ARM: sunxi: Architecture cleanups and rework
Subsystems (7)
v2 cover ARM: sunxi: Architecture cleanups and rework
Hi,
This patchset is a serie of various cleanups and reworks in the sunxi architecture to prepare a clean landing for the next Allwinner SoC, the A31 (sun6i).
The A31 is significantly different from the previous Allwinner SoC we supported, the A10 and A13, to no longer make the generic sunxi prefix we used in most compatible string relevant, while it should really have been sun4i in the first place.
This set is also the occasion to cleanup the timer and irq code by switching to the recently introduced clocksource and irqchip infrastructures.
This set depends on the UART patches I sent previously.
Maxime
Changes from v1:
- Rebased on top of Rob Herring's clksrc/cleanup branch
- Updated the Documentation with the new compatible strings
Maxime Ripard (10):
ARM: sunxi: dt: Reorganize the dtsi
clocksource: sunxi: Cleanup the timer code
clocksource: sunxi: make use of CLKSRC_OF
clocksource: sunxi: Rename sunxi to sun4i
ARM: sunxi: dt: Update timer compatible string
irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
irqchip: sunxi: Rename sunxi to sun4i
ARM: sunxi: dt: Update interrupt controller compatible string
ARM: sunxi: Rework the restart code
ARM: sunxi: dt: Update watchdog compatible string
...lwinner,sunxi-ic.txt => allwinner,sun4i-ic.txt} | 4 +-
...r,sunxi-timer.txt => allwinner,sun4i-timer.txt} | 4 +-
.../watchdog/{sunxi-wdt.txt => sun4i-wdt.txt} | 6 +-
arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 2 +-
arch/arm/boot/dts/sun4i-a10-hackberry.dts | 2 +-
arch/arm/boot/dts/sun4i-a10.dtsi | 157 ++++++++++++++++++-
arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 2 +-
arch/arm/boot/dts/sun5i-a13.dtsi | 145 +++++++++++++++++-
arch/arm/boot/dts/sunxi.dtsi | 159 --------------------
arch/arm/mach-sunxi/Kconfig | 5 +-
arch/arm/mach-sunxi/sunxi.c | 74 +++++----
drivers/clocksource/Kconfig | 2 +-
drivers/clocksource/Makefile | 2 +-
.../clocksource/{sunxi_timer.c => sun4i_timer.c} | 94 +++++-------
drivers/irqchip/Makefile | 2 +-
drivers/irqchip/{irq-sunxi.c => irq-sun4i.c} | 116 +++++++-------
include/linux/irqchip/sunxi.h | 27 ----
include/linux/sunxi_timer.h | 24 ---
18 files changed, 452 insertions(+), 375 deletions(-)
rename Documentation/devicetree/bindings/interrupt-controller/{allwinner,sunxi-ic.txt => allwinner,sun4i-ic.txt} (94%)
rename Documentation/devicetree/bindings/timer/{allwinner,sunxi-timer.txt => allwinner,sun4i-timer.txt} (78%)
rename Documentation/devicetree/bindings/watchdog/{sunxi-wdt.txt => sun4i-wdt.txt} (57%)
delete mode 100644 arch/arm/boot/dts/sunxi.dtsi
rename drivers/clocksource/{sunxi_timer.c => sun4i_timer.c} (50%)
rename drivers/irqchip/{irq-sunxi.c => irq-sun4i.c} (38%)
delete mode 100644 include/linux/irqchip/sunxi.h
delete mode 100644 include/linux/sunxi_timer.hSignature · 1 line
1.7.10.4
PATCH v2 1/10 ARM: sunxi: dt: Reorganize the dtsi
In the early days, the A10 and A13 shared quite some code. Nowadays it shares less and less code, the A31 diverging even more, so it doesn't make much sense to continue to maintain this structure, just use one DTSI for every SoC, and that's it.
--- arch/arm/boot/dts/sun4i-a10-cubieboard.dts | 2 +- arch/arm/boot/dts/sun4i-a10-hackberry.dts | 2 +- arch/arm/boot/dts/sun4i-a10.dtsi | 157 +++++++++++++++++++++++++-- arch/arm/boot/dts/sun5i-a13-olinuxino.dts | 2 +- arch/arm/boot/dts/sun5i-a13.dtsi | 145 ++++++++++++++++++++++++- arch/arm/boot/dts/sunxi.dtsi | 159 ---------------------------- 6 files changed, 295 insertions(+), 172 deletions(-) delete mode 100644 arch/arm/boot/dts/sunxi.dtsi
arch/arm/boot/dts/sun4i-a10-cubieboard.dts +1 -1
@@ -26,7 +26,7 @@ bootargs = "earlyprintk console=ttyS0,115200"; }; - soc { + soc at 01c20000 { pinctrl at 01c20800 { led_pins_cubieboard: led_pins at 0 { allwinner,pins = "PH20", "PH21";
arch/arm/boot/dts/sun4i-a10-hackberry.dts +1 -1
@@ -22,7 +22,7 @@ bootargs = "earlyprintk console=ttyS0,115200"; }; - soc { + soc at 01c20000 { uart0: serial at 01c28000 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>;
arch/arm/boot/dts/sun4i-a10.dtsi +149 -8
211 lines not on this page · raw message
arch/arm/boot/dts/sun5i-a13-olinuxino.dts +1 -1
@@ -22,7 +22,7 @@ bootargs = "earlyprintk console=ttyS0,115200"; }; - soc { + soc at 01c20000 { pinctrl at 01c20800 { led_pins_olinuxino: led_pins at 0 { allwinner,pins = "PG9";
arch/arm/boot/dts/sun5i-a13.dtsi +143 -2
162 lines not on this page · raw message
arch/arm/boot/dts/sunxi.dtsi deleted +0 -159
159 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v2 2/10 clocksource: sunxi: Cleanup the timer code
In reply to Maxime RipardThe timer code was not exact to some aspects, since most of this code was written wihout any datasheet. Make the needed corrections to match the datasheet.
--- drivers/clocksource/sunxi_timer.c | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/clocksource/sunxi_timer.c +24 -24
@@ -25,15 +25,15 @@#include <linux/sunxi_timer.h> #include <linux/clk/sunxi.h> -#define TIMER_CTL_REG 0x00 -#define TIMER_CTL_ENABLE (1 << 0) +#define TIMER_IRQ_EN_REG 0x00 +#define TIMER_IRQ_EN (val) (1 << val)#define TIMER_IRQ_ST_REG 0x04 -#define TIMER0_CTL_REG 0x10 -#define TIMER0_CTL_ENABLE (1 << 0) -#define TIMER0_CTL_AUTORELOAD (1 << 1) -#define TIMER0_CTL_ONESHOT (1 << 7) -#define TIMER0_INTVAL_REG 0x14 -#define TIMER0_CNTVAL_REG 0x18 +#define TIMER_CTL_REG (val) (0x10 * val + 0x10) +#define TIMER_CTL_ENABLE (1 << 0) +#define TIMER_CTL_AUTORELOAD (1 << 1) +#define TIMER_CTL_ONESHOT (1 << 7) +#define TIMER_INTVAL_REG (val) (0x10 * val + 0x14) +#define TIMER_CNTVAL_REG (val) (0x10 * val + 0x18)#define TIMER_SCAL 16
@@ -42,21 +42,21 @@ static void __iomem *timer_base;static void sunxi_clkevt_mode (enum clock_event_mode mode,struct clock_event_device *clk) { -u32 u =readl (timer_base +TIMER0_CTL_REG ); +u32 u =readl (timer_base +TIMER_CTL_REG (0 ));switch (mode) {case CLOCK_EVT_MODE_PERIODIC : - u &= ~(TIMER0_CTL_ONESHOT ); -writel (u |TIMER0_CTL_ENABLE , timer_base +TIMER0_CTL_REG ); + u &= ~(TIMER_CTL_ONESHOT ); +writel (u |TIMER_CTL_ENABLE , timer_base +TIMER_CTL_REG (0 ));break ;case CLOCK_EVT_MODE_ONESHOT : -writel (u |TIMER0_CTL_ONESHOT , timer_base +TIMER0_CTL_REG ); +writel (u |TIMER_CTL_ONESHOT , timer_base +TIMER_CTL_REG (0 ));break ;case CLOCK_EVT_MODE_UNUSED :case CLOCK_EVT_MODE_SHUTDOWN :default : -writel (u & ~(TIMER0_CTL_ENABLE ), timer_base +TIMER0_CTL_REG ); +writel (u & ~(TIMER_CTL_ENABLE ), timer_base +TIMER_CTL_REG (0 ));break ; } }
@@ -64,10 +64,10 @@ static void sunxi_clkevt_mode(enum clock_event_mode mode,static int sunxi_clkevt_next_event (unsigned long evt,struct clock_event_device *unused) { -u32 u =readl (timer_base +TIMER0_CTL_REG ); -writel (evt, timer_base +TIMER0_CNTVAL_REG ); -writel (u |TIMER0_CTL_ENABLE |TIMER0_CTL_AUTORELOAD , - timer_base +TIMER0_CTL_REG ); +u32 u =readl (timer_base +TIMER_CTL_REG (0 )); +writel (evt, timer_base +TIMER_CNTVAL_REG (0 )); +writel (u |TIMER_CTL_ENABLE |TIMER_CTL_AUTORELOAD , + timer_base +TIMER_CTL_REG (0 ));return 0 ; }
@@ -132,26 +132,26 @@ void __init sunxi_timer_init(void) rate =clk_get_rate (clk);writel (rate / (TIMER_SCAL *HZ ), - timer_base +TIMER0_INTVAL_REG ); + timer_base +TIMER_INTVAL_REG (0 ));/* set clock source to HOSC, 16 pre-division */ - val =readl (timer_base +TIMER0_CTL_REG ); + val =readl (timer_base +TIMER_CTL_REG (0 )); val &= ~(0x07 <<4 ); val &= ~(0x03 <<2 ); val |= (4 <<4 ) | (1 <<2 ); -writel (val, timer_base +TIMER0_CTL_REG ); +writel (val, timer_base +TIMER_CTL_REG (0 ));/* set mode to auto reload */ - val =readl (timer_base +TIMER0_CTL_REG ); -writel (val |TIMER0_CTL_AUTORELOAD , timer_base +TIMER0_CTL_REG ); + val =readl (timer_base +TIMER_CTL_REG (0 )); +writel (val |TIMER_CTL_AUTORELOAD , timer_base +TIMER_CTL_REG (0 )); ret =setup_irq (irq, &sunxi_timer_irq);if (ret)pr_warn ("failed to setup irq %d\n" , irq);/* Enable timer0 interrupt */ - val =readl (timer_base +TIMER_CTL_REG ); -writel (val |TIMER_CTL_ENABLE , timer_base +TIMER_CTL_REG ); + val =readl (timer_base +TIMER_IRQ_EN_REG ); +writel (val |TIMER_IRQ_EN (0 ), timer_base +TIMER_IRQ_EN_REG ); sunxi_clockevent.cpumask =cpumask_of (0 );
Signature · 1 line
1.7.10.4
PATCH v2 3/10 clocksource: sunxi: make use of CLKSRC_OF
In reply to Maxime RipardUsing CLKSRC_OF allows to remove the SoC specific sunxi_timer.h header, and instead of using a custom init function in the machine definition use the standard clocksource_of_init function.
--- arch/arm/mach-sunxi/Kconfig | 1 + arch/arm/mach-sunxi/sunxi.c | 11 +++++++++-- drivers/clocksource/sunxi_timer.c | 18 +++--------------- include/linux/sunxi_timer.h | 24 ------------------------ 4 files changed, 13 insertions(+), 41 deletions(-) delete mode 100644 include/linux/sunxi_timer.h
arch/arm/mach-sunxi/Kconfig +1 -0
@@ -1,6 +1,7 @@ config ARCH_SUNXI bool "Allwinner A1X SOCs" if ARCH_MULTI_V7 select CLKSRC_MMIO + select CLKSRC_OF select COMMON_CLK select GENERIC_CLOCKEVENTS select GENERIC_IRQ_CHIP
arch/arm/mach-sunxi/sunxi.c +9 -2
@@ -10,6 +10,7 @@* warranty of any kind, whether express or implied. */ +#include <linux/clocksource.h> #include <linux/delay.h> #include <linux/kernel.h> #include <linux/init.h>
@@ -17,8 +18,8 @@#include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/io.h> -#include <linux/sunxi_timer.h> +#include <linux/clk/sunxi.h> #include <linux/irqchip/sunxi.h> #include <asm/mach/arch.h>
@@ -81,6 +82,12 @@ void __init sunxi_map_io(void)iotable_init (sunxi_io_desc,ARRAY_SIZE (sunxi_io_desc)); } +static void __init sunxi_timer_init (void ) +{ +sunxi_init_clocks (); +clocksource_of_init (); +} +static void __init sunxi_dt_init (void ) {sunxi_setup_restart ();
@@ -100,6 +107,6 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)") .init_irq = sunxi_init_irq, .handle_irq = sunxi_handle_irq, .restart = sunxi_restart, - .init_time = &sunxi_timer_init, + .init_time = sunxi_timer_init, .dt_compat = sunxi_board_dt_compat,MACHINE_END
drivers/clocksource/sunxi_timer.c +3 -15
@@ -22,8 +22,6 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> -#include <linux/sunxi_timer.h> -#include <linux/clk/sunxi.h> #define TIMER_IRQ_EN_REG 0x00#define TIMER_IRQ_EN (val) (1 << val)
@@ -98,23 +96,13 @@ static struct irqaction sunxi_timer_irq = { .dev_id = &sunxi_clockevent, }; -static struct of_device_id sunxi_timer_dt_ids[] = { - { .compatible ="allwinner,sunxi-timer" }, - { } -}; - -void __init sunxi_timer_init (void ) +static void __init sunxi_timer_init (struct device_node *node) { -struct device_node *node;unsigned long rate =0 ;struct clk *clk;int ret, irq;u32 val; - node =of_find_matching_node (NULL , sunxi_timer_dt_ids); -if (!node) -panic ("No sunxi timer node" ); - timer_base =of_iomap (node,0 );if (!timer_base)panic ("Can't map registers" );
@@ -123,8 +111,6 @@ void __init sunxi_timer_init(void)if (irq <=0 )panic ("Can't parse IRQ" ); -sunxi_init_clocks (); - clk =of_clk_get (node,0 );if (IS_ERR (clk))panic ("Can't get timer clock" );
@@ -158,3 +144,5 @@ void __init sunxi_timer_init(void)clockevents_config_and_register (&sunxi_clockevent, rate /TIMER_SCAL ,0x1 ,0xff ); } +CLOCKSOURCE_OF_DECLARE (sunxi,"allwinner,sunxi-timer" , + sunxi_timer_init);
include/linux/sunxi_timer.h deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* Copyright 2012 Maxime Ripard -* -* Maxime Ripard <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#ifndef __SUNXI_TIMER_H -#define __SUNXI_TIMER_H - -#include <asm/mach/time.h> - -void sunxi_timer_init (void ); - -#endif
Signature · 1 line
1.7.10.4
PATCH v2 4/10 clocksource: sunxi: Rename sunxi to sun4i
In reply to Maxime RipardDuring the introduction of the Allwinner SoC platforms, sunxi was initially meant as a generic name for all the variants of the Allwinner SoC.
It was ok at the time of the support of only the A10 and A13 that looks pretty much the same, but it's beginning to be troublesome with the future addition of the Allwinner A31 (sun6i) that is quite different, and would introduce some weird logic, where sunxi would actually mean in some case sun4i and sun5i but without sun6i...
Moreover, it makes the compatible strings naming scheme not consistent with other architectures, where usually for this kind of compability, we just use the oldest SoC name that has this IP, so let's do just this.
---
...r,sunxi-timer.txt => allwinner,sun4i-timer.txt} | 4 +--
arch/arm/mach-sunxi/Kconfig | 4 +--
drivers/clocksource/Kconfig | 2 +-
drivers/clocksource/Makefile | 2 +-
.../clocksource/{sunxi_timer.c => sun4i_timer.c} | 34 ++++++++++----------
5 files changed, 23 insertions(+), 23 deletions(-)
rename Documentation/devicetree/bindings/timer/{allwinner,sunxi-timer.txt => allwinner,sun4i-timer.txt} (78%)
rename drivers/clocksource/{sunxi_timer.c => sun4i_timer.c} (80%)Documentation/devicetree/bindings/timer/allwinner,sun4i-timer.txt renamed from Documentation/devicetree/bindings/timer/allwinner,sunxi-timer.txt +2 -2
@@ -2,7 +2,7 @@ Allwinner A1X SoCs Timer Controller Required properties: -- compatible : should be "allwinner,sunxi-timer" +- compatible : should be "allwinner,sun4i-timer" - reg : Specifies base physical address and size of the registers. - interrupts : The interrupt of the first timer - clocks: phandle to the source clock (usually a 24 MHz fixed clock)
@@ -10,7 +10,7 @@ Required properties: Example: timer { - compatible = "allwinner,sunxi-timer"; + compatible = "allwinner,sun4i-timer"; reg = <0x01c20c00 0x400>; interrupts = <22>; clocks = <&osc>;
arch/arm/mach-sunxi/Kconfig +2 -2
@@ -7,5 +7,5 @@ config ARCH_SUNXI select GENERIC_IRQ_CHIP select PINCTRL select SPARSE_IRQ - select SUNXI_TIMER - select PINCTRL_SUNXI + select SUN4I_TIMER + select PINCTRL_SUNXI
drivers/clocksource/Kconfig +1 -1
@@ -25,7 +25,7 @@ config DW_APB_TIMER_OF config ARMADA_370_XP_TIMER bool -config SUNXI_TIMER +config SUN4I_TIMER bool config VT8500_TIMER
drivers/clocksource/Makefile +1 -1
@@ -16,7 +16,7 @@ obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o -obj-$(CONFIG_SUNXI_TIMER) += sunxi_timer.o +obj-$(CONFIG_SUN4I_TIMER) += sun4i_timer.o obj-$(CONFIG_ARCH_TEGRA) += tegra20_timer.o obj-$(CONFIG_VT8500_TIMER) += vt8500_timer.o
drivers/clocksource/sun4i_timer.c renamed from drivers/clocksource/sunxi_timer.c +17 -17
@@ -37,7 +37,7 @@static void __iomem *timer_base; -static void sunxi_clkevt_mode (enum clock_event_mode mode, +static void sun4i_clkevt_mode (enum clock_event_mode mode,struct clock_event_device *clk) {u32 u =readl (timer_base +TIMER_CTL_REG (0 ));
@@ -59,7 +59,7 @@ static void sunxi_clkevt_mode(enum clock_event_mode mode, } } -static int sunxi_clkevt_next_event (unsigned long evt, +static int sun4i_clkevt_next_event (unsigned long evt,struct clock_event_device *unused) {u32 u =readl (timer_base +TIMER_CTL_REG (0 ));
@@ -70,16 +70,16 @@ static int sunxi_clkevt_next_event(unsigned long evt,return 0 ; } -static struct clock_event_device sunxi_clockevent = { - .name ="sunxi_tick" , +static struct clock_event_device sun4i_clockevent = { + .name ="sun4i_tick" , .rating =300 , .features =CLOCK_EVT_FEAT_PERIODIC |CLOCK_EVT_FEAT_ONESHOT , - .set_mode = sunxi_clkevt_mode, - .set_next_event = sunxi_clkevt_next_event, + .set_mode = sun4i_clkevt_mode, + .set_next_event = sun4i_clkevt_next_event, }; -static irqreturn_t sunxi_timer_interrupt (int irq,void *dev_id) +static irqreturn_t sun4i_timer_interrupt (int irq,void *dev_id) {struct clock_event_device *evt = (struct clock_event_device *)dev_id;
@@ -89,14 +89,14 @@ static irqreturn_t sunxi_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction sunxi_timer_irq = { - .name ="sunxi_timer0" , +static struct irqaction sun4i_timer_irq = { + .name ="sun4i_timer0" , .flags =IRQF_DISABLED |IRQF_TIMER |IRQF_IRQPOLL , - .handler = sunxi_timer_interrupt, - .dev_id = &sunxi_clockevent, + .handler = sun4i_timer_interrupt, + .dev_id = &sun4i_clockevent, }; -static void __init sunxi_timer_init (struct device_node *node) +static void __init sun4i_timer_init (struct device_node *node) {unsigned long rate =0 ;struct clk *clk;
@@ -131,7 +131,7 @@ static void __init sunxi_timer_init(struct device_node *node) val =readl (timer_base +TIMER_CTL_REG (0 ));writel (val |TIMER_CTL_AUTORELOAD , timer_base +TIMER_CTL_REG (0 )); - ret =setup_irq (irq, &sunxi_timer_irq); + ret =setup_irq (irq, &sun4i_timer_irq);if (ret)pr_warn ("failed to setup irq %d\n" , irq);
@@ -139,10 +139,10 @@ static void __init sunxi_timer_init(struct device_node *node) val =readl (timer_base +TIMER_IRQ_EN_REG );writel (val |TIMER_IRQ_EN (0 ), timer_base +TIMER_IRQ_EN_REG ); - sunxi_clockevent.cpumask =cpumask_of (0 ); + sun4i_clockevent.cpumask =cpumask_of (0 ); -clockevents_config_and_register (&sunxi_clockevent, rate /TIMER_SCAL , +clockevents_config_and_register (&sun4i_clockevent, rate /TIMER_SCAL ,0x1 ,0xff ); } -CLOCKSOURCE_OF_DECLARE (sunxi,"allwinner,sunxi-timer" , - sunxi_timer_init); +CLOCKSOURCE_OF_DECLARE (sun4i,"allwinner,sun4i-timer" , + sun4i_timer_init);
Signature · 1 line
1.7.10.4
PATCH v2 5/10 ARM: sunxi: dt: Update timer compatible string
In reply to Maxime Ripard--- arch/arm/boot/dts/sun4i-a10.dtsi | 2 +- arch/arm/boot/dts/sun5i-a13.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/sun4i-a10.dtsi +1 -1
@@ -158,7 +158,7 @@ }; timer at 01c20c00 { - compatible = "allwinner,sunxi-timer"; + compatible = "allwinner,sun4i-timer"; reg = <0x01c20c00 0x90>; interrupts = <22>; clocks = <&osc24M>;
arch/arm/boot/dts/sun5i-a13.dtsi +1 -1
@@ -152,7 +152,7 @@ }; timer at 01c20c00 { - compatible = "allwinner,sunxi-timer"; + compatible = "allwinner,sun4i-timer"; reg = <0x01c20c00 0x90>; interrupts = <22>; clocks = <&osc24M>;
Signature · 1 line
1.7.10.4
PATCH v2 6/10 irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
In reply to Maxime RipardThis allows to remove some boilerplate code. At the same time, call the set_handle_irq function in the initialization function of the irqchip, so that we can remove it from the machine declaration.
--- arch/arm/mach-sunxi/sunxi.c | 5 ++--- drivers/irqchip/irq-sunxi.c | 22 ++++++++++------------ include/linux/irqchip/sunxi.h | 27 --------------------------- 3 files changed, 12 insertions(+), 42 deletions(-) delete mode 100644 include/linux/irqchip/sunxi.h
arch/arm/mach-sunxi/sunxi.c +2 -3
@@ -14,13 +14,13 @@#include <linux/delay.h> #include <linux/kernel.h> #include <linux/init.h> +#include <linux/irqchip.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/io.h> #include <linux/clk/sunxi.h> -#include <linux/irqchip/sunxi.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -104,8 +104,7 @@ static const char * const sunxi_board_dt_compat[] = {DT_MACHINE_START (SUNXI_DT ,"Allwinner A1X (Device Tree)" ) .init_machine = sunxi_dt_init, .map_io = sunxi_map_io, - .init_irq = sunxi_init_irq, - .handle_irq = sunxi_handle_irq, + .init_irq = irqchip_init, .restart = sunxi_restart, .init_time = sunxi_timer_init, .dt_compat = sunxi_board_dt_compat,
drivers/irqchip/irq-sunxi.c +10 -12
@@ -20,7 +20,10 @@#include <linux/of_address.h> #include <linux/of_irq.h> -#include <linux/irqchip/sunxi.h> +#include <asm/exception.h> +#include <asm/mach/irq.h> + +#include "irqchip.h" #define SUNXI_IRQ_VECTOR_REG 0x00#define SUNXI_IRQ_PROTECTION_REG 0x08
@@ -33,6 +36,8 @@static void __iomem *sunxi_irq_base;static struct irq_domain *sunxi_irq_domain; +static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs); +void sunxi_irq_ack (struct irq_data *irqd) {unsigned int irq =irqd_to_hwirq (irqd);
@@ -125,20 +130,13 @@ static int __init sunxi_of_init(struct device_node *node,if (!sunxi_irq_domain)panic ("%s: unable to create IRQ domain\n" , node->full_name); -return 0 ; -} - -static struct of_device_id sunxi_irq_dt_ids[]__initconst = { - { .compatible ="allwinner,sunxi-ic" , .data = sunxi_of_init }, - { } -}; +set_handle_irq (sunxi_handle_irq); -void __init sunxi_init_irq (void ) -{ -of_irq_init (sunxi_irq_dt_ids); +return 0 ; } +IRQCHIP_DECLARE (allwinner_sunxi_ic,"allwinner,sunxi-ic" , sunxi_of_init); -asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs) +static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs) {u32 irq, hwirq;
include/linux/irqchip/sunxi.h deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* Copyright 2012 Maxime Ripard -* -* Maxime Ripard <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#ifndef __LINUX_IRQCHIP_SUNXI_H -#define __LINUX_IRQCHIP_SUNXI_H - -#include <asm/exception.h> - -extern void sunxi_init_irq (void ); - -extern asmlinkage void __exception_irq_entry sunxi_handle_irq( -struct pt_regs *regs); - -#endif
Signature · 1 line
1.7.10.4
PATCH v2 7/10 irqchip: sunxi: Rename sunxi to sun4i
In reply to Maxime RipardDuring the introduction of the Allwinner SoC platforms, sunxi was initially meant as a generic name for all the variants of the Allwinner SoC.
It was ok at the time of the support of only the A10 and A13 that looks pretty much the same, but it's beginning to be troublesome with the future addition of the Allwinner A31 (sun6i) that is quite different, and would introduce some weird logic, where sunxi would actually mean in some case sun4i and sun5i but without sun6i...
Moreover, it makes the compatible strings naming scheme not consistent with other architectures, where usually for this kind of compability, we just use the oldest SoC name that has this IP, so let's do just this.
---
...lwinner,sunxi-ic.txt => allwinner,sun4i-ic.txt} | 4 +-
drivers/irqchip/Makefile | 2 +-
drivers/irqchip/{irq-sunxi.c => irq-sun4i.c} | 102 ++++++++++----------
3 files changed, 54 insertions(+), 54 deletions(-)
rename Documentation/devicetree/bindings/interrupt-controller/{allwinner,sunxi-ic.txt => allwinner,sun4i-ic.txt} (94%)
rename drivers/irqchip/{irq-sunxi.c => irq-sun4i.c} (41%)Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt renamed from Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-ic.txt +2 -2
@@ -2,7 +2,7 @@ Allwinner Sunxi Interrupt Controller Required properties: -- compatible : should be "allwinner,sunxi-ic" +- compatible : should be "allwinner,sun4i-ic" - reg : Specifies base physical address and size of the registers. - interrupt-controller : Identifies the node as an interrupt controller - #interrupt-cells : Specifies the number of cells needed to encode an
@@ -97,7 +97,7 @@ The interrupt sources are as follows: Example: intc: interrupt-controller { - compatible = "allwinner,sunxi-ic"; + compatible = "allwinner,sun4i-ic"; reg = <0x01c20400 0x400>; interrupt-controller; #interrupt-cells = <2>;
drivers/irqchip/Makefile +1 -1
@@ -4,7 +4,7 @@ obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o obj-$(CONFIG_METAG) += irq-metag-ext.o obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o -obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o +obj-$(CONFIG_ARCH_SUNXI) += irq-sun4i.o obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o obj-$(CONFIG_ARM_GIC) += irq-gic.o obj-$(CONFIG_ARM_VIC) += irq-vic.o
drivers/irqchip/irq-sun4i.c renamed from drivers/irqchip/irq-sunxi.c +51 -51
176 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v2 8/10 ARM: sunxi: dt: Update interrupt controller compatible string
In reply to Maxime Ripard--- arch/arm/boot/dts/sun4i-a10.dtsi | 2 +- arch/arm/boot/dts/sun5i-a13.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/sun4i-a10.dtsi +1 -1
@@ -121,7 +121,7 @@ ranges; intc: interrupt-controller at 01c20400 { - compatible = "allwinner,sunxi-ic"; + compatible = "allwinner,sun4i-ic"; reg = <0x01c20400 0x400>; interrupt-controller; #interrupt-cells = <1>;
arch/arm/boot/dts/sun5i-a13.dtsi +1 -1
@@ -122,7 +122,7 @@ ranges; intc: interrupt-controller at 01c20400 { - compatible = "allwinner,sunxi-ic"; + compatible = "allwinner,sun4i-ic"; reg = <0x01c20400 0x400>; interrupt-controller; #interrupt-cells = <1>;
Signature · 1 line
1.7.10.4
PATCH v2 9/10 ARM: sunxi: Rework the restart code
In reply to Maxime RipardThe Allwinner sun6i (A31) has a slightly different watchdog, that doesn't allow to use the already existing restart code.
Rework a bit the restart code to allow to plug in more easily different restart handlers depending on the device tree.
In the past, we were also meaning sunxi as a generic name covering all Allwinner SoCs. This won't be true anymore with the A31 (sun6i) that differs pretty much from sun4i and sun5i, and we will end up having sunxi, for sun4i and sun5i, and sun6i, which is neither consistent nor convenient. So, while we're at it, also change sunxi to sun4i.
---
.../watchdog/{sunxi-wdt.txt => sun4i-wdt.txt} | 6 +-
arch/arm/mach-sunxi/sunxi.c | 58 ++++++++++++--------
2 files changed, 38 insertions(+), 26 deletions(-)
rename Documentation/devicetree/bindings/watchdog/{sunxi-wdt.txt => sun4i-wdt.txt} (57%)Documentation/devicetree/bindings/watchdog/sun4i-wdt.txt renamed from Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt +3 -3
@@ -1,13 +1,13 @@ -Allwinner sunXi Watchdog timer +Allwinner sun4i Watchdog timer Required properties: -- compatible : should be "allwinner,sunxi-wdt" +- compatible : should be "allwinner,sun4i-wdt" - reg : Specifies base physical address and size of the registers. Example: wdt: watchdog at 01c20c90 { - compatible = "allwinner,sunxi-wdt"; + compatible = "allwinner,sun4i-wdt"; reg = <0x01c20c90 0x10>; };
arch/arm/mach-sunxi/sunxi.c +35 -23
92 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v2 10/10 ARM: sunxi: dt: Update watchdog compatible string
In reply to Maxime Ripard--- arch/arm/boot/dts/sun4i-a10.dtsi | 2 +- arch/arm/boot/dts/sun5i-a13.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/sun4i-a10.dtsi +1 -1
@@ -165,7 +165,7 @@ }; wdt: watchdog at 01c20c90 { - compatible = "allwinner,sunxi-wdt"; + compatible = "allwinner,sun4i-wdt"; reg = <0x01c20c90 0x10>; };
arch/arm/boot/dts/sun5i-a13.dtsi +1 -1
@@ -159,7 +159,7 @@ }; wdt: watchdog at 01c20c90 { - compatible = "allwinner,sunxi-wdt"; + compatible = "allwinner,sun4i-wdt"; reg = <0x01c20c90 0x10>; };
Signature · 1 line
1.7.10.4
v2 cover ARM: sunxi: Architecture cleanups and rework
In reply to Maxime RipardHi Mike,
Le 26/03/2013 10:13, Maxime Ripard a ?crit :
Quoted 11 lines
Hi,
This patchset is a serie of various cleanups and reworks in the sunxi architecture to prepare a clean landing for the next Allwinner SoC, the A31 (sun6i).
The A31 is significantly different from the previous Allwinner SoC we supported, the A10 and A13, to no longer make the generic sunxi prefix we used in most compatible string relevant, while it should really have been sun4i in the first place.
Quoted 5 lines
This set is also the occasion to cleanup the timer and irq code by switching to the recently introduced clocksource and irqchip infrastructures.
This set depends on the UART patches I sent previously.
I was meaning to take this branch, but some of the drivers changes in it depends on the clock patches that Emilio sent and that are in clk-next. Is it ok to merge clk-next into my branch?
Thanks,
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
v2 cover ARM: sunxi: Architecture cleanups and rework
Quoted 18 lines · Maxime Ripard
Hi Mike,
Le 26/03/2013 10:13, Maxime Ripard a ?crit :
Quoted 15 lines
Hi,
This patchset is a serie of various cleanups and reworks in the sunxi architecture to prepare a clean landing for the next Allwinner SoC, the A31 (sun6i).
The A31 is significantly different from the previous Allwinner SoC we supported, the A10 and A13, to no longer make the generic sunxi prefix we used in most compatible string relevant, while it should really have been sun4i in the first place.
This set is also the occasion to cleanup the timer and irq code by switching to the recently introduced clocksource and irqchip infrastructures.
Quoted 5 lines
Quoted 1 line
This set depends on the UART patches I sent previously.
I was meaning to take this branch, but some of the drivers changes in it depends on the clock patches that Emilio sent and that are in clk-next. Is it ok to merge clk-next into my branch?
All of of a <subsystem>-next branch is usually asking for trouble, since it'll cause all sorts of pain if the other maintianer is rebasing his for-next branch.
Best is to get those patches on just a minimal topic branch (that is still bisectable) that is shared between the trees.
Mike?
-Olof
v2 cover ARM: sunxi: Architecture cleanups and rework
Le 02/04/2013 20:31, Olof Johansson a ?crit :
Quoted 25 lines · Maxime Ripard
Quoted 18 lines
Hi Mike,
Le 26/03/2013 10:13, Maxime Ripard a ?crit :
Quoted 15 lines
Hi,
This patchset is a serie of various cleanups and reworks in the sunxi architecture to prepare a clean landing for the next Allwinner SoC, the A31 (sun6i).
The A31 is significantly different from the previous Allwinner SoC we supported, the A10 and A13, to no longer make the generic sunxi prefix we used in most compatible string relevant, while it should really have been sun4i in the first place.
This set is also the occasion to cleanup the timer and irq code by switching to the recently introduced clocksource and irqchip infrastructures.
Quoted 5 lines
Quoted 1 line
This set depends on the UART patches I sent previously.
I was meaning to take this branch, but some of the drivers changes in it depends on the clock patches that Emilio sent and that are in clk-next. Is it ok to merge clk-next into my branch?
Quoted 8 lines
All of of a <subsystem>-next branch is usually asking for trouble, since it'll cause all sorts of pain if the other maintianer is rebasing his for-next branch.
Best is to get those patches on just a minimal topic branch (that is still bisectable) that is shared between the trees.
Mike?
Mike, could you comment on that? I'd very much like to see this patches come into 3.10.
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
v2 cover ARM: sunxi: Architecture cleanups and rework
Quoting Maxime Ripard (2013-04-05 10:17:55)
Quoted 30 lines
Le 02/04/2013 20:31, Olof Johansson a ?crit :
Quoted 29 lines · Maxime Ripard
Quoted 18 lines
Hi Mike,
Le 26/03/2013 10:13, Maxime Ripard a ?crit :
Quoted 15 lines
Hi,
This patchset is a serie of various cleanups and reworks in the sunxi architecture to prepare a clean landing for the next Allwinner SoC, the A31 (sun6i).
The A31 is significantly different from the previous Allwinner SoC we supported, the A10 and A13, to no longer make the generic sunxi prefix we used in most compatible string relevant, while it should really have been sun4i in the first place.
This set is also the occasion to cleanup the timer and irq code by switching to the recently introduced clocksource and irqchip infrastructures.
Quoted 5 lines
Quoted 1 line
This set depends on the UART patches I sent previously.
I was meaning to take this branch, but some of the drivers changes in it depends on the clock patches that Emilio sent and that are in clk-next. Is it ok to merge clk-next into my branch?
All of of a <subsystem>-next branch is usually asking for trouble, since it'll cause all sorts of pain if the other maintianer is rebasing his for-next branch.
Quoted 8 lines
Quoted 4 lines
Best is to get those patches on just a minimal topic branch (that is still bisectable) that is shared between the trees.
Mike?
Mike, could you comment on that? I'd very much like to see this patches come into 3.10.
Sorry for not seeing this earlier. This thread ended up in my mail killfile somehow.
I have already merged the patches that this series depends on into my immutable clk-for-3.10 branch. Unfortunately that means that they cannot be separated out into a shared topic branch. However clk-for-3.10 is immutable and will never be rebased, so it is safe to pull in as a dependency.
Does that solve the issue adequately?
Just for reference, the clk-for-3.x branch is always a subset of clk-next. Once some patches from clk-next have had some cycles in linux-next and enough time has passed since being merged without any regressions or other issues I migrate them over into clk-for-3.x. clk-next itself is typically just clk-for-3.x with between 3 and 10 patches on top that may be dropped or rebased or merged into clk-for-3.x.
Regards,
Mike
Quoted 7 lines
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
v2 cover ARM: sunxi: Architecture cleanups and rework
Quoted 43 lines · Mike Turquette
Quoting Maxime Ripard (2013-04-05 10:17:55)
Quoted 30 lines
Le 02/04/2013 20:31, Olof Johansson a ?crit :
Quoted 29 lines · Maxime Ripard
Quoted 18 lines
Hi Mike,
Le 26/03/2013 10:13, Maxime Ripard a ?crit :
Quoted 15 lines
Hi,
This patchset is a serie of various cleanups and reworks in the sunxi architecture to prepare a clean landing for the next Allwinner SoC, the A31 (sun6i).
The A31 is significantly different from the previous Allwinner SoC we supported, the A10 and A13, to no longer make the generic sunxi prefix we used in most compatible string relevant, while it should really have been sun4i in the first place.
This set is also the occasion to cleanup the timer and irq code by switching to the recently introduced clocksource and irqchip infrastructures.
Quoted 5 lines
Quoted 1 line
This set depends on the UART patches I sent previously.
I was meaning to take this branch, but some of the drivers changes in it depends on the clock patches that Emilio sent and that are in clk-next. Is it ok to merge clk-next into my branch?
All of of a <subsystem>-next branch is usually asking for trouble, since it'll cause all sorts of pain if the other maintianer is rebasing his for-next branch.
Quoted 8 lines
Quoted 4 lines
Best is to get those patches on just a minimal topic branch (that is still bisectable) that is shared between the trees.
Mike?
Mike, could you comment on that? I'd very much like to see this patches come into 3.10.
Sorry for not seeing this earlier. This thread ended up in my mail killfile somehow.
Quoted 7 lines
I have already merged the patches that this series depends on into my immutable clk-for-3.10 branch. Unfortunately that means that they cannot be separated out into a shared topic branch. However clk-for-3.10 is immutable and will never be rebased, so it is safe to pull in as a dependency.
Does that solve the issue adequately?
Yes.
Quoted 7 lines
Just for reference, the clk-for-3.x branch is always a subset of clk-next. Once some patches from clk-next have had some cycles in linux-next and enough time has passed since being merged without any regressions or other issues I migrate them over into clk-for-3.x. clk-next itself is typically just clk-for-3.x with between 3 and 10 patches on top that may be dropped or rebased or merged into clk-for-3.x.
We have been burned by other maintainers that normally have stable branches rebasing them since they thought nobody was looking and they had to fix something. :-) So even for these cases I want to see a three-way handshake. Like we just had.
-Olof