From 4d5770a6cfc8faf9ee1b229c495fd33788d82c85 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Fri, 25 Feb 2022 23:06:02 +0800 Subject: [PATCH] ipq807x: zte mf269: optimize related code Since this part will not be accepted by upstream. --- .../ipq807x/base-files/etc/board.d/02_network | 24 ++++++++-- .../arm64/boot/dts/qcom/ipq8071-mf269.dts | 48 +------------------ 2 files changed, 22 insertions(+), 50 deletions(-) mode change 100755 => 100644 target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/ipq807x/base-files/etc/board.d/02_network index 43329eade..93421fbb8 100644 --- a/target/linux/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/ipq807x/base-files/etc/board.d/02_network @@ -16,9 +16,6 @@ ipq807x_setup_interfaces() ;; zte,mf269) ucidef_set_interfaces_lan_wan "eth0" "eth1" - hw_mac_addr=$(mtd_get_mac_binary "mac" 0x0) - ucidef_set_interface_macaddr "wan" "$hw_mac_addr" - ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 1)" ;; *) echo "Unsupported hardware. Network interfaces not initialized" @@ -26,9 +23,30 @@ ipq807x_setup_interfaces() esac } +ipq807x_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + local label_mac="" + + case "$board" in + zte,mf269) + wan_mac=$(mtd_get_mac_binary mac 0x0) + lan_mac=$(macaddr_add "$wan_mac" 1) + label_mac=$wan_mac + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac + [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac +} + board_config_update board=$(board_name) ipq807x_setup_interfaces $board +ipq807x_setup_macs $board board_config_flush exit 0 diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts old mode 100755 new mode 100644 index 4f6eac40d..62a57cfe5 --- a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts +++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts @@ -106,42 +106,6 @@ }; }; -/* -&blsp1_spi6 { - status = "okay"; - pinctrl-0 = <&spi_5_pins>; - pinctrl-names = "default"; - cs-select = <0>; - - si3217x@0 { - compatible = "si3217x"; - num_slic = <1>; - reg = <0>; - spi-cpha; - spi-cpol; - spi-max-frequency = <960000>; - pinctrl-0 = <&slic_ctl_pins>; - pinctrl-names = "default"; - ctl-gpio = <&tlmm 57 0>; - rst-gpio = <&tlmm 58 0>; - irq-gpio = <&tlmm 59 0>; - }; -}; - -&blsp1_i2c5 { - status = "okay"; - - pinctrl-0 = <&i2c_4_pins>; - pinctrl-names = "default"; - - aw9106b@5b { - compatible = "aw9106b"; - reg = <0x5b>; - reset-gpio = <&tlmm 54 0>; - }; -}; -*/ - &blsp1_uart5 { status = "okay"; }; @@ -559,20 +523,10 @@ output-high; }; }; - - usb_cc_pins: usb_cc_pins { - mux { - pins = "gpio47", "gpio48"; - function = "gpio"; - drive-strength = <8>; - bias-disable; - output-high; - }; - }; }; &usb_0 { - pinctrl-0 = <&usb_vbus_pins &usb_cc_pins>; + pinctrl-0 = <&usb_vbus_pins>; pinctrl-names = "default"; status = "okay"; };