I do all this using the serial console.
setenv loadaddr 0x40000000 setenv bootaddr 0x40000000 setenv boot_kyu echo Booting Kyu via dhcp/tftp\; dhcp\; go \${bootaddr} setenv bootcmd run boot_kyu saveenvThis seemed to do the trick. Given that the SD card in my PC unit is now epoxied in place, it is handy to be able to just configure these things in the U-Boot shell.
cd u-boot export CROSS_COMPILE=arm-linux-gnu- make distclean make orangepi_pc_plus_defconfig make allYes indeed I built this for the PC Plus, but it works just fine on the PC. The main difference between the two is that the PC Plus allows for two emmc devices (the SD card and the onboard eMMC), but it works just fine if there is only one (the SD card).
I use my Fedora linux machine and a USB to SD card gizmo to put U-boot on the SD card. On my system the SD card appears as device /dev/sdc. You must be sure to get this right. The risk in getting this wrong is that you will send the dd output to one of the hard drives on your system and have serious data loss, not to mention not being able to boot and run your linux system. You have been warned!
dd if=/dev/zero of=/dev/sdc bs=1024 count=2048 dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8 sync 447+1 records in 447+1 records out 458738 bytes (459 kB) copied, 0.0609168 s, 7.5 MB/sPlug the SD card into your Orange Pi, and apply power ....
=> version U-Boot 2016.11-g29e0cfb-dirty (Jan 09 2017 - 11:19:55 -0700) Allwinner Technology arm-linux-gnu-gcc (GCC) 6.1.1 20160621 (Red Hat Cross 6.1.1-2) GNU ld version 2.27-3.fc24Then issue the following commands (you may as well cut and paste them from here):
setenv loadaddr 0x40000000 setenv bootaddr 0x40000000 setenv boot_kyu echo Booting Kyu via dhcp/tftp\; dhcp\; go \${bootaddr} setenv bootcmd run boot_kyu saveenvBefore you hit reset, use the following command to get the MAC address.
=> env print ethaddr ethaddr=02:20:7f:9b:xx:yy
host orangepiplus2 { hardware ethernet 02:20:7f:9b:xx:yy; fixed-address 192.168.0.61; option host-name "orangepiplus2"; server-name "trona"; filename "orange.bin"; }Then I do this:
systemctl restart dhcpd.serviceAfter this type "boot" to the U-boot prompt (or else hit reset or power cycle). It will boot the file "orange.bin" from your tftp directory (in my case /var/lib/tftpboot).
Works great. Being able to save the U-boot environment on MMC is fantastic!
Tom's electronics pages / tom@mmto.org