From 266036e66782067016b5313149d3981a3ec423e9 Mon Sep 17 00:00:00 2001 From: aiamadeus <2789289348@qq.com> Date: Tue, 6 Jun 2023 23:21:35 +0800 Subject: [PATCH] rockchip: add h68k/h69k hardware v3 support --- .../armv8/base-files/etc/board.d/01_leds | 4 +- .../armv8/base-files/etc/board.d/02_network | 7 +-- .../boot/dts/rockchip/rk3568-opc-h68k.dts | 10 ++-- .../boot/dts/rockchip/rk3568-opc-h69k.dts | 37 +----------- target/linux/rockchip/image/armv8.mk | 60 +++++++++---------- 5 files changed, 42 insertions(+), 76 deletions(-) diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds index 6f669c939..340beeaa8 100755 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds @@ -32,10 +32,12 @@ friendlyarm,nanopi-r5s) ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth2" ;; hinlink,opc-h66k|\ -hinlink,opc-h68k|\ hinlink,opc-h69k) ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth0" ;; +hinlink,opc-h68k) + ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth1" + ;; esac board_config_flush diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index bdc2eb2a6..2a2f60b37 100755 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -24,20 +24,18 @@ rockchip_setup_interfaces() xunlong,orangepi-r1-plus-lts) ucidef_set_interfaces_lan_wan 'eth1' 'eth0' ;; - hinlink,opc-h68k|\ - hinlink,opc-h69k) - ucidef_set_interfaces_lan_wan 'eth1 eth2 eth3' 'eth0' - ;; fastrhino,r66s|\ firefly,rk3568-roc-pc|\ friendlyarm,nanopi-r5c|\ radxa,e25) ucidef_set_interfaces_lan_wan 'eth0' 'eth1' ;; + hinlink,opc-h68k|\ fastrhino,r68s|\ lyt,t68m) ucidef_set_interfaces_lan_wan 'eth0 eth2 eth3' 'eth1' ;; + hinlink,opc-h69k|\ friendlyarm,nanopi-r5s) ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0" ;; @@ -101,7 +99,6 @@ rockchip_setup_macs() ;; friendlyarm,nanopi-r5c|\ friendlyarm,nanopi-r5s|\ - panther,x2|\ sharevdi,guangmiao-g4c) wan_mac=$(macaddr_generate_from_mmc_cid mmcblk1) lan_mac=$(macaddr_add "$wan_mac" +1) diff --git a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h68k.dts b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h68k.dts index 4fee21580..befa4ee8d 100644 --- a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h68k.dts +++ b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h68k.dts @@ -58,17 +58,15 @@ }; &mdio0 { - rgmii_phy0: phy@0 { - compatible = "ethernet-phy-id001c.c916", - "ethernet-phy-ieee802.3-c22"; + rgmii_phy0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; reg = <0x0>; }; }; &mdio1 { - rgmii_phy1: phy@0 { - compatible = "ethernet-phy-id001c.c916", - "ethernet-phy-ieee802.3-c22"; + rgmii_phy1: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; reg = <0x0>; }; }; diff --git a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h69k.dts b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h69k.dts index b3d7113d4..2233a1256 100644 --- a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h69k.dts +++ b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-opc-h69k.dts @@ -10,8 +10,7 @@ compatible = "hinlink,opc-h69k", "rockchip,rk3568"; aliases { - ethernet0 = &gmac0; - ethernet1 = &gmac1; + ethernet0 = &gmac1; }; vcc5v0_ahci: vcc5v0-ahci { @@ -28,27 +27,6 @@ }; }; -&gmac0 { - assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; - assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>; - assigned-clock-rates = <0>, <125000000>; - clock_in_out = "output"; - phy-mode = "rgmii-id"; - pinctrl-names = "default"; - pinctrl-0 = <&gmac0_miim - &gmac0_tx_bus2 - &gmac0_rx_bus2 - &gmac0_rgmii_clk - &gmac0_rgmii_bus>; - snps,reset-gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>; - snps,reset-active-low; - snps,reset-delays-us = <0 20000 100000>; - tx_delay = <0x3c>; - rx_delay = <0x2f>; - phy-handle = <&rgmii_phy0>; - status = "okay"; -}; - &gmac1 { assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>; assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>; @@ -70,18 +48,9 @@ status = "okay"; }; -&mdio0 { - rgmii_phy0: phy@0 { - compatible = "ethernet-phy-id001c.c916", - "ethernet-phy-ieee802.3-c22"; - reg = <0x0>; - }; -}; - &mdio1 { - rgmii_phy1: phy@0 { - compatible = "ethernet-phy-id001c.c916", - "ethernet-phy-ieee802.3-c22"; + rgmii_phy1: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; reg = <0x0>; }; }; diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index 9ccfe0e18..b26e380f4 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -52,35 +52,6 @@ define Device/ezpro_mrkaio-m68s-plus endef TARGET_DEVICES += ezpro_mrkaio-m68s-plus -define Device/hinlink_common - DEVICE_VENDOR := HINLINK - UBOOT_DEVICE_NAME := opc-h68k-rk3568 - IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata - DEVICE_PACKAGES := kmod-ata-ahci-platform kmod-hwmon-pwmfan kmod-mt7921e kmod-r8125 wpad-openssl -endef - -define Device/hinlink_opc-h66k -$(call Device/hinlink_common) - DEVICE_MODEL := OPC-H66K - SOC := rk3568 -endef -TARGET_DEVICES += hinlink_opc-h66k - -define Device/hinlink_opc-h68k -$(call Device/hinlink_common) - DEVICE_MODEL := OPC-H68K - SOC := rk3568 -endef -TARGET_DEVICES += hinlink_opc-h68k - -define Device/hinlink_opc-h69k -$(call Device/hinlink_common) - DEVICE_MODEL := OPC-H69K - SOC := rk3568 - DEVICE_PACKAGES += kmod-usb-serial-option uqmi -endef -TARGET_DEVICES += hinlink_opc-h69k - define Device/fastrhino_common DEVICE_VENDOR := FastRhino SOC := rk3568 @@ -180,13 +151,42 @@ define Device/firefly_station-p2 endef TARGET_DEVICES += firefly_station-p2 +define Device/hinlink_common + DEVICE_VENDOR := HINLINK + UBOOT_DEVICE_NAME := opc-h68k-rk3568 + IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-ata-ahci-platform kmod-hwmon-pwmfan kmod-mt7921e kmod-r8125 wpad-openssl +endef + +define Device/hinlink_opc-h66k +$(call Device/hinlink_common) + DEVICE_MODEL := OPC-H66K + SOC := rk3568 +endef +TARGET_DEVICES += hinlink_opc-h66k + +define Device/hinlink_opc-h68k +$(call Device/hinlink_common) + DEVICE_MODEL := OPC-H68K + SOC := rk3568 +endef +TARGET_DEVICES += hinlink_opc-h68k + +define Device/hinlink_opc-h69k +$(call Device/hinlink_common) + DEVICE_MODEL := OPC-H69K + SOC := rk3568 + DEVICE_PACKAGES += kmod-mt7916-firmware kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += hinlink_opc-h69k + define Device/lyt_t68m DEVICE_VENDOR := LYT DEVICE_MODEL := T68M SOC := rk3568 UBOOT_DEVICE_NAME := lyt-t68m-rk3568 IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata - DEVICE_PACKAGES := kmod-r8125 wpad-openssl kmod-mt7921-firmware kmod-mt7922-firmware kmod-mt7921e kmod-mt7916-firmware + DEVICE_PACKAGES := kmod-mt7921e kmod-r8125 wpad-openssl endef TARGET_DEVICES += lyt_t68m