arm: pxa: add device-tree irq init for pxa27x
Subsystems (3)
Robert Jarzmik
maintainerPATCH 1/4 arm: pxa: add device-tree irq init for pxa27x
Add the initializer for irqs in a device-tree machine on a pxa27x.
--- arch/arm/mach-pxa/pxa27x.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/mach-pxa/pxa27x.c +5 -0
@@ -398,6 +398,11 @@ void __init pxa27x_init_irq(void)pxa_init_irq (34 , pxa27x_set_wake); } +void __init pxa27x_dt_init_irq (void ) +{ +pxa_dt_irq_init (pxa27x_set_wake); +} +static struct map_desc pxa27x_io_desc[]__initdata = { {/* Mem Ctl */ .virtual = (unsigned long )SMEMC_VIRT ,
Signature · 1 line
2.1.0
Robert Jarzmik
maintainerPATCH 2/4 arm: pxa: move init functions into generic.h
In order to have a unique .c file for all pxa variants device-tree definitions, all the initialization functions for MACHINE_START and DT_MACHINE_START have been put together into generic.h.
The alternative would have been one pxaXXX-dt.c file per variant.
The move is necessary because each include/mach/pxaXXX.h includes the variant register descriptions which intersects and conflicts one with each other.
The change is a preparation for pxa-dt.c to support multiple pxa, ie. pxa3xx and pxa27x.
The machine files including mach/pxaXXX.h all include generic.h, which guarantees no regression should be introduced.
--- arch/arm/mach-pxa/generic.h | 26 ++++++++++++++++++++------ arch/arm/mach-pxa/include/mach/pxa25x.h | 8 -------- arch/arm/mach-pxa/include/mach/pxa27x.h | 4 ---- arch/arm/mach-pxa/include/mach/pxa3xx.h | 5 ----- 4 files changed, 20 insertions(+), 23 deletions(-)
arch/arm/mach-pxa/generic.h +20 -6
@@ -13,11 +13,11 @@struct irq_data ; -extern void pxa_timer_init (void ); - -extern void __init pxa_map_io (void ); -extern unsigned int get_clk_frequency_khz (int info); +extern void __init pxa_dt_irq_init (int (*fn)(struct irq_data *, +unsigned int )); +extern void __init pxa_map_io (void ); +extern void pxa_timer_init (void );#define SET_BANK (__nr,__start,__size) \ mi->bank[__nr].start = (__start), \
@@ -26,13 +26,23 @@ extern unsigned int get_clk_frequency_khz(int info);#define ARRAY_AND_SIZE (x) (x), ARRAY_SIZE(x)#ifdef CONFIG_PXA25x +#define pxa25x_handle_irq icip_handle_irqextern unsigned pxa25x_get_clk_frequency_khz (int ); +extern void __init pxa25x_init_irq (void ); +extern void __init pxa25x_map_io (void ); +#ifdef CONFIG_CPU_PXA26x +extern void __init pxa26x_init_irq (void ); +#endif #else #define pxa25x_get_clk_frequency_khz (x) (0)#endif #ifdef CONFIG_PXA27x -extern unsigned pxa27x_get_clk_frequency_khz (int ); +#define pxa27x_handle_irq ichp_handle_irq +extern void __init pxa27x_dt_init_irq (void ); +extern unsigned pxa27x_get_clk_frequency_khz (int ); +extern void __init pxa27x_init_irq (void ); +extern void __init pxa27x_map_io (void );#else #define pxa27x_get_clk_frequency_khz (x) (0)#endif
@@ -44,7 +54,11 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {}#endif #ifdef CONFIG_PXA3xx -extern unsigned pxa3xx_get_clk_frequency_khz (int ); +#define pxa3xx_handle_irq ichp_handle_irq +extern void __init pxa3xx_dt_init_irq (void ); +extern unsigned pxa3xx_get_clk_frequency_khz (int ); +extern void __init pxa3xx_init_irq (void ); +extern void __init pxa3xx_map_io (void );#else #define pxa3xx_get_clk_frequency_khz (x) (0)#endif
arch/arm/mach-pxa/include/mach/pxa25x.h +0 -8
@@ -6,12 +6,4 @@#include <mach/mfp-pxa25x.h> #include <mach/irqs.h> -extern void __init pxa25x_map_io (void ); -extern void __init pxa25x_init_irq (void ); -#ifdef CONFIG_CPU_PXA26x -extern void __init pxa26x_init_irq (void ); -#endif - -#define pxa25x_handle_irq icip_handle_irq -#endif /* __MACH_PXA25x_H */
arch/arm/mach-pxa/include/mach/pxa27x.h +0 -4
@@ -19,11 +19,7 @@#define ARB_CORE_PARK (1<<24)/* Be parked with core when idle */ #define ARB_LOCK_FLAG (1<<23)/* Only Locking masters gain access to the bus */ -extern void __init pxa27x_map_io (void ); -extern void __init pxa27x_init_irq (void );extern int __init pxa27x_set_pwrmode (unsigned int mode);extern void pxa27x_cpu_pm_enter (suspend_state_t state); -#define pxa27x_handle_irq ichp_handle_irq -#endif /* __MACH_PXA27x_H */
arch/arm/mach-pxa/include/mach/pxa3xx.h +0 -5
@@ -5,9 +5,4 @@#include <mach/pxa3xx-regs.h> #include <mach/irqs.h> -extern void __init pxa3xx_map_io (void ); -extern void __init pxa3xx_init_irq (void ); - -#define pxa3xx_handle_irq ichp_handle_irq -#endif /* __MACH_PXA3XX_H */
Signature · 1 line
2.1.0
PATCH 2/4 arm: pxa: move init functions into generic.h
arch/arm/mach-pxa/generic.h extern unsigned int get_clk_frequency_khz(int info); · line 38
Quoted 13 lines · On Monday 29 September 2014 08:51:46 Robert Jarzmik wrote:
#ifdef
CONFIG_PXA25xarch/arm/mach-pxa/generic.h +6
-0+#define pxa25x_handle_irq icip_handle_irqextern unsigned pxa25x_get_clk_frequency_khz (int ); +extern void __init pxa25x_init_irq (void ); +extern void __init pxa25x_map_io (void ); +#ifdef CONFIG_CPU_PXA26x +extern void __init pxa26x_init_irq (void ); +#endif #else #define pxa25x_get_clk_frequency_khz (x) (0)#endif
It's better to add the declarations outside of the #ifdef. I believe the existing #ifdef is meant to provide a dummy alternative, but you don't actually want that for the other declarations, so just add them to a globally visible location.
Arnd
Robert Jarzmik
maintainerPATCH 2/4 arm: pxa: move init functions into generic.h
Quoted 11 lines · Arnd Bergmann
Quoted 10 lines · On Monday 29 September 2014 08:51:46 Robert Jarzmik wrote:
#ifdef
CONFIG_PXA25xarch/arm/mach-pxa/generic.h +6
-0+#define pxa25x_handle_irq icip_handle_irqextern unsigned pxa25x_get_clk_frequency_khz (int ); +extern void __init pxa25x_init_irq (void ); +extern void __init pxa25x_map_io (void ); +#ifdef CONFIG_CPU_PXA26x +extern void __init pxa26x_init_irq (void ); +#endif #else
Quoted 8 lines
Quoted 3 lines
#define
pxa25x_get_clk_frequency_khz(x)(0)
#endifIt's better to add the declarations outside of the #ifdef. I believe the existing #ifdef is meant to provide a dummy alternative, but you don't actually want that for the other declarations, so just add them to a globally visible location.
OK for v2.
I will also put a note on my todo list to kill them. Their remaining purpose is to provide frequency read accessor for get_clk_frequency(). Once the clock framework will be done for all PXAs, get_clk_frequency() will become a simple clk_get_rate(), or even better will be removed if I manage to transform viper.c and the cpu frequency driver.
Cheers.
Signature · 1 line
Robert
Robert Jarzmik
maintainerPATCH 3/4 arm: pxa: remove unecessary includes from pxa-dt
In reply to Robert JarzmikAs the init functions necessary for machine init have moved to generic.h, remove the unecessary includes and prototypes definitions from pxa-dt.c.
This removes the include of mach/pxaXXX-regs.h, and make pxa-dt generic enough to accept other pxa variants.
--- arch/arm/mach-pxa/pxa-dt.c | 3 --- 1 file changed, 3 deletions(-)
arch/arm/mach-pxa/pxa-dt.c +0 -3
@@ -15,13 +15,10 @@#include <asm/mach/arch.h> #include <asm/mach/time.h> #include <mach/irqs.h> -#include <mach/pxa3xx.h> #include "generic.h" #ifdef CONFIG_PXA3xx -extern void __init pxa3xx_dt_init_irq (void ); -static const struct of_dev_auxdata pxa3xx_auxdata_lookup[]__initconst = {OF_DEV_AUXDATA ("mrvl,pxa-uart" ,0x40100000 ,"pxa2xx-uart.0" ,NULL ), OF_DEV_AUXDATA("mrvl,pxa-uart", 0x40200000, "pxa2xx-uart.1", NULL),
Signature · 1 line
2.1.0
PATCH 3/4 arm: pxa: remove unecessary includes from pxa-dt
arch/arm/mach-pxa/pxa-dt.c line 24
Quoted 4 lines · On Monday 29 September 2014 08:51:47 Robert Jarzmik wrote:
#ifdef
CONFIG_PXA3xxarch/arm/mach-pxa/pxa-dt.c +0
-2-extern void __init pxa3xx_dt_init_irq (void ); -
Nice catch.
Arnd
Robert Jarzmik
maintainerPATCH 4/4 arm: pxa: add pxa27x device-tree support
In reply to Robert JarzmikAdd a device-tree machine entry (DT_MACHINE_START) for pxa27x based platforms.
--- arch/arm/mach-pxa/Kconfig | 11 +++++++++++ arch/arm/mach-pxa/Makefile | 1 + arch/arm/mach-pxa/pxa-dt.c | 15 +++++++++++++++ 3 files changed, 27 insertions(+)
arch/arm/mach-pxa/Kconfig +11 -0
@@ -4,6 +4,17 @@ menu "Intel PXA2xx/PXA3xx Implementations" comment "Intel/Marvell Dev Platforms (sorted by hardware release time)" +config MACH_PXA27X_DT + bool "Support PXA27x platforms from device tree" + select CPU_PXA27x + select POWER_SUPPLY + select PXA27x + select USE_OF + help + Include support for Marvell PXA27x based platforms using + the device tree. Needn't select any other machine while + MACH_PXA27X_DT is enabled. + config MACH_PXA3XX_DT bool "Support PXA3xx platforms from device tree" select CPU_PXA300
arch/arm/mach-pxa/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-$(CONFIG_CPU_PXA930) += pxa930.o # Device Tree support obj-$(CONFIG_MACH_PXA3XX_DT) += pxa-dt.o +obj-$(CONFIG_MACH_PXA27X_DT) += pxa-dt.o # Intel/Marvell Dev Platforms obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
arch/arm/mach-pxa/pxa-dt.c +15 -0
@@ -58,3 +58,18 @@ DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)") .dt_compat = pxa3xx_dt_board_compat, MACHINE_END#endif + +#ifdef CONFIG_PXA27x +static const char *const pxa27x_dt_board_compat[]__initconst = { +"marvell,pxa270" , +NULL , +}; + +DT_MACHINE_START (PXA27X_DT ,"Marvell PXA2xx (Device Tree Support)" ) + .map_io = pxa27x_map_io, + .init_irq = pxa27x_dt_init_irq, + .handle_irq = pxa27x_handle_irq, + .restart = pxa_restart, + .dt_compat = pxa27x_dt_board_compat, +MACHINE_END +#endif
Signature · 1 line
2.1.0
PATCH 4/4 arm: pxa: add pxa27x device-tree support
Quoted 5 lines · On Monday 29 September 2014 08:51:48 Robert Jarzmik wrote:
Add a device-tree machine entry (
DT_MACHINE_START) for pxa27x based platforms.Signed-off-by Robert Jarzmik <[email protected]>
Looks good to me,
Arnd