Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lk2nd/device/2nd/gpl/motorola-unit-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define SMEM_KERNEL_RESERVE SMEM_ID_VENDOR0
#define SMEM_KERNEL_RESERVE_SIZE 1024

static uint32_t prod_id;
static const struct mmi_unit_info *mmi_unit_info;

static void readprop_u32(const void *dtb, int node, const char *name, uint32_t *val) {
Expand All @@ -26,10 +27,10 @@ static void readprop_u32(const void *dtb, int node, const char *name, uint32_t *

static void print_unit_info(const struct mmi_unit_info *info)
{
dprintf(INFO, "Motorola unit info v%d: rev=%#04x, serial=%#08x%08x, "
dprintf(INFO, "Motorola unit info v%d: prod_id=%#04x, rev=%#04x, serial=%#08x%08x, "
"machine='%s', barcode='%s', carrier='%s', baseband='%s', device='%s', "
"radio='%s' (%#x), powerup_reason=%#08x\n",
info->version, info->system_rev, info->system_serial_high, info->system_serial_low,
info->version, prod_id, info->system_rev, info->system_serial_high, info->system_serial_low,
info->machine, info->barcode, info->carrier, info->baseband, info->device,
info->radio_str, info->radio, info->powerup_reason);
}
Expand Down Expand Up @@ -67,6 +68,7 @@ static int motorola_unit_info(const void *dtb, int node)
memset(info, 0, SMEM_KERNEL_RESERVE_SIZE);
info->version = MMI_UNIT_INFO_VER;

readprop_u32(dtb, chosen, "mmi,prod_id", &prod_id);
readprop_u32(dtb, chosen, "linux,hwrev", &info->system_rev);
readprop_u32(dtb, chosen, "linux,seriallow", &info->system_serial_low);
readprop_u32(dtb, chosen, "linux,serialhigh", &info->system_serial_high);
Expand Down
30 changes: 0 additions & 30 deletions lk2nd/device/dts/msm8953/msm8953-motorola-sanders.dts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-sanders.dtsi"

/ {
qcom,board-id = <0x4B 0x8100>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-sanders-p1";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-sanders.dtsi"

/ {
qcom,board-id = <0x4B 0x8200>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-sanders-p2";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-sanders.dtsi"

/ {
qcom,board-id = <0x4B 0x8300>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-sanders-p3";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-sanders.dtsi"

/ {
qcom,board-id = <0x4B 0x83B0>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-sanders-p3";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-sanders.dtsi"

/ {
qcom,board-id = <0x4B 0x8400>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-sanders-p4";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-sanders.dtsi"

/ {
qcom,board-id = <0x4C 0x8400>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-sanders-p4";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "../msm8953-motorola.dtsi"

/**
To being able to run stock boot.img, we need to:
1. Unpack stock bootloader with: https://github.com/osm0sis/mkbootimg
- Example: `./mkbootimg/unpackbootimg -i ../boot.img -o out`
2. Patch stock QCDT with: https://gist.github.com/playday3008/c26833299fe8373a4190ec9360687a77#file-moto-qcdt-patch-py
- Example: `python3 moto-qcdt-patch.py ./out/boot.img-dt ./out/boot.img-dt-patched`
3. Repack bootloader with: https://github.com/osm0sis/mkbootimg
- Example:
```
./mkbootimg/mkbootimg \
--kernel ./out/boot.img-kernel \
--ramdisk ./out/boot.img-ramdisk \
--dt ./out/boot.img-dt-patched \
--cmdline "$(cat ./out/boot.img-cmdline)" \
--base "$(cat ./out/boot.img-base)" \
--kernel_offset "$(cat ./out/boot.img-kernel_offset)" \
--ramdisk_offset "$(cat ./out/boot.img-ramdisk_offset)" \
--second_offset "$(cat ./out/boot.img-second_offset)" \
--tags_offset "$(cat ./out/boot.img-tags_offset)" \
--os_version "$(cat ./out/boot.img-os_version)" \
--os_patch_level "$(cat ./out/boot.img-os_patch_level)" \
--board "$(cat ./out/boot.img-board)" \
--pagesize "$(cat ./out/boot.img-pagesize)" \
--hashtype "$(cat ./out/boot.img-hashtype)" \
-o boot.img
```
4. Flash the new boot.img to the device from lk2nd
- Example: `fastboot flash boot boot.img`
*/

&lk2nd {
model = "Motorola Moto G5s Plus (sanders)";
compatible = "motorola,sanders";

lk2nd,dtb-files = "msm8953-motorola-sanders";

panel {
compatible = "motorola,sanders-panel", "lk2nd,panel";

qcom,mdss_dsi_mot_tianma_550_1080p_vid_v0 {
compatible = "motorola,sanders-nt35596-tianma";
};
qcom,mdss_dsi_mot_djn_550_1080p_vid_v0 {
compatible = "motorola,sanders-ili7807d-djn";
};
};
};
7 changes: 6 additions & 1 deletion lk2nd/device/dts/msm8953/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ADTBS += \
$(LOCAL_DIR)/msm8953-huawei-milan.dtb \
$(LOCAL_DIR)/msm8953-lenovo-kuntao.dtb \
$(LOCAL_DIR)/msm8953-motorola-deen.dtb \
$(LOCAL_DIR)/msm8953-motorola-sanders.dtb \
$(LOCAL_DIR)/msm8953-mtp.dtb \
$(LOCAL_DIR)/msm8953-oppo-r9s.dtb \
$(LOCAL_DIR)/msm8953-qrd.dtb \
Expand All @@ -28,4 +27,10 @@ ADTBS += \

QCDTBS += \
$(LOCAL_DIR)/msm8953-motorola-potter.dtb \
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p1.dtb \
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p2.dtb \
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p3-1.dtb \
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p3-2.dtb \
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p4-1.dtb \
$(LOCAL_DIR)/msm8953-motorola-sanders/msm8953-motorola-sanders-p4-2.dtb \
$(LOCAL_DIR)/sdm450-samsung-r04.dtb \