Difference between revisions of "U Boot for WRT Series"

Jump to navigation Jump to search
1,892 bytes added ,  19:50, 25 September 2021
m
no edit summary
m
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
The examples, output, etc. in this article are for the WRT32X.  The WRT3200ACM and various iterations of the WRT1900AC, WRT1900ACS, etc. are similar.
The examples, output, etc. in this article are for the WRT32X.  The WRT3200ACM and various iterations of the WRT1900AC, WRT1900ACS, etc. are similar.


There are just some quick notes here.


setenv
Command: mtdparts (output from WRT32X shown)<syntaxhighlight lang="text">
 
saveenv
 
nandboot=setenv bootargs console=ttyS0,115200 root=/dev/mtdblock6;nand read $defaultLoadAddr $priKernAddr $priKernSize; bootz $defaultLoadAddr
 
ubiblock1_0
mtdparts (output from WRT32X shown)<syntaxhighlight lang="text">
  #: name                size            offset          mask_flags
  #: name                size            offset          mask_flags
  0: uboot              0x000000200000          0x000000000000          1
  0: uboot              0x000000200000          0x000000000000          1
Line 19: Line 13:


active partition: nand0,0 - (uboot) 0x000000200000 @ 0x000000000000
active partition: nand0,0 - (uboot) 0x000000200000 @ 0x000000000000
</syntaxhighlight>This Works: chpart nand0,X (where X is one of the above #s)
</syntaxhighlight>The above seems (not verfied) to be mounted as: ubiblock1_0


To change active partitions: chpart nand0,X (where X is one of the above #s)


Do NOT do this (ONLY AN EXAMPLE, the U-Boot documentation would lead one to believe this "attaches" a partitions, nope, it is equivalent to using the FDISK command in DOS to actually create a partition.): To create (IE overwrite an existing partition) and "attach" (not "mount" apparently) a UBI Parition: ubi part NameOfPartition (like firmware2, IE ubi part firmware2)


Environment Variables (note the nandboot variable)<syntaxhighlight lang="text">
For information: ubi info (only works after the above "attach" command is issued)
 
...and another 2 hours of research after this, and no luck what so ever in figuring out why everyone on the planet says that something like "ubi part firmware2" will ''attach'' a UBI volume, when on the WRT32X Marvell version of U-Boot, it executes a complete "FDISK" (guess what the F stands for here), and wipes everything on the existing partition (checked it twice and it DOES hose the partition).<syntaxhighlight lang="text">
It does this;
 
Venom>> ubi part firmware2
Creating 1 MTD partitions on ...
 
Instead of this;
Venom>> ubi part firmware2
mtd: Giving out device 1 to mtd=5
ubi0: attaching mtd1
</syntaxhighlight>Maybe it isn't a UBI partition at this point because it has a SquashFS image there.  Who know?  Certainly not a web page publically accessible and apparently an OpenWRT secret.  Am I cranky?  Yup.  This is what happens when smart people build things.  They don't document it very well.<br />
 
===Environment Variables===
Note the bootcmd and nandboot variables.  Essentially the boot command (setenv bootargs console=ttyS0,115200 root=/dev/mtdblock6;nand read $defaultLoadAddr $priKernAddr $priKernSize; bootz $defaultLoadAddr) breaks down as follows;
 
*setenv bootargs console=ttyS0,115200 root=/dev/mtdblock6
*nand read 0x2000000 0x0900000 0x0600000 (this equates to the above "firmware1" mtd partition, which is defined by OpenWRT as mtd5 / kernel1 (primary kernel image & mtd6 rootfs1 (ubi))
*bootz 0x2000000
<syntaxhighlight lang="text">
CASset=max
CASset=max
MALLOC_len=5
MALLOC_len=5
Line 129: Line 145:
yuk_ethaddr=00:00:00:EE:51:81
yuk_ethaddr=00:00:00:EE:51:81
</syntaxhighlight>
</syntaxhighlight>
U-Boot Commands;<syntaxhighlight lang="text">
 
===U-Boot Commands===
<syntaxhighlight lang="text">
Venom>> help
Venom>> help
?      - alias for 'help'
?      - alias for 'help'
Line 303: Line 321:
version - print monitor, compiler and linker version
version - print monitor, compiler and linker version
whoAmI  - - reading CPU ID
whoAmI  - - reading CPU ID
</syntaxhighlight>Typical Command Line Boot Up Messages Displayed Via Serial Port / TTL;<syntaxhighlight lang="text">
</syntaxhighlight>
 
===Typical Command Line Boot Up Messages Displayed Via Serial Port / TTL===
<syntaxhighlight lang="text">
BootROM - 1.73
BootROM - 1.73
Booting from NAND flash
Booting from NAND flash
Line 683: Line 704:
[  16.489803] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  16.489803] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
</syntaxhighlight>
</syntaxhighlight>
===Thanks to...===
https://github.com/ARM-software/u-boot/blob/master/doc/README.ubi

Navigation menu