]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
zynq: usb: Runtime detection of usb connected through slcr
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 20 Feb 2014 04:58:25 +0000 (10:28 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 20 Feb 2014 07:37:29 +0000 (08:37 +0100)
This patch adds support to check the connected
usb at runtime based on nand MIO configurations.
User needs to correctly configure the MIO's based
on the usb connected on the board.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/cpu/armv7/zynq/slcr.c

index 1152dc4a6259030c9c50b91afb180e779d8c2564..3d474bfc57679762b604cf8a892dcf4d7f97cf57 100644 (file)
@@ -17,6 +17,7 @@
 #define SLCR_QSPI_ENABLE_MASK          0x03
 #define SLCR_NAND_L2_SEL               0x10
 #define SLCR_NAND_L2_SEL_MASK          0x1F
+#define SLCR_USB_L1_SEL                        0x04
 
 #define SLCR_IDCODE_MASK       0x1F000
 #define SLCR_IDCODE_SHIFT      12
@@ -58,6 +59,14 @@ static const int nand16_pins[] = {
        16, 17, 18, 19, 20, 21, 22, 23
 };
 
+static const int usb0_pins[] = {
+       28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39
+};
+
+static const int usb1_pins[] = {
+       40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
+};
+
 static const struct zynq_slcr_mio_get_status mio_periphs[] = {
        {
                "qspi0",
@@ -94,6 +103,20 @@ static const struct zynq_slcr_mio_get_status mio_periphs[] = {
                SLCR_NAND_L2_SEL_MASK,
                SLCR_NAND_L2_SEL,
        },
+       {
+               "usb0",
+               usb0_pins,
+               ARRAY_SIZE(usb0_pins),
+               SLCR_USB_L1_SEL,
+               SLCR_USB_L1_SEL,
+       },
+       {
+               "usb1",
+               usb1_pins,
+               ARRAY_SIZE(usb1_pins),
+               SLCR_USB_L1_SEL,
+               SLCR_USB_L1_SEL,
+       },
 };
 
 static int slcr_lock = 1; /* 1 means locked, 0 means unlocked */