* [PATCH 01/10] ARM: sunxi: dt: Reorganize the dtsi
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 02/10] clocksource: sunxi: Cleanup the timer code Maxime Ripard
` (9 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
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.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
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
diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
index cd06a3c..8e95845 100644
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
@@ -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";
diff --git a/arch/arm/boot/dts/sun4i-a10-hackberry.dts b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
index 2046000..b9efac1 100644
--- a/arch/arm/boot/dts/sun4i-a10-hackberry.dts
+++ b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
@@ -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>;
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 68a27fc..5c0920b 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -10,14 +10,123 @@
* http://www.gnu.org/copyleft/gpl.html
*/
-/include/ "sunxi.dtsi"
+/include/ "skeleton.dtsi"
/ {
+ interrupt-parent = <&intc>;
+
+ cpus {
+ cpu at 0 {
+ compatible = "arm,cortex-a8";
+ };
+ };
+
memory {
reg = <0x40000000 0x80000000>;
};
- soc {
+ clocks {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ /*
+ * This is a dummy clock, to be used as placeholder on
+ * other mux clocks when a specific parent clock is not
+ * yet implemented. It should be dropped when the driver
+ * is complete.
+ */
+ dummy: dummy {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <0>;
+ };
+
+ osc24M_fixed: osc24M_fixed {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <24000000>;
+ };
+
+ osc24M: osc24M at 01c20050 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-osc-clk";
+ reg = <0x01c20050 0x4>;
+ clocks = <&osc24M_fixed>;
+ };
+
+ osc32k: osc32k {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ };
+
+ pll1: pll1 at 01c20000 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-pll1-clk";
+ reg = <0x01c20000 0x4>;
+ clocks = <&osc24M>;
+ };
+
+ /* dummy is 200M */
+ cpu: cpu at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-cpu-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
+ };
+
+ axi: axi at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-axi-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&cpu>;
+ };
+
+ ahb: ahb at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-ahb-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&axi>;
+ };
+
+ apb0: apb0 at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-apb0-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&ahb>;
+ };
+
+ /* dummy is pll62 */
+ apb1_mux: apb1_mux at 01c20058 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-apb1-mux-clk";
+ reg = <0x01c20058 0x4>;
+ clocks = <&osc24M>, <&dummy>, <&osc32k>;
+ };
+
+ apb1: apb1 at 01c20058 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-apb1-clk";
+ reg = <0x01c20058 0x4>;
+ clocks = <&apb1_mux>;
+ };
+ };
+
+ soc at 01c20000 {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0x01c20000 0x300000>;
+ ranges;
+
+ intc: interrupt-controller at 01c20400 {
+ compatible = "allwinner,sunxi-ic";
+ reg = <0x01c20400 0x400>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ };
+
pio: pinctrl at 01c20800 {
compatible = "allwinner,sun4i-a10-pinctrl";
reg = <0x01c20800 0x400>;
@@ -48,13 +157,35 @@
};
};
+ timer at 01c20c00 {
+ compatible = "allwinner,sunxi-timer";
+ reg = <0x01c20c00 0x90>;
+ interrupts = <22>;
+ clocks = <&osc24M>;
+ };
+
+ wdt: watchdog at 01c20c90 {
+ compatible = "allwinner,sunxi-wdt";
+ reg = <0x01c20c90 0x10>;
+ };
+
uart0: serial at 01c28000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28000 0x400>;
interrupts = <1>;
reg-shift = <2>;
reg-io-width = <4>;
- clocks = <&osc>;
+ clocks = <&osc24M>;
+ status = "disabled";
+ };
+
+ uart1: serial at 01c28400 {
+ compatible = "snps,dw-apb-uart";
+ reg = <0x01c28400 0x400>;
+ interrupts = <2>;
+ reg-shift = <2>;
+ reg-io-width = <4>;
+ clocks = <&osc24M>;
status = "disabled";
};
@@ -64,7 +195,17 @@
interrupts = <3>;
reg-shift = <2>;
reg-io-width = <4>;
- clocks = <&osc>;
+ clocks = <&osc24M>;
+ status = "disabled";
+ };
+
+ uart3: serial at 01c28c00 {
+ compatible = "snps,dw-apb-uart";
+ reg = <0x01c28c00 0x400>;
+ interrupts = <4>;
+ reg-shift = <2>;
+ reg-io-width = <4>;
+ clocks = <&osc24M>;
status = "disabled";
};
@@ -74,7 +215,7 @@
interrupts = <17>;
reg-shift = <2>;
reg-io-width = <4>;
- clocks = <&osc>;
+ clocks = <&osc24M>;
status = "disabled";
};
@@ -84,7 +225,7 @@
interrupts = <18>;
reg-shift = <2>;
reg-io-width = <4>;
- clocks = <&osc>;
+ clocks = <&osc24M>;
status = "disabled";
};
@@ -94,7 +235,7 @@
interrupts = <19>;
reg-shift = <2>;
reg-io-width = <4>;
- clocks = <&osc>;
+ clocks = <&osc24M>;
status = "disabled";
};
@@ -104,7 +245,7 @@
interrupts = <20>;
reg-shift = <2>;
reg-io-width = <4>;
- clocks = <&osc>;
+ clocks = <&osc24M>;
status = "disabled";
};
};
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
index f1579a8..3ca5506 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
@@ -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";
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index 945bfac..fdc5346 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -11,14 +11,123 @@
* http://www.gnu.org/copyleft/gpl.html
*/
-/include/ "sunxi.dtsi"
+/include/ "skeleton.dtsi"
/ {
+ interrupt-parent = <&intc>;
+
+ cpus {
+ cpu at 0 {
+ compatible = "arm,cortex-a8";
+ };
+ };
+
memory {
reg = <0x40000000 0x20000000>;
};
- soc {
+ clocks {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ /*
+ * This is a dummy clock, to be used as placeholder on
+ * other mux clocks when a specific parent clock is not
+ * yet implemented. It should be dropped when the driver
+ * is complete.
+ */
+ dummy: dummy {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <0>;
+ };
+
+ osc24M_fixed: osc24M_fixed {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <24000000>;
+ };
+
+ osc24M: osc24M at 01c20050 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-osc-clk";
+ reg = <0x01c20050 0x4>;
+ clocks = <&osc24M_fixed>;
+ };
+
+ osc32k: osc32k {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ };
+
+ pll1: pll1 at 01c20000 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-pll1-clk";
+ reg = <0x01c20000 0x4>;
+ clocks = <&osc24M>;
+ };
+
+ /* dummy is 200M */
+ cpu: cpu at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-cpu-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
+ };
+
+ axi: axi at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-axi-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&cpu>;
+ };
+
+ ahb: ahb at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-ahb-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&axi>;
+ };
+
+ apb0: apb0 at 01c20054 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-apb0-clk";
+ reg = <0x01c20054 0x4>;
+ clocks = <&ahb>;
+ };
+
+ /* dummy is pll62 */
+ apb1_mux: apb1_mux at 01c20058 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-apb1-mux-clk";
+ reg = <0x01c20058 0x4>;
+ clocks = <&osc24M>, <&dummy>, <&osc32k>;
+ };
+
+ apb1: apb1 at 01c20058 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sunxi-apb1-clk";
+ reg = <0x01c20058 0x4>;
+ clocks = <&apb1_mux>;
+ };
+ };
+
+ soc at 01c20000 {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0x01c20000 0x300000>;
+ ranges;
+
+ intc: interrupt-controller at 01c20400 {
+ compatible = "allwinner,sunxi-ic";
+ reg = <0x01c20400 0x400>;
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ };
+
pio: pinctrl at 01c20800 {
compatible = "allwinner,sun5i-a13-pinctrl";
reg = <0x01c20800 0x400>;
@@ -41,5 +150,37 @@
allwinner,pull = <0>;
};
};
+
+ timer at 01c20c00 {
+ compatible = "allwinner,sunxi-timer";
+ reg = <0x01c20c00 0x90>;
+ interrupts = <22>;
+ clocks = <&osc24M>;
+ };
+
+ wdt: watchdog at 01c20c90 {
+ compatible = "allwinner,sunxi-wdt";
+ reg = <0x01c20c90 0x10>;
+ };
+
+ uart1: serial at 01c28400 {
+ compatible = "snps,dw-apb-uart";
+ reg = <0x01c28400 0x400>;
+ interrupts = <2>;
+ reg-shift = <2>;
+ reg-io-width = <4>;
+ clocks = <&osc24M>;
+ status = "disabled";
+ };
+
+ uart3: serial at 01c28c00 {
+ compatible = "snps,dw-apb-uart";
+ reg = <0x01c28c00 0x400>;
+ interrupts = <4>;
+ reg-shift = <2>;
+ reg-io-width = <4>;
+ clocks = <&osc24M>;
+ status = "disabled";
+ };
};
};
diff --git a/arch/arm/boot/dts/sunxi.dtsi b/arch/arm/boot/dts/sunxi.dtsi
deleted file mode 100644
index cafd393..0000000
--- a/arch/arm/boot/dts/sunxi.dtsi
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright 2012 Maxime Ripard
- *
- * Maxime Ripard <maxime.ripard@free-electrons.com>
- *
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-/include/ "skeleton.dtsi"
-
-/ {
- interrupt-parent = <&intc>;
-
- cpus {
- cpu at 0 {
- compatible = "arm,cortex-a8";
- };
- };
-
- clocks {
- #address-cells = <1>;
- #size-cells = <1>;
- ranges;
-
- /*
- * This is a dummy clock, to be used as placeholder on
- * other mux clocks when a specific parent clock is not
- * yet implemented. It should be dropped when the driver
- * is complete.
- */
- dummy: dummy {
- #clock-cells = <0>;
- compatible = "fixed-clock";
- clock-frequency = <0>;
- };
-
- osc24M_fixed: osc24M_fixed {
- #clock-cells = <0>;
- compatible = "fixed-clock";
- clock-frequency = <24000000>;
- };
-
- osc24M: osc24M at 01c20050 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-osc-clk";
- reg = <0x01c20050 0x4>;
- clocks = <&osc24M_fixed>;
- };
-
- osc32k: osc32k {
- #clock-cells = <0>;
- compatible = "fixed-clock";
- clock-frequency = <32768>;
- };
-
- pll1: pll1 at 01c20000 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-pll1-clk";
- reg = <0x01c20000 0x4>;
- clocks = <&osc24M>;
- };
-
- /* dummy is 200M */
- cpu: cpu at 01c20054 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-cpu-clk";
- reg = <0x01c20054 0x4>;
- clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
- };
-
- axi: axi at 01c20054 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-axi-clk";
- reg = <0x01c20054 0x4>;
- clocks = <&cpu>;
- };
-
- ahb: ahb at 01c20054 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-ahb-clk";
- reg = <0x01c20054 0x4>;
- clocks = <&axi>;
- };
-
- apb0: apb0 at 01c20054 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-apb0-clk";
- reg = <0x01c20054 0x4>;
- clocks = <&ahb>;
- };
-
- /* dummy is pll62 */
- apb1_mux: apb1_mux at 01c20058 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-apb1-mux-clk";
- reg = <0x01c20058 0x4>;
- clocks = <&osc24M>, <&dummy>, <&osc32k>;
- };
-
- apb1: apb1 at 01c20058 {
- #clock-cells = <0>;
- compatible = "allwinner,sunxi-apb1-clk";
- reg = <0x01c20058 0x4>;
- clocks = <&apb1_mux>;
- };
- };
-
- soc {
- compatible = "simple-bus";
- #address-cells = <1>;
- #size-cells = <1>;
- reg = <0x01c20000 0x300000>;
- ranges;
-
- timer at 01c20c00 {
- compatible = "allwinner,sunxi-timer";
- reg = <0x01c20c00 0x90>;
- interrupts = <22>;
- clocks = <&osc24M>;
- };
-
- wdt: watchdog at 01c20c90 {
- compatible = "allwinner,sunxi-wdt";
- reg = <0x01c20c90 0x10>;
- };
-
- intc: interrupt-controller at 01c20400 {
- compatible = "allwinner,sunxi-ic";
- reg = <0x01c20400 0x400>;
- interrupt-controller;
- #interrupt-cells = <1>;
- };
-
- uart1: serial at 01c28400 {
- compatible = "snps,dw-apb-uart";
- reg = <0x01c28400 0x400>;
- interrupts = <2>;
- reg-shift = <2>;
- reg-io-width = <4>;
- clocks = <&osc>;
- status = "disabled";
- };
-
- uart3: serial at 01c28c00 {
- compatible = "snps,dw-apb-uart";
- reg = <0x01c28c00 0x400>;
- interrupts = <4>;
- reg-shift = <2>;
- reg-io-width = <4>;
- clocks = <&osc>;
- status = "disabled";
- };
- };
-};
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 02/10] clocksource: sunxi: Cleanup the timer code
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
2013-03-26 9:13 ` [PATCH 01/10] ARM: sunxi: dt: Reorganize the dtsi Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 03/10] clocksource: sunxi: make use of CLKSRC_OF Maxime Ripard
` (8 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
The 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.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/clocksource/sunxi_timer.c | 48 ++++++++++++++++++-------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/clocksource/sunxi_timer.c b/drivers/clocksource/sunxi_timer.c
index 0ce85e2..7a3ea23 100644
--- a/drivers/clocksource/sunxi_timer.c
+++ b/drivers/clocksource/sunxi_timer.c
@@ -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);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 03/10] clocksource: sunxi: make use of CLKSRC_OF
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
2013-03-26 9:13 ` [PATCH 01/10] ARM: sunxi: dt: Reorganize the dtsi Maxime Ripard
2013-03-26 9:13 ` [PATCH 02/10] clocksource: sunxi: Cleanup the timer code Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 04/10] clocksource: sunxi: Rename sunxi to sun4i Maxime Ripard
` (7 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
Using 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.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
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
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 8709a39..06c2894 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -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
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 23afb73..b26748d 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -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
diff --git a/drivers/clocksource/sunxi_timer.c b/drivers/clocksource/sunxi_timer.c
index 7a3ea23..308bbe3 100644
--- a/drivers/clocksource/sunxi_timer.c
+++ b/drivers/clocksource/sunxi_timer.c
@@ -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);
diff --git a/include/linux/sunxi_timer.h b/include/linux/sunxi_timer.h
deleted file mode 100644
index 1808178..0000000
--- a/include/linux/sunxi_timer.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2012 Maxime Ripard
- *
- * Maxime Ripard <maxime.ripard@free-electrons.com>
- *
- * 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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 04/10] clocksource: sunxi: Rename sunxi to sun4i
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (2 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 03/10] clocksource: sunxi: make use of CLKSRC_OF Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 05/10] ARM: sunxi: dt: Update timer compatible string Maxime Ripard
` (6 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
During 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.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
...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%)
diff --git a/Documentation/devicetree/bindings/timer/allwinner,sunxi-timer.txt b/Documentation/devicetree/bindings/timer/allwinner,sun4i-timer.txt
similarity index 78%
rename from Documentation/devicetree/bindings/timer/allwinner,sunxi-timer.txt
rename to Documentation/devicetree/bindings/timer/allwinner,sun4i-timer.txt
index 0c7b64e..48aeb78 100644
--- a/Documentation/devicetree/bindings/timer/allwinner,sunxi-timer.txt
+++ b/Documentation/devicetree/bindings/timer/allwinner,sun4i-timer.txt
@@ -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>;
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 06c2894..d259c78 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -7,5 +7,5 @@ config ARCH_SUNXI
select GENERIC_IRQ_CHIP
select PINCTRL
select SPARSE_IRQ
- select SUNXI_TIMER
- select PINCTRL_SUNXI
\ No newline at end of file
+ select SUN4I_TIMER
+ select PINCTRL_SUNXI
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index e507ab7..9002185 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -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
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index 4d8283a..7d5d23a 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -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
diff --git a/drivers/clocksource/sunxi_timer.c b/drivers/clocksource/sun4i_timer.c
similarity index 80%
rename from drivers/clocksource/sunxi_timer.c
rename to drivers/clocksource/sun4i_timer.c
index 308bbe3..d4674e7 100644
--- a/drivers/clocksource/sunxi_timer.c
+++ b/drivers/clocksource/sun4i_timer.c
@@ -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);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 05/10] ARM: sunxi: dt: Update timer compatible string
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (3 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 04/10] clocksource: sunxi: Rename sunxi to sun4i Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 06/10] irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro Maxime Ripard
` (5 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 2 +-
arch/arm/boot/dts/sun5i-a13.dtsi | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 5c0920b..be71782 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -158,7 +158,7 @@
};
timer at 01c20c00 {
- compatible = "allwinner,sunxi-timer";
+ compatible = "allwinner,sun4i-timer";
reg = <0x01c20c00 0x90>;
interrupts = <22>;
clocks = <&osc24M>;
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index fdc5346..7a81aaf 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -152,7 +152,7 @@
};
timer at 01c20c00 {
- compatible = "allwinner,sunxi-timer";
+ compatible = "allwinner,sun4i-timer";
reg = <0x01c20c00 0x90>;
interrupts = <22>;
clocks = <&osc24M>;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 06/10] irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (4 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 05/10] ARM: sunxi: dt: Update timer compatible string Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 07/10] irqchip: sunxi: Rename sunxi to sun4i Maxime Ripard
` (4 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
This 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.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
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
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index b26748d..c99ab1b 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -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,
diff --git a/drivers/irqchip/irq-sunxi.c b/drivers/irqchip/irq-sunxi.c
index 10974fa..0fc49c5 100644
--- a/drivers/irqchip/irq-sunxi.c
+++ b/drivers/irqchip/irq-sunxi.c
@@ -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;
diff --git a/include/linux/irqchip/sunxi.h b/include/linux/irqchip/sunxi.h
deleted file mode 100644
index 1fe2c22..0000000
--- a/include/linux/irqchip/sunxi.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2012 Maxime Ripard
- *
- * Maxime Ripard <maxime.ripard@free-electrons.com>
- *
- * 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
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 07/10] irqchip: sunxi: Rename sunxi to sun4i
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (5 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 06/10] irqchip: sunxi: Make use of the IRQCHIP_DECLARE macro Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 08/10] ARM: sunxi: dt: Update interrupt controller compatible string Maxime Ripard
` (3 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
During 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.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
...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%)
diff --git a/Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt
similarity index 94%
rename from Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-ic.txt
rename to Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt
index 7f9fb85..e7f4dc1 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/allwinner,sunxi-ic.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/allwinner,sun4i-ic.txt
@@ -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>;
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index 98e3b87..5416965 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -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
diff --git a/drivers/irqchip/irq-sunxi.c b/drivers/irqchip/irq-sun4i.c
similarity index 41%
rename from drivers/irqchip/irq-sunxi.c
rename to drivers/irqchip/irq-sun4i.c
index 0fc49c5..b66d4ae 100644
--- a/drivers/irqchip/irq-sunxi.c
+++ b/drivers/irqchip/irq-sun4i.c
@@ -25,125 +25,125 @@
#include "irqchip.h"
-#define SUNXI_IRQ_VECTOR_REG 0x00
-#define SUNXI_IRQ_PROTECTION_REG 0x08
-#define SUNXI_IRQ_NMI_CTRL_REG 0x0c
-#define SUNXI_IRQ_PENDING_REG(x) (0x10 + 0x4 * x)
-#define SUNXI_IRQ_FIQ_PENDING_REG(x) (0x20 + 0x4 * x)
-#define SUNXI_IRQ_ENABLE_REG(x) (0x40 + 0x4 * x)
-#define SUNXI_IRQ_MASK_REG(x) (0x50 + 0x4 * x)
+#define SUN4I_IRQ_VECTOR_REG 0x00
+#define SUN4I_IRQ_PROTECTION_REG 0x08
+#define SUN4I_IRQ_NMI_CTRL_REG 0x0c
+#define SUN4I_IRQ_PENDING_REG(x) (0x10 + 0x4 * x)
+#define SUN4I_IRQ_FIQ_PENDING_REG(x) (0x20 + 0x4 * x)
+#define SUN4I_IRQ_ENABLE_REG(x) (0x40 + 0x4 * x)
+#define SUN4I_IRQ_MASK_REG(x) (0x50 + 0x4 * x)
-static void __iomem *sunxi_irq_base;
-static struct irq_domain *sunxi_irq_domain;
+static void __iomem *sun4i_irq_base;
+static struct irq_domain *sun4i_irq_domain;
-static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs);
+static asmlinkage void __exception_irq_entry sun4i_handle_irq(struct pt_regs *regs);
-void sunxi_irq_ack(struct irq_data *irqd)
+void sun4i_irq_ack(struct irq_data *irqd)
{
unsigned int irq = irqd_to_hwirq(irqd);
unsigned int irq_off = irq % 32;
int reg = irq / 32;
u32 val;
- val = readl(sunxi_irq_base + SUNXI_IRQ_PENDING_REG(reg));
+ val = readl(sun4i_irq_base + SUN4I_IRQ_PENDING_REG(reg));
writel(val | (1 << irq_off),
- sunxi_irq_base + SUNXI_IRQ_PENDING_REG(reg));
+ sun4i_irq_base + SUN4I_IRQ_PENDING_REG(reg));
}
-static void sunxi_irq_mask(struct irq_data *irqd)
+static void sun4i_irq_mask(struct irq_data *irqd)
{
unsigned int irq = irqd_to_hwirq(irqd);
unsigned int irq_off = irq % 32;
int reg = irq / 32;
u32 val;
- val = readl(sunxi_irq_base + SUNXI_IRQ_ENABLE_REG(reg));
+ val = readl(sun4i_irq_base + SUN4I_IRQ_ENABLE_REG(reg));
writel(val & ~(1 << irq_off),
- sunxi_irq_base + SUNXI_IRQ_ENABLE_REG(reg));
+ sun4i_irq_base + SUN4I_IRQ_ENABLE_REG(reg));
}
-static void sunxi_irq_unmask(struct irq_data *irqd)
+static void sun4i_irq_unmask(struct irq_data *irqd)
{
unsigned int irq = irqd_to_hwirq(irqd);
unsigned int irq_off = irq % 32;
int reg = irq / 32;
u32 val;
- val = readl(sunxi_irq_base + SUNXI_IRQ_ENABLE_REG(reg));
+ val = readl(sun4i_irq_base + SUN4I_IRQ_ENABLE_REG(reg));
writel(val | (1 << irq_off),
- sunxi_irq_base + SUNXI_IRQ_ENABLE_REG(reg));
+ sun4i_irq_base + SUN4I_IRQ_ENABLE_REG(reg));
}
-static struct irq_chip sunxi_irq_chip = {
- .name = "sunxi_irq",
- .irq_ack = sunxi_irq_ack,
- .irq_mask = sunxi_irq_mask,
- .irq_unmask = sunxi_irq_unmask,
+static struct irq_chip sun4i_irq_chip = {
+ .name = "sun4i_irq",
+ .irq_ack = sun4i_irq_ack,
+ .irq_mask = sun4i_irq_mask,
+ .irq_unmask = sun4i_irq_unmask,
};
-static int sunxi_irq_map(struct irq_domain *d, unsigned int virq,
+static int sun4i_irq_map(struct irq_domain *d, unsigned int virq,
irq_hw_number_t hw)
{
- irq_set_chip_and_handler(virq, &sunxi_irq_chip,
+ irq_set_chip_and_handler(virq, &sun4i_irq_chip,
handle_level_irq);
set_irq_flags(virq, IRQF_VALID | IRQF_PROBE);
return 0;
}
-static struct irq_domain_ops sunxi_irq_ops = {
- .map = sunxi_irq_map,
+static struct irq_domain_ops sun4i_irq_ops = {
+ .map = sun4i_irq_map,
.xlate = irq_domain_xlate_onecell,
};
-static int __init sunxi_of_init(struct device_node *node,
+static int __init sun4i_of_init(struct device_node *node,
struct device_node *parent)
{
- sunxi_irq_base = of_iomap(node, 0);
- if (!sunxi_irq_base)
+ sun4i_irq_base = of_iomap(node, 0);
+ if (!sun4i_irq_base)
panic("%s: unable to map IC registers\n",
node->full_name);
/* Disable all interrupts */
- writel(0, sunxi_irq_base + SUNXI_IRQ_ENABLE_REG(0));
- writel(0, sunxi_irq_base + SUNXI_IRQ_ENABLE_REG(1));
- writel(0, sunxi_irq_base + SUNXI_IRQ_ENABLE_REG(2));
+ writel(0, sun4i_irq_base + SUN4I_IRQ_ENABLE_REG(0));
+ writel(0, sun4i_irq_base + SUN4I_IRQ_ENABLE_REG(1));
+ writel(0, sun4i_irq_base + SUN4I_IRQ_ENABLE_REG(2));
/* Mask all the interrupts */
- writel(0, sunxi_irq_base + SUNXI_IRQ_MASK_REG(0));
- writel(0, sunxi_irq_base + SUNXI_IRQ_MASK_REG(1));
- writel(0, sunxi_irq_base + SUNXI_IRQ_MASK_REG(2));
+ writel(0, sun4i_irq_base + SUN4I_IRQ_MASK_REG(0));
+ writel(0, sun4i_irq_base + SUN4I_IRQ_MASK_REG(1));
+ writel(0, sun4i_irq_base + SUN4I_IRQ_MASK_REG(2));
/* Clear all the pending interrupts */
- writel(0xffffffff, sunxi_irq_base + SUNXI_IRQ_PENDING_REG(0));
- writel(0xffffffff, sunxi_irq_base + SUNXI_IRQ_PENDING_REG(1));
- writel(0xffffffff, sunxi_irq_base + SUNXI_IRQ_PENDING_REG(2));
+ writel(0xffffffff, sun4i_irq_base + SUN4I_IRQ_PENDING_REG(0));
+ writel(0xffffffff, sun4i_irq_base + SUN4I_IRQ_PENDING_REG(1));
+ writel(0xffffffff, sun4i_irq_base + SUN4I_IRQ_PENDING_REG(2));
/* Enable protection mode */
- writel(0x01, sunxi_irq_base + SUNXI_IRQ_PROTECTION_REG);
+ writel(0x01, sun4i_irq_base + SUN4I_IRQ_PROTECTION_REG);
/* Configure the external interrupt source type */
- writel(0x00, sunxi_irq_base + SUNXI_IRQ_NMI_CTRL_REG);
+ writel(0x00, sun4i_irq_base + SUN4I_IRQ_NMI_CTRL_REG);
- sunxi_irq_domain = irq_domain_add_linear(node, 3 * 32,
- &sunxi_irq_ops, NULL);
- if (!sunxi_irq_domain)
+ sun4i_irq_domain = irq_domain_add_linear(node, 3 * 32,
+ &sun4i_irq_ops, NULL);
+ if (!sun4i_irq_domain)
panic("%s: unable to create IRQ domain\n", node->full_name);
- set_handle_irq(sunxi_handle_irq);
+ set_handle_irq(sun4i_handle_irq);
return 0;
}
-IRQCHIP_DECLARE(allwinner_sunxi_ic, "allwinner,sunxi-ic", sunxi_of_init);
+IRQCHIP_DECLARE(allwinner_sun4i_ic, "allwinner,sun4i-ic", sun4i_of_init);
-static asmlinkage void __exception_irq_entry sunxi_handle_irq(struct pt_regs *regs)
+static asmlinkage void __exception_irq_entry sun4i_handle_irq(struct pt_regs *regs)
{
u32 irq, hwirq;
- hwirq = readl(sunxi_irq_base + SUNXI_IRQ_VECTOR_REG) >> 2;
+ hwirq = readl(sun4i_irq_base + SUN4I_IRQ_VECTOR_REG) >> 2;
while (hwirq != 0) {
- irq = irq_find_mapping(sunxi_irq_domain, hwirq);
+ irq = irq_find_mapping(sun4i_irq_domain, hwirq);
handle_IRQ(irq, regs);
- hwirq = readl(sunxi_irq_base + SUNXI_IRQ_VECTOR_REG) >> 2;
+ hwirq = readl(sun4i_irq_base + SUN4I_IRQ_VECTOR_REG) >> 2;
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 08/10] ARM: sunxi: dt: Update interrupt controller compatible string
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (6 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 07/10] irqchip: sunxi: Rename sunxi to sun4i Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 09/10] ARM: sunxi: Rework the restart code Maxime Ripard
` (2 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 2 +-
arch/arm/boot/dts/sun5i-a13.dtsi | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index be71782..805d704 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -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>;
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index 7a81aaf..760222c 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -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>;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 09/10] ARM: sunxi: Rework the restart code
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (7 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 08/10] ARM: sunxi: dt: Update interrupt controller compatible string Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-26 9:13 ` [PATCH 10/10] ARM: sunxi: dt: Update watchdog compatible string Maxime Ripard
2013-03-29 9:20 ` [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
The 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.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
.../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%)
diff --git a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt b/Documentation/devicetree/bindings/watchdog/sun4i-wdt.txt
similarity index 57%
rename from Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
rename to Documentation/devicetree/bindings/watchdog/sun4i-wdt.txt
index 0b27177..ecd650a 100644
--- a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/sun4i-wdt.txt
@@ -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>;
};
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index c99ab1b..706ce35 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -24,50 +24,63 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
+#include <asm/system_misc.h>
#include "sunxi.h"
-#define WATCHDOG_CTRL_REG 0x00
-#define WATCHDOG_CTRL_RESTART (1 << 0)
-#define WATCHDOG_MODE_REG 0x04
-#define WATCHDOG_MODE_ENABLE (1 << 0)
-#define WATCHDOG_MODE_RESET_ENABLE (1 << 1)
+#define SUN4I_WATCHDOG_CTRL_REG 0x00
+#define SUN4I_WATCHDOG_CTRL_RESTART (1 << 0)
+#define SUN4I_WATCHDOG_MODE_REG 0x04
+#define SUN4I_WATCHDOG_MODE_ENABLE (1 << 0)
+#define SUN4I_WATCHDOG_MODE_RESET_ENABLE (1 << 1)
static void __iomem *wdt_base;
-static void sunxi_setup_restart(void)
-{
- struct device_node *np = of_find_compatible_node(NULL, NULL,
- "allwinner,sunxi-wdt");
- if (WARN(!np, "unable to setup watchdog restart"))
- return;
-
- wdt_base = of_iomap(np, 0);
- WARN(!wdt_base, "failed to map watchdog base address");
-}
-
-static void sunxi_restart(char mode, const char *cmd)
+static void sun4i_restart(char mode, const char *cmd)
{
if (!wdt_base)
return;
/* Enable timer and set reset bit in the watchdog */
- writel(WATCHDOG_MODE_ENABLE | WATCHDOG_MODE_RESET_ENABLE,
- wdt_base + WATCHDOG_MODE_REG);
+ writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE,
+ wdt_base + SUN4I_WATCHDOG_MODE_REG);
/*
* Restart the watchdog. The default (and lowest) interval
* value for the watchdog is 0.5s.
*/
- writel(WATCHDOG_CTRL_RESTART, wdt_base + WATCHDOG_CTRL_REG);
+ writel(SUN4I_WATCHDOG_CTRL_RESTART, wdt_base + SUN4I_WATCHDOG_CTRL_REG);
while (1) {
mdelay(5);
- writel(WATCHDOG_MODE_ENABLE | WATCHDOG_MODE_RESET_ENABLE,
- wdt_base + WATCHDOG_MODE_REG);
+ writel(SUN4I_WATCHDOG_MODE_ENABLE | SUN4I_WATCHDOG_MODE_RESET_ENABLE,
+ wdt_base + SUN4I_WATCHDOG_MODE_REG);
}
}
+static struct of_device_id sunxi_restart_ids[] = {
+ { .compatible = "allwinner,sun4i-wdt", .data = sun4i_restart },
+ { /*sentinel*/ }
+};
+
+static void sunxi_setup_restart(void)
+{
+ const struct of_device_id *of_id;
+ struct device_node *np;
+
+ np = of_find_matching_node(NULL, sunxi_restart_ids);
+ if (WARN(!np, "unable to setup watchdog restart"))
+ return;
+
+ wdt_base = of_iomap(np, 0);
+ WARN(!wdt_base, "failed to map watchdog base address");
+
+ of_id = of_match_node(sunxi_restart_ids, np);
+ WARN(!of_id, "restart function not available");
+
+ arm_pm_restart = of_id->data;
+}
+
static struct map_desc sunxi_io_desc[] __initdata = {
{
.virtual = (unsigned long) SUNXI_REGS_VIRT_BASE,
@@ -105,7 +118,6 @@ DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
.init_machine = sunxi_dt_init,
.map_io = sunxi_map_io,
.init_irq = irqchip_init,
- .restart = sunxi_restart,
.init_time = sunxi_timer_init,
.dt_compat = sunxi_board_dt_compat,
MACHINE_END
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 10/10] ARM: sunxi: dt: Update watchdog compatible string
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (8 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 09/10] ARM: sunxi: Rework the restart code Maxime Ripard
@ 2013-03-26 9:13 ` Maxime Ripard
2013-03-29 9:20 ` [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
10 siblings, 0 replies; 16+ messages in thread
From: Maxime Ripard @ 2013-03-26 9:13 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
arch/arm/boot/dts/sun4i-a10.dtsi | 2 +-
arch/arm/boot/dts/sun5i-a13.dtsi | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 805d704..aee190c 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -165,7 +165,7 @@
};
wdt: watchdog at 01c20c90 {
- compatible = "allwinner,sunxi-wdt";
+ compatible = "allwinner,sun4i-wdt";
reg = <0x01c20c90 0x10>;
};
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index 760222c..72c4948 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -159,7 +159,7 @@
};
wdt: watchdog at 01c20c90 {
- compatible = "allwinner,sunxi-wdt";
+ compatible = "allwinner,sun4i-wdt";
reg = <0x01c20c90 0x10>;
};
--
1.7.10.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework
2013-03-26 9:13 [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
` (9 preceding siblings ...)
2013-03-26 9:13 ` [PATCH 10/10] ARM: sunxi: dt: Update watchdog compatible string Maxime Ripard
@ 2013-03-29 9:20 ` Maxime Ripard
2013-04-02 18:31 ` Olof Johansson
10 siblings, 1 reply; 16+ messages in thread
From: Maxime Ripard @ 2013-03-29 9:20 UTC (permalink / raw)
To: linux-arm-kernel
Hi Mike,
Le 26/03/2013 10:13, Maxime Ripard a ?crit :
> 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.
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
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework
2013-03-29 9:20 ` [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework Maxime Ripard
@ 2013-04-02 18:31 ` Olof Johansson
2013-04-05 17:17 ` Maxime Ripard
0 siblings, 1 reply; 16+ messages in thread
From: Olof Johansson @ 2013-04-02 18:31 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Mar 29, 2013 at 10:20:15AM +0100, Maxime Ripard wrote:
> Hi Mike,
>
> Le 26/03/2013 10:13, Maxime Ripard a ?crit :
> > 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.
>
> 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
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework
2013-04-02 18:31 ` Olof Johansson
@ 2013-04-05 17:17 ` Maxime Ripard
2013-04-08 17:03 ` Mike Turquette
0 siblings, 1 reply; 16+ messages in thread
From: Maxime Ripard @ 2013-04-05 17:17 UTC (permalink / raw)
To: linux-arm-kernel
Le 02/04/2013 20:31, Olof Johansson a ?crit :
> On Fri, Mar 29, 2013 at 10:20:15AM +0100, Maxime Ripard wrote:
>> Hi Mike,
>>
>> Le 26/03/2013 10:13, Maxime Ripard a ?crit :
>>> 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.
>>
>> 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?
Mike, could you comment on that? I'd very much like to see this patches
come into 3.10.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework
2013-04-05 17:17 ` Maxime Ripard
@ 2013-04-08 17:03 ` Mike Turquette
2013-04-11 7:03 ` Olof Johansson
0 siblings, 1 reply; 16+ messages in thread
From: Mike Turquette @ 2013-04-08 17:03 UTC (permalink / raw)
To: linux-arm-kernel
Quoting Maxime Ripard (2013-04-05 10:17:55)
> Le 02/04/2013 20:31, Olof Johansson a ?crit :
> > On Fri, Mar 29, 2013 at 10:20:15AM +0100, Maxime Ripard wrote:
> >> Hi Mike,
> >>
> >> Le 26/03/2013 10:13, Maxime Ripard a ?crit :
> >>> 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.
> >>
> >> 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?
>
> 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
> Maxime
>
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCHv2 00/10] ARM: sunxi: Architecture cleanups and rework
2013-04-08 17:03 ` Mike Turquette
@ 2013-04-11 7:03 ` Olof Johansson
0 siblings, 0 replies; 16+ messages in thread
From: Olof Johansson @ 2013-04-11 7:03 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 08, 2013 at 10:03:31AM -0700, Mike Turquette wrote:
> Quoting Maxime Ripard (2013-04-05 10:17:55)
> > Le 02/04/2013 20:31, Olof Johansson a ?crit :
> > > On Fri, Mar 29, 2013 at 10:20:15AM +0100, Maxime Ripard wrote:
> > >> Hi Mike,
> > >>
> > >> Le 26/03/2013 10:13, Maxime Ripard a ?crit :
> > >>> 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.
> > >>
> > >> 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?
> >
> > 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?
Yes.
> 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
^ permalink raw reply [flat|nested] 16+ messages in thread