]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: am6_init: Add support for USB boot mode
authorFaiz Abbas <faiz_abbas@ti.com>
Mon, 3 Aug 2020 06:05:10 +0000 (11:35 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 11 Aug 2020 15:04:46 +0000 (20:34 +0530)
Add support for identifying USB host and device boot modes

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
arch/arm/mach-k3/am6_init.c
arch/arm/mach-k3/include/mach/am6_hardware.h
arch/arm/mach-k3/include/mach/am6_spl.h

index c6d4f05a01a77a251a5b32851a340f7a8e1d1a72..9cb30860145d64236c6e7c29b91d0a88701a2f72 100644 (file)
@@ -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;
index a91ef5f735d5b693bbc05a30abf7446ae94b2046..1908a13f0ff2d6bf1f2f0d36ace2617a85c7d65c 100644 (file)
@@ -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
index e97d8143c62a3d2547f75b70df3896ba8e1b04aa..61e0380927636b391f6f095947f3e2c629401bec 100644 (file)
@@ -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