Skip to contentSkip to conversation

at91: 3.4-rc1 fixes

PATCH In review Nicolas Ferre 5 participants 23 messages Apr 3, 2012 – Apr 7, 2012 1 message not in the archive

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

v2 cover at91: 3.4-rc1 fixes

Here is a bunch of fixes for AT91 that will go on top of 3.4-rc1. Some modifications are related to certain drivers (USB ohci-at91 for instance) but are touching the core AT91 devices/board files and Device Tree files. The modification of "vbus_pin_active_low" in particular cannot be separated from the modification of .dts[i] and devices/board files.

I will have to collect "Acked-by" from USB people on the ohci-at91 modifications (Greg?). I will try to find them just after having posted this v2 today...

Ludovic Desroches (1):
ARM: at91: dt: remove unit-address part for memory nodes

Nicolas Ferre (12):
ARM: at91/at91sam9x5: add clkdev entries for DMA controllers
USB: ohci-at91: fix vbus_pin_active_low handling
ARM: at91/USB host: specify and handle properly vbus_pin_active_low
ARM: at91/dts: USB host vbus is active low
USB: ohci-at91: rework and fix initialization
USB: ohci-at91: change maximum number of ports
USB: ohci-at91: coding style modifications with one-line ifs
USB: ohci-at91: trivial return code name change
ARM: at91/at91sam9x5.dtsi: fix NAND ale/cle in DT file
ARM: at91/NAND DT bindings: add comments
USB: ehci-atmel: add needed of.h header file
ARM: at91: fix check of valid GPIO for SPI and USB

 .../devicetree/bindings/mtd/atmel-nand.txt         |   10 +-
 arch/arm/boot/dts/at91sam9g20.dtsi                 |    2 +-
 arch/arm/boot/dts/at91sam9g25ek.dts                |    4 +-
 arch/arm/boot/dts/at91sam9g45.dtsi                 |    2 +-
 arch/arm/boot/dts/at91sam9m10g45ek.dts             |    6 +-
 arch/arm/boot/dts/at91sam9x5.dtsi                  |    6 +-
 arch/arm/boot/dts/at91sam9x5cm.dtsi                |    2 +-
 arch/arm/boot/dts/usb_a9g20.dts                    |    2 +-
 arch/arm/mach-at91/at91sam9260_devices.c           |    3 +
 arch/arm/mach-at91/at91sam9261_devices.c           |    3 +
 arch/arm/mach-at91/at91sam9263_devices.c           |    6 +-
 arch/arm/mach-at91/at91sam9g45_devices.c           |   11 +-
 arch/arm/mach-at91/at91sam9rl_devices.c            |    3 +
 arch/arm/mach-at91/at91sam9x5.c                    |    2 +
 arch/arm/mach-at91/board-sam9263ek.c               |    1 +
 arch/arm/mach-at91/board-sam9m10g45ek.c            |    1 +
 arch/arm/mach-at91/include/mach/board.h            |   13 +-
 drivers/usb/host/ehci-atmel.c                      |    1 +
 drivers/usb/host/ohci-at91.c                       |  159 +++++++++++---------
 19 files changed, 135 insertions(+), 102 deletions(-)

Thanks, best regards,

Signature · 1 line
1.7.9.4
#1 lore raw

PATCH v2 1/13 ARM: at91/at91sam9x5: add clkdev entries for DMA controllers

---
 arch/arm/mach-at91/at91sam9x5.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-at91/at91sam9x5.c +2 -0
index b6831ee..13c8cae 100644
@@ -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),
Signature · 1 line
1.7.9.4
#2 lore raw

PATCH v2 2/13 USB: ohci-at91: fix vbus_pin_active_low handling

In reply to Nicolas Ferre

The information is not properly taken into account for {get|set}_power() functions.

---
 drivers/usb/host/ohci-at91.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-at91.c +2 -2
index db8963f..4d266ae 100644
@@ -247,7 +247,7 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int
 		return;
 
 	gpio_set_value(pdata->vbus_pin[port],
-		       !pdata->vbus_pin_active_low[port] ^ enable);
+		       pdata->vbus_pin_active_low[port] ^ enable);
 }
 
 static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port)
@@ -259,7 +259,7 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port)
 		return -EINVAL;
 
 	return gpio_get_value(pdata->vbus_pin[port]) ^
-		!pdata->vbus_pin_active_low[port];
+		pdata->vbus_pin_active_low[port];
 }
 
 /*
Signature · 1 line
1.7.9.4
#3 lore raw

PATCH v2 3/13 ARM: at91/USB host: specify and handle properly vbus_pin_active_low

In reply to Nicolas Ferre

Due to an error while handling vbus_pin_active_low in ohci-at91 driver, the specification of this property was not good in devices/board files.

---
 arch/arm/mach-at91/at91sam9263_devices.c |    3 ++-
 arch/arm/mach-at91/at91sam9g45_devices.c |    6 ++++--
 arch/arm/mach-at91/board-sam9263ek.c     |    1 +
 arch/arm/mach-at91/board-sam9m10g45ek.c  |    1 +
 4 files changed, 8 insertions(+), 3 deletions(-)
arch/arm/mach-at91/at91sam9263_devices.c +2 -1
index 53688c4..27cfce3 100644
@@ -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 */
arch/arm/mach-at91/at91sam9g45_devices.c +4 -2
index 698479f..ddf210a 100644
@@ -127,7 +127,8 @@ 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 */
@@ -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;
arch/arm/mach-at91/board-sam9263ek.c +1 -0
index 66f0ddf..2ffe50f 100644
@@ -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},
 };
 
arch/arm/mach-at91/board-sam9m10g45ek.c +1 -0
index e1bea73..c88e908 100644
@@ -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},
 };
 
Signature · 1 line
1.7.9.4
#4 lore raw

PATCH v2 4/13 ARM: at91/dts: USB host vbus is active low

In reply to Nicolas Ferre

Change vbus gpio configuration in .dts files to switch to active low configuration.

---
 arch/arm/boot/dts/at91sam9g25ek.dts    |    4 ++--
 arch/arm/boot/dts/at91sam9m10g45ek.dts |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/at91sam9g25ek.dts +2 -2
index ac0dc00..7829a4d 100644
@@ -37,8 +37,8 @@
 		usb0: ohci at 00600000 {
 			status = "okay";
 			num-ports = <2>;
-			atmel,vbus-gpio = <&pioD 19 0
-					   &pioD 20 0
+			atmel,vbus-gpio = <&pioD 19 1
+					   &pioD 20 1
 					  >;
 		};
 
arch/arm/boot/dts/at91sam9m10g45ek.dts +2 -2
index c4c8ae4..6abb571 100644
@@ -73,8 +73,8 @@
 		usb0: ohci at 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 at 00800000 {
Signature · 1 line
1.7.9.4
#5 lore raw

PATCH v2 5/13 USB: ohci-at91: rework and fix initialization

In reply to Nicolas Ferre

The DT information are filled in a pdata structure and then passed on to the usual check code of the probe function. Thus we do not need to redo the gpio checking and irq configuration in the DT-related code. On the other hand, we setup GPIO direction in driver for vbus and overcurrent. It will be useful when moving to pinctrl subsystem.

---
 drivers/usb/host/ohci-at91.c |   88 ++++++++++++++++++++++--------------------
 1 file changed, 46 insertions(+), 42 deletions(-)
drivers/usb/host/ohci-at91.c +46 -42
index 4d266ae..c30da6a 100644
@@ -492,7 +492,7 @@ static u64 at91_ohci_dma_mask = DMA_BIT_MASK(32);
 static int __devinit ohci_at91_of_init(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	int i, ret, gpio;
+	int i, gpio;
 	enum of_gpio_flags flags;
 	struct at91_usbh_data	*pdata;
 	u32 ports;
@@ -520,42 +520,11 @@ static int __devinit ohci_at91_of_init(struct platform_device *pdev)
 		if (!gpio_is_valid(gpio))
 			continue;
 		pdata->vbus_pin_active_low[i] = flags & OF_GPIO_ACTIVE_LOW;
-		ret = gpio_request(gpio, "ohci_vbus");
-		if (ret) {
-			dev_warn(&pdev->dev, "can't request vbus gpio %d", gpio);
-			continue;
-		}
-		ret = gpio_direction_output(gpio, !(flags & OF_GPIO_ACTIVE_LOW) ^ 1);
-		if (ret)
-			dev_warn(&pdev->dev, "can't put vbus gpio %d as output %d",
-				 !(flags & OF_GPIO_ACTIVE_LOW) ^ 1, gpio);
 	}
 
-	for (i = 0; i < 2; i++) {
-		gpio = of_get_named_gpio_flags(np, "atmel,oc-gpio", i, &flags);
-		pdata->overcurrent_pin[i] = gpio;
-		if (!gpio_is_valid(gpio))
-			continue;
-		ret = gpio_request(gpio, "ohci_overcurrent");
-		if (ret) {
-			dev_err(&pdev->dev, "can't request overcurrent gpio %d", gpio);
-			continue;
-		}
-
-		ret = gpio_direction_input(gpio);
-		if (ret) {
-			dev_err(&pdev->dev, "can't configure overcurrent gpio %d as input", gpio);
-			continue;
-		}
-
-		ret = request_irq(gpio_to_irq(gpio),
-				  ohci_hcd_at91_overcurrent_irq,
-				  IRQF_SHARED, "ohci_overcurrent", pdev);
-		if (ret) {
-			gpio_free(gpio);
-			dev_warn(& pdev->dev, "cannot get GPIO IRQ for overcurrent\n");
-		}
-	}
+	for (i = 0; i < 2; i++)
+		pdata->overcurrent_pin[i] =
+			of_get_named_gpio_flags(np, "atmel,oc-gpio", i, &flags);
 
 	pdev->dev.platform_data = pdata;
 
@@ -574,6 +543,8 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
 {
 	struct at91_usbh_data	*pdata;
 	int			i;
+	int			gpio;
+	int			ret;
 
 	i = ohci_at91_of_init(pdev);
 
@@ -586,23 +557,56 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
 		for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
 			if (!gpio_is_valid(pdata->vbus_pin[i]))
 				continue;
-			gpio_request(pdata->vbus_pin[i], "ohci_vbus");
+			gpio = pdata->vbus_pin[i];
+
+			ret = gpio_request(gpio, "ohci_vbus");
+			if (ret) {
+				dev_err(&pdev->dev,
+					"can't request vbus gpio %d\n", gpio);
+				continue;
+			}
+			ret = gpio_direction_output(gpio,
+						!pdata->vbus_pin_active_low[i]);
+			if (ret) {
+				dev_err(&pdev->dev,
+					"can't put vbus gpio %d as output %d\n",
+					gpio, !pdata->vbus_pin_active_low[i]);
+				gpio_free(gpio);
+				continue;
+			}
+
 			ohci_at91_usb_set_power(pdata, i, 1);
 		}
 
 		for (i = 0; i < ARRAY_SIZE(pdata->overcurrent_pin); i++) {
-			int ret;
-
 			if (!gpio_is_valid(pdata->overcurrent_pin[i]))
 				continue;
-			gpio_request(pdata->overcurrent_pin[i], "ohci_overcurrent");
+			gpio = pdata->overcurrent_pin[i];
+
+			ret = gpio_request(gpio, "ohci_overcurrent");
+			if (ret) {
+				dev_err(&pdev->dev,
+					"can't request overcurrent gpio %d\n",
+					gpio);
+				continue;
+			}
+
+			ret = gpio_direction_input(gpio);
+			if (ret) {
+				dev_err(&pdev->dev,
+					"can't configure overcurrent gpio %d as input\n",
+					gpio);
+				gpio_free(gpio);
+				continue;
+			}
 
-			ret = request_irq(gpio_to_irq(pdata->overcurrent_pin[i]),
+			ret = request_irq(gpio_to_irq(gpio),
 					  ohci_hcd_at91_overcurrent_irq,
 					  IRQF_SHARED, "ohci_overcurrent", pdev);
 			if (ret) {
-				gpio_free(pdata->overcurrent_pin[i]);
-				dev_warn(& pdev->dev, "cannot get GPIO IRQ for overcurrent\n");
+				gpio_free(gpio);
+				dev_err(&pdev->dev,
+					"can't get gpio IRQ for overcurrent\n");
 			}
 		}
 	}
Signature · 1 line
1.7.9.4
#6 lore raw

PATCH v2 6/13 USB: ohci-at91: change maximum number of ports

In reply to Nicolas Ferre

Change number of ports to 3 for newer SoCs. Modify pdata structure and ohci-at91 code that was dealing with ports information and check of port indexes.

---
 arch/arm/mach-at91/include/mach/board.h |   13 +++----
 drivers/usb/host/ohci-at91.c            |   58 ++++++++++++++++++-------------
 2 files changed, 41 insertions(+), 30 deletions(-)
arch/arm/mach-at91/include/mach/board.h +7 -6
index 544a5d5..49a8211 100644
@@ -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);
drivers/usb/host/ohci-at91.c +34 -24

176 lines not on this page · raw message

Signature · 1 line
1.7.9.4
maintainer
#7 lore raw

Re: [PATCH v2 06/13] USB: ohci-at91: change maximum number of ports

Quoted 6 lines · Nicolas Ferre

Change number of ports to 3 for newer SoCs. Modify pdata structure and ohci-at91 code that was dealing with ports information and check of port indexes.

Did you run this patch through scripts/checkpatch.pl? I have the feeling that it might complain about some of the changes.

Alan Stern

#8 lore raw

Re: [PATCH v2 06/13] USB: ohci-at91: change maximum number of ports

On 04/03/2012 04:11 PM, Alan Stern :

Quoted 11 lines · Nicolas Ferre
Quoted 7 lines

Change number of ports to 3 for newer SoCs. Modify pdata structure and ohci-at91 code that was dealing with ports information and check of port indexes.

Did you run this patch through scripts/checkpatch.pl? I have the feeling that it might complain about some of the changes.

Yes, definitively.

I can modify the patch to comply with error issued by checkpatch.pl: several are due to a bad replacement of previous code with my regular expression but others where existing before my modifications.
So what do you think about:
- addressing all style errors in this patch (to prevent carrying them)
- merging this one and the following patch:
"[PATCH v2 07/13] USB: ohci-at91: coding style modifications with one-line ifs
- posting a v3 of this patch only if you agree on this...

Best regards,

Signature · 1 line
Nicolas Ferre
maintainer
#9 lore raw

Re: [PATCH v2 06/13] USB: ohci-at91: change maximum number of ports

Quoted 5 lines · Nicolas Ferre
Quoted 2 lines

Did you run this patch through scripts/checkpatch.pl? I have the feeling that it might complain about some of the changes.

Yes, definitively.

Quoted 8 lines

I can modify the patch to comply with error issued by checkpatch.pl: several are due to a bad replacement of previous code with my regular expression but others where existing before my modifications.
So what do you think about:
- addressing all style errors in this patch (to prevent carrying them)
- merging this one and the following patch:
"[PATCH v2 07/13] USB: ohci-at91: coding style modifications with one-line ifs
- posting a v3 of this patch only if you agree on this...

Sure, go ahead. Aside from this minor issue I didn't notice anything objectionable in the patch series.

Alan Stern

#10 lore raw

PATCH v3 6/12 USB: ohci-at91: change maximum number of ports

Change number of ports to 3 for newer SoCs. Modify pdata structure and ohci-at91 code that was dealing with ports information and check of port indexes.
Several coding style errors have been addresses as the patch was touching affected lines of code and was producing errors while run through checkpatch.pl.

---
v3: - address all style errors in this patch (to prevent carrying them)
- merge following patch about one-line ifs

v2: - use of AT91_MAX_USBH_PORTS instead of ARRAY_SIZE()
- modify wIndex ohci_at91_hub_control() for simpler code

 arch/arm/mach-at91/include/mach/board.h |   13 +++---
 drivers/usb/host/ohci-at91.c            |   66 +++++++++++++++++--------------
 2 files changed, 43 insertions(+), 36 deletions(-)
arch/arm/mach-at91/include/mach/board.h +7 -6
index 544a5d5..49a8211 100644
@@ -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);
drivers/usb/host/ohci-at91.c +36 -30

190 lines not on this page · raw message

Signature · 1 line
1.7.9.4
maintainer Acked-by on v3 6/12
#11 lore raw

Re: [PATCH v3 06/12] USB: ohci-at91: change maximum number of ports

Quoted 7 lines · Nicolas Ferre

Change number of ports to 3 for newer SoCs. Modify pdata structure and ohci-at91 code that was dealing with ports information and check of port indexes.
Several coding style errors have been addresses as the patch was touching affected lines of code and was producing errors while run through checkpatch.pl.

Quoted 8 lines

---
v3: - address all style errors in this patch (to prevent carrying them)
- merge following patch about one-line ifs

v2: - use of AT91_MAX_USBH_PORTS instead of ARRAY_SIZE()
- modify wIndex ohci_at91_hub_control() for simpler code

This is better. For this patch and the other ones in this series affecting ohci-at91 and ehci-at91:

#12 lore raw

PATCH v2 7/13 USB: ohci-at91: coding style modifications with one-line ifs

In reply to Nicolas Ferre
---
 drivers/usb/host/ohci-at91.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/usb/host/ohci-at91.c +4 -8
index 859177c..a8e0446 100644
@@ -333,9 +333,8 @@ static int ohci_at91_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 			dev_dbg(hcd->self.controller,
 				"ClearPortFeature: OVER_CURRENT\n");
 
-			if (valid_port(wIndex)) {
+			if (valid_port(wIndex))
 				pdata->overcurrent_status[wIndex] = 0;
-			}
 
 			goto out;
 
@@ -388,17 +387,14 @@ static int ohci_at91_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 		dev_dbg(hcd->self.controller, "GetPortStatus(%d)\n", wIndex);
 
 		if (valid_port(wIndex)) {
-			if (! ohci_at91_usb_get_power(pdata, wIndex)) {
+			if (! ohci_at91_usb_get_power(pdata, wIndex))
 				*data &= ~cpu_to_le32(RH_PS_PPS);
-			}
 
-			if (pdata->overcurrent_changed[wIndex]) {
+			if (pdata->overcurrent_changed[wIndex])
 				*data |= cpu_to_le32(RH_PS_OCIC);
-			}
 
-			if (pdata->overcurrent_status[wIndex]) {
+			if (pdata->overcurrent_status[wIndex])
 				*data |= cpu_to_le32(RH_PS_POCI);
-			}
 		}
 	}
 
Signature · 1 line
1.7.9.4
#13 lore raw

PATCH v2 8/13 USB: ohci-at91: trivial return code name change

In reply to Nicolas Ferre
---
 drivers/usb/host/ohci-at91.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/usb/host/ohci-at91.c +3 -4
index a8e0446..7e1abbd 100644
@@ -552,10 +552,9 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
 	int			gpio;
 	int			ret;
 
-	i = ohci_at91_of_init(pdev);
-
-	if (i)
-		return i;
+	ret = ohci_at91_of_init(pdev);
+	if (ret)
+		return ret;
 
 	pdata = pdev->dev.platform_data;
 
Signature · 1 line
1.7.9.4
#14 lore raw

PATCH v2 9/13 ARM: at91/at91sam9x5.dtsi: fix NAND ale/cle in DT file

In reply to Nicolas Ferre
---
 arch/arm/boot/dts/at91sam9x5.dtsi |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/at91sam9x5.dtsi +2 -2
index c111001..6597177 100644
@@ -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";
Signature · 1 line
1.7.9.4
#15 lore raw

PATCH v2 10/13 ARM: at91/NAND DT bindings: add comments

In reply to Nicolas Ferre

Add comments to NAND "gpios" property to make it clearer.

---
 .../devicetree/bindings/mtd/atmel-nand.txt         |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/mtd/atmel-nand.txt +5 -5
index 5903ecf..a200695 100644
@@ -27,13 +27,13 @@ nand0: nand at 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 at 0 {
 		...
Signature · 1 line
1.7.9.4
#16 lore raw

PATCH v2 11/13 USB: ehci-atmel: add needed of.h header file

In reply to Nicolas Ferre

Compilation error in case of non-DT configuration without this of.h header file.

---
 drivers/usb/host/ehci-atmel.c |    1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/ehci-atmel.c +1 -0
index 19f318a..cf14c95 100644
@@ -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 */
Signature · 1 line
1.7.9.4
#17 lore raw

PATCH v2 12/13 ARM: at91: fix check of valid GPIO for SPI and USB

In reply to Nicolas Ferre

SPI chip select pins have to be checked by gpio_is_valid(). The USB host overcurrent_pin checking was missing.

---
 arch/arm/mach-at91/at91sam9260_devices.c |    3 +++
 arch/arm/mach-at91/at91sam9261_devices.c |    3 +++
 arch/arm/mach-at91/at91sam9263_devices.c |    3 +++
 arch/arm/mach-at91/at91sam9g45_devices.c |    5 ++++-
 arch/arm/mach-at91/at91sam9rl_devices.c  |    3 +++
 5 files changed, 16 insertions(+), 1 deletion(-)
arch/arm/mach-at91/at91sam9260_devices.c +3 -0
index 7e5651e..5652dde 100644
@@ -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
arch/arm/mach-at91/at91sam9261_devices.c +3 -0
index 096da87..4db961a 100644
@@ -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
arch/arm/mach-at91/at91sam9263_devices.c +3 -0
index 27cfce3..fe99206 100644
@@ -672,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
arch/arm/mach-at91/at91sam9g45_devices.c +4 -1
index ddf210a..6b008ae 100644
@@ -133,7 +133,7 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data)
 
 	/* 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);
 	}
 
@@ -787,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
arch/arm/mach-at91/at91sam9rl_devices.c +3 -0
index eda72e8..fe4ae22 100644
@@ -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);
 
Signature · 1 line
1.7.9.4
#18 lore raw

PATCH v2 13/13 ARM: at91: dt: remove unit-address part for memory nodes

In reply to Nicolas Ferre

From: Ludovic Desroches <[email protected]>

Having a unit-address different from 0 causes bad memory node detection during early_init_dt_scan_memory.

Cc Jean-Christophe PLAGNIOL-VILLARD <plagnioj-sclMFOaUSTBWk0Htik3J/[email protected]>
Cc devicetree-discuss-uLR06cmDAlY/[email protected]
---
 arch/arm/boot/dts/at91sam9g20.dtsi     |    2 +-
 arch/arm/boot/dts/at91sam9g45.dtsi     |    2 +-
 arch/arm/boot/dts/at91sam9m10g45ek.dts |    2 +-
 arch/arm/boot/dts/at91sam9x5.dtsi      |    2 +-
 arch/arm/boot/dts/at91sam9x5cm.dtsi    |    2 +-
 arch/arm/boot/dts/usb_a9g20.dts        |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/at91sam9g20.dtsi +1 -1
index 92f3662..799ad18 100644
@@ -35,7 +35,7 @@
 		};
 	};
 
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x08000000>;
 	};
 
arch/arm/boot/dts/at91sam9g45.dtsi +1 -1
index 3d0c32f..9e6eb6e 100644
@@ -36,7 +36,7 @@
 		};
 	};
 
-	memory@70000000 {
+	memory {
 		reg = <0x70000000 0x10000000>;
 	};
 
arch/arm/boot/dts/at91sam9m10g45ek.dts +1 -1
index 6abb571..a3633bd 100644
@@ -17,7 +17,7 @@
 		bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
 	};
 
-	memory@70000000 {
+	memory {
 		reg = <0x70000000 0x4000000>;
 	};
 
arch/arm/boot/dts/at91sam9x5.dtsi +1 -1
index 6597177..70ab3a4 100644
@@ -34,7 +34,7 @@
 		};
 	};
 
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x10000000>;
 	};
 
arch/arm/boot/dts/at91sam9x5cm.dtsi +1 -1
index 67936f8..31e7be2 100644
@@ -8,7 +8,7 @@
  */
 
 / {
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x8000000>;
 	};
 
arch/arm/boot/dts/usb_a9g20.dts +1 -1
index 3b3c4e0..7c2399c 100644
@@ -16,7 +16,7 @@
 		bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs";
 	};
 
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x4000000>;
 	};
 
Signature · 1 line
1.7.9.4

A message that is not in the archive (sent off-list or not yet received): 1db62b280314855c35cb7a3188fc9d9cb8501948.1333437885.git.nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org

Acked-by
#20 lore raw

Re: [PATCH v2 13/13] ARM: at91: dt: remove unit-address part for memory nodes

Quoted 4 lines · Nicolas Ferre

From: Ludovic Desroches <[email protected]>

Having a unit-address different from 0 causes bad memory node detection during early_init_dt_scan_memory.

Should be more detailed about the reason why. The reason is that these .dts files include skeleton.dtsi which names the memory node "memory". The code in this file creates a new memory node and doesn't modify the old one.

Otherwise;

Quoted 99 lines
Cc Jean-Christophe PLAGNIOL-VILLARD <plagnioj-sclMFOaUSTBWk0Htik3J/[email protected]>
Cc devicetree-discuss-uLR06cmDAlY/[email protected]
---
 arch/arm/boot/dts/at91sam9g20.dtsi     |    2 +-
 arch/arm/boot/dts/at91sam9g45.dtsi     |    2 +-
 arch/arm/boot/dts/at91sam9m10g45ek.dts |    2 +-
 arch/arm/boot/dts/at91sam9x5.dtsi      |    2 +-
 arch/arm/boot/dts/at91sam9x5cm.dtsi    |    2 +-
 arch/arm/boot/dts/usb_a9g20.dts        |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/at91sam9g20.dtsi +1 -1
index 92f3662..799ad18 100644
@@ -35,7 +35,7 @@
 		};
 	};
 
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x08000000>;
 	};
 
arch/arm/boot/dts/at91sam9g45.dtsi +1 -1
index 3d0c32f..9e6eb6e 100644
@@ -36,7 +36,7 @@
 		};
 	};
 
-	memory@70000000 {
+	memory {
 		reg = <0x70000000 0x10000000>;
 	};
 
arch/arm/boot/dts/at91sam9m10g45ek.dts +1 -1
index 6abb571..a3633bd 100644
@@ -17,7 +17,7 @@
 		bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
 	};
 
-	memory@70000000 {
+	memory {
 		reg = <0x70000000 0x4000000>;
 	};
 
arch/arm/boot/dts/at91sam9x5.dtsi +1 -1
index 6597177..70ab3a4 100644
@@ -34,7 +34,7 @@
 		};
 	};
 
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x10000000>;
 	};
 
arch/arm/boot/dts/at91sam9x5cm.dtsi +1 -1
index 67936f8..31e7be2 100644
@@ -8,7 +8,7 @@
  */
 
 / {
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x8000000>;
 	};
 
arch/arm/boot/dts/usb_a9g20.dts +1 -1
index 3b3c4e0..7c2399c 100644
@@ -16,7 +16,7 @@
 		bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs";
 	};
 
-	memory@20000000 {
+	memory {
 		reg = <0x20000000 0x4000000>;
 	};
 
Signature · 6 lines
1.7.9.4

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss
Signature · 2 lines
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.
Acked-by on v2 13/13
#21 lore raw

Re: [PATCH v2 13/13] ARM: at91: dt: remove unit-address part for memory nodes

In reply to Nicolas Ferre
Quoted 4 lines · Nicolas Ferre

From: Ludovic Desroches <[email protected]>

Having a unit-address different from 0 causes bad memory node detection during early_init_dt_scan_memory.

Sounds like a bug in the generic code to me? But specifying a unit address on a non-ambiguous device node isn't necessary anyway, so this patch is still a reasonable thing to do.

Quoted 4 lines
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Cc devicetree-discuss at lists.ozlabs.org

-Olof

#22 lore raw

Re: [PATCH v2 13/13] ARM: at91: dt: remove unit-address part for memory nodes

Quoted 9 lines · Olof Johansson
Quoted 4 lines · Nicolas Ferre

From: Ludovic Desroches <[email protected]>

Having a unit-address different from 0 causes bad memory node detection during early_init_dt_scan_memory.

Sounds like a bug in the generic code to me? But specifying a unit address on a non-ambiguous device node isn't necessary anyway, so this patch is still a reasonable thing to do.

It's actually a 'feature' of the way we're including skeleton.dtsi. skeleton.dtsi has already set the node name, so if the next file doesn't use exactly the same node name then the .dtb ends up with two memory nodes, which is really bad.

It real problem is the dtc tooling.

g.

#23 lore raw
In reply to Nicolas Ferre

On 04/03/2012 09:32 AM, Nicolas Ferre :

Quoted 9 lines

Here is a bunch of fixes for AT91 that will go on top of 3.4-rc1. Some modifications are related to certain drivers (USB ohci-at91 for instance) but are touching the core AT91 devices/board files and Device Tree files. The modification of "vbus_pin_active_low" in particular cannot be separated from the modification of .dts[i] and devices/board files.

I will have to collect "Acked-by" from USB people on the ohci-at91 modifications (Greg?). I will try to find them just after having posted this v2 today...

Hi Greg,

I would like to send this "fixes" patch series via arm-soc. Is it possible for you to have a look at patches that will modify ohci-at91 (and the tiny ehci-atmel one) and give me your "Acked-by" so that I can ask Arnd and Olof to queue this material for 3.4-rc?

Here is the thread in linux-usb mainling-list:
http://www.spinics.net/lists/linux-usb/msg60798.html

Thanks for your help, best regards,

Quoted 39 lines

Ludovic Desroches (1):
ARM: at91: dt: remove unit-address part for memory nodes

Nicolas Ferre (12):
ARM: at91/at91sam9x5: add clkdev entries for DMA controllers
USB: ohci-at91: fix vbus_pin_active_low handling
ARM: at91/USB host: specify and handle properly vbus_pin_active_low
ARM: at91/dts: USB host vbus is active low
USB: ohci-at91: rework and fix initialization
USB: ohci-at91: change maximum number of ports
USB: ohci-at91: coding style modifications with one-line ifs
USB: ohci-at91: trivial return code name change
ARM: at91/at91sam9x5.dtsi: fix NAND ale/cle in DT file
ARM: at91/NAND DT bindings: add comments
USB: ehci-atmel: add needed of.h header file
ARM: at91: fix check of valid GPIO for SPI and USB

 .../devicetree/bindings/mtd/atmel-nand.txt         |   10 +-
 arch/arm/boot/dts/at91sam9g20.dtsi                 |    2 +-
 arch/arm/boot/dts/at91sam9g25ek.dts                |    4 +-
 arch/arm/boot/dts/at91sam9g45.dtsi                 |    2 +-
 arch/arm/boot/dts/at91sam9m10g45ek.dts             |    6 +-
 arch/arm/boot/dts/at91sam9x5.dtsi                  |    6 +-
 arch/arm/boot/dts/at91sam9x5cm.dtsi                |    2 +-
 arch/arm/boot/dts/usb_a9g20.dts                    |    2 +-
 arch/arm/mach-at91/at91sam9260_devices.c           |    3 +
 arch/arm/mach-at91/at91sam9261_devices.c           |    3 +
 arch/arm/mach-at91/at91sam9263_devices.c           |    6 +-
 arch/arm/mach-at91/at91sam9g45_devices.c           |   11 +-
 arch/arm/mach-at91/at91sam9rl_devices.c            |    3 +
 arch/arm/mach-at91/at91sam9x5.c                    |    2 +
 arch/arm/mach-at91/board-sam9263ek.c               |    1 +
 arch/arm/mach-at91/board-sam9m10g45ek.c            |    1 +
 arch/arm/mach-at91/include/mach/board.h            |   13 +-
 drivers/usb/host/ehci-atmel.c                      |    1 +
 drivers/usb/host/ohci-at91.c                       |  159 +++++++++++---------
 19 files changed, 135 insertions(+), 102 deletions(-)

Thanks, best regards,

Signature · 1 line
Nicolas Ferre