Re: [PATCH 3/3] arm64: dts: ti: k3-j7200-som-p0: Add nodes for OSPI0

2021-03-02 Thread Pratyush Yadav
On 02/03/21 01:10PM, Vignesh Raghavendra wrote:
> 
> 
> On 3/2/21 1:28 AM, Pratyush Yadav wrote:
> > +
> > +   mcu_fss0_ospi0_pins_default: mcu-fss0-ospi0-pins-default {
> > +   pinctrl-single,pins = <
> > +   J721E_WKUP_IOPAD(0x, PIN_OUTPUT, 0) /* 
> > MCU_OSPI0_CLK */
> > +   J721E_WKUP_IOPAD(0x002c, PIN_OUTPUT, 0) /* 
> > MCU_OSPI0_CSn0 */
> > +   J721E_WKUP_IOPAD(0x000c, PIN_INPUT, 0)  /* MCU_OSPI0_D0 
> > */
> > +   J721E_WKUP_IOPAD(0x0010, PIN_INPUT, 0)  /* MCU_OSPI0_D1 
> > */
> > +   J721E_WKUP_IOPAD(0x0014, PIN_INPUT, 0)  /* MCU_OSPI0_D2 
> > */
> > +   J721E_WKUP_IOPAD(0x0018, PIN_INPUT, 0)  /* MCU_OSPI0_D3 
> > */
> > +   J721E_WKUP_IOPAD(0x001c, PIN_INPUT, 0)  /* MCU_OSPI0_D4 
> > */
> > +   J721E_WKUP_IOPAD(0x0020, PIN_INPUT, 0)  /* MCU_OSPI0_D5 
> > */
> > +   J721E_WKUP_IOPAD(0x0024, PIN_INPUT, 0)  /* MCU_OSPI0_D6 
> > */
> > +   J721E_WKUP_IOPAD(0x0028, PIN_INPUT, 0)  /* MCU_OSPI0_D7 
> > */
> > +   J721E_WKUP_IOPAD(0x0008, PIN_INPUT_PULLDOWN, 0)  /* 
> > MCU_OSPI0_DQS */
> > +   >;
> > +   };
> 
> There is a pulldown resistor on the board right? So, internal pulldown
> is unnecessary and may even cause conflicts.

Right. Will fix.

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.


Re: [PATCH 3/3] arm64: dts: ti: k3-j7200-som-p0: Add nodes for OSPI0

2021-03-02 Thread Vignesh Raghavendra



On 3/2/21 1:28 AM, Pratyush Yadav wrote:
> +
> + mcu_fss0_ospi0_pins_default: mcu-fss0-ospi0-pins-default {
> + pinctrl-single,pins = <
> + J721E_WKUP_IOPAD(0x, PIN_OUTPUT, 0) /* 
> MCU_OSPI0_CLK */
> + J721E_WKUP_IOPAD(0x002c, PIN_OUTPUT, 0) /* 
> MCU_OSPI0_CSn0 */
> + J721E_WKUP_IOPAD(0x000c, PIN_INPUT, 0)  /* MCU_OSPI0_D0 
> */
> + J721E_WKUP_IOPAD(0x0010, PIN_INPUT, 0)  /* MCU_OSPI0_D1 
> */
> + J721E_WKUP_IOPAD(0x0014, PIN_INPUT, 0)  /* MCU_OSPI0_D2 
> */
> + J721E_WKUP_IOPAD(0x0018, PIN_INPUT, 0)  /* MCU_OSPI0_D3 
> */
> + J721E_WKUP_IOPAD(0x001c, PIN_INPUT, 0)  /* MCU_OSPI0_D4 
> */
> + J721E_WKUP_IOPAD(0x0020, PIN_INPUT, 0)  /* MCU_OSPI0_D5 
> */
> + J721E_WKUP_IOPAD(0x0024, PIN_INPUT, 0)  /* MCU_OSPI0_D6 
> */
> + J721E_WKUP_IOPAD(0x0028, PIN_INPUT, 0)  /* MCU_OSPI0_D7 
> */
> + J721E_WKUP_IOPAD(0x0008, PIN_INPUT_PULLDOWN, 0)  /* 
> MCU_OSPI0_DQS */
> + >;
> + };

There is a pulldown resistor on the board right? So, internal pulldown
is unnecessary and may even cause conflicts.


[PATCH 3/3] arm64: dts: ti: k3-j7200-som-p0: Add nodes for OSPI0

2021-03-01 Thread Pratyush Yadav
TI J7200 has the Cadence OSPI controller for interfacing with OSPI
flashes. Add its node to allow using SPI flashes.

Signed-off-by: Pratyush Yadav 
---
 .../boot/dts/ti/k3-j7200-mcu-wakeup.dtsi  | 17 +
 arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi   | 36 +++
 2 files changed, 53 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi 
b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
index 359e3e8a8cd0..5408ec815d58 100644
--- a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
@@ -269,6 +269,23 @@ hbmc: hyperbus@47034000 {
#size-cells = <1>;
mux-controls = <_mux 0>;
};
+
+   ospi0: spi@4704 {
+   compatible = "ti,am654-ospi";
+   reg = <0x0 0x4704 0x0 0x100>,
+ <0x5 0x 0x1 0x000>;
+   interrupts = ;
+   cdns,fifo-depth = <256>;
+   cdns,fifo-width = <4>;
+   cdns,trigger-address = <0x0>;
+   clocks = <_clks 103 0>;
+   assigned-clocks = <_clks 103 0>;
+   assigned-clock-parents = <_clks 103 2>;
+   assigned-clock-rates = <1>;
+   power-domains = <_pds 103 TI_SCI_PD_EXCLUSIVE>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
};
 
tscadc0: tscadc@4020 {
diff --git a/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi 
b/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi
index a988e2ab2ba1..effecf852139 100644
--- a/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi
@@ -100,6 +100,22 @@ J721E_WKUP_IOPAD(0x24, PIN_INPUT, 1) /* (A8) 
MCU_OSPI0_D6.MCU_HYPERBUS0_DQ6 */
J721E_WKUP_IOPAD(0x28, PIN_INPUT, 1) /* (A7) 
MCU_OSPI0_D7.MCU_HYPERBUS0_DQ7 */
>;
};
+
+   mcu_fss0_ospi0_pins_default: mcu-fss0-ospi0-pins-default {
+   pinctrl-single,pins = <
+   J721E_WKUP_IOPAD(0x, PIN_OUTPUT, 0) /* 
MCU_OSPI0_CLK */
+   J721E_WKUP_IOPAD(0x002c, PIN_OUTPUT, 0) /* 
MCU_OSPI0_CSn0 */
+   J721E_WKUP_IOPAD(0x000c, PIN_INPUT, 0)  /* MCU_OSPI0_D0 
*/
+   J721E_WKUP_IOPAD(0x0010, PIN_INPUT, 0)  /* MCU_OSPI0_D1 
*/
+   J721E_WKUP_IOPAD(0x0014, PIN_INPUT, 0)  /* MCU_OSPI0_D2 
*/
+   J721E_WKUP_IOPAD(0x0018, PIN_INPUT, 0)  /* MCU_OSPI0_D3 
*/
+   J721E_WKUP_IOPAD(0x001c, PIN_INPUT, 0)  /* MCU_OSPI0_D4 
*/
+   J721E_WKUP_IOPAD(0x0020, PIN_INPUT, 0)  /* MCU_OSPI0_D5 
*/
+   J721E_WKUP_IOPAD(0x0024, PIN_INPUT, 0)  /* MCU_OSPI0_D6 
*/
+   J721E_WKUP_IOPAD(0x0028, PIN_INPUT, 0)  /* MCU_OSPI0_D7 
*/
+   J721E_WKUP_IOPAD(0x0008, PIN_INPUT_PULLDOWN, 0)  /* 
MCU_OSPI0_DQS */
+   >;
+   };
 };
 
 _pmx0 {
@@ -235,3 +251,23 @@ exp_som: gpio@21 {
  "GPIO_LIN_EN", "CAN_STB";
};
 };
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_fss0_ospi0_pins_default>;
+
+   flash@0{
+   compatible = "jedec,spi-nor";
+   reg = <0x0>;
+   spi-tx-bus-width = <8>;
+   spi-rx-bus-width = <8>;
+   spi-max-frequency = <2500>;
+   cdns,tshsl-ns = <60>;
+   cdns,tsd2d-ns = <60>;
+   cdns,tchsh-ns = <60>;
+   cdns,tslch-ns = <60>;
+   cdns,read-delay = <4>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   };
+};
-- 
2.30.0