本人从事PPC/ARM Linux/vxworks 开发多年,各类问题欢迎进群讨论:QQ群:245079182。
#############################################
板子最初u-boot环境变量
#############################################
=> printenv
arch=arm
baudrate=115200
board=ls1021atwr
board_name=ls1021atwr
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; env exists secureboot && load ${devtype} ${devnum}:${distro_bootpart} ${scripthdraddr} ${prefix}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_pci_enum=pci enum
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_script_hdr=hdr_ls1021atwr_bs.out
boot_scripts=ls1021atwr_boot.scr
boot_targets=mmc0 usb0
bootargs=root=/dev/mmcblk0p2 rw rootdelay=5 console=,
bootcmd=setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=$consoledev,\
$baudrate;mmcinfo;ext2load mmc 0:2 $loadaddr /boot/$bootfile;ext2load mmc 0:2 $fdtaddr /boot/\
$fdtfile;bootm $loadaddr - $fdtaddr
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=3
cpu=armv7
distro_bootcmd=setenv scsi_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
eth1addr=00:04:9F:05:89:1B
eth2addr=00:04:9F:05:89:1C
ethact=eTSEC1
ethaddr=00:04:9F:05:89:1A
ethprime=eTSEC1
fdt_addr=0x64f00000
fdt_addr_r=0x90000000
fdt_high=0xffffffff
fdtcontroladdr=beb11d94
fdtheader_addr_r=0x80100000
initrd_high=0xffffffff
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
load_addr=0xa0000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
nor_bootcmd=echo Trying load from nor..;cp.b $kernel_addr $load_addr $kernel_size; env exists secureboot && cp.b $kernelheader_addr $kernelheader_addr_r $kernelheader_size && esbc_validated
qspi_bootcmd=echo Trying load from qspi..;sf probe && sf read $load_addr $kernel_addr $kernel_size; env exists secureboot && sf read $kernelheader_addr_r $kernelheader_addr $kernelheader_sd
ramdisk_addr_r=0xa0000000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_scripts; done;
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_booe
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do ife
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_se
scriptaddr=0x80000000
scripthdraddr=0x80080000
scsi_boot=run scsi_init; if scsi dev ${devnum}; then setenv devtype scsi; run scan_dev_for_boot_part; fi
scsi_init=if ${scsi_need_init}; then setenv scsi_need_init false; scsi scan; fi
scsidevs=0
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 $kernelhdd
soc=ls102xa
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
vendor=freescale
Environment size: 4813/131068 bytes
tftp 83000000 uImage
tftp 8f000000 uImage-ls1021a-twr.dtb
bootm 83000000 - 8f000000
########################################
加载网络文件系统
########################################
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
setenv bootargs root=/dev/nfs rw nfsroot=$serverip:/tftpboot/sysrootfs/ ip=$ipaddr:$serverip:192.168.0.14:255.255.255.0::eth0:off console=ttyS0,115200
setenv netdev eth1
setenv nfsboot "run nfsargs;tftp 83000000 uImage;tftp 8f000000 ls1021a-twr.dtb;bootm 83000000 - 8f000000";
run nfsboot
######
加载NFS文件系统各种错误
####
1. 加载卡死
fsl-gianfar soc:ethernet@2d10000 eth0: Link is Up - 1Gbps/Full - flow control rx/tx
IP-Config: Complete:
device=eth0, hwaddr=00:04:9f:05:89:1a, ipaddr=192.168.0.206, mask=255.255.255.0, gw=192.168.0.14
host=192.168.0.206, domain=, nis-domain=(none)
bootserver=192.168.0.14, rootserver=192.168.0.14, rootpath=
ALSA device list:
#0: 2b50000.sai-sgtl5000
卡在这里不动了
2. 又卡死不动了,位置不同
修改sysrootfs 文件系统权限后解决
/etc/init.d/rc: /etc/rcS.d/S38dmesg.sh: line 17: can't create /var/log/dmesg: nonexistent directory
hostname: sethostname: Operation not permitted
chmod: /dev/ttya0: Operation not permitted
chmod: /dev/ttya1: Operation not permitted
chmod: /dev/ttya2: Operation not permitted
chmod: /dev/ttya3: Operation not permitted
chmod: /dev/ttya4: Operation not permitted
chmod: /dev/ttya5: Operation not permitted
chmod: /dev/ttya6: Operation not permitted
chmod: /dev/ttya7: Operation not permitted
chmod: /dev/ttya8: Operation not permitted
chmod: /dev/ttya9: Operation not permitted
chmod: /dev/ttyaa: Operation not permitted
chmod: /dev/ttyab: Operation not permitted
########################################
网络加载文件,暂时不用网络文件系统
########################################
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
setenv nfsboot "tftp 83000000 uImage;tftp 88000000 fsl-image-minimal-ls1021atwr-20190528091718.rootfs.ext2.gz.u-boot;tftp 8f000000 ls1021a-twr.dtb;bootm 83000000 88000000 8f000000"
run nfsboot
启动后时间不太对
Linux ls1021atwr 4.1.8-rt8+ #1 SMP Mon May 27 14:12:20 CST 2019 armv7l GNU/Linux
##############################
单独编译内核
##############################
cd /work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr
source environment-setup-cortexa7hf-vfp-neon-fsl-linux-gnueabi
cd /work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/linux_src/git
make uImage LOADADDR=83000000
cd /work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/linux_src/git/arch/arm/boot
cp uImage /tftpboot
#######################
dtb 需要手动编译
#######################
cd /work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/linux_src/git/scripts
dtc -f -b 0 -p 1024 -I dts -O dtb -o ../arch/arm/boot/dts/ls1021a-twr.dtb ../arch/arm/boot/dts/ls1021a-twr.dts
cd ../../
>>>>>>>>>>用dtc工具编译,有语法错误,暂时没解决,直接改用make 编译生成dtb,OK
cd /work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/linux_src/git/
make ls1021a-twr.dtb
##############################################
kernel编译时间的问题
##############################################
文件没修改,多次编译,网络加载后,uname -a 的时间一直不变,我修改了网卡驱动的内容,然后再编译,再加载后时间就正常了
u-boot测试
u-boot识别到SD 卡
=> mmc info
Device: FSL_SDHC
Manufacturer ID: 3
OEM: 5344
Name: SD128
Tran Speed: 25000000
Rd Block Len: 512
SD version 2.0
High Capacity: No
Capacity: 120.1 MiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
########
分区情况
#######
=> mmc part
Partition Map for MMC device 0 -- Partition Type: DOS
Part Start Sector Num Sectors UUID Type
1 63 245953 0009e67c-01 06 Boot
=>
看到设备树的配置是disabled
esdhc: esdhc@1560000 {
compatible = "fsl,ls1021a-esdhc", "fsl,esdhc";
reg = <0x0 0x1560000 0x0 0x10000>;
interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <0>;
voltage-ranges = <1800 1800 3300 3300>;
sdhci,auto-cmd12;
big-endian;
bus-width = <4>;
rcpm-wakeup = <&rcpm 0x00000080 0x0>;
status = "disabled";
};
sata: sata@3200000 {
compatible = "fsl,ls1021a-ahci";
reg = <0x0 0x3200000 0x0 0x10000>,
<0x0 0x20220520 0x0 0x4>;
reg-names = "ahci", "sata-ecc";
interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clockgen 4 1>;
status = "disabled";
};
把上述状态修改为okay之后内核启动SD 有不一样
[ 1.668542] sdhci: Secure Digital Host Controller Interface driver
[ 1.673386] sdhci: Copyright(c) Pierre Ossman
[ 1.676420] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.681947] sdhci-esdhc 1560000.esdhc: Looking up vmmc-supply from device tree
[ 1.681955] sdhci-esdhc 1560000.esdhc: Looking up vmmc-supply property in node /soc/esdhc@1560000 failed
[ 1.681962] sdhci-esdhc 1560000.esdhc: Looking up vqmmc-supply from device tree
[ 1.681969] sdhci-esdhc 1560000.esdhc: Looking up vqmmc-supply property in node /soc/esdhc@1560000 failed
[ 1.681975] sdhci-esdhc 1560000.esdhc: No vmmc regulator found
[ 1.686474] sdhci-esdhc 1560000.esdhc: No vqmmc regulator found
[ 1.726540] mmc0: SDHCI controller on 1560000.esdhc [1560000.esdhc] using ADMA 64-bit
mount 能看到mmc
/dev/mmcblk0p1 on /run/media/mmcblk0p1 type vfat (rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
看到120M SD 卡
root@ls1021atwr:/run/media/mmcblk0p1# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 12.4M 8.1M 3.6M 69% /
devtmpfs 502.8M 4.0K 502.8M 0% /dev
tmpfs 504.6M 120.0K 504.5M 0% /run
tmpfs 504.6M 60.0K 504.6M 0% /var/volatile
'/dev/mmcblk0p1 119.8M 0 119.8M 0% /run/media/mmcblk0p1
#####################
u-boot 从SD 卡启动
#####################
setenv bootfile uImage
setenv fdtfile ls1021a-twr.dtb
setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p1 rw rootdelay=5 console=$consoledev,
$baudrate;mmcinfo;ext2load mmc 0:1 $loadaddr /boot/$bootfile;ext2load mmc 0:2 $fdtaddr /boot/$fdtfile;bootm $loadaddr - $fdtaddr'
编译u-boot
选择ls1021atwr_sdcard_qspi_config 选项
编译完成后生成u-boot-with-spl-pbl.bin ,直接烧到SD卡,然后RCW源选择SD卡,即可以启动
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 u-boot-with-spl-pbl.bin
mmc write 82000000 8 800
内核启动后将u-boot-with-spl-pbl-sd.bin(不知如何生成的!!!!!!!!)烧入
dd if=u-boot-with-spl-pbl.bin of=/dev/sdb bs=512 seek=8
环境变量保存到MMC
=> setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
=> saveenv
Saving Environment to MMC...
Writing to MMC(0)... done
=>
##########################
成功启动
SW2 设置 00100111
注意此时RCW 源不要把QSPI置上。
##########################
可以看到两个u-boot的时间相同的,确实是从SD卡启动的
U-Boot SPL 2016.012.0+ga9b437f (Jun 04 2019 - 11:08:31)
Trying to boot from MMC
U-Boot 2016.012.0+ga9b437f (Jun 04 2019 - 11:08:31 +0800)
CPU: Freescale LayerScape LS1021E, Version: 2.0, (0x87081120)
Clock Configuration:
CPU0(ARMV7):1000 MHz,
Bus:300 MHz, DDR:800 MHz (1600 MT/s data rate),
Reset Configuration Word (RCW):
00000000: 0608000a 00000000 00000000 00000000
00000010: 30000000 00007900 60040a00 21046000
00000020: 00000000 00000000 00000000 20000000
00000030: 20024800 881b7340 00000000 00000000
I2C: ready
Model: LS1021A TWR Board
Board: LS1021ATWR
DRAM: 1 GiB
Using SERDES1 Protocol: 48 (0x30)
MMC: FSL_SDHC: 0
*** Warning - bad CRC, using default environment
EEPROM: NXID v1
PCIe1: Root Complex no link, regs @ 0x3400000
PCIe2: disabled
In: serial
Out: serial
Err: serial
SEC0: RNG instantiated
SATA link 0 timeout.
AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc
Found 0 device(s).
SCSI: Net: eTSEC1 is in sgmii mode.
eTSEC2 is in sgmii mode.
eTSEC1 [PRIME], eTSEC2, eTSEC3
######################
U-BOOT 从nor flash启动
######################
U-Boot 2017.11-g00cde47 (Mar 22 2018 - 17:46:21 +0800)
CPU: Freescale LayerScape LS1021E, Version: 2.0, (0x87081120)
Clock Configuration:
CPU0(ARMV7):1200 MHz,
Bus:300 MHz, DDR:800 MHz (1600 MT/s data rate),
Reset Configuration Word (RCW):
00000000: 0608000c 00000000 00000000 00000000
00000010: 30000000 00007900 e0025a00 21046000
00000020: 00000000 00000000 00000000 18000000
00000030: 00080000 481b7340 00000000 00000000
Model: LS1021A TWR Board
Board: LS1021ATWR
CPLD: V3.3
PCBA: V2.0
VBank: 1
I2C: ready
DRAM: 1 GiB
Using SERDES1 Protocol: 48 (0x30)
Firmware 'Microcode version 0.0.1 for P1021 r1.0' for 1021 V1.0
QE: uploading microcode 'Microcode for P1021 r1.0' version 0.0.1
Flash: 128 MiB
MMC: FSL_SDHC: 0
EEPROM: NXID v1
In: serial
Out: serial
Err: serial
SEC0: RNG instantiated
SATA link 0 timeout.
AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc
Found 0 device(s).
SCSI: Net: eTSEC1 is in sgmii mode.
eTSEC2 is in sgmii mode.
PCIe0: pcie@3400000 Root Complex: no link
PCIe1: pcie@3500000 disabled
eTSEC1 [PRIME], eTSEC2, eTSEC3
Hit any key to stop autoboot: 0
查看nor flash的RCW 位置
=> md.b 60000000 64
60000000: aa 55 aa 55 01 ee 01 00 06 08 00 0c 00 00 00 00 .U.U............
60000010: 00 00 00 00 00 00 00 00 30 00 00 00 00 00 79 00 ........0.....y.
60000020: e0 02 5a 00 21 04 60 00 00 00 00 00 00 00 00 00 ..Z.!.`.........
60000030: 00 00 00 00 18 00 00 00 00 08 00 00 48 1b 73 40 ............H.s@
60000040: 00 00 00 00 00 00 00 00 09 57 02 00 ff ff ff ff .........W......
60000050: 09 ee 02 00 60 10 00 00 09 ea 08 5c 00 50 28 80 ....`......\.P(.
60000060: 09 57 01 58
查看u-boot image 的内容
=> md.b 60100000 128
60100000: b8 00 00 ea 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 ................
60100010: 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 ................
60100020: 60 00 10 60 c0 00 10 60 20 01 10 60 80 01 10 60 `..`...` ..`...`
60100030: e0 01 10 60 40 02 10 60 a0 02 10 60 ef be ad de ...`@..`...`....
60100040: de c0 ad 0b 00 f0 20 e3 00 f0 20 e3 00 f0 20 e3 ...... ... ... .
60100050: 00 f0 20 e3 00 f0 20 e3 00 f0 20 e3 00 f0 20 e3 .. ... ... ... .
60100060: 28 d0 1f e5 00 e0 8d e5 00 e0 4f e1 04 e0 8d e5 (.........O.....
60100070: 13 d0 a0 e3 0d f0 69 e1 0f e0 a0 e1 0e f0 b0 e1 ......i.........
60100080: 48 d0 4d e2 ff 1f 8d e8 50 20 1f e5 0c 00 92 e8 H.M.....P ......
60100090: 48 00 8d e2 34 50 8d e2 0e 10 a0 e1 0f 00 85 e8 H...4P..........
601000a0: 0d 00 a0 e1 9b 08 00 eb 00 f0 20 e3 00 f0 20 e3 .......... ... .
601000b0: 00 f0 20 e3 00 f0 20 e3 00 f0 20 e3 00 f0 20 e3 .. ... ... ... .
601000c0: 88 d0 1f e5 00 e0 8d e5 00 e0 4f e1 04 e0 8d e5 ..........O.....
601000d0: 13 d0 a0 e3 0d f0 69 e1 0f e0 a0 e1 0e f0 b0 e1 ......i.........
601000e0: 48 d0 4d e2 ff 1f 8d e8 b0 20 1f e5 0c 00 92 e8 H.M...... ......
601000f0: 48 00 8d e2 34 50 8d e2 0e 10 a0 e1 0f 00 85 e8 H...4P..........
60100100: 0d 00 a0 e1 8f 08 00 eb 00 f0 20 e3 00 f0 20 e3 .......... ... .
60100110: 00 f0 20 e3 00 f0 20 e3 00 f0 20 e3 00 f0 20 e3 .. ... ... ... .
60100120: e8 d0 1f e5 00 e0 8d e5 ........
=>
######################
umount 用法
######################
# cp uImage and uImage.dtb to /temp/boot folder
# umount /temp
##############################################
内核功能测试
##############################################
USB 测试
#####################
U盘测试
#####################
插入U盘
root@ls1021atwr:~# usb 1-1.2: new high-speed USB device number 3 using xhci-hcd
usb-storage 1-1.2:1.0: USB Mass Storage device detected
scsi host1: usb-storage 1-1.2:1.0
scsi 1:0:0:0: Direct-Access PNY Lovely Attache 0.00 PQ: 0 ANSI: 2
sd 1:0:0:0: Attached scsi generic sg0 type 0
sd 1:0:0:0: [sda] 7892040 512-byte logical blocks: (4.04 GB/3.76 GiB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Asking for cache data failed
sd 1:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sd 1:0:0:0: [sda] Attached SCSI removable disk
root@ls1021atwr:~# mount
192.168.0.14:/tftpboot/sysrootfs/ on / type nfs (rw,relatime,vers=2,rsize=4096,wsize=4096,namlen=255,hard,nolock,proto=udp,timeo=11,retrans=3,sec=sys,mountaddr=192.168.0.14,mountvers=1,mou)
devtmpfs on /dev type devtmpfs (rw,relatime,size=516632k,nr_inodes=129158,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /var/volatile type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
/dev/sda1 on /run/media/sda1 type vfat (rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
############
fdisk -l
#############
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 691968 7892039 7200072 3.4G b W95 FAT32
查看U盘内容
root@ls1021atwr:/run/media/sda1# ls
?? PCIE????.ppt bmp211_?????.txt vxworks7_PCI ????.doc
????????.doc PCIE???????.docx kernel-source_????lxd?????_20190124.tar.gz zyhd-20190308.zip
???????_??.doc PCIE???????????.doc kernel_make.sh.tar.gz zyhd-20190309.zip
BMP401_1_0_0 PCIE???????????111.doc stm32f4 zyhd_??MV3082??????-20180420.zip
KW902.rar System Volume Information tftpfile
Linux PCIE_MSI??.doc app_supported_ioctl_20190312 vsbE500mc_phy???OK_20171009.rar
PCI?? bmp211_????.doc vxWorks7?????? (???).docx
拔掉U盘
root@ls1021atwr:/run/media/sda1# usb 1-1.2: USB disconnect, device number 3
FAT-fs (sda1): FAT read failed (blocknr 2352)
FAT-fs (sda1): Directory bread(block 16384) failed
FAT-fs (sda1): Directory bread(block 16385) failed
FAT-fs (sda1): Directory bread(block 16386) failed
FAT-fs (sda1): Directory bread(block 16387) failed
FAT-fs (sda1): Directory bread(block 16388) failed
FAT-fs (sda1): Directory bread(block 16389) failed
FAT-fs (sda1): Directory bread(block 16390) failed
FAT-fs (sda1): Directory bread(block 16391) failed
FAT-fs (sda1): Directory bread(block 16384) failed
FAT-fs (sda1): Directory bread(block 16385) failed
FAT-fs (sda1): FAT read failed (blocknr 2352)
##############################################
norflash 测试
##############################################
setenv bootargs root=/dev/mtdblock4 rootfstype=jffs2 rwconsole=ttyS0,115200
再boot ,内核起不来,卡在
Loading Kernel Image ... OK
Using Device Tree in place at 90000000, end 90007593
Starting kernel ...
擦除一个分区的所有内容
flash_eraseall -j /dev/mtd2
mount -t jffs2 /dev/mtdblock9 /mnt
挂在失败,分区不干净,重新格式化,再挂载
mkfs.vfat /dev/mtdblock9
结论 : 格式化之后一把挂上去了
root@ls1021atwr:~# mount -t jffs2 /dev/mtdblock9 /mnt
root@ls1021atwr:~# cd mnt
-sh: cd: can't cd to mnt
root@ls1021atwr:~# cd /mnt
root@ls1021atwr:/mnt# ls
upper work
root@ls1021atwr:/mnt#
新建一个目录libin
重启设备后,重新挂载此分区libin目录仍然在,说明该次写入确实是正确的
##############################################
QSPI启动u-boot
##############################################
U-Boot 2016.092.0+g199df35 (Nov 20 2016 - 12:55:17 +0800)
CPU: Freescale LayerScape LS1021E, Version: 2.0, (0x87081120)
Clock Configuration:
CPU0(ARMV7):1200 MHz,
Bus:300 MHz, DDR:800 MHz (1600 MT/s data rate),
Reset Configuration Word (RCW):
00000000: 0608000c 00000000 00000000 00000000
00000010: 30000000 00007900 40025a00 21046000
00000020: 00000000 00000000 00000000 20000000
00000030: 20024800 881b7540 00000000 00000000
Model: LS1021A TWR Board
Board: LS1021ATWR
I2C: ready
DRAM: 1 GiB
Using SERDES1 Protocol: 48 (0x30)
MMC: FSL_SDHC: 0
SF: Detected N25Q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
EEPROM: NXID v1
In: serial
Out: serial
Err: serial
SEC0: RNG instantiated
SATA link 0 timeout.
AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc
Found 0 device(s).
SCSI: Net: eTSEC1 is in sgmii mode.
eTSEC2 is in sgmii mode.
PCIe0: pcie@3400000 Root Complex: no link
PCIe1: pcie@3500000 disabled
eTSEC1 [PRIME], eTSEC2, eTSEC3
更新QSPI启动的u-boot.bin
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 81000000 rcw_1000_qspiboot_swap.bin;
sf erase 0 +$filesize;
sf write 81000000 0 $filesize
tftp 82000000 u-boot-dtb.bin;
sf erase 10000 +$filesize;
sf write 82000000 10000 $filesize
注意擦除命令的写法
sf erase 0 +0x70
sf erase 0 0x70 =====>>>>错误!!!!!
sf probe
sf read 0x81000000 0 256
md 0x81000000 256
sf probe
sf read 0x82000000 0 256
md.b 0x82000000 64
这个文件烧到QSPI FLASH 试试 ======> 结论:无法启动
u-boot-sdcard-qspi.bin
擦除起始512K 位置 0x80000
sf erase 0 +0x80000;
tftp 81000000 u-boot-sdcard-qspi.bin;
从NOR 启动,写入SD卡中去
mmc write 81000000 0x900 0x800
tftp 81000000 rcw_1200_qspiboot_swap.bin
mmc write 81000000 0x900 0x100
文件大小
tftp 81000000 u-boot-sdcard-qspi.bin;
Speed: 1000, full duplex
Using eTSEC1 device
TFTP from server 192.168.0.14; our IP address is 192.168.0.206
Filename 'u-boot-sdcard-qspi.bin'.
Load address: 0x81000000
Loading: ########################################
2.5 MiB/s
done
Bytes transferred = 574606 (8c48e hex)
写入flash
sf write 0x81000000 0 0x8c48e
############################
在flash 0x10000 处 写入 u-boot-dtb.bin
############################
tftp 81000000 u-boot-dtb.bin;
Load address: 0x81000000
Loading: ###############################
2.4 MiB/s
done
Bytes transferred = 454614 (6efd6 hex)
mmc write 81000000 0x900 0x800
mmc write 81000000 0x1000 0x800
sf erase 10000 +0x6efd6
########################
0x0 处写入rcw_swap.bin
##########################
rcw_1000_qspiboot_swap.bin
tftp 81000000 rcw_1200_qspiboot_swap.bin
Load address: 0x81000000
Loading: #
27.3 KiB/s
done
Bytes transferred = 112 (70 hex)
##################
按照SDK 搞法swap
#################
1.找到byte_swap.tcl,拷贝到u-boot目录,顺便把yocoto编译生成的rcw也拷贝u-boot目录
root@test:/work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr# find ./ -name byte_swap.tcl
./tmp/sysroots/x86_64-linux/usr/bin/byte_swap.tcl
./tmp/work/x86_64-linux/change-file-endianess-native/1.0-r0/sysroot-destdir/work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/tmp/sysroots/x86_64-linux/usr/bin/byte_swap.tcl
./tmp/work/ls1021atwr-fsl-linux-gnueabi/rcw/git-r0/git/ls1021aqds/byte_swap.tcl
./tmp/work/ls1021atwr-fsl-linux-gnueabi/rcw/git-r0/git/ls1043aqds/byte_swap.tcl
2.顺序交换,看看两个文件有什么不同
root@test:/work/QorIQ-SDK-V2.0-20160527-yocto/build_ls1021atwr/u-boot-src/git/tools# tclsh byte_swap.tcl ../rcw/SSR_PNS_30/rcw_1000.bin rcw_1000_swap.bin 8
../rcw/SSR_PNS_30/rcw_1000.bin rcw_1000_swap.bin 8
#####################
测试u-boot-sdcard-qspi_swap.bin 测试通过
#####################
tftp 81000000 u-boot-sdcard-qspi_swap.bin;
mmc write 81000000 0x900 0x800
查看下当前QSPI FLASH里面的内容
=> sf probe
SF: Detected N25Q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
=> sf read 81000000 0 10000
device 0 offset 0x0, size 0x10000
SF: 65536 bytes @ 0x0 Read: OK
=> md.b 81000000 128
81000000: 00 01 ee 01 55 aa 55 aa 00 00 00 00 0a 00 08 06 ....U.U.........
81000010: 00 00 00 00 00 00 00 00 00 79 00 00 00 00 00 30 .........y.....0
81000020: 00 60 04 21 00 0a 04 60 00 00 00 00 00 00 00 00 .`.!...`........
81000030: 00 00 00 20 00 00 00 00 40 73 1b 88 00 48 02 20 ... ....@s...H.
81000040: 00 00 00 00 00 00 00 00 ff ff ff ff 00 02 57 09 ..............W.
81000050: 00 03 00 00 58 01 57 09 00 73 f4 21 7c 00 40 89 ....X.W..s.!|.@.
81000060: 00 00 00 10 00 02 ee 09 00 10 00 00 58 01 57 09 ............X.W.
81000070: ff ff 0f 00 c0 00 61 09 ea 00 00 16 00 00 00 81 ......a.........
81000080: e5 9f f0 14 e5 9f f0 14 e5 9f f0 14 e5 9f f0 14 ................
81000090: e5 9f f0 14 e5 9f f0 14 10 00 00 40 e5 9f f0 14 ...........@....
810000a0: 10 00 00 40 10 00 00 40 10 00 00 40 10 00 00 40 ...@...@...@...@
810000b0: 10 00 00 40 10 00 00 40 40 00 00 81 de ad be ef ...@...@@.......
810000c0: e3 20 f0 00 eb ff ff fe e3 20 f0 00 e3 20 f0 00 . ....... ... ..
810000d0: e3 20 f0 00 e3 20 f0 00 e3 20 f0 00 e3 20 f0 00 . ... ... ... ..
810000e0: e1 0f 00 00 ea 00 00 10 e3 31 00 1a e2 00 10 1f .........1......
810000f0: 13 80 00 13 13 c0 00 1f e1 29 f0 00 e3 80 00 c0 .........)......
81000100: ee 11 0f 10 80 00 00 81 ee 01 0f 10 e3 c0 0a 02 ................
81000110: ee 0c 0f 10 e5 9f 00 6c ee 07 0f 15 eb 00 01 10 .......l........
81000120: ee 07 0f 95 ee 07 0f 9a
#######################################################
0x1000 处开始存放u-boot,与SDK不符有点不理解
#######################################################
=> sf probe
SF: Detected N25Q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
=> sf read 81000000 1000 100000
device 0 offset 0x1000, size 0x100000
SF: 1048576 bytes @ 0x1000 Read: OK
=> md 81000000
81000000: 0c1093e5 080093e5 080081e5 0c1080e5 ................
81000010: 041083e5 011082e3 b4319fe5 08308ee5 ..........1...0.
81000020: 81000ec0 003093e5 7080bd38 030052e1 ......0.8..p.R..
81000030: 7040bde8 a8319fe5 a3ffffea 000093e5 ..@p..1.........
81000040: 044085e5 000051e3 0900001a 0c10a011 ..@..Q..........
81000050: 08c08ee2 080010e5 002082e0 033060e0 .......... ..`0.
81000060: 0c0050e1 080093e5 0cc09315 81000f00 .P..............
81000070: 0cc08015 0110a003 040085e0 08008c15 ................
81000080: 010010e3 040090e5 000051e3 1000001a .........Q......
81000090: 080095e5 042082e0 38c19fe5 0900001a ...... ....8....
810000a0: 040050e1 08408ce2 81000f40 0500001a .P....@.@.......
810000b0: 0110a0e3 14308ce5 0c0083e5 10308ce5 ......0.......0.
810000c0: 020000ea 080083e5 0cc080e5 0cc095e5 ................
810000d0: 000051e3 08008ce5 040083e5 010082e3 .Q..............
810000e0: 7080bd18 022083e7 0c00002a 020c52e3 ...p.. .*....R..
810000f0: a221a0e1 81000f80 01c0a0e3 04009ee5 ..!.............
=>
##################################################################
重新恢复的QSPI启动,CPU的频率为1000HZ,原demo板程序为1200Mhz
##################################################################
发现一个现象 :虽然是从QSPI启动的,但是一开始还是从SD卡启动,SPL加载
SD卡中的映像,然后从QSPI启动,拔掉SD卡后,QSPI也无法启动
U-Boot SPL 2016.012.0+ga9b437f (May 27 2019 - 11:26:58)
Trying to boot from MMC
U-Boot 2016.012.0+ga9b437f (Jun 04 2019 - 11:08:31 +0800)
CPU: Freescale LayerScape LS1021E, Version: 2.0, (0x87081120)
Clock Configuration:
CPU0(ARMV7):1000 MHz,
Bus:300 MHz, DDR:800 MHz (1600 MT/s data rate),
Reset Configuration Word (RCW):
00000000: 0608000a 00000000 00000000 00000000
00000010: 30000000 00007900 60040a00 21046000
00000020: 00000000 00000000 00000000 20000000
00000030: 20024800 881b7340 00000000 00000000
I2C: ready
Model: LS1021A TWR Board
Board: LS1021ATWR
DRAM: 1 GiB
Using SERDES1 Protocol: 48 (0x30)
MMC: FSL_SDHC: 0
EEPROM: NXID v1
PCIe1: Root Complex no link, regs @ 0x3400000
PCIe2: disabled
In: serial
Out: serial
Err: serial
SEC0: RNG instantiated
SATA link 0 timeout.
AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc
Found 0 device(s).
SCSI: Net: eTSEC1 is in sgmii mode.
eTSEC2 is in sgmii mode.
eTSEC1 [PRIME], eTSEC2, eTSEC3
>>>>>>>>>>TFTP 获取文件失败,但是RCW 擦除和烧写还是执行了,RCW 被我搞坏了>>>>>>>>>>>
命令应该一个一个的来
===================网络不行,更新不了,还是要解决QSPI/SD 启动后网口不通的问题===============
准备回复QSPI启动,把数据放到SD卡0x9000 存储rcw
rcw_1000_qspiboot_swap.bin
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 81000000 rcw_1000_qspiboot_swap.bin;
mmc write 81000000 0x900 0x100
sf write 82000000 0 0x70
#####################
QSPI启动时的RCW
#####################
Reset Configuration Word (RCW):
00000000: 0608000c 00000000 00000000 00000000
00000010: 30000000 00007900 40025a00 21046000
00000020: 00000000 00000000 00000000 20000000
00000030: 20024800 881b7540 00000000 00000000
NOR FLASH启动时的RCW
Reset Configuration Word (RCW):
00000000: 0608000c 00000000 00000000 00000000
00000010: 30000000 00007900 e0025a00 21046000
00000020: 00000000 00000000 00000000 18000000
00000030: 00080000 481b7340 00000000 00000000
Model: LS1021A TWR Board
从SD启动时的RCW
00000000: 0608000a 00000000 00000000 00000000
00000010: 30000000 00007900 60040a00 21046000
00000020: 00000000 00000000 00000000 20000000
00000030: 20024800 881b7340 00000000 00000000
比较过程 :
1.SD启动与NOR FLASH启动有以下差别
CPU频率 : SD(1000M HZ) NOR (1200M HZ) 第一个控制字的c和a体现出来,见RM P229
e0025a00(E: PBL_SRC = IFC 2 : RCW SOURCE 为NOR) 与 60040a00 (6: PBL_SRC 为SD ,4 :RCW_SOURCE = SD)
结论 : 有诸多不同,现在发现调试网口不可以用,phy起来了,但是MAC有问题
CodeWarroior生成的文件
00000000: 55aa55aa 0001ee01 0a001006 00000000
00000010: 00000000 00000000 00000030 02000000
00000020: 004a02e0 00600420 00000000 00000000
00000030: 00000000 00000000 00000000 00000000
00000040: 00000000 00000000 40006108 017704b3
##############################################
从SD卡启动时,发现RCW 的存储位置,偏移0x1000的位置
##############################################
80001000: 55aa55aa 0001ee01 0a000806 00000000 .U.U............
80001010: 00000000 00000000 00000030 00790000 ........0.....y.
80001020: 000a0460 00600421 00000000 00000000 `...!.`.........
80001030: 00000000 00000020 00480220 40731b88 .... ... .H...s@
80001040: 00000000 00000000 00025709 ffffffff .........W......
80001050: 58015709 00030000 7c004089 0073f421 .W.X.....@.|!.s.
80001060: 0002ee09 00000010 58015709 00100000 .........W.X....
80001070: c0006109 ffff0f00 00000081 ea000016 .a..............
80001080: e59ff014 e59ff014 e59ff014 e59ff014 ................
80001090: e59ff014 e59ff014 e59ff014 10000040 ............@...
800010a0: 10000040 10000040 10000040 10000040 @...@...@...@...
800010b0: 10000040 10000040 deadbeef 40000081 @...@..........@
800010c0: ebfffffe e320f000 e320f000 e320f000 ...... ... ... .
########################
从SD卡启动u-boot调试
########################
dd if=u-boot-with-spl-pbl.bin of=/run/media/mmcblk0p1 bs=512 seek=8
dd if=u-boot-with-spl-pbl.bin of=/dev/mmcblk0p1 bs=512 seek=8
root@ls1021atwr:/# dd if=test.bin of=/dev/mmcblk0p1 bs=512 seek=8
0+1 records in
0+1 records out
8 bytes (8B) copied, 0.001995 seconds, 3.9KB/s
dd if=fsl-image-minimal-ls1021atwr-20190528091718.rootfs.tar.gz of=/dev/mmcblk0p1 bs=1024 seek=1024
root@ls1021atwr:/# dd if=fsl-image-minimal-ls1021atwr-20190528091718.rootfs.tar.gz of=/dev/mmcblk0p1 bs=1024 seek=1024
3571+1 records in
3571+1 records out
3656774 bytes (3.5MB) copied, 2.101526 seconds, 1.7MB/s
##########################
SD 卡可读写
##########################
1.格式化为vfat模式
2.内核启动后没有自动挂载,手动挂载到/mnt#
3.进入/mnt,创建一个文件test.bin
4.重新启动,重新挂载,查看test.bin 仍然在,表示SD卡写入成功
#####################
所有文件都从SD卡启动
#####################
setenv loadaddr 81000000
setenv fdtaddr 85000000
setenv bootfile uImage
setenv fdtfile ls1021a-twr.dtb
setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=$consoledev,$baudrate;mmcinfo;
ext2load mmc 0:2 $loadaddr /boot/$bootfile;
ext2load mmc 0:2 $fdtaddr /boot/$fdtfile;
ext2load mmc 0:2 83000000 /boot/fsl-image-minimal-ls1021atwr-20190528091718.rootfs.ext2.gz.u-boot;
bootm $loadaddr - $fdtaddr'
=> save
bootm $loadaddr 88000000 $fdtaddr
====>>>>>修改后,start kenel有打印了
setenv consoledev ttyS0,115200
setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=$consoledev,$baudrate;mmcinfo;
ext2load mmc 0:2 $loadaddr /boot/$bootfile;
ext2load mmc 0:2 $fdtaddr /boot/ls1021a-twr.dtb;
bootm $loadaddr - $fdtaddr'
setenv bootargs root=/dev/mmcblk0p2 rw console=ttyS0,115200
####################################################
使用demo板的所有文件,看SD卡启动内核能否正常通过
####################################################
setenv consoledev ttyS0,115200
setenv loadaddr 81000000
setenv fdtaddr 85000000
setenv bootfile uImage
setenv fdtfile uImage-ls1021a-twr.dtb
setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p2 rw rootdelay=5 console=$consoledev,$baudrate;mmcinfo;
ext2load mmc 0:2 $loadaddr /$bootfile;
ext2load mmc 0:2 $fdtaddr /$fdtfile;
ext2load mmc 0:2 83000000 /fsl-image-core-ls1021atwr-20160514210716.rootfs.ext2.gz.u-boot;
bootm $loadaddr - $fdtaddr'
tftp -gr uImage 192.168.0.14
tftp -gr fsl-image-core-ls1021atwr-20160514210716.rootfs.ext2.gz.u-boot 192.168.0.14
tftp -gr uImage-ls1021a-twr.dtb 192.168.0.14
///如果分区0 破坏
dd if=u-boot-with-spl-pbl.bin of=/dev/sdb bs=512 seek=8
tftp -gr u-boot-with-spl-pbl.bin 192.168.0.14
####################################
SDK 描述支持QSPI启动的u-boot获得方法
####################################
Build U-Boot image for QSPI boot
1. Compile QSPI boot image(enable QSPI):
$make distclean ARCH=arm CROSS_COMPILE=${toolchain_path}/gcc-linaro-arm-linux-
gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf-
$make ARCH=arm ${board_name}_qspi_defconfig
$make CROSS_COMPILE=${toolchain_path}/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-
linux-gnueabihf- -j4
2. Swap the bytes for RCW:
$tclsh byte_swap.tcl rcw_1200_qspiboot.bin rcw_1200_qspiboot_swap.bin 8
The byte_swap.tcl script is a shareable tool and can be found under rcw/tool/ directory.
3. Write RCW and U-Boot images to QSPI flash under SD boot (enables QSPI) mode:
sf probe 0:0
SF: Detected N25Q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
tftp 81000000 rcw_1200_qspiboot_swap.bin;sf erase 0 +$filesize;sf write 81000000 0 $filesize
tftp 82000000 u-boot-dtb.bin;sf erase 10000 +$filesize;sf write 82000000 10000 $filesize
4. Switch to QSPI boot: Set switches referring to board configuration document and power on the board from QSPI boot.
####################################
FAE 拿来第二块板子,现更新其中的程序 =====>成功
####################################
<更新 uImage>
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 uImage
protect off 0x60300000 +$filesize
erase 0x60300000 +$filesize
cp.b 82000000 0x60300000 $filesize
protect on 0x60300000 +$filesize
<更新dtb>
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 ls1021a-twr.dtb
protect off 0x60200000 +$filesize
erase 0x60200000 +$filesize
cp.b 82000000 0x60200000 $filesize
protect on 0x60200000 +$filesize
< 更新文件系统 >
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 fsl-image-minimal-ls1021atwr-20190528091718.rootfs.ext2.gz.u-boot
protect off 0x60a00000 +$filesize
erase 0x60a00000 +$filesize
cp.b 82000000 0x60a00000 $filesize
protect on 0x60a00000 +$filesize
修改环境变量
setenv fdt_high 0xa0000000
setenv initrd_high 0xa0000000
setenv kernel_addr 60300000
setenv ramargs 'setenv bootargs root=/dev/ram rw console=ttyS0,115200'
setenv bootcmd 'run ramargs; bootm 0x60300000 0x60a00000 0x60200000'
saveenv
<原来mmc boot的写法>
nor_bootcmd=echo Trying load from nor..;cp.b $kernel_addr $load_addr $kernel_size; env exists secureboot && cp.b $kernelheader_addr $kernelheader_addr_r $kernelheader_size && esbc_validate ${kernelheader_addr_r};
准备修改:
cp.b 0x60200000 82000000 $filesize
setenv nor_bootcmd 'cp.b 0x60300000 83000000 400000 ; cp.b 0x60a00000 88000000 400000; cp.b 0x60200000 89000000 10000;bootm 83000000 88000000 89000000'
setenv nor_bootcmd 'echo Trying load from nor..;cp.b $kernel_addr $load_addr $kernel_size; env exists secureboot && cp.b $kernelheader_addr $kernelheader_addr_r $kernelheader_size && esbc_validated'
<demo 板flash的各种文件布局和SDK中描述的不一致>
内核存放地址
kernel_addr=0x61000000
dtb存放地址
fdt_addr=0x64f00000
kernelheader_addr=0x60800000
kernelheader_addr_r=0x80200000
kernelheader_size=0x40000
setenv kernel_addr 0x61000000
setenv fdt_addr 0x64f00000
setenv kernelheader_addr 0x60800000
setenv kernelheader_addr_r 0x80200000
setenv kernelheader_size 0x40000
kernelheader_size=0x40000
======>更新到上面的地址
<更新kernel>
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 uImage
protect off 0x61000000 +$filesize
erase 0x61000000 +$filesize
cp.b 82000000 0x61000000 $filesize
protect on 0x61000000 +$filesize
<更新dtb>
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 ls1021a-twr.dtb
protect off 0x64f00000 +$filesize
erase 0x64f00000 +$filesize
cp.b 82000000 0x64f00000 $filesize
protect on 0x64f00000 +$filesize
################################################################
nor 启动环境变量修改如下后,所有的文件都可以从nor flash 启动
################################################################
setenv nor_bootcmd 'cp.b 0x61000000 83000000 400000 ; cp.b 0x60a00000 88000000 400000; cp.b 0x64f00000 89000000 10000;bootm 83000000 88000000 89000000'
bootm $kernel_addr 82000000 $fdt_addr
######################
支持所有文件从QSPI启动
######################
修改环境变量
set bootcmd 'run qspi_bootcmd '
setenv kernel_load_address 81000000
setenv ramdisk_load_address 85000000
setenv devicetree_load_address 89000000
set qspi_bootcmd 'echo Copying Linux from QSPI flash to RAM... && \
sf probe 0 &&
sf read ${kernel_load_address} 0x500000 ${kernel_size} && \
sf read ${devicetree_load_address} 0x900000 ${devicetree_size} && \
echo Copying ramdisk... && \
sf read ${ramdisk_load_address} 0x920000 ${ramdisk_size} && \
bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}' \
<更新 uImage>
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 uImage
sf write 0x82000000 500000 359228
<更新dtb>
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 ls1021a-twr.dtb
sf write 0x82000000 900000 5466
< 更新文件系统 >
setenv serverip 192.168.0.14;setenv ipaddr 192.168.0.206
tftp 82000000 fsl-image-minimal-ls1021atwr-20190528091718.rootfs.ext2.gz.u-boot
sf write 0x82000000 920000 3803ef