Skip to contentSkip to conversation

EXYNOS5: Add VBus init required for USB

PATCH New Rajeshwari Shinde 5 participants 8 messages Dec 3, 2012 – Dec 4, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover EXYNOS5: Add VBus init required for USB

This patch sets adds pinmux for USB and function to init VBus.

Rajeshwari Shinde (2):
EXYNOS5: Add pinmux for VBus
SMDK5250: Enable VBus for USB

 arch/arm/cpu/armv7/exynos/pinmux.c        |   10 ++++++++++
 arch/arm/include/asm/arch-exynos/periph.h |    1 +
 board/samsung/smdk5250/smdk5250.c         |   17 +++++++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/2 EXYNOS5: Add pinmux for VBus

This patch sets pinmux for VBus of USB.

---
 arch/arm/cpu/armv7/exynos/pinmux.c        |   10 ++++++++++
 arch/arm/include/asm/arch-exynos/periph.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +10 -0
index f9f6911..d65ffc7 100644
@@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
 	}
 }
 
+void exynos5_usb20_config(void)
+{
+	struct exynos5_gpio_part1 *gpio1 =
+		(struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+	/* Enable VBUS power switch */
+	s5p_gpio_direction_output(&gpio1->x2,6, 1);
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
 	switch (peripheral) {
@@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int flags)
 	case PERIPH_ID_SPI4:
 		exynos5_spi_config(peripheral);
 		break;
+	case PERIPH_ID_USB20:
+		exynos5_usb20_config();
 	default:
 		debug("%s: invalid peripheral %d", __func__, peripheral);
 		return -1;
arch/arm/include/asm/arch-exynos/periph.h +1 -0
index 783b77c..84593f6 100644
@@ -46,6 +46,7 @@ enum periph_id {
 	PERIPH_ID_SPI0 = 68,
 	PERIPH_ID_SPI1,
 	PERIPH_ID_SPI2,
+	PERIPH_ID_USB20,
 	PERIPH_ID_SDMMC0 = 75,
 	PERIPH_ID_SDMMC1,
 	PERIPH_ID_SDMMC2,
Signature · 1 line
1.7.4.4
#2 lore raw

PATCH 1/2 EXYNOS5: Add pinmux for VBus

Quoted 14 lines · Rajeshwari Shinde

This patch sets pinmux for VBus of USB.

---
 arch/arm/cpu/armv7/exynos/pinmux.c        |   10 ++++++++++
 arch/arm/include/asm/arch-exynos/periph.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +0 -0
index f9f6911..d65ffc7 100644

arch/arm/cpu/armv7/exynos/pinmux.c void exynos5_spi_config(int peripheral) · line 293

Quoted 9 lines
arch/arm/cpu/armv7/exynos/pinmux.c +6 -0
@@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
        }
 }
 
+void exynos5_usb20_config(void)
+{
+       struct exynos5_gpio_part1 *gpio1 =
+               (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+       /* Enable VBUS power switch */
+       s5p_gpio_direction_output(&gpio1->x2,6, 1);

it seems to be board specific GPIO value. doesn't it?

Thank you,
Kyungmin Park

Quoted 33 lines
arch/arm/cpu/armv7/exynos/pinmux.c +4 -0
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
        switch (peripheral) {
@@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int flags)
        case PERIPH_ID_SPI4:
                exynos5_spi_config(peripheral);
                break;
+       case PERIPH_ID_USB20:
+               exynos5_usb20_config();
        default:
                debug("%s: invalid peripheral %d", __func__, peripheral);
                return -1;
arch/arm/include/asm/arch-exynos/periph.h +1 -1
index 783b77c..84593f6 100644
@@ -46,6 +46,7 @@ enum periph_id {
        PERIPH_ID_SPI0 = 68,
        PERIPH_ID_SPI1,
        PERIPH_ID_SPI2,
+       PERIPH_ID_USB20,
        PERIPH_ID_SDMMC0 = 75,
        PERIPH_ID_SDMMC1,
        PERIPH_ID_SDMMC2,
--

1.7.4.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#3 lore raw

PATCH 1/2 EXYNOS5: Add pinmux for VBus

Hi Kyungmin Park,

Quoted 19 lines · Kyungmin Park
Quoted 17 lines · Rajeshwari Shinde

This patch sets pinmux for VBus of USB.

---
 arch/arm/cpu/armv7/exynos/pinmux.c        |   10 ++++++++++
 arch/arm/include/asm/arch-exynos/periph.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +0 -0
index f9f6911..d65ffc7 100644
@@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
        }
 }
 
Quoted 7 lines

arch/arm/cpu/armv7/exynos/pinmux.c void exynos5_spi_config(int peripheral) · line 293

Quoted 6 lines
arch/arm/cpu/armv7/exynos/pinmux.c +6 -0
+void exynos5_usb20_config(void)
+{
+       struct exynos5_gpio_part1 *gpio1 =
+               (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+       /* Enable VBUS power switch */
+       s5p_gpio_direction_output(&gpio1->x2,6, 1);

it seems to be board specific GPIO value. doesn't it?

Yes it is smdk5250 specific.

Quoted 31 lines

Thank you,
Kyungmin Park

Quoted 29 lines
arch/arm/cpu/armv7/exynos/pinmux.c +4 -0
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
        switch (peripheral) {
@@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int flags)
        case PERIPH_ID_SPI4:
                exynos5_spi_config(peripheral);
                break;
+       case PERIPH_ID_USB20:
+               exynos5_usb20_config();
        default:
                debug("%s: invalid peripheral %d", __func__, peripheral);
                return -1;
arch/arm/include/asm/arch-exynos/periph.h +1 -1
index 783b77c..84593f6 100644
@@ -46,6 +46,7 @@ enum periph_id {
        PERIPH_ID_SPI0 = 68,
        PERIPH_ID_SPI1,
        PERIPH_ID_SPI2,
+       PERIPH_ID_USB20,
        PERIPH_ID_SDMMC0 = 75,
        PERIPH_ID_SDMMC1,
        PERIPH_ID_SDMMC2,
--

1.7.4.4

Quoted 8 lines
Quoted 4 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Regards,
Rajeshwari shinde.

#4 lore raw

PATCH 1/2 EXYNOS5: Add pinmux for VBus

Quoted 22 lines · Rajeshwari Birje

Hi Kyungmin Park,

Quoted 19 lines · Kyungmin Park
Quoted 17 lines · Rajeshwari Shinde

This patch sets pinmux for VBus of USB.

---
 arch/arm/cpu/armv7/exynos/pinmux.c        |   10 ++++++++++
 arch/arm/include/asm/arch-exynos/periph.h |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/exynos/pinmux.c +0 -0
index f9f6911..d65ffc7 100644
@@ -285,6 +285,14 @@ void exynos5_spi_config(int peripheral)
        }
 }
 
Quoted 8 lines
Quoted 7 lines

arch/arm/cpu/armv7/exynos/pinmux.c void exynos5_spi_config(int peripheral) · line 293

Quoted 6 lines
arch/arm/cpu/armv7/exynos/pinmux.c +6 -0
+void exynos5_usb20_config(void)
+{
+       struct exynos5_gpio_part1 *gpio1 =
+               (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+       /* Enable VBUS power switch */
+       s5p_gpio_direction_output(&gpio1->x2,6, 1);

it seems to be board specific GPIO value. doesn't it?

Yes it is smdk5250 specific.

So it's not proper place to add.

Quoted 42 lines
Quoted 31 lines

Thank you,
Kyungmin Park

Quoted 29 lines
arch/arm/cpu/armv7/exynos/pinmux.c +4 -0
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
        switch (peripheral) {
@@ -322,6 +330,8 @@ static int exynos5_pinmux_config(int peripheral, int flags)
        case PERIPH_ID_SPI4:
                exynos5_spi_config(peripheral);
                break;
+       case PERIPH_ID_USB20:
+               exynos5_usb20_config();
        default:
                debug("%s: invalid peripheral %d", __func__, peripheral);
                return -1;
arch/arm/include/asm/arch-exynos/periph.h +1 -1
index 783b77c..84593f6 100644
@@ -46,6 +46,7 @@ enum periph_id {
        PERIPH_ID_SPI0 = 68,
        PERIPH_ID_SPI1,
        PERIPH_ID_SPI2,
+       PERIPH_ID_USB20,
        PERIPH_ID_SDMMC0 = 75,
        PERIPH_ID_SDMMC1,
        PERIPH_ID_SDMMC2,
--

1.7.4.4

Quoted 8 lines
Quoted 4 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Regards,
Rajeshwari shinde.

#5 lore raw

PATCH 2/2 SMDK5250: Enable VBus for USB

In reply to Rajeshwari Shinde

This patch enables Vbus required for USB.

---
 board/samsung/smdk5250/smdk5250.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
board/samsung/smdk5250/smdk5250.c +17 -0
index 5ebc665..fb4c70e 100644
@@ -63,6 +63,19 @@ void board_poll_devices(void)
 #endif
 }
 
+int board_usb_vbus_init(void)
+{
+	int err;
+	err = exynos_pinmux_config(PERIPH_ID_USB20, PINMUX_FLAG_NONE);
+	if (err) {
+		debug("VBUS not configured\n");
+		return err;
+	}
+	/* VBUS turn ON time */
+	mdelay(3);
+        return 0;
+}
+
 int board_init(void)
 {
 	gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
@@ -80,6 +93,10 @@ int board_init(void)
 #ifdef CONFIG_EXYNOS_SPI
 	spi_init();
 #endif
+
+#ifdef CONFIG_USB_EHCI_EXYNOS
+	board_usb_vbus_init();
+#endif
 	return 0;
 }
 
Signature · 1 line
1.7.4.4
#6 lore raw

PATCH 2/2 SMDK5250: Enable VBus for USB

Hi Rajeshwari,

Quoted 13 lines · Rajeshwari Shinde

This patch enables Vbus required for USB.

---
 board/samsung/smdk5250/smdk5250.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
board/samsung/smdk5250/smdk5250.c +0 -0
index 5ebc665..fb4c70e 100644

board/samsung/smdk5250/smdk5250.c void board_poll_devices(void) · line 68

Quoted 6 lines
board/samsung/smdk5250/smdk5250.c +3 -0
@@ -63,6 +63,19 @@ void board_poll_devices(void)
 #endif
 }
 
+int board_usb_vbus_init(void)
+{
+       int err;

blank line here

board/samsung/smdk5250/smdk5250.c void board_poll_devices(void) · line 75

Quoted 7 lines
board/samsung/smdk5250/smdk5250.c +7 -0
+       err = exynos_pinmux_config(PERIPH_ID_USB20, PINMUX_FLAG_NONE);
+       if (err) {
+               debug("VBUS not configured\n");
+               return err;
+       }
+       /* VBUS turn ON time */
+       mdelay(3);

and here

board/samsung/smdk5250/smdk5250.c int board_init(void) · line 96

Quoted 11 lines
board/samsung/smdk5250/smdk5250.c +4 -0
+        return 0;
+}
+
 int board_init(void)
 {
        gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
@@ -80,6 +93,10 @@ int board_init(void)
 #ifdef CONFIG_EXYNOS_SPI
        spi_init();
 #endif
+

Perhaps could omit this blank line.

Quoted 9 lines
board/samsung/smdk5250/smdk5250.c +3 -1
+#ifdef CONFIG_USB_EHCI_EXYNOS
+       board_usb_vbus_init();
+#endif
        return 0;
 }
 
--

1.7.4.4

Regards
Simon

#7 lore raw

cover EXYNOS5: Add VBus init required for USB

In reply to Rajeshwari Shinde

Dear Rajeshwari Shinde,

Quoted 10 lines

This patch sets adds pinmux for USB and function to init VBus.

Rajeshwari Shinde (2):
EXYNOS5: Add pinmux for VBus
SMDK5250: Enable VBus for USB

 arch/arm/cpu/armv7/exynos/pinmux.c        |   10 ++++++++++
 arch/arm/include/asm/arch-exynos/periph.h |    1 +
 board/samsung/smdk5250/smdk5250.c         |   17 +++++++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)

I'll not apply this until you sort out the issue with Kyungmin .

Best regards,
Marek Vasut