Closed synaption closed 2 years ago
reference board/freescale/imx8mp_evk/spl.c
int spl_board_boot_device(enum boot_device boot_dev_spl) {
return BOOT_DEVICE_BOOTROM;
switch (boot_dev_spl) {
case SD1_BOOT:
case MMC1_BOOT:
case SD2_BOOT:
case MMC2_BOOT:
return BOOT_DEVICE_MMC1;
case SD3_BOOT:
case MMC3_BOOT:
return BOOT_DEVICE_MMC2;
case QSPI_BOOT:
return BOOT_DEVICE_NOR;
case NAND_BOOT:
return BOOT_DEVICE_NAND;
**case USB_BOOT:
return BOOT_DEVICE_BOARD;**
default:
return BOOT_DEVICE_NONE;
}
}
Thanks nxpfrankli. What version of uboot are you referencing? I do not see this in mainline uboot or imx uboot's board/freescale/imx8mp_evk/spl.c. When I add this to common/spl/spl.c, I get a build error. If I understand correctly, I think I need to add values for these variables to include/spl.h as well?
common/spl/spl.c:42:32: warning: ‘enum boot_device’ declared inside parameter list will not be visible outside of this definition or declaration
42 | int spl_board_boot_device(enum boot_device boot_dev_spl)
| ^~~~~~~~~~~
common/spl/spl.c:42:44: error: parameter 1 (‘boot_dev_spl’) has incomplete type
42 | int spl_board_boot_device(enum boot_device boot_dev_spl)
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
common/spl/spl.c: In function ‘spl_board_boot_device’:
common/spl/spl.c:48:6: error: ‘SD1_BOOT’ undeclared (first use in this function)
48 | case SD1_BOOT:
| ^~~~~~~~
common/spl/spl.c:48:6: note: each undeclared identifier is reported only once for each function it appears in
common/spl/spl.c:49:6: error: ‘MMC1_BOOT’ undeclared (first use in this function)
49 | case MMC1_BOOT:
| ^~~~~~~~~
common/spl/spl.c:50:6: error: ‘SD2_BOOT’ undeclared (first use in this function)
50 | case SD2_BOOT:
| ^~~~~~~~
common/spl/spl.c:51:6: error: ‘MMC2_BOOT’ undeclared (first use in this function)
51 | case MMC2_BOOT:
| ^~~~~~~~~
common/spl/spl.c:53:6: error: ‘SD3_BOOT’ undeclared (first use in this function)
53 | case SD3_BOOT:
| ^~~~~~~~
common/spl/spl.c:54:6: error: ‘MMC3_BOOT’ undeclared (first use in this function)
54 | case MMC3_BOOT:
| ^~~~~~~~~
common/spl/spl.c:56:6: error: ‘QSPI_BOOT’ undeclared (first use in this function)
56 | case QSPI_BOOT:
| ^~~~~~~~~
common/spl/spl.c:58:6: error: ‘NAND_BOOT’ undeclared (first use in this function)
58 | case NAND_BOOT:
| ^~~~~~~~~
common/spl/spl.c:60:6: error: ‘USB_BOOT’ undeclared (first use in this function)
60 | case USB_BOOT:
| ^~~~~~~~
common/spl/spl.c:66:1: warning: control reaches end of non-void function [-Wreturn-type]
66 | }
| ^
make[4]: *** [scripts/Makefile.build:254: spl/common/spl/spl.o] Error 1
imx8mp! not imx8mq. I was looking at the wrong board. Anyway. I added #include <asm/mach-imx/boot_mode.h>
and that allowed the code to compile, but this did not change my error message. I even tried to force the function to return BOOT_DEVICE_BOARD;
This caused the output of spl_loader_name()
to change, so I can tell spl_board_boot_device()
is being called, but spl_ll_find_loader()
still returns 0 so my error persists.
Here is major for UUU host side issues. You'd better post uboot issue in nxp community. https://community.nxp.com/. There are more uboot expert to help you. or post into uboot's maillist.
Is there any chance I will have better luck with a winusb based transfer? How would I go about doing that.
You have to pass this phase, let SPL receive uboot firstly by SDP.
you can check common/spl/spl_sdp.c, make sure SPL_LOAD_IMAGE_METHOD("USB SDP", 0, BOOT_DEVICE_BOARD, spl_sdp_load_image);
NEW ERROR! exciting. I added a lot of include/config/imx8mq_evk.h to include/config/imx8mq_phanbell.h, as well as adding a lot from board/freescale/imx8mq_phanbell/imx8mq_evk.c to board/google/imx8mq_phanbell/imx8mq_phanbell.c. It seems like everything that should compile does. Now the process hangs at the following:
U-Boot SPL 2022.04 (Sep 03 2022 - 02:34:18 -0500)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3200MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from USB SDP
SDP: initialize...
SDP: handle requests...
lsusb
during ``SDP: handle requests...shows the device as
Bus 001 Device 093: ID 0525:0151 Netchip Technology, Inc. USB download gadgetbut
0525:0151``` does not seme to corispont to anything in this chart. I'm not sure if this is the problem or how to fix it.
Build in config:
Pctl Chip Vid Pid BcdVersion
==================================================
SDPS: MX8QXP 0x1fc9 0x012f [0x0002..0xffff]
SDPS: MX8QM 0x1fc9 0x0129 [0x0002..0xffff]
SDPS: MX8DXL 0x1fc9 0x0147
SDPS: MX28 0x15a2 0x004f
SDPS: MX815 0x1fc9 0x013e
SDPS: MX865 0x1fc9 0x0146
SDPS: MX8ULP 0x1fc9 0x014a
SDPS: MX8ULP 0x1fc9 0x014b
SDP: MX7D 0x15a2 0x0076
SDP: MX6Q 0x15a2 0x0054
SDP: MX6D 0x15a2 0x0061
SDP: MX6SL 0x15a2 0x0063
SDP: MX6SX 0x15a2 0x0071
SDP: MX6UL 0x15a2 0x007d
SDP: MX6ULL 0x15a2 0x0080
SDP: MX6SLL 0x1fc9 0x0128
SDP: MX7ULP 0x1fc9 0x0126
SDP: MXRT106X 0x1fc9 0x0135
SDP: MX8MM 0x1fc9 0x0134
SDP: MX8MQ 0x1fc9 0x012b
SDPU: SPL 0x0525 0xb4a4 [0x0000..0x04ff]
SDPV: SPL1 0x0525 0xb4a4 [0x0500..0x9998]
SDPU: SPL 0x0525 0xb4a4 [0x9999..0x9999]
SDPU: SPL 0x3016 0x1001 [0x0000..0x04ff]
SDPV: SPL1 0x3016 0x1001 [0x0500..0x9998]
FBK: 0x066f 0x9afe
FBK: 0x066f 0x9bff
FB: 0x0525 0xa4a5
FB: 0x18d1 0x0d02
FB: 0x3016 0x0001
before SDP: handle requests...
lsusb
shows Bus 001 Device 105: ID 1fc9:012b NXP Semiconductors i.MX 8M Dual/8M QuadLite/8M Quad Serial Downloader
. I am trying to use sudo uuu CFG: FB: -chip imx8mq -vid 0x0525 -pid 0x0151
to add recognition for the usb gadget as it seems to appear.
There are config to control USB VID and PID. You can reuse NXP one.
CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 CONFIG_USB_GADGET_PRODUCT_NUM=0x0152
I remember SPL Production_Number is CONFIG_USB_GADGET_PRODUCT_NUM - 1
Suppose your uuu is quit old.
0x0525 0xb4a4 actually is wrong PID/VID, which already register.
cfg only used for in uuu script. System will forget it after run uuu cfg: FB: ....
With A LOT of hacking, I have been able to make something work. CONFIG_USB_GADGET_VENDOR_NUM seemed to effect the right value, but CONFIG_USB_GADGET_PRODUCT_NUM did not do anything unless I changed it directly in the c code. Ultimately what I am able to do is this:
sudo uuu SDP: boot -f SDPVimx8-boot-sd.bin
sleep 1
sudo uuu SDPV: write -f mendel-imx8-boot-sd.bin -skipspl
sudo uuu SDPV: jump
# ums 0 mmc 0 # on coral
sudo bmaptool copy --bmap sdcard.img.bmap sdcard.img.xz /dev/sdb
# fastboot 0 # on coral
fastboot flash bootloader0 imx8-boot-sd.bin
So I basically used my uboot to start SDPV, then I load the original mendel linux uboot to use fastboot and ums. The last problem I am having is that I would rather run fastboot and ums with uuu FB: ucmd
but the mendel uboot automatically boots into fastboot, and I need to use the serial terminal to press ctrl-c. Is there a way to press ctrl-c with ucmd?
fb: continue
I am trying to get UUU working with the google coral devboard that is based on the imx8mq. I can get fastboot to work, but this would be a pain for bulk flashing. I am using buildroot which generates imx8-boot-sd.bin as the uboot binary, verified working in emmc with fastboot. the error I get with uuu is:
The output on the host device is as follows:
These are the lines I have added currently to my uboot config
CONFIG_ANDROID_BOOT_IMAGE=y causes a compile error. I'm not sure if that matters.