[OpenWrt-Devel] [PATCH 4/5] apm821xx: apm82181.dtsi overhaul
Christian Lamparter
chunkeey at gmail.com
Mon Oct 15 14:00:08 EDT 2018
- order entries by mmio address where possible
- switch to lower-case address values
- comment on BSP u-boot behaviour in regards to
what it edits and look for
- annotate irq lines with the help of interrupt-names
- remove deprecated "device_type" properties
The pci and network device_type had to stay since
they are required by the drivers and u-boot.
the cpu and memory device_types will remain as well
as they are still part of the DT Spec.
Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
target/linux/apm821xx/dts/apm82181.dtsi | 274 ++++++++++++------------
1 file changed, 139 insertions(+), 135 deletions(-)
diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi
index 79596da672..951f3d5f08 100644
--- a/target/linux/apm821xx/dts/apm82181.dtsi
+++ b/target/linux/apm821xx/dts/apm82181.dtsi
@@ -32,7 +32,7 @@
compatible = "apm,bluestone";
aliases {
- ethernet0 = &EMAC0;
+ ethernet0 = &EMAC0; /* needed for BSP u-boot */
};
cpus {
@@ -61,7 +61,7 @@
};
UIC0: interrupt-controller0 {
- compatible = "apm,uic-apm82181","ibm,uic";
+ compatible = "apm,uic-apm82181", "ibm,uic";
interrupt-controller;
cell-index = <0>;
dcr-reg = <0x0c0 0x009>;
@@ -71,28 +71,28 @@
};
UIC1: interrupt-controller1 {
- compatible = "apm,uic-apm82181","ibm,uic";
+ compatible = "apm,uic-apm82181", "ibm,uic";
interrupt-controller;
cell-index = <1>;
dcr-reg = <0x0d0 0x009>;
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <2>;
- interrupts = <0x1e IRQ_TYPE_LEVEL_HIGH
- 0x1f IRQ_TYPE_LEVEL_HIGH>; /* cascade */
+ interrupts = <0x1e IRQ_TYPE_LEVEL_HIGH>,
+ <0x1f IRQ_TYPE_LEVEL_HIGH>; /* cascade */
interrupt-parent = <&UIC0>;
};
UIC2: interrupt-controller2 {
- compatible = "apm,uic-apm82181","ibm,uic";
+ compatible = "apm,uic-apm82181", "ibm,uic";
interrupt-controller;
cell-index = <2>;
dcr-reg = <0x0e0 0x009>;
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <2>;
- interrupts = <0x0a IRQ_TYPE_LEVEL_HIGH
- 0x0b IRQ_TYPE_LEVEL_HIGH>; /* cascade */
+ interrupts = <0x0a IRQ_TYPE_LEVEL_HIGH>,
+ <0x0b IRQ_TYPE_LEVEL_HIGH>; /* cascade */
interrupt-parent = <&UIC0>;
};
@@ -104,8 +104,8 @@
#address-cells = <0>;
#size-cells = <0>;
#interrupt-cells = <2>;
- interrupts = <0x10 IRQ_TYPE_LEVEL_HIGH
- 0x11 IRQ_TYPE_LEVEL_HIGH>; /* cascade */
+ interrupts = <0x10 IRQ_TYPE_LEVEL_HIGH>,
+ <0x11 IRQ_TYPE_LEVEL_HIGH>; /* cascade */
interrupt-parent = <&UIC0>;
};
@@ -156,7 +156,7 @@
compatible = "apm,plb-apm82181", "ibm,plb-460ex", "ibm,plb4";
#address-cells = <2>;
#size-cells = <1>;
- ranges;
+ ranges; /* Filled in by U-Boot */
clock-frequency = <0>; /* Filled in by U-Boot */
SDRAM0: sdram {
@@ -172,16 +172,15 @@
};
- CRYPTO: crypto at 180000 {
- compatible = "amcc,ppc460ex-crypto", "amcc,ppc4xx-crypto";
- reg = <4 0x00180000 0x80400>;
- interrupt-parent = <&UIC0>;
- interrupts = <0x1d IRQ_TYPE_LEVEL_HIGH>;
+ TRNG: trng at 110000 {
+ compatible = "amcc,ppc460ex-rng", "ppc4xx-rng", "amcc, ppc4xx-trng";
+ reg = <4 0x00110000 0x100>;
+ interrupt-parent = <&UIC1>;
+ interrupts = <0x03 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
PKA: pka at 114000 {
- device_type = "pka";
compatible = "ppc4xx-pka", "amcc,ppc4xx-pka", "amcc, ppc4xx-pka";
reg = <4 0x00114000 0x4000>;
interrupt-parent = <&UIC0>;
@@ -189,13 +188,12 @@
status = "disabled";
};
- TRNG: trng at 110000 {
- device_type = "trng";
- compatible = "amcc,ppc460ex-rng", "ppc4xx-rng", "amcc, ppc4xx-trng";
- reg = <4 0x00110000 0x100>;
- interrupt-parent = <&UIC1>;
- interrupts = <0x03 IRQ_TYPE_LEVEL_HIGH>;
- status = "disabled";
+ CRYPTO: crypto at 180000 {
+ compatible = "amcc,ppc460ex-crypto", "amcc,ppc4xx-crypto";
+ reg = <4 0x00180000 0x80400>;
+ interrupt-parent = <&UIC0>;
+ interrupts = <0x1d IRQ_TYPE_LEVEL_HIGH>;
+ status = "disabled"; /* hardware option */
};
MAL0: mcmal {
@@ -207,59 +205,19 @@
#address-cells = <0>;
#size-cells = <0>;
interrupt-parent = <&UIC2>;
- interrupts = < 0x06 IRQ_TYPE_LEVEL_HIGH /*TXEOB*/
- 0x07 IRQ_TYPE_LEVEL_HIGH /*RXEOB*/
- 0x03 IRQ_TYPE_LEVEL_HIGH /*SERR*/
- 0x04 IRQ_TYPE_LEVEL_HIGH /*TXDE*/
- 0x05 IRQ_TYPE_LEVEL_HIGH /*RXDE*/
- 0x08 IRQ_TYPE_EDGE_FALLING /*TX0 COAL*/
- /*0x09 IRQ_TYPE_EDGE_FALLING TX1 COAL*/
- 0x0c IRQ_TYPE_EDGE_FALLING /*RX0 COAL*/
- /*0x0d IRQ_TYPE_EDGE_FALLING RX1 COAL*/>;
- };
-
- AHBDMA0: dma at bffd0800 {
- compatible = "snps,dma-spear1340";
- reg = <4 0xbffd0800 0x400>;
- interrupt-parent = <&UIC0>;
- interrupts = <0x19 IRQ_TYPE_LEVEL_HIGH>;
- #dma-cells = <3>;
- /* use autoconfiguration for the dma setup */
- };
-
- SATA0: sata at bffd1000 {
- compatible = "amcc,sata-460ex";
- reg = <4 0xbffd1000 0x800>;
- interrupt-parent = <&UIC0>;
- interrupts = <0x1a IRQ_TYPE_LEVEL_HIGH>;
- dmas = <&AHBDMA0 0 0 1>;
- dma-names = "sata-dma";
- status = "disabled";
- };
-
- SATA1: sata at bffd1800 {
- compatible = "amcc,sata-460ex";
- reg = <4 0xbffd1800 0x800>;
- interrupt-parent = <&UIC0>;
- interrupts = <0x1b IRQ_TYPE_LEVEL_HIGH>;
- dmas = <&AHBDMA0 1 0 2>;
- dma-names = "sata-dma";
- status = "disabled";
- };
-
- USBOTG0: usbotg at bff80000 {
- compatible = "amcc,dwc-otg";
- reg = <4 0xbff80000 0x10000>;
- interrupt-parent = <&USBOTG0>;
- interrupts = <0 1 2>;
- #interrupt-cells = <1>;
- #address-cells = <0>;
- #size-cells = <0>;
- interrupt-map = <0 &UIC2 0x1c IRQ_TYPE_LEVEL_HIGH /* USB-OTG */
- 1 &UIC1 0x1a IRQ_TYPE_LEVEL_LOW /* HIGH-POWER */
- 2 &UIC0 0x0c IRQ_TYPE_LEVEL_HIGH /* DMA */>;
- dr_mode = "host";
- status = "disabled";
+ interrupts = <0x06 IRQ_TYPE_LEVEL_HIGH>,
+ <0x07 IRQ_TYPE_LEVEL_HIGH>,
+ <0x03 IRQ_TYPE_LEVEL_HIGH>,
+ <0x04 IRQ_TYPE_LEVEL_HIGH>,
+ <0x05 IRQ_TYPE_LEVEL_HIGH>,
+ <0x08 IRQ_TYPE_EDGE_FALLING>,
+ <0x09 IRQ_TYPE_EDGE_FALLING>,
+ <0x0c IRQ_TYPE_EDGE_FALLING>,
+ <0x0d IRQ_TYPE_EDGE_FALLING>;
+ interrupt-names = "txeob", "rxeob", "serr",
+ "txde", "rxde",
+ "tx0coal", "tx1coal",
+ "rx0coal", "rx1coal";
};
POB0: opb {
@@ -309,9 +267,9 @@
/*
* AMCC's BSP u-boot scans for the "ns16550"
* compatible, without it, u-boot wouldn't
- * set the "clock-frequency" which is required.
+ * set the required "clock-frequency".
*
- * However, the hardware documentation lists:
+ * The hardware documentation states:
* "Register compatibility with 16750 register set"
*/
compatible = "ns16750", "ns16550";
@@ -334,14 +292,6 @@
status = "disabled";
};
- GPIO0: gpio at ef600b00 {
- compatible = "ibm,ppc4xx-gpio";
- reg = <0xef600b00 0x00000048>;
- #gpio-cells = <2>;
- gpio-controller;
- status = "disabled";
- };
-
IIC0: i2c at ef600700 {
compatible = "ibm,iic-460ex", "ibm,iic";
reg = <0xef600700 0x00000014>;
@@ -360,15 +310,12 @@
status = "disabled";
};
- RGMII0: emac-rgmii at ef601500 {
- compatible = "ibm,rgmii-405ex", "ibm,rgmii";
- reg = <0xef601500 0x00000008>;
- has-mdio;
- };
-
- TAH0: emac-tah at ef601350 {
- compatible = "ibm,tah-460ex", "ibm,tah";
- reg = <0xef601350 0x00000030>;
+ GPIO0: gpio at ef600b00 {
+ compatible = "ibm,ppc4xx-gpio";
+ reg = <0xef600b00 0x00000048>;
+ #gpio-cells = <2>;
+ gpio-controller;
+ status = "disabled";
};
EMAC0: ethernet at ef600c00 {
@@ -379,8 +326,10 @@
#interrupt-cells = <1>;
#address-cells = <0>;
#size-cells = <0>;
- interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH /* Status */
- 1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH /* Wake */>;
+ interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH>,
+ <1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "status", "wake";
+
reg = <0xef600c00 0x000000c4>;
local-mac-address = [000000000000]; /* Filled in by U-Boot */
mal-device = <&MAL0>;
@@ -401,27 +350,108 @@
has-new-stacr-staopc;
status = "disabled";
};
+
+ TAH0: emac-tah at ef601350 {
+ compatible = "ibm,tah-460ex", "ibm,tah";
+ reg = <0xef601350 0x00000030>;
+ };
+
+ RGMII0: emac-rgmii at ef601500 {
+ compatible = "ibm,rgmii-405ex", "ibm,rgmii";
+ reg = <0xef601500 0x00000008>;
+ has-mdio;
+ };
+ };
+
+ USBOTG0: usbotg at bff80000 {
+ compatible = "amcc,dwc-otg";
+ reg = <4 0xbff80000 0x10000>;
+ interrupt-parent = <&USBOTG0>;
+ interrupts = <0 1 2>;
+ #interrupt-cells = <1>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ interrupt-map = <0 &UIC2 0x1c IRQ_TYPE_LEVEL_HIGH>,
+ <1 &UIC1 0x1a IRQ_TYPE_LEVEL_LOW>,
+ <2 &UIC0 0x0c IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "usb-otg", "high-power", "dma";
+ dr_mode = "host";
+ status = "disabled";
+ };
+
+ AHBDMA0: dma at bffd0800 {
+ compatible = "snps,dma-spear1340";
+ reg = <4 0xbffd0800 0x400>;
+ interrupt-parent = <&UIC0>;
+ interrupts = <0x19 IRQ_TYPE_LEVEL_HIGH>;
+ #dma-cells = <3>;
+ /* use autoconfiguration for the dma setup */
+ };
+
+ SATA0: sata at bffd1000 {
+ compatible = "amcc,sata-460ex";
+ reg = <4 0xbffd1000 0x800>;
+ interrupt-parent = <&UIC0>;
+ interrupts = <0x1a IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&AHBDMA0 0 0 1>;
+ dma-names = "sata-dma";
+ status = "disabled";
+ };
+
+ SATA1: sata at bffd1800 {
+ compatible = "amcc,sata-460ex";
+ reg = <4 0xbffd1800 0x800>;
+ interrupt-parent = <&UIC0>;
+ interrupts = <0x1b IRQ_TYPE_LEVEL_HIGH>;
+ dmas = <&AHBDMA0 1 0 2>;
+ dma-names = "sata-dma";
+ status = "disabled";
+ };
+
+ MSI: ppc4xx-msi at c10000000 {
+ compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
+ reg = <0xc 0x10000000 0x100
+ 0xc 0x10000000 0x100>;
+ sdr-base = <0x36C>;
+ msi-data = <0x00004440>;
+ msi-mask = <0x0000ffe0>;
+ interrupts =<0 1 2 3 4 5 6 7>;
+ interrupt-parent = <&MSI>;
+ #interrupt-cells = <1>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ msi-available-ranges = <0x0 0x100>;
+ interrupt-map =
+ <0 &UIC3 0x18 IRQ_TYPE_EDGE_RISING>,
+ <1 &UIC3 0x19 IRQ_TYPE_EDGE_RISING>,
+ <2 &UIC3 0x1a IRQ_TYPE_EDGE_RISING>,
+ <3 &UIC3 0x1b IRQ_TYPE_EDGE_RISING>,
+ <4 &UIC3 0x1c IRQ_TYPE_EDGE_RISING>,
+ <5 &UIC3 0x1d IRQ_TYPE_EDGE_RISING>,
+ <6 &UIC3 0x1e IRQ_TYPE_EDGE_RISING>,
+ <7 &UIC3 0x1f IRQ_TYPE_EDGE_RISING>;
+ status = "disabled";
};
PCIE0: pciex at d00000000 {
- device_type = "pci";
+ device_type = "pci"; /* see ppc4xx_pci_find_bridge */
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
compatible = "ibm,plb-pciex-apm821xx", "ibm,plb-pciex";
primary;
port = <0x0>; /* port number */
- reg = <0x0000000d 0x00000000 0x20000000 /* Config space access */
- 0x0000000c 0x08010000 0x00001000>; /* Registers */
+ reg = <0x0000000d 0x00000000 0x20000000>, /* Config space access */
+ <0x0000000c 0x08010000 0x00001000>; /* Registers */
dcr-reg = <0x100 0x020>;
sdr-base = <0x300>;
/* Outbound ranges, one memory and one IO,
* later cannot be changed
*/
- ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000
- 0x02000000 0x00000000 0x00000000 0x0000000f 0x00000000 0x00000000 0x00100000
- 0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
+ ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000>,
+ <0x02000000 0x00000000 0x00000000 0x0000000f 0x00000000 0x00000000 0x00100000>,
+ <0x01000000 0x00000000 0x00000000 0x0000000f 0x80000000 0x00000000 0x00010000>;
/* Inbound 2GB range starting at 0 */
dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x0 0x80000000>;
@@ -438,37 +468,11 @@
* The real slot is on idsel 0, so the swizzling is 1:1
*/
interrupt-map-mask = <0x0 0x0 0x0 0x7>;
- interrupt-map = <
- 0x0 0x0 0x0 0x1 &UIC3 0x0c IRQ_TYPE_LEVEL_HIGH /* swizzled int A */
- 0x0 0x0 0x0 0x2 &UIC3 0x0d IRQ_TYPE_LEVEL_HIGH /* swizzled int B */
- 0x0 0x0 0x0 0x3 &UIC3 0x0e IRQ_TYPE_LEVEL_HIGH /* swizzled int C */
- 0x0 0x0 0x0 0x4 &UIC3 0x0f IRQ_TYPE_LEVEL_HIGH /* swizzled int D */>;
- status = "disabled";
- };
-
- MSI: ppc4xx-msi at C10000000 {
- compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
- reg = < 0xC 0x10000000 0x100
- 0xC 0x10000000 0x100>;
- sdr-base = <0x36C>;
- msi-data = <0x00004440>;
- msi-mask = <0x0000ffe0>;
- interrupts =<0 1 2 3 4 5 6 7>;
- interrupt-parent = <&MSI>;
- #interrupt-cells = <1>;
- #address-cells = <0>;
- #size-cells = <0>;
- msi-available-ranges = <0x0 0x100>;
- interrupt-map = <
- 0 &UIC3 0x18 IRQ_TYPE_EDGE_RISING
- 1 &UIC3 0x19 IRQ_TYPE_EDGE_RISING
- 2 &UIC3 0x1a IRQ_TYPE_EDGE_RISING
- 3 &UIC3 0x1b IRQ_TYPE_EDGE_RISING
- 4 &UIC3 0x1c IRQ_TYPE_EDGE_RISING
- 5 &UIC3 0x1d IRQ_TYPE_EDGE_RISING
- 6 &UIC3 0x1e IRQ_TYPE_EDGE_RISING
- 7 &UIC3 0x1f IRQ_TYPE_EDGE_RISING
- >;
+ interrupt-map =
+ <0x0 0x0 0x0 0x1 &UIC3 0x0c IRQ_TYPE_LEVEL_HIGH>, /* swizzled int A */
+ <0x0 0x0 0x0 0x2 &UIC3 0x0d IRQ_TYPE_LEVEL_HIGH>, /* swizzled int B */
+ <0x0 0x0 0x0 0x3 &UIC3 0x0e IRQ_TYPE_LEVEL_HIGH>, /* swizzled int C */
+ <0x0 0x0 0x0 0x4 &UIC3 0x0f IRQ_TYPE_LEVEL_HIGH>; /* swizzled int D */
status = "disabled";
};
};
--
2.19.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list