Skip to content
Draft
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
11 changes: 11 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus-p0.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-albus.dtsi"

/ {
qcom,board-id = <0x48 0x8000>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-albus-p0";

Choose a reason for hiding this comment

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

Where are the dtb files if you need to load them?

Copy link
Author

Choose a reason for hiding this comment

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

In the Android kernel qcdt image, apparently.
Without it, when I try to flash the boot.img using fastboot, this error appears in the log:

[11280] DTB Total entry: 7, DTB version: 2
[11280] ERROR: Unable to find suitable device tree for device (293/0x00010001/0x00010008/0)
[11290] ERROR: Getting device tree address failed
[11300] DTB offset is incorrect, kernel image does not have appended DTB.

Adding this to the device tree fixes the problem.

Copy link
Author

Choose a reason for hiding this comment

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

the dtb names and board-ids came from this: https://pastebin.com/Mm8htFgP

Copy link
Author

Choose a reason for hiding this comment

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

Maybe I gave the commit a bad name. In it, I'm just trying to separate each board, with a different board-id, into its own device tree, which prevents the issue in fastboot.
Most likely, the "lk2nd,dtb-files" entries are not strictly necessary. I compiled the code without them, and the "fastboot boot" command still worked in lk2nd.

Choose a reason for hiding this comment

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

Nah this property is meant for booting mainline kernel instead of android downstream. It's pointless if these dtb files are nonexistent in mainline kernel.

Copy link
Author

@Coffee-0xFF Coffee-0xFF Oct 20, 2025

Choose a reason for hiding this comment

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

Ok, I hadn’t understood that very well. Since albus isn’t in the mainline kernel yet, I should remove that property from the seven DTS files, right?

Copy link
Member

Choose a reason for hiding this comment

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

As already noted, dtb-files are useless outside of booting mainline, and, on top of that, having separate dtb and file hint would only be useful if those devices are meaningfully physically different. Otherwise this is useless, and if you only have a file for a board id, could as well put all board ids into the same file. -- see other motorola devices in this dir.

};
11 changes: 11 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus-p1.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-albus.dtsi"

/ {
qcom,board-id = <0x48 0x81A0>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-albus-p1";
};
11 changes: 11 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus-p1a1.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-albus.dtsi"

/ {
qcom,board-id = <0x48 0x81A1>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-albus-p1a1";
};
11 changes: 11 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus-p1b.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-albus.dtsi"

/ {
qcom,board-id = <0x49 0x81B0>;
};

&lk2nd {
lk2nd,dtb-files = "msm8953-albus-p1b";
};
11 changes: 11 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus-p2.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-albus.dtsi"

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

&lk2nd {
lk2nd,dtb-files = "msm8953-albus-p2";
};
11 changes: 11 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus-p3.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-albus.dtsi"

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

&lk2nd {
lk2nd,dtb-files = "msm8953-albus-p3";
};
11 changes: 11 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus-p4.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola-albus.dtsi"

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

&lk2nd {
lk2nd,dtb-files = "msm8953-albus-p4";
};
18 changes: 18 additions & 0 deletions lk2nd/device/dts/msm8953/msm8953-motorola-albus.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8953-motorola.dtsi"

&lk2nd {
model = "Motorola Moto Z2 Play (albus)";
compatible = "motorola,albus", "qcom,msm8953-albus";

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

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

qcom,mdss_dsi_mot_smd_549_1080p_alb_cmd_v0 {
compatible = "smd,549-alb-v0";
};
};
};
7 changes: 7 additions & 0 deletions lk2nd/device/dts/msm8953/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ ADTBS += \

QCDTBS += \
$(LOCAL_DIR)/msm8953-motorola-potter.dtb \
$(LOCAL_DIR)/msm8953-motorola-albus-p0.dtb \
Copy link
Member

Choose a reason for hiding this comment

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

do you actually need /all/ of those device revisions in separate files?

$(LOCAL_DIR)/msm8953-motorola-albus-p1.dtb \
$(LOCAL_DIR)/msm8953-motorola-albus-p1a1.dtb \
$(LOCAL_DIR)/msm8953-motorola-albus-p1b.dtb \
$(LOCAL_DIR)/msm8953-motorola-albus-p2.dtb \
$(LOCAL_DIR)/msm8953-motorola-albus-p3.dtb \
$(LOCAL_DIR)/msm8953-motorola-albus-p4.dtb \
$(LOCAL_DIR)/sdm450-samsung-r04.dtb \
160 changes: 160 additions & 0 deletions lk2nd/display/panel/generated/lk_panel_smd_549_1080p_alb_cmd_v0.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2025 FIXME
// Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree:
// Copyright (c) 2014, The Linux Foundation. All rights reserved. (FIXME)

#ifndef _PANEL_SMD_549_1080P_ALB_CMD_V0_H_
#define _PANEL_SMD_549_1080P_ALB_CMD_V0_H_
Copy link
Member

Choose a reason for hiding this comment

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

are you using lk1st or otherwise using this panel driver? if so, I'd expect you document the device as quirky in the dts and provide notes on how to enable the panel driver.


#include <mipi_dsi.h>
#include <panel_display.h>
#include <panel.h>
#include <string.h>

static struct panel_config smd_549_1080p_alb_cmd_v0_panel_data = {
.panel_node_id = "qcom,mdss_dsi_mot_smd_549_1080p_alb_cmd_v0",
.panel_controller = "dsi:0:",
.panel_compatible = "qcom,mdss-dsi-panel",
.panel_type = 1,
.panel_destination = "DISPLAY_1",
/* .panel_orientation not supported yet */
.panel_framerate = 60,
.panel_lp11_init = 1,
.panel_init_delay = 0,
};

static struct panel_resolution smd_549_1080p_alb_cmd_v0_panel_res = {
.panel_width = 1080,
.panel_height = 1920,
.hfront_porch = 44,
.hback_porch = 32,
.hpulse_width = 12,
.hsync_skew = 0,
.vfront_porch = 9,
.vback_porch = 3,
.vpulse_width = 4,
/* Borders not supported yet */
};

static struct color_info smd_549_1080p_alb_cmd_v0_color = {
.color_format = 24,
.color_order = DSI_RGB_SWAP_RGB,
.underflow_color = 0xff,
/* Borders and pixel packing not supported yet */
};

static char smd_549_1080p_alb_cmd_v0_on_cmd_0[] = {
0x11, 0x00, 0x05, 0x80
};
static char smd_549_1080p_alb_cmd_v0_on_cmd_1[] = {
0x35, 0x00, 0x15, 0x00
};
static char smd_549_1080p_alb_cmd_v0_on_cmd_2[] = {
0x51, 0x00, 0x15, 0x00
};
static char smd_549_1080p_alb_cmd_v0_on_cmd_3[] = {
0x55, 0x00, 0x15, 0x00
};
static char smd_549_1080p_alb_cmd_v0_on_cmd_4[] = {
0x53, 0x20, 0x15, 0x00
};
static char smd_549_1080p_alb_cmd_v0_on_cmd_5[] = {
0x29, 0x00, 0x05, 0x80
};

static struct mipi_dsi_cmd smd_549_1080p_alb_cmd_v0_on_command[] = {
{ sizeof(smd_549_1080p_alb_cmd_v0_on_cmd_0), smd_549_1080p_alb_cmd_v0_on_cmd_0, 20 },
{ sizeof(smd_549_1080p_alb_cmd_v0_on_cmd_1), smd_549_1080p_alb_cmd_v0_on_cmd_1, 0 },
{ sizeof(smd_549_1080p_alb_cmd_v0_on_cmd_2), smd_549_1080p_alb_cmd_v0_on_cmd_2, 0 },
{ sizeof(smd_549_1080p_alb_cmd_v0_on_cmd_3), smd_549_1080p_alb_cmd_v0_on_cmd_3, 0 },
{ sizeof(smd_549_1080p_alb_cmd_v0_on_cmd_4), smd_549_1080p_alb_cmd_v0_on_cmd_4, 0 },
{ sizeof(smd_549_1080p_alb_cmd_v0_on_cmd_5), smd_549_1080p_alb_cmd_v0_on_cmd_5, 0 },
};

static char smd_549_1080p_alb_cmd_v0_off_cmd_0[] = {
0x28, 0x00, 0x05, 0x80
};
static char smd_549_1080p_alb_cmd_v0_off_cmd_1[] = {
0x10, 0x00, 0x05, 0x80
};

static struct mipi_dsi_cmd smd_549_1080p_alb_cmd_v0_off_command[] = {
{ sizeof(smd_549_1080p_alb_cmd_v0_off_cmd_0), smd_549_1080p_alb_cmd_v0_off_cmd_0, 35 },
{ sizeof(smd_549_1080p_alb_cmd_v0_off_cmd_1), smd_549_1080p_alb_cmd_v0_off_cmd_1, 150 },
};

static struct command_state smd_549_1080p_alb_cmd_v0_state = {
.oncommand_state = 0,
.offcommand_state = 0,
};

static struct commandpanel_info smd_549_1080p_alb_cmd_v0_command_panel = {
/* FIXME: This is a command mode panel */
};

static struct videopanel_info smd_549_1080p_alb_cmd_v0_video_panel = {
.hsync_pulse = 0,
.hfp_power_mode = 0,
.hbp_power_mode = 0,
.hsa_power_mode = 0,
.bllp_eof_power_mode = 1,
.bllp_power_mode = 1,
.traffic_mode = 2,
/* This is bllp_eof_power_mode and bllp_power_mode combined */
.bllp_eof_power = 1 << 3 | 1 << 0,
};

static struct lane_configuration smd_549_1080p_alb_cmd_v0_lane_config = {
.dsi_lanes = 4,
.dsi_lanemap = 0,
.lane0_state = 1,
.lane1_state = 1,
.lane2_state = 1,
.lane3_state = 1,
.force_clk_lane_hs = 0,
};

static const uint32_t smd_549_1080p_alb_cmd_v0_timings[] = {
0xd5, 0x32, 0x22, 0x00, 0x60, 0x62, 0x26, 0x34, 0x29, 0x03, 0x04, 0x00
};

static struct panel_timing smd_549_1080p_alb_cmd_v0_timing_info = {
.tclk_post = 0x0d,
.tclk_pre = 0x2d,
};

static struct panel_reset_sequence smd_549_1080p_alb_cmd_v0_reset_seq = {
.pin_state = { 0, 1 },
.sleep = { 1, 6 },
.pin_direction = 2,
};

static struct backlight smd_549_1080p_alb_cmd_v0_backlight = {
.bl_interface_type = BL_DCS,
.bl_min_level = 1,
.bl_max_level = 255,
};

static inline void panel_smd_549_1080p_alb_cmd_v0_select(struct panel_struct *panel,
struct msm_panel_info *pinfo,
struct mdss_dsi_phy_ctrl *phy_db)
{
panel->paneldata = &smd_549_1080p_alb_cmd_v0_panel_data;
panel->panelres = &smd_549_1080p_alb_cmd_v0_panel_res;
panel->color = &smd_549_1080p_alb_cmd_v0_color;
panel->videopanel = &smd_549_1080p_alb_cmd_v0_video_panel;
panel->commandpanel = &smd_549_1080p_alb_cmd_v0_command_panel;
panel->state = &smd_549_1080p_alb_cmd_v0_state;
panel->laneconfig = &smd_549_1080p_alb_cmd_v0_lane_config;
panel->paneltiminginfo = &smd_549_1080p_alb_cmd_v0_timing_info;
panel->panelresetseq = &smd_549_1080p_alb_cmd_v0_reset_seq;
panel->backlightinfo = &smd_549_1080p_alb_cmd_v0_backlight;
pinfo->mipi.panel_on_cmds = smd_549_1080p_alb_cmd_v0_on_command;
pinfo->mipi.panel_off_cmds = smd_549_1080p_alb_cmd_v0_off_command;
pinfo->mipi.num_of_panel_on_cmds = ARRAY_SIZE(smd_549_1080p_alb_cmd_v0_on_command);
pinfo->mipi.num_of_panel_off_cmds = ARRAY_SIZE(smd_549_1080p_alb_cmd_v0_off_command);
memcpy(phy_db->timing, smd_549_1080p_alb_cmd_v0_timings, TIMING_SIZE);
phy_db->regulator_mode = DSI_PHY_REGULATOR_DCDC_MODE;
}

#endif /* _PANEL_SMD_549_1080P_ALB_CMD_V0_H_ */
1 change: 1 addition & 0 deletions lk2nd/display/panel/generated/panels.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "lk_panel_innolux_qhd_video.h"
#include "lk_panel_r61308_720p_video.h"
#include "lk_panel_r69431_720p_video.h"
#include "lk_panel_smd_549_1080p_alb_cmd_v0.h"

int oem_panel_select(const char *panel_name, struct panel_struct *panel,
struct msm_panel_info *pinfo, struct mdss_dsi_phy_ctrl *phy_db);
Expand Down