diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/config-e200.h | 6 | ||||
-rw-r--r-- | firmware/pcm_playback.c | 14 | ||||
-rw-r--r-- | firmware/sound.c | 26 | ||||
-rw-r--r-- | firmware/system.c | 6 | ||||
-rw-r--r-- | firmware/target/arm/crt0-pp.S | 18 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/sansa-e200/lcd-e200.c | 58 | ||||
-rw-r--r-- | firmware/usb.c | 3 |
7 files changed, 110 insertions, 21 deletions
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index 947db4185f..1bbdd6021e 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h | |||
@@ -48,8 +48,8 @@ | |||
48 | /* The number of bytes reserved for loadable plugins */ | 48 | /* The number of bytes reserved for loadable plugins */ |
49 | #define PLUGIN_BUFFER_SIZE 0x80000 | 49 | #define PLUGIN_BUFFER_SIZE 0x80000 |
50 | 50 | ||
51 | /* Define this if you have the WM8975 audio codec */ | 51 | /* Use the built-in DAC on the PP5024 */ |
52 | #define HAVE_WM8731 | 52 | #define HAVE_PP5024_CODEC |
53 | 53 | ||
54 | #define AB_REPEAT_ENABLE 1 | 54 | #define AB_REPEAT_ENABLE 1 |
55 | 55 | ||
@@ -121,4 +121,6 @@ | |||
121 | #define BOOTFILE_EXT "e200" | 121 | #define BOOTFILE_EXT "e200" |
122 | #define BOOTFILE "rockbox." BOOTFILE_EXT | 122 | #define BOOTFILE "rockbox." BOOTFILE_EXT |
123 | 123 | ||
124 | #define ICODE_ATTR_TREMOR_NOT_MDCT | ||
125 | |||
124 | #endif | 126 | #endif |
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c index b35b22f730..a2d09e7c8d 100644 --- a/firmware/pcm_playback.c +++ b/firmware/pcm_playback.c | |||
@@ -61,7 +61,7 @@ void pcm_play_pause_unpause(void); | |||
61 | 61 | ||
62 | #ifndef CPU_COLDFIRE | 62 | #ifndef CPU_COLDFIRE |
63 | 63 | ||
64 | #if (CONFIG_CPU == S3C2440) | 64 | #if (CONFIG_CPU == S3C2440) |
65 | 65 | ||
66 | /* TODO: Implement for Gigabeat | 66 | /* TODO: Implement for Gigabeat |
67 | For now, just implement some dummy functions. | 67 | For now, just implement some dummy functions. |
@@ -99,7 +99,8 @@ size_t pcm_get_bytes_waiting(void) | |||
99 | } | 99 | } |
100 | 100 | ||
101 | #elif defined(HAVE_WM8975) || defined(HAVE_WM8758) \ | 101 | #elif defined(HAVE_WM8975) || defined(HAVE_WM8758) \ |
102 | || defined(HAVE_WM8731) || defined(HAVE_WM8721) | 102 | || defined(HAVE_WM8731) || defined(HAVE_WM8721) \ |
103 | || defined(HAVE_PP5024_CODEC) | ||
103 | 104 | ||
104 | /* We need to unify this code with the uda1380 code as much as possible, but | 105 | /* We need to unify this code with the uda1380 code as much as possible, but |
105 | we will keep it separate during early development. | 106 | we will keep it separate during early development. |
@@ -393,6 +394,11 @@ void fiq(void) | |||
393 | } | 394 | } |
394 | #endif /* CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 */ | 395 | #endif /* CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 */ |
395 | 396 | ||
397 | #ifdef HAVE_PP5024_CODEC | ||
398 | void pcm_init(void) | ||
399 | { | ||
400 | } | ||
401 | #else | ||
396 | void pcm_init(void) | 402 | void pcm_init(void) |
397 | { | 403 | { |
398 | pcm_playing = false; | 404 | pcm_playing = false; |
@@ -411,7 +417,7 @@ void pcm_init(void) | |||
411 | /* Call pcm_play_dma_stop to initialize everything. */ | 417 | /* Call pcm_play_dma_stop to initialize everything. */ |
412 | pcm_play_dma_stop(); | 418 | pcm_play_dma_stop(); |
413 | } | 419 | } |
414 | 420 | #endif /* HAVE_PP5024_CODEC */ | |
415 | #elif (CONFIG_CPU == PNX0101) | 421 | #elif (CONFIG_CPU == PNX0101) |
416 | 422 | ||
417 | #define DMA_BUF_SAMPLES 0x100 | 423 | #define DMA_BUF_SAMPLES 0x100 |
@@ -633,7 +639,7 @@ void pcm_calculate_peaks(int *left, int *right) | |||
633 | { | 639 | { |
634 | #if defined(HAVE_WM8975) || defined(HAVE_WM8758) \ | 640 | #if defined(HAVE_WM8975) || defined(HAVE_WM8758) \ |
635 | || defined(HAVE_WM8731) || defined(HAVE_WM8721) \ | 641 | || defined(HAVE_WM8731) || defined(HAVE_WM8721) \ |
636 | || (CONFIG_CPU == PNX0101) | 642 | || (CONFIG_CPU == PNX0101) || defined(HAVE_PP5024_CODEC) |
637 | size_t samples = p_size / 4; | 643 | size_t samples = p_size / 4; |
638 | addr = p; | 644 | addr = p; |
639 | #endif | 645 | #endif |
diff --git a/firmware/sound.c b/firmware/sound.c index 7e29fddec5..6bd9b70029 100644 --- a/firmware/sound.c +++ b/firmware/sound.c | |||
@@ -89,6 +89,9 @@ static const struct sound_settings_info sound_settings_table[] = { | |||
89 | [SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0, sound_set_treble}, | 89 | [SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0, sound_set_treble}, |
90 | #elif (CONFIG_CPU == PNX0101) | 90 | #elif (CONFIG_CPU == PNX0101) |
91 | [SOUND_VOLUME] = {"dB", 0, 1, -48, 15, 0, sound_set_volume}, | 91 | [SOUND_VOLUME] = {"dB", 0, 1, -48, 15, 0, sound_set_volume}, |
92 | #elif defined(HAVE_PP5024_CODEC) | ||
93 | /* TODO: Make this correct */ | ||
94 | [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25, sound_set_volume}, | ||
92 | #else /* MAS3507D */ | 95 | #else /* MAS3507D */ |
93 | [SOUND_VOLUME] = {"dB", 0, 1, -78, 18, -18, sound_set_volume}, | 96 | [SOUND_VOLUME] = {"dB", 0, 1, -78, 18, -18, sound_set_volume}, |
94 | [SOUND_BASS] = {"dB", 0, 1, -15, 15, 7, sound_set_bass}, | 97 | [SOUND_BASS] = {"dB", 0, 1, -15, 15, 7, sound_set_bass}, |
@@ -420,11 +423,17 @@ static int tenthdb2mixer(int db) | |||
420 | return -db * 2 / 5; | 423 | return -db * 2 / 5; |
421 | } | 424 | } |
422 | 425 | ||
426 | #elif defined(HAVE_PP5024_CODEC) | ||
427 | /* TODO: Work out volume/balance/treble/bass interdependency */ | ||
428 | #define VOLUME_MIN 0 | ||
429 | #define VOLUME_MAX 1 | ||
430 | |||
423 | #endif | 431 | #endif |
424 | 432 | ||
425 | #if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ | 433 | #if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ |
426 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \ | 434 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \ |
427 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) | 435 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ |
436 | || defined(HAVE_PP5024_CODEC) | ||
428 | /* volume/balance/treble/bass interdependency main part */ | 437 | /* volume/balance/treble/bass interdependency main part */ |
429 | #define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN) | 438 | #define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN) |
430 | 439 | ||
@@ -599,7 +608,8 @@ void sound_set_volume(int value) | |||
599 | mas_codec_writereg(0x10, tmp); | 608 | mas_codec_writereg(0x10, tmp); |
600 | #elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ | 609 | #elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \ |
601 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \ | 610 | || defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \ |
602 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) | 611 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \ |
612 | || defined(HAVE_PP5024_CODEC) | ||
603 | current_volume = value * 10; /* tenth of dB */ | 613 | current_volume = value * 10; /* tenth of dB */ |
604 | set_prescaled_volume(); | 614 | set_prescaled_volume(); |
605 | #elif CONFIG_CPU == PNX0101 | 615 | #elif CONFIG_CPU == PNX0101 |
@@ -620,8 +630,8 @@ void sound_set_balance(int value) | |||
620 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) | 630 | || defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) |
621 | current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ | 631 | current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ |
622 | set_prescaled_volume(); | 632 | set_prescaled_volume(); |
623 | #elif CONFIG_CPU == PNX0101 | 633 | #elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC) |
624 | /* TODO: implement for iFP */ | 634 | /* TODO: implement for iFP and Sansa */ |
625 | (void)value; | 635 | (void)value; |
626 | #endif | 636 | #endif |
627 | } | 637 | } |
@@ -647,8 +657,8 @@ void sound_set_bass(int value) | |||
647 | current_bass = value * 10; | 657 | current_bass = value * 10; |
648 | wmcodec_set_bass(value); | 658 | wmcodec_set_bass(value); |
649 | set_prescaled_volume(); | 659 | set_prescaled_volume(); |
650 | #elif CONFIG_CPU == PNX0101 | 660 | #elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC) |
651 | /* TODO: implement for iFP */ | 661 | /* TODO: implement for iFP and Sansa */ |
652 | (void)value; | 662 | (void)value; |
653 | #endif | 663 | #endif |
654 | } | 664 | } |
@@ -673,8 +683,8 @@ void sound_set_treble(int value) | |||
673 | wmcodec_set_treble(value); | 683 | wmcodec_set_treble(value); |
674 | current_treble = value * 10; | 684 | current_treble = value * 10; |
675 | set_prescaled_volume(); | 685 | set_prescaled_volume(); |
676 | #elif CONFIG_CPU == PNX0101 | 686 | #elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC) |
677 | /* TODO: implement for iFP */ | 687 | /* TODO: implement for iFP and Sansa */ |
678 | (void)value; | 688 | (void)value; |
679 | #endif | 689 | #endif |
680 | } | 690 | } |
diff --git a/firmware/system.c b/firmware/system.c index 102ace6273..a5fae26bc5 100644 --- a/firmware/system.c +++ b/firmware/system.c | |||
@@ -585,7 +585,7 @@ void UIE(unsigned int pc, unsigned int num) | |||
585 | } | 585 | } |
586 | } | 586 | } |
587 | 587 | ||
588 | #if CONFIG_CPU==PP5020 | 588 | #if CONFIG_CPU==PP5020 || CONFIG_CPU==PP5024 |
589 | 589 | ||
590 | unsigned int ipod_hw_rev; | 590 | unsigned int ipod_hw_rev; |
591 | 591 | ||
@@ -605,9 +605,11 @@ void irq(void) | |||
605 | else if (CPU_HI_INT_STAT & GPIO_MASK) | 605 | else if (CPU_HI_INT_STAT & GPIO_MASK) |
606 | ipod_mini_button_int(); | 606 | ipod_mini_button_int(); |
607 | } | 607 | } |
608 | #elif (defined IRIVER_H10) || (defined IRIVER_H10_5GB) || defined(ELIO_TPJ1022) | 608 | #elif (defined IRIVER_H10) || (defined IRIVER_H10_5GB) || defined(ELIO_TPJ1022) \ |
609 | || (defined SANSA_E200) | ||
609 | /* TODO: this should really be in the target tree, but moving it there caused | 610 | /* TODO: this should really be in the target tree, but moving it there caused |
610 | crt0.S not to find it while linking */ | 611 | crt0.S not to find it while linking */ |
612 | /* TODO: Even if it isn't in the target tree, this should be the default case */ | ||
611 | void irq(void) | 613 | void irq(void) |
612 | { | 614 | { |
613 | if (CPU_INT_STAT & TIMER1_MASK) | 615 | if (CPU_INT_STAT & TIMER1_MASK) |
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: | |||
47 | .equ SLEEP, 0x80000000 | 47 | .equ SLEEP, 0x80000000 |
48 | .equ WAKE, 0x0 | 48 | .equ WAKE, 0x0 |
49 | .equ SLEEPING, 0x80000000 | 49 | .equ SLEEPING, 0x80000000 |
50 | .equ CACHE_CTRL, 0x6000c000 | ||
50 | #endif | 51 | #endif |
51 | 52 | ||
52 | msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */ | 53 | msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */ |
53 | 54 | ||
54 | #ifndef BOOTLOADER | 55 | #ifndef BOOTLOADER |
55 | b pad_skip | 56 | b pad_skip |
56 | .space 50*4 /* (more than enough) space for exception vectors */ | 57 | |
58 | #if defined(SANSA_E200) | ||
59 | /* mi4tool writes junk between 0xe0 and 0xeb. Avoid this. */ | ||
60 | .space 60*4 /* (more than enough) space for exception vectors */ | ||
61 | #else | ||
62 | .space 50*4 | ||
63 | #endif | ||
64 | |||
57 | pad_skip: | 65 | pad_skip: |
66 | #ifdef SANSA_E200 | ||
67 | /* On the Sansa, copying the vectors fails if the cache is initialised */ | ||
68 | ldr r1, =CACHE_CTRL | ||
69 | mov r2, #0x0 | ||
70 | str r2, [r1] | ||
71 | #endif | ||
58 | /* We need to remap memory from wherever SDRAM is mapped natively, to | 72 | /* We need to remap memory from wherever SDRAM is mapped natively, to |
59 | base address 0, so we can put our exception vectors there. We don't | 73 | base address 0, so we can put our exception vectors there. We don't |
60 | want to do this remapping while executing from SDRAM, so we copy the | 74 | want to do this remapping while executing from SDRAM, so we copy the |
@@ -126,7 +140,7 @@ remap_end: | |||
126 | ldr r0, =fiq_handler | 140 | ldr r0, =fiq_handler |
127 | str r0, [r1, #28] | 141 | str r0, [r1, #28] |
128 | #endif | 142 | #endif |
129 | 143 | ||
130 | #ifndef STUB | 144 | #ifndef STUB |
131 | /* Zero out IBSS */ | 145 | /* Zero out IBSS */ |
132 | ldr r2, =_iedata | 146 | 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 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "cpu.h" | ||
25 | #include "lcd.h" | 24 | #include "lcd.h" |
26 | #include "kernel.h" | ||
27 | #include "system.h" | 25 | #include "system.h" |
28 | 26 | ||
29 | #define LCD_DATA_IN_GPIO GPIOB_INPUT_VAL | 27 | #define LCD_DATA_IN_GPIO GPIOB_INPUT_VAL |
@@ -108,6 +106,29 @@ static inline void lcd_write_reg(unsigned int reg, unsigned int data) | |||
108 | lcd_send_msg(0x72, data); | 106 | lcd_send_msg(0x72, data); |
109 | } | 107 | } |
110 | 108 | ||
109 | static inline void cache_flush(void) | ||
110 | { | ||
111 | #ifndef BOOTLOADER | ||
112 | outl(inl(0xf000f044) | 0x2, 0xf000f044); | ||
113 | while ((inl(0x6000c000) & 0x8000) != 0) | ||
114 | { | ||
115 | } | ||
116 | #endif | ||
117 | } | ||
118 | |||
119 | /* The LCD controller gets passed the address of the framebuffer, but can only | ||
120 | use the physical, not the remapped, address. This is a quick and dirty way | ||
121 | of correcting it */ | ||
122 | static unsigned long phys_fb_address(unsigned long address) | ||
123 | { | ||
124 | if(address < 0x10000000) | ||
125 | { | ||
126 | return address + 0x10000000; | ||
127 | } else { | ||
128 | return address; | ||
129 | } | ||
130 | } | ||
131 | |||
111 | inline void lcd_init_device(void) | 132 | inline void lcd_init_device(void) |
112 | { | 133 | { |
113 | /* All this is magic worked out by MrH */ | 134 | /* All this is magic worked out by MrH */ |
@@ -158,7 +179,7 @@ inline void lcd_init_device(void) | |||
158 | LCD_REG_6 |= (1 << 4); | 179 | LCD_REG_6 |= (1 << 4); |
159 | 180 | ||
160 | LCD_REG_5 &= ~(1 << 7); | 181 | LCD_REG_5 &= ~(1 << 7); |
161 | LCD_FB_BASE_REG = (unsigned long)lcd_framebuffer; | 182 | LCD_FB_BASE_REG = phys_fb_address((unsigned long)lcd_framebuffer); |
162 | 183 | ||
163 | udelay(100000); | 184 | udelay(100000); |
164 | 185 | ||
@@ -228,6 +249,7 @@ inline void lcd_init_device(void) | |||
228 | 249 | ||
229 | inline void lcd_update(void) | 250 | inline void lcd_update(void) |
230 | { | 251 | { |
252 | cache_flush(); | ||
231 | if(!(LCD_REG_6 & 1)) | 253 | if(!(LCD_REG_6 & 1)) |
232 | LCD_REG_6 |= 1; | 254 | LCD_REG_6 |= 1; |
233 | } | 255 | } |
@@ -262,3 +284,33 @@ void lcd_set_flip(bool yesno) | |||
262 | /* TODO: Implement lcd_set_flip() */ | 284 | /* TODO: Implement lcd_set_flip() */ |
263 | (void)yesno; | 285 | (void)yesno; |
264 | } | 286 | } |
287 | |||
288 | /* Blitting functions */ | ||
289 | |||
290 | void lcd_blit(const fb_data* data, int x, int by, int width, | ||
291 | int bheight, int stride) | ||
292 | { | ||
293 | /* TODO: Implement lcd_blit() */ | ||
294 | (void)data; | ||
295 | (void)x; | ||
296 | (void)by; | ||
297 | (void)width; | ||
298 | (void)bheight; | ||
299 | (void)stride; | ||
300 | } | ||
301 | |||
302 | void lcd_yuv_blit(unsigned char * const src[3], | ||
303 | int src_x, int src_y, int stride, | ||
304 | int x, int y, int width, int height) | ||
305 | { | ||
306 | /* TODO: Implement lcd_blit() */ | ||
307 | (void)src; | ||
308 | (void)src_x; | ||
309 | (void)src_y; | ||
310 | (void)stride; | ||
311 | (void)x; | ||
312 | (void)y; | ||
313 | (void)width; | ||
314 | (void)height; | ||
315 | } | ||
316 | |||
diff --git a/firmware/usb.c b/firmware/usb.c index bde9463a7a..5c800bde03 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -83,6 +83,9 @@ void screen_dump(void); /* Nasty again. Defined in apps/ too */ | |||
83 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD | 83 | #elif CONFIG_KEYPAD == IRIVER_H10_PAD |
84 | #define USBPOWER_BUTTON BUTTON_NONE | 84 | #define USBPOWER_BUTTON BUTTON_NONE |
85 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | 85 | #define USBPOWER_BTN_IGNORE BUTTON_POWER |
86 | #elif CONFIG_KEYPAD == SANSA_E200_PAD | ||
87 | #define USBPOWER_BUTTON BUTTON_SELECT | ||
88 | #define USBPOWER_BTN_IGNORE BUTTON_POWER | ||
86 | #endif | 89 | #endif |
87 | #endif /* HAVE_USB_POWER */ | 90 | #endif /* HAVE_USB_POWER */ |
88 | 91 | ||