<div dir="ltr">Hi,<div><br></div><div>It seems like there would an easy way to do this for development/bringup, asking instead of hacking on the code for a change.</div><div><br></div><div>Im bringing up a system by loading an image via u-boot across the network into the upper section of ram, then booting from there. It relocates itself to the reset vector and generally works well.</div><div><div><br></div><div>U-Boot 2016.07 (Jun 15 2018 - 20:42:28 +0900)</div><div><br></div><div>DRAM: 240 MiB</div><div>WARNING: Caches not enabled</div><div>Flash: 32 MiB</div><div>*** Warning - bad CRC, using default environment</div><div><br></div><div>In: serial</div><div>Out: serial</div><div>Err: serial</div><div>Net: aspeednic#0</div><div>Error: aspeednic#0 address not set.</div><div><br></div><div>Hit any key to stop autoboot: 0</div><div>ast# nv</div><div>Unknown command 'nv' - try 'help'</div><div>ast# env print</div><div>baudrate=115200</div><div>bootargs=console=ttyS4,115200n8 root=/dev/ram rw</div><div>bootcmd=bootm 20080000</div><div>bootdelay=2</div><div>ethact=aspeednic#0</div><div>spi_dma=yes</div><div>stderr=serial</div><div>stdin=serial</div><div>stdout=serial</div><div>verify=yes</div><div><br></div><div>Environment size: 204/65531 bytes</div><div>ast#</div></div><div><br></div><div>
<div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">The initial stages are good, but 2nd stage loader assume files on MTD instead of whats in RAM, thus crashes out / uses stale data. Wasted about half a day wondering why my changes were having little to no effect. </div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Is there a best practices on this?</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Thanks</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Aaron</div><br class="gmail-Apple-interchange-newline">
<br></div><div><br></div><div><div>ast# bootd</div><div>FTGMAC100#0: link up, 1000bps full-duplex</div><div>Using FTGMAC100#0 device</div><div>TFTP from server 192.168.2.136; our IP address is 192.168.2.143</div><div>Filename 'image-current'.</div><div>Load address: 0x40a00000</div><div>Loading: #################################################################</div><div> #################################################################</div><div> #################################################################</div><div> #################################################################</div><div> #################################################################</div><div> #################################################################</div><div> #################################################################</div></div><div>.</div><div>.</div><div>.</div><div>.</div><div> #################################################################<br></div><div><div> #################################################################</div><div> #################################################################</div><div> #################################################################</div><div> #######################################################</div><div> 2.5 MiB/s</div><div>done</div><div>Bytes transferred = 33554432 (2000000 hex)</div><div>## Loading kernel from FIT Image at 40a80000 ...</div><div> Using 'conf@aspeed-bmc-quanta-q71l.dtb' configuration</div><div> Trying 'kernel@1' kernel subimage</div><div> Description: Linux kernel</div><div> Type: Kernel Image</div><div> Compression: uncompressed</div><div> Data Start: 0x40a8012c</div><div> Data Size: 2331736 Bytes = 2.2 MiB</div><div> Architecture: ARM</div><div> OS: Linux</div><div> Load Address: 0x40008000</div><div> Entry Point: 0x40008000</div><div> Hash algo: sha1</div><div> Hash value: 6a7b891f8d5fed2d358b2ceb06034496979dcae8</div><div> Verifying Hash Integrity ... sha1+ OK</div><div>## Loading ramdisk from FIT Image at 40a80000 ...<br></div></div><div><div> Using 'conf@aspeed-bmc-quanta-q71l.dtb' configuration</div><div> Trying 'ramdisk@1' ramdisk subimage</div><div> Description: obmc-phosphor-initramfs</div><div> Type: RAMDisk Image</div><div> Compression: lzma compressed</div><div> Data Start: 0x40cbfa80</div><div> Data Size: 1874095 Bytes = 1.8 MiB</div><div> Architecture: ARM</div><div> OS: Linux</div><div> Load Address: unavailable</div><div> Entry Point: unavailable</div><div> Hash algo: sha1</div><div> Hash value: 788a33bc41ecf5667b87ee2e264c679ed2a42e51</div><div> Verifying Hash Integrity ... sha1+ OK</div><div>## Loading fdt from FIT Image at 40a80000 ...</div><div> Using 'conf@aspeed-bmc-quanta-q71l.dtb' configuration</div><div> Trying 'fdt@aspeed-bmc-quanta-q71l.dtb' fdt subimage</div><div> Description: Flattened Device Tree blob</div><div> Type: Flat Device Tree</div><div> Compression: uncompressed</div><div> Data Start: 0x40cb9690</div><div> Data Size: 25390 Bytes = 24.8 KiB</div><div> Architecture: ARM</div><div> Hash algo: sha1</div><div> Hash value: 84ed7efe6232738984546b3ef27397ab251c3396</div><div> Verifying Hash Integrity ... sha1+ OK</div><div> Booting using the fdt blob at 0x40cb9690</div><div> Loading Kernel Image ... OK</div><div> Loading Ramdisk to 4e9d1000, end 4eb9a8af ... OK</div><div> Loading Device Tree to 4e9c7000, end 4e9d032d ... OK</div><div><br></div><div>Starting kernel ...</div></div><div><br></div><div><div><br></div><div>[ 0.000000] Booting Linux on physical CPU 0x0</div><div>[ 0.000000] random: get_random_bytes called from start_kernel+0x3c/0x3f0 with crng_init=0</div><div>[ 0.000000] Linux version 4.13.16-aca92be80c008bceeb6fb62fd1d450b5be5d0a4f (oe-user@oe-host) (gcc version 7.3.0 (GCC)) #10 Fri Jun 15 20:59:12 JST 2018</div><div>[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f</div><div>[ 0.000000] CPU: VIVT data cache, VIVT instruction cache</div><div>[ 0.000000] OF: fdt: Machine model: Quanta Q71L BMC</div><div>[ 0.000000] Memory policy: Data cache writeback</div><div>[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 58912</div><div>[ 0.000000] Kernel command line: console=ttyS4,115200n8 root=/dev/ram rw</div><div>[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)</div><div>[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)</div><div>[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)</div><div>[ 0.000000] Memory: 224832K/237568K available (5120K kernel code, 330K rwdata, 1276K rodata, 1024K init, 109K bss, 12736K reserved, 0K cma-reserved)</div><div>[ 0.000000] Virtual kernel memory layout:</div><div>[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)</div><div>[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)</div><div>[ 0.000000] vmalloc : 0x8f800000 - 0xff800000 (1792 MB)</div></div><div>.</div><div>.</div><div><snip></div><div>.</div><div>.</div><div><br></div><div><div>[ 4.641015] Segment Routing with IPv6</div><div>[ 4.643890] ip6_tables: (C) 2000-2006 Netfilter Core Team</div><div>[ 4.648315] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver</div><div>[ 4.654435] NET: Registered protocol family 17</div><div>[ 4.657830] 8021q: 802.1Q VLAN Support v1.8</div><div>[ 4.672023] hctosys: unable to open rtc device (rtc0)</div><div>[ 4.682642] Freeing unused kernel memory: 1024K</div><div>rofs = mtd4 squashfs rwfs = mtd5 jffs2</div><div>mount: mounting /dev/mtdblock4 on run/initramfs/ro failed: Invalid argument</div><div>[ 7.296855] jffs2: notice: (453) jffs2_build_xattr_subsystem: complete building xattr subsystem, 53 of xdatum (40 unchecked, 13 orphan) and 189 of xref (8 dead, 47 orphan) foun.</div><div>[ 7.336463] overlayfs: upper fs does not support tmpfile.</div><div>chroot: can't execute '/bin/sh': No such file or directory</div><div><br></div><div>Unable to confirm /sbin/init is an executable non-empty file</div><div>in merged file system mounted at /root.</div><div><br></div><div>Change Root test failed! Invoking emergency shell.</div><div>Enter password to try to manually fix.</div><div>After fixing run exit to continue this script, or reboot -f to retry, or</div><div>touch /takeover and exit to become PID 1 allowing editing of this script.</div><div>Give root password for maintenance</div><div>(or press Control-D to continue):</div><div><br></div></div><div><br></div><div>... and tries to load from MTD which has been purposely erased, and thus complains.</div><div><br></div><div><br></div><div><br></div></div>