Some SoCs does not have a fixed regulator to handle voltage
switching automatically. Add support for voltage switching
through syscon register when necessary. Add new errata flag
indicating missing regulator. Apply errata to SoCs, which are
known to be affected, i.e. LS1046 and LS1012.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/dev/sdhci/sdhci_fsl_fdt.c | ||
---|---|---|
175 | s/does not have fixed regulator/don't have a fixed regulator | |
215 | s/char* syscon_compat/char *syscon_compat | |
675 | Does a write to SCFG_SDHCIOVSELCR clear SCFG_SDHCIOVSELCR_TGLEN? Otherwise I see no reason setting it again for each voltage, when it's already set in line 665. | |
735 | Will we still get non-null value here on boards that have the regulator connected by syscon? If so, I think the logic should terminate here. |
Fix typos. Don't return from function right after voltage switching with a syscon, but go to the fixed regulator logic.
sys/dev/sdhci/sdhci_fsl_fdt.c | ||
---|---|---|
728 | Now we're skipping over the switch (slot->host.ios.vccq) block, leaving uvolt uninitialized, but we later use it in regulator_set_voltage(vqmmc_supply, uvolt, uvolt). |
sys/dev/sdhci/sdhci_fsl_fdt.c | ||
---|---|---|
714 | One more thought - to prevent this code from becoming spaghetti, I'd suggest to delegate the actual voltage switch logic to its own helper. |
Change voltage switching logic. After setting registers check for errata flag for missing regulator and use syscon register for voltage switch if necessary. Check for a fixed regulator presence afterwards, as it still might be possible and use it.