From 48fc6307aaa9e54e0ae3ef2094fbfbe135257d77 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 10 Feb 2006 13:14:58 +0200 Subject: [PATCH] ARM: OMAP: STI STI_DR handling fixup OMAP1 was using STI_DR instead of STI_RX_DR, which was causing problems in the RX path. OMAP2 has a consolidated XTI_TRACESELECT, the logic for trace clearing is the logical inverse of the OMAP1 STI_DR, so fix that while we're at it. Signed-off-by: Mikko K. Ylinen Signed-off-by: Paul Mundt --- arch/arm/plat-omap/sti/sti-fifo.c | 2 +- arch/arm/plat-omap/sti/sti.c | 12 ++++++++++-- include/asm-arm/arch-omap/sti.h | 4 +++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm/plat-omap/sti/sti-fifo.c b/arch/arm/plat-omap/sti/sti-fifo.c index 1824417a599..4069d9b2d39 100644 --- a/arch/arm/plat-omap/sti/sti-fifo.c +++ b/arch/arm/plat-omap/sti/sti-fifo.c @@ -77,7 +77,7 @@ static void sti_fifo_irq(unsigned long arg) while (!(sti_readl(STI_RX_STATUS) & STI_RXFIFO_EMPTY)) { unsigned int pos = sti_buf_pos(sti_crb->datalen); - sti_crb->buf[pos] = sti_readl(STI_DR); + sti_crb->buf[pos] = sti_readl(STI_RX_DR); sti_crb->datalen++; } diff --git a/arch/arm/plat-omap/sti/sti.c b/arch/arm/plat-omap/sti/sti.c index 5226e95bffb..7b04e3899e8 100644 --- a/arch/arm/plat-omap/sti/sti.c +++ b/arch/arm/plat-omap/sti/sti.c @@ -262,8 +262,16 @@ static void __sti_trace_disable(int event) u32 tmp; tmp = sti_readl(STI_DR); - tmp |= event; - tmp &= ~sti_kern_mask; + + if (cpu_is_omap16xx()) { + tmp |= event; + tmp &= ~sti_kern_mask; + } else if (cpu_is_omap24xx()) { + tmp &= ~event; + tmp |= sti_kern_mask; + } else + BUG(); + sti_writel(tmp, STI_DR); } diff --git a/include/asm-arm/arch-omap/sti.h b/include/asm-arm/arch-omap/sti.h index f42f6e5e907..e5a383d813b 100644 --- a/include/asm-arm/arch-omap/sti.h +++ b/include/asm-arm/arch-omap/sti.h @@ -16,6 +16,7 @@ #define STI_IRQCLREN 0x20 #define STI_ER 0x24 #define STI_DR 0x28 +#define STI_RX_DR 0x2c #define STI_RX_STATUS 0x30 #define STI_CLK_CTRL 0x34 #define STI_IOBOTT0 0x4c @@ -102,7 +103,8 @@ enum { #define STI_RX_STATUS XTI_SYSSTATUS #define STI_IRQCLREN STI_IRQSETEN #define STI_ER XTI_TRACESELECT -#define STI_DR XTI_RXDATA +#define STI_DR XTI_TRACESELECT +#define STI_RX_DR XTI_RXDATA #define STI_CLK_CTRL XTI_SCLKCRTL #define STI_SERIAL_CFG XTI_SCONFIG -- 2.41.1