Skip to content

Commit

Permalink
Sigmastar: only report soc on valid chip generation (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorxda authored Aug 12, 2023
1 parent 8fca347 commit 29ac506
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/hal/sstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ bool mstar_detect_cpu(char *chip_name) {
bool sstar_detect_cpu(char *chip_name) {
uint32_t val = 0;

char *soc_env = getenv("SOC");
if (soc_env && *soc_env) {
strcpy(chip_name, soc_env);
return true;
}

if (mem_reg(SSTAR_ADDR, &val, OP_READ)) {
chip_generation = val;

char *soc_env = getenv("SOC");
if (soc_env && *soc_env) {
strcpy(chip_name, soc_env);
return true;
}

switch (val) {
case INFINITY5:
strcpy(chip_name, "SSC326X/SSC328X/SSC329X");
Expand Down

0 comments on commit 29ac506

Please sign in to comment.