From 5e54a854d05719a41810bbbe59dd6b165da89d59 Mon Sep 17 00:00:00 2001 From: orangepi-xunlong <258384131@qq.com> Date: Thu, 27 Jul 2023 20:06:17 +0800 Subject: [PATCH] Update for opizero2w --- .../kernel/linux-sun50iw9-current.config | 4 +- .../orangepi/orangepi-hardware-optimization | 13 ++++ .../bin/dts/orangepizero2w-u-boot-current.dts | 66 ++++++++++++------- .../sys_config/sys_config_orangepizero2w.fex | 2 +- 4 files changed, 58 insertions(+), 27 deletions(-) diff --git a/external/config/kernel/linux-sun50iw9-current.config b/external/config/kernel/linux-sun50iw9-current.config index cf6c966..139f5dc 100644 --- a/external/config/kernel/linux-sun50iw9-current.config +++ b/external/config/kernel/linux-sun50iw9-current.config @@ -2577,7 +2577,7 @@ CONFIG_KEYBOARD_SUN4I_LRADC=y # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_CAP11XX is not set # CONFIG_KEYBOARD_BCM is not set -CONFIG_KEYBOARD_SUNXI=m +CONFIG_KEYBOARD_SUNXI=y CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_PS2_ALPS=y @@ -2780,7 +2780,7 @@ CONFIG_INPUT_SENSOR=y # CONFIG_SENSORS_SC7A20 is not set # CONFIG_SENSORS_MIR3DA is not set # CONFIG_STK3X1X is not set -# CONFIG_SUNXI_GPADC is not set +CONFIG_SUNXI_GPADC=y # # Hardware I/O ports diff --git a/external/packages/bsp/common/usr/lib/orangepi/orangepi-hardware-optimization b/external/packages/bsp/common/usr/lib/orangepi/orangepi-hardware-optimization index 4ad4278..83927df 100755 --- a/external/packages/bsp/common/usr/lib/orangepi/orangepi-hardware-optimization +++ b/external/packages/bsp/common/usr/lib/orangepi/orangepi-hardware-optimization @@ -185,6 +185,19 @@ prepare_board() { # aplay /usr/share/sounds/alsa/mute.wav -D hw:0,0 > /dev/null 2>&1 #fi + if [[ $BOARD == orangepizero2w ]]; then + + interface_100m="eth0" + echo netdev > /sys/class/leds/100m_act/trigger + echo "${interface_100m}" > /sys/class/leds/100m_act/device_name + echo 1 > /sys/class/leds/100m_act/tx + echo 1 > /sys/class/leds/100m_act/rx + + echo netdev > /sys/class/leds/100m_link/trigger + echo ${interface_100m} > /sys/class/leds/100m_link/device_name + echo 1 > /sys/class/leds/100m_link/link + fi + if [[ $BOARD == orangepir1b ]]; then #for 100m interface diff --git a/external/packages/pack-uboot/sun50iw9/bin/dts/orangepizero2w-u-boot-current.dts b/external/packages/pack-uboot/sun50iw9/bin/dts/orangepizero2w-u-boot-current.dts index 82a5bd6..6357047 100644 --- a/external/packages/pack-uboot/sun50iw9/bin/dts/orangepizero2w-u-boot-current.dts +++ b/external/packages/pack-uboot/sun50iw9/bin/dts/orangepizero2w-u-boot-current.dts @@ -766,9 +766,9 @@ ac200 { compatible = "allwinner,sunxi-ac200"; - status = "disabled"; - tv_used = <0x0>; - tv_twi_used = <0x0>; + status = "okay"; + tv_used = <0x1>; + tv_twi_used = <0x1>; tv_twi_id = <0x3>; tv_twi_addr = <0x10>; tv_pwm_ch = <0x5>; @@ -1149,20 +1149,17 @@ }; gmac1@0 { - allwinner,pins = "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9"; - allwinner,function = "gmac1"; - allwinner,muxsel = <0x2>; - allwinner,drive = <0x3>; - allwinner,pull = <0x0>; + pins = "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9"; + function = "gmac1"; + drive-strength = <10>; + bias-pull-up; phandle = <0x60>; }; gmac1@1 { - allwinner,pins = "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9"; - allwinner,function = "gpio_in"; - allwinner,muxsel = <0x0>; - allwinner,drive = <0x3>; - allwinner,pull = <0x0>; + pins = "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9"; + function = "gpio_in"; + drive-strength = <10>; phandle = <0x61>; }; @@ -1914,9 +1911,6 @@ pinctrl-names = "default", "sleep"; pinctrl-0 = <0x42 0x43>; pinctrl-1 = <0x44>; - spi1_cs_number = <0x1>; - spi1_cs_bitmap = <0x1>; - /*spi_dbi_enable = <0x0>;*/ phandle = <0xa9>; spi_board0 { @@ -1988,17 +1982,18 @@ clocks = <0x2 0x58>; clock-names = "bus"; resets = <0x2 0x22>; - status = "disabled"; + status = "okay"; phandle = <0xab>; }; keyboard@5070800 { compatible = "allwinner,keyboard_1350mv"; reg = <0x0 0x5070800 0x0 0x400>; - interrupts = <0x0 0x14 0x1>; + interrupts = <0x0 0x14 0x0>; clocks = <0x2 0x74>; - resets = <0x2 0x35>; - status = "disabled"; + key_cnt = <1>; + key0 = <1800 139>; + status = "okay"; phandle = <0xac>; }; @@ -2357,11 +2352,35 @@ compatible = "gpio-leds"; status = "okay"; - led-green { - label = "green_led"; + status { + label = "status_led"; gpios = <0x23 0x2 0xd 0x0>; /* PC13 */ linux,default-trigger = "heartbeat"; }; + + 100m_link { + label = "100m_link"; + gpios = <0x23 0x2 0xc 0x0>; /* PC12 */ + default-state = "off"; + }; + + 100m_act { + label = "100m_act"; + gpios = <0x23 0x2 0xe 0x0>; /* PC14 */ + default-state = "off"; + }; + + led12 { + label = "led12"; + gpios = <0x23 0x2 0xf 0x0>; /* PC15 */ + linux,default-trigger = "heartbeat"; + }; + + led34 { + label = "led34"; + gpios = <0x23 0x2 0x10 0x0>; /* PC16 */ + linux,default-trigger = "heartbeat"; + }; }; gpio_para { @@ -2412,7 +2431,7 @@ gmac-power0; gmac-power1; gmac-power2; - status = "disabled"; + status = "okay"; pinctrl-0 = <0x60>; pinctrl-1 = <0x61>; pinctrl-names = "default", "sleep"; @@ -2965,7 +2984,6 @@ regulator-min-microvolt = <0x4c4b40>; regulator-max-microvolt = <0x4c4b40>; regulator-enable-ramp-delay = <0x3e8>; - gpio = <0x23 0x2 0x10 0x0>; enable-active-high; phandle = <0x62>; }; diff --git a/external/packages/pack-uboot/sun50iw9/bin/sys_config/sys_config_orangepizero2w.fex b/external/packages/pack-uboot/sun50iw9/bin/sys_config/sys_config_orangepizero2w.fex index c2a4ae5..947c9d0 100755 --- a/external/packages/pack-uboot/sun50iw9/bin/sys_config/sys_config_orangepizero2w.fex +++ b/external/packages/pack-uboot/sun50iw9/bin/sys_config/sys_config_orangepizero2w.fex @@ -6,7 +6,7 @@ [product] version = "100" -machine = "orangepizero3" +machine = "orangepizero2w" [platform] eraseflag = 1