Skip to content

Commit 3292a47

Browse files
committed
fix: booting stock on sanders
1 parent 8288c2b commit 3292a47

9 files changed

+99
-31
lines changed

lk2nd/device/dts/msm8953/msm8953-motorola-sanders.dts

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include "msm8953-motorola-sanders.dtsi"
4+
5+
/ {
6+
qcom,board-id = <0x4B 0x8100>;
7+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include "msm8953-motorola-sanders.dtsi"
4+
5+
/ {
6+
qcom,board-id = <0x4B 0x8200>;
7+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include "msm8953-motorola-sanders.dtsi"
4+
5+
/ {
6+
qcom,board-id = <0x4B 0x8300>;
7+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include "msm8953-motorola-sanders.dtsi"
4+
5+
/ {
6+
qcom,board-id = <0x4B 0x83B0>;
7+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include "msm8953-motorola-sanders.dtsi"
4+
5+
/ {
6+
qcom,board-id = <0x4B 0x8400>;
7+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include "msm8953-motorola-sanders.dtsi"
4+
5+
/ {
6+
qcom,board-id = <0x4C 0x8400>;
7+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include "../msm8953-motorola.dtsi"
4+
5+
/**
6+
To being able to run stock boot.img, we need to:
7+
1. Unpack stock bootloader with: https://github.com/osm0sis/mkbootimg
8+
- Example: `./mkbootimg/unpackbootimg -i ../boot.img -o out`
9+
2. Patch stock QCDT with: https://gist.github.com/playday3008/c26833299fe8373a4190ec9360687a77#file-moto-qcdt-patch-py
10+
- Example: `python3 moto-qcdt-patch.py ./out/boot.img-dt ./out/boot.img-dt-patched`
11+
3. Repack bootloader with: https://github.com/osm0sis/mkbootimg
12+
- Example:
13+
```
14+
./mkbootimg/mkbootimg \
15+
--kernel ./out/boot.img-kernel \
16+
--ramdisk ./out/boot.img-ramdisk \
17+
--dt ./out/boot.img-dt-py \
18+
--cmdline "$(cat ./out/boot.img-cmdline)" \
19+
--base "$(cat ./out/boot.img-base)" \
20+
--kernel_offset "$(cat ./out/boot.img-kernel_offset)" \
21+
--ramdisk_offset "$(cat ./out/boot.img-ramdisk_offset)" \
22+
--second_offset "$(cat ./out/boot.img-second_offset)" \
23+
--tags_offset "$(cat ./out/boot.img-tags_offset)" \
24+
--os_version "$(cat ./out/boot.img-os_version)" \
25+
--os_patch_level "$(cat ./out/boot.img-os_patch_level)" \
26+
--board "$(cat ./out/boot.img-board)" \
27+
--pagesize "$(cat ./out/boot.img-pagesize)" \
28+
--hashtype "$(cat ./out/boot.img-hashtype)" \
29+
-o boot.img
30+
```
31+
4. Flash the new boot.img to the device from lk2nd
32+
- Example: `fastboot flash boot boot.img`
33+
*/
34+
35+
&lk2nd {
36+
model = "Motorola Moto G5s Plus (sanders)";
37+
compatible = "motorola,sanders";
38+
39+
lk2nd,dtb-files = "msm8953-motorola-sanders";
40+
41+
panel {
42+
compatible = "motorola,sanders-panel", "lk2nd,panel";
43+
44+
qcom,mdss_dsi_mot_tianma_550_1080p_vid_v0 {
45+
compatible = "motorola,sanders-nt35596-tianma";
46+
};
47+
qcom,mdss_dsi_mot_djn_550_1080p_vid_v0 {
48+
compatible = "motorola,sanders-ili7807d-djn";
49+
};
50+
};
51+
};

lk2nd/device/dts/msm8953/rules.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@ ADTBS += \
2727

2828
QCDTBS += \
2929
$(LOCAL_DIR)/msm8953-motorola-potter.dtb \
30-
$(LOCAL_DIR)/msm8953-motorola-sanders.dtb \
30+
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p1.dtb \
31+
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p2.dtb \
32+
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p3-1.dtb \
33+
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p3-2.dtb \
34+
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p4-1.dtb \
35+
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p4-2.dtb \
3136
$(LOCAL_DIR)/sdm450-samsung-r04.dtb \

0 commit comments

Comments
 (0)