diff mbox series

[1/2] arm: dts: k3-am625-sk: Add OSPI support

Message ID 20220927052918.825003-2-d-gole@ti.com
State Superseded
Delegated to: Tom Rini
Headers show
Series ke-am62x-sk_evm: add ospi support | expand

Commit Message

Dhruva Gole Sept. 27, 2022, 5:29 a.m. UTC
Add DT nodes to enable S28HS512T OSPI flash on the SK board.

Signed-off-by: Dhruva Gole <d-gole@ti.com>
---
 arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
 arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+)

Comments

Tom Rini Oct. 6, 2022, 3:38 p.m. UTC | #1
On Tue, Sep 27, 2022 at 10:59:17AM +0530, Dhruva Gole wrote:

> Add DT nodes to enable S28HS512T OSPI flash on the SK board.
> 
> Signed-off-by: Dhruva Gole <d-gole@ti.com>
> ---
>  arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
>  arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++

What is the status of the non u-boot.dtsi portion of this patch with
upstream Linux? Thanks.
Dhruva Gole Oct. 19, 2022, 6:47 a.m. UTC | #2
Hi Tom,

On 06/10/22 21:08, Tom Rini wrote:
> On Tue, Sep 27, 2022 at 10:59:17AM +0530, Dhruva Gole wrote:
> 
>> Add DT nodes to enable S28HS512T OSPI flash on the SK board.
>>
>> Signed-off-by: Dhruva Gole <d-gole@ti.com>
>> ---
>>   arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
>>   arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++
> 
> What is the status of the non u-boot.dtsi portion of this patch with
> upstream Linux? Thanks.
In upstream, please refer to 
https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/ti/k3-am625-sk.dts#L24 


spi0 = &ospi0;

and pinmux is all done in a similar fashion as I have done in these patches.

>
Tom Rini Oct. 19, 2022, 12:34 p.m. UTC | #3
On Wed, Oct 19, 2022 at 12:17:43PM +0530, Dhruva Gole wrote:
> Hi Tom,
> 
> On 06/10/22 21:08, Tom Rini wrote:
> > On Tue, Sep 27, 2022 at 10:59:17AM +0530, Dhruva Gole wrote:
> > 
> > > Add DT nodes to enable S28HS512T OSPI flash on the SK board.
> > > 
> > > Signed-off-by: Dhruva Gole <d-gole@ti.com>
> > > ---
> > >   arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
> > >   arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++
> > 
> > What is the status of the non u-boot.dtsi portion of this patch with
> > upstream Linux? Thanks.
> In upstream, please refer to https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/ti/k3-am625-sk.dts#L24
> 
> 
> spi0 = &ospi0;
> 
> and pinmux is all done in a similar fashion as I have done in these patches.

The preferred way to do this then is to post a patch syncing the whole
of the DTS files with a given upstream tag then, so that it's clear and
also so the trees stay up to date. This also applies to the patches you
posted today.
Dhruva Gole Oct. 20, 2022, 6:02 a.m. UTC | #4
On 19/10/22 18:04, Tom Rini wrote:
> On Wed, Oct 19, 2022 at 12:17:43PM +0530, Dhruva Gole wrote:
>> Hi Tom,
>>
>> On 06/10/22 21:08, Tom Rini wrote:
>>> On Tue, Sep 27, 2022 at 10:59:17AM +0530, Dhruva Gole wrote:
>>>
>>>> Add DT nodes to enable S28HS512T OSPI flash on the SK board.
>>>>
>>>> Signed-off-by: Dhruva Gole <d-gole@ti.com>
>>>> ---
>>>>    arch/arm/dts/k3-am625-sk-u-boot.dtsi | 24 +++++++++
>>>>    arch/arm/dts/k3-am625-sk.dts         | 77 ++++++++++++++++++++++++++++
>>>
>>> What is the status of the non u-boot.dtsi portion of this patch with
>>> upstream Linux? Thanks.
>> In upstream, please refer to https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/ti/k3-am625-sk.dts#L24
>>
>>
>> spi0 = &ospi0;
>>
>> and pinmux is all done in a similar fashion as I have done in these patches.
> 
> The preferred way to do this then is to post a patch syncing the whole
> of the DTS files with a given upstream tag then, so that it's clear and
> also so the trees stay up to date. This also applies to the patches you
> posted today.
Okay noted, I will be sending out a new series where I will sync up the 
DTS files with kernel upstream.
> 

Also kindly note that the series 
https://lore.kernel.org/u-boot/20221019064759.493607-1-d-gole@ti.com/ 
supersedes this series.

I will also be re-spinning that series based on the suggestions given so 
far.
diff mbox series

Patch

diff --git a/arch/arm/dts/k3-am625-sk-u-boot.dtsi b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
index 159fa36bbe9f..92788bae3e09 100644
--- a/arch/arm/dts/k3-am625-sk-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
@@ -102,3 +102,27 @@ 
 &main_mmc1_pins_default {
 	u-boot,dm-spl;
 };
+
+&fss {
+	u-boot,dm-spl;
+};
+
+&ospi0_pins_default {
+	u-boot,dm-spl;
+};
+
+&ospi0 {
+	u-boot,dm-spl;
+
+	flash@0 {
+		u-boot,dm-spl;
+
+		partitions {
+			u-boot,dm-spl;
+
+			partition@3fc0000 {
+				u-boot,dm-spl;
+			};
+		};
+	};
+};
diff --git a/arch/arm/dts/k3-am625-sk.dts b/arch/arm/dts/k3-am625-sk.dts
index 76b06ea23953..5d4b2fddafaa 100644
--- a/arch/arm/dts/k3-am625-sk.dts
+++ b/arch/arm/dts/k3-am625-sk.dts
@@ -19,6 +19,7 @@ 
 	aliases {
 		serial2 = &main_uart0;
 		mmc1 = &sdhci1;
+		spi0 = &ospi0;
 	};
 
 	chosen {
@@ -77,6 +78,23 @@ 
 			AM62X_IOPAD(0x240, PIN_INPUT, 0) /* (D17) MMC1_SDCD */
 		>;
 	};
+
+	ospi0_pins_default: ospi0-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x000, PIN_OUTPUT, 0) /* (H24) OSPI0_CLK */
+			AM62X_IOPAD(0x02c, PIN_OUTPUT, 0) /* (F23) OSPI0_CSn0 */
+			AM62X_IOPAD(0x00c, PIN_INPUT, 0) /* (E25) OSPI0_D0 */
+
+			AM62X_IOPAD(0x010, PIN_INPUT, 0) /* (G24) OSPI0_D1 */
+			AM62X_IOPAD(0x014, PIN_INPUT, 0) /* (F25) OSPI0_D2 */
+			AM62X_IOPAD(0x018, PIN_INPUT, 0) /* (F24) OSPI0_D3 */
+			AM62X_IOPAD(0x01c, PIN_INPUT, 0) /* (J23) OSPI0_D4 */
+			AM62X_IOPAD(0x020, PIN_INPUT, 0) /* (J25) OSPI0_D5 */
+			AM62X_IOPAD(0x024, PIN_INPUT, 0) /* (H25) OSPI0_D6 */
+			AM62X_IOPAD(0x028, PIN_INPUT, 0) /* (J22) OSPI0_D7 */
+			AM62X_IOPAD(0x008, PIN_INPUT, 0) /* (J24) OSPI0_DQS */
+		>;
+	};
 };
 
 &wkup_uart0 {
@@ -148,3 +166,62 @@ 
 	ti,driver-strength-ohm = <50>;
 	disable-wp;
 };
+
+&ospi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&ospi0_pins_default>;
+
+	flash@0{
+		compatible = "jedec,spi-nor";
+		reg = <0x0>;
+		spi-tx-bus-width = <8>;
+		spi-rx-bus-width = <8>;
+		spi-max-frequency = <25000000>;
+		cdns,tshsl-ns = <60>;
+		cdns,tsd2d-ns = <60>;
+		cdns,tchsh-ns = <60>;
+		cdns,tslch-ns = <60>;
+		cdns,read-delay = <4>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "ospi.tiboot3";
+				reg = <0x0 0x80000>;
+			};
+
+			partition@80000 {
+				label = "ospi.tispl";
+				reg = <0x80000 0x200000>;
+			};
+
+			partition@280000 {
+				label = "ospi.u-boot";
+				reg = <0x280000 0x400000>;
+			};
+
+			partition@680000 {
+				label = "ospi.env";
+				reg = <0x680000 0x40000>;
+			};
+
+			partition@6c0000 {
+				label = "ospi.env.backup";
+				reg = <0x6c0000 0x40000>;
+			};
+
+			partition@800000 {
+				label = "ospi.rootfs";
+				reg = <0x800000 0x37c0000>;
+			};
+
+			partition@3fc0000 {
+				label = "ospi.phypattern";
+				reg = <0x3fc0000 0x40000>;
+			};
+		};
+	};
+};