Skip to content

Commit 65bfb4c

Browse files
committed
ANDROID: riscv: dts: spacemit: add nodes for new K1 peripherals
Add device-tree nodes describing the K1 peripherals brought in by the preceding driver commits: * dram_range0 / dram_range1 (spacemit-dram-bus): per-master DRAM dma-ranges. dram_range0 limits USB/SDH/Ethernet to the first 2GB; dram_range1 lets the VPU/GPU/DPU access full DDR via the interconnect framework. * ddraxi_mon (spacemit,ddraxi-mon): DDR AXI bandwidth monitor at 0xc0058500. * combphy (spacemit,k1x-combphy): USB3+PCIe combo PHY at 0xc0b10000. Shared reset with PCIe0 (RESET_PCIE0_GLOBAL). * reboot_handler (spacemit,k1x-reboot): SoC boot-mode register at 0xd4282f90 used to select next-boot mode before warm reset. * efuse / efuse_bank7 (spacemit,k1-efuse): on-die fuse banks at 0xf0702800 wrapped under simple-mfd. * k1-bananapi-f3.dts, k1-x-peripherals.dtsi, k1-hdmi.dtsi: enable the new nodes for the BananaPi F3 and wire the HDMI/USB/PCIe consumers to them. Change-Id: Ia9059ee7a914b042ed1c6aec12bdf1362b6e1f35 Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
1 parent 35bd0ae commit 65bfb4c

4 files changed

Lines changed: 139 additions & 0 deletions

File tree

arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,3 +817,19 @@
817817
};
818818
};
819819
};
820+
821+
&reboot_handler {
822+
status = "okay";
823+
};
824+
825+
&efuse {
826+
status = "okay";
827+
};
828+
829+
&efuse_bank7 {
830+
status = "okay";
831+
};
832+
833+
&socinfo {
834+
status = "okay";
835+
};

arch/riscv/boot/dts/spacemit/k1-hdmi.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
compatible = "spacemit,saturn-hdmi";
1313
reg = <0 0xc0440000 0 0x2A000>;
1414
ports = <&dpu_online2_hdmi>;
15+
interconnects = <&dram_range1>;
16+
interconnect-names = "dma-mem";
1517
};
1618

1719
dpu_online2_hdmi: port@c0440000 {

arch/riscv/boot/dts/spacemit/k1-x-peripherals.dtsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
* Adapted for Android kernel syscon clock/reset references
77
*/
88

9+
#include <dt-bindings/phy/phy.h>
10+
#include <dt-bindings/power/spacemit-k1x-power.h>
11+
912
/* ============================================================
1013
* USB Subsystem
1114
* ============================================================ */
@@ -140,7 +143,12 @@
140143
clocks = <&syscon_apmu CLK_USB30>;
141144
clock-names = "usbdrd30";
142145
usb-phy = <&usb2phy>;
146+
phys = <&combphy PHY_TYPE_USB3>;
147+
phy-names = "usb3-phy";
148+
interconnects = <&dram_range0>;
149+
interconnect-names = "dma-mem";
143150
interrupts = <149>;
151+
reset-on-resume;
144152
ranges;
145153
status = "disabled";
146154

@@ -150,9 +158,13 @@
150158
interrupts = <125>;
151159
dr_mode = "host";
152160
phy_type = "utmi";
161+
snps,hsphy_interface = "utmi";
153162
snps,dis_enblslpm_quirk;
154163
snps,dis_u2_susphy_quirk;
155164
snps,dis_u3_susphy_quirk;
165+
snps,dis-del-phy-power-chg-quirk;
166+
snps,dis-tx-ipgap-linecheck-quirk;
167+
snps,parkmode-disable-ss-quirk;
156168
};
157169
};
158170

arch/riscv/boot/dts/spacemit/k1.dtsi

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,55 @@
347347
dma-noncoherent;
348348
ranges;
349349

350+
/* DRAM mapping for USB/SDH/Ethernet: first 2GB only. */
351+
dram_range0: dram_range@0 {
352+
compatible = "spacemit-dram-bus";
353+
#address-cells = <2>;
354+
#size-cells = <2>;
355+
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;
356+
#interconnect-cells = <0>;
357+
status = "okay";
358+
};
359+
360+
/* DRAM mapping for VPU/GPU/DPU access. Used by the interconnect
361+
* framework so the DPU can access full DDR (>2GB).
362+
* Ported from vendor BSP linux-6.6 k1-x.dtsi.
363+
*/
364+
dram_range1: dram_range@1 {
365+
compatible = "spacemit-dram-bus";
366+
#address-cells = <2>;
367+
#size-cells = <2>;
368+
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
369+
<0x0 0x80000000 0x1 0x00000000 0x3 0x80000000>;
370+
#interconnect-cells = <0>;
371+
status = "okay";
372+
};
373+
374+
/* DDR AXI bandwidth monitor */
375+
ddraxi_mon: ddraxi_mon@c0058500 {
376+
compatible = "spacemit,ddraxi-mon";
377+
reg = <0x0 0xc0058500 0x0 0x80>;
378+
status = "okay";
379+
};
380+
381+
/* USB3 + PCIe combo PHY (required for xHCI USB 3.0 init).
382+
* The reset called RESET_COMBO_PHY upstream (id 76) maps to the
383+
* exact same APMU register bit as RESET_PCIE0_GLOBAL (id 26) in
384+
* the AOSP syscon-apmu reset table:
385+
* [RESET_PCIE0_GLOBAL] = APMU_PCIE_CLK_RES_CTRL_0, BIT(8), 0
386+
* The combphy is shared between USB3 and PCIe0, hence the same reset.
387+
*/
388+
combphy: phy@c0b10000 {
389+
compatible = "spacemit,k1x-combphy";
390+
reg = <0x0 0xc0b10000 0x0 0x800>,
391+
<0x0 0xd4282910 0x0 0x400>;
392+
reg-names = "puphy", "phy_sel";
393+
resets = <&syscon_apmu RESET_PCIE0_GLOBAL>;
394+
reset-names = "phy_rst";
395+
#phy-cells = <1>;
396+
status = "okay";
397+
};
398+
350399
syscon_rcpu: system-controller@c0880000 {
351400
compatible = "spacemit,k1-syscon-rcpu";
352401
reg = <0x0 0xc0880000 0x0 0x2048>;
@@ -1113,6 +1162,66 @@
11131162

11141163
thermal_zones: thermal-zones {
11151164
};
1165+
1166+
reboot_handler: handler@d4282f90 {
1167+
compatible = "spacemit,k1x-reboot";
1168+
reg = <0x0 0xd4282f90 0x0 0x4>;
1169+
status = "disabled";
1170+
};
1171+
1172+
efuse: fuse@f0702800 {
1173+
compatible = "simple-mfd";
1174+
#address-cells = <1>;
1175+
#size-cells = <1>;
1176+
ranges = <0 0x0 0xf0702800 0x400>;
1177+
status = "disabled";
1178+
1179+
efuse_bank7: efuse_bank@7 {
1180+
compatible = "spacemit,k1-efuse";
1181+
#address-cells = <1>;
1182+
#size-cells = <1>;
1183+
reg = <0x190 0x20>;
1184+
resets = <&syscon_apmu RESET_AES>;
1185+
reset-names = "aes_reset";
1186+
clocks = <&syscon_apmu CLK_AES>;
1187+
clock-names = "aes_core";
1188+
status = "disabled";
1189+
1190+
soc_die_id: bank7_die_id@11 {
1191+
reg = <0x11 3>;
1192+
bits = <3 16>;
1193+
};
1194+
1195+
soc_ver_id: bank7_ver_id@1f {
1196+
reg = <0x1F 1>;
1197+
bits = <6 2>;
1198+
};
1199+
1200+
soc_pack_id: bank7_pack_id@16 {
1201+
reg = <0x16 2>;
1202+
bits = <6 9>;
1203+
};
1204+
1205+
soc_svt_dro: bank7_svt_dro@15 {
1206+
reg = <0x15 2>;
1207+
bits = <5 9>;
1208+
};
1209+
1210+
soc_chip_id: bank7_chip_id@17 {
1211+
reg = <0x17 8>;
1212+
bits = <7 55>;
1213+
};
1214+
};
1215+
};
1216+
1217+
socinfo: socinfo {
1218+
compatible = "spacemit,socinfo-k1x";
1219+
nvmem-cells = <&soc_die_id>, <&soc_ver_id>, <&soc_pack_id>,
1220+
<&soc_svt_dro>, <&soc_chip_id>;
1221+
nvmem-cell-names = "soc_die_id", "soc_ver_id", "soc_pack_id",
1222+
"soc_svt_dro", "soc_chip_id";
1223+
status = "disabled";
1224+
};
11161225
};
11171226

11181227
/* Include additional peripherals (USB, Camera) for K1-X SoC */

0 commit comments

Comments
 (0)