Re: [PATCH v8 3/3] arm64: dts: ti: k3-j7200: Add support for higher speed modes and update delay select values for MMCSD subsystems

2021-03-26 Thread Aswath Govindraju
Hi Kishon,

On 25/03/21 9:44 pm, Kishon Vijay Abraham I wrote:
> Hi Aswath,
> 
> On 24/03/21 12:07 pm, Aswath Govindraju wrote:
>> The following speed modes are now supported in J7200 SoC,
>> - HS200 and HS400 modes at 1.8 V card voltage, in MMCSD0 subsystem [1].
>> - UHS-I speed modes in MMCSD1 subsystem [1].
>>
>> Add support for UHS-I modes by adding voltage regulator device tree nodes
>> and corresponding pinmux details, to power cycle and voltage switch cards.
>> Set respective tags in sdhci0 and remove no-1-8-v tag from sdhci1
>> device tree nodes.
>>
>> Also update the delay values for various speed modes supported, based on
>> the revised january 2021 J7200 datasheet[2].
>>
>> [1] - section 12.3.6.1.1 MMCSD Features, in
>>   https://www.ti.com/lit/ug/spruiu1a/spruiu1a.pdf,
>>   (SPRUIU1A – JULY 2020 – REVISED JANUARY 2021)
>>
>> [2] - https://www.ti.com/lit/ds/symlink/dra821u.pdf,
>>   (SPRSP57B – APRIL 2020 – REVISED JANUARY 2021)
> minor comments below.. once you fix them, please add
> 
> Reviewed-by: Kishon Vijay Abraham I 
>>

Thank you for your review :).

>> Signed-off-by: Aswath Govindraju 
>> ---
>>  .../dts/ti/k3-j7200-common-proc-board.dts | 78 +++
>>  arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 14 +++-
>>  2 files changed, 90 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts 
>> b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
>> index b493f939b09a..a069787e1783 100644
>> --- a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
>> +++ b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
>> @@ -16,6 +16,65 @@
>>  stdout-path = "serial2:115200n8";
>>  bootargs = "console=ttyS2,115200n8 
>> earlycon=ns16550a,mmio32,0x0280";
>>  };
>> +
>> +evm_12v0: fixedregulator-evm12v0 {
>> +/* main supply */
>> +compatible = "regulator-fixed";
>> +regulator-name = "evm_12v0";
>> +regulator-min-microvolt = <1200>;
>> +regulator-max-microvolt = <1200>;
>> +regulator-always-on;
>> +regulator-boot-on;
>> +};
>> +
>> +vsys_3v3: fixedregulator-vsys3v3 {
>> +/* Output of LMS140 */
> 
> %s/LMS140/LM5140

Will make this change in respin.

>> +compatible = "regulator-fixed";
>> +regulator-name = "vsys_3v3";
>> +regulator-min-microvolt = <330>;
>> +regulator-max-microvolt = <330>;
>> +vin-supply = <_12v0>;
>> +regulator-always-on;
>> +regulator-boot-on;
>> +};
>> +
>> +vsys_5v0: fixedregulator-vsys5v0 {
>> +/* Output of LM5140 */
>> +compatible = "regulator-fixed";
>> +regulator-name = "vsys_5v0";
>> +regulator-min-microvolt = <500>;
>> +regulator-max-microvolt = <500>;
>> +vin-supply = <_12v0>;
>> +regulator-always-on;
>> +regulator-boot-on;
>> +};
>> +
>> +vdd_mmc1: fixedregulator-sd {
>> +/* Output of TPS22918  */
>> +compatible = "regulator-fixed";
>> +regulator-name = "vdd_mmc1";
>> +regulator-min-microvolt = <330>;
>> +regulator-max-microvolt = <330>;
>> +regulator-boot-on;
>> +enable-active-high;
>> +vin-supply = <_3v3>;
>> +gpio = < 2 GPIO_ACTIVE_HIGH>;
>> +};
>> +
>> +vdd_sd_dv: gpio-regulator-vdd-sd-dv {
>> +/* Output of TLV71033 */
> 
> Would have preferred to keep this similar to j721e.
> gpio-regulator-TLV71033 is used in j721e

Will make this change in respin

>> +compatible = "regulator-gpio";
>> +regulator-name = "vdd_sd_dv";
> 
> same comment here..

Will make this change in respin

>> +pinctrl-names = "default";
>> +pinctrl-0 = <_sd_dv_pins_default>;
>> +regulator-min-microvolt = <180>;
>> +regulator-max-microvolt = <330>;
>> +regulator-boot-on;
>> +vin-supply = <_5v0>;
>> +gpios = <_gpio0 55 GPIO_ACTIVE_HIGH>;
>> +states = <180 0x0>,
>> + <330 0x1>;
>> +};
>>  };
>>  
>>  _pmx0 {
>> @@ -45,6 +104,13 @@
>>  };
>>  
>>  _pmx0 {
>> +main_i2c0_pins_default: main-i2c0-pins-default {
>> +pinctrl-single,pins = <
>> +J721E_IOPAD(0xd4, PIN_INPUT_PULLUP, 0) /* (V3) I2C0_SCL 
>> */
>> +J721E_IOPAD(0xd8, PIN_INPUT_PULLUP, 0) /* (W2) I2C0_SDA 
>> */
>> +>;
>> +};
>> +
>>  main_i2c1_pins_default: main-i2c1-pins-default {
>>  pinctrl-single,pins = <
>>  J721E_IOPAD(0xdc, PIN_INPUT_PULLUP, 3) /* (U3) 
>> ECAP0_IN_APWM_OUT.I2C1_SCL */
>> @@ -70,6 +136,12 @@
>>  J721E_IOPAD(0x120, PIN_OUTPUT, 0) /* (T4) USB0_DRVVBUS 
>> */
>>  >;

Re: [PATCH v8 3/3] arm64: dts: ti: k3-j7200: Add support for higher speed modes and update delay select values for MMCSD subsystems

2021-03-25 Thread Kishon Vijay Abraham I
Hi Aswath,

On 24/03/21 12:07 pm, Aswath Govindraju wrote:
> The following speed modes are now supported in J7200 SoC,
> - HS200 and HS400 modes at 1.8 V card voltage, in MMCSD0 subsystem [1].
> - UHS-I speed modes in MMCSD1 subsystem [1].
> 
> Add support for UHS-I modes by adding voltage regulator device tree nodes
> and corresponding pinmux details, to power cycle and voltage switch cards.
> Set respective tags in sdhci0 and remove no-1-8-v tag from sdhci1
> device tree nodes.
> 
> Also update the delay values for various speed modes supported, based on
> the revised january 2021 J7200 datasheet[2].
> 
> [1] - section 12.3.6.1.1 MMCSD Features, in
>   https://www.ti.com/lit/ug/spruiu1a/spruiu1a.pdf,
>   (SPRUIU1A – JULY 2020 – REVISED JANUARY 2021)
> 
> [2] - https://www.ti.com/lit/ds/symlink/dra821u.pdf,
>   (SPRSP57B – APRIL 2020 – REVISED JANUARY 2021)
minor comments below.. once you fix them, please add

Reviewed-by: Kishon Vijay Abraham I 
> 
> Signed-off-by: Aswath Govindraju 
> ---
>  .../dts/ti/k3-j7200-common-proc-board.dts | 78 +++
>  arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 14 +++-
>  2 files changed, 90 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts 
> b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
> index b493f939b09a..a069787e1783 100644
> --- a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
> +++ b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
> @@ -16,6 +16,65 @@
>   stdout-path = "serial2:115200n8";
>   bootargs = "console=ttyS2,115200n8 
> earlycon=ns16550a,mmio32,0x0280";
>   };
> +
> + evm_12v0: fixedregulator-evm12v0 {
> + /* main supply */
> + compatible = "regulator-fixed";
> + regulator-name = "evm_12v0";
> + regulator-min-microvolt = <1200>;
> + regulator-max-microvolt = <1200>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + vsys_3v3: fixedregulator-vsys3v3 {
> + /* Output of LMS140 */

%s/LMS140/LM5140
> + compatible = "regulator-fixed";
> + regulator-name = "vsys_3v3";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + vin-supply = <_12v0>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + vsys_5v0: fixedregulator-vsys5v0 {
> + /* Output of LM5140 */
> + compatible = "regulator-fixed";
> + regulator-name = "vsys_5v0";
> + regulator-min-microvolt = <500>;
> + regulator-max-microvolt = <500>;
> + vin-supply = <_12v0>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + vdd_mmc1: fixedregulator-sd {
> + /* Output of TPS22918  */
> + compatible = "regulator-fixed";
> + regulator-name = "vdd_mmc1";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> + regulator-boot-on;
> + enable-active-high;
> + vin-supply = <_3v3>;
> + gpio = < 2 GPIO_ACTIVE_HIGH>;
> + };
> +
> + vdd_sd_dv: gpio-regulator-vdd-sd-dv {
> + /* Output of TLV71033 */

Would have preferred to keep this similar to j721e.
gpio-regulator-TLV71033 is used in j721e
> + compatible = "regulator-gpio";
> + regulator-name = "vdd_sd_dv";

same comment here..
> + pinctrl-names = "default";
> + pinctrl-0 = <_sd_dv_pins_default>;
> + regulator-min-microvolt = <180>;
> + regulator-max-microvolt = <330>;
> + regulator-boot-on;
> + vin-supply = <_5v0>;
> + gpios = <_gpio0 55 GPIO_ACTIVE_HIGH>;
> + states = <180 0x0>,
> +  <330 0x1>;
> + };
>  };
>  
>  _pmx0 {
> @@ -45,6 +104,13 @@
>  };
>  
>  _pmx0 {
> + main_i2c0_pins_default: main-i2c0-pins-default {
> + pinctrl-single,pins = <
> + J721E_IOPAD(0xd4, PIN_INPUT_PULLUP, 0) /* (V3) I2C0_SCL 
> */
> + J721E_IOPAD(0xd8, PIN_INPUT_PULLUP, 0) /* (W2) I2C0_SDA 
> */
> + >;
> + };
> +
>   main_i2c1_pins_default: main-i2c1-pins-default {
>   pinctrl-single,pins = <
>   J721E_IOPAD(0xdc, PIN_INPUT_PULLUP, 3) /* (U3) 
> ECAP0_IN_APWM_OUT.I2C1_SCL */
> @@ -70,6 +136,12 @@
>   J721E_IOPAD(0x120, PIN_OUTPUT, 0) /* (T4) USB0_DRVVBUS 
> */
>   >;
>   };
> +
> + vdd_sd_dv_pins_default: vdd-sd-dv-pins-default {
> + pinctrl-single,pins = <
> + J721E_IOPAD(0xd0, PIN_INPUT, 7) /* (T5) 
> SPI0_D1.GPIO0_55 */

This should ideally be PIN_OUTPUT. Can you check the latest 

[PATCH v8 3/3] arm64: dts: ti: k3-j7200: Add support for higher speed modes and update delay select values for MMCSD subsystems

2021-03-24 Thread Aswath Govindraju
The following speed modes are now supported in J7200 SoC,
- HS200 and HS400 modes at 1.8 V card voltage, in MMCSD0 subsystem [1].
- UHS-I speed modes in MMCSD1 subsystem [1].

Add support for UHS-I modes by adding voltage regulator device tree nodes
and corresponding pinmux details, to power cycle and voltage switch cards.
Set respective tags in sdhci0 and remove no-1-8-v tag from sdhci1
device tree nodes.

Also update the delay values for various speed modes supported, based on
the revised january 2021 J7200 datasheet[2].

[1] - section 12.3.6.1.1 MMCSD Features, in
  https://www.ti.com/lit/ug/spruiu1a/spruiu1a.pdf,
  (SPRUIU1A – JULY 2020 – REVISED JANUARY 2021)

[2] - https://www.ti.com/lit/ds/symlink/dra821u.pdf,
  (SPRSP57B – APRIL 2020 – REVISED JANUARY 2021)

Signed-off-by: Aswath Govindraju 
---
 .../dts/ti/k3-j7200-common-proc-board.dts | 78 +++
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 14 +++-
 2 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts 
b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
index b493f939b09a..a069787e1783 100644
--- a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
+++ b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
@@ -16,6 +16,65 @@
stdout-path = "serial2:115200n8";
bootargs = "console=ttyS2,115200n8 
earlycon=ns16550a,mmio32,0x0280";
};
+
+   evm_12v0: fixedregulator-evm12v0 {
+   /* main supply */
+   compatible = "regulator-fixed";
+   regulator-name = "evm_12v0";
+   regulator-min-microvolt = <1200>;
+   regulator-max-microvolt = <1200>;
+   regulator-always-on;
+   regulator-boot-on;
+   };
+
+   vsys_3v3: fixedregulator-vsys3v3 {
+   /* Output of LMS140 */
+   compatible = "regulator-fixed";
+   regulator-name = "vsys_3v3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   vin-supply = <_12v0>;
+   regulator-always-on;
+   regulator-boot-on;
+   };
+
+   vsys_5v0: fixedregulator-vsys5v0 {
+   /* Output of LM5140 */
+   compatible = "regulator-fixed";
+   regulator-name = "vsys_5v0";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   vin-supply = <_12v0>;
+   regulator-always-on;
+   regulator-boot-on;
+   };
+
+   vdd_mmc1: fixedregulator-sd {
+   /* Output of TPS22918  */
+   compatible = "regulator-fixed";
+   regulator-name = "vdd_mmc1";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   enable-active-high;
+   vin-supply = <_3v3>;
+   gpio = < 2 GPIO_ACTIVE_HIGH>;
+   };
+
+   vdd_sd_dv: gpio-regulator-vdd-sd-dv {
+   /* Output of TLV71033 */
+   compatible = "regulator-gpio";
+   regulator-name = "vdd_sd_dv";
+   pinctrl-names = "default";
+   pinctrl-0 = <_sd_dv_pins_default>;
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   vin-supply = <_5v0>;
+   gpios = <_gpio0 55 GPIO_ACTIVE_HIGH>;
+   states = <180 0x0>,
+<330 0x1>;
+   };
 };
 
 _pmx0 {
@@ -45,6 +104,13 @@
 };
 
 _pmx0 {
+   main_i2c0_pins_default: main-i2c0-pins-default {
+   pinctrl-single,pins = <
+   J721E_IOPAD(0xd4, PIN_INPUT_PULLUP, 0) /* (V3) I2C0_SCL 
*/
+   J721E_IOPAD(0xd8, PIN_INPUT_PULLUP, 0) /* (W2) I2C0_SDA 
*/
+   >;
+   };
+
main_i2c1_pins_default: main-i2c1-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0xdc, PIN_INPUT_PULLUP, 3) /* (U3) 
ECAP0_IN_APWM_OUT.I2C1_SCL */
@@ -70,6 +136,12 @@
J721E_IOPAD(0x120, PIN_OUTPUT, 0) /* (T4) USB0_DRVVBUS 
*/
>;
};
+
+   vdd_sd_dv_pins_default: vdd-sd-dv-pins-default {
+   pinctrl-single,pins = <
+   J721E_IOPAD(0xd0, PIN_INPUT, 7) /* (T5) 
SPI0_D1.GPIO0_55 */
+   >;
+   };
 };
 
 _uart0 {
@@ -157,6 +229,10 @@
 };
 
 _i2c0 {
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c0_pins_default>;
+   clock-frequency = <40>;
+
exp1: gpio@20 {
compatible = "ti,tca6416";
reg = <0x20>;
@@ -206,6 +282,8 @@
/* SD card */
pinctrl-0 = <_mmc1_pins_default>;
pinctrl-names = "default";
+   vmmc-supply = <_mmc1>;
+