summaryrefslogtreecommitdiffstats
path: root/sys/dev/bhnd
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2017-05-10 21:42:12 +0000
committermarius <marius@FreeBSD.org>2017-05-10 21:42:12 +0000
commitc0ac95fd0ac9f0466a427d868118f4f039cb453c (patch)
tree76fb82e6dd22147d9bef81c99a08d562618ca34b /sys/dev/bhnd
parentdcde69b03b85cf7ea79958caad181b7dcf93f7b4 (diff)
downloadFreeBSD-src-c0ac95fd0ac9f0466a427d868118f4f039cb453c.zip
FreeBSD-src-c0ac95fd0ac9f0466a427d868118f4f039cb453c.tar.gz
MFC: r314097
- Allow different slicers for different flash types to be registered with geom_flashmap(4) and teach it about MMC for slicing enhanced user data area partitions. The FDT slicer still is the default for CFI, NAND and SPI flash on FDT-enabled platforms. - In addition to a device_t, also pass the name of the GEOM provider in question to the slicers as a single device may provide more than one provider. - Build a geom_flashmap.ko. - Use MODULE_VERSION() so other modules can depend on geom_flashmap(4). - Remove redundant/superfluous GEOM routines that either do nothing or provide/just call default GEOM (slice) functionality. - Trim/adjust includes
Diffstat (limited to 'sys/dev/bhnd')
-rw-r--r--sys/dev/bhnd/cores/chipc/chipc_slicer.c12
-rw-r--r--sys/dev/bhnd/cores/chipc/chipc_slicer.h8
2 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/bhnd/cores/chipc/chipc_slicer.c b/sys/dev/bhnd/cores/chipc/chipc_slicer.c
index 45cac4d..4c6969d 100644
--- a/sys/dev/bhnd/cores/chipc/chipc_slicer.c
+++ b/sys/dev/bhnd/cores/chipc/chipc_slicer.c
@@ -63,10 +63,12 @@ chipc_register_slicer(chipc_flash flash_type)
switch (flash_type) {
case CHIPC_SFLASH_AT:
case CHIPC_SFLASH_ST:
- flash_register_slicer(chipc_slicer_spi);
+ flash_register_slicer(chipc_slicer_spi, FLASH_SLICES_TYPE_SPI,
+ TRUE);
break;
case CHIPC_PFLASH_CFI:
- flash_register_slicer(chipc_slicer_cfi);
+ flash_register_slicer(chipc_slicer_cfi, FLASH_SLICES_TYPE_CFI,
+ TRUE);
break;
default:
/* Unsupported */
@@ -75,7 +77,8 @@ chipc_register_slicer(chipc_flash flash_type)
}
int
-chipc_slicer_cfi(device_t dev, struct flash_slice *slices, int *nslices)
+chipc_slicer_cfi(device_t dev, const char *provider __unused,
+ struct flash_slice *slices, int *nslices)
{
struct cfi_softc *sc;
device_t parent;
@@ -100,7 +103,8 @@ chipc_slicer_cfi(device_t dev, struct flash_slice *slices, int *nslices)
}
int
-chipc_slicer_spi(device_t dev, struct flash_slice *slices, int *nslices)
+chipc_slicer_spi(device_t dev, const char *provider __unused,
+ struct flash_slice *slices, int *nslices)
{
struct chipc_spi_softc *sc;
device_t chipc, spi, spibus;
diff --git a/sys/dev/bhnd/cores/chipc/chipc_slicer.h b/sys/dev/bhnd/cores/chipc/chipc_slicer.h
index 4c35caa..6f29626 100644
--- a/sys/dev/bhnd/cores/chipc/chipc_slicer.h
+++ b/sys/dev/bhnd/cores/chipc/chipc_slicer.h
@@ -41,9 +41,9 @@
#define NVRAM_MAGIC 0x48534C46
void chipc_register_slicer(chipc_flash flash_type);
-int chipc_slicer_spi(device_t dev, struct flash_slice *slices,
- int *nslices);
-int chipc_slicer_cfi(device_t dev, struct flash_slice *slices,
- int *nslices);
+int chipc_slicer_spi(device_t dev, const char *provider,
+ struct flash_slice *slices, int *nslices);
+int chipc_slicer_cfi(device_t dev, const char *provider,
+ struct flash_slice *slices, int *nslices);
#endif /* _BHND_CORES_CHIPC_CHIPC_SLICER_H_ */
OpenPOWER on IntegriCloud