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
8 changes: 8 additions & 0 deletions Documentation/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,11 @@ from the AOSP 13 source tree located in `lk2nd/certs/` are used to sign the
image.
`BOOTIMG_CERT` is expected to be in X.509 PEM format and `BOOTIMG_KEY` is
expected to be in PKCS#8 format.

### OS Version and OS Patch Level in lk2nd.img

#### `MKBOOTIMG_OS_VERSION=` AND `MKBOOTIMG_OS_PATCH_LEVEL=` - Set `lk2nd.img` OS version and patch level

Set the OS version and patch level to specific values, as some bootloaders
may check this. `MKBOOTIMG_OS_VERSION` is in format x.y.z and
`MKBOOTIMG_OS_PATCH_LEVEL` is in format YYYY-MM-DD
1 change: 1 addition & 0 deletions Documentation/devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
- Motorola Moto G5S (montana)
- Motorola Moto G6 Play (jeter)
- OPPO A57 (A57) (quirky - see comment in `lk2nd/device/dts/msm8952/msm8940-oppo-a57.dts`)
- Palm Phone (pepito) (quirky - see comment in `lk2nd/device/dts/msm8952/msm8940-palm-pepito.dts`)
- Redmi 3S (land)
- Redmi 4 (prada)
- Redmi 4A (rolex)
Expand Down
2 changes: 2 additions & 0 deletions lk2nd/device/2nd/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ $(OUTBOOTIMG): $(OUTBINDTB) $(OUTQCDT) $(RAMDISK)
$(if $(OUTQCDT),--qcdt=$(OUTQCDT)) \
$(if $(MKBOOTIMG_BASE),--base=$(MKBOOTIMG_BASE)) \
$(if $(MKBOOTIMG_PAGESIZE),--pagesize=$(MKBOOTIMG_PAGESIZE)) \
$(if $(MKBOOTIMG_OS_VERSION),--os_version=$(MKBOOTIMG_OS_VERSION)) \
$(if $(MKBOOTIMG_OS_PATCH_LEVEL),--os_patch_level=$(MKBOOTIMG_OS_PATCH_LEVEL)) \
--ramdisk=$(RAMDISK) \
$(MKBOOTIMG_ARGS)

Expand Down
31 changes: 31 additions & 0 deletions lk2nd/device/dts/msm8952/msm8940-palm-pepito.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: BSD-3-Clause

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

/*
* There are a few quirks to be aware of
*
* - Fastboot is not available on this device, lk2nd must be flashed via EDL.
* Some EDL programs (or versions thereof) do not work properly with available
* firehoses (or else need responses ignored). QDL is a known working implementation
*
* - The stock bootloader checks the OS version and the OS patch level in the boot.img as
* well as ensuring there is a signature in the boot.img (it does not matter the signature).
* When compiling lk2nd, set MKBOOTIMG_OS_VERSION=8.1.0 MKBOOTIMG_OS_PATCH_LEVEL=2020-09-01
* and SIGN_BOOTIMG=1
*/

/ {
qcom,msm-id = <QCOM_ID_MSM8940 0>;
qcom,board-id = <0xaa000008 0x00>;
};

&lk2nd {
model = "Palm Phone (pepito)";
compatible = "palm,pepito";

lk2nd,dtb-files = "qcom,msm8940-mtp", "qcom,msm8940", "qcom,mtp";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should define a dtb filename for this device, not a list of compatibles (especially downstream ones), which would be used for booting a generic linux image with extlinux.conf. If you have some work to run linux on this device, please put the name of your dtb here

Additionally `lk2nd,dtb-files` property can be present with a list of possible
device-tree names for this device. Don't add `qcom/` or `qcom-` prefix and `.dtb`
suffix to the values since lk2nd will add them as necessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I misinterpreted what this line was for - thanks! I haven't (yet) had a chance to do a mainline linux port. Since that's the case, should the property just be deleted?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you believe you know what the dtb name should be, you can add it, and we can fix it later if upstream wants the filename changed. Otherwise some devices define it as a comment with a best guess (can grep for FIXME in the dts dir)


lk2nd,single-key-navigation;
};
1 change: 1 addition & 0 deletions lk2nd/device/dts/msm8952/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ADTBS += \
$(LOCAL_DIR)/msm8937-xiaomi-land.dtb \
$(LOCAL_DIR)/msm8940-mtp.dtb \
$(LOCAL_DIR)/msm8940-oppo-a57.dtb \
$(LOCAL_DIR)/msm8940-palm-pepito.dtb \
$(LOCAL_DIR)/msm8940-xiaomi-santoni.dtb \
$(LOCAL_DIR)/msm8952-mtp.dtb \
$(LOCAL_DIR)/msm8956-mtp.dtb \
Expand Down