Andrew Jeffery | 4fe996c | 2018-02-27 12:16:48 +1030 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 */ |
| 2 | /* Copyright (C) 2018 IBM Corp. */ |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 3 | |
| 4 | #ifndef MBOXD_FLASH_H |
| 5 | #define MBOXD_FLASH_H |
| 6 | |
| 7 | #define FLASH_DIRTY 0x00 |
| 8 | #define FLASH_ERASED 0x01 |
| 9 | |
Andrew Jeffery | 1a5f8b9 | 2017-04-11 11:58:55 +0930 | [diff] [blame] | 10 | #include "mbox.h" |
| 11 | |
Deepak Kodihalli | 6c2fa90 | 2017-05-01 06:36:02 -0500 | [diff] [blame] | 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 16 | int init_flash_dev(struct mbox_context *context); |
| 17 | void free_flash_dev(struct mbox_context *context); |
Deepak Kodihalli | 7ee307c | 2017-07-12 03:41:08 -0500 | [diff] [blame] | 18 | int64_t copy_flash(struct mbox_context *context, uint32_t offset, void *mem, |
| 19 | uint32_t size); |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 20 | int set_flash_bytemap(struct mbox_context *context, uint32_t offset, |
| 21 | uint32_t count, uint8_t val); |
| 22 | int erase_flash(struct mbox_context *context, uint32_t offset, uint32_t count); |
| 23 | int write_flash(struct mbox_context *context, uint32_t offset, void *buf, |
| 24 | uint32_t count); |
| 25 | |
Deepak Kodihalli | 6c2fa90 | 2017-05-01 06:36:02 -0500 | [diff] [blame] | 26 | #ifdef __cplusplus |
| 27 | } |
| 28 | #endif |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 29 | #endif /* MBOXD_FLASH_H */ |