summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2014-10-13 16:33:08 +0000
committerandrew <andrew@FreeBSD.org>2014-10-13 16:33:08 +0000
commit59d9af2d561d412e201f405c1e3ca3adf0132cfb (patch)
tree9cd290ae538e41192ca1940f8525ce37d0f575e5
parent11cfbfbb69c3303eaa8667a10c1a7c13f29fd5f6 (diff)
downloadFreeBSD-src-59d9af2d561d412e201f405c1e3ca3adf0132cfb.zip
FreeBSD-src-59d9af2d561d412e201f405c1e3ca3adf0132cfb.tar.gz
Use a switch on ti_chip() to find which SoC we are on. This allow us t
only enable support for the SoCs we are built for.
-rw-r--r--sys/arm/ti/ti_sdhci.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/arm/ti/ti_sdhci.c b/sys/arm/ti/ti_sdhci.c
index 63aeb9b..024c830 100644
--- a/sys/arm/ti/ti_sdhci.c
+++ b/sys/arm/ti/ti_sdhci.c
@@ -494,13 +494,21 @@ ti_sdhci_attach(device_t dev)
* Set the offset from the device's memory start to the MMCHS registers.
* Also for OMAP4 disable high speed mode due to erratum ID i626.
*/
- if (ti_chip() == CHIP_OMAP_4) {
+ switch (ti_chip()) {
+#ifdef SOC_OMAP4
+ case CHIP_OMAP_4:
sc->mmchs_reg_off = OMAP4_MMCHS_REG_OFFSET;
sc->disable_highspeed = true;
- } else if (ti_chip() == CHIP_AM335X)
+ break;
+#endif
+#ifdef SOC_TI_AM335X
+ case CHIP_AM335X:
sc->mmchs_reg_off = AM335X_MMCHS_REG_OFFSET;
- else
+ break;
+#endif
+ default:
panic("Unknown OMAP device\n");
+ }
/*
* The standard SDHCI registers are at a fixed offset (the same on all
OpenPOWER on IntegriCloud