diff options
Diffstat (limited to 'firmware')
-rwxr-xr-x | firmware/export/config-hdd1630.h | 12 | ||||
-rw-r--r-- | firmware/target/arm/adc-pp5020.c | 22 | ||||
-rwxr-xr-x | firmware/target/arm/philips/hdd1630/backlight-hdd1630.c | 4 | ||||
-rwxr-xr-x | firmware/target/arm/philips/hdd1630/button-hdd1630.c | 33 | ||||
-rwxr-xr-x | firmware/target/arm/philips/hdd1630/lcd-hdd1630.c | 1 | ||||
-rwxr-xr-x | firmware/target/arm/philips/hdd1630/power-hdd1630.c | 27 | ||||
-rw-r--r-- | firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/wmcodec-pp.c | 7 |
8 files changed, 87 insertions, 27 deletions
diff --git a/firmware/export/config-hdd1630.h b/firmware/export/config-hdd1630.h index 7ee3f11355..3ed77c27fa 100755 --- a/firmware/export/config-hdd1630.h +++ b/firmware/export/config-hdd1630.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * This config file is for the Philips GoGear HDD1630 | 2 | * This config file is for the Philips GoGear HDD16x0/HDD63x0 |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #define TARGET_TREE /* this target is using the target tree system */ | 5 | #define TARGET_TREE /* this target is using the target tree system */ |
6 | 6 | ||
7 | /* For Rolo and boot loader */ | 7 | /* For Rolo and boot loader */ |
8 | #define MODEL_NUMBER 31 | 8 | #define MODEL_NUMBER 31 |
9 | #define MODEL_NAME "Philips GoGear HDD1630" | 9 | #define MODEL_NAME "Philips GoGear HDD16x0" |
10 | 10 | ||
11 | /* define this if you use an ATA controller */ | 11 | /* define this if you use an ATA controller */ |
12 | #define CONFIG_STORAGE STORAGE_ATA | 12 | #define CONFIG_STORAGE STORAGE_ATA |
@@ -48,7 +48,7 @@ | |||
48 | #define LCD_WIDTH 128 | 48 | #define LCD_WIDTH 128 |
49 | #define LCD_HEIGHT 128 | 49 | #define LCD_HEIGHT 128 |
50 | #define LCD_DEPTH 16 /* 65536 colours */ | 50 | #define LCD_DEPTH 16 /* 65536 colours */ |
51 | #define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */ | 51 | #define LCD_PIXELFORMAT RGB565 /* rgb565 byte-swapped */ |
52 | 52 | ||
53 | #ifndef BOOTLOADER | 53 | #ifndef BOOTLOADER |
54 | /* Define this if your LCD can be enabled/disabled */ | 54 | /* Define this if your LCD can be enabled/disabled */ |
@@ -95,7 +95,7 @@ | |||
95 | /* WM8731 has no tone controls, so we use the software ones */ | 95 | /* WM8731 has no tone controls, so we use the software ones */ |
96 | #define HAVE_SW_TONE_CONTROLS | 96 | #define HAVE_SW_TONE_CONTROLS |
97 | 97 | ||
98 | #define AB_REPEAT_ENABLE 1 | 98 | /* TODO: #define AB_REPEAT_ENABLE 1 */ |
99 | 99 | ||
100 | /* FM Tuner */ | 100 | /* FM Tuner */ |
101 | /* #define CONFIG_TUNER TEA5767 */ | 101 | /* #define CONFIG_TUNER TEA5767 */ |
@@ -117,8 +117,6 @@ | |||
117 | /* define this if you have a light associated with the buttons */ | 117 | /* define this if you have a light associated with the buttons */ |
118 | /* #define HAVE_BUTTON_LIGHT */ | 118 | /* #define HAVE_BUTTON_LIGHT */ |
119 | 119 | ||
120 | #define AB_REPEAT_ENABLE 1 | ||
121 | |||
122 | #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */ | 120 | #define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */ |
123 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ | 121 | #define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */ |
124 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ | 122 | #define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ |
@@ -162,7 +160,7 @@ | |||
162 | #define DEFAULT_CONTRAST_SETTING 14 /* Match boot contrast */ | 160 | #define DEFAULT_CONTRAST_SETTING 14 /* Match boot contrast */ |
163 | 161 | ||
164 | /* We're able to shut off power to the HDD */ | 162 | /* We're able to shut off power to the HDD */ |
165 | /* #define HAVE_ATA_POWER_OFF */ | 163 | #define HAVE_ATA_POWER_OFF |
166 | 164 | ||
167 | /* Offset ( in the firmware file's header ) to the file CRC and data. These are | 165 | /* Offset ( in the firmware file's header ) to the file CRC and data. These are |
168 | only used when loading the old format rockbox.e200 file */ | 166 | only used when loading the old format rockbox.e200 file */ |
diff --git a/firmware/target/arm/adc-pp5020.c b/firmware/target/arm/adc-pp5020.c index a8fe8c1560..33950014dc 100644 --- a/firmware/target/arm/adc-pp5020.c +++ b/firmware/target/arm/adc-pp5020.c | |||
@@ -35,28 +35,28 @@ unsigned short adc_scan(int channel) | |||
35 | 35 | ||
36 | /* Start conversion */ | 36 | /* Start conversion */ |
37 | ADC_ADDR |= 0x80000000; | 37 | ADC_ADDR |= 0x80000000; |
38 | 38 | ||
39 | /* Wait for conversion to complete */ | 39 | /* Wait for conversion to complete */ |
40 | while((ADC_STATUS & (0x40<<8*channel))==0); | 40 | while((ADC_STATUS & (0x40<<8*channel))==0); |
41 | 41 | ||
42 | /* Stop conversion */ | 42 | /* Stop conversion */ |
43 | ADC_ADDR &=~ 0x80000000; | 43 | ADC_ADDR &=~ 0x80000000; |
44 | 44 | ||
45 | /* ADC_DATA_1 and ADC_DATA_2 are both four bytes, one byte per channel. | 45 | /* ADC_DATA_1 and ADC_DATA_2 are both four bytes, one byte per channel. |
46 | For each channel, ADC_DATA_1 stores the 8-bit msb, ADC_DATA_2 stores the | 46 | For each channel, ADC_DATA_1 stores the 8-bit msb, ADC_DATA_2 stores the |
47 | 2-bit lsb (in bits 0 and 1). Each channel is 10 bits total. */ | 47 | 2-bit lsb (in bits 0 and 1). Each channel is 10 bits total. */ |
48 | adc_data_1 = ((ADC_DATA_1 >> (8*channel)) & 0xff); | 48 | adc_data_1 = ((ADC_DATA_1 >> (8*channel)) & 0xff); |
49 | adc_data_2 = ((ADC_DATA_2 >> (8*channel+6)) & 0x3); | 49 | adc_data_2 = ((ADC_DATA_2 >> (8*channel+6)) & 0x3); |
50 | 50 | ||
51 | adcdata[channel] = (adc_data_1<<2 | adc_data_2); | 51 | adcdata[channel] = (adc_data_1<<2 | adc_data_2); |
52 | 52 | ||
53 | /* ADC values read low if PLL is enabled */ | 53 | /* ADC values read low if PLL is enabled */ |
54 | if(PLL_CONTROL & 0x80000000){ | 54 | if(PLL_CONTROL & 0x80000000){ |
55 | adcdata[channel] += 0x14; | 55 | adcdata[channel] += 0x14; |
56 | if(adcdata[channel] > 0x400) | 56 | if(adcdata[channel] > 0x400) |
57 | adcdata[channel] = 0x400; | 57 | adcdata[channel] = 0x400; |
58 | } | 58 | } |
59 | 59 | ||
60 | return adcdata[channel]; | 60 | return adcdata[channel]; |
61 | } | 61 | } |
62 | 62 | ||
@@ -83,17 +83,18 @@ static void adc_tick(void) | |||
83 | /* Figured out from how the OF does things */ | 83 | /* Figured out from how the OF does things */ |
84 | void adc_init(void) | 84 | void adc_init(void) |
85 | { | 85 | { |
86 | |||
86 | ADC_INIT |= 1; | 87 | ADC_INIT |= 1; |
87 | ADC_INIT |= 0x40000000; | 88 | ADC_INIT |= 0x40000000; |
88 | udelay(100); | 89 | udelay(100); |
89 | 90 | ||
90 | /* Reset ADC */ | 91 | /* Reset ADC */ |
91 | DEV_RS2 |= 0x20; | 92 | DEV_RS2 |= 0x20; |
92 | udelay(100); | 93 | udelay(100); |
93 | 94 | ||
94 | DEV_RS2 &=~ 0x20; | 95 | DEV_RS2 &=~ 0x20; |
95 | udelay(100); | 96 | udelay(100); |
96 | 97 | ||
97 | /* Enable ADC */ | 98 | /* Enable ADC */ |
98 | DEV_EN2 |= 0x20; | 99 | DEV_EN2 |= 0x20; |
99 | udelay(100); | 100 | udelay(100); |
@@ -121,7 +122,8 @@ void adc_init(void) | |||
121 | ADC_ADDR |= 0x2000000; | 122 | ADC_ADDR |= 0x2000000; |
122 | ADC_STATUS |= 0x2000; | 123 | ADC_STATUS |= 0x2000; |
123 | 124 | ||
124 | #if defined (IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(MROBE_100) | 125 | #if defined (IRIVER_H10) || defined(IRIVER_H10_5GB) || \ |
126 | defined(MROBE_100) || defined(PHILIPS_HDD1630) | ||
125 | /* Enable channel 2 (H10:remote) */ | 127 | /* Enable channel 2 (H10:remote) */ |
126 | DEV_INIT1 &=~0x300; | 128 | DEV_INIT1 &=~0x300; |
127 | DEV_INIT1 |= 0x100; | 129 | DEV_INIT1 |= 0x100; |
diff --git a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c index 0c49e65563..eb2c2731ac 100755 --- a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c +++ b/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c | |||
@@ -34,10 +34,14 @@ void _backlight_set_brightness(int brightness) | |||
34 | 34 | ||
35 | void _backlight_on(void) | 35 | void _backlight_on(void) |
36 | { | 36 | { |
37 | GPO32_VAL &= ~0x1000000; | ||
38 | GPO32_ENABLE &= ~0x1000000; | ||
37 | } | 39 | } |
38 | 40 | ||
39 | void _backlight_off(void) | 41 | void _backlight_off(void) |
40 | { | 42 | { |
43 | GPO32_VAL |= 0x1000000; | ||
44 | GPO32_ENABLE |= 0x1000000; | ||
41 | } | 45 | } |
42 | 46 | ||
43 | #ifdef HAVE_BUTTON_LIGHT | 47 | #ifdef HAVE_BUTTON_LIGHT |
diff --git a/firmware/target/arm/philips/hdd1630/button-hdd1630.c b/firmware/target/arm/philips/hdd1630/button-hdd1630.c index 3a8f7c5408..84cb8f0c06 100755 --- a/firmware/target/arm/philips/hdd1630/button-hdd1630.c +++ b/firmware/target/arm/philips/hdd1630/button-hdd1630.c | |||
@@ -23,6 +23,21 @@ | |||
23 | #include "button.h" | 23 | #include "button.h" |
24 | #include "backlight.h" | 24 | #include "backlight.h" |
25 | 25 | ||
26 | /* Remember last buttons, to make single buzz sound */ | ||
27 | int btn_old; | ||
28 | |||
29 | /* | ||
30 | * Generate a click sound from the player (not in headphones yet) | ||
31 | * TODO: integrate this with the "key click" option | ||
32 | */ | ||
33 | void button_click(void) | ||
34 | { | ||
35 | GPO32_ENABLE |= 0x2000; | ||
36 | GPIOD_OUTPUT_VAL |= 0x8; | ||
37 | udelay(1000); | ||
38 | GPO32_VAL &= ~0x2000; | ||
39 | } | ||
40 | |||
26 | void button_init_device(void) | 41 | void button_init_device(void) |
27 | { | 42 | { |
28 | /* TODO...for now, hardware initialisation is done by the bootloader */ | 43 | /* TODO...for now, hardware initialisation is done by the bootloader */ |
@@ -49,19 +64,33 @@ int button_read_device(void) | |||
49 | /* device buttons */ | 64 | /* device buttons */ |
50 | if (!hold_button) | 65 | if (!hold_button) |
51 | { | 66 | { |
67 | /* These are the correct button definitions | ||
52 | if (!(GPIOA_INPUT_VAL & 0x01)) btn |= BUTTON_MENU; | 68 | if (!(GPIOA_INPUT_VAL & 0x01)) btn |= BUTTON_MENU; |
53 | if (!(GPIOA_INPUT_VAL & 0x02)) btn |= BUTTON_VOL_UP; | 69 | if (!(GPIOA_INPUT_VAL & 0x02)) btn |= BUTTON_VOL_UP; |
54 | if (!(GPIOA_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN; | 70 | if (!(GPIOA_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN; |
55 | if (!(GPIOA_INPUT_VAL & 0x08)) btn |= BUTTON_VIEW; | 71 | if (!(GPIOA_INPUT_VAL & 0x08)) btn |= BUTTON_VIEW; |
56 | |||
57 | if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_PLAYLIST; | 72 | if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_PLAYLIST; |
58 | if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER; | 73 | if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER; |
74 | */ | ||
75 | |||
76 | /* This is a hack until the touchpad works */ | ||
77 | if (!(GPIOA_INPUT_VAL & 0x01)) btn |= BUTTON_LEFT; /* BUTTON_MENU */ | ||
78 | if (!(GPIOA_INPUT_VAL & 0x02)) btn |= BUTTON_UP; /* BUTTON_VOL_UP */ | ||
79 | if (!(GPIOA_INPUT_VAL & 0x04)) btn |= BUTTON_DOWN; /* BUTTON_VOL_DOWN */ | ||
80 | if (!(GPIOA_INPUT_VAL & 0x08)) btn |= BUTTON_RIGHT; /* BUTTON_VIEW */ | ||
81 | if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_SELECT; /* BUTTON_PLAYLIST */ | ||
82 | if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER; | ||
59 | } | 83 | } |
60 | 84 | ||
85 | if ((btn != btn_old) && (btn != BUTTON_NONE)) | ||
86 | button_click(); | ||
87 | |||
88 | btn_old = btn; | ||
89 | |||
61 | return btn; | 90 | return btn; |
62 | } | 91 | } |
63 | 92 | ||
64 | bool headphones_inserted(void) | 93 | bool headphones_inserted(void) |
65 | { | 94 | { |
66 | return true; | 95 | return (GPIOE_INPUT_VAL & 0x80) ? true : false; |
67 | } | 96 | } |
diff --git a/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c b/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c index d7dee2036d..827e3ef8c4 100755 --- a/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c +++ b/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c | |||
@@ -84,6 +84,7 @@ void lcd_init_device(void) | |||
84 | LCD2_BLOCK_CTRL = 0x10008080; | 84 | LCD2_BLOCK_CTRL = 0x10008080; |
85 | LCD2_BLOCK_CONFIG = 0xF00000; | 85 | LCD2_BLOCK_CONFIG = 0xF00000; |
86 | 86 | ||
87 | /* lcd power */ | ||
87 | GPIOJ_ENABLE |= 0x4; | 88 | GPIOJ_ENABLE |= 0x4; |
88 | GPIOJ_OUTPUT_VAL |= 0x4; | 89 | GPIOJ_OUTPUT_VAL |= 0x4; |
89 | GPIOJ_OUTPUT_EN |= 0x4; | 90 | GPIOJ_OUTPUT_EN |= 0x4; |
diff --git a/firmware/target/arm/philips/hdd1630/power-hdd1630.c b/firmware/target/arm/philips/hdd1630/power-hdd1630.c index ade2536154..03a5794791 100755 --- a/firmware/target/arm/philips/hdd1630/power-hdd1630.c +++ b/firmware/target/arm/philips/hdd1630/power-hdd1630.c | |||
@@ -35,11 +35,30 @@ bool charger_enabled; | |||
35 | 35 | ||
36 | void power_init(void) | 36 | void power_init(void) |
37 | { | 37 | { |
38 | /* power off bit */ | ||
39 | GPIOB_ENABLE |= 0x80; | ||
40 | GPIOB_OUTPUT_VAL |= 0x80; | ||
41 | GPIOB_OUTPUT_EN |= 0x80; | ||
42 | |||
43 | /* charger inserted bit */ | ||
44 | GPIOE_ENABLE |= 0x20; | ||
45 | GPIOE_INPUT_VAL |= 0x20; | ||
38 | } | 46 | } |
39 | 47 | ||
40 | unsigned int power_input_status(void) | 48 | unsigned int power_input_status(void) |
41 | { | 49 | { |
42 | return POWER_INPUT_NONE; | 50 | unsigned int status = POWER_INPUT_NONE; |
51 | |||
52 | /* AC charger */ | ||
53 | if (GPIOE_INPUT_VAL & 0x20) | ||
54 | status |= POWER_INPUT_MAIN_CHARGER; | ||
55 | |||
56 | /* Do nothing with USB for now | ||
57 | if (GPIOE_INPUT_VAL & 0x4) | ||
58 | status |= POWER_INPUT_USB_CHARGER; | ||
59 | */ | ||
60 | |||
61 | return status; | ||
43 | } | 62 | } |
44 | 63 | ||
45 | void ide_power_enable(bool on) | 64 | void ide_power_enable(bool on) |
@@ -57,4 +76,8 @@ bool ide_powered(void) | |||
57 | 76 | ||
58 | void power_off(void) | 77 | void power_off(void) |
59 | { | 78 | { |
79 | /* power off bit */ | ||
80 | GPIOB_ENABLE |= 0x80; | ||
81 | GPIOB_OUTPUT_VAL &= ~0x80; | ||
82 | GPIOB_OUTPUT_EN |= 0x80; | ||
60 | } | 83 | } |
diff --git a/firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c b/firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c index c8d5584305..0bb9458fe7 100644 --- a/firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c +++ b/firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | 27 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = |
28 | { | 28 | { |
29 | 3450 | 29 | 3450 |
30 | }; | 30 | }; |
31 | 31 | ||
32 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | 32 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = |
@@ -44,7 +44,7 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | |||
44 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ | 44 | /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ |
45 | const unsigned short percent_to_volt_charge[11] = | 45 | const unsigned short percent_to_volt_charge[11] = |
46 | { | 46 | { |
47 | 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 | 47 | 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 |
48 | }; | 48 | }; |
49 | #endif /* CONFIG_CHARGING */ | 49 | #endif /* CONFIG_CHARGING */ |
50 | 50 | ||
@@ -60,5 +60,7 @@ const unsigned short percent_to_volt_charge[11] = | |||
60 | /* Returns battery voltage from ADC [millivolts] */ | 60 | /* Returns battery voltage from ADC [millivolts] */ |
61 | unsigned int battery_adc_voltage(void) | 61 | unsigned int battery_adc_voltage(void) |
62 | { | 62 | { |
63 | return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; | 63 | /* For now, assume as battery full (we need to calibrate) */ |
64 | /* return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; */ | ||
65 | return 3990; | ||
64 | } | 66 | } |
diff --git a/firmware/target/arm/wmcodec-pp.c b/firmware/target/arm/wmcodec-pp.c index 031f5c8d47..bd3d4e6579 100644 --- a/firmware/target/arm/wmcodec-pp.c +++ b/firmware/target/arm/wmcodec-pp.c | |||
@@ -32,11 +32,12 @@ | |||
32 | #include "i2s.h" | 32 | #include "i2s.h" |
33 | #include "wmcodec.h" | 33 | #include "wmcodec.h" |
34 | 34 | ||
35 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(MROBE_100) | 35 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) || \ |
36 | defined(MROBE_100) || defined(PHILIPS_HDD1630) | ||
36 | /* The H10's audio codec uses an I2C address of 0x1b */ | 37 | /* The H10's audio codec uses an I2C address of 0x1b */ |
37 | #define I2C_AUDIO_ADDRESS 0x1b | 38 | #define I2C_AUDIO_ADDRESS 0x1b |
38 | #else | 39 | #else |
39 | /* The iPod's audio codecs use an I2C address of 0x1a */ | 40 | /* The iPod's audio codecs use an I2C address of 0x1a */ |
40 | #define I2C_AUDIO_ADDRESS 0x1a | 41 | #define I2C_AUDIO_ADDRESS 0x1a |
41 | #endif | 42 | #endif |
42 | 43 | ||
@@ -100,7 +101,7 @@ void audiohw_init(void) | |||
100 | 101 | ||
101 | /* reset the I2S controller into known state */ | 102 | /* reset the I2S controller into known state */ |
102 | i2s_reset(); | 103 | i2s_reset(); |
103 | 104 | ||
104 | audiohw_preinit(); | 105 | audiohw_preinit(); |
105 | } | 106 | } |
106 | 107 | ||