qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] hw/pxa2xx.c: Fix handling of pxa2xx_i2c variable of


From: Peter Maydell
Subject: [Qemu-devel] [PATCH] hw/pxa2xx.c: Fix handling of pxa2xx_i2c variable offset within region
Date: Thu, 8 Mar 2012 13:58:08 +0000

The pxa2xx I2C controller can be at an arbitrary offset within its
region (this is used because one of the controllers starts at offset
0x1600 into an 0x10000 sized region). The previous implementation of this
included an adjustment which worked around the fact that memory region
read/write functions were passed an offset from the start of a page
rather than from the start of the region. Since commit 5312bd8b3
offsets are now from the start of the region and so we were applying
an incorrect adjustment, resulting in warnings like
"pxa2xx_i2c_read: Bad register 0xffffff90".

Retain the offset handling but remove the adjustment to the page
boundary.

Signed-off-by: Peter Maydell <address@hidden>
---
 hw/pxa2xx.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index 1ab2701..d1efef4 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -1507,8 +1507,7 @@ PXA2xxI2CState *pxa2xx_i2c_init(target_phys_addr_t base,
 
     i2c_dev = sysbus_from_qdev(qdev_create(NULL, "pxa2xx_i2c"));
     qdev_prop_set_uint32(&i2c_dev->qdev, "size", region_size + 1);
-    qdev_prop_set_uint32(&i2c_dev->qdev, "offset",
-            base - (base & (~region_size) & TARGET_PAGE_MASK));
+    qdev_prop_set_uint32(&i2c_dev->qdev, "offset", base & region_size);
 
     qdev_init_nofail(&i2c_dev->qdev);
 
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]