Boot Android 8.0 on i.MX6Q SabreSD (MCIMX6Q-SDB) from SD2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Boot Android 8.0 on i.MX6Q SabreSD (MCIMX6Q-SDB) from SD2

1,276 Views
brianptl
Contributor III

Hi All,

I have an i.MX6Q SabreSD EVK (MCIMX6Q-SDB) that came with an SD card. The SD card has the label:

MX6Q-SDB

Android r4.2.2.1

110-77482 C

Using this SD card I am able to boot from Either SD Card 3 (J507 connector), or SD Card 2 (J500 connector) slots.

I have then built a stock AOSP using the instructions in the Android Users Guide ( from android_O8.0.0_1.0.0_docs.tar.gz ).

mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo
chmod a+x ~/bin/repo
export PATH=${PATH}:~/bin

source ~/imx-o8.0.0_1.0.0_ga/imx_android_setup.sh

export MY_ANDROID=~/android_build

cd ${MY_ANDROID}

source build/envsetup.sh

lunch sabresd_6dq-eng

make -j40 2>&1 | tee build-log.txt

I flashed this image to an 8Gb SD card using the mfg tool from (android_O8.0.0_1.0.0_tools.tar.gz).

I can now boot this image from SD3 on the EVK, however I cannot boot this image fully when I try to boot from SD2. It appears to get partially through the Android load, and then hangs without ever showing the Android Desktop. I have attached the logs of the boot.

The default u-boot variables are as follows:

=> printenv
baudrate=115200
board_name=SABRESD
board_rev=MX6Q
bootcmd=boota mmc0
bootdelay=3
ethact=ethernet@02188000
ethaddr=00:00:9f:03:bb:ad
ethprime=eth0
fastboot_dev=mmc0
fdt_high=0xffffffff
fdtcontroladdr=4ef288d8
initrd_high=0xffffffff
loadaddr=0x12000000
soc_type=imx6q
splashpos=m,m

Environment size: 311/8188 bytes

It does boot like this, however the Android users guide has the following:

NOTE
The mmcX value changes depending on the boot mode. These are the correct values:

Header 1Header 2
Hardware portU-Boot device in
software
eMMCmmc2
SD2mmc3
SD3mmc1

If I try to enter the command for SD2 (mmc3) I get the following:

=> setenv bootcmd boota mmc3
=> setenv fastboot_dev mmc3
=> setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=400M init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off androidboot.hardware=freescale cma=384M
=> boot
boota mmc3
MMC Device 3 not found

I don't think this is the issue since it does appear to boot in to Android at least partially with the default u-boot settings.

How do I get my image to boot from SD2? It does partially load, however it looks like it might not be mounting the card correctly perhaps? Do I need to alter u-boot env / u-boot device tree / kernel device tree / something else?

Thanks,

Brian.

Labels (3)
0 Kudos
Reply
2 Replies

865 Views
igorpadykov
NXP Employee
NXP Employee

Hi Brian

issue may be caused by using sd2 by default as wifi (Wi-Fi driver is built in the kernel by default)

so one can try to disable it using sect.4.12 Wi-FI BCM4339 attached Linux Manual.

Configure sd2 as other sabre sd sdhc ports using sect.3.3 MMC/SD/SDIO Host.

Best regards
igor

0 Kudos
Reply

865 Views
brianptl
Contributor III

Hi Igor,

Thank you for your answer. I appear to have this working now. I have done it slightly differently than your answer since I hadn't seen your response until now, but I think you and I are on the same track.

I do think the wifi driver is interfering. My solution was to move this to a different usdhc in the imx6qdl-sabresd.dtsi file. I have removed the entries wifi-host, pm-ignore-notify, cd-post;  from usdhc2 put them in usdhc4. I am not sure if only wifi-host is relevant here, or all three lines. It seemed that removing them would completely would cause the wifi driver to crash. Perhaps the better option is to remove them and disable the driver as you suggest.

&usdhc2 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usdhc2>;
    bus-width = <4>;
    cd-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
    wp-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
    no-1-8-v;
    keep-power-in-suspend;
    enable-sdio-wakeup;
    non-removable;
    status = "okay";
};

<snip>

&usdhc4 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usdhc4>;
    bus-width = <8>;
    non-removable;
    no-1-8-v;
    keep-power-in-suspend;
    wifi-host;
    pm-ignore-notify;
    cd-post;
    status = "okay";
};

The other changes I had to do were related to the address of the usdhc. The addresses are:

USDHC NumberAddress
10x0219_0000
20x0219_4000
30x0219_8000
40x0219_C000

I found the following files had the address of usdhc3 (2198000):

~/android_build/device/fsl/sabresd_6dq/

sepolicy/file_contexts
init.freescale.sd.rc
fstab.freescale.car
fstab-f2fs.freescale
fstab.freescale
ueventd.freescale.rc

These all had reference to the address 2198000. I changed all of these files to have the address 2194000 for SD2. Again, I do not know if they are all relevant.

I now have a working boot.

Edit: It would be good to know how the SD Card that came with the EVK manages to support both SD2 and SD3 at the same time...

Thanks.

0 Kudos
Reply