aboutsummaryrefslogtreecommitdiff
path: root/hw/onenand.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/onenand.c')
-rw-r--r--hw/onenand.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/onenand.c b/hw/onenand.c
index 762da278a3..9bf4630c47 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -113,8 +113,8 @@ void onenand_base_update(void *opaque, target_phys_addr_t new)
0xbe00 << s->shift,
(s->ram +(0x0200 << s->shift)) | IO_MEM_RAM);
if (s->iomemtype)
- cpu_register_physical_memory(s->base + (0xc000 << s->shift),
- 0x4000 << s->shift, s->iomemtype);
+ cpu_register_physical_memory_offset(s->base + (0xc000 << s->shift),
+ 0x4000 << s->shift, s->iomemtype, (0xc000 << s->shift));
}
void onenand_base_unmap(void *opaque)
@@ -449,11 +449,11 @@ static void onenand_command(struct onenand_s *s, int cmd)
static uint32_t onenand_read(void *opaque, target_phys_addr_t addr)
{
struct onenand_s *s = (struct onenand_s *) opaque;
- int offset = (addr - s->base) >> s->shift;
+ int offset = addr >> s->shift;
switch (offset) {
case 0x0000 ... 0xc000:
- return lduw_le_p(s->boot[0] + (addr - s->base));
+ return lduw_le_p(s->boot[0] + addr);
case 0xf000: /* Manufacturer ID */
return (s->id >> 16) & 0xff;
@@ -514,7 +514,7 @@ static void onenand_write(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
struct onenand_s *s = (struct onenand_s *) opaque;
- int offset = (addr - s->base) >> s->shift;
+ int offset = addr >> s->shift;
int sec;
switch (offset) {