-
Notifications
You must be signed in to change notification settings - Fork 417
WIP: Moto Z2 play (albus) Support #595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
bae357b
f69f57c
46b07a7
c4344dd
2ea5956
0fca5bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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"; | ||
| }; | ||
| 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"; | ||
| }; |
| 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"; | ||
| }; |
| 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"; | ||
| }; |
| 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"; | ||
| }; |
| 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"; | ||
| }; |
| 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"; | ||
| }; |
| 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"; | ||
| }; | ||
| }; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,4 +28,11 @@ ADTBS += \ | |
|
|
||
| QCDTBS += \ | ||
| $(LOCAL_DIR)/msm8953-motorola-potter.dtb \ | ||
| $(LOCAL_DIR)/msm8953-motorola-albus-p0.dtb \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 \ | ||
| 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_ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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_ */ | ||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.