aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-06-21 23:40:37 -0400
committerPaul Walmsley <paul@pwsan.com>2012-06-21 23:40:37 -0400
commit2acd089471d93373e051c6b1f9f9e0d9e51a76bc (patch)
tree047f85f2990046ba33c3c0227987d70ceab50abb
parentd660030061dd7e20ad18557368188d9c1002ec71 (diff)
W1: OMAP HDQ1W: use 32-bit register accesses
HDQ/1-wire registers are 32 bits long, even if the register contents fit into 8 bits, so accesses must be 32-bit aligned. Evidently the OMAP2/3 interconnects allowed the driver to get away with 8 bit accesses, but the OMAP4 puts a stop to that: [ 1.488800] Driver for 1-wire Dallas network protocol. [ 1.495025] Bad mode in data abort handler detected [ 1.500122] Internal error: Oops - bad mode: 0 [#1] SMP [ 1.505615] Modules linked in: [ 1.508819] CPU: 0 Not tainted (3.3.0-rc1-00008-g45030e9 #992) [ 1.515289] PC is at 0xffff0018 [ 1.518615] LR is at omap_hdq_probe+0xd4/0x2cc The OMAP4430 ES2 Rev X TRM does warn about this restriction in section 23.2.6.2 "HDQ/1-Wire Registers". Fixes the crash on OMAP4430 ES2 Pandaboard. Tested also on OMAP34xx and OMAP2420; it seems to work fine on those chips, although due to the lack of boards with HDQ/1-wire devices here, a more indepth test was not possible. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: NeilBrown <neilb@suse.de> Cc: Evgeniy Polyakov <zbr@ioremap.net> Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
-rw-r--r--drivers/w1/masters/omap_hdq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 5ef385bfed18..344db9c5ab88 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -102,20 +102,20 @@ static struct w1_bus_master omap_w1_master = {
102/* HDQ register I/O routines */ 102/* HDQ register I/O routines */
103static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset) 103static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset)
104{ 104{
105 return __raw_readb(hdq_data->hdq_base + offset); 105 return __raw_readl(hdq_data->hdq_base + offset);
106} 106}
107 107
108static inline void hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 val) 108static inline void hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 val)
109{ 109{
110 __raw_writeb(val, hdq_data->hdq_base + offset); 110 __raw_writel(val, hdq_data->hdq_base + offset);
111} 111}
112 112
113static inline u8 hdq_reg_merge(struct hdq_data *hdq_data, u32 offset, 113static inline u8 hdq_reg_merge(struct hdq_data *hdq_data, u32 offset,
114 u8 val, u8 mask) 114 u8 val, u8 mask)
115{ 115{
116 u8 new_val = (__raw_readb(hdq_data->hdq_base + offset) & ~mask) 116 u8 new_val = (__raw_readl(hdq_data->hdq_base + offset) & ~mask)
117 | (val & mask); 117 | (val & mask);
118 __raw_writeb(new_val, hdq_data->hdq_base + offset); 118 __raw_writel(new_val, hdq_data->hdq_base + offset);
119 119
120 return new_val; 120 return new_val;
121} 121}