linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: mmp: fix timer_init calls
@ 2018-12-10 20:43 Arnd Bergmann
  2018-12-10 20:43 ` [PATCH 2/2] ARM: mmp: fix pxa168_device_usb_phy use on aspenite Arnd Bergmann
  2018-12-12 21:55 ` [PATCH 1/2] ARM: mmp: fix timer_init calls Olof Johansson
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:43 UTC (permalink / raw)
  To: arm, Lubomir Rintel; +Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel

The change to passing the timer frequency as a function argument
was a good idea, but caused a build failure for one user that
was missed in the update:

arch/arm/mach-mmp/time.c: In function 'mmp_dt_init_timer':
arch/arm/mach-mmp/time.c:242:2: error: implicit declaration of function 'timer_init'; did you mean 'hrtimer_init'? [-Werror=implicit-function-declaration]

Change that as well to fix the build error, and rename the
function to put it into a proper namespace and make it clearer
what is actually going on.

I saw that the high 6500000 HZ frequency was previously only
set with CONFIG_MMP2, but is now also used with MMP (pxa910),
so I'm changing that back here. Please make sure that the
frequencies are all correct now.

Fixes: f36797ee4380 ("ARM: mmp/mmp2: dt: enable the clock")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-mmp/common.h | 2 +-
 arch/arm/mach-mmp/mmp2.c   | 2 +-
 arch/arm/mach-mmp/pxa168.c | 2 +-
 arch/arm/mach-mmp/pxa910.c | 2 +-
 arch/arm/mach-mmp/time.c   | 4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
index 5ac2851ef5d3..483b8b6d3005 100644
--- a/arch/arm/mach-mmp/common.h
+++ b/arch/arm/mach-mmp/common.h
@@ -2,7 +2,7 @@
 #include <linux/reboot.h>
 #define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
 
-extern void timer_init(int irq, unsigned long rate);
+extern void mmp_timer_init(int irq, unsigned long rate);
 
 extern void __init mmp_map_io(void);
 extern void mmp_restart(enum reboot_mode, const char *);
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
index fb3e7e32c882..726c1a642dea 100644
--- a/arch/arm/mach-mmp/mmp2.c
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -134,7 +134,7 @@ void __init mmp2_timer_init(void)
 	clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1);
 	__raw_writel(clk_rst, APBC_TIMERS);
 
-	timer_init(IRQ_MMP2_TIMER1, 6500000);
+	mmp_timer_init(IRQ_MMP2_TIMER1, 6500000);
 }
 
 /* on-chip devices */
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index 77a358165a56..cdcf65ace3f9 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -79,7 +79,7 @@ void __init pxa168_timer_init(void)
 	/* 3.25MHz, bus/functional clock enabled, release reset */
 	__raw_writel(TIMER_CLK_RST, APBC_TIMERS);
 
-	timer_init(IRQ_PXA168_TIMER1, 6500000);
+	mmp_timer_init(IRQ_PXA168_TIMER1, 3250000);
 }
 
 void pxa168_clear_keypad_wakeup(void)
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 1ccbba9ac495..d30a7d12bc98 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -116,7 +116,7 @@ void __init pxa910_timer_init(void)
 	__raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS);
 	__raw_writel(TIMER_CLK_RST, APBC_TIMERS);
 
-	timer_init(IRQ_PXA910_AP1_TIMER1);
+	mmp_timer_init(IRQ_PXA910_AP1_TIMER1, 3250000);
 }
 
 /* on-chip devices */
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index eab0fd8a7343..f9c295154b94 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -184,7 +184,7 @@ static struct irqaction timer_irq = {
 	.dev_id		= &ckevt,
 };
 
-void __init timer_init(int irq, unsigned long rate)
+void __init mmp_timer_init(int irq, unsigned long rate)
 {
 	timer_config();
 
@@ -239,7 +239,7 @@ void __init mmp_dt_init_timer(void)
 		ret = -ENOMEM;
 		goto out;
 	}
-	timer_init(irq, rate);
+	mmp_timer_init(irq, rate);
 	return;
 out:
 	pr_err("Failed to get timer from device tree with error:%d\n", ret);
-- 
2.20.0


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

* [PATCH 2/2] ARM: mmp: fix pxa168_device_usb_phy use on aspenite
  2018-12-10 20:43 [PATCH 1/2] ARM: mmp: fix timer_init calls Arnd Bergmann
@ 2018-12-10 20:43 ` Arnd Bergmann
  2018-12-12 21:55   ` Olof Johansson
  2018-12-12 21:55 ` [PATCH 1/2] ARM: mmp: fix timer_init calls Olof Johansson
  1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:43 UTC (permalink / raw)
  To: arm, Lubomir Rintel; +Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel

This one ended up in the wrong header file, causing a build failure
on at least one platform:

arch/arm/mach-mmp/aspenite.c: In function 'common_init':
arch/arm/mach-mmp/aspenite.c:260:28: error: 'pxa168_device_usb_phy' undeclared (first use in this function); did you mean 'pxa168_device_ssp5'?

We can just include both the pxa168.h and pxa910.h headers to make
that work, which gets us to the next failure:

arch/arm/mach-mmp/aspenite.o: In function `common_init':
aspenite.c:(.init.text+0x1c0): undefined reference to `pxa168_device_usb_phy'

This is solved by using the matching ifdef check around the
USB device registration, enabling them only when either USB
host or gadget mode are enabled.

Fixes: a225daf72ee7 ("ARM: mmp: add a pxa-usb-phy device")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-mmp/aspenite.c | 3 +++
 arch/arm/mach-mmp/ttc_dkb.c  | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index 23f99976b5f5..75b2d7db643e 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -29,6 +29,7 @@
 #include "addr-map.h"
 #include "mfp-pxa168.h"
 #include "pxa168.h"
+#include "pxa910.h"
 #include "irqs.h"
 #include "common.h"
 
@@ -256,6 +257,7 @@ static void __init common_init(void)
 	/* off-chip devices */
 	platform_device_register(&smc91x_device);
 
+#if IS_ENABLED(CONFIG_USB_SUPPORT)
 #if IS_ENABLED(CONFIG_PHY_PXA_USB)
 	platform_device_register(&pxa168_device_usb_phy);
 #endif
@@ -263,6 +265,7 @@ static void __init common_init(void)
 #if IS_ENABLED(CONFIG_USB_EHCI_MV)
 	pxa168_add_usb_host(&pxa168_sph_pdata);
 #endif
+#endif
 }
 
 MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 767dcb23ee1c..09b53ace08ac 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -282,6 +282,7 @@ static void __init ttc_dkb_init(void)
 				 sizeof(struct pxa_gpio_platform_data));
 	platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
 
+#if IS_ENABLED(CONFIG_USB_SUPPORT)
 #if IS_ENABLED(CONFIG_PHY_PXA_USB)
 	platform_device_register(&pxa168_device_usb_phy);
 #endif
@@ -300,6 +301,7 @@ static void __init ttc_dkb_init(void)
 	pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
 	platform_device_register(&pxa168_device_u2ootg);
 #endif
+#endif
 
 #if IS_ENABLED(CONFIG_MMP_DISP)
 	add_disp();
-- 
2.20.0


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

* Re: [PATCH 1/2] ARM: mmp: fix timer_init calls
  2018-12-10 20:43 [PATCH 1/2] ARM: mmp: fix timer_init calls Arnd Bergmann
  2018-12-10 20:43 ` [PATCH 2/2] ARM: mmp: fix pxa168_device_usb_phy use on aspenite Arnd Bergmann
@ 2018-12-12 21:55 ` Olof Johansson
  1 sibling, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2018-12-12 21:55 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: arm, Lubomir Rintel, linux-arm-kernel, linux-kernel

On Mon, Dec 10, 2018 at 09:43:01PM +0100, Arnd Bergmann wrote:
> The change to passing the timer frequency as a function argument
> was a good idea, but caused a build failure for one user that
> was missed in the update:
> 
> arch/arm/mach-mmp/time.c: In function 'mmp_dt_init_timer':
> arch/arm/mach-mmp/time.c:242:2: error: implicit declaration of function 'timer_init'; did you mean 'hrtimer_init'? [-Werror=implicit-function-declaration]
> 
> Change that as well to fix the build error, and rename the
> function to put it into a proper namespace and make it clearer
> what is actually going on.
> 
> I saw that the high 6500000 HZ frequency was previously only
> set with CONFIG_MMP2, but is now also used with MMP (pxa910),
> so I'm changing that back here. Please make sure that the
> frequencies are all correct now.
> 
> Fixes: f36797ee4380 ("ARM: mmp/mmp2: dt: enable the clock")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to next/soc where the rest of the MMP material lives this cycle.


-Olof

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

* Re: [PATCH 2/2] ARM: mmp: fix pxa168_device_usb_phy use on aspenite
  2018-12-10 20:43 ` [PATCH 2/2] ARM: mmp: fix pxa168_device_usb_phy use on aspenite Arnd Bergmann
@ 2018-12-12 21:55   ` Olof Johansson
  0 siblings, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2018-12-12 21:55 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: arm, Lubomir Rintel, linux-arm-kernel, linux-kernel

On Mon, Dec 10, 2018 at 09:43:02PM +0100, Arnd Bergmann wrote:
> This one ended up in the wrong header file, causing a build failure
> on at least one platform:
> 
> arch/arm/mach-mmp/aspenite.c: In function 'common_init':
> arch/arm/mach-mmp/aspenite.c:260:28: error: 'pxa168_device_usb_phy' undeclared (first use in this function); did you mean 'pxa168_device_ssp5'?
> 
> We can just include both the pxa168.h and pxa910.h headers to make
> that work, which gets us to the next failure:
> 
> arch/arm/mach-mmp/aspenite.o: In function `common_init':
> aspenite.c:(.init.text+0x1c0): undefined reference to `pxa168_device_usb_phy'
> 
> This is solved by using the matching ifdef check around the
> USB device registration, enabling them only when either USB
> host or gadget mode are enabled.
> 
> Fixes: a225daf72ee7 ("ARM: mmp: add a pxa-usb-phy device")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied to next/soc. Thanks!


-Olof


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

end of thread, other threads:[~2018-12-12 22:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 20:43 [PATCH 1/2] ARM: mmp: fix timer_init calls Arnd Bergmann
2018-12-10 20:43 ` [PATCH 2/2] ARM: mmp: fix pxa168_device_usb_phy use on aspenite Arnd Bergmann
2018-12-12 21:55   ` Olof Johansson
2018-12-12 21:55 ` [PATCH 1/2] ARM: mmp: fix timer_init calls Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).