Work-in-progress iriver iFP-7xx port by Tomasz Malesinski

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8342 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2006-01-12 00:35:50 +00:00
parent 8d13068421
commit d83e929f3f
52 changed files with 737 additions and 18 deletions

View file

@ -38,6 +38,11 @@
#define BOOKMARK_DELETE (BUTTON_RIGHT | BUTTON_REPEAT)
#define BOOKMARK_DOWN BUTTON_SCROLL_FWD
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define BOOKMARK_SELECT BUTTON_SELECT
#define BOOKMARK_DELETE (BUTTON_PLAY | BUTTON_SELECT)
#define BOOKMARK_DOWN BUTTON_DOWN
#else /* player, recorder, gmini */
#define BOOKMARK_SELECT BUTTON_PLAY
#define BOOKMARK_DELETE (BUTTON_ON | BUTTON_PLAY)

View file

@ -7,6 +7,8 @@ a52.c
mpc.c
wavpack.c
alac.c
#if MEMORYSIZE > 1
aac.c
#endif
shorten.c
#endif

View file

@ -359,6 +359,12 @@ bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
(void)p_device;
(void)addr1;
(void)addr2;
#elif CONFIG_CPU == PNX0101
/* TODO: Implement for iFP7xx */
(void)p_manufacturer;
(void)p_device;
(void)addr1;
(void)addr2;
#else
unsigned not_manu, not_id; /* read values before switching to ID mode */
unsigned manu, id; /* read values when in ID mode */

View file

@ -191,6 +191,25 @@
#define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT)
#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
/* TODO: Check WPS button assignments */
#define WPS_NEXT (BUTTON_RIGHT | BUTTON_REL)
#define WPS_NEXT_PRE BUTTON_RIGHT
#define WPS_PREV (BUTTON_LEFT | BUTTON_REL)
#define WPS_PREV_PRE BUTTON_LEFT
#define WPS_FFWD (BUTTON_RIGHT | BUTTON_REPEAT)
#define WPS_REW (BUTTON_LEFT | BUTTON_REPEAT)
#define WPS_INCVOL BUTTON_UP
#define WPS_DECVOL BUTTON_DOWN
#define WPS_PAUSE BUTTON_PLAY
/* #define WPS_MENU iFP7xx can't have both main menu and context menu in wps */
#define WPS_BROWSE (BUTTON_SELECT | BUTTON_REL)
#define WPS_BROWSE_PRE BUTTON_SELECT
#define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT)
#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
#endif
/* constants used in line_type and as refresh_mode for wps_refresh */

View file

@ -69,6 +69,10 @@
#define LIST_NEXT BUTTON_SCROLL_FWD
#define LIST_PREV BUTTON_SCROLL_BACK
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define LIST_NEXT BUTTON_DOWN
#define LIST_PREV BUTTON_UP
#elif CONFIG_KEYPAD == GMINI100_PAD
#define LIST_NEXT BUTTON_DOWN
#define LIST_PREV BUTTON_UP

View file

@ -61,6 +61,14 @@
#define SELECT_OK2 BUTTON_RIGHT
#define SELECT_CANCEL BUTTON_MENU
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define SELECT_INC BUTTON_UP
#define SELECT_DEC BUTTON_DOWN
#define SELECT_OK BUTTON_RIGHT
#define SELECT_OK2 BUTTON_LEFT
#define SELECT_CANCEL BUTTON_PLAY
#define SELECT_CANCEL2 BUTTON_MODE
#elif CONFIG_KEYPAD == ONDIO_PAD
#define SELECT_INC BUTTON_UP
#define SELECT_DEC BUTTON_DOWN

View file

@ -25,6 +25,9 @@
#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
#define YESNO_OK BUTTON_RIGHT
#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
#define YESNO_OK BUTTON_RIGHT
#endif
enum yesno_res
{

View file

@ -78,6 +78,14 @@
#define MENU_EXIT_MENU BUTTON_MENU
#define MENU_ENTER BUTTON_RIGHT
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define MENU_NEXT BUTTON_DOWN
#define MENU_PREV BUTTON_UP
#define MENU_EXIT BUTTON_LEFT
#define MENU_EXIT_MENU BUTTON_PLAY
#define MENU_ENTER BUTTON_RIGHT
#endif
struct menu_item {

View file

@ -43,8 +43,10 @@ SUBDIRS += searchengine databox
#for any recorder and iRiver model
ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET)))))
ifneq (-DIRIVER_IFP7XX,$(TARGET))
SUBDIRS += rockboy
endif
endif
.PHONY: $(SUBDIRS)

View file

@ -18,6 +18,7 @@ viewer.c
dict.c
metronome.c
#ifndef IRIVER_IFP7XX_SERIES /* Temporarily disable plugin building for iFP7xx */
#ifdef HAVE_LCD_BITMAP /* Recorder/Ondio models only */
solitaire.c
#ifndef HAVE_LCD_COLOR
@ -89,4 +90,5 @@ wav2wv.c
midi2wav.c
#else
splitedit.c
#endif /* iFP7xx */
#endif

View file

@ -39,6 +39,8 @@
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
(CONFIG_KEYPAD == IRIVER_H300_PAD)
#define BATTERY_TEST_QUIT BUTTON_OFF
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define BATTERY_TEST_QUIT BUTTON_PLAY
#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
#define BATTERY_TEST_QUIT BUTTON_MENU
#endif

View file

@ -74,6 +74,16 @@
#define CHC_SETTINGS_OK BUTTON_SELECT
#define CHC_SETTINGS_CANCEL BUTTON_MENU
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define CHC_QUIT BUTTON_PLAY
#define CHC_STARTSTOP BUTTON_MODE
#define CHC_RESET BUTTON_EQ
#define CHC_MENU BUTTON_SELECT
#define CHC_SETTINGS_INC BUTTON_RIGHT
#define CHC_SETTINGS_DEC BUTTON_LEFT
#define CHC_SETTINGS_OK BUTTON_SELECT
#define CHC_SETTINGS_CANCEL BUTTON_PLAY
#endif

View file

@ -92,6 +92,18 @@
#define CUBE_PAUSE (BUTTON_PLAY | BUTTON_REL)
#define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_PLAY)
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define CUBE_QUIT BUTTON_PLAY
#define CUBE_X_INC BUTTON_RIGHT
#define CUBE_X_DEC BUTTON_LEFT
#define CUBE_Y_INC BUTTON_UP
#define CUBE_Y_DEC BUTTON_DOWN
#define CUBE_Z_INC BUTTON_MODE
#define CUBE_Z_DEC BUTTON_EQ
#define CUBE_MODE (BUTTON_SELECT | BUTTON_REPEAT)
#define CUBE_PAUSE (BUTTON_SELECT | BUTTON_REL)
#define CUBE_HIGHSPEED (BUTTON_MODE | BUTTON_EQ) /* TODO: this is impossible */
#endif
#ifdef HAVE_LCD_BITMAP

View file

@ -35,6 +35,9 @@
#elif CONFIG_KEYPAD == PLAYER_PAD
#define DBX_SELECT BUTTON_PLAY
#define DBX_STOP BUTTON_STOP
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define DBX_SELECT BUTTON_SELECT
#define DBX_STOP BUTTON_PLAY
#endif
#define MAX_TOKENS 70

View file

@ -104,6 +104,8 @@ long reverse (long N) {
#define LP_QUIT BUTTON_STOP
#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
#define LP_QUIT BUTTON_MENU
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define LP_QUIT BUTTON_PLAY
#else
#define LP_QUIT BUTTON_OFF
#endif

View file

@ -81,6 +81,12 @@
#define BEJEWELED_SELECT_PRE BUTTON_SELECT
#define BEJEWELED_RESUME (BUTTON_SELECT|BUTTON_PLAY)
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define BEJEWELED_QUIT BUTTON_PLAY
#define BEJEWELED_START BUTTON_MODE
#define BEJEWELED_SELECT BUTTON_SELECT
#define BEJEWELED_RESUME BUTTON_EQ
#else
#error BEJEWELED: Unsupported keypad
#endif

View file

@ -187,6 +187,12 @@ const unsigned char rockbox16x7[] = {
#define LP_INC_X BUTTON_RIGHT
#define LP_DEC_Y BUTTON_SCROLL_BACK
#define LP_INC_Y BUTTON_SCROLL_FWD
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define LP_QUIT BUTTON_PLAY
#define LP_DEC_X BUTTON_LEFT
#define LP_INC_X BUTTON_RIGHT
#define LP_DEC_Y BUTTON_DOWN
#define LP_INC_Y BUTTON_UP
#else
#define LP_QUIT BUTTON_OFF
#define LP_DEC_X BUTTON_LEFT

View file

@ -64,6 +64,15 @@
#define METRONOME_TAP BUTTON_SELECT
#define METRONOME_MSG_START "press play"
#define METRONOME_MSG_STOP "press pause"
#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
#define METRONOME_QUIT BUTTON_MODE
#define METRONOME_PLAYPAUSE BUTTON_PLAY
#define METRONOME_VOL_UP BUTTON_UP
#define METRONOME_VOL_DOWN BUTTON_DOWN
#define METRONOME_TAP BUTTON_EQ
#define METRONOME_MSG_START "press play"
#define METRONOME_MSG_STOP "press pause"
#endif
#if CONFIG_REMOTE_KEYPAD == H100_REMOTE

View file

@ -55,6 +55,12 @@
#define MOSAIQUE_QUIT BUTTON_MENU
#define MOSAIQUE_SPEED BUTTON_SELECT
#define MOSAIQUE_RESTART BUTTON_PLAY
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define MOSAIQUE_QUIT BUTTON_PLAY
#define MOSAIQUE_SPEED BUTTON_MODE
#define MOSAIQUE_RESTART BUTTON_SELECT
#endif
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)

View file

@ -4,7 +4,7 @@
#ifdef CPU_COLDFIRE
OUTPUT_FORMAT(elf32-m68k)
#elif CONFIG_CPU==PP5020
#elif defined(CPU_ARM)
OUTPUT_FORMAT(elf32-littlearm)
#else
OUTPUT_FORMAT(elf32-sh)
@ -32,6 +32,10 @@ OUTPUT_FORMAT(elf32-sh)
#define DRAMORIG 0x10000000
#define IRAMORIG 0x4000c000
#define IRAMSIZE 0xc000
#elif CONFIG_CPU == PNX0101
#define DRAMORIG 0x24000000
#define IRAMORIG 0x408000
#define IRAMSIZE 0x8000
#else
#define DRAMORIG 0x09000000 + STUBOFFSET
#endif
@ -53,7 +57,7 @@ OUTPUT_FORMAT(elf32-sh)
MEMORY
{
PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD)
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
#endif
}
@ -64,7 +68,7 @@ SECTIONS
{
KEEP(*(.entry))
*(.text*)
#if CONFIG_CPU==PP5020
#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
*(.glue_7)
*(.glue_7t)
#endif
@ -79,7 +83,7 @@ SECTIONS
.data :
{
*(.data*)
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD)
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
iramcopy = .;
#endif
} > PLUGIN_RAM
@ -89,7 +93,7 @@ SECTIONS
*(.eh_frame)
}
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD)
#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
.iram IRAMORIG : AT ( iramcopy)
{
iramstart = .;

View file

@ -75,6 +75,13 @@ void joy_close(void)
#define ROCKBOY_PAD_SELECT BUTTON_PLAY
#define ROCKBOY_MENU BUTTON_OFF
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define ROCKBOY_PAD_A BUTTON_PLAY
#define ROCKBOY_PAD_B BUTTON_EQ
#define ROCKBOY_PAD_START BUTTON_MODE
#define ROCKBOY_PAD_SELECT (BUTTON_SELECT | BUTTON_REL)
#define ROCKBOY_MENU (BUTTON_SELECT | BUTTON_REPEAT)
#endif
unsigned int oldbuttonstate = 0, newbuttonstate,holdbutton;

View file

@ -36,6 +36,8 @@
#define SNOW_QUIT BUTTON_STOP
#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
#define SNOW_QUIT BUTTON_MENU
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define SNOW_QUIT BUTTON_PLAY
#else
#define SNOW_QUIT BUTTON_OFF
#endif

View file

@ -30,6 +30,8 @@ static int fontwidth, fontheight;
#define STATS_STOP BUTTON_STOP
#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
#define STATS_STOP BUTTON_MENU
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define STATS_STOP BUTTON_PLAY
#else
#define STATS_STOP BUTTON_OFF
#endif

View file

@ -68,6 +68,13 @@
#define STOPWATCH_LAP_TIMER BUTTON_RIGHT
#define STOPWATCH_SCROLL_UP BUTTON_SCROLL_FWD
#define STOPWATCH_SCROLL_DOWN BUTTON_SCROLL_BACK
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define STOPWATCH_QUIT BUTTON_PLAY
#define STOPWATCH_START_STOP BUTTON_MODE
#define STOPWATCH_RESET_TIMER BUTTON_EQ
#define STOPWATCH_LAP_TIMER BUTTON_SELECT
#define STOPWATCH_SCROLL_UP BUTTON_UP
#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
#endif
static struct plugin_api* rb;

View file

@ -131,6 +131,17 @@
#define VIEWER_MODE_PAGE (BUTTON_SELECT | BUTTON_LEFT | BUTTON_MENU)
#define VIEWER_MODE_SCROLLBAR (BUTTON_SELECT | BUTTON_LEFT | BUTTON_RIGHT)
/* iFP7xx keys */
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define VIEWER_QUIT BUTTON_PLAY
#define VIEWER_PAGE_UP BUTTON_UP
#define VIEWER_PAGE_DOWN BUTTON_DOWN
#define VIEWER_SCREEN_LEFT BUTTON_LEFT
#define VIEWER_SCREEN_RIGHT BUTTON_RIGHT
#define VIEWER_MODE_WRAP (BUTTON_EQ | BUTTON_REL)
#define VIEWER_MODE_LINE (BUTTON_EQ | BUTTON_REPEAT)
#define VIEWER_MODE_WIDTH BUTTON_MODE
#endif
enum {

View file

@ -114,6 +114,20 @@
#define KBD_UP BUTTON_SCROLL_BACK
#define KBD_DOWN BUTTON_SCROLL_FWD
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
/* TODO: Check keyboard mappings */
#define KBD_MODES /* iFP7xx uses 2 modes, picker and line edit */
#define KBD_SELECT (BUTTON_SELECT | BUTTON_REL) /* backspace in line edit */
#define KBD_SELECT_PRE BUTTON_SELECT
#define KBD_DONE BUTTON_MODE
#define KBD_ABORT BUTTON_PLAY
#define KBD_LEFT BUTTON_LEFT
#define KBD_RIGHT BUTTON_RIGHT
#define KBD_UP BUTTON_UP
#define KBD_DOWN BUTTON_DOWN
#endif
#if KEYBOARD_PAGES == 1

View file

@ -101,6 +101,12 @@
#define SETTINGS_NEXT BUTTON_RIGHT
#define SETTINGS_ACCEPT BUTTON_PLAY
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define SETTINGS_INC BUTTON_RIGHT
#define SETTINGS_DEC BUTTON_LEFT
#define SETTINGS_OK BUTTON_SELECT
#define SETTINGS_CANCEL BUTTON_PLAY
#endif
/* data structures */

View file

@ -150,6 +150,20 @@
#define TREE_WPS_PRE BUTTON_MENU
#define TREE_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define TREE_NEXT BUTTON_DOWN
#define TREE_PREV BUTTON_UP
#define TREE_EXIT BUTTON_LEFT
#define TREE_ABORT BUTTON_PLAY
#define TREE_RUN (BUTTON_RIGHT | BUTTON_REL)
#define TREE_RUN_PRE BUTTON_RIGHT
#define TREE_MENU (BUTTON_SELECT | BUTTON_REPEAT)
#define TREE_MENU_PRE BUTTON_SELECT
#define TREE_WPS (BUTTON_SELECT | BUTTON_REL)
#define TREE_WPS_PRE BUTTON_SELECT
#define TREE_CONTEXT (BUTTON_RIGHT | BUTTON_REPEAT)
#define TREE_POWER_BTN (BUTTON_PLAY | BUTTON_REPEAT)
#endif
struct entry {

View file

@ -157,3 +157,4 @@ Nick Lanham
Sebastian Henriksen
Martin Scarratt
Karl Kurbjun
Tomasz Malesinski

View file

@ -74,8 +74,12 @@ drivers/adc.c
#ifdef HAVE_MMC
drivers/ata_mmc.c
#else
#ifdef HAVE_FLASH_DISK
drivers/ata_flash.c
#else
drivers/ata.c
#endif
#endif
drivers/button.c
drivers/dac.c
drivers/fat.c
@ -93,6 +97,8 @@ tuner_philips.c
drivers/i2c-coldfire.c
#elif CONFIG_I2C == I2C_PP5020
drivers/i2c-pp5020.c
#elif CONFIG_I2C == I2C_PNX0101
drivers/i2c-pnx0101.c
#else
drivers/i2c.c
#endif

View file

@ -7,7 +7,7 @@ INPUT(crt0.o)
#elif CONFIG_CPU == TCC730
OUTPUT_FORMAT(elf32-calmrisc16)
INPUT(crt0.o)
#elif CONFIG_CPU == PP5020
#elif defined(CPU_ARM)
OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
INPUT(crt0.o)
@ -126,6 +126,10 @@ _pluginbuf = 0;
#define DRAMORIG 0x00000000 + STUBOFFSET
#define IRAMORIG 0x40000000
#define IRAMSIZE 0xc000
#elif CONFIG_CPU==PNX0101
#define DRAMORIG 0x24000000 + STUBOFFSET
#define IRAMORIG 0x400100
#define IRAMSIZE 0x7f00
#else
#define DRAMORIG 0x09000000 + STUBOFFSET
#define IRAMORIG 0x0f000000
@ -161,7 +165,7 @@ SECTIONS
. = ALIGN(0x200);
*(.init.text)
*(.text*)
#if CONFIG_CPU==PP5020
#ifdef CPU_ARM
*(.glue_7)
*(.glue_7t)
#endif
@ -214,7 +218,7 @@ SECTIONS
_iend = .;
} > IRAM
#if defined(CPU_COLDFIRE) || CONFIG_CPU==PP5020
#if defined(CPU_COLDFIRE) || defined(CPU_ARM)
.stack :
{
*(.stack)
@ -234,7 +238,7 @@ SECTIONS
} > DRAM
#endif
#if defined(CPU_COLDFIRE) || CONFIG_CPU==PP5020
#if defined(CPU_COLDFIRE) || defined(CPU_ARM)
.bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
#else
.bss :

View file

@ -242,6 +242,8 @@ static void __backlight_on(void)
/* set port L07 on */
outl(((0x100 | 1) << 7), 0x6000d12c);
#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
GPIO3_SET = 1;
#endif
}
@ -279,6 +281,8 @@ static void __backlight_off(void)
/* set port L07 off */
outl(((0x100 | 0) << 7), 0x6000d12c);
#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
GPIO3_CLR = 1;
#endif
}

View file

@ -37,6 +37,8 @@ start:
*
*/
msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */
#ifndef BOOTLOADER
#if CONFIG_CPU == PP5002 || CONFIG_CPU == PP5020
b pad_skip
@ -247,8 +249,8 @@ boot_table:
/* Set up stack for IRQ mode */
msr cpsr_c, #0xd2
ldr sp, =irq_stack
/* Switch to supervisor mode, enable IRQ and FIQ processing */
msr cpsr_c, #0x13
/* Switch to supervisor mode */
msr cpsr_c, #0xd3
ldr sp, =stackend
bl main
/* main() should never return */

View file

@ -294,4 +294,38 @@ void adc_init(void)
}
#elif CONFIG_CPU == PNX0101
static unsigned short adcdata[NUM_ADC_CHANNELS];
unsigned short adc_read(int channel)
{
return adcdata[channel];
}
static void adc_tick(void)
{
if (ADCST & 0x10) {
adcdata[0] = ADCCH0 & 0x3ff;
adcdata[1] = ADCCH1 & 0x3ff;
adcdata[2] = ADCCH2 & 0x3ff;
adcdata[3] = ADCCH3 & 0x3ff;
adcdata[4] = ADCCH4 & 0x3ff;
ADCST = 0xa;
}
}
void adc_init(void)
{
ADCR24 = 0xaaaaa;
ADCR28 = 0;
ADCST = 2;
ADCST = 0xa;
while (!(ADCST & 0x10));
adc_tick();
tick_add_task(adc_tick);
}
#endif

View file

@ -61,7 +61,7 @@ static bool flipped; /* buttons can be flipped to match the LCD flip */
#define REPEAT_INTERVAL_FINISH 5
/* the power-off button and number of repeated keys before shutting off */
#if CONFIG_KEYPAD == IPOD_4G_PAD
#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
#define POWEROFF_BUTTON BUTTON_PLAY
#define POWEROFF_COUNT 40
#else
@ -731,6 +731,47 @@ static int button_read(void)
if (!remote_hold_button && ((data & 0x40) == 0))
btn |= BUTTON_RC_ON;
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
static bool hold_button = false;
/* light handling */
if (hold_button && !button_hold())
{
backlight_on();
}
hold_button = button_hold();
/* normal buttons */
if (!button_hold())
{
data = adc_read(ADC_BUTTONS);
if (data < 0x151)
if (data < 0xc7)
if (data < 0x41)
btn = BUTTON_LEFT;
else
btn = BUTTON_RIGHT;
else
btn = BUTTON_SELECT;
else
if (data < 0x268)
if (data < 0x1d7)
btn = BUTTON_UP;
else
btn = BUTTON_DOWN;
else
if (data < 0x2f9)
btn = BUTTON_EQ;
else
if (data < 0x35c)
btn = BUTTON_MODE;
}
if (!button_hold() && (adc_read(ADC_BUTTON_PLAY) < 0x64))
btn |= BUTTON_PLAY;
#elif CONFIG_KEYPAD == RECORDER_PAD
#ifdef HAVE_FMADC
@ -877,6 +918,13 @@ bool remote_button_hold(void)
}
#endif
#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
bool button_hold(void)
{
return (GPIO5_READ & 4) ? false : true;
}
#endif
int button_status(void)
{
return lastbtn;

View file

@ -135,6 +135,24 @@ void lcd_write_data( const unsigned char* data, int count ) {
P2 |= 0x20;
}
}
#elif CONFIG_CPU == PNX0101
void lcd_write_command(int cmd)
{
while ((LCDSTAT & 3) != 3);
LCDCMD = cmd;
}
void lcd_write_data( const unsigned char* data, int count )
{
int i;
for (i=0; i < count; i++) {
while ((LCDSTAT & 3) != 3);
LCDDATA = data[i];
}
}
#endif
/*** hardware configuration ***/
@ -145,6 +163,8 @@ int lcd_default_contrast(void)
return 30;
#elif CONFIG_LCD == LCD_GMINI100
return 31;
#elif CONFIG_LCD == LCD_IFP7XX
return 45;
#else
return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49;
#endif
@ -197,7 +217,11 @@ void lcd_set_flip(bool yesno)
{
lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01);
lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
#if CONFIG_LCD == LCD_IFP7XX
xoffset = 4;
#else
xoffset = 0;
#endif
}
#endif
}
@ -236,6 +260,9 @@ void lcd_init(void)
P2CONL |= 0x5a;
P2CONL &= 0x5b;
P2CONH |= 1;
#elif CONFIG_CPU == PNX0101
LCDREG10 = 0xf;
LCDREG04 = 0x4084;
#else
/* Initialize PB0-3 as output pins */
PBCR2 &= 0xff00; /* MD = 00 */
@ -245,7 +272,11 @@ void lcd_init(void)
/* inits like the original firmware */
lcd_write_command(LCD_SOFTWARE_RESET);
lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4);
#if CONFIG_LCD == LCD_IFP7XX
lcd_write_command(LCD_SET_LCD_BIAS);
#else
lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */
#endif
lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7);
/* power control register: op-amp=1, regulator=1, booster=1 */
lcd_write_command(LCD_SET_DISPLAY_ON);

View file

@ -182,6 +182,8 @@ void ide_power_enable(bool on)
P1 |= 0x08;
else
P1 &= ~0x08;
#elif CONFIG_CPU == PNX0101
/* no ide controller */
#else /* SH1 based archos */
bool touched = false;
#ifdef NEEDS_ATA_POWER_ON
@ -266,6 +268,9 @@ void power_off(void)
/* We don't turn off the ipod, we put it in a deep sleep */
pcf50605_standby_mode();
#endif
#elif CONFIG_CPU == PNX0101
GPIO1_CLR = 1 << 16;
GPIO2_SET = 1;
#elif defined(GMINI_ARCH)
P1 &= ~1;
P1CON &= ~1;

View file

@ -27,8 +27,9 @@
#include "lcd.h"
#include "serial.h"
#if (CONFIG_CPU != MCF5249) && (CONFIG_CPU != TCC730) && (CONFIG_CPU != PP5020)
#if (CONFIG_CPU != MCF5249) && (CONFIG_CPU != TCC730) && (CONFIG_CPU != PP5020) && (CONFIG_CPU != PNX0101)
/* FIX: this doesn't work on iRiver or Gmini or iPod yet */
/* iFP7xx has no remote */
#ifndef HAVE_MMC /* MMC takes serial port 1, so don't mess with it */

View file

@ -29,6 +29,15 @@
#define ADC_BATTERY 2
#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
#elif defined(IRIVER_IFP7XX)
#define NUM_ADC_CHANNELS 5
#define ADC_BUTTONS 0
#define ADC_BATTERY 1
#define ADC_BUTTON_PLAY 2
#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
#else
#define NUM_ADC_CHANNELS 8

View file

@ -45,6 +45,10 @@ bool button_hold(void);
bool remote_button_hold(void);
#endif
#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
bool button_hold(void);
#endif
#define BUTTON_NONE 0x0000
/* Shared button codes */
@ -159,6 +163,15 @@ bool remote_button_hold(void);
#define BUTTON_SCROLL_FWD 0x0010
#define BUTTON_SCROLL_BACK 0x0020
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
#define BUTTON_PLAY 0x0001
#define BUTTON_EQ 0x0002
#define BUTTON_MODE 0x0004
#define BUTTON_UP 0x0010
#define BUTTON_DOWN 0x0020
#define BUTTON_SELECT 0x0100
#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */
#endif /* _BUTTON_H_ */

View file

@ -0,0 +1,96 @@
/*
* This config file is for iriver iFP-799
*/
#define IRIVER_IFP7XX_SERIES 1
/* For Rolo and boot loader */
#define MODEL_NUMBER 6
/* define this if you have recording possibility */
/*#define HAVE_RECORDING 1*/
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP 1
/* define this if you have a colour LCD */
/* #define HAVE_LCD_COLOR 1 */
/* LCD dimensions */
#define LCD_WIDTH 128
#define LCD_HEIGHT 64
#define LCD_DEPTH 1
#define CONFIG_KEYPAD IRIVER_IFP7XX_PAD
#define CONFIG_FLASH FLASH_IFP7XX
#define HAVE_FAT16SUPPORT
/* Define this if you do software codec */
#define CONFIG_CODEC SWCODEC
/* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF
/* The number of bytes reserved for loadable codecs */
#define CODEC_SIZE 0x30000
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x20000
/* Define this if you have the WM8975 audio codec */
/* #define HAVE_WM8975 */
#define HAVE_FLASH_DISK
#ifndef SIMULATOR
/* Define this if you have a Philips PNX0101 */
#define CONFIG_CPU PNX0101
/* Define this if you want to use the PNX0101 i2c interface */
#define CONFIG_I2C I2C_PNX0101
/* Type of mobile power */
//#define CONFIG_BATTERY BATT_LIPOL1300
#define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */
/* Define this if the platform can charge batteries */
//#define HAVE_CHARGING 1
/* define this if the hardware can be powered off while charging */
//#define HAVE_POWEROFF_WHILE_CHARGING
/* The start address index for ROM builds */
#define ROM_START 0x00000000
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IRIVER_IFP7XX /* port controlled */
/* Define this to the CPU frequency */
#define CPU_FREQ 30000000
#define CONFIG_LCD LCD_IFP7XX
/* Offset ( in the firmware file's header ) to the file length */
#define FIRMWARE_OFFSET_FILE_LENGTH 0
/* Offset ( in the firmware file's header ) to the file CRC */
#define FIRMWARE_OFFSET_FILE_CRC 0
/* Offset ( in the firmware file's header ) to the real data */
#define FIRMWARE_OFFSET_FILE_DATA 8
#define USB_ISP1582
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
/* Define this if you have adjustable CPU frequency */
//#define HAVE_ADJUSTABLE_CPU_FREQ
#define BOOTFILE_EXT "iriver"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#endif

View file

@ -41,6 +41,7 @@
#define TCC730 730 /* lacking a proper abbrivation */
#define PP5002 5002
#define PP5020 5020
#define PNX0101 101
/* CONFIG_KEYPAD */
#define PLAYER_PAD 0
@ -51,6 +52,7 @@
#define IRIVER_H300_PAD 5
#define IAUDIO_X5_PAD 6
#define IPOD_4G_PAD 7
#define IRIVER_IFP7XX_PAD 8
/* CONFIG_REMOTE_KEYPAD */
#define H100_REMOTE 1
@ -75,6 +77,7 @@
#define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
#define LCD_IPODNANO 7 /* as used by iPod Nano */
#define LCD_IPODVIDEO 8 /* as used by iPod Video */
#define LCD_IFP7XX 9 /* as used by iRiver iFP 7xx/8xx */
/* LCD_PIXELFORMAT */
#define RGB565 565
@ -89,6 +92,7 @@
#define BL_IPOD4G 5 /* Apple iPod 4G */
#define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/
#define BL_IRIVER_H300 7 /* IRiver PWM */
#define BL_IRIVER_IFP7XX 8 /* IRiver GPIO */
/* CONFIG_I2C */
#define I2C_PLAYREC 0 /* Archos Player/Recorder style */
@ -96,11 +100,15 @@
#define I2C_GMINI 2 /* Gmini style */
#define I2C_COLDFIRE 3 /* Coldfire style */
#define I2C_PP5020 4 /* PP5020 style */
#define I2C_PNX0101 5 /* PNX0101 style */
/* CONFIG_LED */
#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */
#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
/* CONFIG_FLASH */
#define FLASH_IFP7XX 1
/* CONFIG_RTC */
#define RTC_M41ST84W 1 /* Archos Recorder */
#define RTC_PCF50605 2 /* iPod 4G */
@ -139,6 +147,8 @@
#include "config-ipodnano.h"
#elif defined(IPOD_VIDEO)
#include "config-ipodvideo.h"
#elif defined(IRIVER_IFP7XX)
#include "config-ifp7xx.h"
#else
/* no known platform */
#endif
@ -156,7 +166,7 @@
#endif
/* define for all cpus from ARM family */
#if (CONFIG_CPU == PP5020)
#if (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101)
#define CPU_ARM
#endif

View file

@ -33,3 +33,6 @@
#if CONFIG_CPU == PP5020
#include "pp5020.h"
#endif
#if CONFIG_CPU == PNX0101
#include "pnx0101.h"
#endif

67
firmware/export/pnx0101.h Normal file
View file

@ -0,0 +1,67 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2005 by Tomasz Malesinski
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef __PNX0101_H__
#define __PNX0101_H__
#define GPIO0_READ (*(volatile unsigned long *)0x80003000)
#define GPIO0_SET (*(volatile unsigned long *)0x80003014)
#define GPIO0_CLR (*(volatile unsigned long *)0x80003018)
#define GPIO1_READ (*(volatile unsigned long *)0x80003040)
#define GPIO1_SET (*(volatile unsigned long *)0x80003054)
#define GPIO1_CLR (*(volatile unsigned long *)0x80003058)
#define GPIO2_READ (*(volatile unsigned long *)0x80003080)
#define GPIO2_SET (*(volatile unsigned long *)0x80003094)
#define GPIO2_CLR (*(volatile unsigned long *)0x80003098)
#define GPIO3_READ (*(volatile unsigned long *)0x800030c0)
#define GPIO3_SET (*(volatile unsigned long *)0x800030d4)
#define GPIO3_CLR (*(volatile unsigned long *)0x800030d8)
#define GPIO4_READ (*(volatile unsigned long *)0x80003100)
#define GPIO4_SET (*(volatile unsigned long *)0x80003114)
#define GPIO4_CLR (*(volatile unsigned long *)0x80003118)
#define GPIO5_READ (*(volatile unsigned long *)0x80003140)
#define GPIO5_SET (*(volatile unsigned long *)0x80003154)
#define GPIO5_CLR (*(volatile unsigned long *)0x80003158)
#define GPIO6_READ (*(volatile unsigned long *)0x80003180)
#define GPIO6_SET (*(volatile unsigned long *)0x80003194)
#define GPIO6_CLR (*(volatile unsigned long *)0x80003198)
#define GPIO7_READ (*(volatile unsigned long *)0x800031c0)
#define GPIO7_SET (*(volatile unsigned long *)0x800031d4)
#define GPIO7_CLR (*(volatile unsigned long *)0x800031d8)
#define LCDREG04 (*(volatile unsigned long *)0x80104004)
#define LCDSTAT (*(volatile unsigned long *)0x80104008)
#define LCDREG10 (*(volatile unsigned long *)0x80104010)
#define LCDCMD (*(volatile unsigned long *)0x80104020)
#define LCDDATA (*(volatile unsigned long *)0x80104030)
#define TIMERR00 (*(volatile unsigned long *)0x80020000)
#define TIMERR08 (*(volatile unsigned long *)0x80020008)
#define TIMERR0C (*(volatile unsigned long *)0x8002000c)
#define ADCCH0 (*(volatile unsigned long *)0x80002400)
#define ADCCH1 (*(volatile unsigned long *)0x80002404)
#define ADCCH2 (*(volatile unsigned long *)0x80002408)
#define ADCCH3 (*(volatile unsigned long *)0x8000240c)
#define ADCCH4 (*(volatile unsigned long *)0x80002410)
#define ADCST (*(volatile unsigned long *)0x80002420)
#define ADCR24 (*(volatile unsigned long *)0x80002424)
#define ADCR28 (*(volatile unsigned long *)0x80002428)
#endif

View file

@ -299,7 +299,7 @@ static inline void invalidate_icache(void)
#define CPUFREQ_MAX_MULT 11
#define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ)
#elif CONFIG_CPU == PP5020
#elif defined(CPU_ARM)
/* TODO: Implement set_irq_level and check CPU frequencies */
@ -330,14 +330,26 @@ static inline unsigned long swap32(unsigned long value)
}
#define HIGHEST_IRQ_LEVEL (1)
static inline int set_irq_level(int level)
{
int result=level;
return result;
unsigned long cpsr;
/* Read the old level and set the new one */
asm volatile ("mrs %0,cpsr" : "=r" (cpsr));
asm volatile ("msr cpsr_c,%0"
: : "r" ((cpsr & ~0x80) | (level << 7)));
return (cpsr >> 7) & 1;
}
#define invalidate_icache()
#if CONFIG_CPU == PNX0101
typedef void (*interrupt_handler_t)(void);
void irq_set_int_handler(int n, interrupt_handler_t handler);
void irq_enable_int(int n);
#endif
#elif CONFIG_CPU == TCC730
extern int smsc_version(void);

View file

@ -358,6 +358,41 @@ void tick_start(unsigned int interval_in_ms)
#endif
}
#elif CONFIG_CPU == PNX0101
void timer_handler(void)
{
int i;
/* Run through the list of tick tasks */
for(i = 0;i < MAX_NUM_TICK_TASKS;i++)
{
if(tick_funcs[i])
tick_funcs[i]();
}
current_tick++;
wake_up_thread();
TIMERR0C = 1;
}
void tick_start(unsigned int interval_in_ms)
{
TIMERR08 &= ~0x80;
TIMERR0C = 1;
TIMERR08 &= ~0x80;
TIMERR08 |= 0x40;
TIMERR00 = 3000000 * interval_in_ms / 1000;
TIMERR08 &= ~0xc;
TIMERR0C = 1;
irq_set_int_handler(4, timer_handler);
irq_enable_int(4);
TIMERR08 |= 0x80;
}
#endif
int tick_add_task(void (*f)(void))

View file

@ -487,4 +487,55 @@ long pcm_get_bytes_waiting(void)
return 0;
}
#elif CONFIG_CPU == PNX0101
/* TODO: Implement for iFP7xx
For now, just implement some dummy functions.
*/
void pcm_init(void)
{
}
void pcm_set_frequency(unsigned int frequency)
{
(void)frequency;
}
void pcm_play_data(void (*get_more)(unsigned char** start, long* size))
{
(void)get_more;
}
void pcm_play_stop(void)
{
}
void pcm_play_pause(bool play)
{
(void)play;
}
bool pcm_is_paused(void)
{
return false;
}
bool pcm_is_playing(void)
{
return false;
}
void pcm_calculate_peaks(int *left, int *right)
{
(void)left;
(void)right;
}
long pcm_get_bytes_waiting(void)
{
return 0;
}
#endif

View file

@ -1191,5 +1191,86 @@ int system_memory_guard(int newmode)
return 0;
}
#elif CONFIG_CPU==PNX0101
interrupt_handler_t interrupt_vector[0x1d] __attribute__ ((section(".idata")));
#define IRQ_REG(reg) (*(volatile unsigned long *)(0x80300000 + (reg)))
static inline unsigned long irq_read(int reg)
{
unsigned long v, v2;
do
{
v = IRQ_REG(reg);
v2 = IRQ_REG(reg);
} while (v != v2);
return v;
}
#define IRQ_WRITE_WAIT(reg, val, cond) \
do { unsigned long v, v2; \
do { \
IRQ_REG(reg) = (val); \
v = IRQ_REG(reg); \
v2 = IRQ_REG(reg); \
} while ((v != v2) || !(cond)); \
} while (0);
static void UIE(void) {}
void irq(void)
{
int n = irq_read(0x100) >> 3;
(*(interrupt_vector[n]))();
}
void irq_enable_int(int n)
{
IRQ_WRITE_WAIT(0x404 + n * 4, 0x4010000, v & 0x10000);
}
void irq_set_int_handler(int n, interrupt_handler_t handler)
{
interrupt_vector[n + 1] = handler;
}
void system_init(void)
{
int i;
/* turn off watchdog */
(*(volatile unsigned long *)0x80002804) = 0;
/*
IRQ_WRITE_WAIT(0x100, 0, v == 0);
IRQ_WRITE_WAIT(0x104, 0, v == 0);
IRQ_WRITE_WAIT(0, 0, v == 0);
IRQ_WRITE_WAIT(4, 0, v == 0);
*/
for (i = 0; i < 0x1c; i++)
{
IRQ_WRITE_WAIT(0x404 + i * 4, 0x1e000001, (v & 0x3010f) == 1);
IRQ_WRITE_WAIT(0x404 + i * 4, 0x4000000, (v & 0x10000) == 0);
IRQ_WRITE_WAIT(0x404 + i * 4, 0x10000001, (v & 0xf) == 1);
interrupt_vector[i + 1] = UIE;
}
interrupt_vector[0] = UIE;
}
void system_reboot(void)
{
(*(volatile unsigned long *)0x80002804) = 1;
while (1);
}
int system_memory_guard(int newmode)
{
(void)newmode;
return 0;
}
#endif /* CONFIG_CPU */

View file

@ -326,7 +326,7 @@ int create_thread(void (*function)(void), void* stack, int stack_size,
thread_stack[num_threads] = stack;
thread_stack_size[num_threads] = stack_size;
regs = &thread_contexts[num_threads];
#if defined(CPU_COLDFIRE) || (CONFIG_CPU == SH7034) || (CONFIG_CPU == PP5020)
#if defined(CPU_COLDFIRE) || (CONFIG_CPU == SH7034) || defined(CPU_ARM)
/* Align stack to an even 32 bit boundary */
regs->sp = (void*)(((unsigned int)stack + stack_size) & ~3);
#elif CONFIG_CPU == TCC730

View file

@ -180,6 +180,9 @@ void usb_enable(bool on)
outl(1, 0x40017F10);
outl(inl(0x60006004) | 0x4, 0x60006004);
}
#elif defined(USB_ISP1582)
/* TODO: Implement USB_ISP1582 */
(void) on;
#else
#ifdef HAVE_LCD_BITMAP
if(read_hw_mask() & USB_ACTIVE_HIGH)
@ -403,6 +406,10 @@ bool usb_detect(void)
return false;
}
current_status = (USB_STATUS & 0x800)?true:false;
#endif
#ifdef USB_ISP1582
/* TODO: Implement USB_ISP1582 */
current_status = false;
#endif
return current_status;
}

15
tools/configure vendored
View file

@ -425,6 +425,7 @@ appsdir='\$(ROOTDIR)/apps'
echo "13 - iPod Color/Photo"
echo "14 - iPod Nano"
echo "15 - iPod Video"
echo "16 - iriver iFP-790"
getit=`input`;
@ -691,6 +692,20 @@ appsdir='\$(ROOTDIR)/apps'
toolset=$ipodbitmaptools
;;
16)
archos="ifp7xx"
target="-DIRIVER_IFP7XX"
memory=1
arm7tdmicc
tool="cp"
output="rockbox.wma"
appextra="recorder:gui"
archosrom=""
flash=""
plugins="yes"
codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
;;
*)
echo "Please select an actual target platform!"
exit

View file

@ -171,6 +171,8 @@ int main (int argc, char** argv)
modelnum = 4;
else if(!strcmp(&argv[1][5], "ipvd"))
modelnum = 5;
else if(!strcmp(&argv[1][5], "fp7x"))
modelnum = 6;
else {
fprintf(stderr, "unsupported model: %s\n", &argv[1][5]);
return 2;