Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/bhnd/cores/chipc/chipc.c
Show First 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | |||||
* @param sc chipc driver state. | * @param sc chipc driver state. | ||||
* @param caps capability flags to be used to derive NVRAM configuration. | * @param caps capability flags to be used to derive NVRAM configuration. | ||||
*/ | */ | ||||
static bhnd_nvram_src | static bhnd_nvram_src | ||||
chipc_find_nvram_src(struct chipc_softc *sc, struct chipc_caps *caps) | chipc_find_nvram_src(struct chipc_softc *sc, struct chipc_caps *caps) | ||||
{ | { | ||||
uint32_t otp_st, srom_ctrl; | uint32_t otp_st, srom_ctrl; | ||||
/* Very early devices vend SPROM/OTP/CIS (if at all) via the | |||||
* host bridge interface instead of ChipCommon. */ | |||||
if (!CHIPC_QUIRK(sc, SUPPORTS_SPROM)) | |||||
return (BHND_NVRAM_SRC_UNKNOWN); | |||||
/* | /* | ||||
* Later chipset revisions standardized the SPROM capability flags and | |||||
* register interfaces. | |||||
* | |||||
* We check for hardware presence in order of precedence. For example, | * We check for hardware presence in order of precedence. For example, | ||||
* SPROM is is always used in preference to internal OTP if found. | * SPROM is is always used in preference to internal OTP if found. | ||||
*/ | */ | ||||
if (caps->sprom) { | if (CHIPC_QUIRK(sc, SUPPORTS_SPROM) && caps->sprom) { | ||||
srom_ctrl = bhnd_bus_read_4(sc->core, CHIPC_SPROM_CTRL); | srom_ctrl = bhnd_bus_read_4(sc->core, CHIPC_SPROM_CTRL); | ||||
if (srom_ctrl & CHIPC_SRC_PRESENT) | if (srom_ctrl & CHIPC_SRC_PRESENT) | ||||
return (BHND_NVRAM_SRC_SPROM); | return (BHND_NVRAM_SRC_SPROM); | ||||
} | } | ||||
/* Check for programmed OTP H/W subregion (contains SROM data) */ | /* Check for programmed OTP H/W subregion (contains SROM data) */ | ||||
if (CHIPC_QUIRK(sc, SUPPORTS_OTP) && caps->otp_size > 0) { | if (CHIPC_QUIRK(sc, SUPPORTS_OTP) && caps->otp_size > 0) { | ||||
/* TODO: need access to HND-OTP device */ | /* TODO: need access to HND-OTP device */ | ||||
▲ Show 20 Lines • Show All 948 Lines • Show Last 20 Lines |