aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorCyril Bur <cyrilbur@gmail.com>2015-04-01 02:05:30 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 06:49:21 -0400
commited59190e41b725e1cfd79541f5fc66c20adb0671 (patch)
tree94af3907d402d230020c0023b4f3ccaac8306585 /arch/powerpc/include
parentd1d915783d90b15236e73d261cd8909db7275001 (diff)
powerpc/powernv: Add interfaces for flash device access
This change adds the OPAL interface definitions to allow Linux to read, write and erase from system flash devices. We register platform devices for the flash devices exported by firmware. We clash with the existing opal_flash_init function, which is really for the FSP flash update functionality, so we rename that initcall to opal_flash_update_init(). A future change will add an mtd driver that uses this interface. Changes from Joel Stanley and Jeremy Kerr. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/opal-api.h5
-rw-r--r--arch/powerpc/include/asm/opal.h9
2 files changed, 12 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
index e8a6baf55e82..0321a909e663 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -150,7 +150,10 @@
150#define OPAL_IPMI_SEND 107 150#define OPAL_IPMI_SEND 107
151#define OPAL_IPMI_RECV 108 151#define OPAL_IPMI_RECV 108
152#define OPAL_I2C_REQUEST 109 152#define OPAL_I2C_REQUEST 109
153#define OPAL_LAST 109 153#define OPAL_FLASH_READ 110
154#define OPAL_FLASH_WRITE 111
155#define OPAL_FLASH_ERASE 112
156#define OPAL_LAST 112
154 157
155/* Device tree flags */ 158/* Device tree flags */
156 159
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index fde90bacc65e..042af1abfc4d 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -194,6 +194,13 @@ int64_t opal_ipmi_recv(uint64_t interface, struct opal_ipmi_msg *msg,
194int64_t opal_i2c_request(uint64_t async_token, uint32_t bus_id, 194int64_t opal_i2c_request(uint64_t async_token, uint32_t bus_id,
195 struct opal_i2c_request *oreq); 195 struct opal_i2c_request *oreq);
196 196
197int64_t opal_flash_read(uint64_t id, uint64_t offset, uint64_t buf,
198 uint64_t size, uint64_t token);
199int64_t opal_flash_write(uint64_t id, uint64_t offset, uint64_t buf,
200 uint64_t size, uint64_t token);
201int64_t opal_flash_erase(uint64_t id, uint64_t offset, uint64_t size,
202 uint64_t token);
203
197/* Internal functions */ 204/* Internal functions */
198extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 205extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
199 int depth, void *data); 206 int depth, void *data);
@@ -226,7 +233,7 @@ extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data);
226struct rtc_time; 233struct rtc_time;
227extern unsigned long opal_get_boot_time(void); 234extern unsigned long opal_get_boot_time(void);
228extern void opal_nvram_init(void); 235extern void opal_nvram_init(void);
229extern void opal_flash_init(void); 236extern void opal_flash_update_init(void);
230extern void opal_flash_term_callback(void); 237extern void opal_flash_term_callback(void);
231extern int opal_elog_init(void); 238extern int opal_elog_init(void);
232extern void opal_platform_dump_init(void); 239extern void opal_platform_dump_init(void);