[tom@trona bl1-nanopi-m3]$ make [compile....src/startup_aarch64.S] [compile....src/aarch64_libs.S] [compile....src/aarch64_exception_handler.c] [compile....src/secondboot.c] [compile....src/subcpu.c] [compile....src/sleep.c] [compile....src/resetcon.c] [compile....src/GPIO.c] [compile....src/CRC32.c] [compile....src/SecureManager.c] [compile....src/clockinit.c] [compile....src/debug.c] [compile....src/lib2ndboot.c] [compile....src/buildinfo.c] [compile....src/printf.c] [compile....src/psci.c] [compile....src/sysbus.c] [compile....src/init_DDR3.c] [compile....src/CRYPTO.c] [compile....src/i2c_gpio.c] [compile....src/pmic.c] [compile....src/iUSBBOOT.c] [compile....src/iSDHCBOOT.c] [link.... out/bl1-nanopi.elf] [binary.... out/bl1-nanopi.bin]A quick at the LDS file shows that it links to run at 0xffff0000, just where you would want it to to be loaded by the on-chip bootrom. His comments say that this can be used to load U-Boot, and that might be a fine idea instead of using the fip-secure gadget that the linux setup uses. A quick peek at the final "bin" file shows that it has what looks like a proper NSIH header like the boot loader wants, so we could just try loading it with my usb_loader. The first time I try this, the transfer works, but I see no messages on the serial console or any evidence that anything at all has happened.
[root@trona out]# usb_loader bl1-nanopi.bin Start transfer, size = 31264 Transfer successful [root@trona out]# usb_loader bl1-nanopi.bin Start transfer, size = 31264 USB bulk transfer failed Download failedWithout resetting the board, I try loading it again (the second command above) and get the following on the serial console:
I2C_WriteByte nack returned I2C Device Address Write Abitration Error I2C_WriteByte nack returned I2C Device Address Write Abitration Error I2C_WriteByte nack returned I2C Device Address Write Abitration Error I2C_WriteByte nack returned I2C Device Address Write Abitration Error Wakeup Sub CPU 1234567 CPU Wakeup done! WFI is expected. CPU0 is Master! Card Identify Failure Cannot Detect SDMMC Image Loading Failure Try to USB bootAlso I get these messages on my linux host logs:
Aug 27 16:05:59 trona kernel: usb 2-1.8: new high-speed USB device number 60 using ehci-pci Aug 27 16:06:00 trona kernel: usb 2-1.8: New USB device found, idVendor=04e8, idProduct=1234, bcdDevice= 0.00 Aug 27 16:06:00 trona kernel: usb 2-1.8: New USB device strings: Mfr=0, Product=0, SerialNumber=0If I try this a third and fourth time, I get the same kind of behavior (but now I am talking to this bl1 loader) however now messages like this appear for CPU 1 through 7. After a bit of thought, I find a way to fix this crazy business (see below).
Wakeup Sub CPU cpu 1 is not bringup, retry cpu 1 is not bringup, retry cpu 1 is not bringup, retry cpu 1 is not bringup, retryNo doubt these processors are already running and trying to get them running a second time yields this result.
The sources (18854 lines of them) provide all kinds of valuable and interesting information. They even have code to start up additional cores (although why a stage 2 boot loader needs or wants to do that is beyond me). A far more digestable source of information than paddling through the linux sources.
An even more interesting source of information is the prototype/module directory, which holds over 76,000 lines of source code.
This thing seems to use an NSIH header to download whatever comes next. And U-Boot itself could be whatever comes next, rather than the fip-secure thing that the standard linux boot sequence uses.
Tom's electronics pages / [email protected]