Update for Orange Pi Zero2w

This commit is contained in:
orangepi-xunlong
2023-08-18 19:17:05 +08:00
parent 50d9ccad68
commit de53cf7b70
23 changed files with 134 additions and 56 deletions

View File

@@ -1,5 +1,10 @@
# Handle AXP power button with systemd
ACTION=="remove", GOTO="power_switch_end"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="axp20x-pek", TAG+="power-switch"
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_PATH}=="platform-soc@3000000", TAG+="power-switch"
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_PATH}=="platform-soc@3000000", ENV{ID_INPUT}="1"
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_PATH}=="platform-soc@3000000", ENV{ID_INPUT_KEY}="1"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="axp[12][890]-supplyer", TAG+="power-switch"
LABEL="power_switch_end"

View File

@@ -97,7 +97,7 @@ prepare_board() {
rockpro64|renegade-elite|pinebook-pro|station-p1)
BOARDFAMILY=rk3399
;;
orangepi5|orangepi5b|orangepi5plus|orangepitab|orangepi900)
orangepi5|orangepicm5|orangepi5b|orangepi5plus|orangepitab|orangepi900)
[[ $BOARD =~ orangepi5|orangepi5b ]] && echo host > /sys/kernel/debug/usb/fc000000.usb/mode
if [[ $BOARD =~ orangepi900 ]]; then
@@ -187,7 +187,12 @@ prepare_board() {
if [[ $BOARD == orangepizero2w ]]; then
interface_100m="eth0"
if [[ ${DISTRIBUTION_CODENAME} == "bookworm" ]]; then
interface_100m="end0"
else
interface_100m="eth0"
fi
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

View File

@@ -0,0 +1,15 @@
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&keyboard>;
__overlay__ {
status = "okay";
key0 = <600 2>;
key1 = <800 28>;
};
};
};

View File

@@ -0,0 +1,22 @@
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&r_lradc>;
__overlay__ {
status = "okay";
button-500 {
label = "KEY_1";
linux,code = <2>;
};
button-800 {
label = "KEY_ENTER";
linux,code = <28>;
};
};
};
};

View File

@@ -1824,9 +1824,25 @@
compatible = "x-powers,axp1530";
reg = <0x36>;
wakeup-source;
pmu_hot_shutdown = <0x1>;
//pmu_hot_shutdown = <0x1>;
phandle = <0xa6>;
//interrupt-parent = <0x23>;
//interrupts = <2 9 8>;
//interrupt-controller;
//#interrupt-cells = <1>;
//powerkey0: powerkey@0{
// status = "okay";
// compatible = "x-powers,axp2101-pek";
// pmu_powkey_off_time = <6000>;
// pmu_powkey_off_func = <0>;
// pmu_powkey_off_en = <1>;
// pmu_powkey_long_time = <1500>;
// pmu_powkey_on_time = <1000>;
// wakeup_falling;
//};
standby_param {
vdd-cpua = <0x2>;
vdd-sys = <0x1>;
@@ -1982,17 +1998,19 @@
clocks = <0x2 0x58>;
clock-names = "bus";
resets = <0x2 0x22>;
status = "okay";
status = "disabled";
phandle = <0xab>;
};
keyboard@5070800 {
compatible = "allwinner,keyboard_1350mv";
reg = <0x0 0x5070800 0x0 0x400>;
interrupts = <0x0 0x14 0x0>;
interrupts = <0x0 0x14 0x1>;
clocks = <0x2 0x74>;
key_cnt = <1>;
key0 = <1800 139>;
resets = <0x2 53>;
key_cnt = <2>;
key0 = <600 2>;
key1 = <800 28>;
status = "okay";
phandle = <0xac>;
};
@@ -2352,34 +2370,22 @@
compatible = "gpio-leds";
status = "okay";
status {
label = "status_led";
green_led {
label = "green_led";
gpios = <0x23 0x2 0xd 0x0>; /* PC13 */
linux,default-trigger = "heartbeat";
};
100m_link {
label = "100m_link";
gpios = <0x23 0x2 0xc 0x0>; /* PC12 */
gpios = <0x23 0x2 0xf 0x0>; /* PC15 */
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";
default-state = "off";
};
};
@@ -2671,7 +2677,7 @@
clocks = <0xd 0x8 0xa 0xd 0x7>;
clock-names = "bus", "pclk", "mclk";
resets = <0xd 0x3>;
status = "disabled";
status = "okay";
s_cir0_used = <0x1>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <0x64>;
@@ -2978,16 +2984,6 @@
};
};
usb0-drvvvbus {
compatible = "regulator-fixed";
regulator-name = "usb0-drvvbus";
regulator-min-microvolt = <0x4c4b40>;
regulator-max-microvolt = <0x4c4b40>;
regulator-enable-ramp-delay = <0x3e8>;
enable-active-high;
phandle = <0x62>;
};
box_start_os0 {
compatible = "allwinner,box_start_os";
start_type = <0x1>;
@@ -3209,6 +3205,5 @@
cpu_threshold = "/thermal-zones/cpu_thermal_zone/trips/trip-point@0";
cpu_target = "/thermal-zones/cpu_thermal_zone/trips/trip-point@1";
cpu_crit = "/thermal-zones/cpu_thermal_zone/trips/cpu_crit@0";
usb0_drvvbus = "/usb0-drvvvbus";
};
};

View File

@@ -10,4 +10,4 @@
#EOF
install -m 644 files/hciattach_opi "${ROOTFS_DIR}/usr/bin/"
install -m 644 files/brcm_patchram_plus "${ROOTFS_DIR}/usr/bin/"

Binary file not shown.

View File

@@ -51,14 +51,36 @@ prepare_board() {
amixer -c 0 cset name='Playback Path' HP > /dev/null 2>&1
amixer -c 0 cset name='Capture MIC Path' 'Main Mic' > /dev/null 2>&1
rfkill unblock all
/usr/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd &
#rfkill unblock all
#brcm_patchram_plus --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 \
# --baudrate 1500000 --patchram /lib/firmware/cyw43455/BCM4345C0.hcd /dev/ttyS1 &
if [[ $BOARD == orangepi3b ]]; then
rfkill unblock all
/usr/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd &
elif [[ $BOARD == orangepicm4 ]]; then
rfkill unblock all
brcm_patchram_plus --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download --tosleep 200000 \
--baudrate 1500000 --patchram /lib/firmware/BCM4345C0.hcd /dev/ttyS1 &
fi
;;
orangepizero2|orangepizero2-lts|orangepizero2-b|orangepizero3|orangepir1b|orangepizero2w)
kv=$(uname -r)
if [[ $BOARD == orangepizero2w ]]; then
if [[ ${DISTRIBUTION_CODENAME} == "bookworm" ]]; then
interface_100m="end0"
else
interface_100m="eth0"
fi
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

View File

@@ -5,7 +5,7 @@ git
policykit-1
gvfs
rfkill
#chromium-browser rpi-chromium-mods libwidevinecdm0
chromium-browser rpi-chromium-mods libwidevinecdm0
gldriver-test
fonts-droid-fallback
fonts-liberation2