OpenELEC / OpenELEC.tv

OpenELEC - The living room PC for everyone
http://openelec.tv
1.61k stars 883 forks source link

Wandboard support in imx6 project #3653

Closed ghost closed 8 years ago

ghost commented 9 years ago

Hello, I like to see the support of Wandboard in the imx6 project of OpenELEC,

I have started to add this, but I'm block by the u-boot management.

My changed are based on the imx6-final branch from vpeter4. You can look-at this change here : https://github.com/xoddark/OpenELEC.tv/tree/wandboard_support_wip_2

If I install OpenELEC with the create_sdcard script, when I start the wandboard I have nothing on the serial output. If I build u-boot from upstream like in this page : https://eewiki.net/display/linuxonarm/Wandboard#Wandboard-Bootloader:U-Boot, and write u-boot.imx on the sdcard I have this output from u-boot on the serial console :

U-Boot 2015.01-rc2-00086-g38cd8c4-dirty (Nov 30 2014 - 15:05:22)

CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
Reset cause: POR
Board: Wandboard
I2C:   ready
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

auto-detected panel HDMI
Display: HDMI (1024x768)
In:    serial
Out:   serial
Err:   serial
Net:   FEC [PRIME]
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
Checking for: /uEnv.txt ...
reading /uEnv.txt
310 bytes read in 14 ms (21.5 KiB/s)
Loaded environment from /uEnv.txt
Checking if uenvcmd is set ...
Checking for: /boot/uEnv.txt ...
** Invalid partition 3 **
** Invalid partition 4 **
** Invalid partition 5 **
** Invalid partition 6 **
** Invalid partition 7 **
MMC: no card present
SD/MMC found on device 1
Checking for: /uEnv.txt ...
MMC: no card present
** Bad device mmc 1 **
Checking for: /boot/uEnv.txt ...
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 1 **

And the board faile to boot. I'm not very familiar with u-boot, someone have an idea to help me ?

Thank you.

jenkins101 commented 9 years ago

This is old and needs rebasing: #3108

will not work as is!

vpeter4 commented 9 years ago

I don't think your uEnv.txt is correct. Like using fatload and bootz there. This is done from mmcboot. And you need to patch u-boot little more with loading dtb loadfdt=.... /dtbs/${fdt_file} we don't have dtbs folder.

ghost commented 9 years ago

jenkins101: I preffer if it's possible to keep only one project for all imx6 device. vperter4: Do you think it could be possible to update u-boot/package.mk to build u-boot from from differrent source (use upstream u-boot for wandboard, and Solidrun u-boot for cuboxi) ?

I'm not very familiar with the boot operation and configuration. I have take uEnv.txt from Lakka.tv Wandboard project, but perraps it's not a good idea. Why=at do you think it necessary in uEnv.txt ?

vpeter4 commented 9 years ago

Yes, it will be only one imx6 project :) I don't think it is smart to make changes in u-boot package.mk to build different versions. I'm thinking more in the way having u-boot virtual package with dependency for different u-boot versions. But didn't investigate more time on this. For tbs matrix system (and also for udoo system) I add changes to cuboxi version of u-boot. But I think sooner or later we will need solution for this problem (on todo list).

About your uEnv.txt. What is provided is not uEnv.txt but boot.cfg. This one is compiled to a script. Maybe you could use like this

setenv bootargs .......
uenvcmd=fatload mmc 0:1 $loadaddr /KERNEL; fatload mmc 0:1 $fdt_addr /wandboard.dtb; bootz $loadaddr - $fdt_addr 

or just stick with boot.cfg as is.

Update: I think I'm having virtual projects done.

jenkins101 commented 9 years ago

@xoddark I only meant for you to look at that to see what needed to be done.

Hopefully cubox-i u-boot branch will be merged with upstream soon... that would be the best.

ghost commented 9 years ago

@jenkins101: ok thank you. do you know I how can be notified when cubox-i u-boot branch wiil be merged ?

synportack24 commented 9 years ago

I have take uEnv.txt from Lakka.tv Wandboard project, but perraps it's not a good idea.

Thats the way that I was going with things as well. I have a xoddarks branch that I've been toying with as well.

thanks vpeter4 for the heads up.

ghost commented 9 years ago

Hello, small update of my progress.

First I have update my change on top of the vpeter4/imx6-final branche.

Second I have work to have the board booting. For now I build u-boot for wandboard externaly to openelec build. (u-boot-imx from SolidRun don't work for wandboard). If I build u-boot-wandboard_q.imx with folowing https://eewiki.net/display/linuxonarm/Wandboard#Wandboard-Bootloader:U-Boot And move the file in 3rdparty/bootloader/, I can create an sdcard with create_sdcard script from imx6 openelec build. Question: What it's the best method to have a u-boot source would permit to build u-boot version from SolidRun, matrix and Wandboard ?

With this openelec seems to boot on my wandboard quad, but there is no display on hdmi output. The kernel build in OpenELEC imx6 project come from SoldRun and don't have the hdmi management enable in wandboard dtb. Question2: I don't know why should be the best method to add it, add patch in project/imx6/patch/linux or try to integrade patch in SolidRun kernel.

My change can by seen here : https://github.com/xoddark/OpenELEC.tv/tree/wandboard_support_wip_5

I could not work on this project sime time ago, if someone can continue that could be great :).

PS: Thank you vpeter for your help on IRC :)

vpeter4 commented 9 years ago

u-boot: one option is to port required changes for wandboard to "our" u-boot version. I did the same for udoo board successfully. Other option would be to use one newer u-boot for project. But this has to be tested on all boards. Or using more than one u-boot sources for imx6 project. How to do that is to think about (I try to use one virtual package u-boot which has dependency for all required real u-boot's). hdmi output: you need better device tree for wandboard. Kernel used for Lakka project has it so you just need to make a diff and create a patch.

I don't have this board so can help only with tips.

Update: having image to test - check the forum.

shanthisubu50 commented 9 years ago

Thanks for making this happen - great work. I did a build in the last few days from the branch wip_5. u-boot works and boots the kernel, but I also experienced the no display issue. I replaced the dtb file from different build (3.10 wandboard) and I was able to get the display through the HDMI in my wandboard. So far it works well, without any major issue and would like to share my findings:

1) uEnv.txt - the default HDMI settings (1650x1050?) does not have any impact, it goes to 1920x1080 once the openelec/xbmc starts.

1) The biggest issue I had was with the sound, specifically with HDMI. aplay -l shows all the three cards including HDMI, spdif and analog. However, if I tried to play a sample through HDMI (aplay sample.wav), it did not play (error message: "aplay: set params: 1297: unable to install hw params", dmesg: "mxc_hdmi 20e0000.hdmi_video: mxc_hdmi_read_edid HDMI in HDMI mode, failed to config slave dma". The SPDIF worked out well.

The sound seems to be a common issue - I tried to add asound.conf, .asoundrc, but it did not help. Not sure it is to do with my use of dtb files.

3) Struggled with the sound for a while, with XBMC kept switching back to Analog or HDMI as the option, after restart. Did a fresh install, chose SPDIF with a pass through from scratch finally made to work. Tried few restart, so far it is good. bur there is no sound through HDMI.

4) CEC does not seems to work. My wandboard is Rev B, but I have modified the board to overcome the CEC. The CEC used to work with xbmc(Yocto build based on Stephen-Rafin's yocto build), so either the dtb is not correct or something else needs to be fixed.

5) The "add source" does not work consistently.

Other than the above, everything looks good. I am happy to test if there is an update.

SyedAmerGilani commented 9 years ago

i extended the work from @xoddark and @vpeter4 and now have a fully working image with sound and etc i basically only had to change the uEnv slightly and add a kernel patch from https://github.com/CrawX/linux-linaro-stable-mx6 you can see my changes here: https://github.com/SyedAmerGilani/OpenELEC.tv and download a image to try here: https://github.com/SyedAmerGilani/OpenELEC.tv/releases/download/wandboardv1/OpenELEC-imx6.arm-devel-20141228151119-r19885-gd84ab80.img

ghost commented 9 years ago

@SyedAmerGilani : Thank you for continue this work :+1:

@vpeter4 : Do you think this work can be integrated in your imx6-final branch ? And do you think we need other work (in addition to test/bugfix) before have a official build of OpenELEC for wandboard.

Edit: I can prepare a more clean pull request if you want.

PS: Sorry for the particular resolution 1680*1050, juste because I test OpenElec on Wandboard on a monitor than have this resolution ^^.

vpeter4 commented 9 years ago

OpenELEC is very near final 5.0 version. After this my branch will be merged and then support for other systems can be added. But I see some changes for IPU and HDMI which must be clear that they don't interfere with other systems. This needs to be checked with someone who understands the changes.

ghost commented 9 years ago

Ok. Peraps for 5.1 ? :)

synportack24 commented 9 years ago

I just did a pull of SyedAmerGilani's master I take a look at the changes against OpenELEC's IPU and HDMI. Unfurtunatly I'm away from my board so what I can do is limited. ugh.

ghost commented 9 years ago

Hello, I just pushed a v6 https://github.com/xoddark/OpenELEC.tv/tree/wandboard_support_wip_6 This branch contain the imx6-final commit from @vpeter4, my change and change from @SyedAmerGilani. The branch is rebase on top of upstream master.

jpulz commented 9 years ago

@SyedAmerGilani : I donwloaded your image and tried it on my wandboard quad. Everything is running smoth but i found two problems. 1) If there is a microSD card plugged into the second microSD slot, the system will not boot and ends with a recovery console. Message on the serial line is something like "unable to mount root device". If i unplug the second card it boots just fine. I can insert the second card again afterwards and it is recognized and useable. 2) Bluetooth is not working at all. Kodi says "No Bluetooth adapter found". In the kernel messages is some error regarding bluetooth logged.

I don't have the correct error messages for both problems as i'm away from my wandboard.

Will there be a new image with the latest imx6 related changes that hit the official OpenELEC.tv repo lately?

synportack24 commented 9 years ago

I did a build of SyedAmerGilani OpenELEC for my C1 quad. Everything seemed to work just fine apart from the bluetooth. I also tried connecting the board to my TV via HDMI -> DVI and also got nothing to show (HDMI -> HDMI worked just fine). I know that HDMI-> DVI has been problematic there are several forum posts about this over on the wandboard forum as well as one from the old google forum: https://groups.google.com/forum/#!topic/wandboard/eQ3PaEe5uwo

synportack24 commented 9 years ago

I'm using SyedAmerGilani on a C1 wanboard and a libcec-client -l shows that there no devices found. I was wondering if anyone had any luck with this?

ghost commented 9 years ago

I don't have a TV compatible with CEC, so not tested for me.

ElreboCM commented 9 years ago

@xoddark and @SyedAmerGilani: I am trying to bring openElec to RIoTboard. I have managed to adjusted u-boot and the kernel start but gets stuck at [ OK ] Reached target Kodi Mediacenter Interface. with no HDMI output. Was this the same for you before you took another DTB? Did you change anything else apart from the DTB? Looking into the patch for wandboard it seems like you were also changing something with the video driver?

vpeter4 commented 9 years ago

@MCOberle: which kernel exactly are you using?

ElreboCM commented 9 years ago

I have tested openELEC Kernel 5.02 and 5.08. My DTB is from mainline KERNEL 3.19.

ghost commented 9 years ago

@MCOberle : I had the same problem when the screen linked to my board don't support fullHD. For the wandboard, the output screen resolution is hardcoded in the file uEnv-wandboard_x.txt. .

vpeter4 commented 9 years ago

@MCOberle: I would suggest you first to use kernel and device tree from one (verified) source which actually works. Like from this post: branch embest_imx_3.10.17_1.0.0_ga

Don't mix kernel and dtb. Later you can port this dts to kernel used by openelec if you want.

Chris81T commented 9 years ago

Hi, at first thank you all to make it possible to get openelec running at the wandboard quad. I have downloaded months ago an openelec image (development version) for my wandboard and the maintime it works fine. After two, three weeks I need 3 or 5 times to get openelec started.also it is possible, that Every settings are resetted. Normally I wont start to customize the system. My aim is to have a solid running media center.

So can somebody tell me, if there is a newer image of openelec running at the wandboard device? If someone can give a link would really be nice :)

Thank you!

PS: Is it possible that in the near future openelec officially will support the wandboard devices, so we can simply download from the official site directly?

vpeter4 commented 9 years ago

Little birdie told me the reason not including such support is bottom part of http://openelec.tv/.

ElreboCM commented 9 years ago

@vpeter4 The source you are refereing to does not include HDMI output support. Anyway ther is apparently a later version that supports HDMI output. I would then try to decompile the DTB of that version and the DTB of udoo or wandboard and try to compare - would that be the way to go?

ElreboCM commented 9 years ago

@xoddark: The connected device supports fullHD - I have also tried other resolutions but that does not help. I think the problem is the DTB.

ghost commented 9 years ago

@MCOberle Do you use an hdmi -> dvi convertor ? It's can be a source of problem.

stefansaraev commented 9 years ago

Little birdie told me the reason not including such support is bottom part of http://openelec.tv/.

care to explain?

thanks

vpeter4 commented 9 years ago

I think it's self-explaining.

ElreboCM commented 9 years ago

@xoddark I am connecting straight from hdmi port of riotboard to hdmi of my (fullhd) tv.

stefansaraev commented 9 years ago

I think it's self-explaining.

I think it is not. explain or stop spreading nonsense. thanks.

vpeter4 commented 9 years ago

Money of course :-) What else.

stefansaraev commented 9 years ago

what money, can I have some? who pays?

stefansaraev commented 9 years ago

so, you are basicaly saying "a competitor pays openelec team to NOT support other devices" ?

ghost commented 9 years ago

I do not know enough about the organization of the team OpenELEC to judge. But I did not understand and was frustrated by the lack of update (merge or comment) on this pull request : https://github.com/OpenELEC/OpenELEC.tv/pull/3645

ghost commented 9 years ago

Good to see the patch form imx merged last days.

I still hope to integrate Wandboard management in OpenELEC. With my actual version We need different image for different board, which is not ideal. And the actual version of uboot used by OpenELEC is a version from solidRun.

But some work are done to upstream Cuboxi and Humiboard management in uboot. And an update of uboot wandboard management are in progress to use SPL. I like to replace the custom uboot version by the upstream, it's should be ok for Wandboard and Cubox (soon ?), but I don't know if the TBS matrix and the Udoo device have management upstreamed.

Last version of my work to manage multi device in mx6 project : https://github.com/xoddark/OpenELEC.tv/commits/imx6_multi_devices The result is one tar for update, and one image by device (uboot are different). What do you think to have several image file for different imx6 device ? I don't know if it's should be possible to have SPL management for multiple imx6 board (Cuboxi, Wanboard, TBS matrix, udoo, ...)

Thank you. PS: Sorry if my English are not correct ^^, You can correct me, or ask me what I meant.

vpeter4 commented 9 years ago

I don't think we can expect one bootloader which would support all possible devices. Much easier (at least for now) is to have separate images for different systems. And matrix doesn't need image - only tar archive because it is uses MfgTool to transfer image to integrated eMMC modul. Udoo and Matrix works with mainline u-boot 2015.xx (already tested) but there is no support for cuboxi. So we always will have a problem. I port all required changes for udoo and matrix to solidruns u-boot version. That's why for now I don't need separate u-boot version. So if we want to use different u-boot versions for different systems we have another problem - how to use two similar packages at the same time.

ghost commented 9 years ago

@vpeter4 ok for the multiple image. At list one image for all wandboard instead of two is better. For cubox, I don't know if it's already usable, but Fabio Estevam work on upstreaming cubox-i u-boot management. I have to test when I would have a moment.

vpeter4 commented 9 years ago

Lately I add SPL support for udoo. Because I was testing different versions of u-boot I was looking for one simple way of using multiple u-boot versions in single openelec image. So I think on one simple solution (probably not the elegant but it works well). I add another u-boot package (u-boot-udoo) and manually unpack u-boot sources. Package is build at the end from OEM. Created u-boot.imx or SPL/u-boot.img is renamed and copied to original u-boot build folder. When creating final openelec image the correct bootloader is used. One problem solved :)

chewitt commented 8 years ago

I'm closing the ticket due to lack of update and on advice from @vpeter4 who continues to track imx6 efforts on behalf of the OE staff. This does not mean we refuse to add Wandboard in the future, but until bootloader things become more standardised a community build is a better option. Thanks.

vpeter4 commented 8 years ago

Until there is a clear way how to proceed with imx6 project (which kernel, how to combine multiple u-boot's, ..) there is not much to do. But because there is not much imx6 users out there seems this project is mostly in stagnation.