Skip to content

Commit

Permalink
board/ls2080ardb: Update board env based on SoC
Browse files Browse the repository at this point in the history
As per current implementation, default value of board env is
based on board filename i.e ls2080ardb.

With distro support changes, this env is used to decide upon
kernel dtb which is different for other SoCs (ls2088a, ls2081a)
combination supported with this board.

Add support to modify board env at runtime based on SoC type

Signed-off-by: Priyanka Jain <[email protected]>
Reviewed-by: York Sun <[email protected]>
  • Loading branch information
p-priyanka-jain authored and York Sun committed Sep 22, 2017
1 parent 8472d87 commit b5dfd47
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions board/freescale/ls2080ardb/ls2080ardb.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ int misc_init_r(void)
char *env_hwconfig;
u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
u32 val;
struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
u32 svr = gur_in32(&gur->svr);

val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4);

Expand Down Expand Up @@ -278,6 +280,16 @@ int misc_init_r(void)

if (adjust_vdd(0))
printf("Warning: Adjusting core voltage failed.\n");
/*
* Default value of board env is based on filename which is
* ls2080ardb. Modify board env for other supported SoCs
*/
if ((SVR_SOC_VER(svr) == SVR_LS2088A) ||
(SVR_SOC_VER(svr) == SVR_LS2048A))
env_set("board", "ls2088ardb");
else if ((SVR_SOC_VER(svr) == SVR_LS2081A) ||
(SVR_SOC_VER(svr) == SVR_LS2041A))
env_set("board", "ls2081ardb");

return 0;
}
Expand Down

0 comments on commit b5dfd47

Please sign in to comment.