ARM: S3C24XX: Add devicetree support for s3c2416
Subsystems (6)
v2 cover ARM: S3C24XX: Add devicetree support for s3c2416
This is the second installment of beginning devicetree support the Samsung S3C24xx architectures and focuses on the s3c2416 for now.
Included is the devicetree support for the s3c24xx irq controller and basic support for smdk2416 boards, which can sucessfully boot.
After the discussion with Thomas Abraham on v1 and staring to long at all of this, I'm not even sure if having the interrupt mapping in the binding is the correct way to go anymore.
The key positive aspect of this solution is, that after everything is running via dt all the SoC specific mapping tables in the driver can go away, cutting its length in half.
The other option would be as Thomas suggested to define specific irq-controller types (i.e. s3c2416-intc, s3c2443-intc, ... resulting in 16 types) and keep the mapping data in the code, as it is now.
So I would be very thankful for a bit of guidance on what is the better way.
The series depends on the finalized s3c24xx irq rework, which probably won't make it into 3.9 and also the clocksource dt support by Tomasz Figa, which are not in any tree yet.
Changes since v1:
- adapt to changes in the underlying s3c24xx irq rework
= more shared init code
- use irqchip infrastructure
- limit number of possible irq-types to not encode implementation details into the binding
- include new samsung-clocksource
Heiko Stuebner (3):
ARM: S3C24XX: move irq driver to drivers/irqchip
irqchip: irq-s3c24xx: add devicetree support
ARM: S3C24XX: Add devicetree support and dt-board file for s3c2416 SoCs
.../interrupt-controller/samsung,s3c24xx-irq.txt | 53 ++++++ arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/s3c2416-smdk2416.dts | 79 ++++++++ arch/arm/boot/dts/s3c2416.dtsi | 193 ++++++++++++++++++++ arch/arm/boot/dts/s3c24xx.dtsi | 165 +++++++++++++++++ arch/arm/mach-s3c24xx/Kconfig | 10 + arch/arm/mach-s3c24xx/Makefile | 3 +- arch/arm/mach-s3c24xx/mach-s3c2416-dt.c | 91 +++++++++ drivers/irqchip/Makefile | 1 + .../irq.c => drivers/irqchip/irq-s3c24xx.c | 128 +++++++++++++ 10 files changed, 723 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/samsung,s3c24xx-irq.txt create mode 100644 arch/arm/boot/dts/s3c2416-smdk2416.dts create mode 100644 arch/arm/boot/dts/s3c2416.dtsi create mode 100644 arch/arm/boot/dts/s3c24xx.dtsi create mode 100644 arch/arm/mach-s3c24xx/mach-s3c2416-dt.c rename arch/arm/mach-s3c24xx/irq.c => drivers/irqchip/irq-s3c24xx.c (92%)
Signature · 1 line
1.7.2.3
PATCH v2 1/3 ARM: S3C24XX: move irq driver to drivers/irqchip
This move is necessary to make use of the irqchip infrastructure for the following devicetree support for s3c24xx architectures.
--- arch/arm/mach-s3c24xx/Makefile | 2 +- drivers/irqchip/Makefile | 1 + .../irq.c => drivers/irqchip/irq-s3c24xx.c | 0 3 files changed, 2 insertions(+), 1 deletions(-) rename arch/arm/mach-s3c24xx/irq.c => drivers/irqchip/irq-s3c24xx.c (100%)
arch/arm/mach-s3c24xx/Makefile +1 -1
@@ -14,7 +14,7 @@ obj- := # core -obj-y += common.o irq.o +obj-y += common.o obj-$(CONFIG_CPU_S3C2410) += s3c2410.o obj-$(CONFIG_S3C2410_CPUFREQ) += cpufreq-s3c2410.o
drivers/irqchip/Makefile +1 -0
@@ -4,6 +4,7 @@ obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_METAG) += irq-metag-ext.o obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o +obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.c obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o obj-$(CONFIG_ARM_GIC) += irq-gic.o
drivers/irqchip/irq-s3c24xx.c renamed from arch/arm/mach-s3c24xx/irq.c +0 -0
Signature · 1 line
1.7.2.3
PATCH v2 2/3 irqchip: irq-s3c24xx: add devicetree support
In reply to Heiko StübnerThis adds devicetree parsing of the controller-data for the interrupt controllers on S3C24XX architectures.
As the interrupts and their parent differ on all s3c24xx SoCs the interrupt-list and parent-relationship is read from a list in the devicetree data.
--- .../interrupt-controller/samsung,s3c24xx-irq.txt | 53 ++++++++ drivers/irqchip/Makefile | 2 +- drivers/irqchip/irq-s3c24xx.c | 128 ++++++++++++++++++++ 3 files changed, 182 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/samsung,s3c24xx-irq.txt
Documentation/devicetree/bindings/interrupt-controller/samsung,s3c24xx-irq.txt new file +53 -0
@@ -0,0 +1,53 @@ +Samsung S3C24XX Interrupt Controllers + +The S3C24XX SoCs contain custom set of interrupt controllers providing a +varying number of interrupt sources. + +The set consists of a main- and a sub-controller as well as a controller +for the external interrupts and on newer SoCs even a second main controller. + +The bit-to-interrupt and parent mapping of the controllers is not fixed +over all SoCs and therefore must be defined in the controller description. + +Required properties: +- compatible: Compatible property value should be "samsung,s3c24xx-irq". + +- reg: Physical base address of the controller and length of memory mapped + region. + +- interrupt-controller : Identifies the node as an interrupt controller +- #interrupt-cells : Specifies the number of cells needed to encode an + interrupt source. The value shall be 2. + +- s3c24xx,irqlist : List of irqtypes found on this controller as + two-value pairs consisting of irqtype and parent-irq number + + parent-irq is always the list position of the irq in the irqlist + of the parent controller (0..31) + + irqtypes are: + - 0 .. none + - 1 .. external interrupts + - 2 .. edge irq + - 3 .. level irq + +Optional properties: +- interrupt_parent : The parent interrupt controller + +Example: + + intc2:interrupt-controller at 4a000040 { + compatible = "samsung,s3c24xx-irq"; + reg = <0x4a000040 0x18>; + interrupt-controller; + #interrupt-cells = <2>; + + s3c24xx,irqlist = <2 0 /* 2D */ + 2 0 /* IIC1 */ + 0 0 /* reserved */ + 0 0 /* reserved */ + 2 0 /* PCM0 */ + 2 0 /* PCM1 */ + 2 0 /* I2S0 */ + 2 0>; /* I2S1 */ + };
drivers/irqchip/Makefile +1 -1
@@ -4,7 +4,7 @@ obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_METAG) += irq-metag-ext.o obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o -obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.c +obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi.o obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o obj-$(CONFIG_ARM_GIC) += irq-gic.o
drivers/irqchip/irq-s3c24xx.c +128 -0
143 lines not on this page · raw message
Signature · 1 line
1.7.2.3
PATCH v2 3/3 ARM: S3C24XX: Add devicetree support and dt-board file for s3c2416 SoCs
In reply to Heiko StübnerThis adds a board file and the devicetree source files to support boards using the Samsung S3C2416 SoC.
The dt source files contain the definitions generic to all S3C24XX SoCs in the s3c24xx.dtsi file which then gets extendes with S3C2416 specific definitions.
--- arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/s3c2416-smdk2416.dts | 79 +++++++++++++ arch/arm/boot/dts/s3c2416.dtsi | 193 +++++++++++++++++++++++++++++++ arch/arm/boot/dts/s3c24xx.dtsi | 165 ++++++++++++++++++++++++++ arch/arm/mach-s3c24xx/Kconfig | 10 ++ arch/arm/mach-s3c24xx/Makefile | 1 + arch/arm/mach-s3c24xx/mach-s3c2416-dt.c | 91 +++++++++++++++ 7 files changed, 540 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/s3c2416-smdk2416.dts create mode 100644 arch/arm/boot/dts/s3c2416.dtsi create mode 100644 arch/arm/boot/dts/s3c24xx.dtsi create mode 100644 arch/arm/mach-s3c24xx/mach-s3c2416-dt.c
arch/arm/boot/dts/Makefile +1 -0
@@ -134,6 +134,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb \ hrefprev60.dtb \ hrefv60plus.dtb \ ccu9540.dtb +dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ r8a7740-armadillo800eva.dtb \ r8a7779-marzen-reference.dtb \
arch/arm/boot/dts/s3c2416-smdk2416.dts new file +79 -0
79 lines not on this page · raw message
arch/arm/boot/dts/s3c2416.dtsi new file +193 -0
193 lines not on this page · raw message
arch/arm/boot/dts/s3c24xx.dtsi new file +165 -0
165 lines not on this page · raw message
arch/arm/mach-s3c24xx/Kconfig +10 -0
@@ -496,6 +496,16 @@ config MACH_SMDK2416 help Say Y here if you are using an SMDK2416 +config MACH_S3C2416_DT + bool "Samsung S3C2416 machine using devicetree" + select CLKSRC_OF + select USE_OF + help + Machine support for Samsung S3C2416 machines with device tree enabled. + Select this if a fdt blob is available for the S3C2416 SoC based board. + Note: This is under development and not all peripherals can be supported + with this machine file. + endif # CPU_S3C2416 if CPU_S3C2440
arch/arm/mach-s3c24xx/Makefile +1 -0
@@ -85,6 +85,7 @@ obj-$(CONFIG_MACH_SMDK2413) += mach-smdk2413.o obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o +obj-$(CONFIG_MACH_S3C2416_DT) += mach-s3c2416-dt.o obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
arch/arm/mach-s3c24xx/mach-s3c2416-dt.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
1.7.2.3
Quoted 67 lines · Heiko St?bner
This is the second installment of beginning devicetree support the Samsung S3C24xx architectures and focuses on the s3c2416 for now.
Included is the devicetree support for the s3c24xx irq controller and basic support for smdk2416 boards, which can sucessfully boot.
After the discussion with Thomas Abraham on v1 and staring to long at all of
this, I'm not even sure if having the interrupt mapping in the binding is the correct way to go anymore.The key positive aspect of this solution is, that after everything is running
via dt all the SoC specific mapping tables in the driver can go away, cutting
its length in half.The other option would be as Thomas suggested to define specific irq- controller
types (i.e. s3c2416-intc, s3c2443-intc, ... resulting in 16 types) and keep
the mapping data in the code, as it is now.So I would be very thankful for a bit of guidance on what is the better way.
The series depends on the finalized s3c24xx irq rework, which probably won't
make it into 3.9 and also the clocksource dt support by Tomasz Figa, which are not in any tree yet.Changes since v1:
- adapt to changes in the underlying s3c24xx irq rework
= more shared init code
- use irqchip infrastructure
- limit number of possible irq-types to not encode implementation details into the binding
- include new samsung-clocksourceHeiko Stuebner (3):
ARM: S3C24XX: move irq driver todrivers/irqchip
irqchip: irq-s3c24xx: add devicetree support
ARM: S3C24XX: Add devicetree support and dt-board file for s3c2416 SoCs.../interrupt-controller/samsung,s3c24xx-irq.txt | 53 ++++++ arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/s3c2416-smdk2416.dts | 79 ++++++++ arch/arm/boot/dts/s3c2416.dtsi | 193 ++++++++++++++++++++ arch/arm/boot/dts/s3c24xx.dtsi | 165 +++++++++++++++++ arch/arm/mach-s3c24xx/Kconfig | 10 + arch/arm/mach-s3c24xx/Makefile | 3 +- arch/arm/mach-s3c24xx/mach-s3c2416-dt.c | 91 +++++++++ drivers/irqchip/Makefile | 1 + .../irq.c => drivers/irqchip/irq-s3c24xx.c | 128 +++++++++++++ 10 files changed, 723 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt- controller/samsung,s3c24xx-irq.txt create mode 100644 arch/arm/boot/dts/s3c2416-smdk2416.dts create mode 100644 arch/arm/boot/dts/s3c2416.dtsi create mode 100644 arch/arm/boot/dts/s3c24xx.dtsi create mode 100644 arch/arm/mach-s3c24xx/mach-s3c2416-dt.c rename arch/arm/mach-s3c24xx/irq.c => drivers/irqchip/irq-s3c24xx.c (92%)
Quoted 2 lines
--
1.7.2.3
Basically, looks good to me and thanks for your effort.
BTW, if you don't mind, would be better to send to upstream next time. Because I need to consider other s3c24xx SoCs for DT...
Thanks.
- Kukjin
Am Mittwoch, 10. April 2013, 12:15:48 schrieb Kukjin Kim:
Quoted 75 lines
Quoted 74 lines · Heiko St?bner
This is the second installment of beginning devicetree support the Samsung S3C24xx architectures and focuses on the s3c2416 for now.
Included is the devicetree support for the s3c24xx irq controller and basic support for smdk2416 boards, which can sucessfully boot.
After the discussion with Thomas Abraham on v1 and staring to long at all of
this, I'm not even sure if having the interrupt mapping in the binding is the correct way to go anymore.The key positive aspect of this solution is, that after everything is running
via dt all the SoC specific mapping tables in the driver can go away, cutting
its length in half.The other option would be as Thomas suggested to define specific irq- controller
types (i.e. s3c2416-intc, s3c2443-intc, ... resulting in 16 types) and keep
the mapping data in the code, as it is now.So I would be very thankful for a bit of guidance on what is the better way.
The series depends on the finalized s3c24xx irq rework, which probably won't
make it into 3.9 and also the clocksource dt support by Tomasz Figa, which are not in any tree yet.Changes since v1:
- adapt to changes in the underlying s3c24xx irq rework= more shared init code
- use irqchip infrastructure
- limit number of possible irq-types to not encode implementation detailsinto the binding
- include new samsung-clocksource
Heiko Stuebner (3):
ARM: S3C24XX: move irq driver todrivers/irqchip
irqchip: irq-s3c24xx: add devicetree support
ARM: S3C24XX: Add devicetree support and dt-board file for s3c2416 SoCs.../interrupt-controller/samsung,s3c24xx-irq.txt | 53 ++++++ arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/s3c2416-smdk2416.dts | 79 ++++++++ arch/arm/boot/dts/s3c2416.dtsi | 193 ++++++++++++++++++++ arch/arm/boot/dts/s3c24xx.dtsi | 165 +++++++++++++++++ arch/arm/mach-s3c24xx/Kconfig | 10 + arch/arm/mach-s3c24xx/Makefile | 3 +- arch/arm/mach-s3c24xx/mach-s3c2416-dt.c | 91 +++++++++ drivers/irqchip/Makefile | 1 + .../irq.c => drivers/irqchip/irq-s3c24xx.c | 128 +++++++++++++ 10 files changed, 723 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/interrupt-
controller/samsung,s3c24xx-irq.txtcreate mode 100644 arch/arm/boot/dts/s3c2416-smdk2416.dts create mode 100644 arch/arm/boot/dts/s3c2416.dtsi create mode 100644 arch/arm/boot/dts/s3c24xx.dtsi create mode 100644 arch/arm/mach-s3c24xx/mach-s3c2416-dt.c rename arch/arm/mach-s3c24xx/irq.c => drivers/irqchip/irq-s3c24xx.c(92%)
Quoted 7 lines
Quoted 2 lines
--
1.7.2.3Basically, looks good to me and thanks for your effort.
BTW, if you don't mind, would be better to send to upstream next time. Because I need to consider other s3c24xx SoCs for DT...
hehe, you're digging up quite old stuff :-)
This of course got superseeded by the different approach to s3c24xx-irq dt- support and the pinctrl work.
I'll send a new version of the dt support which takes into account all the recent changes in the next couple of days.
Of course I'm ok with delaying this until 3.11. At least all the building blocks (irq and pinctrl) are there now.
Heiko