Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208668
b: refs/heads/master
c: fb54d26
h: refs/heads/master
v: v3
  • Loading branch information
Kuninori Morimoto authored and Paul Mundt committed Apr 15, 2010
1 parent dbf6528 commit 8f5f7bc
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0fff9ec116f2073553cd9b1d1afdc503cf10ef60
refs/heads/master: fb54d268329846aa13b2bc44a64d90e9b7131192
63 changes: 63 additions & 0 deletions trunk/arch/arm/mach-shmobile/board-ap4evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/gpio.h>
#include <linux/input.h>
#include <linux/input/sh_keysc.h>
#include <linux/usb/r8a66597.h>
#include <mach/common.h>
#include <mach/sh7372.h>
#include <asm/mach-types.h>
Expand Down Expand Up @@ -94,6 +95,15 @@
* OFF | KEY / IrDA / IRQ | IRQ |
*/

/*
* USB
*
* J7 : 1-2 MAX3355E VBUS
* 2-3 DC 5.0V
*
* S39: bit2: off
*/

/* MTD */
static struct mtd_partition nor_flash_partitions[] = {
{
Expand Down Expand Up @@ -233,11 +243,53 @@ static struct platform_device sdhi0_device = {
.id = 0,
};

/* USB1 */
void usb1_host_port_power(int port, int power)
{
if (!power) /* only power-on supported for now */
return;

/* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
__raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
}

static struct r8a66597_platdata usb1_host_data = {
.on_chip = 1,
.port_power = usb1_host_port_power,
};

static struct resource usb1_host_resources[] = {
[0] = {
.name = "USBHS",
.start = 0xE68B0000,
.end = 0xE68B00E6 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 215,
.end = 215,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device usb1_host_device = {
.name = "r8a66597_hcd",
.id = 1,
.dev = {
.dma_mask = NULL, /* not use dma */
.coherent_dma_mask = 0xffffffff,
.platform_data = &usb1_host_data,
},
.num_resources = ARRAY_SIZE(usb1_host_resources),
.resource = usb1_host_resources,
};

static struct platform_device *ap4evb_devices[] __initdata = {
&nor_flash_device,
&smc911x_device,
&keysc_device,
&sdhi0_device,
&usb1_host_device,
};

/* TouchScreen (Needs SW3 set to OFF) */
Expand Down Expand Up @@ -351,6 +403,17 @@ static void __init ap4evb_init(void)
i2c_register_board_info(1, i2c1_devices,
ARRAY_SIZE(i2c1_devices));

/* USB enable */
gpio_request(GPIO_FN_VBUS0_1, NULL);
gpio_request(GPIO_FN_IDIN_1_18, NULL);
gpio_request(GPIO_FN_PWEN_1_115, NULL);
gpio_request(GPIO_FN_OVCN_1_114, NULL);
gpio_request(GPIO_FN_EXTLP_1, NULL);
gpio_request(GPIO_FN_OVCN2_1, NULL);

/* setup USB phy */
__raw_writew(0x8a0a, 0xE6058130); /* USBCR2 */

sh7372_add_standard_devices();

platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
Expand Down

0 comments on commit 8f5f7bc

Please sign in to comment.