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 | |
Andrew Jeffery | f2587b0 | 2018-08-08 16:39:55 +0930 | [diff] [blame] | 4 | #ifndef FLASH_H |
| 5 | #define FLASH_H |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 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 | |
Andrew Jeffery | d6b09bc | 2018-08-08 16:47:54 +0930 | [diff] [blame] | 12 | int flash_dev_init(struct mbox_context *context); |
Andrew Jeffery | dec6ca6 | 2018-08-08 16:49:43 +0930 | [diff] [blame^] | 13 | void flash_dev_free(struct mbox_context *context); |
Deepak Kodihalli | 7ee307c | 2017-07-12 03:41:08 -0500 | [diff] [blame] | 14 | int64_t copy_flash(struct mbox_context *context, uint32_t offset, void *mem, |
| 15 | uint32_t size); |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 16 | int set_flash_bytemap(struct mbox_context *context, uint32_t offset, |
| 17 | uint32_t count, uint8_t val); |
| 18 | int erase_flash(struct mbox_context *context, uint32_t offset, uint32_t count); |
| 19 | int write_flash(struct mbox_context *context, uint32_t offset, void *buf, |
| 20 | uint32_t count); |
| 21 | |
Andrew Jeffery | f2587b0 | 2018-08-08 16:39:55 +0930 | [diff] [blame] | 22 | #endif /* FLASH_H */ |