forked from len0rd/rockbox
Add in the needed crt0.S code for the wakeup alarm also
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19094 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
68c686957b
commit
d42041043b
12 changed files with 284 additions and 32 deletions
|
@ -143,6 +143,8 @@ iriverify.c
|
||||||
iriver_flash.c
|
iriver_flash.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gigabeat_flash.c
|
||||||
|
|
||||||
#endif /* iFP7xx */
|
#endif /* iFP7xx */
|
||||||
#if (LCD_WIDTH > 138) && (LCD_DEPTH > 1)
|
#if (LCD_WIDTH > 138) && (LCD_DEPTH > 1)
|
||||||
/* Built for bitmap targets except H10 5/6gb, Archoses, iPod mini, mrobe100 and ifp*/
|
/* Built for bitmap targets except H10 5/6gb, Archoses, iPod mini, mrobe100 and ifp*/
|
||||||
|
|
|
@ -333,8 +333,6 @@ void cpu_timers(int cnt)
|
||||||
|
|
||||||
static int cpu_idle(int max)
|
static int cpu_idle(int max)
|
||||||
{
|
{
|
||||||
int cnt, unit;
|
|
||||||
|
|
||||||
if (!(cpu.halt && IME)) return 0;
|
if (!(cpu.halt && IME)) return 0;
|
||||||
if (R_IF & R_IE)
|
if (R_IF & R_IE)
|
||||||
{
|
{
|
||||||
|
@ -353,6 +351,7 @@ static int cpu_idle(int max)
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cnt, unit;
|
||||||
/* Figure out when the next timer interrupt will happen */
|
/* Figure out when the next timer interrupt will happen */
|
||||||
unit = ((-R_TAC) & 3) << 1;
|
unit = ((-R_TAC) & 3) << 1;
|
||||||
cnt = (511 - cpu.tim + (1<<unit)) >> unit;
|
cnt = (511 - cpu.tim + (1<<unit)) >> unit;
|
||||||
|
|
|
@ -64,7 +64,7 @@ fb_data *vdest;
|
||||||
static void updatepatpix(void) ICODE_ATTR;
|
static void updatepatpix(void) ICODE_ATTR;
|
||||||
static void updatepatpix(void)
|
static void updatepatpix(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i;
|
||||||
#if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE))
|
#if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE))
|
||||||
int k, a, c;
|
int k, a, c;
|
||||||
#endif
|
#endif
|
||||||
|
@ -73,10 +73,12 @@ static void updatepatpix(void)
|
||||||
if (!anydirty) return;
|
if (!anydirty) return;
|
||||||
for (i = 0; i < 1024; i++)
|
for (i = 0; i < 1024; i++)
|
||||||
{
|
{
|
||||||
|
int j;
|
||||||
if (i == 384) i = 512;
|
if (i == 384) i = 512;
|
||||||
if (i == 896) break;
|
if (i == 896) break;
|
||||||
if (!patdirty[i]) continue;
|
if (!patdirty[i]) continue;
|
||||||
patdirty[i] = 0;
|
patdirty[i] = 0;
|
||||||
|
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
{
|
{
|
||||||
#if CONFIG_CPU == SH7034
|
#if CONFIG_CPU == SH7034
|
||||||
|
@ -376,8 +378,8 @@ static void tilebuf(void)
|
||||||
int base;
|
int base;
|
||||||
byte *tilemap, *attrmap;
|
byte *tilemap, *attrmap;
|
||||||
int *tilebuf;
|
int *tilebuf;
|
||||||
int *wrap;
|
const int *wrap;
|
||||||
static int wraptable[64] =
|
static const int wraptable[64] ICONST_ATTR =
|
||||||
{
|
{
|
||||||
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
|
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
|
||||||
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,-32
|
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,-32
|
||||||
|
@ -778,11 +780,11 @@ static void spr_enum(void)
|
||||||
static void spr_scan(void) ICODE_ATTR;
|
static void spr_scan(void) ICODE_ATTR;
|
||||||
static void spr_scan(void)
|
static void spr_scan(void)
|
||||||
{
|
{
|
||||||
int i, x;
|
int i;
|
||||||
byte pal, b, ns = NS;
|
byte ns = NS;
|
||||||
byte *src, *dest, *bg, *pri;
|
byte *src, *dest;
|
||||||
struct vissprite *vs;
|
struct vissprite *vs;
|
||||||
static byte bgdup[256];
|
static byte bgdup[256] IBSS_ATTR;
|
||||||
|
|
||||||
if (!ns) return;
|
if (!ns) return;
|
||||||
|
|
||||||
|
@ -791,7 +793,8 @@ static void spr_scan(void)
|
||||||
|
|
||||||
for (; ns; ns--, vs--)
|
for (; ns; ns--, vs--)
|
||||||
{
|
{
|
||||||
x = vs->x;
|
int x = vs->x;
|
||||||
|
|
||||||
if (x > 159) continue;
|
if (x > 159) continue;
|
||||||
if (x < -7) continue;
|
if (x < -7) continue;
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
|
@ -807,23 +810,25 @@ static void spr_scan(void)
|
||||||
if (x > 152) i = 160 - x;
|
if (x > 152) i = 160 - x;
|
||||||
else i = 8;
|
else i = 8;
|
||||||
}
|
}
|
||||||
pal = vs->pal;
|
|
||||||
|
byte pal = vs->pal;
|
||||||
|
|
||||||
if (vs->pri)
|
if (vs->pri)
|
||||||
{
|
{
|
||||||
bg = bgdup + (dest - BUF);
|
byte *bg = bgdup + (dest - BUF);
|
||||||
while (i--)
|
while (i--)
|
||||||
{
|
{
|
||||||
b = src[i];
|
byte b = src[i];
|
||||||
if (b && !(bg[i]&3)) dest[i] = pal|b;
|
if (b && !(bg[i]&3)) dest[i] = pal|b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (hw.cgb)
|
else if (hw.cgb)
|
||||||
{
|
{
|
||||||
bg = bgdup + (dest - BUF);
|
byte *bg = bgdup + (dest - BUF);
|
||||||
pri = PRI + (dest - BUF);
|
byte *pri = PRI + (dest - BUF);
|
||||||
while (i--)
|
while (i--)
|
||||||
{
|
{
|
||||||
b = src[i];
|
byte b = src[i];
|
||||||
if (b && (!pri[i] || !(bg[i]&3)))
|
if (b && (!pri[i] || !(bg[i]&3)))
|
||||||
dest[i] = pal|b;
|
dest[i] = pal|b;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,9 +116,6 @@ struct snd snd IBSS_ATTR;
|
||||||
static void gbSoundChannel1(int *r, int *l)
|
static void gbSoundChannel1(int *r, int *l)
|
||||||
{
|
{
|
||||||
int vol = S1.envol;
|
int vol = S1.envol;
|
||||||
|
|
||||||
int freq = 0;
|
|
||||||
|
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
|
||||||
if(S1.on && (S1.len || !S1.cont))
|
if(S1.on && (S1.len || !S1.cont))
|
||||||
|
@ -172,7 +169,7 @@ static void gbSoundChannel1(int *r, int *l)
|
||||||
|
|
||||||
if(S1.swlen<=0)
|
if(S1.swlen<=0)
|
||||||
{
|
{
|
||||||
freq = (((int)(R_NR14&7) << 8) | R_NR13);
|
int freq = (((int)(R_NR14&7) << 8) | R_NR13);
|
||||||
|
|
||||||
int updown = 1;
|
int updown = 1;
|
||||||
|
|
||||||
|
|
|
@ -44,11 +44,29 @@
|
||||||
#include "rbunicode.h"
|
#include "rbunicode.h"
|
||||||
#include "usb.h"
|
#include "usb.h"
|
||||||
#include "mmu-arm.h"
|
#include "mmu-arm.h"
|
||||||
|
#include "rtc.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
char version[] = APPSVERSION;
|
char version[] = APPSVERSION;
|
||||||
|
|
||||||
|
void shutdown(void)
|
||||||
|
{
|
||||||
|
/* We need to gracefully spin down the disk to prevent clicks. */
|
||||||
|
if (ide_powered())
|
||||||
|
{
|
||||||
|
/* Make sure ATA has been initialized. */
|
||||||
|
ata_init();
|
||||||
|
|
||||||
|
/* And put the disk into sleep immediately. */
|
||||||
|
ata_sleepnow();
|
||||||
|
}
|
||||||
|
|
||||||
|
_backlight_off();
|
||||||
|
|
||||||
|
power_off();
|
||||||
|
}
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
unsigned char* loadbuffer;
|
unsigned char* loadbuffer;
|
||||||
|
@ -56,14 +74,67 @@ void main(void)
|
||||||
int rc;
|
int rc;
|
||||||
int(*kernel_entry)(void);
|
int(*kernel_entry)(void);
|
||||||
|
|
||||||
power_init();
|
|
||||||
system_init();
|
system_init();
|
||||||
lcd_init();
|
lcd_init();
|
||||||
backlight_init();
|
backlight_init();
|
||||||
|
button_init();
|
||||||
font_init();
|
font_init();
|
||||||
|
kernel_init(); /* Need the kernel to sleep */
|
||||||
|
adc_init();
|
||||||
|
|
||||||
lcd_setfont(FONT_SYSFIXED);
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
|
if(!(GPGDAT&BUTTON_POWER) && charger_inserted())
|
||||||
|
{
|
||||||
|
while(!(GPGDAT&BUTTON_POWER) && charger_inserted())
|
||||||
|
{
|
||||||
|
char msg[20];
|
||||||
|
if(charging_state())
|
||||||
|
{
|
||||||
|
snprintf(msg,sizeof(msg),"Charging");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
snprintf(msg,sizeof(msg),"Charge Complete");
|
||||||
|
}
|
||||||
|
reset_screen();
|
||||||
|
lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2,
|
||||||
|
(LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
|
||||||
|
lcd_update();
|
||||||
|
|
||||||
|
#if defined(HAVE_RTC_ALARM)
|
||||||
|
/* Check if the alarm went off while charging */
|
||||||
|
if(rtc_check_alarm_flag())
|
||||||
|
{
|
||||||
|
GSTATUS4=1; /* Normally this is set in crt0.s */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if(!(GPGDAT&BUTTON_POWER)
|
||||||
|
#if defined(HAVE_RTC_ALARM)
|
||||||
|
&& !GSTATUS4
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
|
shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(button_hold())
|
||||||
|
{
|
||||||
|
const char msg[] = "HOLD is enabled";
|
||||||
|
reset_screen();
|
||||||
|
lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2,
|
||||||
|
(LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
|
||||||
|
lcd_update();
|
||||||
|
|
||||||
|
sleep(2*HZ);
|
||||||
|
|
||||||
|
shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
power_init();
|
||||||
usb_init();
|
usb_init();
|
||||||
|
|
||||||
/* Enter USB mode without USB thread */
|
/* Enter USB mode without USB thread */
|
||||||
|
@ -88,9 +159,7 @@ void main(void)
|
||||||
lcd_update();
|
lcd_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
kernel_init();
|
reset_screen();
|
||||||
adc_init();
|
|
||||||
button_init();
|
|
||||||
|
|
||||||
/* Show debug messages if button is pressed */
|
/* Show debug messages if button is pressed */
|
||||||
if(button_read_device())
|
if(button_read_device())
|
||||||
|
|
|
@ -219,6 +219,8 @@ void audiohw_close(void)
|
||||||
/* 2. Disable all output buffers. */
|
/* 2. Disable all output buffers. */
|
||||||
wmcodec_write(PWRMGMT2, 0x0);
|
wmcodec_write(PWRMGMT2, 0x0);
|
||||||
|
|
||||||
|
sleep(HZ);
|
||||||
|
|
||||||
/* 3. Switch off the power supplies. */
|
/* 3. Switch off the power supplies. */
|
||||||
wmcodec_write(PWRMGMT1, 0x0);
|
wmcodec_write(PWRMGMT1, 0x0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
/* For Rolo and boot loader */
|
/* For Rolo and boot loader */
|
||||||
#define MODEL_NUMBER 18
|
#define MODEL_NUMBER 18
|
||||||
|
|
||||||
|
/* Define RTC alarm */
|
||||||
|
#define HAVE_RTC_ALARM
|
||||||
|
|
||||||
/* define this if you use an ATA controller */
|
/* define this if you use an ATA controller */
|
||||||
#define CONFIG_STORAGE STORAGE_ATA
|
#define CONFIG_STORAGE STORAGE_ATA
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ vectors:
|
||||||
/* Add some strings to detect the bootloader in flash and give it a version
|
/* Add some strings to detect the bootloader in flash and give it a version
|
||||||
* number. (0x040A0028, 0x040A002C)
|
* number. (0x040A0028, 0x040A002C)
|
||||||
*/
|
*/
|
||||||
.string "ROCKBOX"
|
.string "ROCKBOX\0"
|
||||||
.word 0x0001
|
.string "R 03.00\0"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function: word_copy
|
* Function: word_copy
|
||||||
|
@ -99,6 +99,18 @@ start:
|
||||||
cmp r0, #0xA0000
|
cmp r0, #0xA0000
|
||||||
bne poweron
|
bne poweron
|
||||||
|
|
||||||
|
/* Did an RTC event wake the player up? */
|
||||||
|
|
||||||
|
mov r2, #0x4A000000
|
||||||
|
ldr r1, [r2]
|
||||||
|
ands r1, r1, #0x40000000
|
||||||
|
|
||||||
|
/* Woke up with the alarm - store a flag in GSTATUS3 */
|
||||||
|
ldrne r2, =0x560000b8
|
||||||
|
movne r1, #0x01
|
||||||
|
strne r1, [r2]
|
||||||
|
bne poweron
|
||||||
|
|
||||||
/* Set GPG up to read power and menu status */
|
/* Set GPG up to read power and menu status */
|
||||||
ldr r2, =0x56000050
|
ldr r2, =0x56000050
|
||||||
ldr r1, [r2, #0x18]
|
ldr r1, [r2, #0x18]
|
||||||
|
|
|
@ -32,7 +32,44 @@
|
||||||
|
|
||||||
bool __dbg_hw_info(void)
|
bool __dbg_hw_info(void)
|
||||||
{
|
{
|
||||||
return false;
|
char buf[50];
|
||||||
|
int line, button;
|
||||||
|
|
||||||
|
char reg=0, value=0;
|
||||||
|
|
||||||
|
lcd_clear_display();
|
||||||
|
lcd_setfont(FONT_SYSFIXED);
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
line=0;
|
||||||
|
snprintf(buf, sizeof(buf), "reg: %08x value: %08x", reg, value);
|
||||||
|
lcd_puts(0, line++, buf);
|
||||||
|
|
||||||
|
button = button_get_w_tmo(HZ/10);
|
||||||
|
|
||||||
|
if (button == BUTTON_UP)
|
||||||
|
reg++;
|
||||||
|
if (button == BUTTON_DOWN)
|
||||||
|
reg--;
|
||||||
|
|
||||||
|
if (button == BUTTON_VOL_UP)
|
||||||
|
value++;
|
||||||
|
if (button == BUTTON_VOL_DOWN)
|
||||||
|
value--;
|
||||||
|
|
||||||
|
if (button == BUTTON_A)
|
||||||
|
{
|
||||||
|
// LCD_SPI_start();
|
||||||
|
// LCD_SPI_setreg(reg, value);
|
||||||
|
// LCD_SPI_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
lcd_update();
|
||||||
|
|
||||||
|
if (button == (DEBUG_CANCEL|BUTTON_REL))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool __dbg_ports(void)
|
bool __dbg_ports(void)
|
||||||
|
|
|
@ -244,7 +244,7 @@ static void LCD_SPI_init(void)
|
||||||
/* LCD init */
|
/* LCD init */
|
||||||
void lcd_init_device(void)
|
void lcd_init_device(void)
|
||||||
{
|
{
|
||||||
#ifdef BOOTLOADER
|
#if 0//def BOOTLOADER
|
||||||
int i;
|
int i;
|
||||||
/* When the Rockbox bootloader starts, we are changing framebuffer address,
|
/* When the Rockbox bootloader starts, we are changing framebuffer address,
|
||||||
but we don't want what's shown on the LCD to change until we do an
|
but we don't want what's shown on the LCD to change until we do an
|
||||||
|
|
|
@ -71,6 +71,11 @@ void power_off(void)
|
||||||
_buttonlight_off();
|
_buttonlight_off();
|
||||||
sleep(HZ);
|
sleep(HZ);
|
||||||
|
|
||||||
|
/* Do this to allow the drive to properly reset when player restarts
|
||||||
|
* immediately without running OF shutdown.
|
||||||
|
*/
|
||||||
|
GPGCON&=~0x00300000;
|
||||||
|
|
||||||
/* Rockbox never properly shutdown the player. When the sleep bit is set
|
/* Rockbox never properly shutdown the player. When the sleep bit is set
|
||||||
* the player actually wakes up in some type of "zombie" state
|
* the player actually wakes up in some type of "zombie" state
|
||||||
* because the shutdown routine is not set up properly. So far the
|
* because the shutdown routine is not set up properly. So far the
|
||||||
|
@ -81,6 +86,122 @@ void power_off(void)
|
||||||
CLKCON |=(1<<3);
|
CLKCON |=(1<<3);
|
||||||
|
|
||||||
reboot_point();
|
reboot_point();
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
GPBCON=0x00015450;
|
||||||
|
GPBDAT=0x403;
|
||||||
|
GPBUP=0x3FD;
|
||||||
|
|
||||||
|
GPCCON =0xAAA054A8;
|
||||||
|
GPCDAT =0x0000038C;
|
||||||
|
GPCUP =0xFFFF;
|
||||||
|
|
||||||
|
|
||||||
|
GPDCON =0xAAA0AAA5;
|
||||||
|
GPDDAT =0x00000300;
|
||||||
|
GPDUP =0xFCFF;
|
||||||
|
|
||||||
|
|
||||||
|
GPECON =0xAA8002AA;
|
||||||
|
GPEDAT =0x0000FFED;
|
||||||
|
GPEUP =0x3817;
|
||||||
|
|
||||||
|
GPFCON =0x00000a00;
|
||||||
|
GPFDAT =0x000000F1;
|
||||||
|
GPFUP =0x000000FF;
|
||||||
|
|
||||||
|
GPGCON =0x01401002;
|
||||||
|
GPGDAT =0x00000180;
|
||||||
|
GPGUP =0x0000FF7F;
|
||||||
|
|
||||||
|
GPHCON =0x001540A5;
|
||||||
|
GPHDAT =0x000006FD;
|
||||||
|
GPHUP =0x00000187;
|
||||||
|
|
||||||
|
// mine
|
||||||
|
INTMSK =0xFFFFFFFF;
|
||||||
|
EINTMASK=0x0FFFFEF0;
|
||||||
|
EXTINT0 =0xFFFFFECF;
|
||||||
|
EXTINT1 =0x07;
|
||||||
|
//
|
||||||
|
|
||||||
|
// INTMSK=0xFFFFFFFF;
|
||||||
|
// EINTMASK=0x00200000;
|
||||||
|
|
||||||
|
// GPHDAT=0x00000004;
|
||||||
|
|
||||||
|
// EXTINT0=~0x00000130;
|
||||||
|
// INTMSK=(~0x00000130)+0x00000100;
|
||||||
|
// GPGUP=0xFFFFFFFF;
|
||||||
|
|
||||||
|
//mine
|
||||||
|
INTMSK =0xFFFFFFDE;
|
||||||
|
//
|
||||||
|
|
||||||
|
SRCPND=0xFFFFFFFF;
|
||||||
|
INTPND=0xFFFFFFFF;
|
||||||
|
GSTATUS1=0x00000600;
|
||||||
|
|
||||||
|
ADCCON=0x00000004;
|
||||||
|
|
||||||
|
// MISCCR=MISCCR&(~0x703000)|0x603000;
|
||||||
|
LCDCON1=0x00000000;
|
||||||
|
LOCKTIME=0xFFFFFFFF;
|
||||||
|
// REFRESH=REFRESH|0x00400000;
|
||||||
|
|
||||||
|
// MISCCR=MISCCR|0x000E0000;
|
||||||
|
|
||||||
|
// CLKCON=CLKCON|0x00004018;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This next piece of code was taken from the linux 2.6.17 sources:
|
||||||
|
* linux/arch/arm/mach-s3c2410/sleep.S
|
||||||
|
*
|
||||||
|
* Copyright (c) 2004 Simtec Electronics
|
||||||
|
* Ben Dooks <ben@simtec.co.uk>
|
||||||
|
*
|
||||||
|
* Based on PXA/SA1100 sleep code by:
|
||||||
|
* Nicolas Pitre, (c) 2002 Monta Vista Software Inc
|
||||||
|
* Cliff Brake, (c) 2001
|
||||||
|
*/
|
||||||
|
|
||||||
|
asm volatile
|
||||||
|
(
|
||||||
|
/* get REFRESH, MISCCR, and CLKCON (and ensure in TLB) */
|
||||||
|
"ldr r4, =0x48000024 \n"
|
||||||
|
"ldr r5, =0x56000080 \n"
|
||||||
|
"ldr r6, =0x4C00000C \n"
|
||||||
|
"ldr r7, [ r4 ] \n"
|
||||||
|
"ldr r8, [ r5 ] \n"
|
||||||
|
"ldr r9, [ r6 ] \n"
|
||||||
|
|
||||||
|
/* Setup register writes */
|
||||||
|
"ldr r2, =0x006E3000 \n"
|
||||||
|
"ldr r3, =0x00004018 \n"
|
||||||
|
"orr r7, r7, #0x00400000 \n" /* SDRAM sleep command */
|
||||||
|
"orr r8, r8, r2 \n" /* SDRAM power-down signals */
|
||||||
|
"orr r9, r9, r3 \n" /* power down command */
|
||||||
|
|
||||||
|
/* first as a trial-run to load cache */
|
||||||
|
"teq pc, #0 \n"
|
||||||
|
"bl s3c2410_do_sleep \n"
|
||||||
|
|
||||||
|
/* now do it for real */
|
||||||
|
"teq r0, r0 \n"
|
||||||
|
"b s3c2410_do_sleep \n"
|
||||||
|
|
||||||
|
/* align next bit of code to cache line */
|
||||||
|
".align 8 \n"
|
||||||
|
"s3c2410_do_sleep: \n"
|
||||||
|
"streq r7, [ r4 ] \n" /* SDRAM sleep command */
|
||||||
|
"streq r8, [ r5 ] \n" /* SDRAM power-down config */
|
||||||
|
"streq r3, [ r6 ] \n" /* CPU sleep */
|
||||||
|
"1: \n"
|
||||||
|
"beq 1b \n"
|
||||||
|
"bx lr \n"
|
||||||
|
);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* SIMULATOR */
|
#else /* SIMULATOR */
|
||||||
|
|
|
@ -113,9 +113,14 @@ void system_reboot(void)
|
||||||
|
|
||||||
static void set_page_tables(void)
|
static void set_page_tables(void)
|
||||||
{
|
{
|
||||||
map_section(0, 0, 0x1000, CACHE_NONE); /* map every memory region to itself */
|
/* map every memory region to itself */
|
||||||
map_section(0x30000000, 0, 32, CACHE_ALL); /* map RAM to 0 and enable caching for it */
|
map_section(0, 0, 0x1000, CACHE_NONE);
|
||||||
map_section((int)FRAME, (int)FRAME, 1, BUFFERED); /* enable buffered writing for the framebuffer */
|
|
||||||
|
/* map RAM to 0 and enable caching for it */
|
||||||
|
map_section(0x30000000, 0, 32, CACHE_ALL);
|
||||||
|
|
||||||
|
/* enable buffered writing for the framebuffer */
|
||||||
|
map_section((int)FRAME, (int)FRAME, 1, BUFFERED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void memory_init(void) {
|
void memory_init(void) {
|
||||||
|
@ -145,7 +150,7 @@ void s3c_regclr(volatile int *reg, unsigned int mask)
|
||||||
void system_init(void)
|
void system_init(void)
|
||||||
{
|
{
|
||||||
INTMSK = 0xFFFFFFFF;
|
INTMSK = 0xFFFFFFFF;
|
||||||
INTMOD = 0;
|
INTMOD = 0;
|
||||||
SRCPND = 0xFFFFFFFF;
|
SRCPND = 0xFFFFFFFF;
|
||||||
INTPND = 0xFFFFFFFF;
|
INTPND = 0xFFFFFFFF;
|
||||||
INTSUBMSK = 0xFFFFFFFF;
|
INTSUBMSK = 0xFFFFFFFF;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue