Skip to content

Commit

Permalink
dts: msm8953: Add OPPO R9s/R9sk
Browse files Browse the repository at this point in the history
Signed-off-by: Ricky Cheung <[email protected]>
  • Loading branch information
Ricky Cheung authored and TravMurav committed Aug 15, 2024
1 parent f6efac1 commit e0a1d96
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
- Motorola Moto G5 Plus (potter)
- Motorola Moto G7 Power (ocean)
- Motorola One (deen)
- OPPO R9s/R9sk (R9s/R9sk) (quirky - see comments in `lk2nd/device/dts/msm8953/msm8953-oppo-r9s.dts`)
- Samsung Galaxy A6+
- Samsung Galaxy J8 LTE
- Samsung Tab A2 XL WIFI
Expand Down
69 changes: 69 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-oppo-r9s.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include <skeleton64.dtsi>
#include <lk2nd.dtsi>

/*
* OPPO R9s/k has a few quirks to be aware of before working with lk2nd:
*
* - Custom board id is required by the bootloader
* The bootloader will attempt to load the first dtb with
* matching msm id, which fails as the board id does not match.
* Add LK2ND_DTBS="msm8953-oppo-r9s.dtb" to your make cmdline.
*
* - Not unlockable bootloaders
* However, downgrading to earlier bootloader versions allow for
* the exploitation of an unvalidated AVB signature vulnerability.
* You will have to insert OPPO AVB signature found at the end of
* stock boot images before the `SEANDROIDENFORCE` string.
* Generic AVB signatures via SIGN_BOOTIMG do not work!
*
* - lk2nd cannot be flashed in fastboot mode
* Instead, use EDL (https://github.com/bkerler/edl) to write the signed
* lk2nd.img to the boot partition.
* For example:
*
* edl w boot build-lk2nd-msm8952/lk2nd.img
*/

/ {
qcom,msm-id = <QCOM_ID_MSM8953 0>;
qcom,board-id = <QCOM_BOARD_ID_MTP 0 16017>,
<QCOM_BOARD_ID_MTP 0 16027>;
};

&lk2nd {
oppo-r9s {
model = "OPPO R9s (16017)";
compatible = "oppo,r9s";
lk2nd,match-cmdline = "*oppo16017*";

// FIXME: lk2nd,dtb-files = "...";

gpio-keys {
compatible = "gpio-keys";
down {
lk2nd,code = <KEY_VOLUMEDOWN>;
gpios = <&tlmm 86 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};
};

oppo-r9sk {
model = "OPPO R9sk (16027)";
compatible = "oppo,r9sk";
lk2nd,match-cmdline = "*oppo16027*";

// FIXME: lk2nd,dtb-files = "...";

gpio-keys {
compatible = "gpio-keys";
down {
lk2nd,code = <KEY_VOLUMEDOWN>;
gpios = <&tlmm 86 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};
};
};
1 change: 1 addition & 0 deletions lk2nd/device/dts/msm8953/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ADTBS += \
$(LOCAL_DIR)/msm8953-motorola-deen.dtb \
$(LOCAL_DIR)/msm8953-motorola-potter.dtb \
$(LOCAL_DIR)/msm8953-mtp.dtb \
$(LOCAL_DIR)/msm8953-oppo-r9s.dtb \
$(LOCAL_DIR)/msm8953-qrd.dtb \
$(LOCAL_DIR)/msm8953-xiaomi-common.dtb \
$(LOCAL_DIR)/msm8953-xiaomi-daisy.dtb \
Expand Down

0 comments on commit e0a1d96

Please sign in to comment.