diff --git a/config/sources/families/include/rockchip64_common.inc b/config/sources/families/include/rockchip64_common.inc index b69330bc59..7c0c1e930c 100644 --- a/config/sources/families/include/rockchip64_common.inc +++ b/config/sources/families/include/rockchip64_common.inc @@ -285,9 +285,9 @@ family_tweaks_bsp() install -m 755 $SRC/packages/bsp/rk3328/z28pro/start_bt.sh $destination/usr/local/bin cp $SRC/packages/bsp/rk3328/z28pro/z28pro-bluetooth.service $destination/lib/systemd/system/ - elif [[ $BOARD == nanop*4 || $BOARD == orangepi* || $BOARD == firefly* ]]; then + elif [[ $BRANCH == legacy && ($BOARD == rockpi-4[bc] || $BOARD == nanop*4* || $BOARD == orangepi* || $BOARD == firefly*) ]]; then - # Bluetooth for most of others + # Bluetooth for most of others (custom patchram is needed only in legacy) install -m 755 $SRC/packages/bsp/rk3399/brcm_patchram_plus_rk3399 $destination/usr/bin cp $SRC/packages/bsp/rk3399/rk3399-bluetooth.service $destination/lib/systemd/system/ diff --git a/patch/kernel/rockchip64-current/board-firefly-rk3399-enable-bluetooth.patch b/patch/kernel/rockchip64-current/board-firefly-rk3399-enable-bluetooth.patch new file mode 100644 index 0000000000..73407e5c0e --- /dev/null +++ b/patch/kernel/rockchip64-current/board-firefly-rk3399-enable-bluetooth.patch @@ -0,0 +1,59 @@ +From 5afe0542f78fee6d4f1a83a840fec1efef114eaf Mon Sep 17 00:00:00 2001 +From: Piotr Szczepanik +Date: Sun, 9 Aug 2020 18:09:41 +0200 +Subject: [PATCH] Enable bluetooth for Firefly RK3399 + +Signed-off-by: Piotr Szczepanik +--- + .../boot/dts/rockchip/rk3399-firefly.dts | 30 ++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +index a39c32ac9..984a38dfb 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +@@ -566,6 +566,20 @@ + }; + + &pinctrl { ++ bt { ++ bt_host_wake_l: bt-host-wake-l { ++ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ bt_reg_on_h: bt-reg-on-h { ++ rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ bt_wake_l: bt-wake-l { ++ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ + buttons { + pwrbtn: pwrbtn { + rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; +@@ -784,8 +798,22 @@ + + &uart0 { + pinctrl-names = "default"; +- pinctrl-0 = <&uart0_xfer &uart0_cts>; ++ pinctrl-0 = <&uart0_xfer &uart0_rts &uart0_cts>; + status = "okay"; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ clocks = <&rk808 1>; ++ clock-names = "lpo"; ++ device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>; ++ host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; ++ shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; ++ max-speed = <4000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bt_reg_on_h &bt_host_wake_l &bt_wake_l>; ++ vbat-supply = <&vcc3v3_sys>; ++ vddio-supply = <&vcc_1v8>; ++ }; + }; + + &uart2 { diff --git a/patch/kernel/rockchip64-current/firefly-rk3399-enable-wifi.patch b/patch/kernel/rockchip64-current/board-firefly-rk3399-enable-wifi.patch similarity index 100% rename from patch/kernel/rockchip64-current/firefly-rk3399-enable-wifi.patch rename to patch/kernel/rockchip64-current/board-firefly-rk3399-enable-wifi.patch diff --git a/patch/kernel/rockchip64-dev/board-firefly-rk3399-enable-bluetooth.patch b/patch/kernel/rockchip64-dev/board-firefly-rk3399-enable-bluetooth.patch new file mode 100644 index 0000000000..73407e5c0e --- /dev/null +++ b/patch/kernel/rockchip64-dev/board-firefly-rk3399-enable-bluetooth.patch @@ -0,0 +1,59 @@ +From 5afe0542f78fee6d4f1a83a840fec1efef114eaf Mon Sep 17 00:00:00 2001 +From: Piotr Szczepanik +Date: Sun, 9 Aug 2020 18:09:41 +0200 +Subject: [PATCH] Enable bluetooth for Firefly RK3399 + +Signed-off-by: Piotr Szczepanik +--- + .../boot/dts/rockchip/rk3399-firefly.dts | 30 ++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +index a39c32ac9..984a38dfb 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +@@ -566,6 +566,20 @@ + }; + + &pinctrl { ++ bt { ++ bt_host_wake_l: bt-host-wake-l { ++ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ bt_reg_on_h: bt-reg-on-h { ++ rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ bt_wake_l: bt-wake-l { ++ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ + buttons { + pwrbtn: pwrbtn { + rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; +@@ -784,8 +798,22 @@ + + &uart0 { + pinctrl-names = "default"; +- pinctrl-0 = <&uart0_xfer &uart0_cts>; ++ pinctrl-0 = <&uart0_xfer &uart0_rts &uart0_cts>; + status = "okay"; ++ ++ bluetooth { ++ compatible = "brcm,bcm43438-bt"; ++ clocks = <&rk808 1>; ++ clock-names = "lpo"; ++ device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>; ++ host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; ++ shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; ++ max-speed = <4000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bt_reg_on_h &bt_host_wake_l &bt_wake_l>; ++ vbat-supply = <&vcc3v3_sys>; ++ vddio-supply = <&vcc_1v8>; ++ }; + }; + + &uart2 { diff --git a/patch/kernel/rockchip64-dev/firefly-rk3399-enable-wifi.patch b/patch/kernel/rockchip64-dev/board-firefly-rk3399-enable-wifi.patch similarity index 100% rename from patch/kernel/rockchip64-dev/firefly-rk3399-enable-wifi.patch rename to patch/kernel/rockchip64-dev/board-firefly-rk3399-enable-wifi.patch