diff options
author | Faiz Abbas <faiz_abbas@ti.com> | 2020-08-03 11:35:10 +0530 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2020-08-11 20:34:46 +0530 |
commit | 897e83f0a5ad97f3f97976c2df16f14b1f205d94 (patch) | |
tree | e13c230966634c4369b6c23e784028c9c0857904 /arch/arm/mach-k3 | |
parent | 403fc5c9cf2c40c85e0c3d0c8bc36244a665cb74 (diff) |
arm: mach-k3: am6_init: Add support for USB boot mode
Add support for identifying USB host and device boot modes
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Diffstat (limited to 'arch/arm/mach-k3')
-rw-r--r-- | arch/arm/mach-k3/am6_init.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-k3/include/mach/am6_hardware.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-k3/include/mach/am6_spl.h | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c index c6d4f05a01..9cb3086014 100644 --- a/arch/arm/mach-k3/am6_init.c +++ b/arch/arm/mach-k3/am6_init.c @@ -333,6 +333,11 @@ static u32 __get_primary_bootmedia(u32 devstat) CTRLMMR_MAIN_DEVSTAT_EMMC_PORT_SHIFT; if (port == 0x1) bootmode = BOOT_DEVICE_MMC2; + } else if (bootmode == BOOT_DEVICE_DFU) { + u32 mode = (devstat & CTRLMMR_MAIN_DEVSTAT_USB_MODE_MASK) >> + CTRLMMR_MAIN_DEVSTAT_USB_MODE_SHIFT; + if (mode == 0x2) + bootmode = BOOT_DEVICE_USB; } return bootmode; diff --git a/arch/arm/mach-k3/include/mach/am6_hardware.h b/arch/arm/mach-k3/include/mach/am6_hardware.h index a91ef5f735..1908a13f0f 100644 --- a/arch/arm/mach-k3/include/mach/am6_hardware.h +++ b/arch/arm/mach-k3/include/mach/am6_hardware.h @@ -25,6 +25,8 @@ #define CTRLMMR_MAIN_DEVSTAT_EMMC_PORT_SHIFT 14 #define CTRLMMR_MAIN_DEVSTAT_BKUP_MMC_PORT_MASK GENMASK(17, 17) #define CTRLMMR_MAIN_DEVSTAT_BKUP_MMC_PORT_SHIFT 12 +#define CTRLMMR_MAIN_DEVSTAT_USB_MODE_SHIFT 9 +#define CTRLMMR_MAIN_DEVSTAT_USB_MODE_MASK GENMASK(10, 9) #define WKUP_CTRL_MMR0_BASE 0x43000000 #define MCU_CTRL_MMR0_BASE 0x40f00000 diff --git a/arch/arm/mach-k3/include/mach/am6_spl.h b/arch/arm/mach-k3/include/mach/am6_spl.h index e97d8143c6..61e0380927 100644 --- a/arch/arm/mach-k3/include/mach/am6_spl.h +++ b/arch/arm/mach-k3/include/mach/am6_spl.h @@ -14,7 +14,8 @@ #define BOOT_DEVICE_I2C 0x05 #define BOOT_DEVICE_MMC2 0x06 #define BOOT_DEVICE_ETHERNET 0x07 -#define BOOT_DEVICE_USB 0x08 +#define BOOT_DEVICE_DFU 0x08 +#define BOOT_DEVICE_USB 0x408 #define BOOT_DEVICE_PCIE 0x09 #define BOOT_DEVICE_UART 0x0a #define BOOT_DEVICE_NAND 0x0c |