diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2008-11-12 04:15:34 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2008-11-12 04:15:34 +0000 |
commit | 59d4d2025c9f1b0a68b780fe6a6f0e313caf3027 (patch) | |
tree | 600746fc28046ddfc58498fd69d4afef8d40e419 | |
parent | d42041043b95617244ffdb9150c5e2f2720a8a83 (diff) | |
download | rockbox-59d4d2025c9f1b0a68b780fe6a6f0e313caf3027.tar.gz rockbox-59d4d2025c9f1b0a68b780fe6a6f0e313caf3027.zip |
Revert last commit (accidentally committed the whole tree)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19095 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/SOURCES | 2 | ||||
-rw-r--r-- | apps/plugins/rockboy/cpu.c | 3 | ||||
-rw-r--r-- | apps/plugins/rockboy/lcd.c | 33 | ||||
-rw-r--r-- | apps/plugins/rockboy/sound.c | 5 | ||||
-rw-r--r-- | bootloader/gigabeat.c | 77 | ||||
-rw-r--r-- | firmware/drivers/audio/wm8751.c | 2 | ||||
-rw-r--r-- | firmware/export/config-gigabeat.h | 3 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/crt0.S | 16 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/debug-s3c2440.c | 39 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c | 121 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c | 13 |
12 files changed, 32 insertions, 284 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index edeaf216a8..a4ddbacfd0 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -143,8 +143,6 @@ iriverify.c | |||
143 | iriver_flash.c | 143 | iriver_flash.c |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | gigabeat_flash.c | ||
147 | |||
148 | #endif /* iFP7xx */ | 146 | #endif /* iFP7xx */ |
149 | #if (LCD_WIDTH > 138) && (LCD_DEPTH > 1) | 147 | #if (LCD_WIDTH > 138) && (LCD_DEPTH > 1) |
150 | /* Built for bitmap targets except H10 5/6gb, Archoses, iPod mini, mrobe100 and ifp*/ | 148 | /* Built for bitmap targets except H10 5/6gb, Archoses, iPod mini, mrobe100 and ifp*/ |
diff --git a/apps/plugins/rockboy/cpu.c b/apps/plugins/rockboy/cpu.c index f1926fe421..1aca06f337 100644 --- a/apps/plugins/rockboy/cpu.c +++ b/apps/plugins/rockboy/cpu.c | |||
@@ -333,6 +333,8 @@ void cpu_timers(int cnt) | |||
333 | 333 | ||
334 | static int cpu_idle(int max) | 334 | static int cpu_idle(int max) |
335 | { | 335 | { |
336 | int cnt, unit; | ||
337 | |||
336 | if (!(cpu.halt && IME)) return 0; | 338 | if (!(cpu.halt && IME)) return 0; |
337 | if (R_IF & R_IE) | 339 | if (R_IF & R_IE) |
338 | { | 340 | { |
@@ -351,7 +353,6 @@ static int cpu_idle(int max) | |||
351 | return max; | 353 | return max; |
352 | } | 354 | } |
353 | 355 | ||
354 | int cnt, unit; | ||
355 | /* Figure out when the next timer interrupt will happen */ | 356 | /* Figure out when the next timer interrupt will happen */ |
356 | unit = ((-R_TAC) & 3) << 1; | 357 | unit = ((-R_TAC) & 3) << 1; |
357 | cnt = (511 - cpu.tim + (1<<unit)) >> unit; | 358 | cnt = (511 - cpu.tim + (1<<unit)) >> unit; |
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c index f62e3a9ce3..da3b138e51 100644 --- a/apps/plugins/rockboy/lcd.c +++ b/apps/plugins/rockboy/lcd.c | |||
@@ -64,7 +64,7 @@ fb_data *vdest; | |||
64 | static void updatepatpix(void) ICODE_ATTR; | 64 | static void updatepatpix(void) ICODE_ATTR; |
65 | static void updatepatpix(void) | 65 | static void updatepatpix(void) |
66 | { | 66 | { |
67 | int i; | 67 | int i, j; |
68 | #if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE)) | 68 | #if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE)) |
69 | int k, a, c; | 69 | int k, a, c; |
70 | #endif | 70 | #endif |
@@ -73,12 +73,10 @@ static void updatepatpix(void) | |||
73 | if (!anydirty) return; | 73 | if (!anydirty) return; |
74 | for (i = 0; i < 1024; i++) | 74 | for (i = 0; i < 1024; i++) |
75 | { | 75 | { |
76 | int j; | ||
77 | if (i == 384) i = 512; | 76 | if (i == 384) i = 512; |
78 | if (i == 896) break; | 77 | if (i == 896) break; |
79 | if (!patdirty[i]) continue; | 78 | if (!patdirty[i]) continue; |
80 | patdirty[i] = 0; | 79 | patdirty[i] = 0; |
81 | |||
82 | for (j = 0; j < 8; j++) | 80 | for (j = 0; j < 8; j++) |
83 | { | 81 | { |
84 | #if CONFIG_CPU == SH7034 | 82 | #if CONFIG_CPU == SH7034 |
@@ -378,8 +376,8 @@ static void tilebuf(void) | |||
378 | int base; | 376 | int base; |
379 | byte *tilemap, *attrmap; | 377 | byte *tilemap, *attrmap; |
380 | int *tilebuf; | 378 | int *tilebuf; |
381 | const int *wrap; | 379 | int *wrap; |
382 | static const int wraptable[64] ICONST_ATTR = | 380 | static int wraptable[64] = |
383 | { | 381 | { |
384 | 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, | 382 | 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, |
385 | 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,-32 | 383 | 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,-32 |
@@ -780,11 +778,11 @@ static void spr_enum(void) | |||
780 | static void spr_scan(void) ICODE_ATTR; | 778 | static void spr_scan(void) ICODE_ATTR; |
781 | static void spr_scan(void) | 779 | static void spr_scan(void) |
782 | { | 780 | { |
783 | int i; | 781 | int i, x; |
784 | byte ns = NS; | 782 | byte pal, b, ns = NS; |
785 | byte *src, *dest; | 783 | byte *src, *dest, *bg, *pri; |
786 | struct vissprite *vs; | 784 | struct vissprite *vs; |
787 | static byte bgdup[256] IBSS_ATTR; | 785 | static byte bgdup[256]; |
788 | 786 | ||
789 | if (!ns) return; | 787 | if (!ns) return; |
790 | 788 | ||
@@ -793,8 +791,7 @@ static void spr_scan(void) | |||
793 | 791 | ||
794 | for (; ns; ns--, vs--) | 792 | for (; ns; ns--, vs--) |
795 | { | 793 | { |
796 | int x = vs->x; | 794 | x = vs->x; |
797 | |||
798 | if (x > 159) continue; | 795 | if (x > 159) continue; |
799 | if (x < -7) continue; | 796 | if (x < -7) continue; |
800 | if (x < 0) | 797 | if (x < 0) |
@@ -810,25 +807,23 @@ static void spr_scan(void) | |||
810 | if (x > 152) i = 160 - x; | 807 | if (x > 152) i = 160 - x; |
811 | else i = 8; | 808 | else i = 8; |
812 | } | 809 | } |
813 | 810 | pal = vs->pal; | |
814 | byte pal = vs->pal; | ||
815 | |||
816 | if (vs->pri) | 811 | if (vs->pri) |
817 | { | 812 | { |
818 | byte *bg = bgdup + (dest - BUF); | 813 | bg = bgdup + (dest - BUF); |
819 | while (i--) | 814 | while (i--) |
820 | { | 815 | { |
821 | byte b = src[i]; | 816 | b = src[i]; |
822 | if (b && !(bg[i]&3)) dest[i] = pal|b; | 817 | if (b && !(bg[i]&3)) dest[i] = pal|b; |
823 | } | 818 | } |
824 | } | 819 | } |
825 | else if (hw.cgb) | 820 | else if (hw.cgb) |
826 | { | 821 | { |
827 | byte *bg = bgdup + (dest - BUF); | 822 | bg = bgdup + (dest - BUF); |
828 | byte *pri = PRI + (dest - BUF); | 823 | pri = PRI + (dest - BUF); |
829 | while (i--) | 824 | while (i--) |
830 | { | 825 | { |
831 | byte b = src[i]; | 826 | b = src[i]; |
832 | if (b && (!pri[i] || !(bg[i]&3))) | 827 | if (b && (!pri[i] || !(bg[i]&3))) |
833 | dest[i] = pal|b; | 828 | dest[i] = pal|b; |
834 | } | 829 | } |
diff --git a/apps/plugins/rockboy/sound.c b/apps/plugins/rockboy/sound.c index c1b06a1bd7..041b7831d3 100644 --- a/apps/plugins/rockboy/sound.c +++ b/apps/plugins/rockboy/sound.c | |||
@@ -116,6 +116,9 @@ struct snd snd IBSS_ATTR; | |||
116 | static void gbSoundChannel1(int *r, int *l) | 116 | static void gbSoundChannel1(int *r, int *l) |
117 | { | 117 | { |
118 | int vol = S1.envol; | 118 | int vol = S1.envol; |
119 | |||
120 | int freq = 0; | ||
121 | |||
119 | int value = 0; | 122 | int value = 0; |
120 | 123 | ||
121 | if(S1.on && (S1.len || !S1.cont)) | 124 | if(S1.on && (S1.len || !S1.cont)) |
@@ -169,7 +172,7 @@ static void gbSoundChannel1(int *r, int *l) | |||
169 | 172 | ||
170 | if(S1.swlen<=0) | 173 | if(S1.swlen<=0) |
171 | { | 174 | { |
172 | int freq = (((int)(R_NR14&7) << 8) | R_NR13); | 175 | freq = (((int)(R_NR14&7) << 8) | R_NR13); |
173 | 176 | ||
174 | int updown = 1; | 177 | int updown = 1; |
175 | 178 | ||
diff --git a/bootloader/gigabeat.c b/bootloader/gigabeat.c index 575e61c2fa..6b3a68be6e 100644 --- a/bootloader/gigabeat.c +++ b/bootloader/gigabeat.c | |||
@@ -44,29 +44,11 @@ | |||
44 | #include "rbunicode.h" | 44 | #include "rbunicode.h" |
45 | #include "usb.h" | 45 | #include "usb.h" |
46 | #include "mmu-arm.h" | 46 | #include "mmu-arm.h" |
47 | #include "rtc.h" | ||
48 | 47 | ||
49 | #include <stdarg.h> | 48 | #include <stdarg.h> |
50 | 49 | ||
51 | char version[] = APPSVERSION; | 50 | char version[] = APPSVERSION; |
52 | 51 | ||
53 | void shutdown(void) | ||
54 | { | ||
55 | /* We need to gracefully spin down the disk to prevent clicks. */ | ||
56 | if (ide_powered()) | ||
57 | { | ||
58 | /* Make sure ATA has been initialized. */ | ||
59 | ata_init(); | ||
60 | |||
61 | /* And put the disk into sleep immediately. */ | ||
62 | ata_sleepnow(); | ||
63 | } | ||
64 | |||
65 | _backlight_off(); | ||
66 | |||
67 | power_off(); | ||
68 | } | ||
69 | |||
70 | void main(void) | 52 | void main(void) |
71 | { | 53 | { |
72 | unsigned char* loadbuffer; | 54 | unsigned char* loadbuffer; |
@@ -74,67 +56,14 @@ void main(void) | |||
74 | int rc; | 56 | int rc; |
75 | int(*kernel_entry)(void); | 57 | int(*kernel_entry)(void); |
76 | 58 | ||
59 | power_init(); | ||
77 | system_init(); | 60 | system_init(); |
78 | lcd_init(); | 61 | lcd_init(); |
79 | backlight_init(); | 62 | backlight_init(); |
80 | button_init(); | ||
81 | font_init(); | 63 | font_init(); |
82 | kernel_init(); /* Need the kernel to sleep */ | ||
83 | adc_init(); | ||
84 | 64 | ||
85 | lcd_setfont(FONT_SYSFIXED); | 65 | lcd_setfont(FONT_SYSFIXED); |
86 | |||
87 | if(!(GPGDAT&BUTTON_POWER) && charger_inserted()) | ||
88 | { | ||
89 | while(!(GPGDAT&BUTTON_POWER) && charger_inserted()) | ||
90 | { | ||
91 | char msg[20]; | ||
92 | if(charging_state()) | ||
93 | { | ||
94 | snprintf(msg,sizeof(msg),"Charging"); | ||
95 | } | ||
96 | else | ||
97 | { | ||
98 | snprintf(msg,sizeof(msg),"Charge Complete"); | ||
99 | } | ||
100 | reset_screen(); | ||
101 | lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2, | ||
102 | (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg); | ||
103 | lcd_update(); | ||
104 | |||
105 | #if defined(HAVE_RTC_ALARM) | ||
106 | /* Check if the alarm went off while charging */ | ||
107 | if(rtc_check_alarm_flag()) | ||
108 | { | ||
109 | GSTATUS4=1; /* Normally this is set in crt0.s */ | ||
110 | break; | ||
111 | } | ||
112 | #endif | ||
113 | } | ||
114 | if(!(GPGDAT&BUTTON_POWER) | ||
115 | #if defined(HAVE_RTC_ALARM) | ||
116 | && !GSTATUS4 | ||
117 | #endif | ||
118 | ) | ||
119 | { | ||
120 | shutdown(); | ||
121 | } | ||
122 | } | ||
123 | |||
124 | if(button_hold()) | ||
125 | { | ||
126 | const char msg[] = "HOLD is enabled"; | ||
127 | reset_screen(); | ||
128 | lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2, | ||
129 | (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg); | ||
130 | lcd_update(); | ||
131 | |||
132 | sleep(2*HZ); | ||
133 | |||
134 | shutdown(); | ||
135 | } | ||
136 | 66 | ||
137 | power_init(); | ||
138 | usb_init(); | 67 | usb_init(); |
139 | 68 | ||
140 | /* Enter USB mode without USB thread */ | 69 | /* Enter USB mode without USB thread */ |
@@ -159,7 +88,9 @@ void main(void) | |||
159 | lcd_update(); | 88 | lcd_update(); |
160 | } | 89 | } |
161 | 90 | ||
162 | reset_screen(); | 91 | kernel_init(); |
92 | adc_init(); | ||
93 | button_init(); | ||
163 | 94 | ||
164 | /* Show debug messages if button is pressed */ | 95 | /* Show debug messages if button is pressed */ |
165 | if(button_read_device()) | 96 | if(button_read_device()) |
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c index 439d50a5d0..7145fe4ea4 100644 --- a/firmware/drivers/audio/wm8751.c +++ b/firmware/drivers/audio/wm8751.c | |||
@@ -219,8 +219,6 @@ void audiohw_close(void) | |||
219 | /* 2. Disable all output buffers. */ | 219 | /* 2. Disable all output buffers. */ |
220 | wmcodec_write(PWRMGMT2, 0x0); | 220 | wmcodec_write(PWRMGMT2, 0x0); |
221 | 221 | ||
222 | sleep(HZ); | ||
223 | |||
224 | /* 3. Switch off the power supplies. */ | 222 | /* 3. Switch off the power supplies. */ |
225 | wmcodec_write(PWRMGMT1, 0x0); | 223 | wmcodec_write(PWRMGMT1, 0x0); |
226 | } | 224 | } |
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h index a75dbc8a55..0c5462400b 100644 --- a/firmware/export/config-gigabeat.h +++ b/firmware/export/config-gigabeat.h | |||
@@ -10,9 +10,6 @@ | |||
10 | /* For Rolo and boot loader */ | 10 | /* For Rolo and boot loader */ |
11 | #define MODEL_NUMBER 18 | 11 | #define MODEL_NUMBER 18 |
12 | 12 | ||
13 | /* Define RTC alarm */ | ||
14 | #define HAVE_RTC_ALARM | ||
15 | |||
16 | /* define this if you use an ATA controller */ | 13 | /* define this if you use an ATA controller */ |
17 | #define CONFIG_STORAGE STORAGE_ATA | 14 | #define CONFIG_STORAGE STORAGE_ATA |
18 | 15 | ||
diff --git a/firmware/target/arm/s3c2440/crt0.S b/firmware/target/arm/s3c2440/crt0.S index af0ef5bba8..ff5eafd042 100644 --- a/firmware/target/arm/s3c2440/crt0.S +++ b/firmware/target/arm/s3c2440/crt0.S | |||
@@ -49,8 +49,8 @@ vectors: | |||
49 | /* Add some strings to detect the bootloader in flash and give it a version | 49 | /* Add some strings to detect the bootloader in flash and give it a version |
50 | * number. (0x040A0028, 0x040A002C) | 50 | * number. (0x040A0028, 0x040A002C) |
51 | */ | 51 | */ |
52 | .string "ROCKBOX\0" | 52 | .string "ROCKBOX" |
53 | .string "R 03.00\0" | 53 | .word 0x0001 |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * Function: word_copy | 56 | * Function: word_copy |
@@ -99,18 +99,6 @@ start: | |||
99 | cmp r0, #0xA0000 | 99 | cmp r0, #0xA0000 |
100 | bne poweron | 100 | bne poweron |
101 | 101 | ||
102 | /* Did an RTC event wake the player up? */ | ||
103 | |||
104 | mov r2, #0x4A000000 | ||
105 | ldr r1, [r2] | ||
106 | ands r1, r1, #0x40000000 | ||
107 | |||
108 | /* Woke up with the alarm - store a flag in GSTATUS3 */ | ||
109 | ldrne r2, =0x560000b8 | ||
110 | movne r1, #0x01 | ||
111 | strne r1, [r2] | ||
112 | bne poweron | ||
113 | |||
114 | /* Set GPG up to read power and menu status */ | 102 | /* Set GPG up to read power and menu status */ |
115 | ldr r2, =0x56000050 | 103 | ldr r2, =0x56000050 |
116 | ldr r1, [r2, #0x18] | 104 | ldr r1, [r2, #0x18] |
diff --git a/firmware/target/arm/s3c2440/debug-s3c2440.c b/firmware/target/arm/s3c2440/debug-s3c2440.c index 6cd6d649cf..97b7123a43 100644 --- a/firmware/target/arm/s3c2440/debug-s3c2440.c +++ b/firmware/target/arm/s3c2440/debug-s3c2440.c | |||
@@ -32,44 +32,7 @@ | |||
32 | 32 | ||
33 | bool __dbg_hw_info(void) | 33 | bool __dbg_hw_info(void) |
34 | { | 34 | { |
35 | char buf[50]; | 35 | return false; |
36 | int line, button; | ||
37 | |||
38 | char reg=0, value=0; | ||
39 | |||
40 | lcd_clear_display(); | ||
41 | lcd_setfont(FONT_SYSFIXED); | ||
42 | |||
43 | while(1) | ||
44 | { | ||
45 | line=0; | ||
46 | snprintf(buf, sizeof(buf), "reg: %08x value: %08x", reg, value); | ||
47 | lcd_puts(0, line++, buf); | ||
48 | |||
49 | button = button_get_w_tmo(HZ/10); | ||
50 | |||
51 | if (button == BUTTON_UP) | ||
52 | reg++; | ||
53 | if (button == BUTTON_DOWN) | ||
54 | reg--; | ||
55 | |||
56 | if (button == BUTTON_VOL_UP) | ||
57 | value++; | ||
58 | if (button == BUTTON_VOL_DOWN) | ||
59 | value--; | ||
60 | |||
61 | if (button == BUTTON_A) | ||
62 | { | ||
63 | // LCD_SPI_start(); | ||
64 | // LCD_SPI_setreg(reg, value); | ||
65 | // LCD_SPI_stop(); | ||
66 | } | ||
67 | |||
68 | lcd_update(); | ||
69 | |||
70 | if (button == (DEBUG_CANCEL|BUTTON_REL)) | ||
71 | return false; | ||
72 | } | ||
73 | } | 36 | } |
74 | 37 | ||
75 | bool __dbg_ports(void) | 38 | bool __dbg_ports(void) |
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c index e09f628809..ac8dc380e2 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/lcd-meg-fx.c | |||
@@ -244,7 +244,7 @@ static void LCD_SPI_init(void) | |||
244 | /* LCD init */ | 244 | /* LCD init */ |
245 | void lcd_init_device(void) | 245 | void lcd_init_device(void) |
246 | { | 246 | { |
247 | #if 0//def BOOTLOADER | 247 | #ifdef BOOTLOADER |
248 | int i; | 248 | int i; |
249 | /* When the Rockbox bootloader starts, we are changing framebuffer address, | 249 | /* When the Rockbox bootloader starts, we are changing framebuffer address, |
250 | but we don't want what's shown on the LCD to change until we do an | 250 | but we don't want what's shown on the LCD to change until we do an |
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c index d625c07cc8..544869ab6c 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/power-meg-fx.c | |||
@@ -70,11 +70,6 @@ void power_off(void) | |||
70 | _backlight_off(); | 70 | _backlight_off(); |
71 | _buttonlight_off(); | 71 | _buttonlight_off(); |
72 | sleep(HZ); | 72 | sleep(HZ); |
73 | |||
74 | /* Do this to allow the drive to properly reset when player restarts | ||
75 | * immediately without running OF shutdown. | ||
76 | */ | ||
77 | GPGCON&=~0x00300000; | ||
78 | 73 | ||
79 | /* Rockbox never properly shutdown the player. When the sleep bit is set | 74 | /* Rockbox never properly shutdown the player. When the sleep bit is set |
80 | * the player actually wakes up in some type of "zombie" state | 75 | * the player actually wakes up in some type of "zombie" state |
@@ -86,122 +81,6 @@ void power_off(void) | |||
86 | CLKCON |=(1<<3); | 81 | CLKCON |=(1<<3); |
87 | 82 | ||
88 | reboot_point(); | 83 | reboot_point(); |
89 | |||
90 | #if 0 | ||
91 | |||
92 | GPBCON=0x00015450; | ||
93 | GPBDAT=0x403; | ||
94 | GPBUP=0x3FD; | ||
95 | |||
96 | GPCCON =0xAAA054A8; | ||
97 | GPCDAT =0x0000038C; | ||
98 | GPCUP =0xFFFF; | ||
99 | |||
100 | |||
101 | GPDCON =0xAAA0AAA5; | ||
102 | GPDDAT =0x00000300; | ||
103 | GPDUP =0xFCFF; | ||
104 | |||
105 | |||
106 | GPECON =0xAA8002AA; | ||
107 | GPEDAT =0x0000FFED; | ||
108 | GPEUP =0x3817; | ||
109 | |||
110 | GPFCON =0x00000a00; | ||
111 | GPFDAT =0x000000F1; | ||
112 | GPFUP =0x000000FF; | ||
113 | |||
114 | GPGCON =0x01401002; | ||
115 | GPGDAT =0x00000180; | ||
116 | GPGUP =0x0000FF7F; | ||
117 | |||
118 | GPHCON =0x001540A5; | ||
119 | GPHDAT =0x000006FD; | ||
120 | GPHUP =0x00000187; | ||
121 | |||
122 | // mine | ||
123 | INTMSK =0xFFFFFFFF; | ||
124 | EINTMASK=0x0FFFFEF0; | ||
125 | EXTINT0 =0xFFFFFECF; | ||
126 | EXTINT1 =0x07; | ||
127 | // | ||
128 | |||
129 | // INTMSK=0xFFFFFFFF; | ||
130 | // EINTMASK=0x00200000; | ||
131 | |||
132 | // GPHDAT=0x00000004; | ||
133 | |||
134 | // EXTINT0=~0x00000130; | ||
135 | // INTMSK=(~0x00000130)+0x00000100; | ||
136 | // GPGUP=0xFFFFFFFF; | ||
137 | |||
138 | //mine | ||
139 | INTMSK =0xFFFFFFDE; | ||
140 | // | ||
141 | |||
142 | SRCPND=0xFFFFFFFF; | ||
143 | INTPND=0xFFFFFFFF; | ||
144 | GSTATUS1=0x00000600; | ||
145 | |||
146 | ADCCON=0x00000004; | ||
147 | |||
148 | // MISCCR=MISCCR&(~0x703000)|0x603000; | ||
149 | LCDCON1=0x00000000; | ||
150 | LOCKTIME=0xFFFFFFFF; | ||
151 | // REFRESH=REFRESH|0x00400000; | ||
152 | |||
153 | // MISCCR=MISCCR|0x000E0000; | ||
154 | |||
155 | // CLKCON=CLKCON|0x00004018; | ||
156 | |||
157 | /* | ||
158 | * This next piece of code was taken from the linux 2.6.17 sources: | ||
159 | * linux/arch/arm/mach-s3c2410/sleep.S | ||
160 | * | ||
161 | * Copyright (c) 2004 Simtec Electronics | ||
162 | * Ben Dooks <ben@simtec.co.uk> | ||
163 | * | ||
164 | * Based on PXA/SA1100 sleep code by: | ||
165 | * Nicolas Pitre, (c) 2002 Monta Vista Software Inc | ||
166 | * Cliff Brake, (c) 2001 | ||
167 | */ | ||
168 | |||
169 | asm volatile | ||
170 | ( | ||
171 | /* get REFRESH, MISCCR, and CLKCON (and ensure in TLB) */ | ||
172 | "ldr r4, =0x48000024 \n" | ||
173 | "ldr r5, =0x56000080 \n" | ||
174 | "ldr r6, =0x4C00000C \n" | ||
175 | "ldr r7, [ r4 ] \n" | ||
176 | "ldr r8, [ r5 ] \n" | ||
177 | "ldr r9, [ r6 ] \n" | ||
178 | |||
179 | /* Setup register writes */ | ||
180 | "ldr r2, =0x006E3000 \n" | ||
181 | "ldr r3, =0x00004018 \n" | ||
182 | "orr r7, r7, #0x00400000 \n" /* SDRAM sleep command */ | ||
183 | "orr r8, r8, r2 \n" /* SDRAM power-down signals */ | ||
184 | "orr r9, r9, r3 \n" /* power down command */ | ||
185 | |||
186 | /* first as a trial-run to load cache */ | ||
187 | "teq pc, #0 \n" | ||
188 | "bl s3c2410_do_sleep \n" | ||
189 | |||
190 | /* now do it for real */ | ||
191 | "teq r0, r0 \n" | ||
192 | "b s3c2410_do_sleep \n" | ||
193 | |||
194 | /* align next bit of code to cache line */ | ||
195 | ".align 8 \n" | ||
196 | "s3c2410_do_sleep: \n" | ||
197 | "streq r7, [ r4 ] \n" /* SDRAM sleep command */ | ||
198 | "streq r8, [ r5 ] \n" /* SDRAM power-down config */ | ||
199 | "streq r3, [ r6 ] \n" /* CPU sleep */ | ||
200 | "1: \n" | ||
201 | "beq 1b \n" | ||
202 | "bx lr \n" | ||
203 | ); | ||
204 | #endif | ||
205 | } | 84 | } |
206 | 85 | ||
207 | #else /* SIMULATOR */ | 86 | #else /* SIMULATOR */ |
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c index 96afa9b238..8065926e28 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/system-meg-fx.c | |||
@@ -113,14 +113,9 @@ void system_reboot(void) | |||
113 | 113 | ||
114 | static void set_page_tables(void) | 114 | static void set_page_tables(void) |
115 | { | 115 | { |
116 | /* map every memory region to itself */ | 116 | map_section(0, 0, 0x1000, CACHE_NONE); /* map every memory region to itself */ |
117 | map_section(0, 0, 0x1000, CACHE_NONE); | 117 | map_section(0x30000000, 0, 32, CACHE_ALL); /* map RAM to 0 and enable caching for it */ |
118 | 118 | map_section((int)FRAME, (int)FRAME, 1, BUFFERED); /* enable buffered writing for the framebuffer */ | |
119 | /* map RAM to 0 and enable caching for it */ | ||
120 | map_section(0x30000000, 0, 32, CACHE_ALL); | ||
121 | |||
122 | /* enable buffered writing for the framebuffer */ | ||
123 | map_section((int)FRAME, (int)FRAME, 1, BUFFERED); | ||
124 | } | 119 | } |
125 | 120 | ||
126 | void memory_init(void) { | 121 | void memory_init(void) { |
@@ -150,7 +145,7 @@ void s3c_regclr(volatile int *reg, unsigned int mask) | |||
150 | void system_init(void) | 145 | void system_init(void) |
151 | { | 146 | { |
152 | INTMSK = 0xFFFFFFFF; | 147 | INTMSK = 0xFFFFFFFF; |
153 | INTMOD = 0; | 148 | INTMOD = 0; |
154 | SRCPND = 0xFFFFFFFF; | 149 | SRCPND = 0xFFFFFFFF; |
155 | INTPND = 0xFFFFFFFF; | 150 | INTPND = 0xFFFFFFFF; |
156 | INTSUBMSK = 0xFFFFFFFF; | 151 | INTSUBMSK = 0xFFFFFFFF; |