forked from len0rd/rockbox
Setup LCD ourselves; move LCD buffer and TTB to free up 1.7MB of memory
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11994 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
35b0c3f24f
commit
355be5010a
12 changed files with 138 additions and 103 deletions
|
@ -37,6 +37,8 @@ OUTPUT_FORMAT(elf32-sh)
|
||||||
#define IRAMORIG 0x407000
|
#define IRAMORIG 0x407000
|
||||||
#define IRAMSIZE 0x9000
|
#define IRAMSIZE 0x9000
|
||||||
#elif CONFIG_CPU == S3C2440
|
#elif CONFIG_CPU == S3C2440
|
||||||
|
#include "s3c2440.h"
|
||||||
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - STUBOFFSET - LCD_BUFFER_SIZE - TTB_SIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE
|
||||||
#define DRAMORIG 0x100 + STUBOFFSET
|
#define DRAMORIG 0x100 + STUBOFFSET
|
||||||
#define IRAMORIG DRAMORIG
|
#define IRAMORIG DRAMORIG
|
||||||
#define IRAMSIZE 4K
|
#define IRAMSIZE 4K
|
||||||
|
@ -46,11 +48,13 @@ OUTPUT_FORMAT(elf32-sh)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
|
#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
|
||||||
|
|
||||||
|
#if CONFIG_CPU != S3C2440
|
||||||
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - CODEC_SIZE
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - CODEC_SIZE
|
||||||
|
#endif
|
||||||
#define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
|
#define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
|
||||||
#define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
|
#define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
|
||||||
|
|
||||||
|
|
||||||
#ifdef CODEC
|
#ifdef CODEC
|
||||||
#define THIS_LENGTH CODEC_SIZE
|
#define THIS_LENGTH CODEC_SIZE
|
||||||
#define THIS_ORIGIN CODEC_ORIGIN
|
#define THIS_ORIGIN CODEC_ORIGIN
|
||||||
|
@ -84,7 +88,7 @@ SECTIONS
|
||||||
#endif
|
#endif
|
||||||
} > PLUGIN_RAM
|
} > PLUGIN_RAM
|
||||||
|
|
||||||
.rodata :
|
.rodata :
|
||||||
{
|
{
|
||||||
*(.rodata*)
|
*(.rodata*)
|
||||||
. = ALIGN(0x4);
|
. = ALIGN(0x4);
|
||||||
|
@ -98,7 +102,7 @@ SECTIONS
|
||||||
#endif
|
#endif
|
||||||
} > PLUGIN_RAM
|
} > PLUGIN_RAM
|
||||||
|
|
||||||
/DISCARD/ :
|
/DISCARD/ :
|
||||||
{
|
{
|
||||||
*(.eh_frame)
|
*(.eh_frame)
|
||||||
}
|
}
|
||||||
|
@ -124,7 +128,7 @@ SECTIONS
|
||||||
|
|
||||||
.bss (NOLOAD) :
|
.bss (NOLOAD) :
|
||||||
{
|
{
|
||||||
plugin_bss_start = .;
|
plugin_bss_start = .;
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
. = ALIGN(0x4);
|
. = ALIGN(0x4);
|
||||||
|
@ -134,7 +138,7 @@ SECTIONS
|
||||||
|
|
||||||
/* Special trick to avoid a linker error when no other sections are
|
/* Special trick to avoid a linker error when no other sections are
|
||||||
left after garbage collection (plugin not for this platform) */
|
left after garbage collection (plugin not for this platform) */
|
||||||
.comment 0 :
|
.comment 0 :
|
||||||
{
|
{
|
||||||
KEEP(*(.comment))
|
KEEP(*(.comment))
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ void memdump(void)
|
||||||
|
|
||||||
data = *(volatile int *)memlocations[i].address;
|
data = *(volatile int *)memlocations[i].address;
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "%s %s 0x%08X",
|
snprintf(tmp, sizeof(tmp), "%s %s 0x%08X",
|
||||||
(i==current) ? "*" : " ",
|
(i==current) ? "*" : " ",
|
||||||
memlocations[i].desc,
|
memlocations[i].desc,
|
||||||
data);
|
data);
|
||||||
lcd_puts(0, i*2+5, tmp);
|
lcd_puts(0, i*2+5, tmp);
|
||||||
|
@ -323,6 +323,9 @@ void * main(void)
|
||||||
lcd_puts(0, line++, "Hold MENU when booting for rescue mode.");
|
lcd_puts(0, line++, "Hold MENU when booting for rescue mode.");
|
||||||
lcd_puts(0, line++, " \"VOL+\" button to restore original kernel");
|
lcd_puts(0, line++, " \"VOL+\" button to restore original kernel");
|
||||||
lcd_puts(0, line++, " \"A\" button to load original firmware");
|
lcd_puts(0, line++, " \"A\" button to load original firmware");
|
||||||
|
line++;
|
||||||
|
snprintf(buf, sizeof(buf), "FRAME %x TTB %x", FRAME, TTB_BASE);
|
||||||
|
lcd_puts(0, line++, buf);
|
||||||
lcd_update();
|
lcd_update();
|
||||||
sleep(1*HZ);
|
sleep(1*HZ);
|
||||||
|
|
||||||
|
@ -334,7 +337,7 @@ void * main(void)
|
||||||
while(1);
|
while(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(5*HZ);
|
sleep(1*HZ);
|
||||||
|
|
||||||
if(GPGDAT & 0x10) {
|
if(GPGDAT & 0x10) {
|
||||||
load_original = true;
|
load_original = true;
|
||||||
|
@ -434,7 +437,7 @@ load_rockbox:
|
||||||
map_memory();
|
map_memory();
|
||||||
lcd_puts(0, line, "Loading Rockbox...");
|
lcd_puts(0, line, "Loading Rockbox...");
|
||||||
lcd_update();
|
lcd_update();
|
||||||
sleep(HZ*4);
|
/* sleep(HZ*4); */
|
||||||
|
|
||||||
// TODO: read those values from somwhere
|
// TODO: read those values from somwhere
|
||||||
loadbuffer = (unsigned char*) 0x100;
|
loadbuffer = (unsigned char*) 0x100;
|
||||||
|
@ -447,7 +450,7 @@ load_rockbox:
|
||||||
} else {
|
} else {
|
||||||
lcd_puts(0, line++, "Rockbox loaded.");
|
lcd_puts(0, line++, "Rockbox loaded.");
|
||||||
lcd_update();
|
lcd_update();
|
||||||
kernel_entry = (void*)0x100;
|
kernel_entry = (void*) loadbuffer;
|
||||||
rc = kernel_entry();
|
rc = kernel_entry();
|
||||||
snprintf(buf, sizeof(buf), "Woops, should not return from firmware: %d", rc);
|
snprintf(buf, sizeof(buf), "Woops, should not return from firmware: %d", rc);
|
||||||
lcd_puts(0, line++, buf);
|
lcd_puts(0, line++, buf);
|
||||||
|
|
|
@ -26,8 +26,9 @@ INPUT(target/sh/crt0.o)
|
||||||
#define STUBOFFSET 0
|
#define STUBOFFSET 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_CPU!=S3C2440
|
||||||
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
|
||||||
|
#endif
|
||||||
#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
|
#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
|
||||||
#define DRAMORIG 0x31000000 + STUBOFFSET
|
#define DRAMORIG 0x31000000 + STUBOFFSET
|
||||||
#define IRAMORIG 0x10000000
|
#define IRAMORIG 0x10000000
|
||||||
|
@ -45,7 +46,9 @@ INPUT(target/sh/crt0.o)
|
||||||
#define IRAMORIG 0x400000
|
#define IRAMORIG 0x400000
|
||||||
#define IRAMSIZE 0x7000
|
#define IRAMSIZE 0x7000
|
||||||
#elif CONFIG_CPU==S3C2440
|
#elif CONFIG_CPU==S3C2440
|
||||||
#define DRAMORIG 0x100 + STUBOFFSET
|
#include "s3c2440.h"
|
||||||
|
#define DRAMORIG (0x100 + STUBOFFSET)
|
||||||
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - STUBOFFSET - LCD_BUFFER_SIZE - TTB_SIZE - PLUGINSIZE - CODECSIZE
|
||||||
#define IRAMORIG DRAMORIG
|
#define IRAMORIG DRAMORIG
|
||||||
#define IRAMSIZE 4K
|
#define IRAMSIZE 4K
|
||||||
#define IRAM DRAM
|
#define IRAM DRAM
|
||||||
|
@ -126,7 +129,7 @@ SECTIONS
|
||||||
_dataend = .;
|
_dataend = .;
|
||||||
} > DRAM
|
} > DRAM
|
||||||
|
|
||||||
/DISCARD/ :
|
/DISCARD/ :
|
||||||
{
|
{
|
||||||
*(.eh_frame)
|
*(.eh_frame)
|
||||||
}
|
}
|
||||||
|
@ -163,7 +166,7 @@ SECTIONS
|
||||||
} > IRAM AT> DRAM
|
} > IRAM AT> DRAM
|
||||||
|
|
||||||
_iramcopy = LOADADDR(.iram);
|
_iramcopy = LOADADDR(.iram);
|
||||||
|
|
||||||
.ibss (NOLOAD) :
|
.ibss (NOLOAD) :
|
||||||
{
|
{
|
||||||
_iedata = .;
|
_iedata = .;
|
||||||
|
@ -180,7 +183,7 @@ SECTIONS
|
||||||
. += 0x2000;
|
. += 0x2000;
|
||||||
stackend = .;
|
stackend = .;
|
||||||
} > IRAM
|
} > IRAM
|
||||||
|
|
||||||
#ifdef CPU_PP
|
#ifdef CPU_PP
|
||||||
.cop_stack :
|
.cop_stack :
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
#define BATTERY_TYPES_COUNT 1 /* only one type */
|
#define BATTERY_TYPES_COUNT 1 /* only one type */
|
||||||
|
|
||||||
/* ADC[0] is (530) at discharge and 625 at full charge */
|
/* ADC[0] is (530) at discharge and 625 at full charge */
|
||||||
#define BATTERY_SCALE_FACTOR 6450
|
#define BATTERY_SCALE_FACTOR 6450
|
||||||
|
|
||||||
/* Hardware controlled charging with monitoring */
|
/* Hardware controlled charging with monitoring */
|
||||||
#define CONFIG_CHARGING CHARGING_MONITOR
|
#define CONFIG_CHARGING CHARGING_MONITOR
|
||||||
|
@ -132,5 +132,5 @@
|
||||||
#define BOOTFILE_EXT "gigabeat"
|
#define BOOTFILE_EXT "gigabeat"
|
||||||
#define BOOTFILE "rockbox." BOOTFILE_EXT
|
#define BOOTFILE "rockbox." BOOTFILE_EXT
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -347,8 +347,10 @@ extern void lcd_set_drawinfo(int mode, unsigned foreground,
|
||||||
void lcd_set_backdrop(fb_data* backdrop);
|
void lcd_set_backdrop(fb_data* backdrop);
|
||||||
#if defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR)
|
#if defined(TOSHIBA_GIGABEAT_F) && !defined(SIMULATOR)
|
||||||
void lcd_device_prepare_backdrop(fb_data* backdrop);
|
void lcd_device_prepare_backdrop(fb_data* backdrop);
|
||||||
|
bool lcd_enabled(void);
|
||||||
#else
|
#else
|
||||||
#define lcd_device_prepare_backdrop(x) ;
|
#define lcd_device_prepare_backdrop(x) ;
|
||||||
|
#define lcd_enabled() true
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fb_data* lcd_get_backdrop(void);
|
fb_data* lcd_get_backdrop(void);
|
||||||
|
|
|
@ -143,9 +143,12 @@
|
||||||
#define LCDINTMSK (*(volatile int *)0x4D00005C) /* LCD interrupt mask */
|
#define LCDINTMSK (*(volatile int *)0x4D00005C) /* LCD interrupt mask */
|
||||||
#define TCONSEL (*(volatile int *)0x4D000060) /* TCON(LPC3600/LCC3600) control */
|
#define TCONSEL (*(volatile int *)0x4D000060) /* TCON(LPC3600/LCC3600) control */
|
||||||
|
|
||||||
/* The following should be computed but for now, we cheat. */
|
#define LCD_BUFFER_SIZE ((320*240*2))
|
||||||
#define FRAME ( (short *) 0x31E00000 ) /* LCD Frame buffer */
|
#define TTB_SIZE (0x4000)
|
||||||
|
/*#define FRAME ( (short *) 0x31E00000 ) */ /* LCD Frame buffer - Firmware Address */
|
||||||
|
/* must be 16Kb (0x4000) aligned */
|
||||||
|
#define TTB_BASE (0x30000000 + (32*1024*1024) - TTB_SIZE) /* End of memory */
|
||||||
|
#define FRAME ((short *) (TTB_BASE - LCD_BUFFER_SIZE)) /* Right before TTB */
|
||||||
/* NAND Flash */
|
/* NAND Flash */
|
||||||
|
|
||||||
#define NFCONF (*(volatile int *)0x4E000000) /* NAND flash configuration */
|
#define NFCONF (*(volatile int *)0x4E000000) /* NAND flash configuration */
|
||||||
|
|
|
@ -53,10 +53,11 @@ void ata_device_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(BOOTLOADER)
|
||||||
void copy_read_sectors(unsigned char* buf, int wordcount)
|
void copy_read_sectors(unsigned char* buf, int wordcount)
|
||||||
{
|
{
|
||||||
__buttonlight_trigger();
|
__buttonlight_trigger();
|
||||||
|
|
||||||
/* Unaligned transfer - slow copy */
|
/* Unaligned transfer - slow copy */
|
||||||
if ( (unsigned long)buf & 1)
|
if ( (unsigned long)buf & 1)
|
||||||
{ /* not 16-bit aligned, copy byte by byte */
|
{ /* not 16-bit aligned, copy byte by byte */
|
||||||
|
@ -94,7 +95,9 @@ void copy_read_sectors(unsigned char* buf, int wordcount)
|
||||||
DISRC0 = (int) 0x18000000;
|
DISRC0 = (int) 0x18000000;
|
||||||
DISRCC0 = 0x1;
|
DISRCC0 = 0x1;
|
||||||
/* Dest mapped to physical address, on AHB bus, increment */
|
/* Dest mapped to physical address, on AHB bus, increment */
|
||||||
DIDST0 = (int) (buf + 0x30000000);
|
DIDST0 = (int) buf;
|
||||||
|
if(DIDST0 < 0x30000000)
|
||||||
|
DIDST0 += 0x30000000;
|
||||||
DIDSTC0 = 0;
|
DIDSTC0 = 0;
|
||||||
|
|
||||||
/* DACK/DREQ Sync to AHB, Int on Transfer complete, Whole service, No reload, 16-bit transfers */
|
/* DACK/DREQ Sync to AHB, Int on Transfer complete, Whole service, No reload, 16-bit transfers */
|
||||||
|
@ -112,10 +115,10 @@ void copy_read_sectors(unsigned char* buf, int wordcount)
|
||||||
|
|
||||||
/* Wait for transfer to complete */
|
/* Wait for transfer to complete */
|
||||||
while((DSTAT0 & 0x000fffff))
|
while((DSTAT0 & 0x000fffff))
|
||||||
CLKCON |= (1 << 2); /* set IDLE bit */
|
yield();
|
||||||
/* Dump cache for the buffer */
|
/* Dump cache for the buffer */
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
void dma0(void)
|
void dma0(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,8 +123,8 @@ bool __backlight_init(void)
|
||||||
|
|
||||||
buttonlight_selected = 0x04;
|
buttonlight_selected = 0x04;
|
||||||
|
|
||||||
/* delay 2 seconds before any fading */
|
/* delay 4 seconds before any fading */
|
||||||
initial_tick_delay = 2000;
|
initial_tick_delay = 400;
|
||||||
/* put the led control on the tick list */
|
/* put the led control on the tick list */
|
||||||
tick_add_task(led_control_service);
|
tick_add_task(led_control_service);
|
||||||
|
|
||||||
|
@ -272,10 +272,10 @@ void __buttonlight_mode(enum buttonlight_mode mode,
|
||||||
*/
|
*/
|
||||||
static void led_control_service(void)
|
static void led_control_service(void)
|
||||||
{
|
{
|
||||||
if(initial_tick_delay) {
|
if(initial_tick_delay) {
|
||||||
initial_tick_delay--;
|
initial_tick_delay--;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (backlight_control)
|
switch (backlight_control)
|
||||||
{
|
{
|
||||||
case BACKLIGHT_CONTROL_IDLE:
|
case BACKLIGHT_CONTROL_IDLE:
|
||||||
|
|
|
@ -29,21 +29,37 @@ bool lcd_enabled()
|
||||||
return lcd_on;
|
return lcd_on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int LCDBANK(unsigned int address)
|
||||||
|
{
|
||||||
|
return ((address >> 22) & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int LCDBASEU(unsigned int address)
|
||||||
|
{
|
||||||
|
return (address & ((1 << 22)-1)) >> 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int LCDBASEL(unsigned int address)
|
||||||
|
{
|
||||||
|
address += 320*240*2;
|
||||||
|
return (address & ((1 << 22)-1)) >> 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* LCD init */
|
/* LCD init */
|
||||||
void lcd_init_device(void)
|
void lcd_init_device(void)
|
||||||
{
|
{
|
||||||
memset16(fg_pattern_blit, fg_pattern, sizeof(fg_pattern_blit)/2);
|
LCDSADDR1 = (LCDBANK((unsigned)FRAME) << 21) | (LCDBASEU((unsigned)FRAME));
|
||||||
memset16(bg_pattern_blit, bg_pattern, sizeof(bg_pattern_blit)/2);
|
LCDSADDR2 = LCDBASEL((unsigned)FRAME);
|
||||||
clean_dcache_range((void *)fg_pattern_blit, sizeof(fg_pattern_blit));
|
LCDSADDR3 = 0x000000F0;
|
||||||
clean_dcache_range((void *)bg_pattern_blit, sizeof(bg_pattern_blit));
|
|
||||||
|
|
||||||
LCDSADDR1 = 0x18F00000; /* These values are pulled from an F40 */
|
|
||||||
LCDSADDR2 = 0x00112C00; /* They should move FRAME to the correct location */
|
|
||||||
LCDSADDR3 = 0x000000F0; /* TODO: Move FRAME to where we want it */
|
|
||||||
|
|
||||||
LCDCON5 |= 1 << 11; /* Switch from 555I mode to 565 mode */
|
LCDCON5 |= 1 << 11; /* Switch from 555I mode to 565 mode */
|
||||||
|
|
||||||
#if !defined(BOOTLOADER)
|
#if !defined(BOOTLOADER)
|
||||||
|
memset16(fg_pattern_blit, fg_pattern, sizeof(fg_pattern_blit)/2);
|
||||||
|
memset16(bg_pattern_blit, bg_pattern, sizeof(bg_pattern_blit)/2);
|
||||||
|
clean_dcache_range((void *)fg_pattern_blit, sizeof(fg_pattern_blit));
|
||||||
|
clean_dcache_range((void *)bg_pattern_blit, sizeof(bg_pattern_blit));
|
||||||
use_dma_blit = true;
|
use_dma_blit = true;
|
||||||
lcd_poweroff = true;
|
lcd_poweroff = true;
|
||||||
#endif
|
#endif
|
||||||
|
@ -66,7 +82,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
/* Wait for this controller to stop pending transfer */
|
/* Wait for this controller to stop pending transfer */
|
||||||
while((DSTAT1 & 0x000fffff))
|
while((DSTAT1 & 0x000fffff))
|
||||||
CLKCON |= (1 << 2); /* set IDLE bit */
|
yield();
|
||||||
|
|
||||||
/* Flush DCache */
|
/* Flush DCache */
|
||||||
invalidate_dcache_range((void *)(((int) &lcd_framebuffer)+(y * sizeof(fb_data) * LCD_WIDTH)), (height * sizeof(fb_data) * LCD_WIDTH));
|
invalidate_dcache_range((void *)(((int) &lcd_framebuffer)+(y * sizeof(fb_data) * LCD_WIDTH)), (height * sizeof(fb_data) * LCD_WIDTH));
|
||||||
|
@ -92,7 +108,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
|
|
||||||
/* Wait for transfer to complete */
|
/* Wait for transfer to complete */
|
||||||
while((DSTAT1 & 0x000fffff))
|
while((DSTAT1 & 0x000fffff))
|
||||||
CLKCON |= (1 << 2); /* set IDLE bit */
|
yield();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
memcpy(((char*)FRAME) + (y * sizeof(fb_data) * LCD_WIDTH), ((char *)&lcd_framebuffer) + (y * sizeof(fb_data) * LCD_WIDTH), ((height * sizeof(fb_data) * LCD_WIDTH)));
|
memcpy(((char*)FRAME) + (y * sizeof(fb_data) * LCD_WIDTH), ((char *)&lcd_framebuffer) + (y * sizeof(fb_data) * LCD_WIDTH), ((height * sizeof(fb_data) * LCD_WIDTH)));
|
||||||
|
@ -143,9 +159,8 @@ void lcd_clear_display_dma(void)
|
||||||
void *src;
|
void *src;
|
||||||
bool inc = false;
|
bool inc = false;
|
||||||
|
|
||||||
if(!lcd_on) {
|
if(!lcd_on)
|
||||||
sleep(200);
|
yield();
|
||||||
}
|
|
||||||
if (lcd_get_drawmode() & DRMODE_INVERSEVID)
|
if (lcd_get_drawmode() & DRMODE_INVERSEVID)
|
||||||
src = fg_pattern_blit;
|
src = fg_pattern_blit;
|
||||||
else
|
else
|
||||||
|
@ -162,7 +177,7 @@ void lcd_clear_display_dma(void)
|
||||||
}
|
}
|
||||||
/* Wait for any pending transfer to complete */
|
/* Wait for any pending transfer to complete */
|
||||||
while((DSTAT3 & 0x000fffff))
|
while((DSTAT3 & 0x000fffff))
|
||||||
CLKCON |= (1 << 2); /* set IDLE bit */
|
yield();
|
||||||
DMASKTRIG3 |= 0x4; /* Stop controller */
|
DMASKTRIG3 |= 0x4; /* Stop controller */
|
||||||
DIDST3 = ((int) lcd_framebuffer) + 0x30000000; /* set DMA dest, physical address */
|
DIDST3 = ((int) lcd_framebuffer) + 0x30000000; /* set DMA dest, physical address */
|
||||||
DIDSTC3 = 0; /* Dest on AHB, increment */
|
DIDSTC3 = 0; /* Dest on AHB, increment */
|
||||||
|
@ -182,7 +197,7 @@ void lcd_clear_display_dma(void)
|
||||||
|
|
||||||
/* Wait for transfer to complete */
|
/* Wait for transfer to complete */
|
||||||
while((DSTAT3 & 0x000fffff))
|
while((DSTAT3 & 0x000fffff))
|
||||||
CLKCON |= (1 << 2); /* set IDLE bit */
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_clear_display(void)
|
void lcd_clear_display(void)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "s3c2440.h"
|
#include "s3c2440.h"
|
||||||
#include "mmu-meg-fx.h"
|
#include "mmu-meg-fx.h"
|
||||||
|
#include "panic.h"
|
||||||
|
|
||||||
void map_memory(void);
|
void map_memory(void);
|
||||||
static void enable_mmu(void);
|
static void enable_mmu(void);
|
||||||
|
@ -20,7 +21,7 @@ void map_memory(void) {
|
||||||
enable_mmu();
|
enable_mmu();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int* ttb_base;
|
unsigned int* ttb_base = (unsigned int *) TTB_BASE;
|
||||||
const int ttb_size = 4096;
|
const int ttb_size = 4096;
|
||||||
|
|
||||||
void set_ttb() {
|
void set_ttb() {
|
||||||
|
@ -29,7 +30,7 @@ void set_ttb() {
|
||||||
int domain_access;
|
int domain_access;
|
||||||
|
|
||||||
/* must be 16Kb (0x4000) aligned */
|
/* must be 16Kb (0x4000) aligned */
|
||||||
ttb_base = (int*)0x31F00000;
|
ttb_base = (int*) TTB_BASE;
|
||||||
for (i=0; i<ttb_size; i++,ttbPtr++)
|
for (i=0; i<ttb_size; i++,ttbPtr++)
|
||||||
ttbPtr = 0;
|
ttbPtr = 0;
|
||||||
asm volatile("mcr p15, 0, %0, c2, c0, 0" : : "r" (ttb_base));
|
asm volatile("mcr p15, 0, %0, c2, c0, 0" : : "r" (ttb_base));
|
||||||
|
@ -47,8 +48,8 @@ void set_page_tables() {
|
||||||
|
|
||||||
map_section(0x30000000, 0, 32, CACHE_NONE); /* map RAM to 0 */
|
map_section(0x30000000, 0, 32, CACHE_NONE); /* map RAM to 0 */
|
||||||
|
|
||||||
map_section(0x30000000, 0, 30, CACHE_ALL); /* cache the first 30 MB or RAM */
|
map_section(0x30000000, 0, 32, CACHE_ALL); /* cache the first 31 MB or RAM */
|
||||||
map_section(0x31E00000, 0x31E00000, 1, BUFFERED); /* enable buffered writing for the framebuffer */
|
map_section((int)FRAME, (int)FRAME, 1, BUFFERED); /* enable buffered writing for the framebuffer */
|
||||||
}
|
}
|
||||||
|
|
||||||
void map_section(unsigned int pa, unsigned int va, int mb, int cache_flags) {
|
void map_section(unsigned int pa, unsigned int va, int mb, int cache_flags) {
|
||||||
|
|
|
@ -59,6 +59,7 @@ void system_init(void)
|
||||||
|
|
||||||
/* Turn off AC97 and Camera */
|
/* Turn off AC97 and Camera */
|
||||||
CLKCON &= ~( (1<<19) | (1<<20) );
|
CLKCON &= ~( (1<<19) | (1<<20) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
108
tools/configure
vendored
108
tools/configure
vendored
|
@ -167,7 +167,7 @@ simcc () {
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "`uname -m`" = "x86_64" ]; then
|
if [ "`uname -m`" = "x86_64" ]; then
|
||||||
GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
|
GCCOPTS="$GCCOPTS -fPIC" # needed to make shared objects link
|
||||||
fi
|
fi
|
||||||
|
@ -284,7 +284,7 @@ whichdevel () {
|
||||||
echo "done"
|
echo "done"
|
||||||
cont=0
|
cont=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "yes" = "$use_debug" ]; then
|
if [ "yes" = "$use_debug" ]; then
|
||||||
|
@ -402,7 +402,7 @@ voiceconfig () {
|
||||||
NOISEFLOOR=$DEFAULT_NOISEFLOOR
|
NOISEFLOOR=$DEFAULT_NOISEFLOOR
|
||||||
esac
|
esac
|
||||||
echo "Using $TTS_ENGINE for TTS"
|
echo "Using $TTS_ENGINE for TTS"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
if [ `which oggenc` ]; then
|
if [ `which oggenc` ]; then
|
||||||
|
@ -416,7 +416,7 @@ voiceconfig () {
|
||||||
SPEEXENC="(S)peexenc "
|
SPEEXENC="(S)peexenc "
|
||||||
DEFAULT_ENC="speexenc"
|
DEFAULT_ENC="speexenc"
|
||||||
SPEEX_OPTS="" # TODO: find appropriate options for speex
|
SPEEX_OPTS="" # TODO: find appropriate options for speex
|
||||||
DEFAULT_ENC_OPTS=$SPEEX_OPTS
|
DEFAULT_ENC_OPTS=$SPEEX_OPTS
|
||||||
DEFAULT_CHOICE="S"
|
DEFAULT_CHOICE="S"
|
||||||
fi
|
fi
|
||||||
if [ `which lame` ]; then
|
if [ `which lame` ]; then
|
||||||
|
@ -464,32 +464,32 @@ ${ENC_OPTS}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
picklang() {
|
picklang() {
|
||||||
# figure out which languages that are around
|
# figure out which languages that are around
|
||||||
for file in $rootdir/apps/lang/*.lang; do
|
for file in $rootdir/apps/lang/*.lang; do
|
||||||
clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
|
clean=`echo $file | sed -e 's:.*/::g' | cut "-d." -f1`
|
||||||
langs="$langs $clean"
|
langs="$langs $clean"
|
||||||
done
|
done
|
||||||
|
|
||||||
num=1
|
num=1
|
||||||
for one in $langs; do
|
for one in $langs; do
|
||||||
echo "$num. $one"
|
echo "$num. $one"
|
||||||
num=`expr $num + 1`
|
num=`expr $num + 1`
|
||||||
done
|
done
|
||||||
|
|
||||||
read pick
|
read pick
|
||||||
return $pick;
|
return $pick;
|
||||||
}
|
}
|
||||||
|
|
||||||
whichlang() {
|
whichlang() {
|
||||||
num=1
|
num=1
|
||||||
for one in $langs; do
|
for one in $langs; do
|
||||||
if [ "$num" = "$pick" ]; then
|
if [ "$num" = "$pick" ]; then
|
||||||
echo $one
|
echo $one
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
num=`expr $num + 1`
|
num=`expr $num + 1`
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
target=$1
|
target=$1
|
||||||
|
@ -553,17 +553,17 @@ toolsdir='\$(ROOTDIR)/tools'
|
||||||
|
|
||||||
echo "Enter target platform:"
|
echo "Enter target platform:"
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
==Archos== ==iriver== ==Apple iPod==
|
==Archos== ==iriver== ==Apple iPod==
|
||||||
0) Player/Studio 10) H120/H140 20) Color/Photo
|
0) Player/Studio 10) H120/H140 20) Color/Photo
|
||||||
1) Recorder 11) H320/H340 21) Nano
|
1) Recorder 11) H320/H340 21) Nano
|
||||||
2) FM Recorder 12) iHP-100/110/115 22) Video
|
2) FM Recorder 12) iHP-100/110/115 22) Video
|
||||||
3) Recorder v2 13) iFP-790 23) 3G
|
3) Recorder v2 13) iFP-790 23) 3G
|
||||||
4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
|
4) Ondio SP 14) H10 20Gb 24) 4G Grayscale
|
||||||
5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
|
5) Ondio FM 15) H10 5/6Gb 25) Mini 1G
|
||||||
26) Mini 2G
|
26) Mini 2G
|
||||||
|
|
||||||
==iAudio== ==Toshiba== ==SanDisk==
|
==iAudio== ==Toshiba== ==SanDisk==
|
||||||
30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
|
30) X5/X5V/X5L 40) Gigabeat F 50) Sansa e200
|
||||||
|
|
||||||
==Tatung==
|
==Tatung==
|
||||||
60) Elio TPJ-1022
|
60) Elio TPJ-1022
|
||||||
|
@ -598,7 +598,7 @@ EOF
|
||||||
# output: the final output file name
|
# output: the final output file name
|
||||||
# boottool: the tool that takes a plain binary and generates a bootloader
|
# boottool: the tool that takes a plain binary and generates a bootloader
|
||||||
# file for your target (or blank to use $tool)
|
# file for your target (or blank to use $tool)
|
||||||
# bootoutput:the final output file name for the bootloader (or blank to use
|
# bootoutput:the final output file name for the bootloader (or blank to use
|
||||||
# $output)
|
# $output)
|
||||||
# appextra: passed to the APPEXTRA variable in the Makefiles.
|
# appextra: passed to the APPEXTRA variable in the Makefiles.
|
||||||
# TODO: add proper explanation
|
# TODO: add proper explanation
|
||||||
|
@ -953,7 +953,7 @@ EOF
|
||||||
t_manufacturer="ipod"
|
t_manufacturer="ipod"
|
||||||
t_model="3g"
|
t_model="3g"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
24|ipod4g)
|
24|ipod4g)
|
||||||
target_id=17
|
target_id=17
|
||||||
archos="ipod4g"
|
archos="ipod4g"
|
||||||
|
@ -978,7 +978,7 @@ EOF
|
||||||
t_manufacturer="ipod"
|
t_manufacturer="ipod"
|
||||||
t_model="4g"
|
t_model="4g"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
25|ipodmini)
|
25|ipodmini)
|
||||||
target_id=18
|
target_id=18
|
||||||
archos="ipodmini"
|
archos="ipodmini"
|
||||||
|
@ -1003,7 +1003,7 @@ EOF
|
||||||
t_manufacturer="ipod"
|
t_manufacturer="ipod"
|
||||||
t_model="mini"
|
t_model="mini"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
13|ifp7xx)
|
13|ifp7xx)
|
||||||
target_id=19
|
target_id=19
|
||||||
archos="ifp7xx"
|
archos="ifp7xx"
|
||||||
|
@ -1031,7 +1031,7 @@ EOF
|
||||||
target_id=20
|
target_id=20
|
||||||
archos="gigabeatf"
|
archos="gigabeatf"
|
||||||
target="-DGIGABEAT_F"
|
target="-DGIGABEAT_F"
|
||||||
memory=30 # always
|
memory=32 # always
|
||||||
arm9tdmicc
|
arm9tdmicc
|
||||||
tool="cp"
|
tool="cp"
|
||||||
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
|
||||||
|
@ -1286,7 +1286,7 @@ fi
|
||||||
toolset='';
|
toolset='';
|
||||||
apps="manual"
|
apps="manual"
|
||||||
echo "Manual build selected"
|
echo "Manual build selected"
|
||||||
;;
|
;;
|
||||||
[Vv])
|
[Vv])
|
||||||
echo "Voice build selected"
|
echo "Voice build selected"
|
||||||
voiceconfig
|
voiceconfig
|
||||||
|
@ -1312,7 +1312,7 @@ fi
|
||||||
;;
|
;;
|
||||||
ipodmini2g)
|
ipodmini2g)
|
||||||
manualdev="ipodmini"
|
manualdev="ipodmini"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
manualdev=$archos
|
manualdev=$archos
|
||||||
;;
|
;;
|
||||||
|
@ -1329,15 +1329,15 @@ language="english"
|
||||||
|
|
||||||
# Ask about language if building voice
|
# Ask about language if building voice
|
||||||
if [ "yes" = "$voice" ]; then
|
if [ "yes" = "$voice" ]; then
|
||||||
echo "Select a number for the language to use (default is english)"
|
echo "Select a number for the language to use (default is english)"
|
||||||
|
|
||||||
picklang
|
picklang
|
||||||
language=`whichlang`
|
language=`whichlang`
|
||||||
|
|
||||||
if [ -z "$language" ]; then
|
if [ -z "$language" ]; then
|
||||||
# pick a default
|
# pick a default
|
||||||
language="english"
|
language="english"
|
||||||
fi
|
fi
|
||||||
echo "Language set to $language"
|
echo "Language set to $language"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1378,14 +1378,14 @@ else
|
||||||
|
|
||||||
echo "Using $CC $gccver ($gccnum)"
|
echo "Using $CC $gccver ($gccnum)"
|
||||||
|
|
||||||
if test "$gccnum" -ge "400"; then
|
if test "$gccnum" -ge "400"; then
|
||||||
# gcc 4.0 is just *so* much pickier on arguments that differ in signedness
|
# gcc 4.0 is just *so* much pickier on arguments that differ in signedness
|
||||||
# so we ignore that warnings for now
|
# so we ignore that warnings for now
|
||||||
# -Wno-pointer-sign
|
# -Wno-pointer-sign
|
||||||
GCCOPTS="$GCCOPTS -Wno-pointer-sign"
|
GCCOPTS="$GCCOPTS -Wno-pointer-sign"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$gccnum" -ge "401"; then
|
if test "$gccnum" -ge "401"; then
|
||||||
# this is a lame hack to avoid "warning: dereferencing type-punned pointer
|
# this is a lame hack to avoid "warning: dereferencing type-punned pointer
|
||||||
# will break strict-aliasing rules"
|
# will break strict-aliasing rules"
|
||||||
|
|
||||||
|
@ -1396,7 +1396,7 @@ fi
|
||||||
|
|
||||||
# check the compiler for SH platforms
|
# check the compiler for SH platforms
|
||||||
if test "$CC" = "sh-elf-gcc"; then
|
if test "$CC" = "sh-elf-gcc"; then
|
||||||
if test "$gccnum" -lt "400"; then
|
if test "$gccnum" -lt "400"; then
|
||||||
echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
|
echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
|
||||||
echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
|
echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
|
||||||
else
|
else
|
||||||
|
@ -1689,7 +1689,7 @@ help:
|
||||||
@echo "fontzip - creates rockbox-fonts.zip"
|
@echo "fontzip - creates rockbox-fonts.zip"
|
||||||
@echo "mapzip - creates rockbox-maps.zip with all .map files"
|
@echo "mapzip - creates rockbox-maps.zip with all .map files"
|
||||||
@echo "tools - builds the tools only"
|
@echo "tools - builds the tools only"
|
||||||
@echo "install - installs your build (for simulator builds only)"
|
@echo "install - installs your build (for simulator builds only)"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue