From 43e2c01065df95bac37e2efd15d61c86b736e1c0 Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Wed, 22 Nov 2006 00:49:16 +0000 Subject: Sansa doesn't use a Wolfson codec. Various other changes to allow Sansa to compile correctly with a normal build. Based on FS#6336 by Pavel Gnelitsa git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11570 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/crt0-pp.S | 18 ++++++- firmware/target/arm/sandisk/sansa-e200/lcd-e200.c | 58 +++++++++++++++++++++-- 2 files changed, 71 insertions(+), 5 deletions(-) (limited to 'firmware/target') diff --git a/firmware/target/arm/crt0-pp.S b/firmware/target/arm/crt0-pp.S index d847d9d943..17b1e8a4a3 100644 --- a/firmware/target/arm/crt0-pp.S +++ b/firmware/target/arm/crt0-pp.S @@ -47,14 +47,28 @@ start: .equ SLEEP, 0x80000000 .equ WAKE, 0x0 .equ SLEEPING, 0x80000000 + .equ CACHE_CTRL, 0x6000c000 #endif msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */ #ifndef BOOTLOADER b pad_skip -.space 50*4 /* (more than enough) space for exception vectors */ + +#if defined(SANSA_E200) +/* mi4tool writes junk between 0xe0 and 0xeb. Avoid this. */ +.space 60*4 /* (more than enough) space for exception vectors */ +#else +.space 50*4 +#endif + pad_skip: +#ifdef SANSA_E200 + /* On the Sansa, copying the vectors fails if the cache is initialised */ + ldr r1, =CACHE_CTRL + mov r2, #0x0 + str r2, [r1] +#endif /* We need to remap memory from wherever SDRAM is mapped natively, to base address 0, so we can put our exception vectors there. We don't want to do this remapping while executing from SDRAM, so we copy the @@ -126,7 +140,7 @@ remap_end: ldr r0, =fiq_handler str r0, [r1, #28] #endif - + #ifndef STUB /* Zero out IBSS */ ldr r2, =_iedata diff --git a/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c b/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c index 2ee191faa5..c2829d11da 100644 --- a/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c +++ b/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c @@ -21,9 +21,7 @@ * ****************************************************************************/ #include "config.h" -#include "cpu.h" #include "lcd.h" -#include "kernel.h" #include "system.h" #define LCD_DATA_IN_GPIO GPIOB_INPUT_VAL @@ -108,6 +106,29 @@ static inline void lcd_write_reg(unsigned int reg, unsigned int data) lcd_send_msg(0x72, data); } +static inline void cache_flush(void) +{ +#ifndef BOOTLOADER + outl(inl(0xf000f044) | 0x2, 0xf000f044); + while ((inl(0x6000c000) & 0x8000) != 0) + { + } +#endif +} + +/* The LCD controller gets passed the address of the framebuffer, but can only + use the physical, not the remapped, address. This is a quick and dirty way + of correcting it */ +static unsigned long phys_fb_address(unsigned long address) +{ + if(address < 0x10000000) + { + return address + 0x10000000; + } else { + return address; + } +} + inline void lcd_init_device(void) { /* All this is magic worked out by MrH */ @@ -158,7 +179,7 @@ inline void lcd_init_device(void) LCD_REG_6 |= (1 << 4); LCD_REG_5 &= ~(1 << 7); - LCD_FB_BASE_REG = (unsigned long)lcd_framebuffer; + LCD_FB_BASE_REG = phys_fb_address((unsigned long)lcd_framebuffer); udelay(100000); @@ -228,6 +249,7 @@ inline void lcd_init_device(void) inline void lcd_update(void) { + cache_flush(); if(!(LCD_REG_6 & 1)) LCD_REG_6 |= 1; } @@ -262,3 +284,33 @@ void lcd_set_flip(bool yesno) /* TODO: Implement lcd_set_flip() */ (void)yesno; } + +/* Blitting functions */ + +void lcd_blit(const fb_data* data, int x, int by, int width, + int bheight, int stride) +{ + /* TODO: Implement lcd_blit() */ + (void)data; + (void)x; + (void)by; + (void)width; + (void)bheight; + (void)stride; +} + +void lcd_yuv_blit(unsigned char * const src[3], + int src_x, int src_y, int stride, + int x, int y, int width, int height) +{ + /* TODO: Implement lcd_blit() */ + (void)src; + (void)src_x; + (void)src_y; + (void)stride; + (void)x; + (void)y; + (void)width; + (void)height; +} + -- cgit v1.2.3