From: Joshua Milas <[email protected]>

This adds initial riscv support for the Milk-V Duo S board
[1] making it possible to boot Linux to the command line.

Link: https://milkv.io/duo-s [1]

Signed-off-by: Joshua Milas <[email protected]>
Link: https://milkv.io/duo-s [1]
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Inochi Amaoto <[email protected]> # Trim empty line
Signed-off-by: Chen Wang <[email protected]>

[ upstream commit: 66153532fb18474c83f9bcbb27b039c7788e664f ]

(cherry picked from commit 2b4cd02ed6873160a2c8be4cdaa0d63e92b52830)
---
 .../src/riscv/sophgo/sg2000-milkv-duo-s.dts        | 244 +++++++++++++++++++++
 1 file changed, 244 insertions(+)

diff --git a/dts/upstream/src/riscv/sophgo/sg2000-milkv-duo-s.dts 
b/dts/upstream/src/riscv/sophgo/sg2000-milkv-duo-s.dts
new file mode 100644
index 000000000000..78a257839f6f
--- /dev/null
+++ b/dts/upstream/src/riscv/sophgo/sg2000-milkv-duo-s.dts
@@ -0,0 +1,244 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/pinctrl/pinctrl-sg2000.h>
+#include "sg2000.dtsi"
+
+/ {
+       model = "Milk-V Duo S";
+       compatible = "milkv,duo-s", "sophgo,sg2000";
+
+       aliases {
+               i2c4 = &i2c4;
+               mmc0 = &sdhci0;
+               mmc1 = &emmc;
+               mmc2 = &sdhci1;
+               serial0 = &uart0;
+               serial4 = &uart4;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       wifi_pwrseq: wifi-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&porta 15 GPIO_ACTIVE_LOW>;
+               power-off-delay-us = <50000>;
+               post-power-on-delay-ms = <200>;
+       };
+};
+
+&osc {
+       clock-frequency = <25000000>;
+};
+
+&pinctrl {
+       emmc_cfg: emmc-cfg {
+               emmc-rstn-pins {
+                       pinmux = <PINMUX(PIN_EMMC_RSTN, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <1800>;
+               };
+
+               emmc-clk-pins {
+                       pinmux = <PINMUX(PIN_EMMC_CLK, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <1800>;
+               };
+
+               emmc-cmd-pins {
+                       pinmux = <PINMUX(PIN_EMMC_CMD, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <1800>;
+               };
+
+               emmc-data-pins {
+                       pinmux = <PINMUX(PIN_EMMC_DAT0, 0)>,
+                                <PINMUX(PIN_EMMC_DAT1, 0)>,
+                                <PINMUX(PIN_EMMC_DAT2, 0)>,
+                                <PINMUX(PIN_EMMC_DAT3, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <1800>;
+               };
+       };
+
+       i2c4_cfg: i2c4-cfg {
+               i2c4-pins {
+                       pinmux = <PINMUX(PIN_VIVO_D1, 7)>,
+                                <PINMUX(PIN_VIVO_D0, 7)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <4000>;
+                       power-source = <1800>;
+               };
+       };
+
+       sdhci0_cfg: sdhci0-cfg {
+               sdhci0-cd-pins {
+                       pinmux = <PINMUX(PIN_SD0_CD, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <3300>;
+               };
+
+               sdhci0-clk-pins {
+                       pinmux = <PINMUX(PIN_SD0_CLK, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <16100>;
+                       power-source = <3300>;
+               };
+
+               sdhci0-cmd-pins {
+                       pinmux = <PINMUX(PIN_SD0_CMD, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <3300>;
+               };
+
+               sdhci0-data-pins {
+                       pinmux = <PINMUX(PIN_SD0_D0, 0)>,
+                                <PINMUX(PIN_SD0_D1, 0)>,
+                                <PINMUX(PIN_SD0_D2, 0)>,
+                                <PINMUX(PIN_SD0_D3, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <3300>;
+               };
+       };
+
+       sdhci1_cfg: sdhci1-cfg {
+               sdhci1-clk-pins {
+                       pinmux = <PINMUX(PIN_MIPI_TXM4, 1)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <1800>;
+               };
+
+               sdhci1-cmd-pins {
+                       pinmux = <PINMUX(PIN_MIPI_TXP4, 1)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <1800>;
+               };
+
+               sdhci1-data-pins {
+                       pinmux = <PINMUX(PIN_MIPI_TXM3, 1)>,
+                                <PINMUX(PIN_MIPI_TXP3, 1)>,
+                                <PINMUX(PIN_MIPI_TXM2, 7)>,
+                                <PINMUX(PIN_MIPI_TXP2, 7)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <1800>;
+               };
+       };
+
+       uart0_cfg: uart0-cfg {
+               uart0-pins {
+                       pinmux = <PINMUX(PIN_UART0_TX, 0)>,
+                                <PINMUX(PIN_UART0_RX, 0)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <3300>;
+               };
+       };
+
+       uart4_cfg: uart4-cfg {
+               uart4-data-pins {
+                       pinmux = <PINMUX(PIN_UART2_TX, 5)>,
+                                <PINMUX(PIN_UART2_RX, 5)>;
+                       drive-strength-microamp = <10800>;
+                       power-source = <3300>;
+               };
+
+               uart4-control-pins {
+                       pinmux = <PINMUX(PIN_UART2_CTS, 5)>,
+                                <PINMUX(PIN_UART2_RTS, 5)>;
+                       bias-pull-up;
+                       drive-strength-microamp = <10800>;
+                       power-source = <3300>;
+               };
+       };
+};
+
+&dmac {
+       status = "okay";
+};
+
+&emmc {
+       bus-width = <4>;
+       no-1-8-v;
+       cap-mmc-hw-reset;
+       no-sd;
+       no-sdio;
+       non-removable;
+       pinctrl-0 = <&emmc_cfg>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&gmac0 {
+       status = "okay";
+};
+
+&i2c4 {
+       pinctrl-0 = <&i2c4_cfg>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&mdio {
+       status = "okay";
+};
+
+&saradc {
+       status = "okay";
+};
+
+&sdhci0 {
+       bus-width = <4>;
+       disable-wp;
+       no-1-8-v;
+       pinctrl-0 = <&sdhci0_cfg>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&sdhci1 {
+       bus-width = <4>;
+       cap-sdio-irq;
+       cap-sd-highspeed;
+       keep-power-in-suspend;
+       no-mmc;
+       no-sd;
+       non-removable;
+       max-frequency = <150000000>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       pinctrl-0 = <&sdhci1_cfg>;
+       pinctrl-names = "default";
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-0 = <&uart0_cfg>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+
+&uart4 {
+       pinctrl-0 = <&uart4_cfg>;
+       pinctrl-names = "default";
+       uart-has-rtscts;
+       status = "okay";
+};
+
+&usb {
+       dr_mode = "host";
+       status = "okay";
+};

-- 
2.53.0

Reply via email to