[PATCH 00/23] arm: dts: k3-am64: Sync with kernel.org and

Hi,
This is a bit painful series, so apologies in advance for the patchbomb. I did'nt see any clean way to do this, so here goes.
First: there are dts mismatches and overrides being done in u-boot in varied manner that should have been submitted to kernel.org in the first place, so, https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
This series picks some of those nodes up and marks them so that merge is a lot more logical. There are still stuff like esm and cpsw that will need a little more work.
This series cleans up the dt, switches to .env mode and finally defaults to distroboot with none of the fancy stuff.
I have tried to maintain bisectability, but the r5-sk stuff is a bit too broken for me to succeed cleanly.. but it did'nt make sense to confuse review by squashing everything up. Let me know if there is a better bisect option, and I can try.
Logs are available: (including a log with the last two patches applied for distoboot default) https://gist.github.com/nmenon/6b09f55251225d3f3cce076c32a33bba Tested along with the ethernet fixup I had sent earlier: https://lore.kernel.org/u-boot/20230414042433.3436425-1-nm@ti.com/
Baseline for these patches: 9e804638bfe2 Merge tag 'for-v2023-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-i2c
Nishanth Menon (23): Revert "ARM: dts: k3-am642-sk-u-boot: add PMIC node" arm: dts: k3-am64: Update devicetree to sync with v6.3-rc6 arm: dts: k3-am642-sk: Add a note to handle pinmux till MDIO DM conversion is done arm: dts: k3-am642-sk: Fix mmc1 pinmux pull polarity arm: dts: k3-am642-sk: Add main_uart1 description arm: dts: k3-am642-sk: Add main_i2c0 and eeprom arm: dts: k3-am642-sk-u-boot: Drop the i2c node arm: dts: k3-am642-sk-u-boot: Drop redundant usb dr_mode property arm: dts: k3-am642-sk-u-boot: Mark main_uart0 to be used for spl arm: dts: k3-am642-sk-u-boot: Document timer as missing upstream arm: dts: k3-am642-sk-u-boot: Drop aliases and stdout arm: dts: k3-am642-r5-sk: Use am642-sk.dts and k3-am642-sk-u-boot.dtsi arm: dts: k3-am642-evm: Move the mdio pinmux down to evm.dts arm: dts: k3-am642-evm: Add DDR vtt regulator arm: dts: k3-am642-evm: Add main_uart1 description arm: dts: k3-am642-evm: Add main_i2c0 and eeprom arm: dts: k3-am642-evm-u-boot: Drop the i2c node arm: dts: k3-am642-evm-u-boot: Drop stdout and cosmetic fixups arm: dts: k3-am642-evm-u-boot: Re-organize the pinmux arm: dts: k3-am642-evm-u-boot: Add missing pinmux notations arm: dts: k3-am642-r5-evm: Use am642-evm.dts and k3-am642-evm-u-boot.dtsi include: configs: am64x_evm: Change to using .env configs: am64x_evm_a53_defconfig: Just use distroboot
arch/arm/dts/k3-am642-evm-u-boot.dtsi | 52 ++++--- arch/arm/dts/k3-am642-evm.dts | 60 +++++++- arch/arm/dts/k3-am642-r5-evm.dts | 203 ++++---------------------- arch/arm/dts/k3-am642-r5-sk.dts | 194 +++--------------------- arch/arm/dts/k3-am642-sk-u-boot.dtsi | 89 ++--------- arch/arm/dts/k3-am642-sk.dts | 54 ++++++- arch/arm/dts/k3-am642.dtsi | 1 + board/ti/am64x/Kconfig | 3 + board/ti/am64x/am64x.env | 37 +++++ configs/am64x_evm_a53_defconfig | 2 +- include/configs/am64x_evm.h | 117 ++++----------- 11 files changed, 266 insertions(+), 546 deletions(-) create mode 100644 board/ti/am64x/am64x.env

The original patch is completely wrong. a) https://www.ti.com/tool/SK-AM64#design-files shows no such PMIC driving the supplies. b) This should have gone upstream to am64-sk.dts and NOT hacked into u-boot.dtsi.
This reverts commit 28a4c3113445d4400639f357fae0def007a41093.
Cc: Neil Armstrong narmstrong@baylibre.com Cc: Kevin Hilman khilman@baylibre.com Signed-off-by: Nishanth Menon nm@ti.com ---
https://www.ti.com/tool/SK-AM64B seems to be TPS6522053RHBR, but anyways, it is not this dts - revert, and when the board dts is added to kernel.org, we can see how to backport it - this just adds to all kind of confusion when syncing with kernel.org
arch/arm/dts/k3-am642-sk-u-boot.dtsi | 61 ---------------------------- 1 file changed, 61 deletions(-)
diff --git a/arch/arm/dts/k3-am642-sk-u-boot.dtsi b/arch/arm/dts/k3-am642-sk-u-boot.dtsi index 69dbe943bdf3..f6b8b887e4c1 100644 --- a/arch/arm/dts/k3-am642-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-sk-u-boot.dtsi @@ -52,67 +52,6 @@ pinctrl-names = "default"; pinctrl-0 = <&main_i2c0_pins_default>; clock-frequency = <400000>; - - tps65219: pmic@30 { - compatible = "ti,tps65219"; - reg = <0x30>; - - regulators { - buck1_reg: buck1 { - regulator-name = "VDD_CORE"; - regulator-min-microvolt = <750000>; - regulator-max-microvolt = <750000>; - regulator-boot-on; - regulator-always-on; - }; - - buck2_reg: buck2 { - regulator-name = "VCC1V8"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-boot-on; - regulator-always-on; - }; - - buck3_reg: buck3 { - regulator-name = "VDD_LPDDR4"; - regulator-min-microvolt = <1100000>; - regulator-max-microvolt = <1100000>; - regulator-boot-on; - regulator-always-on; - }; - - ldo1_reg: ldo1 { - regulator-name = "VDDSHV_SD_IO_PMIC"; - regulator-min-microvolt = <33000000>; - regulator-max-microvolt = <33000000>; - }; - - ldo2_reg: ldo2 { - regulator-name = "VDDAR_CORE"; - regulator-min-microvolt = <850000>; - regulator-max-microvolt = <850000>; - regulator-boot-on; - regulator-always-on; - }; - - ldo3_reg: ldo3 { - regulator-name = "VDDA_1V8"; - regulator-min-microvolt = <18000000>; - regulator-max-microvolt = <18000000>; - regulator-boot-on; - regulator-always-on; - }; - - ldo4_reg: ldo4 { - regulator-name = "VDD_PHY_2V5"; - regulator-min-microvolt = <25000000>; - regulator-max-microvolt = <25000000>; - regulator-boot-on; - regulator-always-on; - }; - }; - }; };
&main_uart0 {

Sync with Kernel.org v6.3-rc6 tag.
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642.dtsi | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/dts/k3-am642.dtsi b/arch/arm/dts/k3-am642.dtsi index 8a76f4821b11..7a6eedea3aae 100644 --- a/arch/arm/dts/k3-am642.dtsi +++ b/arch/arm/dts/k3-am642.dtsi @@ -58,6 +58,7 @@ L2_0: l2-cache0 { compatible = "cache"; cache-level = <2>; + cache-unified; cache-size = <0x40000>; cache-line-size = <64>; cache-sets = <256>;

Until MDIO is converted to DM model, it won't be possible to probe for pinmux from the MDIO node. To work around this, lets hack the board dts to set the default mux option to include MDIO. This hack is a limitation for now till we get u-boot MDIO driver into DM model.
Signed-off-by: Nishanth Menon nm@ti.com ---
Cant send this upstream.
arch/arm/dts/k3-am642-sk.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-am642-sk.dts b/arch/arm/dts/k3-am642-sk.dts index 2e2d40da360a..4fb279489cfc 100644 --- a/arch/arm/dts/k3-am642-sk.dts +++ b/arch/arm/dts/k3-am642-sk.dts @@ -439,7 +439,9 @@
&cpsw3g { pinctrl-names = "default"; - pinctrl-0 = <&rgmii1_pins_default + /* XXX: U-boot HACK: mdio pinmux till MDIO DM conversion is done */ + pinctrl-0 = <&mdio1_pins_default + &rgmii1_pins_default &rgmii2_pins_default>; };

Fix the pinmux pull polarity.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com --- Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
arch/arm/dts/k3-am642-sk.dts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/arm/dts/k3-am642-sk.dts b/arch/arm/dts/k3-am642-sk.dts index 4fb279489cfc..cc2027417e86 100644 --- a/arch/arm/dts/k3-am642-sk.dts +++ b/arch/arm/dts/k3-am642-sk.dts @@ -223,15 +223,17 @@
&main_pmx0 { main_mmc1_pins_default: main-mmc1-pins-default { + /* XXX: Kernel-Upstream: TODO: Upstream (pull changes) */ pinctrl-single,pins = < - AM64X_IOPAD(0x0294, PIN_INPUT, 0) /* (J19) MMC1_CMD */ + AM64X_IOPAD(0x029c, PIN_INPUT_PULLUP, 0) /* (C20) MMC1_SDWP */ + AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */ + AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */ AM64X_IOPAD(0x0290, PIN_INPUT, 0) /* (#N/A) MMC1_CLKLB */ - AM64X_IOPAD(0x028c, PIN_INPUT, 0) /* (L20) MMC1_CLK */ - AM64X_IOPAD(0x0288, PIN_INPUT, 0) /* (K21) MMC1_DAT0 */ - AM64X_IOPAD(0x0284, PIN_INPUT, 0) /* (L21) MMC1_DAT1 */ - AM64X_IOPAD(0x0280, PIN_INPUT, 0) /* (K19) MMC1_DAT2 */ - AM64X_IOPAD(0x027c, PIN_INPUT, 0) /* (K18) MMC1_DAT3 */ - AM64X_IOPAD(0x0298, PIN_INPUT, 0) /* (D19) MMC1_SDCD */ + AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */ + AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */ + AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */ + AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */ + AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */ >; };

On 14/04/2023 10:57, Nishanth Menon wrote:
Fix the pinmux pull polarity.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com
Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
Link to actual patch is https://lore.kernel.org/linux-devicetree/20230414073328.381336-3-nm@ti.com/
arch/arm/dts/k3-am642-sk.dts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/arm/dts/k3-am642-sk.dts b/arch/arm/dts/k3-am642-sk.dts index 4fb279489cfc..cc2027417e86 100644 --- a/arch/arm/dts/k3-am642-sk.dts +++ b/arch/arm/dts/k3-am642-sk.dts @@ -223,15 +223,17 @@
&main_pmx0 { main_mmc1_pins_default: main-mmc1-pins-default {
/* XXX: Kernel-Upstream: TODO: Upstream (pull changes) */
Do we really want to sprinkle these comments in u-boot upstream? If we are quite sure this makes to upstream kernel we might as well pull them into u-boot as is.
pinctrl-single,pins = <
AM64X_IOPAD(0x0294, PIN_INPUT, 0) /* (J19) MMC1_CMD */
AM64X_IOPAD(0x029c, PIN_INPUT_PULLUP, 0) /* (C20) MMC1_SDWP */
AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */
AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */ AM64X_IOPAD(0x0290, PIN_INPUT, 0) /* (#N/A) MMC1_CLKLB */
AM64X_IOPAD(0x028c, PIN_INPUT, 0) /* (L20) MMC1_CLK */
AM64X_IOPAD(0x0288, PIN_INPUT, 0) /* (K21) MMC1_DAT0 */
AM64X_IOPAD(0x0284, PIN_INPUT, 0) /* (L21) MMC1_DAT1 */
AM64X_IOPAD(0x0280, PIN_INPUT, 0) /* (K19) MMC1_DAT2 */
AM64X_IOPAD(0x027c, PIN_INPUT, 0) /* (K18) MMC1_DAT3 */
AM64X_IOPAD(0x0298, PIN_INPUT, 0) /* (D19) MMC1_SDCD */
AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */
AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */
AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */
AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */
AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */
;};
cheers, -roger

On 13:42-20230417, Roger Quadros wrote:
On 14/04/2023 10:57, Nishanth Menon wrote:
Fix the pinmux pull polarity.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com
Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
Link to actual patch is https://lore.kernel.org/linux-devicetree/20230414073328.381336-3-nm@ti.com/
arch/arm/dts/k3-am642-sk.dts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/arm/dts/k3-am642-sk.dts b/arch/arm/dts/k3-am642-sk.dts index 4fb279489cfc..cc2027417e86 100644 --- a/arch/arm/dts/k3-am642-sk.dts +++ b/arch/arm/dts/k3-am642-sk.dts @@ -223,15 +223,17 @@
&main_pmx0 { main_mmc1_pins_default: main-mmc1-pins-default {
/* XXX: Kernel-Upstream: TODO: Upstream (pull changes) */
Do we really want to sprinkle these comments in u-boot upstream?
I have no other means to indicate that these nodes need to get to upstream kernel and when they do get into upstream kernel, what needs to be dropped from u-boot.
I am open to suggestions here.
If we are quite sure this makes to upstream kernel we might as well pull them into u-boot as is.
No, that has been the reason why the entire dt mismatch occurred in the first place. the subjective evaluation from various devs have been way off. if it makes it to kernel.org master, only then can we claim that the changes are in upstream.
pinctrl-single,pins = <
AM64X_IOPAD(0x0294, PIN_INPUT, 0) /* (J19) MMC1_CMD */
AM64X_IOPAD(0x029c, PIN_INPUT_PULLUP, 0) /* (C20) MMC1_SDWP */
AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */
AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */ AM64X_IOPAD(0x0290, PIN_INPUT, 0) /* (#N/A) MMC1_CLKLB */
AM64X_IOPAD(0x028c, PIN_INPUT, 0) /* (L20) MMC1_CLK */
AM64X_IOPAD(0x0288, PIN_INPUT, 0) /* (K21) MMC1_DAT0 */
AM64X_IOPAD(0x0284, PIN_INPUT, 0) /* (L21) MMC1_DAT1 */
AM64X_IOPAD(0x0280, PIN_INPUT, 0) /* (K19) MMC1_DAT2 */
AM64X_IOPAD(0x027c, PIN_INPUT, 0) /* (K18) MMC1_DAT3 */
AM64X_IOPAD(0x0298, PIN_INPUT, 0) /* (D19) MMC1_SDCD */
AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */
AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */
AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */
AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */
AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */
;};cheers, -roger

On 17/04/2023 14:12, Nishanth Menon wrote:
On 13:42-20230417, Roger Quadros wrote:
On 14/04/2023 10:57, Nishanth Menon wrote:
Fix the pinmux pull polarity.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com
Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
Link to actual patch is https://lore.kernel.org/linux-devicetree/20230414073328.381336-3-nm@ti.com/
arch/arm/dts/k3-am642-sk.dts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/arch/arm/dts/k3-am642-sk.dts b/arch/arm/dts/k3-am642-sk.dts index 4fb279489cfc..cc2027417e86 100644 --- a/arch/arm/dts/k3-am642-sk.dts +++ b/arch/arm/dts/k3-am642-sk.dts @@ -223,15 +223,17 @@
&main_pmx0 { main_mmc1_pins_default: main-mmc1-pins-default {
/* XXX: Kernel-Upstream: TODO: Upstream (pull changes) */
Do we really want to sprinkle these comments in u-boot upstream?
I have no other means to indicate that these nodes need to get to upstream kernel and when they do get into upstream kernel, what needs to be dropped from u-boot.
I am open to suggestions here.
If we are quite sure this makes to upstream kernel we might as well pull them into u-boot as is.
No, that has been the reason why the entire dt mismatch occurred in the first place. the subjective evaluation from various devs have been way off. if it makes it to kernel.org master, only then can we claim that the changes are in upstream.
In that case we do not accept any DT patches in u-boot till at least Acked by kernel maintainer?

On 14:45-20230417, Roger Quadros wrote: [...]
&main_pmx0 { main_mmc1_pins_default: main-mmc1-pins-default {
/* XXX: Kernel-Upstream: TODO: Upstream (pull changes) */
Do we really want to sprinkle these comments in u-boot upstream?
I have no other means to indicate that these nodes need to get to upstream kernel and when they do get into upstream kernel, what needs to be dropped from u-boot.
I am open to suggestions here.
If we are quite sure this makes to upstream kernel we might as well pull them into u-boot as is.
No, that has been the reason why the entire dt mismatch occurred in the first place. the subjective evaluation from various devs have been way off. if it makes it to kernel.org master, only then can we claim that the changes are in upstream.
In that case we do not accept any DT patches in u-boot till at least Acked by kernel maintainer?
My 2 cents: Given that: a) until the maintainer sends a tag to upstream merge, things are'nt really final and patches still have been dropped and/or modified (not typically, but have happened) b) the delay between a tag and final merge is just a few weeks
We should hold the master tag as baseline at least till things settle down, prior to relaxing rules to what is reasonable.

Add main_uart1 description in sk devicetree.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com --- Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
arch/arm/dts/k3-am642-sk.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm/dts/k3-am642-sk.dts b/arch/arm/dts/k3-am642-sk.dts index cc2027417e86..a0431ad374a5 100644 --- a/arch/arm/dts/k3-am642-sk.dts +++ b/arch/arm/dts/k3-am642-sk.dts @@ -246,6 +246,16 @@ >; };
+ /* XXX: Kernel-Upstream: TODO: Upstream */ + main_uart1_pins_default: main-uart1-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0248, PIN_INPUT, 0) /* (D16) UART1_CTSn */ + AM64X_IOPAD(0x024c, PIN_OUTPUT, 0) /* (E16) UART1_RTSn */ + AM64X_IOPAD(0x0240, PIN_INPUT, 0) /* (E15) UART1_RXD */ + AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */ + >; + }; + main_usb0_pins_default: main-usb0-pins-default { pinctrl-single,pins = < AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ @@ -349,6 +359,9 @@ &main_uart1 { /* main_uart1 is reserved for firmware usage */ status = "reserved"; + /* XXX: Kernel-Upstream: TODO: Upstream pinmux */ + pinctrl-names = "default"; + pinctrl-0 = <&main_uart1_pins_default>; };
&main_i2c1 {

Add missing main_i2c0 node and eeprom property.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com --- Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
arch/arm/dts/k3-am642-sk.dts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/arch/arm/dts/k3-am642-sk.dts b/arch/arm/dts/k3-am642-sk.dts index a0431ad374a5..5d16aa0d7596 100644 --- a/arch/arm/dts/k3-am642-sk.dts +++ b/arch/arm/dts/k3-am642-sk.dts @@ -262,6 +262,14 @@ >; };
+ /* XXX: Kernel-Upstream: TODO: Upstream */ + main_i2c0_pins_default: main-i2c0-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ + AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ + >; + }; + main_i2c1_pins_default: main-i2c1-pins-default { pinctrl-single,pins = < AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */ @@ -364,6 +372,19 @@ pinctrl-0 = <&main_uart1_pins_default>; };
+/* XXX: Kernel-Upstream: TODO: Upstream */ +&main_i2c0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&main_i2c0_pins_default>; + clock-frequency = <400000>; + + eeprom@51 { + compatible = "atmel,24c512"; + reg = <0x51>; + }; +}; + &main_i2c1 { status = "okay"; pinctrl-names = "default";

Drop the i2c and mux description, since we have it on main board dts.
Signed-off-by: Nishanth Menon nm@ti.com ---
This causes a bisect break with some weird dependency on r5-sk.dts on u-boot.dtsi
arch/arm/dts/k3-am642-sk-u-boot.dtsi | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/arch/arm/dts/k3-am642-sk-u-boot.dtsi b/arch/arm/dts/k3-am642-sk-u-boot.dtsi index f6b8b887e4c1..aa3551c2bb4a 100644 --- a/arch/arm/dts/k3-am642-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-sk-u-boot.dtsi @@ -38,20 +38,14 @@
&main_pmx0 { bootph-pre-ram; - main_i2c0_pins_default: main-i2c0-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ - AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ - >; - }; +}; + +&main_i2c0_pins_default { + bootph-pre-ram; };
&main_i2c0 { bootph-pre-ram; - pinctrl-names = "default"; - pinctrl-0 = <&main_i2c0_pins_default>; - clock-frequency = <400000>; };
&main_uart0 {

We do not need that property to be defined as it is already defined in am642-sk.dts
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-sk-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/k3-am642-sk-u-boot.dtsi b/arch/arm/dts/k3-am642-sk-u-boot.dtsi index aa3551c2bb4a..57797a59e05d 100644 --- a/arch/arm/dts/k3-am642-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-sk-u-boot.dtsi @@ -152,7 +152,6 @@ };
&usb0 { - dr_mode = "host"; bootph-pre-ram; };

we need to configure the pinmux for main_uart0 to get console
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-sk-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/dts/k3-am642-sk-u-boot.dtsi b/arch/arm/dts/k3-am642-sk-u-boot.dtsi index 57797a59e05d..122a304d4501 100644 --- a/arch/arm/dts/k3-am642-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-sk-u-boot.dtsi @@ -48,6 +48,10 @@ bootph-pre-ram; };
+&main_uart0_pins_default { + bootph-pre-ram; +}; + &main_uart0 { bootph-pre-ram; };

Mark the timer as missing in upstream kernel.
Signed-off-by: Nishanth Menon nm@ti.com --- Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/ once the patches are merged, we can consider integrating the same in the appropriate sync, I have tried to stay off main SoC dtsi file mods in this series.
arch/arm/dts/k3-am642-sk-u-boot.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/k3-am642-sk-u-boot.dtsi b/arch/arm/dts/k3-am642-sk-u-boot.dtsi index 122a304d4501..4a5ab6a7c4be 100644 --- a/arch/arm/dts/k3-am642-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-sk-u-boot.dtsi @@ -20,6 +20,8 @@
&cbass_main{ bootph-pre-ram; + + /* XXX: Upstream kernel TODO: send upstream */ timer1: timer@2400000 { compatible = "ti,omap5430-timer"; reg = <0x0 0x2400000 0x0 0x80>;

These are inherited from am642-sk.dts itself.
While at this, fix up a minor formatting error with main_cbass.
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-sk-u-boot.dtsi | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/dts/k3-am642-sk-u-boot.dtsi b/arch/arm/dts/k3-am642-sk-u-boot.dtsi index 4a5ab6a7c4be..25a32206a244 100644 --- a/arch/arm/dts/k3-am642-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-sk-u-boot.dtsi @@ -5,20 +5,15 @@
/ { chosen { - stdout-path = "serial2:115200n8"; tick-timer = &timer1; };
- aliases { - mmc1 = &sdhci1; - }; - memory@80000000 { bootph-pre-ram; }; };
-&cbass_main{ +&cbass_main { bootph-pre-ram;
/* XXX: Upstream kernel TODO: send upstream */

Use am642-sk.dts to represent the Board and selectively enable/override the configurations necessary. And since am642-sk-u-boot.dtsi also needs to setup common properties, instead of re-inventing everything, just reuse the definitions.
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-r5-sk.dts | 194 +++----------------------------- 1 file changed, 18 insertions(+), 176 deletions(-)
diff --git a/arch/arm/dts/k3-am642-r5-sk.dts b/arch/arm/dts/k3-am642-r5-sk.dts index 9ff4dd3dd365..8ac6cc77256c 100644 --- a/arch/arm/dts/k3-am642-r5-sk.dts +++ b/arch/arm/dts/k3-am642-r5-sk.dts @@ -5,31 +5,18 @@
/dts-v1/;
-#include <dt-bindings/mux/ti-serdes.h> -#include <dt-bindings/phy/phy.h> -#include <dt-bindings/net/ti-dp83867.h> -#include "k3-am642.dtsi" +#include "k3-am642-sk.dts" #include "k3-am64-sk-lp4-1600MTs.dtsi" #include "k3-am64-ddr.dtsi"
-/ { - chosen { - stdout-path = "serial2:115200n8"; - tick-timer = &timer1; - }; +#include "k3-am642-sk-u-boot.dtsi"
+/ { aliases { remoteproc0 = &sysctrler; remoteproc1 = &a53_0; };
- memory@80000000 { - device_type = "memory"; - /* 2G RAM */ - reg = <0x00000000 0x80000000 0x00000000 0x80000000>; - bootph-pre-ram; - }; - a53_0: a53@0 { compatible = "ti,am654-rproc"; reg = <0x00 0x00a90000 0x00 0x10>; @@ -46,18 +33,6 @@ bootph-pre-ram; };
- reserved-memory { - #address-cells = <2>; - #size-cells = <2>; - ranges; - - secure_ddr: optee@9e800000 { - reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */ - alignment = <0x1000>; - no-map; - }; - }; - clk_200mhz: dummy-clock-200mhz { compatible = "fixed-clock"; #clock-cells = <0>; @@ -73,9 +48,8 @@ mbox-names = "tx", "rx"; bootph-pre-ram; }; -};
-&cbass_main { + /* XXX: Upstream kernel TODO: send upstream */ main_esm: esm@420000 { compatible = "ti,j721e-esm"; reg = <0x0 0x420000 0x0 0x1000>; @@ -86,6 +60,8 @@
&cbass_mcu { bootph-pre-ram; + + /* XXX: Upstream kernel TODO: send upstream */ mcu_esm: esm@4100000 { compatible = "ti,j721e-esm"; reg = <0x0 0x4100000 0x0 0x1000>; @@ -94,92 +70,8 @@ }; };
-&main_pmx0 { - bootph-pre-ram; - main_uart0_pins_default: main-uart0-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */ - AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */ - AM64X_IOPAD(0x0230, PIN_INPUT, 0) /* (D15) UART0_RXD */ - AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */ - >; - }; - - main_uart1_pins_default: main-uart1-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0248, PIN_INPUT, 0) /* (D16) UART1_CTSn */ - AM64X_IOPAD(0x024c, PIN_OUTPUT, 0) /* (E16) UART1_RTSn */ - AM64X_IOPAD(0x0240, PIN_INPUT, 0) /* (E15) UART1_RXD */ - AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */ - >; - }; - - main_mmc1_pins_default: main-mmc1-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */ - AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */ - AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */ - AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */ - AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */ - AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */ - AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */ - AM64X_IOPAD(0x029c, PIN_INPUT_PULLUP, 0) /* (C20) MMC1_SDWP */ - >; - }; - - main_usb0_pins_default: main-usb0-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ - >; - }; - - mdio1_pins_default: mdio1-pins-default { - pinctrl-single,pins = < - AM64X_IOPAD(0x01fc, PIN_OUTPUT, 4) /* (R2) PRG0_PRU1_GPO19.MDIO0_MDC */ - AM64X_IOPAD(0x01f8, PIN_INPUT, 4) /* (P5) PRG0_PRU1_GPO18.MDIO0_MDIO */ - >; - }; - - rgmii1_pins_default: rgmii1-pins-default { - pinctrl-single,pins = < - AM64X_IOPAD(0x011c, PIN_INPUT, 4) /* (AA13) PRG1_PRU1_GPO5.RGMII1_RD0 */ - AM64X_IOPAD(0x0128, PIN_INPUT, 4) /* (U12) PRG1_PRU1_GPO8.RGMII1_RD1 */ - AM64X_IOPAD(0x0150, PIN_INPUT, 4) /* (Y13) PRG1_PRU1_GPO18.RGMII1_RD2 */ - AM64X_IOPAD(0x0154, PIN_INPUT, 4) /* (V12) PRG1_PRU1_GPO19.RGMII1_RD3 */ - AM64X_IOPAD(0x00d8, PIN_INPUT, 4) /* (W13) PRG1_PRU0_GPO8.RGMII1_RXC */ - AM64X_IOPAD(0x00cc, PIN_INPUT, 4) /* (V13) PRG1_PRU0_GPO5.RGMII1_RX_CTL */ - AM64X_IOPAD(0x0124, PIN_OUTPUT, 4) /* (V15) PRG1_PRU1_GPO7.RGMII1_TD0 */ - AM64X_IOPAD(0x012c, PIN_OUTPUT, 4) /* (V14) PRG1_PRU1_GPO9.RGMII1_TD1 */ - AM64X_IOPAD(0x0130, PIN_OUTPUT, 4) /* (W14) PRG1_PRU1_GPO10.RGMII1_TD2 */ - AM64X_IOPAD(0x014c, PIN_OUTPUT, 4) /* (AA14) PRG1_PRU1_GPO17.RGMII1_TD3 */ - AM64X_IOPAD(0x00e0, PIN_OUTPUT, 4) /* (U14) PRG1_PRU0_GPO10.RGMII1_TXC */ - AM64X_IOPAD(0x00dc, PIN_OUTPUT, 4) /* (U15) PRG1_PRU0_GPO9.RGMII1_TX_CTL */ - >; - }; - - rgmii2_pins_default: rgmii2-pins-default { - pinctrl-single,pins = < - AM64X_IOPAD(0x0108, PIN_INPUT, 4) /* (W11) PRG1_PRU1_GPO0.RGMII2_RD0 */ - AM64X_IOPAD(0x010c, PIN_INPUT, 4) /* (V11) PRG1_PRU1_GPO1.RGMII2_RD1 */ - AM64X_IOPAD(0x0110, PIN_INPUT, 4) /* (AA12) PRG1_PRU1_GPO2.RGMII2_RD2 */ - AM64X_IOPAD(0x0114, PIN_INPUT, 4) /* (Y12) PRG1_PRU1_GPO3.RGMII2_RD3 */ - AM64X_IOPAD(0x0120, PIN_INPUT, 4) /* (U11) PRG1_PRU1_GPO6.RGMII2_RXC */ - AM64X_IOPAD(0x0118, PIN_INPUT, 4) /* (W12) PRG1_PRU1_GPO4.RGMII2_RX_CTL */ - AM64X_IOPAD(0x0134, PIN_OUTPUT, 4) /* (AA10) PRG1_PRU1_GPO11.RGMII2_TD0 */ - AM64X_IOPAD(0x0138, PIN_OUTPUT, 4) /* (V10) PRG1_PRU1_GPO12.RGMII2_TD1 */ - AM64X_IOPAD(0x013c, PIN_OUTPUT, 4) /* (U10) PRG1_PRU1_GPO13.RGMII2_TD2 */ - AM64X_IOPAD(0x0140, PIN_OUTPUT, 4) /* (AA11) PRG1_PRU1_GPO14.RGMII2_TD3 */ - AM64X_IOPAD(0x0148, PIN_OUTPUT, 4) /* (Y10) PRG1_PRU1_GPO16.RGMII2_TXC */ - AM64X_IOPAD(0x0144, PIN_OUTPUT, 4) /* (Y11) PRG1_PRU1_GPO15.RGMII2_TX_CTL */ - >; - }; -}; - &dmsc { + bootph-pre-ram; mboxes= <&secure_proxy_main 0>, <&secure_proxy_main 1>, <&secure_proxy_main 0>; @@ -189,78 +81,28 @@ };
&main_uart0 { + /* Clocked by default - enable early in boot to get debug logs */ /delete-property/ power-domains; /delete-property/ clocks; /delete-property/ clock-names; - pinctrl-names = "default"; - pinctrl-0 = <&main_uart0_pins_default>; - status = "okay"; +}; + +&main_uart1_pins_default { + bootph-pre-ram; };
&main_uart1 { bootph-pre-ram; - pinctrl-names = "default"; - pinctrl-0 = <&main_uart1_pins_default>; +}; + +/* EEPROM might be read before SYSFW is available */ +&main_i2c0 { + /delete-property/ power-domains; };
&sdhci1 { + /* Clocked by default */ /delete-property/ power-domains; clocks = <&clk_200mhz>; clock-names = "clk_xin"; - ti,driver-strength-ohm = <50>; - disable-wp; - pinctrl-0 = <&main_mmc1_pins_default>; -}; - -&serdes_ln_ctrl { - idle-states = <AM64_SERDES0_LANE0_USB>; -}; - -&serdes_wiz0 { - status = "okay"; -}; - -&serdes0 { - serdes0_usb_link: link@0 { - reg = <0>; - cdns,num-lanes = <1>; - #phy-cells = <0>; - cdns,phy-type = <PHY_TYPE_USB3>; - resets = <&serdes_wiz0 1>; - }; -}; - -&usbss0 { - ti,vbus-divider; -}; - -&usb0 { - dr_mode = "host"; - maximum-speed = "super-speed"; - pinctrl-names = "default"; - pinctrl-0 = <&main_usb0_pins_default>; - phys = <&serdes0_usb_link>; - phy-names = "cdns3,usb3-phy"; -}; - -&cpsw3g { - pinctrl-names = "default"; - pinctrl-0 = <&mdio1_pins_default - &rgmii1_pins_default - &rgmii2_pins_default>; }; - -&cpsw_port2 { - phy-mode = "rgmii-rxid"; - phy-handle = <&cpsw3g_phy1>; -}; - -&cpsw3g_mdio { - cpsw3g_phy1: ethernet-phy@1 { - reg = <1>; - ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; - ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; - }; -}; - -#include "k3-am642-sk-u-boot.dtsi"

Hi Nishanth,
On 14/04/23 13:27, Nishanth Menon wrote:
Use am642-sk.dts to represent the Board and selectively enable/override the configurations necessary. And since am642-sk-u-boot.dtsi also needs to setup common properties, instead of re-inventing everything, just reuse the definitions.
Signed-off-by: Nishanth Menon nm@ti.com
arch/arm/dts/k3-am642-r5-sk.dts | 194 +++----------------------------- 1 file changed, 18 insertions(+), 176 deletions(-)
diff --git a/arch/arm/dts/k3-am642-r5-sk.dts b/arch/arm/dts/k3-am642-r5-sk.dts index 9ff4dd3dd365..8ac6cc77256c 100644 --- a/arch/arm/dts/k3-am642-r5-sk.dts +++ b/arch/arm/dts/k3-am642-r5-sk.dts @@ -5,31 +5,18 @@
/dts-v1/;
-#include <dt-bindings/mux/ti-serdes.h> -#include <dt-bindings/phy/phy.h> -#include <dt-bindings/net/ti-dp83867.h> -#include "k3-am642.dtsi" +#include "k3-am642-sk.dts" #include "k3-am64-sk-lp4-1600MTs.dtsi" #include "k3-am64-ddr.dtsi"
-/ {
- chosen {
stdout-path = "serial2:115200n8";
tick-timer = &timer1;
- };
+#include "k3-am642-sk-u-boot.dtsi"
would changing the location of the include affect the dt nodes somehow?
+/ { aliases { remoteproc0 = &sysctrler; remoteproc1 = &a53_0; };
- memory@80000000 {
device_type = "memory";
/* 2G RAM */
reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
bootph-pre-ram;
- };
- a53_0: a53@0 { compatible = "ti,am654-rproc"; reg = <0x00 0x00a90000 0x00 0x10>;
@@ -46,18 +33,6 @@ bootph-pre-ram; };
- reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
secure_ddr: optee@9e800000 {
reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
alignment = <0x1000>;
no-map;
};
- };
- clk_200mhz: dummy-clock-200mhz { compatible = "fixed-clock"; #clock-cells = <0>;
@@ -73,9 +48,8 @@ mbox-names = "tx", "rx"; bootph-pre-ram; }; -};
-&cbass_main {
- /* XXX: Upstream kernel TODO: send upstream */ main_esm: esm@420000 { compatible = "ti,j721e-esm"; reg = <0x0 0x420000 0x0 0x1000>;
@@ -86,6 +60,8 @@
&cbass_mcu { bootph-pre-ram;
- /* XXX: Upstream kernel TODO: send upstream */ mcu_esm: esm@4100000 { compatible = "ti,j721e-esm"; reg = <0x0 0x4100000 0x0 0x1000>;
@@ -94,92 +70,8 @@ }; };
-&main_pmx0 {
- bootph-pre-ram;
- main_uart0_pins_default: main-uart0-pins-default {
bootph-pre-ram;
pinctrl-single,pins = <
AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */
AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */
AM64X_IOPAD(0x0230, PIN_INPUT, 0) /* (D15) UART0_RXD */
AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */
>;
- };
- main_uart1_pins_default: main-uart1-pins-default {
bootph-pre-ram;
pinctrl-single,pins = <
AM64X_IOPAD(0x0248, PIN_INPUT, 0) /* (D16) UART1_CTSn */
AM64X_IOPAD(0x024c, PIN_OUTPUT, 0) /* (E16) UART1_RTSn */
AM64X_IOPAD(0x0240, PIN_INPUT, 0) /* (E15) UART1_RXD */
AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */
>;
- };
- main_mmc1_pins_default: main-mmc1-pins-default {
bootph-pre-ram;
pinctrl-single,pins = <
AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */
AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */
AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */
AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */
AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */
AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */
AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */
AM64X_IOPAD(0x029c, PIN_INPUT_PULLUP, 0) /* (C20) MMC1_SDWP */
>;
- };
- main_usb0_pins_default: main-usb0-pins-default {
bootph-pre-ram;
pinctrl-single,pins = <
AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */
>;
- };
- mdio1_pins_default: mdio1-pins-default {
pinctrl-single,pins = <
AM64X_IOPAD(0x01fc, PIN_OUTPUT, 4) /* (R2) PRG0_PRU1_GPO19.MDIO0_MDC */
AM64X_IOPAD(0x01f8, PIN_INPUT, 4) /* (P5) PRG0_PRU1_GPO18.MDIO0_MDIO */
>;
- };
- rgmii1_pins_default: rgmii1-pins-default {
pinctrl-single,pins = <
AM64X_IOPAD(0x011c, PIN_INPUT, 4) /* (AA13) PRG1_PRU1_GPO5.RGMII1_RD0 */
AM64X_IOPAD(0x0128, PIN_INPUT, 4) /* (U12) PRG1_PRU1_GPO8.RGMII1_RD1 */
AM64X_IOPAD(0x0150, PIN_INPUT, 4) /* (Y13) PRG1_PRU1_GPO18.RGMII1_RD2 */
AM64X_IOPAD(0x0154, PIN_INPUT, 4) /* (V12) PRG1_PRU1_GPO19.RGMII1_RD3 */
AM64X_IOPAD(0x00d8, PIN_INPUT, 4) /* (W13) PRG1_PRU0_GPO8.RGMII1_RXC */
AM64X_IOPAD(0x00cc, PIN_INPUT, 4) /* (V13) PRG1_PRU0_GPO5.RGMII1_RX_CTL */
AM64X_IOPAD(0x0124, PIN_OUTPUT, 4) /* (V15) PRG1_PRU1_GPO7.RGMII1_TD0 */
AM64X_IOPAD(0x012c, PIN_OUTPUT, 4) /* (V14) PRG1_PRU1_GPO9.RGMII1_TD1 */
AM64X_IOPAD(0x0130, PIN_OUTPUT, 4) /* (W14) PRG1_PRU1_GPO10.RGMII1_TD2 */
AM64X_IOPAD(0x014c, PIN_OUTPUT, 4) /* (AA14) PRG1_PRU1_GPO17.RGMII1_TD3 */
AM64X_IOPAD(0x00e0, PIN_OUTPUT, 4) /* (U14) PRG1_PRU0_GPO10.RGMII1_TXC */
AM64X_IOPAD(0x00dc, PIN_OUTPUT, 4) /* (U15) PRG1_PRU0_GPO9.RGMII1_TX_CTL */
>;
- };
rgmii2_pins_default: rgmii2-pins-default {
pinctrl-single,pins = <
AM64X_IOPAD(0x0108, PIN_INPUT, 4) /* (W11) PRG1_PRU1_GPO0.RGMII2_RD0 */
AM64X_IOPAD(0x010c, PIN_INPUT, 4) /* (V11) PRG1_PRU1_GPO1.RGMII2_RD1 */
AM64X_IOPAD(0x0110, PIN_INPUT, 4) /* (AA12) PRG1_PRU1_GPO2.RGMII2_RD2 */
AM64X_IOPAD(0x0114, PIN_INPUT, 4) /* (Y12) PRG1_PRU1_GPO3.RGMII2_RD3 */
AM64X_IOPAD(0x0120, PIN_INPUT, 4) /* (U11) PRG1_PRU1_GPO6.RGMII2_RXC */
AM64X_IOPAD(0x0118, PIN_INPUT, 4) /* (W12) PRG1_PRU1_GPO4.RGMII2_RX_CTL */
AM64X_IOPAD(0x0134, PIN_OUTPUT, 4) /* (AA10) PRG1_PRU1_GPO11.RGMII2_TD0 */
AM64X_IOPAD(0x0138, PIN_OUTPUT, 4) /* (V10) PRG1_PRU1_GPO12.RGMII2_TD1 */
AM64X_IOPAD(0x013c, PIN_OUTPUT, 4) /* (U10) PRG1_PRU1_GPO13.RGMII2_TD2 */
AM64X_IOPAD(0x0140, PIN_OUTPUT, 4) /* (AA11) PRG1_PRU1_GPO14.RGMII2_TD3 */
AM64X_IOPAD(0x0148, PIN_OUTPUT, 4) /* (Y10) PRG1_PRU1_GPO16.RGMII2_TXC */
AM64X_IOPAD(0x0144, PIN_OUTPUT, 4) /* (Y11) PRG1_PRU1_GPO15.RGMII2_TX_CTL */
>;
- };
-};
- &dmsc {
- bootph-pre-ram; mboxes= <&secure_proxy_main 0>, <&secure_proxy_main 1>, <&secure_proxy_main 0>;
@@ -189,78 +81,28 @@ };
&main_uart0 {
- /* Clocked by default - enable early in boot to get debug logs */ /delete-property/ power-domains; /delete-property/ clocks; /delete-property/ clock-names;
- pinctrl-names = "default";
- pinctrl-0 = <&main_uart0_pins_default>;
- status = "okay";
+};
+&main_uart1_pins_default {
bootph-pre-ram; };
&main_uart1 { bootph-pre-ram;
- pinctrl-names = "default";
- pinctrl-0 = <&main_uart1_pins_default>;
+};
+/* EEPROM might be read before SYSFW is available */ +&main_i2c0 {
/delete-property/ power-domains; };
&sdhci1 {
/* Clocked by default */ /delete-property/ power-domains; clocks = <&clk_200mhz>; clock-names = "clk_xin";
- ti,driver-strength-ohm = <50>;
- disable-wp;
- pinctrl-0 = <&main_mmc1_pins_default>;
-};
-&serdes_ln_ctrl {
- idle-states = <AM64_SERDES0_LANE0_USB>;
-};
-&serdes_wiz0 {
- status = "okay";
-};
-&serdes0 {
- serdes0_usb_link: link@0 {
reg = <0>;
cdns,num-lanes = <1>;
#phy-cells = <0>;
cdns,phy-type = <PHY_TYPE_USB3>;
resets = <&serdes_wiz0 1>;
- };
-};
-&usbss0 {
- ti,vbus-divider;
-};
-&usb0 {
- dr_mode = "host";
- maximum-speed = "super-speed";
- pinctrl-names = "default";
- pinctrl-0 = <&main_usb0_pins_default>;
- phys = <&serdes0_usb_link>;
- phy-names = "cdns3,usb3-phy";
-};
-&cpsw3g {
- pinctrl-names = "default";
- pinctrl-0 = <&mdio1_pins_default
&rgmii1_pins_default
};&rgmii2_pins_default>;
-&cpsw_port2 {
- phy-mode = "rgmii-rxid";
- phy-handle = <&cpsw3g_phy1>;
-};
-&cpsw3g_mdio {
- cpsw3g_phy1: ethernet-phy@1 {
reg = <1>;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
- };
-};
-#include "k3-am642-sk-u-boot.dtsi"
Regards,
Manorit

On 14:45-20230418, Manorit Chawdhry wrote:
Hi Nishanth,
On 14/04/23 13:27, Nishanth Menon wrote:
Use am642-sk.dts to represent the Board and selectively enable/override the configurations necessary. And since am642-sk-u-boot.dtsi also needs to setup common properties, instead of re-inventing everything, just reuse the definitions.
Signed-off-by: Nishanth Menon nm@ti.com
arch/arm/dts/k3-am642-r5-sk.dts | 194 +++----------------------------- 1 file changed, 18 insertions(+), 176 deletions(-)
diff --git a/arch/arm/dts/k3-am642-r5-sk.dts b/arch/arm/dts/k3-am642-r5-sk.dts index 9ff4dd3dd365..8ac6cc77256c 100644 --- a/arch/arm/dts/k3-am642-r5-sk.dts +++ b/arch/arm/dts/k3-am642-r5-sk.dts @@ -5,31 +5,18 @@ /dts-v1/; -#include <dt-bindings/mux/ti-serdes.h> -#include <dt-bindings/phy/phy.h> -#include <dt-bindings/net/ti-dp83867.h> -#include "k3-am642.dtsi" +#include "k3-am642-sk.dts" #include "k3-am64-sk-lp4-1600MTs.dtsi" #include "k3-am64-ddr.dtsi" -/ {
- chosen {
stdout-path = "serial2:115200n8";
tick-timer = &timer1;
- };
+#include "k3-am642-sk-u-boot.dtsi"
would changing the location of the include affect the dt nodes somehow?
yes, ofcourse, depends on the overlap ofcourse, in this series, I have tried to ensure the overlap occurs only where necessary. board.dts: &node { property-x = <0>; };
board-u-boot.dts: &node { property-x = <1>; };
board-r5.dts: &node { property-x = <2>; };
Then: case a) u-boot.dtsi included in r5.dts at the very end will make the property 1! - but then what was the point in overriding node?
case b) u-boot.dtsi included early in r5.dts will make the property 2 - which was intended when we introduced the override.
Are you seeing a specific problem in this series?

On 07:34-20230418, Nishanth Menon wrote:
On 14:45-20230418, Manorit Chawdhry wrote:
Hi Nishanth,
On 14/04/23 13:27, Nishanth Menon wrote:
Use am642-sk.dts to represent the Board and selectively enable/override the configurations necessary. And since am642-sk-u-boot.dtsi also needs to setup common properties, instead of re-inventing everything, just reuse the definitions.
Signed-off-by: Nishanth Menon nm@ti.com
arch/arm/dts/k3-am642-r5-sk.dts | 194 +++----------------------------- 1 file changed, 18 insertions(+), 176 deletions(-)
diff --git a/arch/arm/dts/k3-am642-r5-sk.dts b/arch/arm/dts/k3-am642-r5-sk.dts index 9ff4dd3dd365..8ac6cc77256c 100644 --- a/arch/arm/dts/k3-am642-r5-sk.dts +++ b/arch/arm/dts/k3-am642-r5-sk.dts @@ -5,31 +5,18 @@ /dts-v1/; -#include <dt-bindings/mux/ti-serdes.h> -#include <dt-bindings/phy/phy.h> -#include <dt-bindings/net/ti-dp83867.h> -#include "k3-am642.dtsi" +#include "k3-am642-sk.dts" #include "k3-am64-sk-lp4-1600MTs.dtsi" #include "k3-am64-ddr.dtsi" -/ {
- chosen {
stdout-path = "serial2:115200n8";
tick-timer = &timer1;
- };
+#include "k3-am642-sk-u-boot.dtsi"
would changing the location of the include affect the dt nodes somehow?
yes, ofcourse, depends on the overlap ofcourse, in this series, I have tried to ensure the overlap occurs only where necessary. board.dts: &node { property-x = <0>; };
board-u-boot.dts: &node { property-x = <1>; };
board-r5.dts: &node { property-x = <2>; };
Then: case a) u-boot.dtsi included in r5.dts at the very end will make the property 1! - but then what was the point in overriding node?
case b) u-boot.dtsi included early in r5.dts will make the property 2 - which was intended when we introduced the override.
Are you seeing a specific problem in this series?
Ah no, I was just worried since you had moved this specific include from bottom of the file to top so was thinking if it could change the order of overrides, but looks like there are no common nodes as such in u-boot.dtsi and r5-sk.dtsi to change the override order. LGTM.
[override check for u-boot.dtsi and r5-sk.dtsi] Reviewed-by: Manorit Chawdhry m-chawdhry@ti.com
Regards, Manorit
-- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

Since networking is needed even for u-boot, lets move the MDIO pinmux hack down to evm.dts.
Until MDIO is converted to DM model, it won't be possible to probe for pinmux from the MDIO node. To work around this, hack the board dts to set the default mux option to include MDIO. This hack is a limitation for now till we get u-boot MDIO driver into DM model.
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-evm-u-boot.dtsi | 4 ---- arch/arm/dts/k3-am642-evm.dts | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi index 64857b09099d..c8fd08885366 100644 --- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi @@ -113,10 +113,6 @@ <0x0 0x43000200 0x0 0x8>; reg-names = "cpsw_nuss", "mac_efuse"; /delete-property/ ranges; - pinctrl-0 = <&mdio1_pins_default /* HACK: as MDIO driver is not DM enabled */ - &rgmii1_pins_default - &rgmii2_pins_default>; - cpsw-phy-sel@04044 { compatible = "ti,am64-phy-gmii-sel"; reg = <0x0 0x43004044 0x0 0x8>; diff --git a/arch/arm/dts/k3-am642-evm.dts b/arch/arm/dts/k3-am642-evm.dts index 39feea78a084..ed3a6f1341b0 100644 --- a/arch/arm/dts/k3-am642-evm.dts +++ b/arch/arm/dts/k3-am642-evm.dts @@ -425,7 +425,8 @@
&cpsw3g { pinctrl-names = "default"; - pinctrl-0 = <&rgmii1_pins_default + pinctrl-0 = <&mdio1_pins_default /* HACK: as MDIO driver is not DM enabled */ + &rgmii1_pins_default &rgmii2_pins_default>; };

Describe the DDR vtt regulator on evm
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com --- Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/ I skipped doing the regulator renaming etc, it is just churn un-necessary for the original purpose of fixing the r5.dts
arch/arm/dts/k3-am642-evm.dts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/arch/arm/dts/k3-am642-evm.dts b/arch/arm/dts/k3-am642-evm.dts index ed3a6f1341b0..82d356a66793 100644 --- a/arch/arm/dts/k3-am642-evm.dts +++ b/arch/arm/dts/k3-am642-evm.dts @@ -148,6 +148,21 @@ regulator-boot-on; };
+ /* XXX: Upstream kernel TODO: send upstream */ + vtt_supply: regulator-5 { + compatible = "regulator-fixed"; + regulator-name = "vtt"; + pinctrl-names = "default"; + pinctrl-0 = <&ddr_vtt_pins_default>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&main_gpio0 12 GPIO_ACTIVE_HIGH>; + vin-supply = <&vsys_3v3>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + }; + leds { compatible = "gpio-leds";
@@ -322,6 +337,13 @@ AM64X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (C17) MCAN1_TX */ >; }; + + /* XXX: Upstream kernel TODO: send upstream */ + ddr_vtt_pins_default: ddr-vtt-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0030, PIN_OUTPUT_PULLUP, 7) /* (L18) OSPI0_CSN1.GPIO0_12 */ + >; + }; };
&main_uart0 {

Add main_uart1 description in evm devicetree.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com --- Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
arch/arm/dts/k3-am642-evm.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm/dts/k3-am642-evm.dts b/arch/arm/dts/k3-am642-evm.dts index 82d356a66793..9cc271d9a22a 100644 --- a/arch/arm/dts/k3-am642-evm.dts +++ b/arch/arm/dts/k3-am642-evm.dts @@ -230,6 +230,16 @@ >; };
+ /* XXX: Upstream kernel TODO: send upstream pinmux */ + main_uart1_pins_default: main-uart1-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0248, PIN_INPUT, 0) /* (D16) UART1_CTSn */ + AM64X_IOPAD(0x024c, PIN_OUTPUT, 0) /* (E16) UART1_RTSn */ + AM64X_IOPAD(0x0240, PIN_INPUT, 0) /* (E15) UART1_RXD */ + AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */ + >; + }; + main_uart0_pins_default: main-uart0-pins-default { pinctrl-single,pins = < AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */ @@ -355,6 +365,9 @@ /* main_uart1 is reserved for firmware usage */ &main_uart1 { status = "reserved"; + /* XXX: Upstream kernel TODO: send upstream pinmux */ + pinctrl-names = "default"; + pinctrl-0 = <&main_uart1_pins_default>; };
&main_i2c1 {

Add missing main_i2c0 node and eeprom property.
This is a pending upstream kernel updates as of v6.3-rc6.
Signed-off-by: Nishanth Menon nm@ti.com --- Sent to kernel.org https://lore.kernel.org/linux-devicetree/20230414073328.381336-1-nm@ti.com/
arch/arm/dts/k3-am642-evm.dts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/arch/arm/dts/k3-am642-evm.dts b/arch/arm/dts/k3-am642-evm.dts index 9cc271d9a22a..c20215b68d8f 100644 --- a/arch/arm/dts/k3-am642-evm.dts +++ b/arch/arm/dts/k3-am642-evm.dts @@ -258,6 +258,14 @@ >; };
+ /* XXX: Upstream kernel TODO: send upstream pinmux */ + main_i2c0_pins_default: main-i2c0-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ + AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ + >; + }; + main_i2c1_pins_default: main-i2c1-pins-default { pinctrl-single,pins = < AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */ @@ -370,6 +378,20 @@ pinctrl-0 = <&main_uart1_pins_default>; };
+/* XXX: Upstream kernel TODO: send upstream pinmux */ +&main_i2c0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&main_i2c0_pins_default>; + clock-frequency = <400000>; + + eeprom@50 { + /* AT24CM01 */ + compatible = "atmel,24c1024"; + reg = <0x50>; + }; +}; + &main_i2c1 { status = "okay"; pinctrl-names = "default";

Drop the i2c and mux description, since we have it on main board dts.
Signed-off-by: Nishanth Menon nm@ti.com --- Again causes a bisect break at this point due to some weird dependency with r5 which I could not cleanly resolve.
arch/arm/dts/k3-am642-evm-u-boot.dtsi | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi index c8fd08885366..6e85101f134e 100644 --- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi @@ -34,21 +34,14 @@
&main_pmx0 { bootph-pre-ram; - main_i2c0_pins_default: main-i2c0-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ - AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ - >; - }; +}; + +&main_i2c0_pins_default { + bootph-pre-ram; };
&main_i2c0 { - status = "okay"; bootph-pre-ram; - pinctrl-names = "default"; - pinctrl-0 = <&main_i2c0_pins_default>; - clock-frequency = <400000>; };
&main_uart0 {

stdout is provided in evm.dts, add documentation that timer needs to be fixed in upstream. While at it, fix a minor formatting error
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-evm-u-boot.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi index 6e85101f134e..83e00c3f4553 100644 --- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi @@ -5,7 +5,6 @@
/ { chosen { - stdout-path = "serial2:115200n8"; tick-timer = &timer1; };
@@ -14,8 +13,10 @@ }; };
-&cbass_main{ +&cbass_main { bootph-pre-ram; + + /* XXX: Upstream kernel TODO: send upstream pinmux */ timer1: timer@2400000 { compatible = "ti,omap5430-timer"; reg = <0x0 0x2400000 0x0 0x80>;

Reorder the pinmux to place it above the interface for easier tracking.
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-evm-u-boot.dtsi | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi index 83e00c3f4553..afd1fc4c0b0b 100644 --- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi @@ -49,20 +49,16 @@ bootph-pre-ram; };
-&usb0 { - dr_mode="peripheral"; - bootph-pre-ram; -}; - -&usbss0 { +&main_usb0_pins_default { bootph-pre-ram; };
-&main_mmc1_pins_default { +&usb0 { + dr_mode="peripheral"; bootph-pre-ram; };
-&main_usb0_pins_default { +&usbss0 { bootph-pre-ram; };
@@ -98,6 +94,10 @@ bootph-pre-ram; };
+&main_mmc1_pins_default { + bootph-pre-ram; +}; + &sdhci1 { bootph-pre-ram; };

Add required pinmux spl notations for pinmux entries that are missing.
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-evm-u-boot.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi index afd1fc4c0b0b..11a4cb5dad88 100644 --- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi @@ -45,6 +45,10 @@ bootph-pre-ram; };
+&main_uart0_pins_default { + bootph-pre-ram; +}; + &main_uart0 { bootph-pre-ram; }; @@ -102,6 +106,18 @@ bootph-pre-ram; };
+&mdio1_pins_default { + bootph-pre-ram; +}; + +&rgmii1_pins_default { + bootph-pre-ram; +}; + +&rgmii2_pins_default { + bootph-pre-ram; +}; + &cpsw3g { reg = <0x0 0x8000000 0x0 0x200000>, <0x0 0x43000200 0x0 0x8>;

Use am642-evm.dts to represent the Board and selectively enable/override the configurations necessary. And since am642-evm-u-boot.dtsi also needs to setup common properties, instead of re-inventing everything, just reuse the definitions.
Signed-off-by: Nishanth Menon nm@ti.com --- arch/arm/dts/k3-am642-r5-evm.dts | 203 +++++-------------------------- 1 file changed, 29 insertions(+), 174 deletions(-)
diff --git a/arch/arm/dts/k3-am642-r5-evm.dts b/arch/arm/dts/k3-am642-r5-evm.dts index ca5ce4a35a5c..140dd90fbdf1 100644 --- a/arch/arm/dts/k3-am642-r5-evm.dts +++ b/arch/arm/dts/k3-am642-r5-evm.dts @@ -5,29 +5,18 @@
/dts-v1/;
-#include "k3-am642.dtsi" +#include "k3-am642-evm.dts" #include "k3-am64-evm-ddr4-1600MTs.dtsi" #include "k3-am64-ddr.dtsi"
-/ { - chosen { - stdout-path = "serial2:115200n8"; - tick-timer = &timer1; - }; +#include "k3-am642-evm-u-boot.dtsi"
+/ { aliases { remoteproc0 = &sysctrler; remoteproc1 = &a53_0; };
- memory@80000000 { - device_type = "memory"; - /* 2G RAM */ - reg = <0x00000000 0x80000000 0x00000000 0x80000000>; - - bootph-pre-ram; - }; - a53_0: a53@0 { compatible = "ti,am654-rproc"; reg = <0x00 0x00a90000 0x00 0x10>; @@ -44,34 +33,12 @@ bootph-pre-ram; };
- reserved-memory { - #address-cells = <2>; - #size-cells = <2>; - ranges; - - secure_ddr: optee@9e800000 { - reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */ - alignment = <0x1000>; - no-map; - }; - }; - clk_200mhz: dummy-clock-200mhz { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <200000000>; bootph-pre-ram; }; - - vtt_supply: vtt-supply { - compatible = "regulator-gpio"; - regulator-name = "vtt"; - regulator-min-microvolt = <0>; - regulator-max-microvolt = <3300000>; - gpios = <&main_gpio0 12 GPIO_ACTIVE_HIGH>; - states = <0 0x0 3300000 0x1>; - bootph-pre-ram; - }; };
&cbass_main { @@ -81,9 +48,8 @@ mbox-names = "tx", "rx"; bootph-pre-ram; }; -};
-&cbass_main { + /* XXX: Upstream kernel TODO: send upstream */ main_esm: esm@420000 { compatible = "ti,j721e-esm"; reg = <0x0 0x420000 0x0 0x1000>; @@ -94,6 +60,8 @@
&cbass_mcu { bootph-pre-ram; + + /* XXX: Upstream kernel TODO: send upstream */ mcu_esm: esm@4100000 { compatible = "ti,j721e-esm"; reg = <0x0 0x4100000 0x0 0x1000>; @@ -102,115 +70,8 @@ }; };
-&main_pmx0 { - bootph-pre-ram; - main_uart0_pins_default: main-uart0-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */ - AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */ - AM64X_IOPAD(0x0230, PIN_INPUT, 0) /* (D15) UART0_RXD */ - AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */ - >; - }; - - main_uart1_pins_default: main-uart1-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0248, PIN_INPUT, 0) /* (D16) UART1_CTSn */ - AM64X_IOPAD(0x024c, PIN_OUTPUT, 0) /* (E16) UART1_RTSn */ - AM64X_IOPAD(0x0240, PIN_INPUT, 0) /* (E15) UART1_RXD */ - AM64X_IOPAD(0x0244, PIN_OUTPUT, 0) /* (E14) UART1_TXD */ - >; - }; - - main_mmc0_pins_default: main-mmc0-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x01a8, PIN_INPUT_PULLDOWN, 0) /* (B25) MMC0_CLK */ - AM64X_IOPAD(0x01aC, PIN_INPUT_PULLUP, 0) /* (B27) MMC0_CMD */ - AM64X_IOPAD(0x01a4, PIN_INPUT_PULLUP, 0) /* (A26) MMC0_DAT0 */ - AM64X_IOPAD(0x01a0, PIN_INPUT_PULLUP, 0) /* (E25) MMC0_DAT1 */ - AM64X_IOPAD(0x019c, PIN_INPUT_PULLUP, 0) /* (C26) MMC0_DAT2 */ - AM64X_IOPAD(0x0198, PIN_INPUT_PULLUP, 0) /* (A25) MMC0_DAT3 */ - AM64X_IOPAD(0x0194, PIN_INPUT_PULLUP, 0) /* (E24) MMC0_DAT4 */ - AM64X_IOPAD(0x0190, PIN_INPUT_PULLUP, 0) /* (A24) MMC0_DAT5 */ - AM64X_IOPAD(0x018c, PIN_INPUT_PULLUP, 0) /* (B26) MMC0_DAT6 */ - AM64X_IOPAD(0x0188, PIN_INPUT_PULLUP, 0) /* (D25) MMC0_DAT7 */ - AM64X_IOPAD(0x01b0, PIN_INPUT, 0) /* (C25) MMC0_DS */ - >; - }; - - main_mmc1_pins_default: main-mmc1-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */ - AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */ - AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */ - AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */ - AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */ - AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */ - AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */ - AM64X_IOPAD(0x029c, PIN_INPUT_PULLUP, 0) /* (C20) MMC1_SDWP */ - >; - }; - - ddr_vtt_pins_default: ddr-vtt-pins-default { - bootph-pre-ram; - pinctrl-single,pins = < - AM64X_IOPAD(0x0030, PIN_OUTPUT_PULLUP, 7) /* (L18) OSPI0_CSN1.GPIO0_12 */ - >; - }; - - main_usb0_pins_default: main-usb0-pins-default { - pinctrl-single,pins = < - AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ - >; - }; - - mdio1_pins_default: mdio1-pins-default { - pinctrl-single,pins = < - AM64X_IOPAD(0x01fc, PIN_OUTPUT, 4) /* (R2) PRG0_PRU1_GPO19.MDIO0_MDC */ - AM64X_IOPAD(0x01f8, PIN_INPUT, 4) /* (P5) PRG0_PRU1_GPO18.MDIO0_MDIO */ - >; - }; - - rgmii1_pins_default: rgmii1-pins-default { - pinctrl-single,pins = < - AM64X_IOPAD(0x01cc, PIN_INPUT, 4) /* (W5) PRG0_PRU1_GPO7.RGMII1_RD0 */ - AM64X_IOPAD(0x01d4, PIN_INPUT, 4) /* (Y5) PRG0_PRU1_GPO9.RGMII1_RD1 */ - AM64X_IOPAD(0x01d8, PIN_INPUT, 4) /* (V6) PRG0_PRU1_GPO10.RGMII1_RD2 */ - AM64X_IOPAD(0x01f4, PIN_INPUT, 4) /* (V5) PRG0_PRU1_GPO17.RGMII1_RD3 */ - AM64X_IOPAD(0x0188, PIN_INPUT, 4) /* (AA5) PRG0_PRU0_GPO10.RGMII1_RXC */ - AM64X_IOPAD(0x0184, PIN_INPUT, 4) /* (W6) PRG0_PRU0_GPO9.RGMII1_RX_CTL */ - AM64X_IOPAD(0x0124, PIN_OUTPUT, 4) /* (V15) PRG1_PRU1_GPO7.RGMII1_TD0 */ - AM64X_IOPAD(0x012c, PIN_OUTPUT, 4) /* (V14) PRG1_PRU1_GPO9.RGMII1_TD1 */ - AM64X_IOPAD(0x0130, PIN_OUTPUT, 4) /* (W14) PRG1_PRU1_GPO10.RGMII1_TD2 */ - AM64X_IOPAD(0x014c, PIN_OUTPUT, 4) /* (AA14) PRG1_PRU1_GPO17.RGMII1_TD3 */ - AM64X_IOPAD(0x00e0, PIN_OUTPUT, 4) /* (U14) PRG1_PRU0_GPO10.RGMII1_TXC */ - AM64X_IOPAD(0x00dc, PIN_OUTPUT, 4) /* (U15) PRG1_PRU0_GPO9.RGMII1_TX_CTL */ - >; - }; - - rgmii2_pins_default: rgmii2-pins-default { - pinctrl-single,pins = < - AM64X_IOPAD(0x0108, PIN_INPUT, 4) /* (W11) PRG1_PRU1_GPO0.RGMII2_RD0 */ - AM64X_IOPAD(0x010c, PIN_INPUT, 4) /* (V11) PRG1_PRU1_GPO1.RGMII2_RD1 */ - AM64X_IOPAD(0x0110, PIN_INPUT, 4) /* (AA12) PRG1_PRU1_GPO2.RGMII2_RD2 */ - AM64X_IOPAD(0x0114, PIN_INPUT, 4) /* (Y12) PRG1_PRU1_GPO3.RGMII2_RD3 */ - AM64X_IOPAD(0x0120, PIN_INPUT, 4) /* (U11) PRG1_PRU1_GPO6.RGMII2_RXC */ - AM64X_IOPAD(0x0118, PIN_INPUT, 4) /* (W12) PRG1_PRU1_GPO4.RGMII2_RX_CTL */ - AM64X_IOPAD(0x0134, PIN_OUTPUT, 4) /* (AA10) PRG1_PRU1_GPO11.RGMII2_TD0 */ - AM64X_IOPAD(0x0138, PIN_OUTPUT, 4) /* (V10) PRG1_PRU1_GPO12.RGMII2_TD1 */ - AM64X_IOPAD(0x013c, PIN_OUTPUT, 4) /* (U10) PRG1_PRU1_GPO13.RGMII2_TD2 */ - AM64X_IOPAD(0x0140, PIN_OUTPUT, 4) /* (AA11) PRG1_PRU1_GPO14.RGMII2_TD3 */ - AM64X_IOPAD(0x0148, PIN_OUTPUT, 4) /* (Y10) PRG1_PRU1_GPO16.RGMII2_TXC */ - AM64X_IOPAD(0x0144, PIN_OUTPUT, 4) /* (Y11) PRG1_PRU1_GPO15.RGMII2_TX_CTL */ - >; - }; -}; - &dmsc { + bootph-pre-ram; mboxes= <&secure_proxy_main 0>, <&secure_proxy_main 1>, <&secure_proxy_main 0>; @@ -219,19 +80,35 @@ ti,secure-host; };
+&ddr_vtt_pins_default { + bootph-pre-ram; +}; + +&vtt_supply { + bootph-pre-ram; +}; + +/* EEPROM might be read before SYSFW is available */ +&main_i2c0 { + /delete-property/ power-domains; +}; + &main_uart0 { + /* Clocked by default */ /delete-property/ power-domains; /delete-property/ clocks; /delete-property/ clock-names; - pinctrl-names = "default"; - pinctrl-0 = <&main_uart0_pins_default>; - status = "okay"; +}; + +&main_uart1_pins_default { + bootph-pre-ram; };
&main_uart1 { bootph-pre-ram; pinctrl-names = "default"; pinctrl-0 = <&main_uart1_pins_default>; + status = "okay"; };
&memorycontroller { @@ -241,43 +118,21 @@ };
&sdhci0 { + /* Clocked by default */ /delete-property/ power-domains; clocks = <&clk_200mhz>; clock-names = "clk_xin"; - ti,driver-strength-ohm = <50>; - disable-wp; - pinctrl-0 = <&main_mmc0_pins_default>; };
&sdhci1 { + /* Clocked by default */ /delete-property/ power-domains; clocks = <&clk_200mhz>; clock-names = "clk_xin"; - ti,driver-strength-ohm = <50>; - disable-wp; - pinctrl-0 = <&main_mmc1_pins_default>; };
&main_gpio0 { bootph-pre-ram; + /* Clocked by default */ /delete-property/ power-domains; }; - -/* EEPROM might be read before SYSFW is available */ -&main_i2c0 { - /delete-property/ power-domains; -}; - -&usbss0 { - ti,vbus-divider; - ti,usb2-only; -}; - -&usb0 { - dr_mode = "otg"; - maximum-speed = "high-speed"; - pinctrl-names = "default"; - pinctrl-0 = <&main_usb0_pins_default>; -}; - -#include "k3-am642-evm-u-boot.dtsi"

Move to using .env file for setting up environment variables for am64x.
Signed-off-by: Nishanth Menon nm@ti.com ---
I think this was long time pending.. but anyways..
board/ti/am64x/Kconfig | 3 + board/ti/am64x/am64x.env | 37 ++++++++++++ include/configs/am64x_evm.h | 117 ++++++++++-------------------------- 3 files changed, 72 insertions(+), 85 deletions(-) create mode 100644 board/ti/am64x/am64x.env
diff --git a/board/ti/am64x/Kconfig b/board/ti/am64x/Kconfig index afb54f8cdabb..bc99b041228d 100644 --- a/board/ti/am64x/Kconfig +++ b/board/ti/am64x/Kconfig @@ -37,6 +37,9 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "am64x_evm"
+config ENV_SOURCE_FILE + default "am64x" + source "board/ti/common/Kconfig"
endif diff --git a/board/ti/am64x/am64x.env b/board/ti/am64x/am64x.env new file mode 100644 index 000000000000..28ba0ac073b8 --- /dev/null +++ b/board/ti/am64x/am64x.env @@ -0,0 +1,37 @@ +#include <environment/ti/ti_armv7_common.env> +#include <environment/ti/mmc.env> + +default_device_tree=k3-am642-evm.dtb +findfdt= + setenv name_fdt ${default_device_tree}; + if test $board_name = am64x_gpevm; then + setenv name_fdt k3-am642-evm.dtb; fi; + if test $board_name = am64x_skevm; then + setenv name_fdt k3-am642-sk.dtb; fi; + setenv fdtfile ${name_fdt} + +name_kern=Image +console=ttyS2,115200n8 +args_all=setenv optargs ${optargs} ${mtdparts} +run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} + +boot=mmc +mmcdev=1 +bootpart=1:2 +bootdir=/boot +rd_spec=- +init_mmc=run args_all args_mmc +get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt} +get_overlay_mmc= + fdt address ${fdtaddr}; + fdt resize 0x100000; + for overlay in $name_overlays; + do; + load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && + fdt apply ${dtboaddr}; + done; +get_kern_mmc=load mmc ${bootpart} ${loadaddr} + ${bootdir}/${name_kern} +get_fit_mmc=load mmc ${bootpart} ${addr_fit} + ${bootdir}/${name_fit} +partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h index 26a7f2521ecc..6c5987b6e0cd 100644 --- a/include/configs/am64x_evm.h +++ b/include/configs/am64x_evm.h @@ -2,7 +2,7 @@ /* * Configuration header file for K3 AM642 SoC family * - * Copyright (C) 2020-2021 Texas Instruments Incorporated - https://www.ti.com/ + * Copyright (C) 2020-2023 Texas Instruments Incorporated - https://www.ti.com/ * Keerthy j-keerthy@ti.com */
@@ -10,98 +10,45 @@ #define __CONFIG_AM642_EVM_H
#include <linux/sizes.h> -#include <config_distro_bootcmd.h> -#include <environment/ti/mmc.h> -#include <asm/arch/am64_hardware.h> -#include <environment/ti/k3_dfu.h>
/* DDR Configuration */ #define CFG_SYS_SDRAM_BASE1 0x880000000
-#define PARTS_DEFAULT \ - /* Linux partitions */ \ - "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" - -/* U-Boot general configuration */ -#define EXTRA_ENV_AM642_BOARD_SETTINGS \ - "findfdt=" \ - "if test $board_name = am64x_gpevm; then " \ - "setenv fdtfile k3-am642-evm.dtb; fi; " \ - "if test $board_name = am64x_skevm; then " \ - "setenv fdtfile k3-am642-sk.dtb; fi;" \ - "if test $fdtfile = undefined; then " \ - "echo WARNING: Could not determine device tree to use; fi; \0" \ - "name_kern=Image\0" \ - "console=ttyS2,115200n8\0" \ - "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \ - "${mtdparts}\0" \ - "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" - -/* U-Boot MMC-specific configuration */ -#define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \ - "boot=mmc\0" \ - "mmcdev=1\0" \ - "bootpart=1:2\0" \ - "bootdir=/boot\0" \ - "rd_spec=-\0" \ - "init_mmc=run args_all args_mmc\0" \ - "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ - "get_overlay_mmc=" \ - "fdt address ${fdtaddr};" \ - "fdt resize 0x100000;" \ - "for overlay in $name_overlays;" \ - "do;" \ - "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ - "fdt apply ${dtboaddr};" \ - "done;\0" \ - "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ - "${bootdir}/${name_kern}\0" \ - "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ - "${bootdir}/${name_fit}\0" \ - "partitions=" PARTS_DEFAULT +#if CONFIG_IS_ENABLED(CMD_MMC) +#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 1) func(MMC, mmc, 0) +#else +#define DISTRO_BOOT_DEV_MMC(func) +#endif + +#if CONFIG_IS_ENABLED(CMD_PXE) +#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na) +#else +#define DISTRO_BOOT_DEV_PXE(func) +#endif + +#if CONFIG_IS_ENABLED(CMD_DHCP) +#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na) +#else +#define DISTRO_BOOT_DEV_DHCP(func) +#endif + +#if CONFIG_IS_ENABLED(CMD_USB) +# define BOOT_TARGET_USB(func) func(USB, usb, 0) +#else +# define BOOT_TARGET_USB(func) +#endif + +#define BOOT_TARGET_DEVICES(func) \ + BOOT_TARGET_USB(func) \ + DISTRO_BOOT_DEV_MMC(func) \ + DISTRO_BOOT_DEV_PXE(func) \ + DISTRO_BOOT_DEV_DHCP(func)
-#define EXTRA_ENV_AM642_BOARD_SETTING_USBMSC \ - "args_usb=run finduuid;setenv bootargs console=${console} " \ - "${optargs} " \ - "root=PARTUUID=${uuid} rw " \ - "rootfstype=${mmcrootfstype}\0" \ - "init_usb=run args_all args_usb\0" \ - "get_fdt_usb=load usb ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ - "get_overlay_usb=" \ - "fdt address ${fdtaddr};" \ - "fdt resize 0x100000;" \ - "for overlay in $name_overlays;" \ - "do;" \ - "load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ - "fdt apply ${dtboaddr};" \ - "done;\0" \ - "get_kern_usb=load usb ${bootpart} ${loadaddr} " \ - "${bootdir}/${name_kern}\0" \ - "get_fit_usb=load usb ${bootpart} ${addr_fit} " \ - "${bootdir}/${name_fit}\0" \ - "usbboot=setenv boot usb;" \ - "setenv bootpart 0:2;" \ - "usb start;" \ - "run findfdt;" \ - "run init_usb;" \ - "run get_kern_usb;" \ - "run get_fdt_usb;" \ - "run run_kern\0" - -#define EXTRA_ENV_DFUARGS \ - DFU_ALT_INFO_MMC \ - DFU_ALT_INFO_EMMC \ - DFU_ALT_INFO_RAM \ - DFU_ALT_INFO_OSPI +#include <config_distro_bootcmd.h>
/* Incorporate settings into the U-Boot environment */ #define CFG_EXTRA_ENV_SETTINGS \ - DEFAULT_LINUX_BOOT_ENV \ - DEFAULT_MMC_TI_ARGS \ - EXTRA_ENV_AM642_BOARD_SETTINGS \ - EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \ - EXTRA_ENV_DFUARGS \ - EXTRA_ENV_AM642_BOARD_SETTING_USBMSC + BOOTENV
/* Now for the remaining common defines */ #include <configs/ti_armv7_common.h>

Just use distroboot when we are attempting to enable that by default.
Signed-off-by: Nishanth Menon nm@ti.com ---
we should probably do this for all other defconfigs instead of the weird hacks folks have been doing inconsistenly in am62x, j721e defconfig.
if we are distroboot, just do it.. envboot is for personal user overrides.
configs/am64x_evm_a53_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig index 6543ae76fcb1..ea6165d8f7e1 100644 --- a/configs/am64x_evm_a53_defconfig +++ b/configs/am64x_evm_a53_defconfig @@ -31,7 +31,7 @@ CONFIG_SPL_SPI=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_DISTRO_DEFAULTS=y -CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_kern_${boot}; run get_fdt_${boot}; run run_kern" +CONFIG_BOOTCOMMAND="run findfdt; run envboot; run distro_bootcmd" CONFIG_BOARD_LATE_INIT=y CONFIG_SPL_MAX_SIZE=0x180000 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
participants (3)
-
Manorit Chawdhry
-
Nishanth Menon
-
Roger Quadros