Change bootargs in uboot November 14, 2021 04:34AM |
Registered: 7 years ago Posts: 104 |
bootdelay=5 baudrate=115200 boot_config=setenv devices "usb scsi"; setenv bootdev usb; setenv device 0:1; setenv disks "0 1 2 3 4 5 6 7"; scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start"; setenv scan_scsi "scsi reset"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if ext2load $dev $disknum:1 $load_image_addr /boot/zImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done kernel_config=setenv load_dtb_addr 0x1000000; setenv load_initrd_addr 0x3000000; setenv load_image_addr 0x02000000; setenv dtb_file /boot/dts/armada-385-thecus-n2350.dtb load_image=echo loading uImage ...; ext2load $bootdev $device $load_image_addr /boot/uImage load_dtb=echo loading DTB $dtb_file ...; ext2load $bootdev $device $load_dtb_addr $dtb_file load_initrd=echo loading uInitrd ...; ext2load $bootdev $device $load_initrd_addr /boot/uInitrd set_bootargs_stock=setenv bootargs "root=/dev/ram0 rw max_loop=210 console=ttyS0,115200 init=sbin/init rootdelay=3 ubi.mtd=0 mtdparts=armada-nand:-(ubifs);spi_flash:0x00400000(uboot),0x00010000@0x00100000(uboot_env)" bootcmd_exec=echo Booting from $bootdev $device …; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; if run load_image; then if run load_initrd; then bootm $load_image_addr $load_initrd_addr; else bootm $load_image_addr; fi; fi bootcmd_custom=run boot_config; run kernel_config; run scan_disk; run set_bootargs; run bootcmd_exec bootcmd=echo Booting Debian ...; run bootcmd_custom; echo Booting stock ...; run set_bootargs_stock; usb reset; if fatload usb 0:1 0x2000000 rescue_fw/rescue_fw.img;then imi 0x2000000;source 0x2000000; fi; ubi part ubifs;ubifsmount boot;ubifsload 0x2000000 boot/bzImage;ubifsload 0x3000000 boot/ramdisk;bootm 0x2000000 0x3000000 set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=armada-nand:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial init=/bin/systemd"
mjung@vega:~$ cat /proc/cmdline console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial
mjung@vega:~$ ls -lh /bin/systemd lrwxrwxrwx 1 root root 20 Jul 13 19:29 /bin/systemd -> /lib/systemd/systemd
Re: Change bootargs in uboot November 14, 2021 03:20PM |
Admin Registered: 14 years ago Posts: 19,413 |
Quote
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial
Re: Change bootargs in uboot November 14, 2021 04:33PM |
Admin Registered: 14 years ago Posts: 19,413 |
setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=armada-nand:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial init=/bin/systemd"' printenv set_bootargs
boot
Re: Change bootargs in uboot November 18, 2021 11:20AM |
Registered: 7 years ago Posts: 104 |
Re: Change bootargs in uboot November 18, 2021 03:06PM |
Admin Registered: 14 years ago Posts: 19,413 |
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial
dev: size erasesize name mtd0: 20000000 00020000 "ubifs" mtd1: 00400000 00001000 "uboot" mtd2: 00010000 00001000 "uboot_env" mtd3: 00010000 00001000 "uboot_scr"
# MTD device name Device offset Env. size Flash sector size Number of sectors # # Thecus N2350 /dev/mtd2 0x00000 0x10000 0x10000
mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr)
fw_printenvAnd then once you see all envs are listed OK. Set something to test, such as
fw_setenv test_001 yes fw_printenv test_001After a reboot you should see it in serial console and then in Debian. And then remove it
fw_setenv test_001
Re: Change bootargs in uboot November 20, 2021 10:36AM |
Registered: 7 years ago Posts: 104 |
mjung@vega:~$ cat /proc/cmdline console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=armada-nand:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial systemd.unified_cgroup_hierarchy=0 mjung@vega:~$ cat /etc/fw_env.config # Configuration file for fw_(printenv/saveenv) utility. # Up to two entries are valid, in this case the redundant # environment sector is assumed present. # Notice, that the "Number of sectors" is ignored on NOR. # MTD device name Device offset Env. size Flash sector size Number of sectors /dev/mtd0 0xc0000 0x20000 0x20000 mjung@vega:~$ cat /proc/mtd dev: size erasesize name mtd0: 20000000 00020000 "ubifs" mtd1: 00400000 00001000 "uboot" mtd2: 00010000 00001000 "uboot_env" mtd3: 00010000 00001000 "uboot_scr"
Re: Change bootargs in uboot November 20, 2021 03:20PM |
Admin Registered: 14 years ago Posts: 19,413 |
# MTD device name Device offset Env. size Flash sector size Number of sectors # # Thecus N2350 /dev/mtd2 0x00000 0x10000 0x10000
Re: Change bootargs in uboot November 21, 2021 06:27AM |
Registered: 7 years ago Posts: 104 |
> # MTD device name Device offset Env. size Flash > sector size Number of sectors > # > # Thecus N2350 > /dev/mtd2 0x00000 0x10000 0x10000 >Ok, i fixed it, and now fw_printenv shows all the envs correctly.
mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr)
Re: Change bootargs in uboot November 21, 2021 02:51PM |
Admin Registered: 14 years ago Posts: 19,413 |
Re: Change bootargs in uboot November 21, 2021 06:51PM |
Admin Registered: 14 years ago Posts: 19,413 |
fw_setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=armada-nand:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial"'
fw_setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr)earlyprintk=serial"'