[PATCH net-next v6 3/5] riscv: dts: spacemit: Add Ethernet support for K1
Yixun Lan
dlan at gentoo.org
Mon Aug 25 16:32:17 PDT 2025
Hi Vivian,
On 14:47 Wed 20 Aug , Vivian Wang wrote:
> Add nodes for each of the two Ethernet MACs on K1 with generic
> properties. Also add "gmac" pins to pinctrl config.
>
> Signed-off-by: Vivian Wang <wangruikang at iscas.ac.cn>
Reviewed-by: Yixun Lan <dlan at gentoo.org>
> ---
> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 48 ++++++++++++++++++++++++++++
> arch/riscv/boot/dts/spacemit/k1.dtsi | 22 +++++++++++++
> 2 files changed, 70 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> index 3810557374228100be7adab58cd785c72e6d4aed..aff19c86d5ff381881016eaa87fc4809da65b50e 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> @@ -11,6 +11,54 @@
> #define K1_GPIO(x) (x / 32) (x % 32)
>
> &pinctrl {
> + gmac0_cfg: gmac0-cfg {
> + gmac0-pins {
> + pinmux = <K1_PADCONF(0, 1)>, /* gmac0_rxdv */
> + <K1_PADCONF(1, 1)>, /* gmac0_rx_d0 */
> + <K1_PADCONF(2, 1)>, /* gmac0_rx_d1 */
> + <K1_PADCONF(3, 1)>, /* gmac0_rx_clk */
> + <K1_PADCONF(4, 1)>, /* gmac0_rx_d2 */
> + <K1_PADCONF(5, 1)>, /* gmac0_rx_d3 */
> + <K1_PADCONF(6, 1)>, /* gmac0_tx_d0 */
> + <K1_PADCONF(7, 1)>, /* gmac0_tx_d1 */
> + <K1_PADCONF(8, 1)>, /* gmac0_tx */
> + <K1_PADCONF(9, 1)>, /* gmac0_tx_d2 */
> + <K1_PADCONF(10, 1)>, /* gmac0_tx_d3 */
> + <K1_PADCONF(11, 1)>, /* gmac0_tx_en */
> + <K1_PADCONF(12, 1)>, /* gmac0_mdc */
> + <K1_PADCONF(13, 1)>, /* gmac0_mdio */
> + <K1_PADCONF(14, 1)>, /* gmac0_int_n */
> + <K1_PADCONF(45, 1)>; /* gmac0_clk_ref */
> +
> + bias-pull-up = <0>;
> + drive-strength = <21>;
> + };
> + };
> +
> + gmac1_cfg: gmac1-cfg {
> + gmac1-pins {
> + pinmux = <K1_PADCONF(29, 1)>, /* gmac1_rxdv */
> + <K1_PADCONF(30, 1)>, /* gmac1_rx_d0 */
> + <K1_PADCONF(31, 1)>, /* gmac1_rx_d1 */
> + <K1_PADCONF(32, 1)>, /* gmac1_rx_clk */
> + <K1_PADCONF(33, 1)>, /* gmac1_rx_d2 */
> + <K1_PADCONF(34, 1)>, /* gmac1_rx_d3 */
> + <K1_PADCONF(35, 1)>, /* gmac1_tx_d0 */
> + <K1_PADCONF(36, 1)>, /* gmac1_tx_d1 */
> + <K1_PADCONF(37, 1)>, /* gmac1_tx */
> + <K1_PADCONF(38, 1)>, /* gmac1_tx_d2 */
> + <K1_PADCONF(39, 1)>, /* gmac1_tx_d3 */
> + <K1_PADCONF(40, 1)>, /* gmac1_tx_en */
> + <K1_PADCONF(41, 1)>, /* gmac1_mdc */
> + <K1_PADCONF(42, 1)>, /* gmac1_mdio */
> + <K1_PADCONF(43, 1)>, /* gmac1_int_n */
> + <K1_PADCONF(46, 1)>; /* gmac1_clk_ref */
> +
> + bias-pull-up = <0>;
> + drive-strength = <21>;
> + };
> + };
> +
> uart0_2_cfg: uart0-2-cfg {
> uart0-2-pins {
> pinmux = <K1_PADCONF(68, 2)>,
> diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> index abde8bb07c95c5a745736a2dd6f0c0e0d7c696e4..7b2ac3637d6d9fa1929418cc68aa25c57850ac7f 100644
> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
> @@ -805,6 +805,28 @@ network-bus {
> #size-cells = <2>;
> dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>,
> <0x0 0x80000000 0x1 0x00000000 0x0 0x80000000>;
> +
> + eth0: ethernet at cac80000 {
> + compatible = "spacemit,k1-emac";
> + reg = <0x0 0xcac80000 0x0 0x420>;
> + clocks = <&syscon_apmu CLK_EMAC0_BUS>;
> + interrupts = <131>;
> + mac-address = [ 00 00 00 00 00 00 ];
> + resets = <&syscon_apmu RESET_EMAC0>;
> + spacemit,apmu = <&syscon_apmu 0x3e4>;
> + status = "disabled";
> + };
> +
> + eth1: ethernet at cac81000 {
> + compatible = "spacemit,k1-emac";
> + reg = <0x0 0xcac81000 0x0 0x420>;
> + clocks = <&syscon_apmu CLK_EMAC1_BUS>;
> + interrupts = <133>;
> + mac-address = [ 00 00 00 00 00 00 ];
> + resets = <&syscon_apmu RESET_EMAC1>;
> + spacemit,apmu = <&syscon_apmu 0x3ec>;
> + status = "disabled";
> + };
> };
>
> pcie-bus {
>
> --
> 2.50.1
>
--
Yixun Lan (dlan)
More information about the linux-riscv
mailing list