mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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
This commit is contained in:
parent
242cbd5cd7
commit
43e2c01065
8 changed files with 111 additions and 21 deletions
|
@ -248,3 +248,4 @@ Austin Appel
|
||||||
Andre Smith
|
Andre Smith
|
||||||
Travis Hyyppa
|
Travis Hyyppa
|
||||||
Ian Webber
|
Ian Webber
|
||||||
|
Pavel Gnelitsa
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
/* The number of bytes reserved for loadable plugins */
|
/* The number of bytes reserved for loadable plugins */
|
||||||
#define PLUGIN_BUFFER_SIZE 0x80000
|
#define PLUGIN_BUFFER_SIZE 0x80000
|
||||||
|
|
||||||
/* Define this if you have the WM8975 audio codec */
|
/* Use the built-in DAC on the PP5024 */
|
||||||
#define HAVE_WM8731
|
#define HAVE_PP5024_CODEC
|
||||||
|
|
||||||
#define AB_REPEAT_ENABLE 1
|
#define AB_REPEAT_ENABLE 1
|
||||||
|
|
||||||
|
@ -121,4 +121,6 @@
|
||||||
#define BOOTFILE_EXT "e200"
|
#define BOOTFILE_EXT "e200"
|
||||||
#define BOOTFILE "rockbox." BOOTFILE_EXT
|
#define BOOTFILE "rockbox." BOOTFILE_EXT
|
||||||
|
|
||||||
|
#define ICODE_ATTR_TREMOR_NOT_MDCT
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,7 +61,7 @@ void pcm_play_pause_unpause(void);
|
||||||
|
|
||||||
#ifndef CPU_COLDFIRE
|
#ifndef CPU_COLDFIRE
|
||||||
|
|
||||||
#if (CONFIG_CPU == S3C2440)
|
#if (CONFIG_CPU == S3C2440)
|
||||||
|
|
||||||
/* TODO: Implement for Gigabeat
|
/* TODO: Implement for Gigabeat
|
||||||
For now, just implement some dummy functions.
|
For now, just implement some dummy functions.
|
||||||
|
@ -99,7 +99,8 @@ size_t pcm_get_bytes_waiting(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|
#elif defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|
||||||
|| defined(HAVE_WM8731) || defined(HAVE_WM8721)
|
|| defined(HAVE_WM8731) || defined(HAVE_WM8721) \
|
||||||
|
|| defined(HAVE_PP5024_CODEC)
|
||||||
|
|
||||||
/* We need to unify this code with the uda1380 code as much as possible, but
|
/* We need to unify this code with the uda1380 code as much as possible, but
|
||||||
we will keep it separate during early development.
|
we will keep it separate during early development.
|
||||||
|
@ -393,6 +394,11 @@ void fiq(void)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 */
|
#endif /* CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 */
|
||||||
|
|
||||||
|
#ifdef HAVE_PP5024_CODEC
|
||||||
|
void pcm_init(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#else
|
||||||
void pcm_init(void)
|
void pcm_init(void)
|
||||||
{
|
{
|
||||||
pcm_playing = false;
|
pcm_playing = false;
|
||||||
|
@ -411,7 +417,7 @@ void pcm_init(void)
|
||||||
/* Call pcm_play_dma_stop to initialize everything. */
|
/* Call pcm_play_dma_stop to initialize everything. */
|
||||||
pcm_play_dma_stop();
|
pcm_play_dma_stop();
|
||||||
}
|
}
|
||||||
|
#endif /* HAVE_PP5024_CODEC */
|
||||||
#elif (CONFIG_CPU == PNX0101)
|
#elif (CONFIG_CPU == PNX0101)
|
||||||
|
|
||||||
#define DMA_BUF_SAMPLES 0x100
|
#define DMA_BUF_SAMPLES 0x100
|
||||||
|
@ -633,7 +639,7 @@ void pcm_calculate_peaks(int *left, int *right)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|
#if defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|
||||||
|| defined(HAVE_WM8731) || defined(HAVE_WM8721) \
|
|| defined(HAVE_WM8731) || defined(HAVE_WM8721) \
|
||||||
|| (CONFIG_CPU == PNX0101)
|
|| (CONFIG_CPU == PNX0101) || defined(HAVE_PP5024_CODEC)
|
||||||
size_t samples = p_size / 4;
|
size_t samples = p_size / 4;
|
||||||
addr = p;
|
addr = p;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -89,6 +89,9 @@ static const struct sound_settings_info sound_settings_table[] = {
|
||||||
[SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0, sound_set_treble},
|
[SOUND_TREBLE] = {"dB", 0, 1, -6, 9, 0, sound_set_treble},
|
||||||
#elif (CONFIG_CPU == PNX0101)
|
#elif (CONFIG_CPU == PNX0101)
|
||||||
[SOUND_VOLUME] = {"dB", 0, 1, -48, 15, 0, sound_set_volume},
|
[SOUND_VOLUME] = {"dB", 0, 1, -48, 15, 0, sound_set_volume},
|
||||||
|
#elif defined(HAVE_PP5024_CODEC)
|
||||||
|
/* TODO: Make this correct */
|
||||||
|
[SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25, sound_set_volume},
|
||||||
#else /* MAS3507D */
|
#else /* MAS3507D */
|
||||||
[SOUND_VOLUME] = {"dB", 0, 1, -78, 18, -18, sound_set_volume},
|
[SOUND_VOLUME] = {"dB", 0, 1, -78, 18, -18, sound_set_volume},
|
||||||
[SOUND_BASS] = {"dB", 0, 1, -15, 15, 7, sound_set_bass},
|
[SOUND_BASS] = {"dB", 0, 1, -15, 15, 7, sound_set_bass},
|
||||||
|
@ -420,11 +423,17 @@ static int tenthdb2mixer(int db)
|
||||||
return -db * 2 / 5;
|
return -db * 2 / 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif defined(HAVE_PP5024_CODEC)
|
||||||
|
/* TODO: Work out volume/balance/treble/bass interdependency */
|
||||||
|
#define VOLUME_MIN 0
|
||||||
|
#define VOLUME_MAX 1
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \
|
#if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \
|
||||||
|| defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \
|
|| defined HAVE_WM8975 || defined HAVE_WM8758 || defined(HAVE_WM8731) \
|
||||||
|| defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751)
|
|| defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \
|
||||||
|
|| defined(HAVE_PP5024_CODEC)
|
||||||
/* volume/balance/treble/bass interdependency main part */
|
/* volume/balance/treble/bass interdependency main part */
|
||||||
#define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN)
|
#define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN)
|
||||||
|
|
||||||
|
@ -599,7 +608,8 @@ void sound_set_volume(int value)
|
||||||
mas_codec_writereg(0x10, tmp);
|
mas_codec_writereg(0x10, tmp);
|
||||||
#elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \
|
#elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 \
|
||||||
|| defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \
|
|| defined HAVE_WM8975 || defined HAVE_WM8758 || defined HAVE_WM8731 \
|
||||||
|| defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751)
|
|| defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751) \
|
||||||
|
|| defined(HAVE_PP5024_CODEC)
|
||||||
current_volume = value * 10; /* tenth of dB */
|
current_volume = value * 10; /* tenth of dB */
|
||||||
set_prescaled_volume();
|
set_prescaled_volume();
|
||||||
#elif CONFIG_CPU == PNX0101
|
#elif CONFIG_CPU == PNX0101
|
||||||
|
@ -620,8 +630,8 @@ void sound_set_balance(int value)
|
||||||
|| defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751)
|
|| defined(HAVE_WM8721) || defined(HAVE_TLV320) || defined(HAVE_WM8751)
|
||||||
current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */
|
current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */
|
||||||
set_prescaled_volume();
|
set_prescaled_volume();
|
||||||
#elif CONFIG_CPU == PNX0101
|
#elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC)
|
||||||
/* TODO: implement for iFP */
|
/* TODO: implement for iFP and Sansa */
|
||||||
(void)value;
|
(void)value;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -647,8 +657,8 @@ void sound_set_bass(int value)
|
||||||
current_bass = value * 10;
|
current_bass = value * 10;
|
||||||
wmcodec_set_bass(value);
|
wmcodec_set_bass(value);
|
||||||
set_prescaled_volume();
|
set_prescaled_volume();
|
||||||
#elif CONFIG_CPU == PNX0101
|
#elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC)
|
||||||
/* TODO: implement for iFP */
|
/* TODO: implement for iFP and Sansa */
|
||||||
(void)value;
|
(void)value;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -673,8 +683,8 @@ void sound_set_treble(int value)
|
||||||
wmcodec_set_treble(value);
|
wmcodec_set_treble(value);
|
||||||
current_treble = value * 10;
|
current_treble = value * 10;
|
||||||
set_prescaled_volume();
|
set_prescaled_volume();
|
||||||
#elif CONFIG_CPU == PNX0101
|
#elif CONFIG_CPU == PNX0101 || defined(HAVE_PP5024_CODEC)
|
||||||
/* TODO: implement for iFP */
|
/* TODO: implement for iFP and Sansa */
|
||||||
(void)value;
|
(void)value;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -585,7 +585,7 @@ void UIE(unsigned int pc, unsigned int num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_CPU==PP5020
|
#if CONFIG_CPU==PP5020 || CONFIG_CPU==PP5024
|
||||||
|
|
||||||
unsigned int ipod_hw_rev;
|
unsigned int ipod_hw_rev;
|
||||||
|
|
||||||
|
@ -605,9 +605,11 @@ void irq(void)
|
||||||
else if (CPU_HI_INT_STAT & GPIO_MASK)
|
else if (CPU_HI_INT_STAT & GPIO_MASK)
|
||||||
ipod_mini_button_int();
|
ipod_mini_button_int();
|
||||||
}
|
}
|
||||||
#elif (defined IRIVER_H10) || (defined IRIVER_H10_5GB) || defined(ELIO_TPJ1022)
|
#elif (defined IRIVER_H10) || (defined IRIVER_H10_5GB) || defined(ELIO_TPJ1022) \
|
||||||
|
|| (defined SANSA_E200)
|
||||||
/* TODO: this should really be in the target tree, but moving it there caused
|
/* TODO: this should really be in the target tree, but moving it there caused
|
||||||
crt0.S not to find it while linking */
|
crt0.S not to find it while linking */
|
||||||
|
/* TODO: Even if it isn't in the target tree, this should be the default case */
|
||||||
void irq(void)
|
void irq(void)
|
||||||
{
|
{
|
||||||
if (CPU_INT_STAT & TIMER1_MASK)
|
if (CPU_INT_STAT & TIMER1_MASK)
|
||||||
|
|
|
@ -47,14 +47,28 @@ start:
|
||||||
.equ SLEEP, 0x80000000
|
.equ SLEEP, 0x80000000
|
||||||
.equ WAKE, 0x0
|
.equ WAKE, 0x0
|
||||||
.equ SLEEPING, 0x80000000
|
.equ SLEEPING, 0x80000000
|
||||||
|
.equ CACHE_CTRL, 0x6000c000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */
|
msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */
|
||||||
|
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
b pad_skip
|
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:
|
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
|
/* 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
|
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
|
want to do this remapping while executing from SDRAM, so we copy the
|
||||||
|
@ -126,7 +140,7 @@ remap_end:
|
||||||
ldr r0, =fiq_handler
|
ldr r0, =fiq_handler
|
||||||
str r0, [r1, #28]
|
str r0, [r1, #28]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef STUB
|
#ifndef STUB
|
||||||
/* Zero out IBSS */
|
/* Zero out IBSS */
|
||||||
ldr r2, =_iedata
|
ldr r2, =_iedata
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "cpu.h"
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "kernel.h"
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#define LCD_DATA_IN_GPIO GPIOB_INPUT_VAL
|
#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);
|
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)
|
inline void lcd_init_device(void)
|
||||||
{
|
{
|
||||||
/* All this is magic worked out by MrH */
|
/* 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_6 |= (1 << 4);
|
||||||
|
|
||||||
LCD_REG_5 &= ~(1 << 7);
|
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);
|
udelay(100000);
|
||||||
|
|
||||||
|
@ -228,6 +249,7 @@ inline void lcd_init_device(void)
|
||||||
|
|
||||||
inline void lcd_update(void)
|
inline void lcd_update(void)
|
||||||
{
|
{
|
||||||
|
cache_flush();
|
||||||
if(!(LCD_REG_6 & 1))
|
if(!(LCD_REG_6 & 1))
|
||||||
LCD_REG_6 |= 1;
|
LCD_REG_6 |= 1;
|
||||||
}
|
}
|
||||||
|
@ -262,3 +284,33 @@ void lcd_set_flip(bool yesno)
|
||||||
/* TODO: Implement lcd_set_flip() */
|
/* TODO: Implement lcd_set_flip() */
|
||||||
(void)yesno;
|
(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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,9 @@ void screen_dump(void); /* Nasty again. Defined in apps/ too */
|
||||||
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
||||||
#define USBPOWER_BUTTON BUTTON_NONE
|
#define USBPOWER_BUTTON BUTTON_NONE
|
||||||
#define USBPOWER_BTN_IGNORE BUTTON_POWER
|
#define USBPOWER_BTN_IGNORE BUTTON_POWER
|
||||||
|
#elif CONFIG_KEYPAD == SANSA_E200_PAD
|
||||||
|
#define USBPOWER_BUTTON BUTTON_SELECT
|
||||||
|
#define USBPOWER_BTN_IGNORE BUTTON_POWER
|
||||||
#endif
|
#endif
|
||||||
#endif /* HAVE_USB_POWER */
|
#endif /* HAVE_USB_POWER */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue