summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES26
-rw-r--r--firmware/drivers/synaptics-mep.c2
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/export/config/gogearhdd1630.h2
-rw-r--r--firmware/export/config/gogearhdd6330.h202
-rw-r--r--firmware/export/usb.h3
-rw-r--r--firmware/target/arm/adc-pp5020.c8
-rw-r--r--firmware/target/arm/crt0-pp-bl.S2
-rw-r--r--firmware/target/arm/i2c-pp.c4
-rw-r--r--firmware/target/arm/philips/backlight-hdd.c (renamed from firmware/target/arm/philips/hdd1630/backlight-hdd1630.c)0
-rw-r--r--firmware/target/arm/philips/backlight-target.h (renamed from firmware/target/arm/philips/hdd1630/backlight-target.h)0
-rw-r--r--firmware/target/arm/philips/fmradio_i2c-hdd.c (renamed from firmware/target/arm/philips/hdd1630/fmradio_i2c-hdd1630.c)0
-rw-r--r--firmware/target/arm/philips/hdd6330/adc-target.h35
-rw-r--r--firmware/target/arm/philips/hdd6330/button-hdd6330.c125
-rw-r--r--firmware/target/arm/philips/hdd6330/button-target.h63
-rw-r--r--firmware/target/arm/philips/hdd6330/lcd-hdd6330.c159
-rw-r--r--firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c72
-rw-r--r--firmware/target/arm/philips/power-hdd.c (renamed from firmware/target/arm/philips/hdd1630/power-hdd1630.c)0
-rw-r--r--firmware/target/arm/system-pp502x.c4
-rw-r--r--firmware/target/arm/usb-fw-pp502x.c2
20 files changed, 698 insertions, 15 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 36f4c2762c..ee1b5c4dc9 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -636,17 +636,37 @@ target/arm/ata-pp5020.c
636target/arm/wmcodec-pp.c 636target/arm/wmcodec-pp.c
637target/arm/i2s-pp.c 637target/arm/i2s-pp.c
638target/arm/adc-pp5020.c 638target/arm/adc-pp5020.c
639target/arm/philips/hdd1630/backlight-hdd1630.c 639target/arm/philips/backlight-hdd.c
640target/arm/philips/power-hdd.c
641target/arm/philips/fmradio_i2c-hdd.c
640target/arm/philips/hdd1630/button-hdd1630.c 642target/arm/philips/hdd1630/button-hdd1630.c
641target/arm/philips/hdd1630/fmradio_i2c-hdd1630.c
642target/arm/philips/hdd1630/lcd-hdd1630.c 643target/arm/philips/hdd1630/lcd-hdd1630.c
643target/arm/philips/hdd1630/lcd-as-hdd1630.S 644target/arm/philips/hdd1630/lcd-as-hdd1630.S
644target/arm/philips/hdd1630/power-hdd1630.c
645target/arm/philips/hdd1630/powermgmt-hdd1630.c 645target/arm/philips/hdd1630/powermgmt-hdd1630.c
646target/arm/usb-fw-pp502x.c 646target/arm/usb-fw-pp502x.c
647#endif /* SIMULATOR */ 647#endif /* SIMULATOR */
648#endif /* PHILIPS_HDD1630 */ 648#endif /* PHILIPS_HDD1630 */
649 649
650#ifdef PHILIPS_HDD6330
651#ifndef SIMULATOR
652#ifndef BOOTLOADER
653drivers/synaptics-mep.c
654#endif /* BOOTLOADER */
655target/arm/ata-as-arm.S
656target/arm/ata-pp5020.c
657target/arm/wmcodec-pp.c
658target/arm/i2s-pp.c
659target/arm/adc-pp5020.c
660target/arm/philips/backlight-hdd.c
661target/arm/philips/power-hdd.c
662target/arm/philips/fmradio_i2c-hdd.c
663target/arm/philips/hdd6330/button-hdd6330.c
664target/arm/philips/hdd6330/lcd-hdd6330.c
665target/arm/philips/hdd6330/powermgmt-hdd6330.c
666target/arm/usb-fw-pp502x.c
667#endif /* SIMULATOR */
668#endif /* PHILIPS_HDD6330 */
669
650#ifdef IAUDIO_X5 670#ifdef IAUDIO_X5
651#ifndef SIMULATOR 671#ifndef SIMULATOR
652target/coldfire/ata-as-coldfire.S 672target/coldfire/ata-as-coldfire.S
diff --git a/firmware/drivers/synaptics-mep.c b/firmware/drivers/synaptics-mep.c
index a18f9e7fd6..937a5f64b1 100644
--- a/firmware/drivers/synaptics-mep.c
+++ b/firmware/drivers/synaptics-mep.c
@@ -53,7 +53,7 @@
53 GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x4) 53 GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x4)
54#define DATA_CL GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_EN, 0x4) 54#define DATA_CL GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_EN, 0x4)
55 55
56#elif defined(PHILIPS_HDD1630) 56#elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)
57#define INT_ENABLE GPIO_CLEAR_BITWISE(GPIOA_INT_LEV, 0x20);\ 57#define INT_ENABLE GPIO_CLEAR_BITWISE(GPIOA_INT_LEV, 0x20);\
58 GPIO_SET_BITWISE(GPIOA_INT_EN, 0x20) 58 GPIO_SET_BITWISE(GPIOA_INT_EN, 0x20)
59#define INT_DISABLE GPIO_CLEAR_BITWISE(GPIOA_INT_EN, 0x20);\ 59#define INT_DISABLE GPIO_CLEAR_BITWISE(GPIOA_INT_EN, 0x20);\
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 114952e211..3997ce4b0c 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -114,6 +114,7 @@
114#define ONDAVX777_PAD 39 114#define ONDAVX777_PAD 39
115#define SAMSUNG_YPS3_PAD 40 115#define SAMSUNG_YPS3_PAD 40
116#define MINI2440_PAD 41 116#define MINI2440_PAD 41
117#define PHILIPS_HDD6330_PAD 42
117 118
118/* CONFIG_REMOTE_KEYPAD */ 119/* CONFIG_REMOTE_KEYPAD */
119#define H100_REMOTE 1 120#define H100_REMOTE 1
@@ -194,6 +195,7 @@
194#define LCD_VIEW 35 /* as used by the Sansa View */ 195#define LCD_VIEW 35 /* as used by the Sansa View */
195#define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */ 196#define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */
196#define LCD_MINI2440 37 /* as used by the Mini2440 */ 197#define LCD_MINI2440 37 /* as used by the Mini2440 */
198#define LCD_HDD6330 38 /* as used by the Philips HDD6330 */
197 199
198/* LCD_PIXELFORMAT */ 200/* LCD_PIXELFORMAT */
199#define HORIZONTAL_PACKING 1 201#define HORIZONTAL_PACKING 1
@@ -359,6 +361,8 @@ Lyre prototype 1 */
359#include "config/gogearsa9200.h" 361#include "config/gogearsa9200.h"
360#elif defined(PHILIPS_HDD1630) 362#elif defined(PHILIPS_HDD1630)
361#include "config/gogearhdd1630.h" 363#include "config/gogearhdd1630.h"
364#elif defined(PHILIPS_HDD6330)
365#include "config/gogearhdd6330.h"
362#elif defined(SANSA_C100) 366#elif defined(SANSA_C100)
363#include "config/sansac100.h" 367#include "config/sansac100.h"
364#elif defined(MEIZU_M6SL) 368#elif defined(MEIZU_M6SL)
diff --git a/firmware/export/config/gogearhdd1630.h b/firmware/export/config/gogearhdd1630.h
index c9a3b035ca..912ba427c0 100644
--- a/firmware/export/config/gogearhdd1630.h
+++ b/firmware/export/config/gogearhdd1630.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * This config file is for the Philips GoGear HDD16x0/HDD63x0 2 * This config file is for the Philips GoGear HDD16x0/HDD18x0
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 */
diff --git a/firmware/export/config/gogearhdd6330.h b/firmware/export/config/gogearhdd6330.h
new file mode 100644
index 0000000000..26da200ce1
--- /dev/null
+++ b/firmware/export/config/gogearhdd6330.h
@@ -0,0 +1,202 @@
1/*
2 * This config file is for the Philips GoGear HDD63x0
3 */
4
5#define TARGET_TREE /* this target is using the target tree system */
6
7/* For Rolo and boot loader */
8#define MODEL_NUMBER 65
9#define MODEL_NAME "Philips GoGear HDD63x0"
10
11/* define this if you use an ATA controller */
12#define CONFIG_STORAGE STORAGE_ATA
13
14/* define this if you have recording possibility */
15#define HAVE_RECORDING
16
17/* Define bitmask of input sources - recordable bitmask can be defined
18 explicitly if different */
19#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
20
21/* define the bitmask of hardware sample rates */
22#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
23 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
24
25/* define the bitmask of recording sample rates */
26#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
27 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
28
29/* define this if you have a bitmap LCD display */
30#define HAVE_LCD_BITMAP
31
32/* define this if you have a colour LCD */
33#define HAVE_LCD_COLOR
34
35/* define this if you want album art for this target */
36#define HAVE_ALBUMART
37
38/* define this to enable bitmap scaling */
39#define HAVE_BMP_SCALING
40
41/* define this to enable JPEG decoding */
42#define HAVE_JPEG
43
44/* define this if you have access to the quickscreen */
45#define HAVE_QUICKSCREEN
46
47/* define this if you have access to the pitchscreen */
48#define HAVE_PITCHSCREEN
49
50/* define this if you would like tagcache to build on this target */
51#define HAVE_TAGCACHE
52
53/* LCD dimensions */
54#define LCD_WIDTH 220
55#define LCD_HEIGHT 176
56#define LCD_DEPTH 16 /* 65536 colours */
57#define LCD_PIXELFORMAT RGB565 /* rgb565 byte-swapped */
58
59#ifndef BOOTLOADER
60/* Define this if your LCD can be enabled/disabled */
61/* #define HAVE_LCD_ENABLE */
62
63/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
64 * should be defined as well.
65 * We can currently put the lcd to sleep but it won't wake up properly */
66/* #define HAVE_LCD_SLEEP */
67/* #define HAVE_LCD_SLEEP_SETTING */
68#endif
69
70/* define this if you can flip your LCD */
71/* #define HAVE_LCD_FLIP */
72
73/* define this if you can invert the colours on your LCD */
74/* #define HAVE_LCD_INVERT */
75
76/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */
77
78#define CONFIG_KEYPAD PHILIPS_HDD6330_PAD
79
80/* Define this to enable morse code input */
81#define HAVE_MORSE_INPUT
82
83/* define this if the target has volume keys which can be used in the lists */
84#define HAVE_VOLUME_IN_LIST
85
86/* Define this if you do software codec */
87#define CONFIG_CODEC SWCODEC
88
89/* define this if you have a real-time clock. The HDD16x0 has a PCF8563 RTC,
90 but it's register compatible with the E8564. */
91#ifndef BOOTLOADER
92#define CONFIG_RTC RTC_E8564
93#define HAVE_RTC_ALARM
94#endif
95
96/* Define this if you have a software controlled poweroff */
97#define HAVE_SW_POWEROFF
98
99/* The number of bytes reserved for loadable codecs */
100#define CODEC_SIZE 0x100000
101
102/* The number of bytes reserved for loadable plugins */
103#define PLUGIN_BUFFER_SIZE 0x80000
104
105/* Define this if you have the WM8731 audio codec */
106#define HAVE_WM8731
107
108/* WM8731 has no tone controls, so we use the software ones */
109#define HAVE_SW_TONE_CONTROLS
110
111/* TODO: #define AB_REPEAT_ENABLE 1 */
112
113/* FM Tuner */
114#define CONFIG_TUNER TEA5767
115#define CONFIG_TUNER_XTAL 32768
116
117/* define this if you have a disk storage, i.e. something
118 that needs spinups and can cause skips when shaked */
119#define HAVE_DISK_STORAGE
120
121/* Define this for LCD backlight available */
122#define HAVE_BACKLIGHT
123#define HAVE_BACKLIGHT_BRIGHTNESS
124/* #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING */
125
126/* Main LCD backlight brightness range and defaults */
127#define MIN_BRIGHTNESS_SETTING 1
128#define MAX_BRIGHTNESS_SETTING 16
129#define DEFAULT_BRIGHTNESS_SETTING 13 /* match OF brightness */
130
131/* define this if you have a light associated with the buttons */
132#define HAVE_BUTTON_LIGHT
133#define HAVE_BUTTONLIGHT_BRIGHTNESS
134
135#define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */
136#define BATTERY_CAPACITY_MIN 630 /* min. capacity selectable */
137#define BATTERY_CAPACITY_MAX 630 /* max. capacity selectable */
138#define BATTERY_CAPACITY_INC 0 /* capacity increment */
139#define BATTERY_TYPES_COUNT 1 /* only one type */
140
141/* Hardware controlled charging */
142#define CONFIG_CHARGING CHARGING_SIMPLE
143
144/* define this if the unit can be powered or charged via USB */
145#define HAVE_USB_POWER
146
147/* Define this if you have a PortalPlayer PP5020 */
148#define CONFIG_CPU PP5022
149
150/* Define this if you want to use the PP5020 i2c interface */
151#define CONFIG_I2C I2C_PP5020
152
153/* define this if the hardware can be powered off while charging */
154#define HAVE_POWEROFF_WHILE_CHARGING
155
156/* The start address index for ROM builds */
157#define ROM_START 0x00000000
158
159/* The size of the flash ROM */
160#define FLASH_SIZE 0x100000
161
162/* Define this to the CPU frequency */
163#define CPU_FREQ 75000000
164
165/* Type of LCD */
166#define CONFIG_LCD LCD_HDD6330
167
168/* Define this if your LCD can set contrast */
169/* #define HAVE_LCD_CONTRAST */
170
171#define MIN_CONTRAST_SETTING 0
172#define MAX_CONTRAST_SETTING 127
173#define DEFAULT_CONTRAST_SETTING 63 /* Match boot contrast */
174
175/* We're able to shut off power to the HDD */
176#define HAVE_ATA_POWER_OFF
177
178/* Offset ( in the firmware file's header ) to the file CRC and data. These are
179 only used when loading the old format rockbox.e200 file */
180#define FIRMWARE_OFFSET_FILE_CRC 0x0
181#define FIRMWARE_OFFSET_FILE_DATA 0x8
182
183/* USB On-the-go */
184#define CONFIG_USBOTG USBOTG_ARC
185
186/* enable these for the experimental usb stack */
187#define HAVE_USBSTACK
188#define USE_ROCKBOX_USB
189#define USB_VENDOR_ID 0x0471
190#define USB_PRODUCT_ID 0x014C
191#define HAVE_USB_HID_MOUSE
192
193/* Define this if you have adjustable CPU frequency */
194#define HAVE_ADJUSTABLE_CPU_FREQ
195
196#define MI4_FORMAT
197#define BOOTFILE_EXT "mi4"
198#define BOOTFILE "rockbox." BOOTFILE_EXT
199#define BOOTDIR "/.rockbox"
200
201#define ICODE_ATTR_TREMOR_NOT_MDCT
202
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index 42c0a93016..59c0004416 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -86,6 +86,9 @@ enum {
86#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD 86#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
87#define USBPOWER_BUTTON BUTTON_PLAYLIST 87#define USBPOWER_BUTTON BUTTON_PLAYLIST
88#define USBPOWER_BTN_IGNORE BUTTON_POWER 88#define USBPOWER_BTN_IGNORE BUTTON_POWER
89#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD
90#define USBPOWER_BUTTON BUTTON_SELECT
91#define USBPOWER_BTN_IGNORE BUTTON_POWER
89#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD 92#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
90#define USBPOWER_BUTTON BUTTON_RIGHT 93#define USBPOWER_BUTTON BUTTON_RIGHT
91#define USBPOWER_BTN_IGNORE BUTTON_LEFT 94#define USBPOWER_BTN_IGNORE BUTTON_LEFT
diff --git a/firmware/target/arm/adc-pp5020.c b/firmware/target/arm/adc-pp5020.c
index 851e907246..d4b4ff5b02 100644
--- a/firmware/target/arm/adc-pp5020.c
+++ b/firmware/target/arm/adc-pp5020.c
@@ -59,7 +59,7 @@ unsigned short adc_scan(int channel)
59 59
60 adcdata[channel] = (adc_data_1<<2 | adc_data_2); 60 adcdata[channel] = (adc_data_1<<2 | adc_data_2);
61 61
62#if !defined(PHILIPS_HDD1630) 62#if !(defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330))
63 /* ADC values read low if PLL is enabled */ 63 /* ADC values read low if PLL is enabled */
64 if(PLL_CONTROL & 0x80000000){ 64 if(PLL_CONTROL & 0x80000000){
65 adcdata[channel] += 0x14; 65 adcdata[channel] += 0x14;
@@ -94,7 +94,7 @@ static void adc_tick(void)
94/* Figured out from how the OF does things */ 94/* Figured out from how the OF does things */
95void adc_init(void) 95void adc_init(void)
96{ 96{
97#if defined(PHILIPS_HDD1630) 97#if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)
98 ADC_INIT = 0; 98 ADC_INIT = 0;
99#else 99#else
100 ADC_INIT |= 1; 100 ADC_INIT |= 1;
@@ -119,7 +119,7 @@ void adc_init(void)
119 ADC_ADDR = 0; 119 ADC_ADDR = 0;
120 ADC_ADDR |= 0x40; 120 ADC_ADDR |= 0x40;
121 121
122#if !defined(PHILIPS_HDD1630) 122#if !(defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330))
123 ADC_ADDR |= 0x20000000; 123 ADC_ADDR |= 0x20000000;
124 udelay(100); 124 udelay(100);
125 125
@@ -155,7 +155,7 @@ void adc_init(void)
155 ADC_STATUS |= 0x20000000; 155 ADC_STATUS |= 0x20000000;
156#endif 156#endif
157 157
158#if defined(PHILIPS_HDD1630) 158#if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)
159 ADC_INIT |= 0x80000000; 159 ADC_INIT |= 0x80000000;
160 udelay(100); 160 udelay(100);
161 ADC_INIT = 0; 161 ADC_INIT = 0;
diff --git a/firmware/target/arm/crt0-pp-bl.S b/firmware/target/arm/crt0-pp-bl.S
index 1d2909e7f4..79235a6371 100644
--- a/firmware/target/arm/crt0-pp-bl.S
+++ b/firmware/target/arm/crt0-pp-bl.S
@@ -156,7 +156,7 @@ cpu:
156 mov r1, #WAKE 156 mov r1, #WAKE
157 str r1, [r0] 157 str r1, [r0]
158 158
159#if defined(SANSA_C200) || defined(PHILIPS_HDD1630) 159#if defined(SANSA_C200) || defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)
160 /* Magic for loading the c200 OF */ 160 /* Magic for loading the c200 OF */
161 ldr r0, =0xb00d10ad 161 ldr r0, =0xb00d10ad
162 mov r1, #0x700 162 mov r1, #0x700
diff --git a/firmware/target/arm/i2c-pp.c b/firmware/target/arm/i2c-pp.c
index 60497b04b9..9b92e3b8f1 100644
--- a/firmware/target/arm/i2c-pp.c
+++ b/firmware/target/arm/i2c-pp.c
@@ -269,8 +269,8 @@ void i2c_init(void)
269 269
270#if CONFIG_I2C == I2C_PP5020 270#if CONFIG_I2C == I2C_PP5020
271 outl(0x0, 0x600060a4); 271 outl(0x0, 0x600060a4);
272#if defined(PHILIPS_HDD1630) || defined(SAMSUNG_YH820) || \ 272#if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) || \
273 defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) 273 defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925)
274 outl(inl(0x600060a4) | 0x20, 0x600060a4); 274 outl(inl(0x600060a4) | 0x20, 0x600060a4);
275 outl(inl(0x7000c020) | 0x3, 0x7000c020); 275 outl(inl(0x7000c020) | 0x3, 0x7000c020);
276 outl(0x55, 0x7000c02c); 276 outl(0x55, 0x7000c02c);
diff --git a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c b/firmware/target/arm/philips/backlight-hdd.c
index cc8f04dda9..cc8f04dda9 100644
--- a/firmware/target/arm/philips/hdd1630/backlight-hdd1630.c
+++ b/firmware/target/arm/philips/backlight-hdd.c
diff --git a/firmware/target/arm/philips/hdd1630/backlight-target.h b/firmware/target/arm/philips/backlight-target.h
index c7aca54a23..c7aca54a23 100644
--- a/firmware/target/arm/philips/hdd1630/backlight-target.h
+++ b/firmware/target/arm/philips/backlight-target.h
diff --git a/firmware/target/arm/philips/hdd1630/fmradio_i2c-hdd1630.c b/firmware/target/arm/philips/fmradio_i2c-hdd.c
index 98fe5f64ab..98fe5f64ab 100644
--- a/firmware/target/arm/philips/hdd1630/fmradio_i2c-hdd1630.c
+++ b/firmware/target/arm/philips/fmradio_i2c-hdd.c
diff --git a/firmware/target/arm/philips/hdd6330/adc-target.h b/firmware/target/arm/philips/hdd6330/adc-target.h
new file mode 100644
index 0000000000..bf97081e35
--- /dev/null
+++ b/firmware/target/arm/philips/hdd6330/adc-target.h
@@ -0,0 +1,35 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#define NUM_ADC_CHANNELS 2
25
26#define ADC_BATTERY 0
27#define ADC_UNKNOWN_1 1
28#define ADC_UNKNOWN_2 2
29#define ADC_UNKNOWN_3 3
30#define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */
31
32/* Force a scan now */
33unsigned short adc_scan(int channel);
34
35#endif
diff --git a/firmware/target/arm/philips/hdd6330/button-hdd6330.c b/firmware/target/arm/philips/hdd6330/button-hdd6330.c
new file mode 100644
index 0000000000..ab06c0cf1a
--- /dev/null
+++ b/firmware/target/arm/philips/hdd6330/button-hdd6330.c
@@ -0,0 +1,125 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Mark Arigo
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "system.h"
23#include "button.h"
24#include "backlight.h"
25#include "synaptics-mep.h"
26
27/*#define LOGF_ENABLE*/
28#include "logf.h"
29
30static int int_btn = BUTTON_NONE;
31
32/*
33 * Generate a click sound from the player (not in headphones yet)
34 * TODO: integrate this with the "key click" option
35 */
36void button_click(void)
37{
38 GPO32_ENABLE |= 0x2000;
39 GPO32_VAL |= 0x2000;
40 udelay(1000);
41 GPO32_VAL &= ~0x2000;
42}
43
44#ifndef BOOTLOADER
45void button_init_device(void)
46{
47 /* The touchpad is powered on and initialized in power-hdd1630.c
48 since it needs to be ready for both buttons and button lights. */
49}
50
51/*
52 * Button interrupt handler
53 */
54void button_int(void)
55{
56 char data[4];
57 int val;
58
59 int_btn = BUTTON_NONE;
60
61 val = touchpad_read_device(data, 4);
62
63 if (val == MEP_BUTTON_HEADER)
64 {
65 /* Buttons packet */
66 if (data[1] & 0x1)
67 int_btn |= BUTTON_LEFT;
68 if (data[1] & 0x2)
69 int_btn |= BUTTON_RIGHT;
70 }
71 else if (val == MEP_ABSOLUTE_HEADER)
72 {
73 /* Absolute packet - the finger is on the vertical strip.
74 Position ranges from 1-4095, with 1 at the bottom. */
75 val = ((data[1] >> 4) << 8) | data[2]; /* position */
76
77 if ((val > 0) && (val <= 1365))
78 int_btn |= BUTTON_DOWN;
79 else if ((val > 1365) && (val <= 2730))
80 int_btn |= BUTTON_SELECT;
81 else if ((val > 2730) && (val <= 4095))
82 int_btn |= BUTTON_UP;
83 }
84}
85#else
86void button_init_device(void){}
87#endif /* bootloader */
88
89bool button_hold(void)
90{
91 return !(GPIOJ_INPUT_VAL & 0x8);
92}
93
94/*
95 * Get button pressed from hardware
96 */
97int button_read_device(void)
98{
99 static int btn_old = BUTTON_NONE;
100 int btn = int_btn;
101
102 /* Hold */
103 if(button_hold())
104 return BUTTON_NONE;
105
106 /* Device buttons */
107 if (!(GPIOA_INPUT_VAL & 0x01)) btn |= BUTTON_MENU;
108 if (!(GPIOA_INPUT_VAL & 0x02)) btn |= BUTTON_VOL_UP;
109 if (!(GPIOA_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN;
110 if (!(GPIOA_INPUT_VAL & 0x08)) btn |= BUTTON_VIEW;
111 if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_PLAYLIST;
112 if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER;
113
114 if ((btn != btn_old) && (btn != BUTTON_NONE))
115 button_click();
116
117 btn_old = btn;
118
119 return btn;
120}
121
122bool headphones_inserted(void)
123{
124 return (GPIOE_INPUT_VAL & 0x80) ? true : false;
125}
diff --git a/firmware/target/arm/philips/hdd6330/button-target.h b/firmware/target/arm/philips/hdd6330/button-target.h
new file mode 100644
index 0000000000..b7fc21aca2
--- /dev/null
+++ b/firmware/target/arm/philips/hdd6330/button-target.h
@@ -0,0 +1,63 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Mark Arigo
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25#include <stdbool.h>
26#include "config.h"
27
28#define MEP_BUTTON_HEADER 0x19
29#define MEP_BUTTON_ID 0x9
30#define MEP_ABSOLUTE_HEADER 0x0b
31
32#define HAS_BUTTON_HOLD
33
34bool button_hold(void);
35void button_init_device(void);
36int button_read_device(void);
37
38#ifndef BOOTLOADER
39void button_int(void);
40#endif
41
42/* Main unit's buttons */
43#define BUTTON_POWER 0x00000001
44#define BUTTON_PLAYLIST 0x00000002
45#define BUTTON_MENU 0x00000004
46#define BUTTON_VIEW 0x00000008
47#define BUTTON_VOL_UP 0x00000010
48#define BUTTON_VOL_DOWN 0x00000020
49#define BUTTON_SELECT 0x00000040
50#define BUTTON_LEFT 0x00000080
51#define BUTTON_RIGHT 0x00000100
52#define BUTTON_UP 0x00000200
53#define BUTTON_DOWN 0x00000400
54
55#define BUTTON_MAIN 0x00000fff
56
57/* No Remote control */
58#define BUTTON_REMOTE 0
59
60#define POWEROFF_BUTTON BUTTON_POWER
61#define POWEROFF_COUNT 10
62
63#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
new file mode 100644
index 0000000000..3d9cb036f1
--- /dev/null
+++ b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
@@ -0,0 +1,159 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2009 by Mark Arigo
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23#include "lcd.h"
24#include "kernel.h"
25#include "system.h"
26
27/* Display status */
28static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
29
30/* wait for LCD */
31static inline void lcd_wait_write(void)
32{
33 int i = 0;
34 while (LCD2_PORT & LCD2_BUSY_MASK)
35 {
36 if (i < 2000)
37 i++;
38 else
39 LCD2_PORT &= ~LCD2_BUSY_MASK;
40 }
41}
42
43/* send LCD data */
44static void lcd_send_data(unsigned data)
45{
46 lcd_wait_write();
47 LCD2_PORT = LCD2_DATA_MASK | (data & 0xff);
48}
49
50/* send LCD command */
51static void lcd_send_cmd(unsigned cmd)
52{
53 lcd_wait_write();
54 LCD2_PORT = LCD2_CMD_MASK | (cmd & 0xff);
55 lcd_wait_write();
56}
57
58static inline void lcd_send_pixel(unsigned pixel)
59{
60 lcd_send_data(pixel >> 8);
61 lcd_send_data(pixel);
62}
63
64void lcd_init_device(void)
65{
66 /* init handled by the OF bootloader */
67}
68
69/*** hardware configuration ***/
70int lcd_default_contrast(void)
71{
72 return DEFAULT_CONTRAST_SETTING;
73}
74
75void lcd_set_contrast(int val)
76{
77 (void)val;
78}
79
80void lcd_set_invert_display(bool yesno)
81{
82 (void)yesno;
83}
84
85/* turn the display upside down (call lcd_update() afterwards) */
86void lcd_set_flip(bool yesno)
87{
88 (void)yesno;
89}
90
91void lcd_yuv_set_options(unsigned options)
92{
93 lcd_yuv_options = options;
94}
95
96/* Performance function to blit a YUV bitmap directly to the LCD */
97void lcd_blit_yuv(unsigned char * const src[3],
98 int src_x, int src_y, int stride,
99 int x, int y, int width, int height)
100{
101 (void)src;
102 (void)src_x;
103 (void)src_y;
104 (void)stride;
105 (void)x;
106 (void)y;
107 (void)width;
108 (void)height;
109}
110
111/* Update the display.
112 This must be called after all other LCD functions that change the display. */
113void lcd_update(void)
114{
115 lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
116}
117
118/* Update a fraction of the display. */
119void lcd_update_rect(int x, int y, int width, int height)
120{
121 const fb_data *addr;
122
123 if (x + width >= LCD_WIDTH)
124 width = LCD_WIDTH - x;
125 if (y + height >= LCD_HEIGHT)
126 height = LCD_HEIGHT - y;
127
128 if ((width <= 0) || (height <= 0))
129 return; /* Nothing left to do. */
130
131 addr = &lcd_framebuffer[y][x];
132
133 lcd_send_cmd(0x01);
134 lcd_send_data(0x48);
135
136 lcd_send_cmd(0x05);
137 lcd_send_data(0x0f);
138
139 lcd_send_cmd(0x08);
140 lcd_send_data(y);
141
142 lcd_send_cmd(0x09);
143 lcd_send_data(y + height - 1);
144
145 lcd_send_cmd(0x0a);
146 lcd_send_data(x + 16);
147
148 lcd_send_cmd(0x0b);
149 lcd_send_data(x + width - 1 + 16);
150
151 lcd_send_cmd(0x06);
152 do {
153 int w = width;
154 do {
155 lcd_send_pixel(*addr++);
156 } while (--w > 0);
157 addr += LCD_WIDTH - width;
158 } while (--height > 0);
159}
diff --git a/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c b/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c
new file mode 100644
index 0000000000..33bbb6af48
--- /dev/null
+++ b/firmware/target/arm/philips/hdd6330/powermgmt-hdd6330.c
@@ -0,0 +1,72 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese
11 * Revisions copyright (C) 2005 by Gerald Van Baren
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "adc.h"
25#include "powermgmt.h"
26
27#define SMLAL(lo, hi, x, y) \
28 asm volatile ("smlal %0, %1, %2, %3" \
29 : "+r" (lo), "+r" (hi) \
30 : "%r" (x), "r" (y))
31
32const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
33{
34 3550
35};
36
37const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
38{
39 3500
40};
41
42/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
43const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
44{
45 { 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 },
46};
47
48#if CONFIG_CHARGING
49/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
50const unsigned short percent_to_volt_charge[11] =
51{
52 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990
53};
54#endif /* CONFIG_CHARGING */
55
56#define BATTERY_SCALE_FACTOR 4200
57/* full-scale ADC readout (2^10) in millivolt */
58
59/* Returns battery voltage from ADC [millivolts] */
60unsigned int battery_adc_voltage(void)
61{
62 /* return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; */
63
64 /* This may be overly complicated (pulled from the OF) */
65 int lo = 0;
66 int val = adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR;
67
68 SMLAL(lo, val, 0x8a42f871, val);
69 val>>= 9;
70 val -= (val >> 31);
71 return val;
72}
diff --git a/firmware/target/arm/philips/hdd1630/power-hdd1630.c b/firmware/target/arm/philips/power-hdd.c
index c348567529..c348567529 100644
--- a/firmware/target/arm/philips/hdd1630/power-hdd1630.c
+++ b/firmware/target/arm/philips/power-hdd.c
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c
index 61d4d7cb59..e2604e7633 100644
--- a/firmware/target/arm/system-pp502x.c
+++ b/firmware/target/arm/system-pp502x.c
@@ -143,7 +143,7 @@ void __attribute__((interrupt("IRQ"))) irq_handler(void)
143 usb_insert_int(); 143 usb_insert_int();
144 } 144 }
145/* end PHILIPS_SA9200 */ 145/* end PHILIPS_SA9200 */
146#elif defined(PHILIPS_HDD1630) 146#elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)
147 else if (CPU_HI_INT_STAT & GPIO0_MASK) { 147 else if (CPU_HI_INT_STAT & GPIO0_MASK) {
148 if (GPIOA_INT_STAT & 0x20) 148 if (GPIOA_INT_STAT & 0x20)
149 button_int(); 149 button_int();
@@ -152,7 +152,7 @@ void __attribute__((interrupt("IRQ"))) irq_handler(void)
152 if (GPIOE_INT_STAT & 0x04) 152 if (GPIOE_INT_STAT & 0x04)
153 usb_insert_int(); 153 usb_insert_int();
154 } 154 }
155/* end PHILIPS_HDD1630 */ 155/* end PHILIPS_HDD1630 || PHILIPS_HDD6330 */
156#elif defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) 156#elif defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925)
157 else if (CPU_HI_INT_STAT & GPIO0_MASK) { 157 else if (CPU_HI_INT_STAT & GPIO0_MASK) {
158 if (GPIOD_INT_STAT & 0x10) 158 if (GPIOD_INT_STAT & 0x10)
diff --git a/firmware/target/arm/usb-fw-pp502x.c b/firmware/target/arm/usb-fw-pp502x.c
index e234e61031..bc15dc208d 100644
--- a/firmware/target/arm/usb-fw-pp502x.c
+++ b/firmware/target/arm/usb-fw-pp502x.c
@@ -70,7 +70,7 @@
70#define USB_GPIO_MASK 0x80 70#define USB_GPIO_MASK 0x80
71#define USB_GPIO_VAL 0x00 71#define USB_GPIO_VAL 0x00
72 72
73#elif defined(PHILIPS_HDD1630) 73#elif defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)
74 /* GPIO E bit 2 is usb detect */ 74 /* GPIO E bit 2 is usb detect */
75#define USB_GPIO GPIOE 75#define USB_GPIO GPIOE
76#define USB_GPIO_MASK 0x04 76#define USB_GPIO_MASK 0x04