summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/bookmark.h5
-rw-r--r--apps/codecs/SOURCES2
-rw-r--r--apps/debug_menu.c6
-rw-r--r--apps/gui/gwps.h19
-rw-r--r--apps/gui/list.h4
-rw-r--r--apps/gui/select.h8
-rw-r--r--apps/gui/yesno.h3
-rw-r--r--apps/menu.h8
-rw-r--r--apps/plugins/Makefile2
-rw-r--r--apps/plugins/SOURCES2
-rw-r--r--apps/plugins/battery_test.c2
-rw-r--r--apps/plugins/chessclock.c10
-rw-r--r--apps/plugins/cube.c12
-rw-r--r--apps/plugins/databox/databox.c3
-rw-r--r--apps/plugins/dict.c2
-rw-r--r--apps/plugins/jewels.c6
-rw-r--r--apps/plugins/logo.c6
-rw-r--r--apps/plugins/metronome.c9
-rw-r--r--apps/plugins/mosaique.c6
-rw-r--r--apps/plugins/plugin.lds14
-rw-r--r--apps/plugins/rockboy/sys_rockbox.c7
-rw-r--r--apps/plugins/snow.c2
-rw-r--r--apps/plugins/stats.c2
-rw-r--r--apps/plugins/stopwatch.c7
-rw-r--r--apps/plugins/viewer.c11
-rw-r--r--apps/recorder/keyboard.c14
-rw-r--r--apps/settings.h6
-rw-r--r--apps/tree.h14
-rw-r--r--docs/CREDITS1
-rw-r--r--firmware/SOURCES6
-rw-r--r--firmware/app.lds12
-rw-r--r--firmware/backlight.c4
-rw-r--r--firmware/crt0.S6
-rw-r--r--firmware/drivers/adc.c34
-rw-r--r--firmware/drivers/button.c50
-rw-r--r--firmware/drivers/lcd-recorder.c31
-rw-r--r--firmware/drivers/power.c5
-rw-r--r--firmware/drivers/serial.c3
-rw-r--r--firmware/export/adc.h9
-rw-r--r--firmware/export/button.h13
-rw-r--r--firmware/export/config-ifp7xx.h96
-rw-r--r--firmware/export/config.h12
-rw-r--r--firmware/export/cpu.h3
-rw-r--r--firmware/export/pnx0101.h67
-rw-r--r--firmware/export/system.h18
-rw-r--r--firmware/kernel.c35
-rw-r--r--firmware/pcm_playback.c51
-rw-r--r--firmware/system.c81
-rw-r--r--firmware/thread.c2
-rw-r--r--firmware/usb.c7
-rwxr-xr-xtools/configure15
-rw-r--r--tools/scramble.c2
52 files changed, 737 insertions, 18 deletions
diff --git a/apps/bookmark.h b/apps/bookmark.h
index dff4473167..284c0ceffb 100644
--- a/apps/bookmark.h
+++ b/apps/bookmark.h
@@ -38,6 +38,11 @@
38#define BOOKMARK_DELETE (BUTTON_RIGHT | BUTTON_REPEAT) 38#define BOOKMARK_DELETE (BUTTON_RIGHT | BUTTON_REPEAT)
39#define BOOKMARK_DOWN BUTTON_SCROLL_FWD 39#define BOOKMARK_DOWN BUTTON_SCROLL_FWD
40 40
41#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
42#define BOOKMARK_SELECT BUTTON_SELECT
43#define BOOKMARK_DELETE (BUTTON_PLAY | BUTTON_SELECT)
44#define BOOKMARK_DOWN BUTTON_DOWN
45
41#else /* player, recorder, gmini */ 46#else /* player, recorder, gmini */
42#define BOOKMARK_SELECT BUTTON_PLAY 47#define BOOKMARK_SELECT BUTTON_PLAY
43#define BOOKMARK_DELETE (BUTTON_ON | BUTTON_PLAY) 48#define BOOKMARK_DELETE (BUTTON_ON | BUTTON_PLAY)
diff --git a/apps/codecs/SOURCES b/apps/codecs/SOURCES
index 69d925248b..911ee3b705 100644
--- a/apps/codecs/SOURCES
+++ b/apps/codecs/SOURCES
@@ -7,6 +7,8 @@ a52.c
7mpc.c 7mpc.c
8wavpack.c 8wavpack.c
9alac.c 9alac.c
10#if MEMORYSIZE > 1
10aac.c 11aac.c
12#endif
11shorten.c 13shorten.c
12#endif 14#endif
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 4bb2cfbe75..69c0e2fceb 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -359,6 +359,12 @@ bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
359 (void)p_device; 359 (void)p_device;
360 (void)addr1; 360 (void)addr1;
361 (void)addr2; 361 (void)addr2;
362#elif CONFIG_CPU == PNX0101
363 /* TODO: Implement for iFP7xx */
364 (void)p_manufacturer;
365 (void)p_device;
366 (void)addr1;
367 (void)addr2;
362#else 368#else
363 unsigned not_manu, not_id; /* read values before switching to ID mode */ 369 unsigned not_manu, not_id; /* read values before switching to ID mode */
364 unsigned manu, id; /* read values when in ID mode */ 370 unsigned manu, id; /* read values when in ID mode */
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 610c3021bf..b6d06a645a 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -191,6 +191,25 @@
191#define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT) 191#define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT)
192#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT) 192#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
193 193
194#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
195
196/* TODO: Check WPS button assignments */
197
198#define WPS_NEXT (BUTTON_RIGHT | BUTTON_REL)
199#define WPS_NEXT_PRE BUTTON_RIGHT
200#define WPS_PREV (BUTTON_LEFT | BUTTON_REL)
201#define WPS_PREV_PRE BUTTON_LEFT
202#define WPS_FFWD (BUTTON_RIGHT | BUTTON_REPEAT)
203#define WPS_REW (BUTTON_LEFT | BUTTON_REPEAT)
204#define WPS_INCVOL BUTTON_UP
205#define WPS_DECVOL BUTTON_DOWN
206#define WPS_PAUSE BUTTON_PLAY
207/* #define WPS_MENU iFP7xx can't have both main menu and context menu in wps */
208#define WPS_BROWSE (BUTTON_SELECT | BUTTON_REL)
209#define WPS_BROWSE_PRE BUTTON_SELECT
210#define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT)
211#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
212
194#endif 213#endif
195 214
196/* constants used in line_type and as refresh_mode for wps_refresh */ 215/* constants used in line_type and as refresh_mode for wps_refresh */
diff --git a/apps/gui/list.h b/apps/gui/list.h
index 3ae1b80dc2..4f02693127 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -69,6 +69,10 @@
69#define LIST_NEXT BUTTON_SCROLL_FWD 69#define LIST_NEXT BUTTON_SCROLL_FWD
70#define LIST_PREV BUTTON_SCROLL_BACK 70#define LIST_PREV BUTTON_SCROLL_BACK
71 71
72#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
73#define LIST_NEXT BUTTON_DOWN
74#define LIST_PREV BUTTON_UP
75
72#elif CONFIG_KEYPAD == GMINI100_PAD 76#elif CONFIG_KEYPAD == GMINI100_PAD
73#define LIST_NEXT BUTTON_DOWN 77#define LIST_NEXT BUTTON_DOWN
74#define LIST_PREV BUTTON_UP 78#define LIST_PREV BUTTON_UP
diff --git a/apps/gui/select.h b/apps/gui/select.h
index b6a9afd55c..3f6dd1413b 100644
--- a/apps/gui/select.h
+++ b/apps/gui/select.h
@@ -61,6 +61,14 @@
61#define SELECT_OK2 BUTTON_RIGHT 61#define SELECT_OK2 BUTTON_RIGHT
62#define SELECT_CANCEL BUTTON_MENU 62#define SELECT_CANCEL BUTTON_MENU
63 63
64#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
65#define SELECT_INC BUTTON_UP
66#define SELECT_DEC BUTTON_DOWN
67#define SELECT_OK BUTTON_RIGHT
68#define SELECT_OK2 BUTTON_LEFT
69#define SELECT_CANCEL BUTTON_PLAY
70#define SELECT_CANCEL2 BUTTON_MODE
71
64#elif CONFIG_KEYPAD == ONDIO_PAD 72#elif CONFIG_KEYPAD == ONDIO_PAD
65#define SELECT_INC BUTTON_UP 73#define SELECT_INC BUTTON_UP
66#define SELECT_DEC BUTTON_DOWN 74#define SELECT_DEC BUTTON_DOWN
diff --git a/apps/gui/yesno.h b/apps/gui/yesno.h
index 5399c88391..98bf84f504 100644
--- a/apps/gui/yesno.h
+++ b/apps/gui/yesno.h
@@ -25,6 +25,9 @@
25 25
26#elif (CONFIG_KEYPAD == IPOD_4G_PAD) 26#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
27#define YESNO_OK BUTTON_RIGHT 27#define YESNO_OK BUTTON_RIGHT
28
29#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
30#define YESNO_OK BUTTON_RIGHT
28#endif 31#endif
29enum yesno_res 32enum yesno_res
30{ 33{
diff --git a/apps/menu.h b/apps/menu.h
index 2d5c036a34..143933d833 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -78,6 +78,14 @@
78#define MENU_EXIT_MENU BUTTON_MENU 78#define MENU_EXIT_MENU BUTTON_MENU
79#define MENU_ENTER BUTTON_RIGHT 79#define MENU_ENTER BUTTON_RIGHT
80 80
81#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
82
83#define MENU_NEXT BUTTON_DOWN
84#define MENU_PREV BUTTON_UP
85#define MENU_EXIT BUTTON_LEFT
86#define MENU_EXIT_MENU BUTTON_PLAY
87#define MENU_ENTER BUTTON_RIGHT
88
81#endif 89#endif
82 90
83struct menu_item { 91struct menu_item {
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index 98c66c6d46..45fa7a469d 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -43,8 +43,10 @@ SUBDIRS += searchengine databox
43 43
44#for any recorder and iRiver model 44#for any recorder and iRiver model
45ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET))))) 45ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET)))))
46ifneq (-DIRIVER_IFP7XX,$(TARGET))
46 SUBDIRS += rockboy 47 SUBDIRS += rockboy
47endif 48endif
49endif
48 50
49 51
50.PHONY: $(SUBDIRS) 52.PHONY: $(SUBDIRS)
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 6742b88218..98ffcc2be8 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -18,6 +18,7 @@ viewer.c
18dict.c 18dict.c
19metronome.c 19metronome.c
20 20
21#ifndef IRIVER_IFP7XX_SERIES /* Temporarily disable plugin building for iFP7xx */
21#ifdef HAVE_LCD_BITMAP /* Recorder/Ondio models only */ 22#ifdef HAVE_LCD_BITMAP /* Recorder/Ondio models only */
22solitaire.c 23solitaire.c
23#ifndef HAVE_LCD_COLOR 24#ifndef HAVE_LCD_COLOR
@@ -89,4 +90,5 @@ wav2wv.c
89midi2wav.c 90midi2wav.c
90#else 91#else
91splitedit.c 92splitedit.c
93#endif /* iFP7xx */
92#endif 94#endif
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c
index b559ed53af..ac47b001f2 100644
--- a/apps/plugins/battery_test.c
+++ b/apps/plugins/battery_test.c
@@ -39,6 +39,8 @@
39#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ 39#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
40 (CONFIG_KEYPAD == IRIVER_H300_PAD) 40 (CONFIG_KEYPAD == IRIVER_H300_PAD)
41#define BATTERY_TEST_QUIT BUTTON_OFF 41#define BATTERY_TEST_QUIT BUTTON_OFF
42#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
43#define BATTERY_TEST_QUIT BUTTON_PLAY
42#elif (CONFIG_KEYPAD == IPOD_4G_PAD) 44#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
43#define BATTERY_TEST_QUIT BUTTON_MENU 45#define BATTERY_TEST_QUIT BUTTON_MENU
44#endif 46#endif
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index 3291f3e32e..18ba68014f 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -74,6 +74,16 @@
74#define CHC_SETTINGS_OK BUTTON_SELECT 74#define CHC_SETTINGS_OK BUTTON_SELECT
75#define CHC_SETTINGS_CANCEL BUTTON_MENU 75#define CHC_SETTINGS_CANCEL BUTTON_MENU
76 76
77#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
78#define CHC_QUIT BUTTON_PLAY
79#define CHC_STARTSTOP BUTTON_MODE
80#define CHC_RESET BUTTON_EQ
81#define CHC_MENU BUTTON_SELECT
82#define CHC_SETTINGS_INC BUTTON_RIGHT
83#define CHC_SETTINGS_DEC BUTTON_LEFT
84#define CHC_SETTINGS_OK BUTTON_SELECT
85#define CHC_SETTINGS_CANCEL BUTTON_PLAY
86
77#endif 87#endif
78 88
79 89
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index cebc36a016..e71d8b6e4e 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -92,6 +92,18 @@
92#define CUBE_PAUSE (BUTTON_PLAY | BUTTON_REL) 92#define CUBE_PAUSE (BUTTON_PLAY | BUTTON_REL)
93#define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_PLAY) 93#define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_PLAY)
94 94
95#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
96#define CUBE_QUIT BUTTON_PLAY
97#define CUBE_X_INC BUTTON_RIGHT
98#define CUBE_X_DEC BUTTON_LEFT
99#define CUBE_Y_INC BUTTON_UP
100#define CUBE_Y_DEC BUTTON_DOWN
101#define CUBE_Z_INC BUTTON_MODE
102#define CUBE_Z_DEC BUTTON_EQ
103#define CUBE_MODE (BUTTON_SELECT | BUTTON_REPEAT)
104#define CUBE_PAUSE (BUTTON_SELECT | BUTTON_REL)
105#define CUBE_HIGHSPEED (BUTTON_MODE | BUTTON_EQ) /* TODO: this is impossible */
106
95#endif 107#endif
96 108
97#ifdef HAVE_LCD_BITMAP 109#ifdef HAVE_LCD_BITMAP
diff --git a/apps/plugins/databox/databox.c b/apps/plugins/databox/databox.c
index d9b513c378..ebed139020 100644
--- a/apps/plugins/databox/databox.c
+++ b/apps/plugins/databox/databox.c
@@ -35,6 +35,9 @@
35#elif CONFIG_KEYPAD == PLAYER_PAD 35#elif CONFIG_KEYPAD == PLAYER_PAD
36#define DBX_SELECT BUTTON_PLAY 36#define DBX_SELECT BUTTON_PLAY
37#define DBX_STOP BUTTON_STOP 37#define DBX_STOP BUTTON_STOP
38#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
39#define DBX_SELECT BUTTON_SELECT
40#define DBX_STOP BUTTON_PLAY
38#endif 41#endif
39 42
40#define MAX_TOKENS 70 43#define MAX_TOKENS 70
diff --git a/apps/plugins/dict.c b/apps/plugins/dict.c
index aea7c44a6c..c432b564f4 100644
--- a/apps/plugins/dict.c
+++ b/apps/plugins/dict.c
@@ -104,6 +104,8 @@ long reverse (long N) {
104#define LP_QUIT BUTTON_STOP 104#define LP_QUIT BUTTON_STOP
105#elif (CONFIG_KEYPAD == IPOD_4G_PAD) 105#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
106#define LP_QUIT BUTTON_MENU 106#define LP_QUIT BUTTON_MENU
107#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
108#define LP_QUIT BUTTON_PLAY
107#else 109#else
108#define LP_QUIT BUTTON_OFF 110#define LP_QUIT BUTTON_OFF
109#endif 111#endif
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 739e8141a6..af5a3743c7 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -81,6 +81,12 @@
81#define BEJEWELED_SELECT_PRE BUTTON_SELECT 81#define BEJEWELED_SELECT_PRE BUTTON_SELECT
82#define BEJEWELED_RESUME (BUTTON_SELECT|BUTTON_PLAY) 82#define BEJEWELED_RESUME (BUTTON_SELECT|BUTTON_PLAY)
83 83
84#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
85#define BEJEWELED_QUIT BUTTON_PLAY
86#define BEJEWELED_START BUTTON_MODE
87#define BEJEWELED_SELECT BUTTON_SELECT
88#define BEJEWELED_RESUME BUTTON_EQ
89
84#else 90#else
85 #error BEJEWELED: Unsupported keypad 91 #error BEJEWELED: Unsupported keypad
86#endif 92#endif
diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c
index ba5451410b..9472de9110 100644
--- a/apps/plugins/logo.c
+++ b/apps/plugins/logo.c
@@ -187,6 +187,12 @@ const unsigned char rockbox16x7[] = {
187#define LP_INC_X BUTTON_RIGHT 187#define LP_INC_X BUTTON_RIGHT
188#define LP_DEC_Y BUTTON_SCROLL_BACK 188#define LP_DEC_Y BUTTON_SCROLL_BACK
189#define LP_INC_Y BUTTON_SCROLL_FWD 189#define LP_INC_Y BUTTON_SCROLL_FWD
190#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
191#define LP_QUIT BUTTON_PLAY
192#define LP_DEC_X BUTTON_LEFT
193#define LP_INC_X BUTTON_RIGHT
194#define LP_DEC_Y BUTTON_DOWN
195#define LP_INC_Y BUTTON_UP
190#else 196#else
191#define LP_QUIT BUTTON_OFF 197#define LP_QUIT BUTTON_OFF
192#define LP_DEC_X BUTTON_LEFT 198#define LP_DEC_X BUTTON_LEFT
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index c1e156075b..f8c5445542 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -64,6 +64,15 @@
64#define METRONOME_TAP BUTTON_SELECT 64#define METRONOME_TAP BUTTON_SELECT
65#define METRONOME_MSG_START "press play" 65#define METRONOME_MSG_START "press play"
66#define METRONOME_MSG_STOP "press pause" 66#define METRONOME_MSG_STOP "press pause"
67
68#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
69#define METRONOME_QUIT BUTTON_MODE
70#define METRONOME_PLAYPAUSE BUTTON_PLAY
71#define METRONOME_VOL_UP BUTTON_UP
72#define METRONOME_VOL_DOWN BUTTON_DOWN
73#define METRONOME_TAP BUTTON_EQ
74#define METRONOME_MSG_START "press play"
75#define METRONOME_MSG_STOP "press pause"
67#endif 76#endif
68 77
69#if CONFIG_REMOTE_KEYPAD == H100_REMOTE 78#if CONFIG_REMOTE_KEYPAD == H100_REMOTE
diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c
index 0773236140..7a18bc2d42 100644
--- a/apps/plugins/mosaique.c
+++ b/apps/plugins/mosaique.c
@@ -55,6 +55,12 @@
55#define MOSAIQUE_QUIT BUTTON_MENU 55#define MOSAIQUE_QUIT BUTTON_MENU
56#define MOSAIQUE_SPEED BUTTON_SELECT 56#define MOSAIQUE_SPEED BUTTON_SELECT
57#define MOSAIQUE_RESTART BUTTON_PLAY 57#define MOSAIQUE_RESTART BUTTON_PLAY
58
59#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
60#define MOSAIQUE_QUIT BUTTON_PLAY
61#define MOSAIQUE_SPEED BUTTON_MODE
62#define MOSAIQUE_RESTART BUTTON_SELECT
63
58#endif 64#endif
59 65
60enum plugin_status plugin_start(struct plugin_api* api, void* parameter) 66enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 84617b9b4e..c8ac88fb62 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -4,7 +4,7 @@
4 4
5#ifdef CPU_COLDFIRE 5#ifdef CPU_COLDFIRE
6OUTPUT_FORMAT(elf32-m68k) 6OUTPUT_FORMAT(elf32-m68k)
7#elif CONFIG_CPU==PP5020 7#elif defined(CPU_ARM)
8OUTPUT_FORMAT(elf32-littlearm) 8OUTPUT_FORMAT(elf32-littlearm)
9#else 9#else
10OUTPUT_FORMAT(elf32-sh) 10OUTPUT_FORMAT(elf32-sh)
@@ -32,6 +32,10 @@ OUTPUT_FORMAT(elf32-sh)
32#define DRAMORIG 0x10000000 32#define DRAMORIG 0x10000000
33#define IRAMORIG 0x4000c000 33#define IRAMORIG 0x4000c000
34#define IRAMSIZE 0xc000 34#define IRAMSIZE 0xc000
35#elif CONFIG_CPU == PNX0101
36#define DRAMORIG 0x24000000
37#define IRAMORIG 0x408000
38#define IRAMSIZE 0x8000
35#else 39#else
36#define DRAMORIG 0x09000000 + STUBOFFSET 40#define DRAMORIG 0x09000000 + STUBOFFSET
37#endif 41#endif
@@ -53,7 +57,7 @@ OUTPUT_FORMAT(elf32-sh)
53MEMORY 57MEMORY
54{ 58{
55 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH 59 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
56#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) 60#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
57 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE 61 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
58#endif 62#endif
59} 63}
@@ -64,7 +68,7 @@ SECTIONS
64 { 68 {
65 KEEP(*(.entry)) 69 KEEP(*(.entry))
66 *(.text*) 70 *(.text*)
67#if CONFIG_CPU==PP5020 71#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
68 *(.glue_7) 72 *(.glue_7)
69 *(.glue_7t) 73 *(.glue_7t)
70#endif 74#endif
@@ -79,7 +83,7 @@ SECTIONS
79 .data : 83 .data :
80 { 84 {
81 *(.data*) 85 *(.data*)
82#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) 86#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
83 iramcopy = .; 87 iramcopy = .;
84#endif 88#endif
85 } > PLUGIN_RAM 89 } > PLUGIN_RAM
@@ -89,7 +93,7 @@ SECTIONS
89 *(.eh_frame) 93 *(.eh_frame)
90 } 94 }
91 95
92#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) 96#if defined(ARCH_IRIVER) || defined(ARCH_IPOD) || (CONFIG_CPU==PNX0101)
93 .iram IRAMORIG : AT ( iramcopy) 97 .iram IRAMORIG : AT ( iramcopy)
94 { 98 {
95 iramstart = .; 99 iramstart = .;
diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c
index b8bb65e6fc..53fe19b199 100644
--- a/apps/plugins/rockboy/sys_rockbox.c
+++ b/apps/plugins/rockboy/sys_rockbox.c
@@ -75,6 +75,13 @@ void joy_close(void)
75#define ROCKBOY_PAD_SELECT BUTTON_PLAY 75#define ROCKBOY_PAD_SELECT BUTTON_PLAY
76#define ROCKBOY_MENU BUTTON_OFF 76#define ROCKBOY_MENU BUTTON_OFF
77 77
78#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
79#define ROCKBOY_PAD_A BUTTON_PLAY
80#define ROCKBOY_PAD_B BUTTON_EQ
81#define ROCKBOY_PAD_START BUTTON_MODE
82#define ROCKBOY_PAD_SELECT (BUTTON_SELECT | BUTTON_REL)
83#define ROCKBOY_MENU (BUTTON_SELECT | BUTTON_REPEAT)
84
78#endif 85#endif
79 86
80unsigned int oldbuttonstate = 0, newbuttonstate,holdbutton; 87unsigned int oldbuttonstate = 0, newbuttonstate,holdbutton;
diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c
index ec4a240894..7fd0c8a3d6 100644
--- a/apps/plugins/snow.c
+++ b/apps/plugins/snow.c
@@ -36,6 +36,8 @@
36#define SNOW_QUIT BUTTON_STOP 36#define SNOW_QUIT BUTTON_STOP
37#elif (CONFIG_KEYPAD == IPOD_4G_PAD) 37#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
38#define SNOW_QUIT BUTTON_MENU 38#define SNOW_QUIT BUTTON_MENU
39#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
40#define SNOW_QUIT BUTTON_PLAY
39#else 41#else
40#define SNOW_QUIT BUTTON_OFF 42#define SNOW_QUIT BUTTON_OFF
41#endif 43#endif
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c
index 0dfac24c6d..e1b8b6fc21 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -30,6 +30,8 @@ static int fontwidth, fontheight;
30#define STATS_STOP BUTTON_STOP 30#define STATS_STOP BUTTON_STOP
31#elif (CONFIG_KEYPAD == IPOD_4G_PAD) 31#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
32#define STATS_STOP BUTTON_MENU 32#define STATS_STOP BUTTON_MENU
33#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
34#define STATS_STOP BUTTON_PLAY
33#else 35#else
34#define STATS_STOP BUTTON_OFF 36#define STATS_STOP BUTTON_OFF
35#endif 37#endif
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index 9df064d36f..4a1382ef65 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -68,6 +68,13 @@
68#define STOPWATCH_LAP_TIMER BUTTON_RIGHT 68#define STOPWATCH_LAP_TIMER BUTTON_RIGHT
69#define STOPWATCH_SCROLL_UP BUTTON_SCROLL_FWD 69#define STOPWATCH_SCROLL_UP BUTTON_SCROLL_FWD
70#define STOPWATCH_SCROLL_DOWN BUTTON_SCROLL_BACK 70#define STOPWATCH_SCROLL_DOWN BUTTON_SCROLL_BACK
71#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
72#define STOPWATCH_QUIT BUTTON_PLAY
73#define STOPWATCH_START_STOP BUTTON_MODE
74#define STOPWATCH_RESET_TIMER BUTTON_EQ
75#define STOPWATCH_LAP_TIMER BUTTON_SELECT
76#define STOPWATCH_SCROLL_UP BUTTON_UP
77#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
71#endif 78#endif
72 79
73static struct plugin_api* rb; 80static struct plugin_api* rb;
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 60438c9dc9..823072e145 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -131,6 +131,17 @@
131#define VIEWER_MODE_PAGE (BUTTON_SELECT | BUTTON_LEFT | BUTTON_MENU) 131#define VIEWER_MODE_PAGE (BUTTON_SELECT | BUTTON_LEFT | BUTTON_MENU)
132#define VIEWER_MODE_SCROLLBAR (BUTTON_SELECT | BUTTON_LEFT | BUTTON_RIGHT) 132#define VIEWER_MODE_SCROLLBAR (BUTTON_SELECT | BUTTON_LEFT | BUTTON_RIGHT)
133 133
134/* iFP7xx keys */
135#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
136#define VIEWER_QUIT BUTTON_PLAY
137#define VIEWER_PAGE_UP BUTTON_UP
138#define VIEWER_PAGE_DOWN BUTTON_DOWN
139#define VIEWER_SCREEN_LEFT BUTTON_LEFT
140#define VIEWER_SCREEN_RIGHT BUTTON_RIGHT
141#define VIEWER_MODE_WRAP (BUTTON_EQ | BUTTON_REL)
142#define VIEWER_MODE_LINE (BUTTON_EQ | BUTTON_REPEAT)
143#define VIEWER_MODE_WIDTH BUTTON_MODE
144
134#endif 145#endif
135 146
136enum { 147enum {
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index 5f56274026..3cff78bbc5 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -114,6 +114,20 @@
114#define KBD_UP BUTTON_SCROLL_BACK 114#define KBD_UP BUTTON_SCROLL_BACK
115#define KBD_DOWN BUTTON_SCROLL_FWD 115#define KBD_DOWN BUTTON_SCROLL_FWD
116 116
117#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
118
119/* TODO: Check keyboard mappings */
120
121#define KBD_MODES /* iFP7xx uses 2 modes, picker and line edit */
122#define KBD_SELECT (BUTTON_SELECT | BUTTON_REL) /* backspace in line edit */
123#define KBD_SELECT_PRE BUTTON_SELECT
124#define KBD_DONE BUTTON_MODE
125#define KBD_ABORT BUTTON_PLAY
126#define KBD_LEFT BUTTON_LEFT
127#define KBD_RIGHT BUTTON_RIGHT
128#define KBD_UP BUTTON_UP
129#define KBD_DOWN BUTTON_DOWN
130
117#endif 131#endif
118 132
119#if KEYBOARD_PAGES == 1 133#if KEYBOARD_PAGES == 1
diff --git a/apps/settings.h b/apps/settings.h
index 263147c92c..2490635620 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -101,6 +101,12 @@
101#define SETTINGS_NEXT BUTTON_RIGHT 101#define SETTINGS_NEXT BUTTON_RIGHT
102#define SETTINGS_ACCEPT BUTTON_PLAY 102#define SETTINGS_ACCEPT BUTTON_PLAY
103 103
104#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
105#define SETTINGS_INC BUTTON_RIGHT
106#define SETTINGS_DEC BUTTON_LEFT
107#define SETTINGS_OK BUTTON_SELECT
108#define SETTINGS_CANCEL BUTTON_PLAY
109
104#endif 110#endif
105 111
106/* data structures */ 112/* data structures */
diff --git a/apps/tree.h b/apps/tree.h
index 05800ae68a..ad4a4a91aa 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -150,6 +150,20 @@
150#define TREE_WPS_PRE BUTTON_MENU 150#define TREE_WPS_PRE BUTTON_MENU
151#define TREE_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT) 151#define TREE_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
152 152
153#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
154
155#define TREE_NEXT BUTTON_DOWN
156#define TREE_PREV BUTTON_UP
157#define TREE_EXIT BUTTON_LEFT
158#define TREE_ABORT BUTTON_PLAY
159#define TREE_RUN (BUTTON_RIGHT | BUTTON_REL)
160#define TREE_RUN_PRE BUTTON_RIGHT
161#define TREE_MENU (BUTTON_SELECT | BUTTON_REPEAT)
162#define TREE_MENU_PRE BUTTON_SELECT
163#define TREE_WPS (BUTTON_SELECT | BUTTON_REL)
164#define TREE_WPS_PRE BUTTON_SELECT
165#define TREE_CONTEXT (BUTTON_RIGHT | BUTTON_REPEAT)
166#define TREE_POWER_BTN (BUTTON_PLAY | BUTTON_REPEAT)
153#endif 167#endif
154 168
155struct entry { 169struct entry {
diff --git a/docs/CREDITS b/docs/CREDITS
index 2e15a6b986..f388d1452b 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -157,3 +157,4 @@ Nick Lanham
157Sebastian Henriksen 157Sebastian Henriksen
158Martin Scarratt 158Martin Scarratt
159Karl Kurbjun 159Karl Kurbjun
160Tomasz Malesinski
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 7f07598273..4fe5fc91f5 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -74,8 +74,12 @@ drivers/adc.c
74#ifdef HAVE_MMC 74#ifdef HAVE_MMC
75drivers/ata_mmc.c 75drivers/ata_mmc.c
76#else 76#else
77#ifdef HAVE_FLASH_DISK
78drivers/ata_flash.c
79#else
77drivers/ata.c 80drivers/ata.c
78#endif 81#endif
82#endif
79drivers/button.c 83drivers/button.c
80drivers/dac.c 84drivers/dac.c
81drivers/fat.c 85drivers/fat.c
@@ -93,6 +97,8 @@ tuner_philips.c
93drivers/i2c-coldfire.c 97drivers/i2c-coldfire.c
94#elif CONFIG_I2C == I2C_PP5020 98#elif CONFIG_I2C == I2C_PP5020
95drivers/i2c-pp5020.c 99drivers/i2c-pp5020.c
100#elif CONFIG_I2C == I2C_PNX0101
101drivers/i2c-pnx0101.c
96#else 102#else
97drivers/i2c.c 103drivers/i2c.c
98#endif 104#endif
diff --git a/firmware/app.lds b/firmware/app.lds
index e17e5a97b9..feff264d39 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -7,7 +7,7 @@ INPUT(crt0.o)
7#elif CONFIG_CPU == TCC730 7#elif CONFIG_CPU == TCC730
8OUTPUT_FORMAT(elf32-calmrisc16) 8OUTPUT_FORMAT(elf32-calmrisc16)
9INPUT(crt0.o) 9INPUT(crt0.o)
10#elif CONFIG_CPU == PP5020 10#elif defined(CPU_ARM)
11OUTPUT_FORMAT(elf32-littlearm) 11OUTPUT_FORMAT(elf32-littlearm)
12OUTPUT_ARCH(arm) 12OUTPUT_ARCH(arm)
13INPUT(crt0.o) 13INPUT(crt0.o)
@@ -126,6 +126,10 @@ _pluginbuf = 0;
126#define DRAMORIG 0x00000000 + STUBOFFSET 126#define DRAMORIG 0x00000000 + STUBOFFSET
127#define IRAMORIG 0x40000000 127#define IRAMORIG 0x40000000
128#define IRAMSIZE 0xc000 128#define IRAMSIZE 0xc000
129#elif CONFIG_CPU==PNX0101
130#define DRAMORIG 0x24000000 + STUBOFFSET
131#define IRAMORIG 0x400100
132#define IRAMSIZE 0x7f00
129#else 133#else
130#define DRAMORIG 0x09000000 + STUBOFFSET 134#define DRAMORIG 0x09000000 + STUBOFFSET
131#define IRAMORIG 0x0f000000 135#define IRAMORIG 0x0f000000
@@ -161,7 +165,7 @@ SECTIONS
161 . = ALIGN(0x200); 165 . = ALIGN(0x200);
162 *(.init.text) 166 *(.init.text)
163 *(.text*) 167 *(.text*)
164#if CONFIG_CPU==PP5020 168#ifdef CPU_ARM
165 *(.glue_7) 169 *(.glue_7)
166 *(.glue_7t) 170 *(.glue_7t)
167#endif 171#endif
@@ -214,7 +218,7 @@ SECTIONS
214 _iend = .; 218 _iend = .;
215 } > IRAM 219 } > IRAM
216 220
217#if defined(CPU_COLDFIRE) || CONFIG_CPU==PP5020 221#if defined(CPU_COLDFIRE) || defined(CPU_ARM)
218 .stack : 222 .stack :
219 { 223 {
220 *(.stack) 224 *(.stack)
@@ -234,7 +238,7 @@ SECTIONS
234 } > DRAM 238 } > DRAM
235#endif 239#endif
236 240
237#if defined(CPU_COLDFIRE) || CONFIG_CPU==PP5020 241#if defined(CPU_COLDFIRE) || defined(CPU_ARM)
238 .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram): 242 .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
239#else 243#else
240 .bss : 244 .bss :
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 740acd1d82..b475c61fc0 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -242,6 +242,8 @@ static void __backlight_on(void)
242 242
243 /* set port L07 on */ 243 /* set port L07 on */
244 outl(((0x100 | 1) << 7), 0x6000d12c); 244 outl(((0x100 | 1) << 7), 0x6000d12c);
245#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
246 GPIO3_SET = 1;
245#endif 247#endif
246} 248}
247 249
@@ -279,6 +281,8 @@ static void __backlight_off(void)
279 281
280 /* set port L07 off */ 282 /* set port L07 off */
281 outl(((0x100 | 0) << 7), 0x6000d12c); 283 outl(((0x100 | 0) << 7), 0x6000d12c);
284#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
285 GPIO3_CLR = 1;
282#endif 286#endif
283} 287}
284 288
diff --git a/firmware/crt0.S b/firmware/crt0.S
index 0e75195530..1e07e0c029 100644
--- a/firmware/crt0.S
+++ b/firmware/crt0.S
@@ -37,6 +37,8 @@ start:
37 * 37 *
38 */ 38 */
39 39
40 msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */
41
40#ifndef BOOTLOADER 42#ifndef BOOTLOADER
41#if CONFIG_CPU == PP5002 || CONFIG_CPU == PP5020 43#if CONFIG_CPU == PP5002 || CONFIG_CPU == PP5020
42 b pad_skip 44 b pad_skip
@@ -247,8 +249,8 @@ boot_table:
247 /* Set up stack for IRQ mode */ 249 /* Set up stack for IRQ mode */
248 msr cpsr_c, #0xd2 250 msr cpsr_c, #0xd2
249 ldr sp, =irq_stack 251 ldr sp, =irq_stack
250 /* Switch to supervisor mode, enable IRQ and FIQ processing */ 252 /* Switch to supervisor mode */
251 msr cpsr_c, #0x13 253 msr cpsr_c, #0xd3
252 ldr sp, =stackend 254 ldr sp, =stackend
253 bl main 255 bl main
254 /* main() should never return */ 256 /* main() should never return */
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c
index c9ae2daca8..ad10017d85 100644
--- a/firmware/drivers/adc.c
+++ b/firmware/drivers/adc.c
@@ -294,4 +294,38 @@ void adc_init(void)
294 294
295} 295}
296 296
297#elif CONFIG_CPU == PNX0101
298
299static unsigned short adcdata[NUM_ADC_CHANNELS];
300
301unsigned short adc_read(int channel)
302{
303 return adcdata[channel];
304}
305
306static void adc_tick(void)
307{
308 if (ADCST & 0x10) {
309 adcdata[0] = ADCCH0 & 0x3ff;
310 adcdata[1] = ADCCH1 & 0x3ff;
311 adcdata[2] = ADCCH2 & 0x3ff;
312 adcdata[3] = ADCCH3 & 0x3ff;
313 adcdata[4] = ADCCH4 & 0x3ff;
314 ADCST = 0xa;
315 }
316}
317
318void adc_init(void)
319{
320 ADCR24 = 0xaaaaa;
321 ADCR28 = 0;
322 ADCST = 2;
323 ADCST = 0xa;
324
325 while (!(ADCST & 0x10));
326 adc_tick();
327
328 tick_add_task(adc_tick);
329}
330
297#endif 331#endif
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 544cfec32e..0c17fce4c6 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -61,7 +61,7 @@ static bool flipped; /* buttons can be flipped to match the LCD flip */
61#define REPEAT_INTERVAL_FINISH 5 61#define REPEAT_INTERVAL_FINISH 5
62 62
63/* the power-off button and number of repeated keys before shutting off */ 63/* the power-off button and number of repeated keys before shutting off */
64#if CONFIG_KEYPAD == IPOD_4G_PAD 64#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
65#define POWEROFF_BUTTON BUTTON_PLAY 65#define POWEROFF_BUTTON BUTTON_PLAY
66#define POWEROFF_COUNT 40 66#define POWEROFF_COUNT 40
67#else 67#else
@@ -731,6 +731,47 @@ static int button_read(void)
731 if (!remote_hold_button && ((data & 0x40) == 0)) 731 if (!remote_hold_button && ((data & 0x40) == 0))
732 btn |= BUTTON_RC_ON; 732 btn |= BUTTON_RC_ON;
733 733
734#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
735
736 static bool hold_button = false;
737
738 /* light handling */
739 if (hold_button && !button_hold())
740 {
741 backlight_on();
742 }
743 hold_button = button_hold();
744
745 /* normal buttons */
746 if (!button_hold())
747 {
748 data = adc_read(ADC_BUTTONS);
749
750 if (data < 0x151)
751 if (data < 0xc7)
752 if (data < 0x41)
753 btn = BUTTON_LEFT;
754 else
755 btn = BUTTON_RIGHT;
756 else
757 btn = BUTTON_SELECT;
758 else
759 if (data < 0x268)
760 if (data < 0x1d7)
761 btn = BUTTON_UP;
762 else
763 btn = BUTTON_DOWN;
764 else
765 if (data < 0x2f9)
766 btn = BUTTON_EQ;
767 else
768 if (data < 0x35c)
769 btn = BUTTON_MODE;
770 }
771
772 if (!button_hold() && (adc_read(ADC_BUTTON_PLAY) < 0x64))
773 btn |= BUTTON_PLAY;
774
734#elif CONFIG_KEYPAD == RECORDER_PAD 775#elif CONFIG_KEYPAD == RECORDER_PAD
735 776
736#ifdef HAVE_FMADC 777#ifdef HAVE_FMADC
@@ -877,6 +918,13 @@ bool remote_button_hold(void)
877} 918}
878#endif 919#endif
879 920
921#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
922bool button_hold(void)
923{
924 return (GPIO5_READ & 4) ? false : true;
925}
926#endif
927
880int button_status(void) 928int button_status(void)
881{ 929{
882 return lastbtn; 930 return lastbtn;
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index 081a7a5267..523e8a1c09 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -135,6 +135,24 @@ void lcd_write_data( const unsigned char* data, int count ) {
135 P2 |= 0x20; 135 P2 |= 0x20;
136 } 136 }
137} 137}
138
139#elif CONFIG_CPU == PNX0101
140
141void lcd_write_command(int cmd)
142{
143 while ((LCDSTAT & 3) != 3);
144 LCDCMD = cmd;
145}
146
147void lcd_write_data( const unsigned char* data, int count )
148{
149 int i;
150 for (i=0; i < count; i++) {
151 while ((LCDSTAT & 3) != 3);
152 LCDDATA = data[i];
153 }
154}
155
138#endif 156#endif
139 157
140/*** hardware configuration ***/ 158/*** hardware configuration ***/
@@ -145,6 +163,8 @@ int lcd_default_contrast(void)
145 return 30; 163 return 30;
146#elif CONFIG_LCD == LCD_GMINI100 164#elif CONFIG_LCD == LCD_GMINI100
147 return 31; 165 return 31;
166#elif CONFIG_LCD == LCD_IFP7XX
167 return 45;
148#else 168#else
149 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; 169 return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49;
150#endif 170#endif
@@ -197,7 +217,11 @@ void lcd_set_flip(bool yesno)
197 { 217 {
198 lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01); 218 lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01);
199 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); 219 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
220#if CONFIG_LCD == LCD_IFP7XX
221 xoffset = 4;
222#else
200 xoffset = 0; 223 xoffset = 0;
224#endif
201 } 225 }
202#endif 226#endif
203} 227}
@@ -236,6 +260,9 @@ void lcd_init(void)
236 P2CONL |= 0x5a; 260 P2CONL |= 0x5a;
237 P2CONL &= 0x5b; 261 P2CONL &= 0x5b;
238 P2CONH |= 1; 262 P2CONH |= 1;
263#elif CONFIG_CPU == PNX0101
264 LCDREG10 = 0xf;
265 LCDREG04 = 0x4084;
239#else 266#else
240 /* Initialize PB0-3 as output pins */ 267 /* Initialize PB0-3 as output pins */
241 PBCR2 &= 0xff00; /* MD = 00 */ 268 PBCR2 &= 0xff00; /* MD = 00 */
@@ -245,7 +272,11 @@ void lcd_init(void)
245 /* inits like the original firmware */ 272 /* inits like the original firmware */
246 lcd_write_command(LCD_SOFTWARE_RESET); 273 lcd_write_command(LCD_SOFTWARE_RESET);
247 lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); 274 lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4);
275#if CONFIG_LCD == LCD_IFP7XX
276 lcd_write_command(LCD_SET_LCD_BIAS);
277#else
248 lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ 278 lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */
279#endif
249 lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7); 280 lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7);
250 /* power control register: op-amp=1, regulator=1, booster=1 */ 281 /* power control register: op-amp=1, regulator=1, booster=1 */
251 lcd_write_command(LCD_SET_DISPLAY_ON); 282 lcd_write_command(LCD_SET_DISPLAY_ON);
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index 141d985ee6..da97233e57 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -182,6 +182,8 @@ void ide_power_enable(bool on)
182 P1 |= 0x08; 182 P1 |= 0x08;
183 else 183 else
184 P1 &= ~0x08; 184 P1 &= ~0x08;
185#elif CONFIG_CPU == PNX0101
186 /* no ide controller */
185#else /* SH1 based archos */ 187#else /* SH1 based archos */
186 bool touched = false; 188 bool touched = false;
187#ifdef NEEDS_ATA_POWER_ON 189#ifdef NEEDS_ATA_POWER_ON
@@ -266,6 +268,9 @@ void power_off(void)
266 /* We don't turn off the ipod, we put it in a deep sleep */ 268 /* We don't turn off the ipod, we put it in a deep sleep */
267 pcf50605_standby_mode(); 269 pcf50605_standby_mode();
268#endif 270#endif
271#elif CONFIG_CPU == PNX0101
272 GPIO1_CLR = 1 << 16;
273 GPIO2_SET = 1;
269#elif defined(GMINI_ARCH) 274#elif defined(GMINI_ARCH)
270 P1 &= ~1; 275 P1 &= ~1;
271 P1CON &= ~1; 276 P1CON &= ~1;
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c
index 4c5c5a8172..27061c299b 100644
--- a/firmware/drivers/serial.c
+++ b/firmware/drivers/serial.c
@@ -27,8 +27,9 @@
27#include "lcd.h" 27#include "lcd.h"
28#include "serial.h" 28#include "serial.h"
29 29
30#if (CONFIG_CPU != MCF5249) && (CONFIG_CPU != TCC730) && (CONFIG_CPU != PP5020) 30#if (CONFIG_CPU != MCF5249) && (CONFIG_CPU != TCC730) && (CONFIG_CPU != PP5020) && (CONFIG_CPU != PNX0101)
31/* FIX: this doesn't work on iRiver or Gmini or iPod yet */ 31/* FIX: this doesn't work on iRiver or Gmini or iPod yet */
32/* iFP7xx has no remote */
32 33
33#ifndef HAVE_MMC /* MMC takes serial port 1, so don't mess with it */ 34#ifndef HAVE_MMC /* MMC takes serial port 1, so don't mess with it */
34 35
diff --git a/firmware/export/adc.h b/firmware/export/adc.h
index 3ae9dae215..8364cdb012 100644
--- a/firmware/export/adc.h
+++ b/firmware/export/adc.h
@@ -29,6 +29,15 @@
29#define ADC_BATTERY 2 29#define ADC_BATTERY 2
30#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ 30#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
31 31
32#elif defined(IRIVER_IFP7XX)
33
34#define NUM_ADC_CHANNELS 5
35
36#define ADC_BUTTONS 0
37#define ADC_BATTERY 1
38#define ADC_BUTTON_PLAY 2
39#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
40
32#else 41#else
33 42
34#define NUM_ADC_CHANNELS 8 43#define NUM_ADC_CHANNELS 8
diff --git a/firmware/export/button.h b/firmware/export/button.h
index 47912ef1df..7f50b1013c 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -45,6 +45,10 @@ bool button_hold(void);
45bool remote_button_hold(void); 45bool remote_button_hold(void);
46#endif 46#endif
47 47
48#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
49bool button_hold(void);
50#endif
51
48#define BUTTON_NONE 0x0000 52#define BUTTON_NONE 0x0000
49 53
50/* Shared button codes */ 54/* Shared button codes */
@@ -159,6 +163,15 @@ bool remote_button_hold(void);
159#define BUTTON_SCROLL_FWD 0x0010 163#define BUTTON_SCROLL_FWD 0x0010
160#define BUTTON_SCROLL_BACK 0x0020 164#define BUTTON_SCROLL_BACK 0x0020
161 165
166#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
167
168#define BUTTON_PLAY 0x0001
169#define BUTTON_EQ 0x0002
170#define BUTTON_MODE 0x0004
171#define BUTTON_UP 0x0010
172#define BUTTON_DOWN 0x0020
173#define BUTTON_SELECT 0x0100
174
162#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */ 175#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */
163 176
164#endif /* _BUTTON_H_ */ 177#endif /* _BUTTON_H_ */
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h
new file mode 100644
index 0000000000..086b455235
--- /dev/null
+++ b/firmware/export/config-ifp7xx.h
@@ -0,0 +1,96 @@
1/*
2 * This config file is for iriver iFP-799
3 */
4#define IRIVER_IFP7XX_SERIES 1
5
6/* For Rolo and boot loader */
7#define MODEL_NUMBER 6
8
9/* define this if you have recording possibility */
10/*#define HAVE_RECORDING 1*/
11
12/* define this if you have a bitmap LCD display */
13#define HAVE_LCD_BITMAP 1
14
15/* define this if you have a colour LCD */
16/* #define HAVE_LCD_COLOR 1 */
17
18/* LCD dimensions */
19#define LCD_WIDTH 128
20#define LCD_HEIGHT 64
21#define LCD_DEPTH 1
22
23#define CONFIG_KEYPAD IRIVER_IFP7XX_PAD
24
25#define CONFIG_FLASH FLASH_IFP7XX
26
27#define HAVE_FAT16SUPPORT
28
29/* Define this if you do software codec */
30#define CONFIG_CODEC SWCODEC
31
32/* Define this if you have a software controlled poweroff */
33#define HAVE_SW_POWEROFF
34
35/* The number of bytes reserved for loadable codecs */
36#define CODEC_SIZE 0x30000
37
38/* The number of bytes reserved for loadable plugins */
39#define PLUGIN_BUFFER_SIZE 0x20000
40
41/* Define this if you have the WM8975 audio codec */
42/* #define HAVE_WM8975 */
43
44#define HAVE_FLASH_DISK
45
46#ifndef SIMULATOR
47
48/* Define this if you have a Philips PNX0101 */
49#define CONFIG_CPU PNX0101
50
51/* Define this if you want to use the PNX0101 i2c interface */
52#define CONFIG_I2C I2C_PNX0101
53
54/* Type of mobile power */
55//#define CONFIG_BATTERY BATT_LIPOL1300
56
57#define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */
58
59/* Define this if the platform can charge batteries */
60//#define HAVE_CHARGING 1
61
62/* define this if the hardware can be powered off while charging */
63//#define HAVE_POWEROFF_WHILE_CHARGING
64
65/* The start address index for ROM builds */
66#define ROM_START 0x00000000
67
68/* Define this for LCD backlight available */
69#define CONFIG_BACKLIGHT BL_IRIVER_IFP7XX /* port controlled */
70
71/* Define this to the CPU frequency */
72#define CPU_FREQ 30000000
73
74#define CONFIG_LCD LCD_IFP7XX
75
76/* Offset ( in the firmware file's header ) to the file length */
77#define FIRMWARE_OFFSET_FILE_LENGTH 0
78
79/* Offset ( in the firmware file's header ) to the file CRC */
80#define FIRMWARE_OFFSET_FILE_CRC 0
81
82/* Offset ( in the firmware file's header ) to the real data */
83#define FIRMWARE_OFFSET_FILE_DATA 8
84
85#define USB_ISP1582
86
87/* Virtual LED (icon) */
88#define CONFIG_LED LED_VIRTUAL
89
90/* Define this if you have adjustable CPU frequency */
91//#define HAVE_ADJUSTABLE_CPU_FREQ
92
93#define BOOTFILE_EXT "iriver"
94#define BOOTFILE "rockbox." BOOTFILE_EXT
95
96#endif
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 3f563ca9df..5e3bbeb645 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -41,6 +41,7 @@
41#define TCC730 730 /* lacking a proper abbrivation */ 41#define TCC730 730 /* lacking a proper abbrivation */
42#define PP5002 5002 42#define PP5002 5002
43#define PP5020 5020 43#define PP5020 5020
44#define PNX0101 101
44 45
45/* CONFIG_KEYPAD */ 46/* CONFIG_KEYPAD */
46#define PLAYER_PAD 0 47#define PLAYER_PAD 0
@@ -51,6 +52,7 @@
51#define IRIVER_H300_PAD 5 52#define IRIVER_H300_PAD 5
52#define IAUDIO_X5_PAD 6 53#define IAUDIO_X5_PAD 6
53#define IPOD_4G_PAD 7 54#define IPOD_4G_PAD 7
55#define IRIVER_IFP7XX_PAD 8
54 56
55/* CONFIG_REMOTE_KEYPAD */ 57/* CONFIG_REMOTE_KEYPAD */
56#define H100_REMOTE 1 58#define H100_REMOTE 1
@@ -75,6 +77,7 @@
75#define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */ 77#define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
76#define LCD_IPODNANO 7 /* as used by iPod Nano */ 78#define LCD_IPODNANO 7 /* as used by iPod Nano */
77#define LCD_IPODVIDEO 8 /* as used by iPod Video */ 79#define LCD_IPODVIDEO 8 /* as used by iPod Video */
80#define LCD_IFP7XX 9 /* as used by iRiver iFP 7xx/8xx */
78 81
79/* LCD_PIXELFORMAT */ 82/* LCD_PIXELFORMAT */
80#define RGB565 565 83#define RGB565 565
@@ -89,6 +92,7 @@
89#define BL_IPOD4G 5 /* Apple iPod 4G */ 92#define BL_IPOD4G 5 /* Apple iPod 4G */
90#define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/ 93#define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/
91#define BL_IRIVER_H300 7 /* IRiver PWM */ 94#define BL_IRIVER_H300 7 /* IRiver PWM */
95#define BL_IRIVER_IFP7XX 8 /* IRiver GPIO */
92 96
93/* CONFIG_I2C */ 97/* CONFIG_I2C */
94#define I2C_PLAYREC 0 /* Archos Player/Recorder style */ 98#define I2C_PLAYREC 0 /* Archos Player/Recorder style */
@@ -96,11 +100,15 @@
96#define I2C_GMINI 2 /* Gmini style */ 100#define I2C_GMINI 2 /* Gmini style */
97#define I2C_COLDFIRE 3 /* Coldfire style */ 101#define I2C_COLDFIRE 3 /* Coldfire style */
98#define I2C_PP5020 4 /* PP5020 style */ 102#define I2C_PP5020 4 /* PP5020 style */
103#define I2C_PNX0101 5 /* PNX0101 style */
99 104
100/* CONFIG_LED */ 105/* CONFIG_LED */
101#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ 106#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */
102#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */ 107#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
103 108
109/* CONFIG_FLASH */
110#define FLASH_IFP7XX 1
111
104/* CONFIG_RTC */ 112/* CONFIG_RTC */
105#define RTC_M41ST84W 1 /* Archos Recorder */ 113#define RTC_M41ST84W 1 /* Archos Recorder */
106#define RTC_PCF50605 2 /* iPod 4G */ 114#define RTC_PCF50605 2 /* iPod 4G */
@@ -139,6 +147,8 @@
139#include "config-ipodnano.h" 147#include "config-ipodnano.h"
140#elif defined(IPOD_VIDEO) 148#elif defined(IPOD_VIDEO)
141#include "config-ipodvideo.h" 149#include "config-ipodvideo.h"
150#elif defined(IRIVER_IFP7XX)
151#include "config-ifp7xx.h"
142#else 152#else
143/* no known platform */ 153/* no known platform */
144#endif 154#endif
@@ -156,7 +166,7 @@
156#endif 166#endif
157 167
158/* define for all cpus from ARM family */ 168/* define for all cpus from ARM family */
159#if (CONFIG_CPU == PP5020) 169#if (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101)
160#define CPU_ARM 170#define CPU_ARM
161#endif 171#endif
162 172
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h
index a65786c69f..1ced9fce5e 100644
--- a/firmware/export/cpu.h
+++ b/firmware/export/cpu.h
@@ -33,3 +33,6 @@
33#if CONFIG_CPU == PP5020 33#if CONFIG_CPU == PP5020
34#include "pp5020.h" 34#include "pp5020.h"
35#endif 35#endif
36#if CONFIG_CPU == PNX0101
37#include "pnx0101.h"
38#endif
diff --git a/firmware/export/pnx0101.h b/firmware/export/pnx0101.h
new file mode 100644
index 0000000000..4408c0aa5b
--- /dev/null
+++ b/firmware/export/pnx0101.h
@@ -0,0 +1,67 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Tomasz Malesinski
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef __PNX0101_H__
21#define __PNX0101_H__
22
23#define GPIO0_READ (*(volatile unsigned long *)0x80003000)
24#define GPIO0_SET (*(volatile unsigned long *)0x80003014)
25#define GPIO0_CLR (*(volatile unsigned long *)0x80003018)
26#define GPIO1_READ (*(volatile unsigned long *)0x80003040)
27#define GPIO1_SET (*(volatile unsigned long *)0x80003054)
28#define GPIO1_CLR (*(volatile unsigned long *)0x80003058)
29#define GPIO2_READ (*(volatile unsigned long *)0x80003080)
30#define GPIO2_SET (*(volatile unsigned long *)0x80003094)
31#define GPIO2_CLR (*(volatile unsigned long *)0x80003098)
32#define GPIO3_READ (*(volatile unsigned long *)0x800030c0)
33#define GPIO3_SET (*(volatile unsigned long *)0x800030d4)
34#define GPIO3_CLR (*(volatile unsigned long *)0x800030d8)
35#define GPIO4_READ (*(volatile unsigned long *)0x80003100)
36#define GPIO4_SET (*(volatile unsigned long *)0x80003114)
37#define GPIO4_CLR (*(volatile unsigned long *)0x80003118)
38#define GPIO5_READ (*(volatile unsigned long *)0x80003140)
39#define GPIO5_SET (*(volatile unsigned long *)0x80003154)
40#define GPIO5_CLR (*(volatile unsigned long *)0x80003158)
41#define GPIO6_READ (*(volatile unsigned long *)0x80003180)
42#define GPIO6_SET (*(volatile unsigned long *)0x80003194)
43#define GPIO6_CLR (*(volatile unsigned long *)0x80003198)
44#define GPIO7_READ (*(volatile unsigned long *)0x800031c0)
45#define GPIO7_SET (*(volatile unsigned long *)0x800031d4)
46#define GPIO7_CLR (*(volatile unsigned long *)0x800031d8)
47
48#define LCDREG04 (*(volatile unsigned long *)0x80104004)
49#define LCDSTAT (*(volatile unsigned long *)0x80104008)
50#define LCDREG10 (*(volatile unsigned long *)0x80104010)
51#define LCDCMD (*(volatile unsigned long *)0x80104020)
52#define LCDDATA (*(volatile unsigned long *)0x80104030)
53
54#define TIMERR00 (*(volatile unsigned long *)0x80020000)
55#define TIMERR08 (*(volatile unsigned long *)0x80020008)
56#define TIMERR0C (*(volatile unsigned long *)0x8002000c)
57
58#define ADCCH0 (*(volatile unsigned long *)0x80002400)
59#define ADCCH1 (*(volatile unsigned long *)0x80002404)
60#define ADCCH2 (*(volatile unsigned long *)0x80002408)
61#define ADCCH3 (*(volatile unsigned long *)0x8000240c)
62#define ADCCH4 (*(volatile unsigned long *)0x80002410)
63#define ADCST (*(volatile unsigned long *)0x80002420)
64#define ADCR24 (*(volatile unsigned long *)0x80002424)
65#define ADCR28 (*(volatile unsigned long *)0x80002428)
66
67#endif
diff --git a/firmware/export/system.h b/firmware/export/system.h
index d197b06547..50cbaee686 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -299,7 +299,7 @@ static inline void invalidate_icache(void)
299#define CPUFREQ_MAX_MULT 11 299#define CPUFREQ_MAX_MULT 11
300#define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ) 300#define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ)
301 301
302#elif CONFIG_CPU == PP5020 302#elif defined(CPU_ARM)
303 303
304/* TODO: Implement set_irq_level and check CPU frequencies */ 304/* TODO: Implement set_irq_level and check CPU frequencies */
305 305
@@ -330,14 +330,26 @@ static inline unsigned long swap32(unsigned long value)
330} 330}
331 331
332#define HIGHEST_IRQ_LEVEL (1) 332#define HIGHEST_IRQ_LEVEL (1)
333
333static inline int set_irq_level(int level) 334static inline int set_irq_level(int level)
334{ 335{
335 int result=level; 336 unsigned long cpsr;
336 return result; 337 /* Read the old level and set the new one */
338 asm volatile ("mrs %0,cpsr" : "=r" (cpsr));
339 asm volatile ("msr cpsr_c,%0"
340 : : "r" ((cpsr & ~0x80) | (level << 7)));
341 return (cpsr >> 7) & 1;
337} 342}
338 343
339#define invalidate_icache() 344#define invalidate_icache()
340 345
346#if CONFIG_CPU == PNX0101
347typedef void (*interrupt_handler_t)(void);
348
349void irq_set_int_handler(int n, interrupt_handler_t handler);
350void irq_enable_int(int n);
351#endif
352
341#elif CONFIG_CPU == TCC730 353#elif CONFIG_CPU == TCC730
342 354
343extern int smsc_version(void); 355extern int smsc_version(void);
diff --git a/firmware/kernel.c b/firmware/kernel.c
index a353c4bdc9..b30a3bb12b 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -358,6 +358,41 @@ void tick_start(unsigned int interval_in_ms)
358#endif 358#endif
359} 359}
360 360
361#elif CONFIG_CPU == PNX0101
362
363void timer_handler(void)
364{
365 int i;
366
367 /* Run through the list of tick tasks */
368 for(i = 0;i < MAX_NUM_TICK_TASKS;i++)
369 {
370 if(tick_funcs[i])
371 tick_funcs[i]();
372 }
373
374 current_tick++;
375 wake_up_thread();
376
377 TIMERR0C = 1;
378}
379
380void tick_start(unsigned int interval_in_ms)
381{
382 TIMERR08 &= ~0x80;
383 TIMERR0C = 1;
384 TIMERR08 &= ~0x80;
385 TIMERR08 |= 0x40;
386 TIMERR00 = 3000000 * interval_in_ms / 1000;
387 TIMERR08 &= ~0xc;
388 TIMERR0C = 1;
389
390 irq_set_int_handler(4, timer_handler);
391 irq_enable_int(4);
392
393 TIMERR08 |= 0x80;
394}
395
361#endif 396#endif
362 397
363int tick_add_task(void (*f)(void)) 398int tick_add_task(void (*f)(void))
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c
index 5e16353b85..62a48b5855 100644
--- a/firmware/pcm_playback.c
+++ b/firmware/pcm_playback.c
@@ -487,4 +487,55 @@ long pcm_get_bytes_waiting(void)
487 return 0; 487 return 0;
488} 488}
489 489
490#elif CONFIG_CPU == PNX0101
491
492/* TODO: Implement for iFP7xx
493 For now, just implement some dummy functions.
494*/
495
496void pcm_init(void)
497{
498
499}
500
501void pcm_set_frequency(unsigned int frequency)
502{
503 (void)frequency;
504}
505
506void pcm_play_data(void (*get_more)(unsigned char** start, long* size))
507{
508 (void)get_more;
509}
510
511void pcm_play_stop(void)
512{
513}
514
515void pcm_play_pause(bool play)
516{
517 (void)play;
518}
519
520bool pcm_is_paused(void)
521{
522 return false;
523}
524
525bool pcm_is_playing(void)
526{
527 return false;
528}
529
530void pcm_calculate_peaks(int *left, int *right)
531{
532 (void)left;
533 (void)right;
534}
535
536long pcm_get_bytes_waiting(void)
537{
538 return 0;
539}
540
490#endif 541#endif
diff --git a/firmware/system.c b/firmware/system.c
index 7afa3f720e..da15ee1122 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -1191,5 +1191,86 @@ int system_memory_guard(int newmode)
1191 return 0; 1191 return 0;
1192} 1192}
1193 1193
1194#elif CONFIG_CPU==PNX0101
1195
1196interrupt_handler_t interrupt_vector[0x1d] __attribute__ ((section(".idata")));
1197
1198#define IRQ_REG(reg) (*(volatile unsigned long *)(0x80300000 + (reg)))
1199
1200static inline unsigned long irq_read(int reg)
1201{
1202 unsigned long v, v2;
1203 do
1204 {
1205 v = IRQ_REG(reg);
1206 v2 = IRQ_REG(reg);
1207 } while (v != v2);
1208 return v;
1209}
1210
1211#define IRQ_WRITE_WAIT(reg, val, cond) \
1212 do { unsigned long v, v2; \
1213 do { \
1214 IRQ_REG(reg) = (val); \
1215 v = IRQ_REG(reg); \
1216 v2 = IRQ_REG(reg); \
1217 } while ((v != v2) || !(cond)); \
1218 } while (0);
1219
1220static void UIE(void) {}
1221
1222void irq(void)
1223{
1224 int n = irq_read(0x100) >> 3;
1225 (*(interrupt_vector[n]))();
1226}
1227
1228void irq_enable_int(int n)
1229{
1230 IRQ_WRITE_WAIT(0x404 + n * 4, 0x4010000, v & 0x10000);
1231}
1232
1233void irq_set_int_handler(int n, interrupt_handler_t handler)
1234{
1235 interrupt_vector[n + 1] = handler;
1236}
1237
1238void system_init(void)
1239{
1240 int i;
1241
1242 /* turn off watchdog */
1243 (*(volatile unsigned long *)0x80002804) = 0;
1244
1245 /*
1246 IRQ_WRITE_WAIT(0x100, 0, v == 0);
1247 IRQ_WRITE_WAIT(0x104, 0, v == 0);
1248 IRQ_WRITE_WAIT(0, 0, v == 0);
1249 IRQ_WRITE_WAIT(4, 0, v == 0);
1250 */
1251
1252 for (i = 0; i < 0x1c; i++)
1253 {
1254 IRQ_WRITE_WAIT(0x404 + i * 4, 0x1e000001, (v & 0x3010f) == 1);
1255 IRQ_WRITE_WAIT(0x404 + i * 4, 0x4000000, (v & 0x10000) == 0);
1256 IRQ_WRITE_WAIT(0x404 + i * 4, 0x10000001, (v & 0xf) == 1);
1257 interrupt_vector[i + 1] = UIE;
1258 }
1259 interrupt_vector[0] = UIE;
1260}
1261
1262
1263void system_reboot(void)
1264{
1265 (*(volatile unsigned long *)0x80002804) = 1;
1266 while (1);
1267}
1268
1269int system_memory_guard(int newmode)
1270{
1271 (void)newmode;
1272 return 0;
1273}
1274
1194#endif /* CONFIG_CPU */ 1275#endif /* CONFIG_CPU */
1195 1276
diff --git a/firmware/thread.c b/firmware/thread.c
index 13577e8efb..281801418f 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -326,7 +326,7 @@ int create_thread(void (*function)(void), void* stack, int stack_size,
326 thread_stack[num_threads] = stack; 326 thread_stack[num_threads] = stack;
327 thread_stack_size[num_threads] = stack_size; 327 thread_stack_size[num_threads] = stack_size;
328 regs = &thread_contexts[num_threads]; 328 regs = &thread_contexts[num_threads];
329#if defined(CPU_COLDFIRE) || (CONFIG_CPU == SH7034) || (CONFIG_CPU == PP5020) 329#if defined(CPU_COLDFIRE) || (CONFIG_CPU == SH7034) || defined(CPU_ARM)
330 /* Align stack to an even 32 bit boundary */ 330 /* Align stack to an even 32 bit boundary */
331 regs->sp = (void*)(((unsigned int)stack + stack_size) & ~3); 331 regs->sp = (void*)(((unsigned int)stack + stack_size) & ~3);
332#elif CONFIG_CPU == TCC730 332#elif CONFIG_CPU == TCC730
diff --git a/firmware/usb.c b/firmware/usb.c
index 98f224f781..bd2fde3ab8 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -180,6 +180,9 @@ void usb_enable(bool on)
180 outl(1, 0x40017F10); 180 outl(1, 0x40017F10);
181 outl(inl(0x60006004) | 0x4, 0x60006004); 181 outl(inl(0x60006004) | 0x4, 0x60006004);
182 } 182 }
183#elif defined(USB_ISP1582)
184 /* TODO: Implement USB_ISP1582 */
185 (void) on;
183#else 186#else
184#ifdef HAVE_LCD_BITMAP 187#ifdef HAVE_LCD_BITMAP
185 if(read_hw_mask() & USB_ACTIVE_HIGH) 188 if(read_hw_mask() & USB_ACTIVE_HIGH)
@@ -404,6 +407,10 @@ bool usb_detect(void)
404 } 407 }
405 current_status = (USB_STATUS & 0x800)?true:false; 408 current_status = (USB_STATUS & 0x800)?true:false;
406#endif 409#endif
410#ifdef USB_ISP1582
411 /* TODO: Implement USB_ISP1582 */
412 current_status = false;
413#endif
407 return current_status; 414 return current_status;
408} 415}
409 416
diff --git a/tools/configure b/tools/configure
index 68d2481922..f8fea6e76c 100755
--- a/tools/configure
+++ b/tools/configure
@@ -425,6 +425,7 @@ appsdir='\$(ROOTDIR)/apps'
425 echo "13 - iPod Color/Photo" 425 echo "13 - iPod Color/Photo"
426 echo "14 - iPod Nano" 426 echo "14 - iPod Nano"
427 echo "15 - iPod Video" 427 echo "15 - iPod Video"
428 echo "16 - iriver iFP-790"
428 429
429 getit=`input`; 430 getit=`input`;
430 431
@@ -691,6 +692,20 @@ appsdir='\$(ROOTDIR)/apps'
691 toolset=$ipodbitmaptools 692 toolset=$ipodbitmaptools
692 ;; 693 ;;
693 694
695 16)
696 archos="ifp7xx"
697 target="-DIRIVER_IFP7XX"
698 memory=1
699 arm7tdmicc
700 tool="cp"
701 output="rockbox.wma"
702 appextra="recorder:gui"
703 archosrom=""
704 flash=""
705 plugins="yes"
706 codecs="libmad liba52 libffmpegFLAC libTremor libwavpack dumb libmusepack libalac libfaad libm4a"
707 ;;
708
694 *) 709 *)
695 echo "Please select an actual target platform!" 710 echo "Please select an actual target platform!"
696 exit 711 exit
diff --git a/tools/scramble.c b/tools/scramble.c
index d19ef89173..44a1902424 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -171,6 +171,8 @@ int main (int argc, char** argv)
171 modelnum = 4; 171 modelnum = 4;
172 else if(!strcmp(&argv[1][5], "ipvd")) 172 else if(!strcmp(&argv[1][5], "ipvd"))
173 modelnum = 5; 173 modelnum = 5;
174 else if(!strcmp(&argv[1][5], "fp7x"))
175 modelnum = 6;
174 else { 176 else {
175 fprintf(stderr, "unsupported model: %s\n", &argv[1][5]); 177 fprintf(stderr, "unsupported model: %s\n", &argv[1][5]);
176 return 2; 178 return 2;