Skip to content

Commit

Permalink
Merge branch 'at91-fixes' of git://github.com/at91linux/linux-at91 in…
Browse files Browse the repository at this point in the history
…to fixes

* 'at91-fixes' of git://github.com/at91linux/linux-at91:
  ARM: at91: dt: remove unit-address part for memory nodes
  ARM: at91: fix check of valid GPIO for SPI and USB
  USB: ehci-atmel: add needed of.h header file
  ARM: at91/NAND DT bindings: add comments
  ARM: at91/at91sam9x5.dtsi: fix NAND ale/cle in DT file
  USB: ohci-at91: trivial return code name change
  USB: ohci-at91: change maximum number of ports
  USB: ohci-at91: rework and fix initialization
  ARM: at91/dts: USB host vbus is active low
  ARM: at91/USB host: specify and handle properly vbus_pin_active_low
  USB: ohci-at91: fix vbus_pin_active_low handling
  ARM: at91/at91sam9x5: add clkdev entries for DMA controllers
  • Loading branch information
olofj committed Apr 5, 2012
2 parents 98f0ec0 + dcce6ce commit 8078342
Show file tree
Hide file tree
Showing 19 changed files with 137 additions and 104 deletions.
10 changes: 5 additions & 5 deletions Documentation/devicetree/bindings/mtd/atmel-nand.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ nand0: nand@40000000,0 {
reg = <0x40000000 0x10000000
0xffffe800 0x200
>;
atmel,nand-addr-offset = <21>;
atmel,nand-cmd-offset = <22>;
atmel,nand-addr-offset = <21>; /* ale */
atmel,nand-cmd-offset = <22>; /* cle */
nand-on-flash-bbt;
nand-ecc-mode = "soft";
gpios = <&pioC 13 0
&pioC 14 0
0
gpios = <&pioC 13 0 /* rdy */
&pioC 14 0 /* nce */
0 /* cd */
>;
partition@0 {
...
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/at91sam9g20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
};
};

memory@20000000 {
memory {
reg = <0x20000000 0x08000000>;
};

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/at91sam9g25ek.dts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
usb0: ohci@00600000 {
status = "okay";
num-ports = <2>;
atmel,vbus-gpio = <&pioD 19 0
&pioD 20 0
atmel,vbus-gpio = <&pioD 19 1
&pioD 20 1
>;
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/at91sam9g45.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
};
};

memory@70000000 {
memory {
reg = <0x70000000 0x10000000>;
};

Expand Down
6 changes: 3 additions & 3 deletions arch/arm/boot/dts/at91sam9m10g45ek.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
};

memory@70000000 {
memory {
reg = <0x70000000 0x4000000>;
};

Expand Down Expand Up @@ -73,8 +73,8 @@
usb0: ohci@00700000 {
status = "okay";
num-ports = <2>;
atmel,vbus-gpio = <&pioD 1 0
&pioD 3 0>;
atmel,vbus-gpio = <&pioD 1 1
&pioD 3 1>;
};

usb1: ehci@00800000 {
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/boot/dts/at91sam9x5.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
};
};

memory@20000000 {
memory {
reg = <0x20000000 0x10000000>;
};

Expand Down Expand Up @@ -201,8 +201,8 @@
>;
atmel,nand-addr-offset = <21>;
atmel,nand-cmd-offset = <22>;
gpios = <&pioC 8 0
&pioC 14 0
gpios = <&pioD 5 0
&pioD 4 0
0
>;
status = "disabled";
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/at91sam9x5cm.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

/ {
memory@20000000 {
memory {
reg = <0x20000000 0x8000000>;
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/usb_a9g20.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs";
};

memory@20000000 {
memory {
reg = <0x20000000 0x4000000>;
};

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-at91/at91sam9260_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
else
cs_pin = spi1_standard_cs[devices[i].chip_select];

if (!gpio_is_valid(cs_pin))
continue;

if (devices[i].bus_num == 0)
enable_spi0 = 1;
else
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-at91/at91sam9261_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
else
cs_pin = spi1_standard_cs[devices[i].chip_select];

if (!gpio_is_valid(cs_pin))
continue;

if (devices[i].bus_num == 0)
enable_spi0 = 1;
else
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-at91/at91sam9263_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data)
/* Enable VBus control for UHP ports */
for (i = 0; i < data->ports; i++) {
if (gpio_is_valid(data->vbus_pin[i]))
at91_set_gpio_output(data->vbus_pin[i], 0);
at91_set_gpio_output(data->vbus_pin[i],
data->vbus_pin_active_low[i]);
}

/* Enable overcurrent notification */
Expand Down Expand Up @@ -671,6 +672,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
else
cs_pin = spi1_standard_cs[devices[i].chip_select];

if (!gpio_is_valid(cs_pin))
continue;

if (devices[i].bus_num == 0)
enable_spi0 = 1;
else
Expand Down
11 changes: 8 additions & 3 deletions arch/arm/mach-at91/at91sam9g45_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)
/* Enable VBus control for UHP ports */
for (i = 0; i < data->ports; i++) {
if (gpio_is_valid(data->vbus_pin[i]))
at91_set_gpio_output(data->vbus_pin[i], 0);
at91_set_gpio_output(data->vbus_pin[i],
data->vbus_pin_active_low[i]);
}

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

Expand Down Expand Up @@ -188,7 +189,8 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data)
/* Enable VBus control for UHP ports */
for (i = 0; i < data->ports; i++) {
if (gpio_is_valid(data->vbus_pin[i]))
at91_set_gpio_output(data->vbus_pin[i], 0);
at91_set_gpio_output(data->vbus_pin[i],
data->vbus_pin_active_low[i]);
}

usbh_ehci_data = *data;
Expand Down Expand Up @@ -785,6 +787,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
else
cs_pin = spi1_standard_cs[devices[i].chip_select];

if (!gpio_is_valid(cs_pin))
continue;

if (devices[i].bus_num == 0)
enable_spi0 = 1;
else
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-at91/at91sam9rl_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
else
cs_pin = spi_standard_cs[devices[i].chip_select];

if (!gpio_is_valid(cs_pin))
continue;

/* enable chip-select pin */
at91_set_gpio_output(cs_pin, 1);

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-at91/at91sam9x5.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk),
CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb0_clk),
CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk),
CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk),
CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk),
CLKDEV_CON_ID("pioA", &pioAB_clk),
CLKDEV_CON_ID("pioB", &pioAB_clk),
CLKDEV_CON_ID("pioC", &pioCD_clk),
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-at91/board-sam9263ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static void __init ek_init_early(void)
static struct at91_usbh_data __initdata ek_usbh_data = {
.ports = 2,
.vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 },
.vbus_pin_active_low = {1, 1},
.overcurrent_pin= {-EINVAL, -EINVAL},
};

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-at91/board-sam9m10g45ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static void __init ek_init_early(void)
static struct at91_usbh_data __initdata ek_usbh_hs_data = {
.ports = 2,
.vbus_pin = {AT91_PIN_PD1, AT91_PIN_PD3},
.vbus_pin_active_low = {1, 1},
.overcurrent_pin= {-EINVAL, -EINVAL},
};

Expand Down
13 changes: 7 additions & 6 deletions arch/arm/mach-at91/include/mach/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *d
extern void __init at91_add_device_eth(struct macb_platform_data *data);

/* USB Host */
#define AT91_MAX_USBH_PORTS 3
struct at91_usbh_data {
u8 ports; /* number of ports on root hub */
int vbus_pin[2]; /* port power-control pin */
u8 vbus_pin_active_low[2];
int vbus_pin[AT91_MAX_USBH_PORTS]; /* port power-control pin */
int overcurrent_pin[AT91_MAX_USBH_PORTS];
u8 ports; /* number of ports on root hub */
u8 overcurrent_supported;
int overcurrent_pin[2];
u8 overcurrent_status[2];
u8 overcurrent_changed[2];
u8 vbus_pin_active_low[AT91_MAX_USBH_PORTS];
u8 overcurrent_status[AT91_MAX_USBH_PORTS];
u8 overcurrent_changed[AT91_MAX_USBH_PORTS];
};
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
1 change: 1 addition & 0 deletions drivers/usb/host/ehci-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_platform.h>

/* interface and function clocks */
Expand Down
Loading

0 comments on commit 8078342

Please sign in to comment.