summaryrefslogtreecommitdiffstats
path: root/libflash/libflash.h
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-08-26 16:02:33 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-08-28 15:24:04 +1000
commitaa0f5f4cb904faeff3ae53e35d16e5e12191de4e (patch)
tree1105c46990c0bf85833023ae9d1d073698f83665 /libflash/libflash.h
parent315acaa5d6a271d2dd6516a358a38c51c10667fa (diff)
downloadblackbird-skiboot-aa0f5f4cb904faeff3ae53e35d16e5e12191de4e.tar.gz
blackbird-skiboot-aa0f5f4cb904faeff3ae53e35d16e5e12191de4e.zip
external/common: Create common code for initialising libflash components
In order to access the flash on ARM (presumably code running on a BMC), the hardware is involved. In order to access the flash on POWER (presumably code running on a host), opal calls through the Linux MTD driver are involved. In order to access the flash on x86 (presumably on a developer/admin system), you can't but it would be nice to be able to manipulate data which has come from the flash or will go onto the flash. The pflash and the gard tool both can read and write to the 'flash' and with the introduction of the blocklevel interface the details of how the flash is read from and written to is sufficiently abstracted that these tools don't need to know what they're running on. What does differ is the setup, and not by too much either. This common code pulls out the setup of the flash hardware on ARM, the searching for the appropriate MTD device on power and generic blocklevel device init for all three architectures. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/libflash.h')
-rw-r--r--libflash/libflash.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libflash/libflash.h b/libflash/libflash.h
index fa5143a1..3fdd00bf 100644
--- a/libflash/libflash.h
+++ b/libflash/libflash.h
@@ -49,6 +49,11 @@ int flash_init(struct spi_flash_ctrl *ctrl, struct blocklevel_device **bl,
struct flash_chip **flash_chip);
void flash_exit(struct blocklevel_device *bl);
+/*
+ * Function which till call close on the underlying struct spi_flash_ctrl
+ */
+void flash_exit_close(struct blocklevel_device *bl, void (*close)(struct spi_flash_ctrl *ctrl));
+
/* libflash sets the 4b mode automatically based on the flash
* size and controller capabilities but it can be overriden
*/
OpenPOWER on IntegriCloud