Skip to content

Commit

Permalink
dev_tree: Match entire variant_id if board_hardware_id() > 0xff
Browse files Browse the repository at this point in the history
Some Huawei devices seem to encode the entire qcom,board-id in there.
Right now matching would always fail if board_hardware_id() > 0xff.
  • Loading branch information
stephan-gh committed Jan 24, 2021
1 parent 47e2951 commit f36005a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/aboot/lk2nd-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ static void update_board_id(struct board_id *board_id)
uint32_t hw_subtype = board_id->platform_subtype & 0xff;
uint32_t target_id = board_id->variant_id & 0xffff00;

/* Some Huawei devices seem to use hw_id > 0xff, match entire variant */
if (board_hardware_id() > 0xff)
hw_id = board_id->variant_id;

/* See platform_dt_absolute_match() for the checks made here */
if (board_hardware_id() != hw_id) {
dprintf(INFO, "Updating board hardware id: 0x%x -> 0x%x\n",
Expand Down
4 changes: 4 additions & 0 deletions platform/msm_shared/dev_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,10 @@ static int platform_dt_absolute_match(struct dt_entry *cur_dt_entry, struct dt_e
/* Determine the bits 10:8 to check the DT with the DDR Size */
cur_dt_hlos_ddr = (cur_dt_entry->board_hw_subtype & 0x700);

/* Some Huawei devices seem to use hw_id > 0xff, match entire variant */
if (board_hardware_id() > 0xff)
cur_dt_hw_platform = cur_dt_entry->variant_id;

/* 1. must match the msm_id, platform_hw_id, platform_subtype and DDR size
* soc, board major/minor, pmic major/minor must less than board info
* 2. find the matched DTB then return 1
Expand Down

0 comments on commit f36005a

Please sign in to comment.