public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/12] Allow framebuffer in SRAM and do not touch framebuffer SRAM on boot.
@ 2007-06-09 17:28 Vivien Chappelier
  2007-06-12 13:27 ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Vivien Chappelier @ 2007-06-09 17:28 UTC (permalink / raw)
  To: Linux OMAP

On HTC smartphones, the LCD controller is already running in SRAM at 
boot time.
Therefore, clearing the SRAM before the controller is turned off will 
hang it,
and attemps to reset it later during the initialization of the LCD will not
work. This patch reserves the SRAM part where the framebuffer 'palette' is
located so that it is not cleared at boot time on HTC phones. It also fixes
support for LCD DMA in the SRAM region.

Signed-off-by: Vivien Chappelier <vivien.chappelier@free.fr>

---
 arch/arm/plat-omap/dma.c  |   12 ++++++++++++
 arch/arm/plat-omap/sram.c |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 05a3849..6e83f85 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -47,6 +47,8 @@
 
 #define OMAP_FUNC_MUX_ARM_BASE    (0xfffe1000 + 0xec)
 
+#define OMAP_SRAM_BASE          0x20000000
+
 static int enable_1510_mode = 0;
 
 struct omap_dma_lch {
@@ -1176,6 +1178,16 @@ static void set_b1_regs(void)
     }
 
     if (omap_dma_in_1510_mode()) {
+
+        if(top >= OMAP_SRAM_BASE && bottom >= OMAP_SRAM_BASE) {
+            omap_writew(1 << 6, OMAP1510_DMA_LCD_CTRL); /* SRAM */
+        } else if(top < OMAP_SRAM_BASE && bottom < OMAP_SRAM_BASE) {
+            omap_writew(0, OMAP1510_DMA_LCD_CTRL);     /* SDRAM */
+        } else {
+            printk(KERN_ERR "LCD DMA across SDRAM and SRAM\n");
+            BUG();
+        }
+
         omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U);
         omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L);
         omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U);
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 1f23f04..2e0b267 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -33,6 +33,8 @@
 
 #if defined(CONFIG_ARCH_OMAP24XX)
 #define SRAM_BOOTLOADER_SZ    0x00
+#elif defined(CONFIG_MACH_TYPHOON) /* don't touch framebuffer until DMA 
off */
+#define SRAM_BOOTLOADER_SZ      0x1020
 #else
 #define SRAM_BOOTLOADER_SZ    0x80
 #endif
-- 
1.5.1.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH 6/12] Allow framebuffer in SRAM and do not touch framebuffer SRAM on boot.
@ 2007-06-09 18:41 Vivien Chappelier
  0 siblings, 0 replies; 3+ messages in thread
From: Vivien Chappelier @ 2007-06-09 18:41 UTC (permalink / raw)
  To: linux-omap-open-source

On HTC smartphones, the LCD controller is already running in SRAM at boot time.
Therefore, clearing the SRAM before the controller is turned off will hang it,
and attemps to reset it later during the initialization of the LCD will not
work. This patch reserves the SRAM part where the framebuffer 'palette' is
located so that it is not cleared at boot time on HTC phones. It also fixes
support for LCD DMA in the SRAM region.

Signed-off-by: Vivien Chappelier <vivien.chappelier@free.fr>

---
 arch/arm/plat-omap/dma.c  |   12 ++++++++++++
 arch/arm/plat-omap/sram.c |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 05a3849..6e83f85 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -47,6 +47,8 @@
 
 #define OMAP_FUNC_MUX_ARM_BASE	(0xfffe1000 + 0xec)
 
+#define OMAP_SRAM_BASE          0x20000000
+
 static int enable_1510_mode = 0;
 
 struct omap_dma_lch {
@@ -1176,6 +1178,16 @@ static void set_b1_regs(void)
 	}
 
 	if (omap_dma_in_1510_mode()) {
+
+		if(top >= OMAP_SRAM_BASE && bottom >= OMAP_SRAM_BASE) {
+			omap_writew(1 << 6, OMAP1510_DMA_LCD_CTRL); /* SRAM */
+		} else if(top < OMAP_SRAM_BASE && bottom < OMAP_SRAM_BASE) {
+			omap_writew(0, OMAP1510_DMA_LCD_CTRL);     /* SDRAM */
+		} else {
+			printk(KERN_ERR "LCD DMA across SDRAM and SRAM\n");
+			BUG();
+		}
+
 		omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U);
 		omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L);
 		omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U);
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 1f23f04..2e0b267 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -33,6 +33,8 @@
 
 #if defined(CONFIG_ARCH_OMAP24XX)
 #define SRAM_BOOTLOADER_SZ	0x00
+#elif defined(CONFIG_MACH_TYPHOON) /* don't touch framebuffer until DMA off */
+#define SRAM_BOOTLOADER_SZ      0x1020
 #else
 #define SRAM_BOOTLOADER_SZ	0x80
 #endif
-- 
1.5.1.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-12 13:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-09 17:28 [PATCH 6/12] Allow framebuffer in SRAM and do not touch framebuffer SRAM on boot Vivien Chappelier
2007-06-12 13:27 ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2007-06-09 18:41 Vivien Chappelier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox