summaryrefslogtreecommitdiffstats
path: root/sst_fwhub.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2007-05-24 08:48:10 +0000
committerStefan Reinauer <stefan.reinauer@coreboot.org>2007-05-24 08:48:10 +0000
commitff4f197a24d2b06162e062004874ac915ee353ac (patch)
treef0892c97e2f71c31bab955384efebffd8fb1621a /sst_fwhub.c
parent7c1402f2208f3240de9f28f6ac48a24f526c430d (diff)
downloadast2050-flashrom-ff4f197a24d2b06162e062004874ac915ee353ac.zip
ast2050-flashrom-ff4f197a24d2b06162e062004874ac915ee353ac.tar.gz
Factor out register mapping code
Corresponding to flashrom svn r113 and coreboot v2 svn r2691. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
Diffstat (limited to 'sst_fwhub.c')
-rw-r--r--sst_fwhub.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/sst_fwhub.c b/sst_fwhub.c
index 78589b1..b828cee 100644
--- a/sst_fwhub.c
+++ b/sst_fwhub.c
@@ -46,21 +46,11 @@ void print_sst_fwhub_status(uint8_t status)
/* probe_jedec works fine for probing */
int probe_sst_fwhub(struct flashchip *flash)
{
- volatile uint8_t *registers;
- size_t size = flash->total_size * 1024;
-
if (probe_jedec(flash) == 0)
return 0;
- registers = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED,
- fd_mem, (off_t) (0xFFFFFFFF - 0x400000 - size + 1));
- if (registers == MAP_FAILED) {
- // it's this part but we can't map it ...
- perror("Can't mmap memory using " MEM_DEV);
- exit(1);
- }
+ map_flash_registers(flash);
- flash->virtual_registers = registers;
return 1;
}
OpenPOWER on IntegriCloud