dts: ti: Add support for AM623-M3

Message ID 20240510081038.26101-1-patrick.barsanti@amarulasolutions.com
State New
Headers show
Series
  • dts: ti: Add support for AM623-M3
Related show

Commit Message

Patrick Barsanti May 10, 2024, 8:10 a.m. UTC
AM623-M3 is a low-cost board based on K3 AM623 SoC.
It supports the following interfaces:
* 256 MB LPDDR3 RAM
* x1 USB OTG Connector
* CC330x SimpleLink™ Wi-Fi 6 and Bluetooth® Low Energy companion IC
* 512 Mbit OSPI flash
* x1 UART through UART-USB bridge
* x1 eMMC 4GB

Add basic support for AM623-M3.

Signed-off-by: Patrick Barsanti <patrick.barsanti@amarulasolutions.com>
---
 arch/arm64/boot/dts/ti/Makefile               |   1 +
 arch/arm64/boot/dts/ti/k3-am62-ccm-m3.dts     |  98 ++++++
 .../boot/dts/ti/k3-am62x-ccm-m3-common.dtsi   | 300 ++++++++++++++++++
 3 files changed, 399 insertions(+)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-ccm-m3.dts
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62x-ccm-m3-common.dtsi

Patch

diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile
index 9a722c2473fb..630d0c7da9ae 100644
--- a/arch/arm64/boot/dts/ti/Makefile
+++ b/arch/arm64/boot/dts/ti/Makefile
@@ -23,6 +23,7 @@  dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-dev.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-mallow.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-yavia.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am62x-phyboard-lyra-gpio-fan.dtbo
+dtb-$(CONFIG_ARCH_K3) += k3-am62-ccm-m3.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am62-lp-sk.dtb
 
 # Boards with AM62Ax SoC
diff --git a/arch/arm64/boot/dts/ti/k3-am62-ccm-m3.dts b/arch/arm64/boot/dts/ti/k3-am62-ccm-m3.dts
new file mode 100644
index 000000000000..29f447c0ab2a
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am62-ccm-m3.dts
@@ -0,0 +1,98 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * AM623 M3
+ *
+ * Copyright (C) 2024 Amarula Solutions BV
+ */
+
+/dts-v1/;
+
+#include "k3-am62x-ccm-m3-common.dtsi"
+
+/ {
+	compatible =  "ti,am625-ccm-m3", "ti,am625";
+	model = "BSH - CCM-M3";
+
+	opp-table {
+		/* Add 1.4GHz OPP for am625-sk board. Requires VDD_CORE to be at 0.85V */
+		opp-1400000000 {
+			opp-hz = /bits/ 64 <1400000000>;
+			opp-supported-hw = <0x01 0x0004>;
+			clock-latency-ns = <6000000>;
+		};
+	};
+};
+
+&main0_crit {
+	temperature = <115000>; /* milliCelsius original value: 105000 */
+	hysteresis = <2000>; /* milliCelsius */
+	type = "critical";
+};
+
+&main1_crit {
+	temperature = <115000>; /* milliCelsius original value: 105000 */
+	hysteresis = <2000>; /* milliCelsius */
+	type = "critical";
+};
+
+&ospi0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&ospi0_pins_default>;
+
+	flash@0 {
+		compatible = "spi-nand";
+		reg = <0x0>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+		spi-max-frequency = <50000000>;
+		cdns,tshsl-ns = <60>;
+		cdns,tsd2d-ns = <60>;
+		cdns,tchsh-ns = <60>;
+		cdns,tslch-ns = <60>;
+		cdns,read-delay = <2>;
+		cdns,phy-mode;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "ospi_nand.tiboot3";
+				reg = <0x0 0x80000>;
+			};
+
+			partition@80000 {
+				label = "ospi_nand.tispl";
+				reg = <0x80000 0x200000>;
+			};
+
+			partition@280000 {
+				label = "ospi_nand.u-boot";
+				reg = <0x280000 0x400000>;
+			};
+
+			partition@600000 {
+				label = "ospi_nand.env";
+				reg = <0x600000 0x40000>;
+			};
+
+			partition@640000 {
+				label = "ospi_nand.env.backup";
+				reg = <0x640000 0x40000>;
+			};
+
+			partition@2000000 {
+				label = "ospi_nand.rootfs";
+				reg = <0x2000000 0xd9c0000>;
+			};
+
+			partition@f9c0000 {
+				label = "ospi_nand.phypattern";
+				reg = <0xf9c0000 0x40000>;
+			};
+			/* End of 256MB */
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62x-ccm-m3-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-ccm-m3-common.dtsi
new file mode 100644
index 000000000000..9f6ef1b326e8
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am62x-ccm-m3-common.dtsi
@@ -0,0 +1,300 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Common dtsi for AM623 BSH M3 and derivatives
+ *
+ * Copyright (C) 2024 Amarula Solutions BV
+ */
+
+#include "k3-am625.dtsi"
+
+/ {
+	aliases {
+		i2c0 = &main_i2c0;
+		mmc0 = &sdhci0;
+		rtc0 = &wkup_rtc0;
+		serial2 = &main_uart0;
+		spi0 = &ospi0;
+		usb0 = &usb0;
+	};
+
+	chosen {
+		stdout-path = "serial2:115200n8";
+	};
+
+	cpus {
+		/delete-node/ cpu@2;
+		/delete-node/ cpu@3;
+	};
+
+	memory@80000000 {
+		bootph-pre-ram;
+		device_type = "memory";
+		/* 256M RAM */
+		reg = <0x00000000 0x80000000 0x00000000 0x10000000>;
+	};
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		rtos_ipc_memory_region: ipc-memories@88800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x88800000 0x00 0x00300000>;
+			no-map;
+		};
+
+		secure_tfa_ddr: tfa@8a500000 {
+			reg = <0x00 0x8a500000 0x00 0x80000>;
+			alignment = <0x1000>;
+			no-map;
+		};
+
+		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@87600000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x87600000 0x00 0x00100000>;
+			no-map;
+		};
+
+		wkup_r5fss0_core0_memory_region: r5f-memory@87700000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x87700000 0x00 0x00c00000>;
+			no-map;
+		};
+	};
+
+	vcc_5v: regulator-0 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_5v";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	vdd_3v3: regulator-1 {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd_3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		/* This get supplied by pmic that is powered by the 5v */
+		vin-supply = <&vcc_5v>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+};
+
+&cluster0 {
+	/delete-node/ core2;
+	/delete-node/ core3;
+};
+
+&cpsw3g {
+	status = "disabled";
+};
+
+&gpu {
+	status = "disabled";
+};
+
+&mailbox0_cluster0 {
+	mbox_r5_0: mbox-r5-0 {
+		ti,mbox-rx = <2 0 0>;
+		ti,mbox-tx = <3 0 0>;
+	};
+};
+
+&main_gpio0 {
+	status = "okay";
+};
+
+&main_gpio1 {
+	status = "okay";
+};
+
+&main_gpio_intr {
+	status = "okay";
+};
+
+&main_i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_i2c0_pins_default>;
+	clock-frequency = <400000>;
+	status = "okay";
+
+	tps65219: pmic@30 {
+		compatible = "ti,tps65219";
+		reg = <0x30>;
+		buck1-supply = <&vcc_5v>;
+		buck2-supply = <&vcc_5v>;
+		buck3-supply = <&vcc_5v>;
+		ldo1-supply = <&vcc_5v>;
+		ldo2-supply = <&vcc_5v>;
+		ldo3-supply = <&vcc_5v>;
+		ldo4-supply = <&vcc_5v>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&pmic_irq_pins_default>;
+		interrupt-parent = <&gic500>;
+		interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		/* ti,power-button; */
+
+		regulators {
+			buck1_reg: buck1 {
+				regulator-name = "VDD_CORE";            /* VDDSOC */
+				regulator-min-microvolt = <850000>;
+				regulator-max-microvolt = <850000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			buck2_reg: buck2 {
+				regulator-name = "VCC1V8_SYS";          /* VDD_1V8 */
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			buck3_reg: buck3 {
+				regulator-name = "VDD_LPDDR4";          /* VDD_DRAM */
+				regulator-min-microvolt = <1100000>;
+				regulator-max-microvolt = <1100000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo2_reg: ldo2 {
+				regulator-name = "VDDAR_CORE";        /* VPP_1V8 */
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo3_reg: ldo3 {
+				regulator-name = "VDDA_1V8";          /* VDDA_1V8 */
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
+};
+
+&main_pmx0 {
+
+	main_i2c0_pins_default: main-i2c0-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x1e0, PIN_INPUT_PULLUP, 0) /* (B16) I2C0_SCL */
+			AM62X_IOPAD(0x1e4, PIN_INPUT_PULLUP, 0) /* (A16) I2C0_SDA */
+		>;
+	};
+
+	main_mmc0_pins_default: main-mmc0-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x220, PIN_INPUT, 0) /* (Y3) MMC0_CMD */
+			AM62X_IOPAD(0x218, PIN_INPUT, 0) /* (AB1) MMC0_CLK */
+			AM62X_IOPAD(0x214, PIN_INPUT, 0) /* (AA2) MMC0_DAT0 */
+			AM62X_IOPAD(0x210, PIN_INPUT, 0) /* (AA1) MMC0_DAT1 */
+			AM62X_IOPAD(0x20c, PIN_INPUT, 0) /* (AA3) MMC0_DAT2 */
+			AM62X_IOPAD(0x208, PIN_INPUT, 0) /* (Y4) MMC0_DAT3 */
+			AM62X_IOPAD(0x204, PIN_INPUT, 0) /* (AB2) MMC0_DAT4 */
+			AM62X_IOPAD(0x200, PIN_INPUT, 0) /* (AC1) MMC0_DAT5 */
+			AM62X_IOPAD(0x1fc, PIN_INPUT, 0) /* (AD2) MMC0_DAT6 */
+			AM62X_IOPAD(0x1f8, PIN_INPUT, 0) /* (AC2) MMC0_DAT7 */
+		>;
+	};
+
+	/* Debug console */
+	main_uart0_pins_default: main-uart0-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */
+			AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */
+		>;
+	};
+
+	main_usb0_pins_default: main-usb0-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x0254, PIN_INPUT, 0) /* (C20) USB0_DRVVBUS */
+		>;
+	};
+
+	ospi0_pins_default: qspi-nand-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x0000, PIN_OUTPUT, 0) /* (H24) OSPI0_CLK */
+			AM62X_IOPAD(0x002c, PIN_OUTPUT, 0) /* (F23) OSPI0_CSn0 */
+			AM62X_IOPAD(0x000c, PIN_INPUT, 0) /* (E25) OSPI0_D0 */
+			AM62X_IOPAD(0x0010, PIN_INPUT, 0) /* (G24) OSPI0_D1 */
+			AM62X_IOPAD(0x0014, PIN_INPUT, 0) /* (F25) OSPI0_D2 */
+			AM62X_IOPAD(0x0018, PIN_INPUT, 0) /* (F24) OSPI0_D3 */
+		>;
+	};
+
+	pmic_irq_pins_default: pmic-irq-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x01f4, PIN_INPUT, 0) /* (D16) EXTINTn */
+		>;
+	};
+};
+
+&main_rti2 {
+	status = "disabled";
+};
+
+&main_rti3 {
+	status = "disabled";
+};
+
+&main_rti15 {
+	status = "disabled";
+};
+
+&main_uart0 {
+	bootph-all;
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_uart0_pins_default>;
+	interrupts-extended = <&gic500 GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>,
+			       <&main_pmx0 0x1c8>; /* (D14) UART0_RXD PADCONFIG114 */
+	interrupt-names = "irq", "wakeup";
+};
+
+&main_uart1 {
+	/* Main UART1 is used by TIFS firmware */
+	bootph-pre-ram;
+	status = "reserved";
+};
+
+&mcu_uart0 {
+	status = "disabled";
+};
+
+&sdhci0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mmc0_pins_default>;
+	ti,driver-strength-ohm = <50>;
+	disable-wp;
+};
+
+&usb0 {
+	dr_mode = "otg";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_usb0_pins_default>;
+	usb-role-switch;
+};
+
+&usbss0 {
+	status = "okay";
+	ti,vbus-divider;
+};
+
+&wkup_uart0 {
+	/* WKUP UART0 is used by DM firmware */
+	bootph-pre-ram;
+	status = "reserved";
+};