diff --git a/src/hal/fh.c b/src/hal/fh.c index a140daa..7a5b8c1 100644 --- a/src/hal/fh.c +++ b/src/hal/fh.c @@ -23,7 +23,7 @@ static sensor_addr_t fh_possible_i2c_addrs[] = { bool fh_detect_cpu(char *chip_name) { char buf[256]; - uint32_t sysctrl, ipver, reg; + uint32_t sysctrl, ipver, chipinfo = 0, reg; unsigned int chip_id = 0; if (!line_from_file("/proc/cpuinfo", "Hardware.+: ([a-zA-Z0-9-]+)", buf, @@ -96,7 +96,9 @@ bool fh_detect_cpu(char *chip_name) { } break; case 0x20031601: - switch (ipver & 0xc) { + /* mach-fh/fh_chipid.c reads the FH865x package from CHIP_INFO */ + mem_reg(REG_PMU_CHIP_INFO, &chipinfo, OP_READ); + switch (chipinfo & 0xc) { case 0xc: strcpy(chip_name, "FH8652"); break; diff --git a/src/hal/fh.h b/src/hal/fh.h index 6e95aed..887c0ec 100644 --- a/src/hal/fh.h +++ b/src/hal/fh.h @@ -8,6 +8,7 @@ #define REG_PMU_IP_VER (PMU_REG_BASE + 0x0004) #define REG_PMU_FW_VER (PMU_REG_BASE + 0x0008) #define REG_PMU_SYS_CTRL (PMU_REG_BASE + 0x000c) +#define REG_PMU_CHIP_INFO (PMU_REG_BASE + 0x033c) /* chip_generation for the parts hal/fh_padmux.c has a pad table for, and the * two it knows it has none for. "FH", the model, and a last nibble for the