mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
fusee/sept: fix fuse driver to not infinitely recurse on get_soc_type()
This commit is contained in:
parent
e391f593de
commit
ff7e52a1c1
5 changed files with 87 additions and 77 deletions
|
@ -164,22 +164,24 @@ uint32_t fuse_get_spare_bit(uint32_t index) {
|
||||||
|
|
||||||
/* Read a reserved ODM register. */
|
/* Read a reserved ODM register. */
|
||||||
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
||||||
uint32_t soc_type = fuse_get_soc_type();
|
|
||||||
if (index < 8) {
|
if (index < 8) {
|
||||||
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
||||||
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
||||||
} else if (soc_type == 1) {
|
} else {
|
||||||
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
uint32_t soc_type = fuse_get_soc_type();
|
||||||
if (index < 22) {
|
if (soc_type == 1) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
||||||
} else if (index < 25) {
|
if (index < 22) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
||||||
} else if (index < 26) {
|
} else if (index < 25) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM25;
|
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
||||||
} else if (index < 29) {
|
} else if (index < 26) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
return fuse_chip->FUSE_RESERVED_ODM25;
|
||||||
} else if (index < 30) {
|
} else if (index < 29) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM29;
|
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
||||||
|
} else if (index < 30) {
|
||||||
|
return fuse_chip->FUSE_RESERVED_ODM29;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -164,22 +164,24 @@ uint32_t fuse_get_spare_bit(uint32_t index) {
|
||||||
|
|
||||||
/* Read a reserved ODM register. */
|
/* Read a reserved ODM register. */
|
||||||
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
||||||
uint32_t soc_type = fuse_get_soc_type();
|
|
||||||
if (index < 8) {
|
if (index < 8) {
|
||||||
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
||||||
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
||||||
} else if (soc_type == 1) {
|
} else {
|
||||||
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
uint32_t soc_type = fuse_get_soc_type();
|
||||||
if (index < 22) {
|
if (soc_type == 1) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
||||||
} else if (index < 25) {
|
if (index < 22) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
||||||
} else if (index < 26) {
|
} else if (index < 25) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM25;
|
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
||||||
} else if (index < 29) {
|
} else if (index < 26) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
return fuse_chip->FUSE_RESERVED_ODM25;
|
||||||
} else if (index < 30) {
|
} else if (index < 29) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM29;
|
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
||||||
|
} else if (index < 30) {
|
||||||
|
return fuse_chip->FUSE_RESERVED_ODM29;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -164,22 +164,24 @@ uint32_t fuse_get_spare_bit(uint32_t index) {
|
||||||
|
|
||||||
/* Read a reserved ODM register. */
|
/* Read a reserved ODM register. */
|
||||||
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
||||||
uint32_t soc_type = fuse_get_soc_type();
|
|
||||||
if (index < 8) {
|
if (index < 8) {
|
||||||
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
||||||
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
||||||
} else if (soc_type == 1) {
|
} else {
|
||||||
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
uint32_t soc_type = fuse_get_soc_type();
|
||||||
if (index < 22) {
|
if (soc_type == 1) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
||||||
} else if (index < 25) {
|
if (index < 22) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
||||||
} else if (index < 26) {
|
} else if (index < 25) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM25;
|
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
||||||
} else if (index < 29) {
|
} else if (index < 26) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
return fuse_chip->FUSE_RESERVED_ODM25;
|
||||||
} else if (index < 30) {
|
} else if (index < 29) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM29;
|
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
||||||
|
} else if (index < 30) {
|
||||||
|
return fuse_chip->FUSE_RESERVED_ODM29;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -164,22 +164,24 @@ uint32_t fuse_get_spare_bit(uint32_t index) {
|
||||||
|
|
||||||
/* Read a reserved ODM register. */
|
/* Read a reserved ODM register. */
|
||||||
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
||||||
uint32_t soc_type = fuse_get_soc_type();
|
|
||||||
if (index < 8) {
|
if (index < 8) {
|
||||||
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
||||||
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
||||||
} else if (soc_type == 1) {
|
} else {
|
||||||
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
uint32_t soc_type = fuse_get_soc_type();
|
||||||
if (index < 22) {
|
if (soc_type == 1) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
||||||
} else if (index < 25) {
|
if (index < 22) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
||||||
} else if (index < 26) {
|
} else if (index < 25) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM25;
|
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
||||||
} else if (index < 29) {
|
} else if (index < 26) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
return fuse_chip->FUSE_RESERVED_ODM25;
|
||||||
} else if (index < 30) {
|
} else if (index < 29) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM29;
|
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
||||||
|
} else if (index < 30) {
|
||||||
|
return fuse_chip->FUSE_RESERVED_ODM29;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -164,22 +164,24 @@ uint32_t fuse_get_spare_bit(uint32_t index) {
|
||||||
|
|
||||||
/* Read a reserved ODM register. */
|
/* Read a reserved ODM register. */
|
||||||
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
uint32_t fuse_get_reserved_odm(uint32_t index) {
|
||||||
uint32_t soc_type = fuse_get_soc_type();
|
|
||||||
if (index < 8) {
|
if (index < 8) {
|
||||||
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
volatile tegra_fuse_chip_common_t *fuse_chip = fuse_chip_common_get_regs();
|
||||||
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
return fuse_chip->FUSE_RESERVED_ODM0[index];
|
||||||
} else if (soc_type == 1) {
|
} else {
|
||||||
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
uint32_t soc_type = fuse_get_soc_type();
|
||||||
if (index < 22) {
|
if (soc_type == 1) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
volatile tegra_fuse_chip_mariko_t *fuse_chip = fuse_chip_mariko_get_regs();
|
||||||
} else if (index < 25) {
|
if (index < 22) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
return fuse_chip->FUSE_RESERVED_ODM8[index - 8];
|
||||||
} else if (index < 26) {
|
} else if (index < 25) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM25;
|
return fuse_chip->FUSE_RESERVED_ODM22[index - 22];
|
||||||
} else if (index < 29) {
|
} else if (index < 26) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
return fuse_chip->FUSE_RESERVED_ODM25;
|
||||||
} else if (index < 30) {
|
} else if (index < 29) {
|
||||||
return fuse_chip->FUSE_RESERVED_ODM29;
|
return fuse_chip->FUSE_RESERVED_ODM26[index - 26];
|
||||||
|
} else if (index < 30) {
|
||||||
|
return fuse_chip->FUSE_RESERVED_ODM29;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue