[meta-freescale] Bootstrapping Linux on an unsupported board using Yocto (Linux)

Gary Thomas gary at mlbassoc.com
Wed Apr 29 07:49:37 PDT 2015


On 2015-04-29 08:37, Marco Pensallorto wrote:
> Hi there folks,
>
>   My boss asked me to evaluate the process of tailoring a yocto-based
> Linux distribution to support this iMX6 board:
> https://www.embedded-world.de/en/ausstellerprodukte/embwld15/product-1537794/bf8a1/
> we're using in a commercial project for an important customer.
>
>   At first, I figured I could just get away with it just by using a
> standard supported configuration and then proceed the extra mile from
> there tweaking and fixing as necessary creating extra layers and so
> forth... but it turned out it's waaaay harder than that! I've already
> spent a couple of days on this thing and I could not achieve the board
> to boot properly into Linux.
>
>    At first I tried building for imx6qsabresd:
>
> $ repo init -u https://github.com/Freescale/fsl-community-bsp-platform
> -b fido && repo sync
> $ source ./setup-environment build
> $ bitbake core-image-minimal
>
> .... crunch crunch crunch....
>
> 1. Tried to write the sdcard image but it doesn't even start u-boot
> (no serial output on any port)
> $ sudo dd if=core-image-minimal-imx6qsabresd-20150429122640.rootfs.sdcard
> of=/dev/sdb bs=1M conv=fsync
>
> 2. Tried to bot into u-boot.imx alone. Again, nothing. (no serial output)
> $ sudo dd if=u-boot.imx of=/dev/sdb seek=2 conv=fsync
>
> 3. Tried to boot into very-old-but-working vendor-provided u-boot load
> kernel uImage and DTB from there and boot. Didn't work either, however
> I read that older U-boot versions did not support DTB files so it is
> not clear to me how to bundle together the kernel and the DTB into a
> uImage. Of course it would be much better to be able the yocto version
> of u-boot instead.  Moreover, would a generic dtb work for a different
> piece of hardware anyways?? I am totally stuck here folks and I would
> really appreciate some help on this. Sorry if this looks like a noob
> question. It definitely is :-( Thanks.
>

I'm assuming that the output below is from the manufacturer's U-Boot?

> U-Boot 2009.08-dirty (Feb 03 2015 - 10:50:48)
>
> CPU: Freescale i.MX6 family TO1.5 at 792 MHz
> Thermal sensor with ratio = 183
> Temperature:   39 C, calibration data 0x5844eb69
> mx6q pll1: 792MHz
> mx6q pll2: 528MHz
> mx6q pll3: 480MHz
> mx6q pll8: 50MHz
> ipg clock     : 66000000Hz
> ipg per clock : 66000000Hz
> uart clock    : 80000000Hz
> cspi clock    : 60000000Hz
> ahb clock     : 132000000Hz
> axi clock   : 264000000Hz
> emi_slow clock: 132000000Hz
> ddr clock     : 528000000Hz
> usdhc1 clock  : 198000000Hz
> usdhc2 clock  : 198000000Hz
> usdhc3 clock  : 198000000Hz
> usdhc4 clock  : 198000000Hz
> nfc clock     : 24000000Hz
> Board: i.MX6Q-SABRESD: unknown-board Board: 0x63015 [POR ]
> Boot Device: SD
> I2C:   ready
> DRAM:   2 GB
> MMC:   FSL_USDHC: 0,FSL_USDHC: 1,FSL_USDHC: 2,FSL_USDHC: 3
> *** Warning - bad CRC or MMC, using default environment
>
> In:    serial
> Out:   serial
> Err:   serial
> Found PFUZE100! deviceid=10,revid=21
> Net:   got MAC address from IIM: 00:00:00:00:00:00
> FEC0 [PRIME]
> Hit any key to stop autoboot:  0
>
> MX6Q SABRESD U-Boot > printenv
> bootdelay=3
> baudrate=115200
> ipaddr=192.168.1.103
> serverip=192.168.1.101
> netmask=255.255.255.0
> loadaddr=0x10800000
> rd_loadaddr=(0x1300000)
> netdev=eth0
> ethprime=FEC0
> uboot=u-boot.bin
> kernel=uImage
> nfsroot=/opt/eldk/arm
> bootargs_base=setenv bootargs console=ttymxc2,115200

This tells you that this board is set up to use UART3 as its main
console, which does not match the defaults for the SabreSD (UART2)

If you want to use the FSLC versions, you'll need to figure out
what the manufacturer has changed.  For example, you'll need to
tailor the configuration in U-Boot just to get it to use UART3
instead of UART2.

If it were me, I'd start with the base FSLC trees (kernel, u-boot)
and port to your board separately.  Once you get those components
going, you can figure out how to integrate with the Yocto based
repos.  You'll definitely want to have the manufacturer's board
documentation available, possibly alongside that of whichever
standard board you chose to use (the one closest in form and
functionality).

It's not hard, just a bit tedious.

> bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs ip=dhcp
> nfsroot=${serverip}:${nfsroot},v3,tcp
> bootcmd_net=run bootargs_base bootargs_nfs; tftpboot ${loadaddr}
> ${kernel}; bootm
> bootargs_mmc=setenv bootargs ${bootargs} root=/dev/mmcblk0p1 rootwait
> rw video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666
> video=mxcfb0:dev=hdmi,1920x1080M at 60,if=RGB24
> bootcmd_mmc=run bootargs_base bootargs_mmc; mmc dev 0; mmc read
> ${loadaddr} 0x800 0x2000; bootm
> bootcmd=run bootcmd_mmc
> stdin=serial
> stdout=serial
> stderr=serial
> ethact=FEC0
>
> Environment size: 784/8188 bytes
> MX6Q SABRESD U-Boot >
>
> I've created a FAT partition, put uImage and a DTB file there, loaded
> into 2009 U-Boot Ok but it won't boot. It gets stuck just after
> verifying the uImage checksum. Thought this could be related to the
> missing/wrong DTB.
>
> Addendum: tried a few more MACHINES (imx6dlsabresd, imx6qsabrelite,
> imx6qsabresd, nitrogen6x). Still no pie :-(
>

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


More information about the meta-freescale mailing list