diff options
author | Tom Rini <trini@konsulko.com> | 2021-09-11 15:15:56 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-09-11 15:15:56 +0300 |
commit | 78528b3e7ee70c798cb25cac8d1450582fe8606f (patch) | |
tree | 12e1c396ad1f7e61351036f6d4b3b01618da318b /board | |
parent | de5857d05660a839b3ba81b0f24d9b98e927d2ac (diff) | |
parent | cab1306a0990474032a7523e73ff185507488e3b (diff) | |
download | u-boot-78528b3e7ee70c798cb25cac8d1450582fe8606f.tar.xz |
Merge branch '2021-09-10-assorted-TI-updates'
- A number of TI platform bugfixes
Diffstat (limited to 'board')
-rw-r--r-- | board/ti/am64x/evm.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c index 21c58c76d6..1a9f69c6cf 100644 --- a/board/ti/am64x/evm.c +++ b/board/ti/am64x/evm.c @@ -10,6 +10,7 @@ #include <common.h> #include <asm/io.h> #include <spl.h> +#include <fdt_support.h> #include <asm/arch/hardware.h> #include <asm/arch/sys_proto.h> #include <env.h> @@ -60,6 +61,37 @@ int board_fit_config_name_match(const char *name) } #endif +#if defined(CONFIG_SPL_BUILD) && CONFIG_IS_ENABLED(USB_STORAGE) +static int fixup_usb_boot(const void *fdt_blob) +{ + int ret = 0; + + switch (spl_boot_device()) { + case BOOT_DEVICE_USB: + /* + * If the boot mode is host, fixup the dr_mode to host + * before cdns3 bind takes place + */ + ret = fdt_find_and_setprop((void *)fdt_blob, + "/bus@f4000/cdns-usb@f900000/usb@f400000", + "dr_mode", "host", 5, 0); + if (ret) + printf("%s: fdt_find_and_setprop() failed:%d\n", + __func__, ret); + fallthrough; + default: + break; + } + + return ret; +} + +void spl_perform_fixups(struct spl_image_info *spl_image) +{ + fixup_usb_boot(spl_image->fdt_addr); +} +#endif + #ifdef CONFIG_TI_I2C_BOARD_DETECT int do_board_detect(void) { |