summaryrefslogtreecommitdiff
path: root/util/flashrom/cbtable.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-01-26 01:23:31 +0000
committerPeter Stuge <peter@stuge.se>2009-01-26 01:23:31 +0000
commit713ee92c96c0c92cdd1fe64a58cc1f9abd94d11c (patch)
treeba465bab12911ecb94ab3ea56b466273081543f8 /util/flashrom/cbtable.c
parentd48091a35c18745527d1e164f82bc774e4bd6b58 (diff)
flashrom: Darwin / Mac OS X
Through DirectIO from coresystems GmbH we now support Darwin/Mac OS X. DirectIO is available at http://www.coresystems.de/en/directio Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3905 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/cbtable.c')
-rw-r--r--util/flashrom/cbtable.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/util/flashrom/cbtable.c b/util/flashrom/cbtable.c
index 284140a563..2a3f2a75f0 100644
--- a/util/flashrom/cbtable.c
+++ b/util/flashrom/cbtable.c
@@ -184,11 +184,20 @@ static void search_lb_records(struct lb_record *rec, struct lb_record *last,
int coreboot_init(void)
{
uint8_t *low_1MB;
- unsigned long addr;
+ unsigned long addr, start;
struct lb_header *lb_table;
struct lb_record *rec, *last;
- low_1MB = physmap("low megabyte", 0x0, 1024*1024);
+#ifdef __DARWIN__
+ /* This is a hack. DirectIO fails to map physical address 0x00000000.
+ * Why?
+ */
+ start = 0x400;
+#else
+ start = 0x0;
+#endif
+ low_1MB = physmap("low megabyte", start, 1024*1024);
+
lb_table = find_lb_table(low_1MB, 0x00000, 0x1000);
if (!lb_table)
lb_table = find_lb_table(low_1MB, 0xf0000, 1024*1024);
@@ -197,8 +206,8 @@ int coreboot_init(void)
return -1;
}
- addr = ((char *)lb_table) - ((char *)low_1MB);
- printf_debug("coreboot table found at %p.\n", lb_table);
+ addr = ((char *)lb_table) - ((char *)low_1MB) + start;
+ printf_debug("coreboot table found at %p.\n", lb_table + start);
rec = (struct lb_record *)(((char *)lb_table) + lb_table->header_bytes);
last = (struct lb_record *)(((char *)rec) + lb_table->table_bytes);
printf_debug("coreboot header(%d) checksum: %04x table(%d) checksum: %04x entries: %d\n",