ARM: mmp: fix timer_init calls
Subsystems (3)
PATCH 1/2 ARM: mmp: fix timer_init calls
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.
--- 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(-)
arch/arm/mach-mmp/common.h +1 -1
@@ -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 *);
arch/arm/mach-mmp/mmp2.c +1 -1
@@ -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 */
arch/arm/mach-mmp/pxa168.c +1 -1
@@ -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 )
arch/arm/mach-mmp/pxa910.c +1 -1
@@ -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 */
arch/arm/mach-mmp/time.c +2 -2
@@ -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);
Signature · 7 lines
2.20.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/2 ARM: mmp: fix pxa168_device_usb_phy use on aspenite
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.
--- arch/arm/mach-mmp/aspenite.c | 3 +++ arch/arm/mach-mmp/ttc_dkb.c | 2 ++ 2 files changed, 5 insertions(+)
arch/arm/mach-mmp/aspenite.c +3 -0
@@ -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" )
arch/arm/mach-mmp/ttc_dkb.c +2 -0
@@ -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 ();
Signature · 1 line
2.20.0
Olof Johansson
AppliedQuoted 11 lines · Arnd Bergmann
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.
Quoted 7 lines
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 <[email protected]>
Applied to next/soc where the rest of the MMP material lives this cycle.
-Olof
Olof Johansson
AppliedRe: [PATCH 2/2] ARM: mmp: fix pxa168_device_usb_phy use on aspenite
In reply to Arnd BergmannQuoted 12 lines · Arnd Bergmann
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.handpxa910.hheaders 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'
Quoted 6 lines
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 <[email protected]>
Applied to next/soc. Thanks!
-Olof