Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272865
b: refs/heads/master
c: 29ea359
h: refs/heads/master
i:
  272863: 3daf454
v: v3
  • Loading branch information
Arnd Bergmann committed Oct 20, 2011
1 parent 0e2fe72 commit cbadd15
Show file tree
Hide file tree
Showing 26 changed files with 620 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4cbb8a4e602ea77b0525d06eff89c6a6070dab3
refs/heads/master: 29ea35969b92a4be122a58c4aceea8c5e2c388d9
9 changes: 7 additions & 2 deletions trunk/arch/arm/boot/dts/prima2-cb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
compatible = "sirf,prima2-rstc";
reg = <0x88010000 0x1000>;
};

rsc-controller@88020000 {
compatible = "sirf,prima2-rsc";
reg = <0x88020000 0x1000>;
};
};

mem-iobg {
Expand Down Expand Up @@ -274,7 +279,7 @@
gpio: gpio-controller@b0120000 {
#gpio-cells = <2>;
#interrupt-cells = <2>;
compatible = "sirf,prima2-gpio";
compatible = "sirf,prima2-gpio-pinmux";
reg = <0xb0120000 0x10000>;
gpio-controller;
interrupt-controller;
Expand Down Expand Up @@ -358,7 +363,7 @@
};

rtc-iobg {
compatible = "sirf,prima2-rtciobg", "simple-bus";
compatible = "sirf,prima2-rtciobg", "sirf-prima2-rtciobg-bus";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x80030000 0x10000>;
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-at91/at91cap9.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
};

static struct clk_lookup usart_clocks_lookups[] = {
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-at91/at91cap9_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)
at91_set_gpio_output(data->vbus_pin[i], 0);
}

/* Enable overcurrent notification */
for (i = 0; i < data->ports; i++) {
if (data->overcurrent_pin[i])
at91_set_gpio_input(data->overcurrent_pin[i], 1);
}

usbh_data = *data;
platform_device_register(&at91_usbh_device);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-at91/at91rm9200.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
};

static struct clk_lookup usart_clocks_lookups[] = {
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-at91/at91rm9200_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@ static struct platform_device at91rm9200_usbh_device = {

void __init at91_add_device_usbh(struct at91_usbh_data *data)
{
int i;

if (!data)
return;

/* Enable overcurrent notification */
for (i = 0; i < data->ports; i++) {
if (data->overcurrent_pin[i])
at91_set_gpio_input(data->overcurrent_pin[i], 1);
}

usbh_data = *data;
platform_device_register(&at91rm9200_usbh_device);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-at91/at91sam9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t4_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t5_clk", "atmel_tcb.1", &tc5_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
};

static struct clk_lookup usart_clocks_lookups[] = {
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-at91/at91sam9260_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,17 @@ static struct platform_device at91_usbh_device = {

void __init at91_add_device_usbh(struct at91_usbh_data *data)
{
int i;

if (!data)
return;

/* Enable overcurrent notification */
for (i = 0; i < data->ports; i++) {
if (data->overcurrent_pin[i])
at91_set_gpio_input(data->overcurrent_pin[i], 1);
}

usbh_data = *data;
platform_device_register(&at91_usbh_device);
}
Expand Down
29 changes: 15 additions & 14 deletions trunk/arch/arm/mach-at91/at91sam9261.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ static struct clk lcdc_clk = {
.type = CLK_TYPE_PERIPHERAL,
};

/* HClocks */
static struct clk hck0 = {
.name = "hck0",
.pmc_mask = AT91_PMC_HCK0,
.type = CLK_TYPE_SYSTEM,
.id = 0,
};
static struct clk hck1 = {
.name = "hck1",
.pmc_mask = AT91_PMC_HCK1,
.type = CLK_TYPE_SYSTEM,
.id = 1,
};

static struct clk *periph_clocks[] __initdata = {
&pioA_clk,
&pioB_clk,
Expand Down Expand Up @@ -161,6 +175,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
};

static struct clk_lookup usart_clocks_lookups[] = {
Expand Down Expand Up @@ -199,20 +214,6 @@ static struct clk pck3 = {
.id = 3,
};

/* HClocks */
static struct clk hck0 = {
.name = "hck0",
.pmc_mask = AT91_PMC_HCK0,
.type = CLK_TYPE_SYSTEM,
.id = 0,
};
static struct clk hck1 = {
.name = "hck1",
.pmc_mask = AT91_PMC_HCK1,
.type = CLK_TYPE_SYSTEM,
.id = 1,
};

static void __init at91sam9261_register_clocks(void)
{
int i;
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-at91/at91sam9261_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,17 @@ static struct platform_device at91sam9261_usbh_device = {

void __init at91_add_device_usbh(struct at91_usbh_data *data)
{
int i;

if (!data)
return;

/* Enable overcurrent notification */
for (i = 0; i < data->ports; i++) {
if (data->overcurrent_pin[i])
at91_set_gpio_input(data->overcurrent_pin[i], 1);
}

usbh_data = *data;
platform_device_register(&at91sam9261_usbh_device);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-at91/at91sam9263.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
};

static struct clk_lookup usart_clocks_lookups[] = {
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-at91/at91sam9263_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)
at91_set_gpio_output(data->vbus_pin[i], 0);
}

/* Enable overcurrent notification */
for (i = 0; i < data->ports; i++) {
if (data->overcurrent_pin[i])
at91_set_gpio_input(data->overcurrent_pin[i], 1);
}

usbh_data = *data;
platform_device_register(&at91_usbh_device);
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-at91/at91sam9g45.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &uhphs_clk),
};

static struct clk_lookup usart_clocks_lookups[] = {
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-at91/at91sam9g45_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)
at91_set_gpio_output(data->vbus_pin[i], 0);
}

/* Enable overcurrent notification */
for (i = 0; i < data->ports; i++) {
if (data->overcurrent_pin[i])
at91_set_gpio_input(data->overcurrent_pin[i], 1);
}

usbh_ohci_data = *data;
platform_device_register(&at91_usbh_ohci_device);
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/arm/mach-at91/include/mach/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ extern void __init at91_add_device_eth(struct at91_eth_data *data);
struct at91_usbh_data {
u8 ports; /* number of ports on root hub */
u8 vbus_pin[2]; /* port power-control pin */
u8 vbus_pin_inverted;
u8 overcurrent_supported;
u8 overcurrent_pin[2];
u8 overcurrent_status[2];
u8 overcurrent_changed[2];
};
extern void __init at91_add_device_usbh(struct at91_usbh_data *data);
extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data);
Expand Down
10 changes: 10 additions & 0 deletions trunk/arch/arm/mach-davinci/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ config DA850_UI_RMII

endchoice

config DA850_WL12XX
bool "AM18x wl1271 daughter board"
depends on MACH_DAVINCI_DA850_EVM
help
The wl1271 daughter card for AM18x EVMs is a combo wireless
connectivity add-on card, based on the LS Research TiWi module with
Texas Instruments' wl1271 solution.
Say Y if you want to use a wl1271 expansion card connected to the
AM18x EVM.

config GPIO_PCA953X
default MACH_DAVINCI_DA850_EVM

Expand Down
114 changes: 114 additions & 0 deletions trunk/arch/arm/mach-davinci/board-da850-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <linux/input/tps6507x-ts.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
#include <linux/delay.h>
#include <linux/wl12xx.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Expand All @@ -49,6 +51,9 @@
#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)

#define DA850_WLAN_EN GPIO_TO_PIN(6, 9)
#define DA850_WLAN_IRQ GPIO_TO_PIN(6, 10)

#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)

static struct mtd_partition da850evm_spiflash_part[] = {
Expand Down Expand Up @@ -1143,6 +1148,110 @@ static __init int da850_evm_init_cpufreq(void)
static __init int da850_evm_init_cpufreq(void) { return 0; }
#endif

#ifdef CONFIG_DA850_WL12XX

static void wl12xx_set_power(int index, bool power_on)
{
static bool power_state;

pr_debug("Powering %s wl12xx", power_on ? "on" : "off");

if (power_on == power_state)
return;
power_state = power_on;

if (power_on) {
/* Power up sequence required for wl127x devices */
gpio_set_value(DA850_WLAN_EN, 1);
usleep_range(15000, 15000);
gpio_set_value(DA850_WLAN_EN, 0);
usleep_range(1000, 1000);
gpio_set_value(DA850_WLAN_EN, 1);
msleep(70);
} else {
gpio_set_value(DA850_WLAN_EN, 0);
}
}

static struct davinci_mmc_config da850_wl12xx_mmc_config = {
.set_power = wl12xx_set_power,
.wires = 4,
.max_freq = 25000000,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
MMC_CAP_POWER_OFF_CARD,
.version = MMC_CTLR_VERSION_2,
};

static const short da850_wl12xx_pins[] __initconst = {
DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
DA850_GPIO6_9, DA850_GPIO6_10,
-1
};

static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
.irq = -1,
.board_ref_clock = WL12XX_REFCLOCK_38,
.platform_quirks = WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
};

static __init int da850_wl12xx_init(void)
{
int ret;

ret = davinci_cfg_reg_list(da850_wl12xx_pins);
if (ret) {
pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
goto exit;
}

ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
if (ret) {
pr_err("wl12xx/mmc registration failed: %d\n", ret);
goto exit;
}

ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
if (ret) {
pr_err("Could not request wl12xx enable gpio: %d\n", ret);
goto exit;
}

ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
if (ret) {
pr_err("Could not request wl12xx irq gpio: %d\n", ret);
goto free_wlan_en;
}

da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);

ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
if (ret) {
pr_err("Could not set wl12xx data: %d\n", ret);
goto free_wlan_irq;
}

return 0;

free_wlan_irq:
gpio_free(DA850_WLAN_IRQ);

free_wlan_en:
gpio_free(DA850_WLAN_EN);

exit:
return ret;
}

#else /* CONFIG_DA850_WL12XX */

static __init int da850_wl12xx_init(void)
{
return 0;
}

#endif /* CONFIG_DA850_WL12XX */

#define DA850EVM_SATA_REFCLKPN_RATE (100 * 1000 * 1000)

static __init void da850_evm_init(void)
Expand Down Expand Up @@ -1197,6 +1306,11 @@ static __init void da850_evm_init(void)
if (ret)
pr_warning("da850_evm_init: mmcsd0 registration failed:"
" %d\n", ret);

ret = da850_wl12xx_init();
if (ret)
pr_warning("da850_evm_init: wl12xx initialization"
" failed: %d\n", ret);
}

davinci_serial_init(&da850_evm_uart_config);
Expand Down
Loading

0 comments on commit cbadd15

Please sign in to comment.