summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/app.lds4
-rw-r--r--firmware/boot.lds6
-rw-r--r--firmware/drivers/ata.c40
-rw-r--r--firmware/drivers/power.c8
-rw-r--r--firmware/export/button.h14
-rw-r--r--firmware/export/config-gigabeat.h94
-rw-r--r--firmware/export/config.h11
-rw-r--r--firmware/export/cpu.h3
8 files changed, 179 insertions, 1 deletions
diff --git a/firmware/app.lds b/firmware/app.lds
index 74cca5a96a..5309311ee1 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -130,6 +130,10 @@ _pluginbuf = 0;
130#define DRAMORIG 0xc00000 + STUBOFFSET 130#define DRAMORIG 0xc00000 + STUBOFFSET
131#define IRAMORIG 0x400000 131#define IRAMORIG 0x400000
132#define IRAMSIZE 0x8000 132#define IRAMSIZE 0x8000
133#elif CONFIG_CPU==S3C2440
134#define DRAMORIG 0x30000000 + STUBOFFSET
135#define IRAMORIG 0x40000000
136#define IRAMSIZE 4K
133#else 137#else
134#define DRAMORIG 0x09000000 + STUBOFFSET 138#define DRAMORIG 0x09000000 + STUBOFFSET
135#define IRAMORIG 0x0f000000 139#define IRAMORIG 0x0f000000
diff --git a/firmware/boot.lds b/firmware/boot.lds
index 779b7b3b85..0b49917edd 100644
--- a/firmware/boot.lds
+++ b/firmware/boot.lds
@@ -38,6 +38,12 @@ INPUT(crt0.o)
38#define IRAMSIZE 0x18000 38#define IRAMSIZE 0x18000
39#define FLASHORIG 0x001f0000 39#define FLASHORIG 0x001f0000
40#define FLASHSIZE 2M 40#define FLASHSIZE 2M
41#elif CONFIG_CPU == S3C2440
42#define DRAMORIG 0x30000000
43#define IRAMORIG 0x40000000
44#define IRAMSIZE 4K
45#define FLASHORIG 0x0000000
46#define FLASHSIZE 1M
41#elif CONFIG_CPU == PP5002 47#elif CONFIG_CPU == PP5002
42#define DRAMORIG 0x28000000 48#define DRAMORIG 0x28000000
43#define IRAMORIG 0x40000000 49#define IRAMORIG 0x40000000
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index e4600e171a..8b3e54da44 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -246,6 +246,43 @@ int ide_read_register(int reg) {
246 return ide_reg_temp; 246 return ide_reg_temp;
247} 247}
248 248
249#elif defined(TOSHIBA_GIGABEAT_F)
250
251/* don't use sh7034 assembler routines */
252#define PREFER_C_READING
253#define PREFER_C_WRITING
254
255#define ATA_IOBASE 0x20000000
256#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
257#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x02)))
258#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x04)))
259#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x06)))
260#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x08)))
261#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10)))
262#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x12)))
263#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x14)))
264#define ATA_CONTROL (*((volatile unsigned char*)(0x21000000 + 0x1c)))
265
266#define STATUS_BSY 0x80
267#define STATUS_RDY 0x40
268#define STATUS_DF 0x20
269#define STATUS_DRQ 0x08
270#define STATUS_ERR 0x01
271#define ERROR_ABRT 0x04
272
273#define WRITE_PATTERN1 0xa5
274#define WRITE_PATTERN2 0x5a
275#define WRITE_PATTERN3 0xaa
276#define WRITE_PATTERN4 0x55
277
278#define READ_PATTERN1 0xa5
279#define READ_PATTERN2 0x5a
280#define READ_PATTERN3 0xaa
281#define READ_PATTERN4 0x55
282
283#define SET_REG(reg,val) reg = (val)
284#define SET_16BITREG(reg,val) reg = (val)
285
249#endif 286#endif
250 287
251#define ATA_FEATURE ATA_ERROR 288#define ATA_FEATURE ATA_ERROR
@@ -1429,6 +1466,9 @@ int ata_init(void)
1429#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) 1466#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
1430 bool coldstart = false; 1467 bool coldstart = false;
1431 /* TODO: Implement coldstart variable */ 1468 /* TODO: Implement coldstart variable */
1469#elif defined(TOSHIBA_GIGABEAT_F)
1470 /* TODO */
1471 bool coldstart = true;
1432#else 1472#else
1433 bool coldstart = (PACR2 & 0x4000) != 0; 1473 bool coldstart = (PACR2 & 0x4000) != 0;
1434#endif 1474#endif
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index d7750a33b2..b62121298d 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -122,6 +122,8 @@ bool charger_inserted(void)
122 /* FM or V2, can also charge from the USB port */ 122 /* FM or V2, can also charge from the USB port */
123 return (adc_read(ADC_CHARGE_REGULATOR) < 0x1FF) || 123 return (adc_read(ADC_CHARGE_REGULATOR) < 0x1FF) ||
124 (adc_read(ADC_USB_POWER) < 0x1FF); 124 (adc_read(ADC_USB_POWER) < 0x1FF);
125#elif defined(TOSHIBA_GIGABEAT_F)
126 return false;
125#else 127#else
126 /* Player */ 128 /* Player */
127 return (PADR & 1) == 0; 129 return (PADR & 1) == 0;
@@ -189,6 +191,8 @@ void ide_power_enable(bool on)
189 P1 &= ~0x08; 191 P1 &= ~0x08;
190#elif CONFIG_CPU == PNX0101 192#elif CONFIG_CPU == PNX0101
191 /* no ide controller */ 193 /* no ide controller */
194#elif defined(TOSHIBA_GIGABEAT_F)
195 /* Gigabeat TODO */
192#else /* SH1 based archos */ 196#else /* SH1 based archos */
193 bool touched = false; 197 bool touched = false;
194#ifdef NEEDS_ATA_POWER_ON 198#ifdef NEEDS_ATA_POWER_ON
@@ -241,6 +245,8 @@ bool ide_powered(void)
241 return true; 245 return true;
242#elif defined(GMINI_ARCH) 246#elif defined(GMINI_ARCH)
243 return (P1 & 0x08?true:false); 247 return (P1 & 0x08?true:false);
248#elif defined(TOSHIBA_GIGABEAT_F)
249 return false;
244#else /* SH1 based archos */ 250#else /* SH1 based archos */
245#if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF) 251#if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF)
246#ifdef ATA_POWER_PLAYERSTYLE 252#ifdef ATA_POWER_PLAYERSTYLE
@@ -283,6 +289,8 @@ void power_off(void)
283#elif defined(GMINI_ARCH) 289#elif defined(GMINI_ARCH)
284 P1 &= ~1; 290 P1 &= ~1;
285 P1CON &= ~1; 291 P1CON &= ~1;
292#elif defined(TOSHIBA_GIGABEAT_F)
293 /* FIXME: Can we turn the device off, or only enter sleep mode? */
286#else 294#else
287#ifdef HAVE_POWEROFF_ON_PBDR 295#ifdef HAVE_POWEROFF_ON_PBDR
288 and_b(~0x10, &PBDRL); 296 and_b(~0x10, &PBDRL);
diff --git a/firmware/export/button.h b/firmware/export/button.h
index 484698e492..3ae1d37d52 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -197,6 +197,20 @@ bool button_hold(void);
197 197
198#define BUTTON_RC_REC (BUTTON_REMOTE | 0x00400000) 198#define BUTTON_RC_REC (BUTTON_REMOTE | 0x00400000)
199 199
200#elif CONFIG_KEYPAD == GIGABEAT_PAD
201
202/* TODO: These codes should relate to the hardware */
203
204#define BUTTON_POWER 0x0001
205#define BUTTON_MENU 0x0002
206#define BUTTON_VOL_UP 0x0008
207#define BUTTON_VOL_DOWN 0x0010
208#define BUTTON_A 0x0020
209#define BUTTON_UP 0x0100
210#define BUTTON_DOWN 0x0200
211#define BUTTON_SELECT 0x0400
212
213
200#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */ 214#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */
201 215
202#endif /* _BUTTON_H_ */ 216#endif /* _BUTTON_H_ */
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h
new file mode 100644
index 0000000000..db99bf5d57
--- /dev/null
+++ b/firmware/export/config-gigabeat.h
@@ -0,0 +1,94 @@
1/*
2 * This config file is for toshiba Gigabeat F
3 */
4#define TOSHIBA_GIGABEAT_F 1
5
6/* For Rolo and boot loader */
7#define MODEL_NUMBER 1
8
9/* define this if you have a bitmap LCD display */
10#define HAVE_LCD_BITMAP 1
11
12/* define this if you have a colour LCD */
13#define HAVE_LCD_COLOR 1
14
15/* LCD dimensions */
16#define LCD_WIDTH 240
17#define LCD_HEIGHT 320
18#define LCD_DEPTH 16 /* 65k colours */
19#define LCD_PIXELFORMAT RGB565 /* rgb565 */
20
21
22#define CONFIG_KEYPAD GIGABEAT_PAD
23
24/* Define this if you do software codec */
25#define CONFIG_CODEC SWCODEC
26
27/* define this if you have a real-time clock */
28//#define CONFIG_RTC RTC_PCF50606
29
30/* Define this for LCD backlight available */
31#define CONFIG_BACKLIGHT BL_GIGABEAT /* port controlled PWM */
32
33/* Define this if you have a software controlled poweroff */
34#define HAVE_SW_POWEROFF
35
36/* The number of bytes reserved for loadable codecs */
37#define CODEC_SIZE 0x80000
38
39/* The number of bytes reserved for loadable plugins */
40#define PLUGIN_BUFFER_SIZE 0x80000
41
42/* Define this if you have the WM8975 audio codec */
43#define HAVE_WM8751
44
45#ifndef SIMULATOR
46
47/* Define this if you have a Motorola SCF5249 */
48#define CONFIG_CPU S3C2440
49
50/* Define this if you want to use coldfire's i2c interface */
51#define CONFIG_I2C I2C_S3C2440
52
53/* Type of mobile power */
54#define CONFIG_BATTERY BATT_LIPOL1300
55
56#define BATTERY_SCALE_FACTOR 23437 /* FIX: this value is picked at random */
57
58/* Define this if the platform can charge batteries */
59#define HAVE_CHARGING 1
60
61/* define this if the hardware can be powered off while charging */
62#define HAVE_POWEROFF_WHILE_CHARGING
63
64/* The size of the flash ROM */
65#define FLASH_SIZE 0x400000
66
67/* Define this to the CPU frequency */
68#define CPU_FREQ 16934400
69
70/* Define this if you have ATA power-off control */
71#define HAVE_ATA_POWER_OFF
72
73/* Virtual LED (icon) */
74#define CONFIG_LED LED_VIRTUAL
75
76#define CONFIG_LCD LCD_GIGABEAT
77
78/* Offset ( in the firmware file's header ) to the file CRC */
79#define FIRMWARE_OFFSET_FILE_CRC 0
80
81/* Offset ( in the firmware file's header ) to the real data */
82#define FIRMWARE_OFFSET_FILE_DATA 8
83
84#define USB_IRIVERSTYLE
85
86/* Define this if you have adjustable CPU frequency */
87#define HAVE_ADJUSTABLE_CPU_FREQ
88
89#define BOOTFILE_EXT "gigabeat"
90#define BOOTFILE "rockbox." BOOTFILE_EXT
91
92#define HAVE_BACKLIGHT_BRIGHTNESS
93
94#endif
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 0e673cb988..1557accde5 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -42,6 +42,7 @@
42#define PP5002 5002 42#define PP5002 5002
43#define PP5020 5020 43#define PP5020 5020
44#define PNX0101 101 44#define PNX0101 101
45#define S3C2440 2440
45 46
46/* CONFIG_KEYPAD */ 47/* CONFIG_KEYPAD */
47#define PLAYER_PAD 0 48#define PLAYER_PAD 0
@@ -54,6 +55,7 @@
54#define IPOD_4G_PAD 7 55#define IPOD_4G_PAD 7
55#define IPOD_3G_PAD 8 56#define IPOD_3G_PAD 8
56#define IRIVER_IFP7XX_PAD 9 57#define IRIVER_IFP7XX_PAD 9
58#define GIGABEAT_PAD 10
57 59
58/* CONFIG_REMOTE_KEYPAD */ 60/* CONFIG_REMOTE_KEYPAD */
59#define H100_REMOTE 1 61#define H100_REMOTE 1
@@ -80,6 +82,7 @@
80#define LCD_IPODVIDEO 8 /* as used by iPod Video */ 82#define LCD_IPODVIDEO 8 /* as used by iPod Video */
81#define LCD_IPOD2BPP 9 /* as used by all greyscale iPods */ 83#define LCD_IPOD2BPP 9 /* as used by all greyscale iPods */
82#define LCD_IFP7XX 10 /* as used by iRiver iFP 7xx/8xx */ 84#define LCD_IFP7XX 10 /* as used by iRiver iFP 7xx/8xx */
85#define LCD_GIGABEAT 11
83 86
84/* LCD_PIXELFORMAT */ 87/* LCD_PIXELFORMAT */
85#define HORIZONTAL_PACKING 1 88#define HORIZONTAL_PACKING 1
@@ -99,6 +102,7 @@
99#define BL_IRIVER_H300 8 /* IRiver PWM */ 102#define BL_IRIVER_H300 8 /* IRiver PWM */
100#define BL_IRIVER_IFP7XX 9 /* IRiver GPIO */ 103#define BL_IRIVER_IFP7XX 9 /* IRiver GPIO */
101#define BL_IPODMINI 10 /* Apple iPod Mini */ 104#define BL_IPODMINI 10 /* Apple iPod Mini */
105#define BL_GIGABEAT 11 /* Toshiba Gigabeat */
102 106
103/* CONFIG_I2C */ 107/* CONFIG_I2C */
104#define I2C_PLAYREC 0 /* Archos Player/Recorder style */ 108#define I2C_PLAYREC 0 /* Archos Player/Recorder style */
@@ -108,6 +112,7 @@
108#define I2C_PP5002 4 /* PP5002 style */ 112#define I2C_PP5002 4 /* PP5002 style */
109#define I2C_PP5020 5 /* PP5020 style */ 113#define I2C_PP5020 5 /* PP5020 style */
110#define I2C_PNX0101 6 /* PNX0101 style */ 114#define I2C_PNX0101 6 /* PNX0101 style */
115#define I2C_S3C2440 7
111 116
112/* CONFIG_LED */ 117/* CONFIG_LED */
113#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ 118#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */
@@ -120,6 +125,7 @@
120#define RTC_M41ST84W 1 /* Archos Recorder */ 125#define RTC_M41ST84W 1 /* Archos Recorder */
121#define RTC_PCF50605 2 /* iPod 3G and 4G*/ 126#define RTC_PCF50605 2 /* iPod 3G and 4G*/
122#define RTC_PCF50606 3 /* iriver H300 */ 127#define RTC_PCF50606 3 /* iriver H300 */
128#define RTC_S3C2440 4
123 129
124/* else HW controlled LED (iRiver H1x0) */ 130/* else HW controlled LED (iRiver H1x0) */
125 131
@@ -160,6 +166,8 @@
160#include "config-ipod4g.h" 166#include "config-ipod4g.h"
161#elif defined(IRIVER_IFP7XX) 167#elif defined(IRIVER_IFP7XX)
162#include "config-ifp7xx.h" 168#include "config-ifp7xx.h"
169#elif defined(GIGABEAT_F)
170#include "config-gigabeat.h"
163#elif defined(IPOD_MINI) 171#elif defined(IPOD_MINI)
164#include "config-ipodmini.h" 172#include "config-ipodmini.h"
165#else 173#else
@@ -185,7 +193,8 @@
185#endif 193#endif
186 194
187/* define for all cpus from ARM family */ 195/* define for all cpus from ARM family */
188#if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101) 196#if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440)
197
189#define CPU_ARM 198#define CPU_ARM
190#endif 199#endif
191 200
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h
index d0b953ef6f..4c33ac96f4 100644
--- a/firmware/export/cpu.h
+++ b/firmware/export/cpu.h
@@ -39,3 +39,6 @@
39#if CONFIG_CPU == PNX0101 39#if CONFIG_CPU == PNX0101
40#include "pnx0101.h" 40#include "pnx0101.h"
41#endif 41#endif
42#if CONFIG_CPU == S3C2440
43#include "s3c2440.h"
44#endif