From 7512cd4a30a4931ea147c6de85a41dccbd228fd2 Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Wed, 21 Aug 2024 13:31:08 +0930 Subject: [PATCH] ARM: dts: aspeed: Rework APB nodes The way the APB nodes are currently described causes excessive output from `make dtbs_check` (approximately 30KB per devicetree). This stems from nesting the apb nodes under the top-level ahb nodes, while the simple-bus binding requires that the ahb subnode names contain a unit address[1]. In the process of cleaning this up, it became apparent that both the APB descriptions in the devicetree and datasheet were pretty murky. I followed up with Troy Lee and Ryan Chen, and received the following from Ryan: > Sorry, I double confirm with designer. > AST2400/AST2500/AST2600: 1e6exxxx, 1e6fxxxx, 1e78xxxx, 1e79xxxx : APB, > others is AHB As a result, update the Aspeed DTSIs to describe one APB node per mapping listed in Ryan's response, and lift all controllers that are not in the described ranges out of the APB nodes to the AHB node. This change may impact OpenBMC userspace applications that use devicetree paths in sysfs to identify hardware components. However, these uses of sysfs were previously identified as incorrect[2][3][4]. Its expected that any affected applications will reworked so they are not sensitive to node renames. Cc: Andrew Geissler Cc: Krzysztof Kozlowski Cc: Rob Herring (Arm) Cc: Ryan Chen Cc: Troy Lee Link: https://github.com/devicetree-org/dt-schema/blob/c51125d571cac9596048e888a856d70650e400e0/dtschema/schemas/simple-bus.yaml#L35-L36 [1] Link: https://github.com/openbmc/phosphor-state-manager/issues/27 [2] Link: https://lore.kernel.org/all/20240531193115.3814887-1-robh@kernel.org/ [3] Link: https://lore.kernel.org/all/8dabf3d1-2d23-4adc-a804-2b7aa5fe16e9@kernel.org/ [4] Link: https://lore.kernel.org/r/20240821-dt-warnings-apb-nodes-v1-1-c524923acca5@codeconstruct.com.au Signed-off-by: Andrew Jeffery --- arch/arm/boot/dts/aspeed/aspeed-g4.dtsi | 93 +++++---- arch/arm/boot/dts/aspeed/aspeed-g5.dtsi | 109 ++++++----- arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 249 +++++++++++++----------- 3 files changed, 251 insertions(+), 200 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi index 78c96781249289..7b1982c116f17e 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g4.dtsi @@ -179,8 +179,9 @@ status = "disabled"; }; - apb { + apb@1e6e0000 { compatible = "simple-bus"; + reg = <0x1e6e0000 0x00010000>; #address-cells = <1>; #size-cells = <1>; ranges; @@ -226,52 +227,62 @@ #io-channel-cells = <1>; status = "disabled"; }; + }; - sram: sram@1e720000 { - compatible = "mmio-sram"; - reg = <0x1e720000 0x8000>; // 32K - ranges; - #address-cells = <1>; - #size-cells = <1>; - }; + /* There's another APB mapping at 0x1e6f0000 for 0x00010000 */ + + sram: sram@1e720000 { + compatible = "mmio-sram"; + reg = <0x1e720000 0x8000>; // 32K + ranges; + #address-cells = <1>; + #size-cells = <1>; + }; + + video: video@1e700000 { + compatible = "aspeed,ast2400-video-engine"; + reg = <0x1e700000 0x1000>; + clocks = <&syscon ASPEED_CLK_GATE_VCLK>, + <&syscon ASPEED_CLK_GATE_ECLK>; + clock-names = "vclk", "eclk"; + interrupts = <7>; + status = "disabled"; + }; + + sdmmc: sd-controller@1e740000 { + compatible = "aspeed,ast2400-sd-controller"; + reg = <0x1e740000 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1e740000 0x10000>; + clocks = <&syscon ASPEED_CLK_GATE_SDCLK>; + status = "disabled"; - video: video@1e700000 { - compatible = "aspeed,ast2400-video-engine"; - reg = <0x1e700000 0x1000>; - clocks = <&syscon ASPEED_CLK_GATE_VCLK>, - <&syscon ASPEED_CLK_GATE_ECLK>; - clock-names = "vclk", "eclk"; - interrupts = <7>; + sdhci0: sdhci@100 { + compatible = "aspeed,ast2400-sdhci"; + reg = <0x100 0x100>; + interrupts = <26>; + sdhci,auto-cmd12; + clocks = <&syscon ASPEED_CLK_SDIO>; status = "disabled"; }; - sdmmc: sd-controller@1e740000 { - compatible = "aspeed,ast2400-sd-controller"; - reg = <0x1e740000 0x100>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x1e740000 0x10000>; - clocks = <&syscon ASPEED_CLK_GATE_SDCLK>; + sdhci1: sdhci@200 { + compatible = "aspeed,ast2400-sdhci"; + reg = <0x200 0x100>; + interrupts = <26>; + sdhci,auto-cmd12; + clocks = <&syscon ASPEED_CLK_SDIO>; status = "disabled"; - - sdhci0: sdhci@100 { - compatible = "aspeed,ast2400-sdhci"; - reg = <0x100 0x100>; - interrupts = <26>; - sdhci,auto-cmd12; - clocks = <&syscon ASPEED_CLK_SDIO>; - status = "disabled"; - }; - - sdhci1: sdhci@200 { - compatible = "aspeed,ast2400-sdhci"; - reg = <0x200 0x100>; - interrupts = <26>; - sdhci,auto-cmd12; - clocks = <&syscon ASPEED_CLK_SDIO>; - status = "disabled"; - }; }; + }; + + apb@1e780000 { + compatible = "simple-bus"; + reg = <0x1e780000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; gpio: gpio@1e780000 { #gpio-cells = <2>; @@ -454,6 +465,8 @@ ranges = <0 0x1e78a000 0x1000>; }; }; + + /* There's another APB mapping at 0x1e790000 for 0x00010000 */ }; }; diff --git a/arch/arm/boot/dts/aspeed/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g5.dtsi index 57a699a7c1499e..c4d7986cd357f1 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g5.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g5.dtsi @@ -207,8 +207,9 @@ status = "disabled"; }; - apb { + apb@1e6e0000 { compatible = "simple-bus"; + reg = <0x1e6e0000 0x00010000>; #address-cells = <1>; #size-cells = <1>; ranges; @@ -289,53 +290,63 @@ #io-channel-cells = <1>; status = "disabled"; }; + }; - video: video@1e700000 { - compatible = "aspeed,ast2500-video-engine"; - reg = <0x1e700000 0x1000>; - clocks = <&syscon ASPEED_CLK_GATE_VCLK>, - <&syscon ASPEED_CLK_GATE_ECLK>; - clock-names = "vclk", "eclk"; - interrupts = <7>; - status = "disabled"; - }; + /* There's another APB mapping at 0x1e6f0000 for 0x00010000 */ - sram: sram@1e720000 { - compatible = "mmio-sram"; - reg = <0x1e720000 0x9000>; // 36K - ranges; - #address-cells = <1>; - #size-cells = <1>; - }; + video: video@1e700000 { + compatible = "aspeed,ast2500-video-engine"; + reg = <0x1e700000 0x1000>; + clocks = <&syscon ASPEED_CLK_GATE_VCLK>, + <&syscon ASPEED_CLK_GATE_ECLK>; + clock-names = "vclk", "eclk"; + interrupts = <7>; + status = "disabled"; + }; - sdmmc: sd-controller@1e740000 { - compatible = "aspeed,ast2500-sd-controller"; - reg = <0x1e740000 0x100>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x1e740000 0x10000>; - clocks = <&syscon ASPEED_CLK_GATE_SDCLK>; - status = "disabled"; + sram: sram@1e720000 { + compatible = "mmio-sram"; + reg = <0x1e720000 0x9000>; // 36K + ranges; + #address-cells = <1>; + #size-cells = <1>; + }; - sdhci0: sdhci@100 { - compatible = "aspeed,ast2500-sdhci"; - reg = <0x100 0x100>; - interrupts = <26>; - sdhci,auto-cmd12; - clocks = <&syscon ASPEED_CLK_SDIO>; - status = "disabled"; - }; + sdmmc: sd-controller@1e740000 { + compatible = "aspeed,ast2500-sd-controller"; + reg = <0x1e740000 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1e740000 0x10000>; + clocks = <&syscon ASPEED_CLK_GATE_SDCLK>; + status = "disabled"; - sdhci1: sdhci@200 { - compatible = "aspeed,ast2500-sdhci"; - reg = <0x200 0x100>; - interrupts = <26>; - sdhci,auto-cmd12; - clocks = <&syscon ASPEED_CLK_SDIO>; - status = "disabled"; - }; + sdhci0: sdhci@100 { + compatible = "aspeed,ast2500-sdhci"; + reg = <0x100 0x100>; + interrupts = <26>; + sdhci,auto-cmd12; + clocks = <&syscon ASPEED_CLK_SDIO>; + status = "disabled"; }; + sdhci1: sdhci@200 { + compatible = "aspeed,ast2500-sdhci"; + reg = <0x200 0x100>; + interrupts = <26>; + sdhci,auto-cmd12; + clocks = <&syscon ASPEED_CLK_SDIO>; + status = "disabled"; + }; + }; + + apb@1e780000 { + compatible = "simple-bus"; + reg = <0x1e780000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + gpio: gpio@1e780000 { #gpio-cells = <2>; gpio-controller; @@ -521,6 +532,13 @@ }; }; + i2c: bus@1e78a000 { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1e78a000 0x1000>; + }; + peci0: peci-controller@1e78b000 { compatible = "aspeed,ast2500-peci"; reg = <0x1e78b000 0x60>; @@ -564,14 +582,9 @@ no-loopback-test; status = "disabled"; }; - - i2c: bus@1e78a000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x1e78a000 0x1000>; - }; }; + + /* There's another APB mapping at 0x1e790000 for 0x00010000 */ }; }; diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi index 8ed715bd53aab2..88e719cc19bbc4 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi @@ -318,20 +318,21 @@ status = "disabled"; }; - apb { + hace: crypto@1e6d0000 { + compatible = "aspeed,ast2600-hace"; + reg = <0x1e6d0000 0x200>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_GATE_YCLK>; + resets = <&syscon ASPEED_RESET_HACE>; + }; + + apb@1e6e0000 { compatible = "simple-bus"; + reg = <0x1e6e0000 0x00010000>; #address-cells = <1>; #size-cells = <1>; ranges; - hace: crypto@1e6d0000 { - compatible = "aspeed,ast2600-hace"; - reg = <0x1e6d0000 0x200>; - interrupts = ; - clocks = <&syscon ASPEED_CLK_GATE_YCLK>; - resets = <&syscon ASPEED_RESET_HACE>; - }; - syscon: syscon@1e6e2000 { compatible = "aspeed,ast2600-scu", "syscon", "simple-mfd"; reg = <0x1e6e2000 0x1000>; @@ -409,6 +410,14 @@ #io-channel-cells = <1>; status = "disabled"; }; + }; + + apb@1e6f0000 { + compatible = "simple-bus"; + reg = <0x1e6f0000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; sbc: secure-boot-controller@1e6f2000 { compatible = "aspeed,ast2600-sbc"; @@ -422,17 +431,73 @@ clocks = <&syscon ASPEED_CLK_GATE_RSACLK>; aspeed,ahbc = <&ahbc>; }; + }; + + video: video@1e700000 { + compatible = "aspeed,ast2600-video-engine"; + reg = <0x1e700000 0x1000>; + clocks = <&syscon ASPEED_CLK_GATE_VCLK>, + <&syscon ASPEED_CLK_GATE_ECLK>; + clock-names = "vclk", "eclk"; + interrupts = ; + status = "disabled"; + }; + + sdc: sdc@1e740000 { + compatible = "aspeed,ast2600-sd-controller"; + reg = <0x1e740000 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1e740000 0x10000>; + clocks = <&syscon ASPEED_CLK_GATE_SDCLK>; + status = "disabled"; - video: video@1e700000 { - compatible = "aspeed,ast2600-video-engine"; - reg = <0x1e700000 0x1000>; - clocks = <&syscon ASPEED_CLK_GATE_VCLK>, - <&syscon ASPEED_CLK_GATE_ECLK>; - clock-names = "vclk", "eclk"; - interrupts = ; + sdhci0: sdhci@1e740100 { + compatible = "aspeed,ast2600-sdhci", "sdhci"; + reg = <0x100 0x100>; + interrupts = ; + sdhci,auto-cmd12; + clocks = <&syscon ASPEED_CLK_SDIO>; status = "disabled"; }; + sdhci1: sdhci@1e740200 { + compatible = "aspeed,ast2600-sdhci", "sdhci"; + reg = <0x200 0x100>; + interrupts = ; + sdhci,auto-cmd12; + clocks = <&syscon ASPEED_CLK_SDIO>; + status = "disabled"; + }; + }; + + emmc_controller: sdc@1e750000 { + compatible = "aspeed,ast2600-sd-controller"; + reg = <0x1e750000 0x100>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x1e750000 0x10000>; + clocks = <&syscon ASPEED_CLK_GATE_EMMCCLK>; + status = "disabled"; + + emmc: sdhci@1e750100 { + compatible = "aspeed,ast2600-sdhci"; + reg = <0x100 0x100>; + sdhci,auto-cmd12; + interrupts = ; + clocks = <&syscon ASPEED_CLK_EMMC>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_emmc_default>; + }; + }; + + apb@1e780000 { + compatible = "simple-bus"; + reg = <0x1e780000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + gpio0: gpio@1e780000 { #gpio-cells = <2>; gpio-controller; @@ -558,14 +623,43 @@ status = "disabled"; }; - peci0: peci-controller@1e78b000 { - compatible = "aspeed,ast2600-peci"; - reg = <0x1e78b000 0x100>; - interrupts = ; - clocks = <&syscon ASPEED_CLK_GATE_REF0CLK>; - resets = <&syscon ASPEED_RESET_PECI>; - cmd-timeout-ms = <1000>; - clock-frequency = <1000000>; + vuart1: serial@1e787000 { + compatible = "aspeed,ast2500-vuart"; + reg = <0x1e787000 0x40>; + reg-shift = <2>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_APB1>; + no-loopback-test; + status = "disabled"; + }; + + vuart3: serial@1e787800 { + compatible = "aspeed,ast2500-vuart"; + reg = <0x1e787800 0x40>; + reg-shift = <2>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_APB2>; + no-loopback-test; + status = "disabled"; + }; + + vuart2: serial@1e788000 { + compatible = "aspeed,ast2500-vuart"; + reg = <0x1e788000 0x40>; + reg-shift = <2>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_APB1>; + no-loopback-test; + status = "disabled"; + }; + + vuart4: serial@1e788800 { + compatible = "aspeed,ast2500-vuart"; + reg = <0x1e788800 0x40>; + reg-shift = <2>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_APB2>; + no-loopback-test; status = "disabled"; }; @@ -652,91 +746,21 @@ }; }; - sdc: sdc@1e740000 { - compatible = "aspeed,ast2600-sd-controller"; - reg = <0x1e740000 0x100>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x1e740000 0x10000>; - clocks = <&syscon ASPEED_CLK_GATE_SDCLK>; - status = "disabled"; - - sdhci0: sdhci@1e740100 { - compatible = "aspeed,ast2600-sdhci", "sdhci"; - reg = <0x100 0x100>; - interrupts = ; - sdhci,auto-cmd12; - clocks = <&syscon ASPEED_CLK_SDIO>; - status = "disabled"; - }; - - sdhci1: sdhci@1e740200 { - compatible = "aspeed,ast2600-sdhci", "sdhci"; - reg = <0x200 0x100>; - interrupts = ; - sdhci,auto-cmd12; - clocks = <&syscon ASPEED_CLK_SDIO>; - status = "disabled"; - }; - }; - - emmc_controller: sdc@1e750000 { - compatible = "aspeed,ast2600-sd-controller"; - reg = <0x1e750000 0x100>; + i2c: bus@1e78a000 { + compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges = <0 0x1e750000 0x10000>; - clocks = <&syscon ASPEED_CLK_GATE_EMMCCLK>; - status = "disabled"; - - emmc: sdhci@1e750100 { - compatible = "aspeed,ast2600-sdhci"; - reg = <0x100 0x100>; - sdhci,auto-cmd12; - interrupts = ; - clocks = <&syscon ASPEED_CLK_EMMC>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_emmc_default>; - }; - }; - - vuart1: serial@1e787000 { - compatible = "aspeed,ast2500-vuart"; - reg = <0x1e787000 0x40>; - reg-shift = <2>; - interrupts = ; - clocks = <&syscon ASPEED_CLK_APB1>; - no-loopback-test; - status = "disabled"; - }; - - vuart3: serial@1e787800 { - compatible = "aspeed,ast2500-vuart"; - reg = <0x1e787800 0x40>; - reg-shift = <2>; - interrupts = ; - clocks = <&syscon ASPEED_CLK_APB2>; - no-loopback-test; - status = "disabled"; - }; - - vuart2: serial@1e788000 { - compatible = "aspeed,ast2500-vuart"; - reg = <0x1e788000 0x40>; - reg-shift = <2>; - interrupts = ; - clocks = <&syscon ASPEED_CLK_APB1>; - no-loopback-test; - status = "disabled"; + ranges = <0 0x1e78a000 0x1000>; }; - vuart4: serial@1e788800 { - compatible = "aspeed,ast2500-vuart"; - reg = <0x1e788800 0x40>; - reg-shift = <2>; - interrupts = ; - clocks = <&syscon ASPEED_CLK_APB2>; - no-loopback-test; + peci0: peci-controller@1e78b000 { + compatible = "aspeed,ast2600-peci"; + reg = <0x1e78b000 0x100>; + interrupts = ; + clocks = <&syscon ASPEED_CLK_GATE_REF0CLK>; + resets = <&syscon ASPEED_RESET_PECI>; + cmd-timeout-ms = <1000>; + clock-frequency = <1000000>; status = "disabled"; }; @@ -781,6 +805,14 @@ pinctrl-0 = <&pinctrl_txd4_default &pinctrl_rxd4_default>; status = "disabled"; }; + }; + + apb@1e790000 { + compatible = "simple-bus"; + reg = <0x1e790000 0x00010000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; uart6: serial@1e790000 { compatible = "ns16550a"; @@ -838,13 +870,6 @@ status = "disabled"; }; - i2c: bus@1e78a000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x1e78a000 0x1000>; - }; - fsim0: fsi@1e79b000 { #interrupt-cells = <1>; compatible = "aspeed,ast2600-fsi-master", "fsi-master";