drivers/flash: Support mmaped flash with non-zero base offset
authorFurquan Shaikh <furquan@google.com>
Tue, 21 Jun 2016 12:29:28 +0000 (05:29 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 23 Jun 2016 03:01:40 +0000 (20:01 -0700)
commit30058c5df4abee78305e2e36f370e3d8be10a30c
tree8987f921c2e503fd3280012650c5eccf01e2d13a
parent09bec71f76d5fa668c218299e08ede3d99afb0a0
drivers/flash: Support mmaped flash with non-zero base offset

In some boards e.g. reef, the entire flash is not memory mapped. Instead
only a part of the flash (offset 0x1000 to offset x which covers the
BIOS region) is mapped in the address space. In order to handle such
special cases, a new API is required to allow boards to define the
offset on flash of the base address that is memory mapped. This base
offset needs to be taken care of while accessing any absolute address
within the mmaped range. For older boards, this base_offset defaults to
0.

BUG=chrome-os-partner:54563
BRANCH=None
TEST=Compiles successfully and boots to OS on reef.

Change-Id: I8cc54168235ceeaf561c7e77c0b661ed053bcd4b
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/354380
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
src/drivers/flash/memmapped.c
src/drivers/flash/memmapped.h