aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/driver.h
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2010-05-11 11:16:33 +0800
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-05-16 13:39:47 +0200
commitbc8be110ff314cab0e09792a05b6871672c18302 (patch)
tree4b7d6fe290465142848a4e9d17c808f9564fafc8 /src/flash/nor/driver.h
parent24ebfffff54f5201f1503256df56717900e65e2d (diff)
NOR: add read() callback to struct flash_driver
Final target is to force bus_width size during CFI flash read. In this first step I need to replace default flash read with flash specific implementation. This patch introduces: - flash_driver_read() layer; - default_flash_read(), backward compatible; - read() callback in struct flash_driver; - proper initialization in every flash_driver instance. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/flash/nor/driver.h')
-rw-r--r--src/flash/nor/driver.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/flash/nor/driver.h b/src/flash/nor/driver.h
index 0e771327..3757442f 100644
--- a/src/flash/nor/driver.h
+++ b/src/flash/nor/driver.h
@@ -3,6 +3,7 @@
* Copyright (C) 2007,2008 Øyvind Harboe <oyvind.harboe@zylin.com> *
* Copyright (C) 2008 by Spencer Oliver <spen@spen-soft.co.uk> *
* Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
+ * Copyright (C) 2010 by Antonio Borneo <borneo.antonio@gmail.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -131,6 +132,20 @@ struct flash_driver
uint8_t *buffer, uint32_t offset, uint32_t count);
/**
+ * Read data from the flash. Note CPU address will be
+ * "bank->base + offset", while the physical address is
+ * dependent upon current target MMU mappings.
+ *
+ * @param bank The bank to read.
+ * @param buffer The data bytes read.
+ * @param offset The offset into the chip to read.
+ * @param count The number of bytes to read.
+ * @returns ERROR_OK if successful; otherwise, an error code.
+ */
+ int (*read)(struct flash_bank *bank,
+ uint8_t *buffer, uint32_t offset, uint32_t count);
+
+ /**
* Probe to determine what kind of flash is present.
* This is invoked by the "probe" script command.
*