blob: b86ec7da302b625e31a04a235c6129686e0978e7 [file] [log] [blame]
Andrew Jeffery4fe996c2018-02-27 12:16:48 +10301/* SPDX-License-Identifier: Apache-2.0 */
2/* Copyright (C) 2018 IBM Corp. */
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +11003
Andrew Jefferyf2587b02018-08-08 16:39:55 +09304#ifndef FLASH_H
5#define FLASH_H
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +11006
7#define FLASH_DIRTY 0x00
8#define FLASH_ERASED 0x01
9
Andrew Jeffery1a5f8b92017-04-11 11:58:55 +093010#include "mbox.h"
11
Andrew Jefferyd6b09bc2018-08-08 16:47:54 +093012int flash_dev_init(struct mbox_context *context);
Andrew Jefferydec6ca62018-08-08 16:49:43 +093013void flash_dev_free(struct mbox_context *context);
Andrew Jefferye0cdd3e2018-08-08 16:51:44 +093014int64_t flash_copy(struct mbox_context *context, uint32_t offset, void *mem,
Deepak Kodihalli7ee307c2017-07-12 03:41:08 -050015 uint32_t size);
Andrew Jefferyf953f792018-08-08 16:56:03 +093016int flash_set_bytemap(struct mbox_context *context, uint32_t offset,
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110017 uint32_t count, uint8_t val);
Andrew Jeffery4f5d29c2018-08-08 16:58:04 +093018int flash_erase(struct mbox_context *context, uint32_t offset, uint32_t count);
Andrew Jeffery0293f2f2018-08-08 16:59:45 +093019int flash_write(struct mbox_context *context, uint32_t offset, void *buf,
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110020 uint32_t count);
21
Andrew Jefferyf2587b02018-08-08 16:39:55 +093022#endif /* FLASH_H */