From d202e6b40722120d54d7d2d714194d42b0081b58 Mon Sep 17 00:00:00 2001 From: Rene Straub Date: Sun, 24 Jun 2018 19:06:02 +0200 Subject: [PATCH] hancock: board update - handle PMIC v3.14 (overprogrammed) as v1.0 - change default DTB name --- board/nm/hancock/board.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/board/nm/hancock/board.c b/board/nm/hancock/board.c index 095ef401a9..d1e3da4b17 100644 --- a/board/nm/hancock/board.c +++ b/board/nm/hancock/board.c @@ -628,7 +628,7 @@ static void set_devicetree_name(void) /* add hardware versions to environment */ if (bd_get_devicetree(devicetreename, sizeof(devicetreename)) != 0) { printf("Devicetree name not found, using default name\n"); - strcpy(devicetreename, "am335x-hancock-prod1.dtb"); + strcpy(devicetreename, "am335x-vcu-prod1.dtb"); } setenv("fdt_image", devicetreename); @@ -668,9 +668,19 @@ static void get_pmic_version(void) uint8_t val = 0x00; uint8_t ver, rev; - da9063_get_reg(PMIC_REG_CONFIG_ID, &val); + (void)da9063_get_reg(PMIC_REG_CONFIG_ID, &val); ver = (val >> 4) & 0xF; rev = (val >> 0) & 0xF; + + /* Quirk: + * If reported version is 3.14, this is one of the 5 prototypes which have + * been programmed multiple times --> Treat these as 1.0 + */ + if ((ver == 3) && (rev == 14)) { + ver = 1; + rev = 0; + } + printf("PMIC: V%d.%d\n", ver, rev); }