diff mbox series

[v3,6/6] riscv: dts: starfive: add Milkv Mars board device tree

Message ID 20240131132600.4067-7-jszhang@kernel.org (mailing list archive)
State Changes Requested
Delegated to: Conor Dooley
Headers show
Series riscv: dts: starfive: add Milkv Mars board device tree | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-6-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-6-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-6-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-6-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-6-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-6-test-6 warning .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-6-test-7 fail .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-6-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-6-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-6-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-6-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-6-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Jisheng Zhang Jan. 31, 2024, 1:26 p.m. UTC
The Milkv Mars is a development board based on the Starfive JH7110 SoC.
The board features:

- JH7110 SoC
- 1/2/4/8 GiB LPDDR4 DRAM
- AXP15060 PMIC
- 40 pin GPIO header
- 3x USB 3.0 host port
- 1x USB 2.0 host port
- 1x M.2 E-Key
- 1x eMMC slot
- 1x MicroSD slot
- 1x QSPI Flash
- 1x 1Gbps Ethernet port
- 1x HDMI port
- 1x 2-lane DSI and 1x 4-lane DSI
- 1x 2-lane CSI

Add the devicetree file describing the currently supported features,
namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/boot/dts/starfive/Makefile         |  1 +
 .../boot/dts/starfive/jh7110-milkv-mars.dts   | 35 +++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts

Comments

Conor Dooley Feb. 6, 2024, 7:13 p.m. UTC | #1
On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> The board features:
> 
> - JH7110 SoC
> - 1/2/4/8 GiB LPDDR4 DRAM
> - AXP15060 PMIC
> - 40 pin GPIO header
> - 3x USB 3.0 host port
> - 1x USB 2.0 host port
> - 1x M.2 E-Key
> - 1x eMMC slot
> - 1x MicroSD slot
> - 1x QSPI Flash
> - 1x 1Gbps Ethernet port
> - 1x HDMI port
> - 1x 2-lane DSI and 1x 4-lane DSI
> - 1x 2-lane CSI
> 
> Add the devicetree file describing the currently supported features,
> namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>

Got a dtbs_check issue in the patchwork CI:

  +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
  +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
  +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
  +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#

Can you fix that please? Also, I applied some patches the other day that
seem to conflict quite a bit with the common board dts patch. Would you
please do a rebase on top of that please?

Cheers,
Conor.

> ---
>  arch/riscv/boot/dts/starfive/Makefile         |  1 +
>  .../boot/dts/starfive/jh7110-milkv-mars.dts   | 35 +++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> 
> diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
> index 0141504c0f5c..2fa0cd7f31c3 100644
> --- a/arch/riscv/boot/dts/starfive/Makefile
> +++ b/arch/riscv/boot/dts/starfive/Makefile
> @@ -8,5 +8,6 @@ DTC_FLAGS_jh7110-starfive-visionfive-2-v1.3b := -@
>  dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
>  dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
>  
> +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-milkv-mars.dtb
>  dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
>  dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
> diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> new file mode 100644
> index 000000000000..de600e799e7d
> --- /dev/null
> +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> @@ -0,0 +1,35 @@
> +// SPDX-License-Identifier: GPL-2.0 OR MIT
> +/*
> + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
> + */
> +
> +/dts-v1/;
> +#include "jh7110-visionfive2-mars-common.dtsi"
> +
> +/ {
> +	model = "Milk-V Mars";
> +	compatible = "milkv,mars", "starfive,jh7110";
> +};
> +
> +&gmac0 {
> +	starfive,tx-use-rgmii-clk;
> +	assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
> +	assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
> +};
> +
> +
> +&phy0 {
> +	motorcomm,tx-clk-adj-enabled;
> +	motorcomm,tx-clk-10-inverted;
> +	motorcomm,tx-clk-100-inverted;
> +	motorcomm,tx-clk-1000-inverted;
> +	motorcomm,rx-clk-drv-microamp = <3970>;
> +	motorcomm,rx-data-drv-microamp = <2910>;
> +	rx-internal-delay-ps = <1500>;
> +	tx-internal-delay-ps = <1500>;
> +};
> +
> +&mmc1 {
> +	disable-wp;
> +	cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
> +};
> -- 
> 2.43.0
>
Conor Dooley March 27, 2024, 6:06 p.m. UTC | #2
Yo,

On Tue, Feb 06, 2024 at 07:13:48PM +0000, Conor Dooley wrote:
> On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> > The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> > The board features:
> > 
> > - JH7110 SoC
> > - 1/2/4/8 GiB LPDDR4 DRAM
> > - AXP15060 PMIC
> > - 40 pin GPIO header
> > - 3x USB 3.0 host port
> > - 1x USB 2.0 host port
> > - 1x M.2 E-Key
> > - 1x eMMC slot
> > - 1x MicroSD slot
> > - 1x QSPI Flash
> > - 1x 1Gbps Ethernet port
> > - 1x HDMI port
> > - 1x 2-lane DSI and 1x 4-lane DSI
> > - 1x 2-lane CSI
> > 
> > Add the devicetree file describing the currently supported features,
> > namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> 
> Got a dtbs_check issue in the patchwork CI:
> 
>   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
>   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
>   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
>   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> 
> Can you fix that please? Also, I applied some patches the other day that
> seem to conflict quite a bit with the common board dts patch. Would you
> please do a rebase on top of that please?

Been going through stuff on my todo list now that the merge window is
closed. Could you please resend this with the rebase done?

Thanks,
Conor.
Jisheng Zhang March 28, 2024, 10:08 a.m. UTC | #3
On Wed, Mar 27, 2024 at 06:06:58PM +0000, Conor Dooley wrote:
> Yo,
> 
> On Tue, Feb 06, 2024 at 07:13:48PM +0000, Conor Dooley wrote:
> > On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> > > The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> > > The board features:
> > > 
> > > - JH7110 SoC
> > > - 1/2/4/8 GiB LPDDR4 DRAM
> > > - AXP15060 PMIC
> > > - 40 pin GPIO header
> > > - 3x USB 3.0 host port
> > > - 1x USB 2.0 host port
> > > - 1x M.2 E-Key
> > > - 1x eMMC slot
> > > - 1x MicroSD slot
> > > - 1x QSPI Flash
> > > - 1x 1Gbps Ethernet port
> > > - 1x HDMI port
> > > - 1x 2-lane DSI and 1x 4-lane DSI
> > > - 1x 2-lane CSI
> > > 
> > > Add the devicetree file describing the currently supported features,
> > > namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> > > 
> > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > 
> > Got a dtbs_check issue in the patchwork CI:
> > 
> >   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
> >   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> >   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
> >   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > 
> > Can you fix that please? Also, I applied some patches the other day that
> > seem to conflict quite a bit with the common board dts patch. Would you
> > please do a rebase on top of that please?
> 
> Been going through stuff on my todo list now that the merge window is
> closed. Could you please resend this with the rebase done?

Thanks for the reminding, I will rebase on 6.9-rc1 then send out the
patches.

> 
> Thanks,
> Conor.
Emil Renner Berthing March 28, 2024, 12:45 p.m. UTC | #4
Jisheng Zhang wrote:
> On Wed, Mar 27, 2024 at 06:06:58PM +0000, Conor Dooley wrote:
> > Yo,
> >
> > On Tue, Feb 06, 2024 at 07:13:48PM +0000, Conor Dooley wrote:
> > > On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> > > > The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> > > > The board features:
> > > >
> > > > - JH7110 SoC
> > > > - 1/2/4/8 GiB LPDDR4 DRAM
> > > > - AXP15060 PMIC
> > > > - 40 pin GPIO header
> > > > - 3x USB 3.0 host port
> > > > - 1x USB 2.0 host port
> > > > - 1x M.2 E-Key
> > > > - 1x eMMC slot
> > > > - 1x MicroSD slot
> > > > - 1x QSPI Flash
> > > > - 1x 1Gbps Ethernet port
> > > > - 1x HDMI port
> > > > - 1x 2-lane DSI and 1x 4-lane DSI
> > > > - 1x 2-lane CSI
> > > >
> > > > Add the devicetree file describing the currently supported features,
> > > > namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> > > >
> > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > >
> > > Got a dtbs_check issue in the patchwork CI:
> > >
> > >   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
> > >   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > >   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
> > >   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > >
> > > Can you fix that please? Also, I applied some patches the other day that
> > > seem to conflict quite a bit with the common board dts patch. Would you
> > > please do a rebase on top of that please?
> >
> > Been going through stuff on my todo list now that the merge window is
> > closed. Could you please resend this with the rebase done?
>
> Thanks for the reminding, I will rebase on 6.9-rc1 then send out the
> patches.

Hi Jisheng,

A rebase would be great. It looks good to me, but could you maybe call the
common .dtsi something more generic like jh7110-common.dtsi like the
jh7100-common.dtsi. If we'll see other boards based on the jh7110 upstreamed
(eg. Star64) I suspect they'll also be heavily based on^M^M^M similar to the
VF2 schematics.

/Emil

>
> >
> > Thanks,
> > Conor.
>
>
Heinrich Schuchardt March 28, 2024, 9:28 p.m. UTC | #5
On 2/6/24 20:13, Conor Dooley wrote:
> On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
>> The Milkv Mars is a development board based on the Starfive JH7110 SoC.
>> The board features:
>>
>> - JH7110 SoC
>> - 1/2/4/8 GiB LPDDR4 DRAM
>> - AXP15060 PMIC
>> - 40 pin GPIO header
>> - 3x USB 3.0 host port
>> - 1x USB 2.0 host port
>> - 1x M.2 E-Key
>> - 1x eMMC slot
>> - 1x MicroSD slot
>> - 1x QSPI Flash
>> - 1x 1Gbps Ethernet port
>> - 1x HDMI port
>> - 1x 2-lane DSI and 1x 4-lane DSI
>> - 1x 2-lane CSI
>>
>> Add the devicetree file describing the currently supported features,
>> namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
>>
>> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> 
> Got a dtbs_check issue in the patchwork CI:
> 
>    +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
>    +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
>    +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
>    +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> 
> Can you fix that please? Also, I applied some patches the other day that
> seem to conflict quite a bit with the common board dts patch. Would you
> please do a rebase on top of that please?
> 
> Cheers,
> Conor.
> 
>> ---
>>   arch/riscv/boot/dts/starfive/Makefile         |  1 +
>>   .../boot/dts/starfive/jh7110-milkv-mars.dts   | 35 +++++++++++++++++++
>>   2 files changed, 36 insertions(+)
>>   create mode 100644 arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
>>
>> diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
>> index 0141504c0f5c..2fa0cd7f31c3 100644
>> --- a/arch/riscv/boot/dts/starfive/Makefile
>> +++ b/arch/riscv/boot/dts/starfive/Makefile
>> @@ -8,5 +8,6 @@ DTC_FLAGS_jh7110-starfive-visionfive-2-v1.3b := -@
>>   dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
>>   dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
>>   
>> +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-milkv-mars.dtb
>>   dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
>>   dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
>> diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
>> new file mode 100644
>> index 000000000000..de600e799e7d
>> --- /dev/null
>> +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
>> @@ -0,0 +1,35 @@
>> +// SPDX-License-Identifier: GPL-2.0 OR MIT
>> +/*
>> + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
>> + */
>> +
>> +/dts-v1/;
>> +#include "jh7110-visionfive2-mars-common.dtsi"
>> +
>> +/ {
>> +	model = "Milk-V Mars";
>> +	compatible = "milkv,mars", "starfive,jh7110";
>> +};
>> +
>> +&gmac0 {
>> +	starfive,tx-use-rgmii-clk;
>> +	assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
>> +	assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
>> +};
>> +
>> +
>> +&phy0 {
>> +	motorcomm,tx-clk-adj-enabled;
>> +	motorcomm,tx-clk-10-inverted;
>> +	motorcomm,tx-clk-100-inverted;
>> +	motorcomm,tx-clk-1000-inverted;
>> +	motorcomm,rx-clk-drv-microamp = <3970>;
>> +	motorcomm,rx-data-drv-microamp = <2910>;
>> +	rx-internal-delay-ps = <1500>;
>> +	tx-internal-delay-ps = <1500>;
>> +};
>> +
>> +&mmc1 {
>> +	disable-wp;

Due to which difference is 'disable-wp' necessary for the Mars board and 
not necessary for the VisionFive 2 board?

>> +	cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;

On my VisionFive 2 1.2B, and 1.3A boards GPIO 41 reflects if an SD-card 
is inserted (as shown in U-Boot by gpio status -a). So shouldn't this 
value be moved to the common include 
"jh7110-visionfive2-mars-common.dtsi" and broken-cd removed from the 
VisionFive2 board?

https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf
has a line

     GPIO41 | SD_SDIO0_CD_GPIO41 | Micro SD:J10

Best regards

Heinrich

>> +};
>> -- 
>> 2.43.0
Jisheng Zhang March 29, 2024, 2:31 a.m. UTC | #6
On Thu, Mar 28, 2024 at 10:28:28PM +0100, Heinrich Schuchardt wrote:
> On 2/6/24 20:13, Conor Dooley wrote:
> > On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> > > The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> > > The board features:
> > > 
> > > - JH7110 SoC
> > > - 1/2/4/8 GiB LPDDR4 DRAM
> > > - AXP15060 PMIC
> > > - 40 pin GPIO header
> > > - 3x USB 3.0 host port
> > > - 1x USB 2.0 host port
> > > - 1x M.2 E-Key
> > > - 1x eMMC slot
> > > - 1x MicroSD slot
> > > - 1x QSPI Flash
> > > - 1x 1Gbps Ethernet port
> > > - 1x HDMI port
> > > - 1x 2-lane DSI and 1x 4-lane DSI
> > > - 1x 2-lane CSI
> > > 
> > > Add the devicetree file describing the currently supported features,
> > > namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> > > 
> > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > 
> > Got a dtbs_check issue in the patchwork CI:
> > 
> >    +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
> >    +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> >    +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
> >    +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > 
> > Can you fix that please? Also, I applied some patches the other day that
> > seem to conflict quite a bit with the common board dts patch. Would you
> > please do a rebase on top of that please?
> > 
> > Cheers,
> > Conor.
> > 
> > > ---
> > >   arch/riscv/boot/dts/starfive/Makefile         |  1 +
> > >   .../boot/dts/starfive/jh7110-milkv-mars.dts   | 35 +++++++++++++++++++
> > >   2 files changed, 36 insertions(+)
> > >   create mode 100644 arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> > > 
> > > diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
> > > index 0141504c0f5c..2fa0cd7f31c3 100644
> > > --- a/arch/riscv/boot/dts/starfive/Makefile
> > > +++ b/arch/riscv/boot/dts/starfive/Makefile
> > > @@ -8,5 +8,6 @@ DTC_FLAGS_jh7110-starfive-visionfive-2-v1.3b := -@
> > >   dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
> > >   dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
> > > +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-milkv-mars.dtb
> > >   dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
> > >   dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
> > > diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> > > new file mode 100644
> > > index 000000000000..de600e799e7d
> > > --- /dev/null
> > > +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> > > @@ -0,0 +1,35 @@
> > > +// SPDX-License-Identifier: GPL-2.0 OR MIT
> > > +/*
> > > + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
> > > + */
> > > +
> > > +/dts-v1/;
> > > +#include "jh7110-visionfive2-mars-common.dtsi"
> > > +
> > > +/ {
> > > +	model = "Milk-V Mars";
> > > +	compatible = "milkv,mars", "starfive,jh7110";
> > > +};
> > > +
> > > +&gmac0 {
> > > +	starfive,tx-use-rgmii-clk;
> > > +	assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
> > > +	assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
> > > +};
> > > +
> > > +
> > > +&phy0 {
> > > +	motorcomm,tx-clk-adj-enabled;
> > > +	motorcomm,tx-clk-10-inverted;
> > > +	motorcomm,tx-clk-100-inverted;
> > > +	motorcomm,tx-clk-1000-inverted;
> > > +	motorcomm,rx-clk-drv-microamp = <3970>;
> > > +	motorcomm,rx-data-drv-microamp = <2910>;
> > > +	rx-internal-delay-ps = <1500>;
> > > +	tx-internal-delay-ps = <1500>;
> > > +};
> > > +
> > > +&mmc1 {
> > > +	disable-wp;
> 
> Due to which difference is 'disable-wp' necessary for the Mars board and not
> necessary for the VisionFive 2 board?

Mars doesn't have wp pin, but dunno vf2 case since I don't have a VF2
board ;)
> 
> > > +	cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
> 
> On my VisionFive 2 1.2B, and 1.3A boards GPIO 41 reflects if an SD-card is
> inserted (as shown in U-Boot by gpio status -a). So shouldn't this value be
> moved to the common include "jh7110-visionfive2-mars-common.dtsi" and
> broken-cd removed from the VisionFive2 board?

I tested the CD pin and can confirm it works on Mars, but I dunno whether
this works on VF2 since I have no VF2 board.
Could you please check whether it works or not on VF2?

> 
> https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf
> has a line
> 
>     GPIO41 | SD_SDIO0_CD_GPIO41 | Micro SD:J10
> 
> Best regards
> 
> Heinrich
> 
> > > +};
> > > -- 
> > > 2.43.0
>
Jisheng Zhang March 29, 2024, 2:32 a.m. UTC | #7
On Thu, Mar 28, 2024 at 05:45:21AM -0700, Emil Renner Berthing wrote:
> Jisheng Zhang wrote:
> > On Wed, Mar 27, 2024 at 06:06:58PM +0000, Conor Dooley wrote:
> > > Yo,
> > >
> > > On Tue, Feb 06, 2024 at 07:13:48PM +0000, Conor Dooley wrote:
> > > > On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> > > > > The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> > > > > The board features:
> > > > >
> > > > > - JH7110 SoC
> > > > > - 1/2/4/8 GiB LPDDR4 DRAM
> > > > > - AXP15060 PMIC
> > > > > - 40 pin GPIO header
> > > > > - 3x USB 3.0 host port
> > > > > - 1x USB 2.0 host port
> > > > > - 1x M.2 E-Key
> > > > > - 1x eMMC slot
> > > > > - 1x MicroSD slot
> > > > > - 1x QSPI Flash
> > > > > - 1x 1Gbps Ethernet port
> > > > > - 1x HDMI port
> > > > > - 1x 2-lane DSI and 1x 4-lane DSI
> > > > > - 1x 2-lane CSI
> > > > >
> > > > > Add the devicetree file describing the currently supported features,
> > > > > namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> > > > >
> > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > >
> > > > Got a dtbs_check issue in the patchwork CI:
> > > >
> > > >   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
> > > >   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > > >   +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
> > > >   +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > > >
> > > > Can you fix that please? Also, I applied some patches the other day that
> > > > seem to conflict quite a bit with the common board dts patch. Would you
> > > > please do a rebase on top of that please?
> > >
> > > Been going through stuff on my todo list now that the merge window is
> > > closed. Could you please resend this with the rebase done?
> >
> > Thanks for the reminding, I will rebase on 6.9-rc1 then send out the
> > patches.
> 
> Hi Jisheng,

Hi,

> 
> A rebase would be great. It looks good to me, but could you maybe call the
> common .dtsi something more generic like jh7110-common.dtsi like the
> jh7100-common.dtsi. If we'll see other boards based on the jh7110 upstreamed

make sense, will do in v4 series.

> (eg. Star64) I suspect they'll also be heavily based on^M^M^M similar to the
> VF2 schematics.
> 
> /Emil
> 
> >
> > >
> > > Thanks,
> > > Conor.
> >
> >
Heinrich Schuchardt April 1, 2024, 1:28 p.m. UTC | #8
On 3/29/24 03:31, Jisheng Zhang wrote:
> On Thu, Mar 28, 2024 at 10:28:28PM +0100, Heinrich Schuchardt wrote:
>> On 2/6/24 20:13, Conor Dooley wrote:
>>> On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
>>>> The Milkv Mars is a development board based on the Starfive JH7110 SoC.
>>>> The board features:
>>>>
>>>> - JH7110 SoC
>>>> - 1/2/4/8 GiB LPDDR4 DRAM
>>>> - AXP15060 PMIC
>>>> - 40 pin GPIO header
>>>> - 3x USB 3.0 host port
>>>> - 1x USB 2.0 host port
>>>> - 1x M.2 E-Key
>>>> - 1x eMMC slot
>>>> - 1x MicroSD slot
>>>> - 1x QSPI Flash
>>>> - 1x 1Gbps Ethernet port
>>>> - 1x HDMI port
>>>> - 1x 2-lane DSI and 1x 4-lane DSI
>>>> - 1x 2-lane CSI
>>>>
>>>> Add the devicetree file describing the currently supported features,
>>>> namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
>>>>
>>>> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
>>>
>>> Got a dtbs_check issue in the patchwork CI:
>>>
>>>     +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
>>>     +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
>>>     +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
>>>     +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
>>>
>>> Can you fix that please? Also, I applied some patches the other day that
>>> seem to conflict quite a bit with the common board dts patch. Would you
>>> please do a rebase on top of that please?
>>>
>>> Cheers,
>>> Conor.
>>>
>>>> ---
>>>>    arch/riscv/boot/dts/starfive/Makefile         |  1 +
>>>>    .../boot/dts/starfive/jh7110-milkv-mars.dts   | 35 +++++++++++++++++++
>>>>    2 files changed, 36 insertions(+)
>>>>    create mode 100644 arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
>>>>
>>>> diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
>>>> index 0141504c0f5c..2fa0cd7f31c3 100644
>>>> --- a/arch/riscv/boot/dts/starfive/Makefile
>>>> +++ b/arch/riscv/boot/dts/starfive/Makefile
>>>> @@ -8,5 +8,6 @@ DTC_FLAGS_jh7110-starfive-visionfive-2-v1.3b := -@
>>>>    dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
>>>>    dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
>>>> +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-milkv-mars.dtb
>>>>    dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
>>>>    dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
>>>> diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
>>>> new file mode 100644
>>>> index 000000000000..de600e799e7d
>>>> --- /dev/null
>>>> +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
>>>> @@ -0,0 +1,35 @@
>>>> +// SPDX-License-Identifier: GPL-2.0 OR MIT
>>>> +/*
>>>> + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
>>>> + */
>>>> +
>>>> +/dts-v1/;
>>>> +#include "jh7110-visionfive2-mars-common.dtsi"
>>>> +
>>>> +/ {
>>>> +	model = "Milk-V Mars";
>>>> +	compatible = "milkv,mars", "starfive,jh7110";
>>>> +};
>>>> +
>>>> +&gmac0 {
>>>> +	starfive,tx-use-rgmii-clk;
>>>> +	assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
>>>> +	assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
>>>> +};
>>>> +
>>>> +
>>>> +&phy0 {
>>>> +	motorcomm,tx-clk-adj-enabled;
>>>> +	motorcomm,tx-clk-10-inverted;
>>>> +	motorcomm,tx-clk-100-inverted;
>>>> +	motorcomm,tx-clk-1000-inverted;
>>>> +	motorcomm,rx-clk-drv-microamp = <3970>;
>>>> +	motorcomm,rx-data-drv-microamp = <2910>;
>>>> +	rx-internal-delay-ps = <1500>;
>>>> +	tx-internal-delay-ps = <1500>;
>>>> +};
>>>> +
>>>> +&mmc1 {
>>>> +	disable-wp;
>>
>> Due to which difference is 'disable-wp' necessary for the Mars board and not
>> necessary for the VisionFive 2 board?
> 
> Mars doesn't have wp pin, but dunno vf2 case since I don't have a VF2
> board ;)

If the Milk-V Mars does not have a WP GPIO, we should be able to drop 
this property. The VisionFive 2 does not need it either.

>>
>>>> +	cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
>>
>> On my VisionFive 2 1.2B, and 1.3A boards GPIO 41 reflects if an SD-card is
>> inserted (as shown in U-Boot by gpio status -a). So shouldn't this value be
>> moved to the common include "jh7110-visionfive2-mars-common.dtsi" and
>> broken-cd removed from the VisionFive2 board?
> 
> I tested the CD pin and can confirm it works on Mars, but I dunno whether
> this works on VF2 since I have no VF2 board.
> Could you please check whether it works or not on VF2?

As mentioned in my prior mail the card detect GPIO is working on the 
VisionFive 2. StarFive acknowledged my U-Boot patch:

https://lore.kernel.org/u-boot/SHXPR01MB086314C47C281B3DDDF7BAE9E63AA@SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn/

Best regards

Heinrich

> 
>>
>> https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf
>> has a line
>>
>>      GPIO41 | SD_SDIO0_CD_GPIO41 | Micro SD:J10
>>
>> Best regards
>>
>> Heinrich
>>
>>>> +};
>>>> -- 
>>>> 2.43.0
>>
Jisheng Zhang April 1, 2024, 2:44 p.m. UTC | #9
On Mon, Apr 01, 2024 at 03:28:33PM +0200, Heinrich Schuchardt wrote:
> On 3/29/24 03:31, Jisheng Zhang wrote:
> > On Thu, Mar 28, 2024 at 10:28:28PM +0100, Heinrich Schuchardt wrote:
> > > On 2/6/24 20:13, Conor Dooley wrote:
> > > > On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> > > > > The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> > > > > The board features:
> > > > > 
> > > > > - JH7110 SoC
> > > > > - 1/2/4/8 GiB LPDDR4 DRAM
> > > > > - AXP15060 PMIC
> > > > > - 40 pin GPIO header
> > > > > - 3x USB 3.0 host port
> > > > > - 1x USB 2.0 host port
> > > > > - 1x M.2 E-Key
> > > > > - 1x eMMC slot
> > > > > - 1x MicroSD slot
> > > > > - 1x QSPI Flash
> > > > > - 1x 1Gbps Ethernet port
> > > > > - 1x HDMI port
> > > > > - 1x 2-lane DSI and 1x 4-lane DSI
> > > > > - 1x 2-lane CSI
> > > > > 
> > > > > Add the devicetree file describing the currently supported features,
> > > > > namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> > > > > 
> > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > > 
> > > > Got a dtbs_check issue in the patchwork CI:
> > > > 
> > > >     +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rgmii-rxin-clock: 'clock-frequency' is a required property
> > > >     +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > > >     +arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dtb: gmac1-rmii-refin-clock: 'clock-frequency' is a required property
> > > >     +	from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml#
> > > > 
> > > > Can you fix that please? Also, I applied some patches the other day that
> > > > seem to conflict quite a bit with the common board dts patch. Would you
> > > > please do a rebase on top of that please?
> > > > 
> > > > Cheers,
> > > > Conor.
> > > > 
> > > > > ---
> > > > >    arch/riscv/boot/dts/starfive/Makefile         |  1 +
> > > > >    .../boot/dts/starfive/jh7110-milkv-mars.dts   | 35 +++++++++++++++++++
> > > > >    2 files changed, 36 insertions(+)
> > > > >    create mode 100644 arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> > > > > 
> > > > > diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
> > > > > index 0141504c0f5c..2fa0cd7f31c3 100644
> > > > > --- a/arch/riscv/boot/dts/starfive/Makefile
> > > > > +++ b/arch/riscv/boot/dts/starfive/Makefile
> > > > > @@ -8,5 +8,6 @@ DTC_FLAGS_jh7110-starfive-visionfive-2-v1.3b := -@
> > > > >    dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
> > > > >    dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
> > > > > +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-milkv-mars.dtb
> > > > >    dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
> > > > >    dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
> > > > > diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> > > > > new file mode 100644
> > > > > index 000000000000..de600e799e7d
> > > > > --- /dev/null
> > > > > +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
> > > > > @@ -0,0 +1,35 @@
> > > > > +// SPDX-License-Identifier: GPL-2.0 OR MIT
> > > > > +/*
> > > > > + * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
> > > > > + */
> > > > > +
> > > > > +/dts-v1/;
> > > > > +#include "jh7110-visionfive2-mars-common.dtsi"
> > > > > +
> > > > > +/ {
> > > > > +	model = "Milk-V Mars";
> > > > > +	compatible = "milkv,mars", "starfive,jh7110";
> > > > > +};
> > > > > +
> > > > > +&gmac0 {
> > > > > +	starfive,tx-use-rgmii-clk;
> > > > > +	assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
> > > > > +	assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
> > > > > +};
> > > > > +
> > > > > +
> > > > > +&phy0 {
> > > > > +	motorcomm,tx-clk-adj-enabled;
> > > > > +	motorcomm,tx-clk-10-inverted;
> > > > > +	motorcomm,tx-clk-100-inverted;
> > > > > +	motorcomm,tx-clk-1000-inverted;
> > > > > +	motorcomm,rx-clk-drv-microamp = <3970>;
> > > > > +	motorcomm,rx-data-drv-microamp = <2910>;
> > > > > +	rx-internal-delay-ps = <1500>;
> > > > > +	tx-internal-delay-ps = <1500>;
> > > > > +};
> > > > > +
> > > > > +&mmc1 {
> > > > > +	disable-wp;
> > > 
> > > Due to which difference is 'disable-wp' necessary for the Mars board and not
> > > necessary for the VisionFive 2 board?
> > 
> > Mars doesn't have wp pin, but dunno vf2 case since I don't have a VF2
> > board ;)
> 
> If the Milk-V Mars does not have a WP GPIO, we should be able to drop this
> property. The VisionFive 2 does not need it either.

Nope, dropping this property would result in RO sdcard on vf2.
> 
> > > 
> > > > > +	cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
> > > 
> > > On my VisionFive 2 1.2B, and 1.3A boards GPIO 41 reflects if an SD-card is
> > > inserted (as shown in U-Boot by gpio status -a). So shouldn't this value be
> > > moved to the common include "jh7110-visionfive2-mars-common.dtsi" and
> > > broken-cd removed from the VisionFive2 board?
> > 
> > I tested the CD pin and can confirm it works on Mars, but I dunno whether
> > this works on VF2 since I have no VF2 board.
> > Could you please check whether it works or not on VF2?
> 
> As mentioned in my prior mail the card detect GPIO is working on the
> VisionFive 2. StarFive acknowledged my U-Boot patch:
> 
> https://lore.kernel.org/u-boot/SHXPR01MB086314C47C281B3DDDF7BAE9E63AA@SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn/

Thanks for confirmation.

> 
> Best regards
> 
> Heinrich
> 
> > 
> > > 
> > > https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf
> > > has a line
> > > 
> > >      GPIO41 | SD_SDIO0_CD_GPIO41 | Micro SD:J10
> > > 
> > > Best regards
> > > 
> > > Heinrich
> > > 
> > > > > +};
> > > > > -- 
> > > > > 2.43.0
> > > 
>
Emil Renner Berthing April 19, 2024, 10:11 p.m. UTC | #10
Jisheng Zhang wrote:
> On Mon, Apr 01, 2024 at 03:28:33PM +0200, Heinrich Schuchardt wrote:
> > On 3/29/24 03:31, Jisheng Zhang wrote:
> > > On Thu, Mar 28, 2024 at 10:28:28PM +0100, Heinrich Schuchardt wrote:
> > > > On 2/6/24 20:13, Conor Dooley wrote:
> > > > > On Wed, Jan 31, 2024 at 09:26:00PM +0800, Jisheng Zhang wrote:
> > > > > > The Milkv Mars is a development board based on the Starfive JH7110 SoC.
> > > > > > The board features:
> > > > > >
> > > > > > - JH7110 SoC
> > > > > > - 1/2/4/8 GiB LPDDR4 DRAM
> > > > > > - AXP15060 PMIC
> > > > > > - 40 pin GPIO header
> > > > > > - 3x USB 3.0 host port
> > > > > > - 1x USB 2.0 host port
> > > > > > - 1x M.2 E-Key
> > > > > > - 1x eMMC slot
> > > > > > - 1x MicroSD slot
> > > > > > - 1x QSPI Flash
> > > > > > - 1x 1Gbps Ethernet port
> > > > > > - 1x HDMI port
> > > > > > - 1x 2-lane DSI and 1x 4-lane DSI
> > > > > > - 1x 2-lane CSI
> > > > > >
> > > > > > Add the devicetree file describing the currently supported features,
> > > > > > namely PMIC, UART, I2C, GPIO, SD card, QSPI Flash, eMMC and Ethernet.
> > > > > >
> > > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
...
> > > > > > +
> > > > > > +&mmc1 {
> > > > > > +	disable-wp;
> > > >
> > > > Due to which difference is 'disable-wp' necessary for the Mars board and not
> > > > necessary for the VisionFive 2 board?
> > >
> > > Mars doesn't have wp pin, but dunno vf2 case since I don't have a VF2
> > > board ;)

The schematic is available here:
https://doc-en.rvspace.org/VisionFive2/PDF/RV002_V1.3B_20230208.PDF

> >
> > If the Milk-V Mars does not have a WP GPIO, we should be able to drop this
> > property. The VisionFive 2 does not need it either.
>
> Nope, dropping this property would result in RO sdcard on vf2.
> >
> > > >
> > > > > > +	cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
> > > >
> > > > On my VisionFive 2 1.2B, and 1.3A boards GPIO 41 reflects if an SD-card is
> > > > inserted (as shown in U-Boot by gpio status -a). So shouldn't this value be
> > > > moved to the common include "jh7110-visionfive2-mars-common.dtsi" and
> > > > broken-cd removed from the VisionFive2 board?
> > >
> > > I tested the CD pin and can confirm it works on Mars, but I dunno whether
> > > this works on VF2 since I have no VF2 board.
> > > Could you please check whether it works or not on VF2?
> >
> > As mentioned in my prior mail the card detect GPIO is working on the
> > VisionFive 2. StarFive acknowledged my U-Boot patch:
> >
> > https://lore.kernel.org/u-boot/SHXPR01MB086314C47C281B3DDDF7BAE9E63AA@SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn/
>
> Thanks for confirmation.

Actually comparing the schematic for the VF2 above and the Mars board[1] I
don't see any differences in how the SD-card is connected, so if I'm right the
mmc1 node could be fully defined in the jh7110-common.dtsi.

[1]: https://github.com/milkv-mars/mars-files/blob/main/Mars_hardware_schematics/Mars_V1.11_20230821.pdf

/Emil

>
> >
> > Best regards
> >
> > Heinrich
> >
> > >
> > > >
> > > > https://doc-en.rvspace.org/VisionFive2/PDF/SCH_RV002_V1.2A_20221216.pdf
> > > > has a line
> > > >
> > > >      GPIO41 | SD_SDIO0_CD_GPIO41 | Micro SD:J10
> > > >
> > > > Best regards
> > > >
> > > > Heinrich
> > > >
> > > > > > +};
> > > > > > --
> > > > > > 2.43.0
> > > >
> >
diff mbox series

Patch

diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile
index 0141504c0f5c..2fa0cd7f31c3 100644
--- a/arch/riscv/boot/dts/starfive/Makefile
+++ b/arch/riscv/boot/dts/starfive/Makefile
@@ -8,5 +8,6 @@  DTC_FLAGS_jh7110-starfive-visionfive-2-v1.3b := -@
 dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb
 dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb
 
+dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-milkv-mars.dtb
 dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb
 dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb
diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
new file mode 100644
index 000000000000..de600e799e7d
--- /dev/null
+++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts
@@ -0,0 +1,35 @@ 
+// SPDX-License-Identifier: GPL-2.0 OR MIT
+/*
+ * Copyright (C) 2023 Jisheng Zhang <jszhang@kernel.org>
+ */
+
+/dts-v1/;
+#include "jh7110-visionfive2-mars-common.dtsi"
+
+/ {
+	model = "Milk-V Mars";
+	compatible = "milkv,mars", "starfive,jh7110";
+};
+
+&gmac0 {
+	starfive,tx-use-rgmii-clk;
+	assigned-clocks = <&aoncrg JH7110_AONCLK_GMAC0_TX>;
+	assigned-clock-parents = <&aoncrg JH7110_AONCLK_GMAC0_RMII_RTX>;
+};
+
+
+&phy0 {
+	motorcomm,tx-clk-adj-enabled;
+	motorcomm,tx-clk-10-inverted;
+	motorcomm,tx-clk-100-inverted;
+	motorcomm,tx-clk-1000-inverted;
+	motorcomm,rx-clk-drv-microamp = <3970>;
+	motorcomm,rx-data-drv-microamp = <2910>;
+	rx-internal-delay-ps = <1500>;
+	tx-internal-delay-ps = <1500>;
+};
+
+&mmc1 {
+	disable-wp;
+	cd-gpios = <&sysgpio 41 GPIO_ACTIVE_LOW>;
+};