blob: acf821887bcc0c5a95a7f3c5cc8d425449b01e09 [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
Deepak Kodihalli6c2fa902017-05-01 06:36:02 -050012#ifdef __cplusplus
13extern "C" {
14#endif
15
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110016int init_flash_dev(struct mbox_context *context);
17void free_flash_dev(struct mbox_context *context);
Deepak Kodihalli7ee307c2017-07-12 03:41:08 -050018int64_t copy_flash(struct mbox_context *context, uint32_t offset, void *mem,
19 uint32_t size);
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110020int set_flash_bytemap(struct mbox_context *context, uint32_t offset,
21 uint32_t count, uint8_t val);
22int erase_flash(struct mbox_context *context, uint32_t offset, uint32_t count);
23int write_flash(struct mbox_context *context, uint32_t offset, void *buf,
24 uint32_t count);
25
Deepak Kodihalli6c2fa902017-05-01 06:36:02 -050026#ifdef __cplusplus
27}
28#endif
Andrew Jefferyf2587b02018-08-08 16:39:55 +093029#endif /* FLASH_H */