sd_boot cmd missing in uboot_ls1021atwr_sdcard_ifc.bin

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

sd_boot cmd missing in uboot_ls1021atwr_sdcard_ifc.bin

1,655 Views
jiye
Contributor V

Guys,

I have a standalone ls1021a and external eMMC. I need build a uboot that goes to my eMMC.

I used

flex-builder -c uboot -m ls1021atwr -b sd

to create files under

/build/firmware/u-boot/ls1021atwr:

I then used uboot_ls1021atwr_sdcard_ifc.bin

I tried to flash the bin image into the eMMC using CodeWarrior

I realized that in uboot_ls1021atwr_sdcard_ifc.bin 

bootcmd=run distro_bootcmd; run sd_bootcmd; env exists secureboot && esbc_halt;

there is no sd_bootcmd variable that is defined after it says sd_bootcmd not defined (How to define this please hlep)

From the NXP sd card image I checked the uboot variable says that

sd_bootcmd=echo Trying load from SD ..;mmcinfo && mmc read $load_addr $kernel_addr_sd $kernel_size_sd && env exists secureboot && mmc read $kernelheader_addr_r $kernelhdr_addr_sd $kernelhdr_size_sd && esbc_validate ${kernelheader_addr_r};bootm $load_addr#$board

But does not exist in uboot_ls1021atwr_sdcard_ifc.bin 

(1)How am I able to fix this

(2) How do I know what is the right kernel address I am using:

kernel_addr=0x61000000
kernel_addr_r=0x81000000
kernel_addr_sd=0x8000
kernel_size=0x2800000
kernel_size_sd=0x14000
kernelhdr_addr_sd=0x4000
kernelhdr_size_sd=0x10
kernelheader_addr=0x60800000
kernelheader_addr_r=0x80200000
kernelheader_size=0x40000

(3)How am I able to recompile the uboot to have those no exist variables

0 Kudos
15 Replies

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to CONFIG_EXTRA_ENV_SETTINGS definition in include/configs/ls1021atwr.h.

#ifdef CONFIG_LPUART
#define CONFIG_EXTRA_ENV_SETTINGS

... ...

#else

#define CONFIG_EXTRA_ENV_SETTINGS       \
        "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \
        "initrd_high=0xffffffff\0"      \
        "fdt_high=0xffffffff\0"         \
        "fdt_addr=0x64f00000\0"         \
        "kernel_addr=0x61000000\0"      \
        "kernelheader_addr=0x60800000\0"        \
        "scriptaddr=0x80000000\0"       \
        "scripthdraddr=0x80080000\0"    \
        "fdtheader_addr_r=0x80100000\0" \
        "kernelheader_addr_r=0x80200000\0"      \
        "kernel_addr_r=0x81000000\0"    \
        "kernelheader_size=0x40000\0"   \
        "fdt_addr_r=0x90000000\0"       \
        "ramdisk_addr_r=0xa0000000\0"   \
        "load_addr=0xa0000000\0"        \
        "kernel_size=0x2800000\0"       \
        "kernel_addr_sd=0x8000\0"       \
        "kernel_size_sd=0x14000\0"      \
        "kernelhdr_addr_sd=0x4000\0"            \
        "kernelhdr_size_sd=0x10\0"              \
        BOOTENV                         \

        ... ...

               "sd_bootcmd=echo Trying load from SD ..;"       \
                "mmcinfo && mmc read $load_addr "       \
                "$kernel_addr_sd $kernel_size_sd && "   \
                "env exists secureboot && mmc read $kernelheader_addr_r "               \
                "$kernelhdr_addr_sd $kernelhdr_size_sd "                \
                " && esbc_validate ${kernelheader_addr_r};"     \
                "bootm $load_addr#$board\0"

#endif

Please check your source code whether you defined variable CONFIG_EXTRA_ENV_SETTINGS as the above.

Thanks,

Yiping

0 Kudos

1,400 Views
jiye
Contributor V

Hi Yiping,

I understand that the one you showed me is for ttyS0 but I am using ttyLP0 section as I want to boot from sd card but via lpuart1 serial port

==========================================================================

#ifdef CONFIG_LPUART
#define CONFIG_EXTRA_ENV_SETTINGS       \
        "bootargs=root=/dev/ram0 rw console=ttyLP0,115200\0" \
        "initrd_high=0xffffffff\0"      \
        "fdt_high=0xffffffff\0"         \
        "fdt_addr=0x64f00000\0"         \
        "kernel_addr=0x65000000\0"      \
        "scriptaddr=0x80000000\0"       \
        "scripthdraddr=0x80080000\0"    \
        "fdtheader_addr_r=0x80100000\0" \
        "kernelheader_addr_r=0x80200000\0"      \
        "kernel_addr_r=0x81000000\0"    \
        "fdt_addr_r=0x90000000\0"       \
        "ramdisk_addr_r=0xa0000000\0"   \
        "load_addr=0xa0000000\0"        \
        "kernel_size=0x2800000\0"       \
        "kernel_addr_sd=0x8000\0"       \
        "kernel_size_sd=0x14000\0"      \
        BOOTENV                         \
        "boot_scripts=ls1021atwr_boot.scr\0"    \
        "boot_script_hdr=hdr_ls1021atwr_bs.out\0"       \
                "scan_dev_for_boot_part="       \
                        "part list ${devtype} ${devnum} devplist; "     \
                        "env exists devplist || setenv devplist 1; "    \
                        "for distro_bootpart in ${devplist}; do "       \
                        "if fstype ${devtype} "                         \
                                "${devnum}:${distro_bootpart} "         \
                                "bootfstype; then "                     \
                                "run scan_dev_for_boot; "               \
                        "fi; "                  \
                "done\0"                        \
        "scan_dev_for_boot="                              \
                "echo Scanning ${devtype} "               \
                                "${devnum}:${distro_bootpart}...; "  \
                "for prefix in ${boot_prefixes}; do "     \
                        "run scan_dev_for_scripts; "      \
                "done;"                                   \
                "\0"                                      \
        "boot_a_script="                                  \
                "load ${devtype} ${devnum}:${distro_bootpart} "  \
                        "${scriptaddr} ${prefix}${script}; "    \
                "env exists secureboot && load ${devtype} "     \
                        "${devnum}:${distro_bootpart} "         \
                        "${scripthdraddr} ${prefix}${boot_script_hdr}; " \
                        "env exists secureboot "        \
                        "&& esbc_validate ${scripthdraddr};"    \
                "source ${scriptaddr}\0"          \
        "installer=load mmc 0:2 $load_addr "    \
                "/flex_installer_arm32.itb; "           \
                "bootm $load_addr#ls1021atwr\0" \
        "qspi_bootcmd=echo Trying load from qspi..;"    \
                "sf probe && sf read $load_addr "       \

=========================================================

what changes should I make?

0 Kudos

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Elias Bitbaker,

Please add the following at the end of CONFIG_EXTRA_ENV_SETTINGS  definition.

"sd_bootcmd=echo Trying load from SD ..;"       \
                "mmcinfo && mmc read $load_addr "       \
                "$kernel_addr_sd $kernel_size_sd && "   \
                "env exists secureboot && mmc read $kernelheader_addr_r "               \
                "$kernelhdr_addr_sd $kernelhdr_size_sd "                \
                " && esbc_validate ${kernelheader_addr_r};"     \
                "bootm $load_addr#$board\0"

Thanks,

Yiping

0 Kudos

1,400 Views
jiye
Contributor V

i did all these as you recommended, then recompile the uboot then inject into my img file then I found that the serial port is still printing from the default serial port even though

pastedImage_2.png

the console has been changed to ttyLP0

but in the linux system it still show:

pastedImage_1.png

0 Kudos

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Elias Bitbaker,

Please configure CONFIG_SERIAL_FSL_LPUART in Linux Kernel configuration file.

Thanks,

Yiping

0 Kudos

1,400 Views
jiye
Contributor V

Hi Yiping,

I did this as well

pastedImage_1.png

0 Kudos

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please configure bootargs as the following.

=>setenv  bootargs root=/dev/ram0 rw console=ttyLP0,115200

0 Kudos

1,400 Views
jiye
Contributor V

still the same

I did what you say which was what I did previously.

Still go to serial port uart1 ttyS0.

Then I went to linux to change ls1021atwr_boot.scr to change the console=  from ttyS0 to ttyLP0, then after I reboot

it crashes

pastedImage_1.png

can you tell me what is the content under /boot do ?

pastedImage_2.png

This is the second partition of my SD card but in the rootfs /boot it's empty.

How does this relate to the linux system?

Also if I go to the device I can see:

pastedImage_2.png

does this tell me that the ttyLP0 is not enabled ?

0 Kudos

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

LS1021ATWR  LPUART console setting:

1. J19 and J20 short 1-2.

2. Use rcw: rcw_1000_lpuart.bin.

3. Follow the general UART port setting steps above to install the drivers.

0 Kudos

1,400 Views
jiye
Contributor V

(1)how to apply rcw_1000_lpuart.bin into the SD card?

(2)How to modify the contends of ls1021atwr_boot.src file under /boot

pastedImage_1.png

because in this file it has an argument of console=ttyS0

pastedImage_2.png

this one did not change to LP0 I noticed which might be the cause

0 Kudos

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please modify board/freescale/ls1046ardb/ls1046ardb_rcw_sd.cfg in u-boot source code according to rcw_1000_lpuart.bin.

ls1021atwr_boot.src is only used in secure boot.

0 Kudos

1,400 Views
jiye
Contributor V

I did the RCW changes it's the same thing.

(1)so which part of the image or file tells the CPU which port is going to use to print the console information before loading the kernal and after?

(2)also if my standalone board does not have the eth0,eth1,eth2 PHY interfaces, should I only need to remove these definitions from the packages/linux/linux/arch/arm/boot/dts#  ls1021a.dts file?

(3) Also the rcw_1000_lpuart.bin is still for NOR Flash on the IFC

pastedImage_1.png

If I want one for my SD card version what changes should I make

0 Kudos

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please check whether LPUART works first when you use booting from NOR flash.

0 Kudos

1,400 Views
jiye
Contributor V

do i have to apply lpuart.bin into the NOR flash RCW , if so how do I inject lpuart RCW into NOR flash 

0 Kudos

1,400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please configure RCW[UART_EXT] as 4 for lpuart RCW, please program RCW at 0x60000000 on NOR flash.

0 Kudos