All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/6 v3] ARM: integrator: check PL010 base address from resource
@ 2012-09-03 20:06 ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-09-03 20:06 UTC (permalink / raw)
  To: linux-arm-kernel

In the PL010 UART callback a comparison against the location of the
statically allocated PL010 device is done to figure out which UART
is doing the callback. This does not play well with dynamic devices
such as in device tree, so let's check the base address of the
memory resource inside the amba_device instead.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Check for the base address of the physical memory resource instead
  of checking for the device name (which will also be dynamic when
  we use device tree).
---
 arch/arm/mach-integrator/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 5ba4bc8..268eadf 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -99,11 +99,14 @@ int __init integrator_init(bool is_cp)
 static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl)
 {
 	unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask;
+	u32 phybase = dev->res.start;
 
-	if (dev == &uart0_device) {
+	if (phybase == INTEGRATOR_UART0_BASE) {
+		/* UART0 */
 		rts_mask = 1 << 4;
 		dtr_mask = 1 << 5;
 	} else {
+		/* UART1 */
 		rts_mask = 1 << 6;
 		dtr_mask = 1 << 7;
 	}
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/6 v3] ARM: integrator: check PL010 base address from resource
@ 2012-09-03 20:06 ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-09-03 20:06 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
  Cc: Will Deacon, arm-DgEjT+Ai2ygdnm+yROfE0A, Russell King, Pawel Moll

In the PL010 UART callback a comparison against the location of the
statically allocated PL010 device is done to figure out which UART
is doing the callback. This does not play well with dynamic devices
such as in device tree, so let's check the base address of the
memory resource inside the amba_device instead.

Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
ChangeLog v2->v3:
- Check for the base address of the physical memory resource instead
  of checking for the device name (which will also be dynamic when
  we use device tree).
---
 arch/arm/mach-integrator/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 5ba4bc8..268eadf 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -99,11 +99,14 @@ int __init integrator_init(bool is_cp)
 static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl)
 {
 	unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask;
+	u32 phybase = dev->res.start;
 
-	if (dev == &uart0_device) {
+	if (phybase == INTEGRATOR_UART0_BASE) {
+		/* UART0 */
 		rts_mask = 1 << 4;
 		dtr_mask = 1 << 5;
 	} else {
+		/* UART1 */
 		rts_mask = 1 << 6;
 		dtr_mask = 1 << 7;
 	}
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/6 v3] ARM: integrator: check PL010 base address from resource
@ 2012-09-03 20:10   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2012-09-03 20:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 03 September 2012, Linus Walleij wrote:
> In the PL010 UART callback a comparison against the location of the
> statically allocated PL010 device is done to figure out which UART
> is doing the callback. This does not play well with dynamic devices
> such as in device tree, so let's check the base address of the
> memory resource inside the amba_device instead.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v2->v3:
> - Check for the base address of the physical memory resource instead
>   of checking for the device name (which will also be dynamic when
>   we use device tree).

Ok, looks good to me.

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/6 v3] ARM: integrator: check PL010 base address from resource
@ 2012-09-03 20:10   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2012-09-03 20:10 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Russell King, Pawel Moll,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Will Deacon,
	arm-DgEjT+Ai2ygdnm+yROfE0A,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Monday 03 September 2012, Linus Walleij wrote:
> In the PL010 UART callback a comparison against the location of the
> statically allocated PL010 device is done to figure out which UART
> is doing the callback. This does not play well with dynamic devices
> such as in device tree, so let's check the base address of the
> memory resource inside the amba_device instead.
> 
> Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> ChangeLog v2->v3:
> - Check for the base address of the physical memory resource instead
>   of checking for the device name (which will also be dynamic when
>   we use device tree).

Ok, looks good to me.

Acked-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-03 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03 20:06 [PATCH 2/6 v3] ARM: integrator: check PL010 base address from resource Linus Walleij
2012-09-03 20:06 ` Linus Walleij
2012-09-03 20:10 ` Arnd Bergmann
2012-09-03 20:10   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.