summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorAndrew Ryabinin <ryabinin.a.a@gmail.com>2013-10-27 22:34:24 +0400
committerAndrew Ryabinin <ryabinin.a.a@gmail.com>2013-11-05 09:59:45 +0400
commitd602717735b09cdd39e4e8c75d69ce8c5e2d957d (patch)
treefd22483f6d11f41daeec6a4668e5007ed4481e9a /firmware
parentb48e6d0e1c7e533d3da5519a9b0d76026db14f4d (diff)
downloadrockbox-d602717735b09cdd39e4e8c75d69ce8c5e2d957d.tar.gz
rockbox-d602717735b09cdd39e4e8c75d69ce8c5e2d957d.zip
Introduce HiFi E.T. MA9C port.
The only difference between this target and HiFi E.T. MA9 is display driver (ILI9342 in MA9 and ILI9342c in MA9C) Change-Id: Icc3d2490f850902a653175360f12283f3708bbb7
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES4
-rw-r--r--firmware/export/config.h3
-rw-r--r--firmware/export/config/hifietma9c.h153
-rw-r--r--firmware/target/arm/rk27xx/backlight-rk27xx.c2
-rw-r--r--firmware/target/arm/rk27xx/debug-rk27xx.c2
-rw-r--r--firmware/target/arm/rk27xx/ma/lcd-ma.c81
-rw-r--r--firmware/target/arm/rk27xx/sd-rk27xx.c2
7 files changed, 242 insertions, 5 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 2a9ae0c266..d8b2795f59 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -705,7 +705,7 @@ target/arm/ipod/lcd-gray.c
705target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c 705target/arm/imx31/gigabeat-s/lcd-gigabeat-s.c
706#elif CONFIG_LCD == LCD_GIGABEAT || CONFIG_LCD == LCD_MINI2440 706#elif CONFIG_LCD == LCD_GIGABEAT || CONFIG_LCD == LCD_MINI2440
707target/arm/s3c2440/lcd-s3c2440.c 707target/arm/s3c2440/lcd-s3c2440.c
708#elif CONFIG_LCD == LCD_ILI9342 708#elif CONFIG_LCD == LCD_ILI9342 || CONFIG_LCD == LCD_ILI9342C
709target/arm/rk27xx/ma/lcd-ma.c 709target/arm/rk27xx/ma/lcd-ma.c
710#endif 710#endif
711 711
@@ -1745,7 +1745,7 @@ target/arm/rk27xx/hm801/powermgmt-hm801.c
1745target/arm/rk27xx/hm801/power-hm801.c 1745target/arm/rk27xx/hm801/power-hm801.c
1746#endif 1746#endif
1747 1747
1748#if defined(MA9) 1748#if defined(MA9) || defined(MA9C)
1749target/arm/rk27xx/ma/button-ma.c 1749target/arm/rk27xx/ma/button-ma.c
1750target/arm/rk27xx/ma/powermgmt-ma.c 1750target/arm/rk27xx/ma/powermgmt-ma.c
1751target/arm/rk27xx/ma/power-ma.c 1751target/arm/rk27xx/ma/power-ma.c
diff --git a/firmware/export/config.h b/firmware/export/config.h
index a5c199484b..9c6f1f73c5 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -256,6 +256,7 @@
256#define LCD_NWZE360 52 /* as used by Sony NWZ-E360 series */ 256#define LCD_NWZE360 52 /* as used by Sony NWZ-E360 series */
257#define LCD_CREATIVEZEN 55 /* as used by the Creative ZEN (X-Fi) (LMS250GF03-001(S6D0139)) */ 257#define LCD_CREATIVEZEN 55 /* as used by the Creative ZEN (X-Fi) (LMS250GF03-001(S6D0139)) */
258#define LCD_CREATIVEZENMOZAIC 56 /* as used by the Creative ZEN Mozaic (FGD0801) */ 258#define LCD_CREATIVEZENMOZAIC 56 /* as used by the Creative ZEN Mozaic (FGD0801) */
259#define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */
259 260
260/* LCD_PIXELFORMAT */ 261/* LCD_PIXELFORMAT */
261#define HORIZONTAL_PACKING 1 262#define HORIZONTAL_PACKING 1
@@ -532,6 +533,8 @@ Lyre prototype 1 */
532#include "config/creativezen.h" 533#include "config/creativezen.h"
533#elif defined(MA9) 534#elif defined(MA9)
534#include "config/hifietma9.h" 535#include "config/hifietma9.h"
536#elif defined(MA9C)
537#include "config/hifietma9c.h"
535#elif defined(SONY_NWZE370) 538#elif defined(SONY_NWZE370)
536#include "config/sonynwze370.h" 539#include "config/sonynwze370.h"
537#elif defined(SONY_NWZE360) 540#elif defined(SONY_NWZE360)
diff --git a/firmware/export/config/hifietma9c.h b/firmware/export/config/hifietma9c.h
new file mode 100644
index 0000000000..6162aa2762
--- /dev/null
+++ b/firmware/export/config/hifietma9c.h
@@ -0,0 +1,153 @@
1/*
2 * This config file is for HiFi E.T. MA9 reference design
3 */
4
5/* For Rolo and boot loader */
6#define MODEL_NUMBER 84
7
8#define MODEL_NAME "HiFi E.T. MA9C"
9
10/* define the bitmask of hardware sample rates */
11#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_48 | SAMPR_CAP_44 | \
12 SAMPR_CAP_32 | SAMPR_CAP_24 | SAMPR_CAP_22 | \
13 SAMPR_CAP_16 | SAMPR_CAP_12 | SAMPR_CAP_11 | SAMPR_CAP_8)
14
15#define HAVE_DF1704_CODEC
16
17#define CODEC_SLAVE
18/* define this if you have a bitmap LCD display */
19#define HAVE_LCD_BITMAP
20
21/* define this if you can flip your LCD */
22/* #define HAVE_LCD_FLIP */
23
24/* define this if you have a colour LCD */
25#define HAVE_LCD_COLOR
26
27/* define this if you want album art for this target */
28#define HAVE_ALBUMART
29
30/* define this to enable bitmap scaling */
31#define HAVE_BMP_SCALING
32
33/* define this to enable JPEG decoding */
34#define HAVE_JPEG
35
36/* define this if you can invert the colours on your LCD */
37/* #define HAVE_LCD_INVERT */
38
39/* define this if you have access to the quickscreen */
40#define HAVE_QUICKSCREEN
41
42/* define this if you would like tagcache to build on this target */
43#define HAVE_TAGCACHE
44
45/* define this if you have a flash memory storage */
46#define HAVE_FLASH_STORAGE
47
48#define CONFIG_STORAGE (STORAGE_SD | STORAGE_NAND)
49
50#define CONFIG_NAND NAND_RK27XX
51#define HAVE_SW_TONE_CONTROLS
52
53/* commented for now */
54/* #define HAVE_HOTSWAP */
55
56#define NUM_DRIVES 2
57#define SECTOR_SIZE 512
58
59/* for small(ish) SD cards */
60#define HAVE_FAT16SUPPORT
61
62/* LCD dimensions */
63#define LCD_WIDTH 320
64#define LCD_HEIGHT 240
65#define LCD_DEPTH 16 /* pseudo 262.144 colors */
66#define LCD_PIXELFORMAT RGB565 /* rgb565 */
67
68/* Define this if your LCD can be enabled/disabled */
69#define HAVE_LCD_ENABLE
70
71#define CONFIG_KEYPAD MA_PAD
72
73/* Define this to enable morse code input */
74#define HAVE_MORSE_INPUT
75
76/* Define this if you do software codec */
77#define CONFIG_CODEC SWCODEC
78
79#define CONFIG_LCD LCD_ILI9342C
80
81/* Define this for LCD backlight available */
82#define HAVE_BACKLIGHT
83#define HAVE_BACKLIGHT_BRIGHTNESS
84#define MIN_BRIGHTNESS_SETTING 0
85#define MAX_BRIGHTNESS_SETTING 31
86#define DEFAULT_BRIGHTNESS_SETTING 31
87#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_HW_REG
88
89/* Define this if you have a software controlled poweroff */
90#define HAVE_SW_POWEROFF
91
92/* The number of bytes reserved for loadable codecs */
93#define CODEC_SIZE 0x100000
94
95/* The number of bytes reserved for loadable plugins */
96#define PLUGIN_BUFFER_SIZE 0x80000
97
98/* TODO: Figure out real values */
99#define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity */
100#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
101#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
102#define BATTERY_CAPACITY_INC 10 /* capacity increment */
103#define BATTERY_TYPES_COUNT 1 /* only one type */
104
105#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
106
107/* Hardware controlled charging with monitoring */
108#define CONFIG_CHARGING CHARGING_MONITOR
109
110/* USB On-the-go */
111#define CONFIG_USBOTG USBOTG_RK27XX
112
113/* enable these for the experimental usb stack */
114#define HAVE_USBSTACK
115
116#define USE_ROCKBOX_USB
117#define USB_VENDOR_ID 0x071b
118#define USB_PRODUCT_ID 0x3202
119#define HAVE_BOOTLOADER_USB_MODE
120
121/* Define this if your LCD can set contrast */
122/* #define HAVE_LCD_CONTRAST */
123
124/* The exact type of CPU */
125#define CONFIG_CPU RK27XX
126
127/* I2C interface */
128#define CONFIG_I2C I2C_RK27XX
129
130/* Define this to the CPU frequency */
131#define CPU_FREQ 200000000
132
133/* define this if the hardware can be powered off while charging */
134/* #define HAVE_POWEROFF_WHILE_CHARGING */
135
136/* Offset ( in the firmware file's header ) to the file CRC */
137#define FIRMWARE_OFFSET_FILE_CRC 0
138
139/* Offset ( in the firmware file's header ) to the real data */
140#define FIRMWARE_OFFSET_FILE_DATA 8
141
142#define STORAGE_NEEDS_ALIGN
143
144/* Define this if you have adjustable CPU frequency */
145#define HAVE_ADJUSTABLE_CPU_FREQ
146
147/* Virtual LED (icon) */
148#define CONFIG_LED LED_VIRTUAL
149
150#define RKW_FORMAT
151#define BOOTFILE_EXT "rkw"
152#define BOOTFILE "rockbox." BOOTFILE_EXT
153#define BOOTDIR "/.rockbox"
diff --git a/firmware/target/arm/rk27xx/backlight-rk27xx.c b/firmware/target/arm/rk27xx/backlight-rk27xx.c
index 9ea9c9984e..8c10d7af2a 100644
--- a/firmware/target/arm/rk27xx/backlight-rk27xx.c
+++ b/firmware/target/arm/rk27xx/backlight-rk27xx.c
@@ -61,7 +61,7 @@ static const unsigned short lin_brightness[] = {
61 562, 579, 596, 616, 637, 660, 684, 711, 61 562, 579, 596, 616, 637, 660, 684, 711,
62 739, 770, 802, 837, 874, 914, 955, 1000 62 739, 770, 802, 837, 874, 914, 955, 1000
63}; 63};
64#elif defined(MA9) 64#elif defined(MA9) || defined(MA9C)
65static const unsigned short lin_brightness[] = { 65static const unsigned short lin_brightness[] = {
66 2, 4, 7, 10, 15, 21, 28, 36, 66 2, 4, 7, 10, 15, 21, 28, 36,
67 46, 58, 72, 87, 104, 124, 146, 171, 67 46, 58, 72, 87, 104, 124, 146, 171,
diff --git a/firmware/target/arm/rk27xx/debug-rk27xx.c b/firmware/target/arm/rk27xx/debug-rk27xx.c
index a73ca05c77..9f91f58f14 100644
--- a/firmware/target/arm/rk27xx/debug-rk27xx.c
+++ b/firmware/target/arm/rk27xx/debug-rk27xx.c
@@ -32,7 +32,7 @@
32 32
33#ifdef RK27_GENERIC 33#ifdef RK27_GENERIC
34#define DEBUG_CANCEL BUTTON_VOL 34#define DEBUG_CANCEL BUTTON_VOL
35#elif defined(HM60X) || defined(HM801) || defined(MA9) 35#elif defined(HM60X) || defined(HM801) || defined(MA_PAD)
36#define DEBUG_CANCEL BUTTON_LEFT 36#define DEBUG_CANCEL BUTTON_LEFT
37#endif 37#endif
38 38
diff --git a/firmware/target/arm/rk27xx/ma/lcd-ma.c b/firmware/target/arm/rk27xx/ma/lcd-ma.c
index a35f13ba3a..3fecce2d18 100644
--- a/firmware/target/arm/rk27xx/ma/lcd-ma.c
+++ b/firmware/target/arm/rk27xx/ma/lcd-ma.c
@@ -27,8 +27,88 @@
27#include "cpu.h" 27#include "cpu.h"
28#include "lcdif-rk27xx.h" 28#include "lcdif-rk27xx.h"
29 29
30#define ILI9342 0
31#define ILI9342C 1
32#define LCD_DRIVER ILI9342C
33
30static bool display_on = false; 34static bool display_on = false;
31 35
36#if (CONFIG_LCD == LCD_ILI9342C)
37void lcd_display_init(void)
38{
39 unsigned int x, y;
40
41 lcd_cmd(0xC8);
42 lcd_data(0xFF);
43 lcd_data(0x93);
44 lcd_data(0x42);
45
46 lcd_write_reg(0x36, 0xC8);
47
48 lcd_write_reg(0x3A, 0x55);
49
50 lcd_cmd(0xC0);
51 lcd_data(0x14);
52 lcd_data(0x0E);
53
54 lcd_write_reg(0xC1, 0x01);
55
56 lcd_write_reg(0xC5, 0xF4);
57
58 lcd_cmd(0xB1);
59 lcd_data(0x00);
60 lcd_data(0x1B);
61
62 lcd_write_reg(0xB4, 0x02);
63
64 lcd_cmd(0xE0);
65 lcd_data(0x00);
66 lcd_data(0x0A);
67 lcd_data(0x11);
68 lcd_data(0x08);
69 lcd_data(0x16);
70 lcd_data(0x0A);
71 lcd_data(0x3C);
72 lcd_data(0x9B);
73 lcd_data(0x4A);
74 lcd_data(0x09);
75 lcd_data(0x0E);
76 lcd_data(0x0A);
77 lcd_data(0x1C);
78 lcd_data(0x1D);
79 lcd_data(0x0F);
80
81 lcd_cmd(0xE1);
82 lcd_data(0x00);
83 lcd_data(0x23);
84 lcd_data(0x25);
85 lcd_data(0x04);
86 lcd_data(0x10);
87 lcd_data(0x07);
88 lcd_data(0x39);
89 lcd_data(0x46);
90 lcd_data(0x4A);
91 lcd_data(0x03);
92 lcd_data(0x0C);
93 lcd_data(0x0A);
94 lcd_data(0x31);
95 lcd_data(0x36);
96 lcd_data(0x0F);
97
98 /* exit sleep */
99 lcd_cmd(0x11);
100 udelay(5000);
101 lcd_cmd(0x29);
102
103 lcd_cmd(0x2C);
104 for (x = 0; x < LCD_WIDTH; x++)
105 for(y=0; y < LCD_HEIGHT; y++)
106 lcd_data(0x00);
107
108 display_on = true;
109}
110
111#elif (CONFIG_LCD == LCD_ILI9342)
32 112
33void lcd_display_init(void) 113void lcd_display_init(void)
34{ 114{
@@ -131,6 +211,7 @@ void lcd_display_init(void)
131 211
132 display_on = true; 212 display_on = true;
133} 213}
214#endif
134 215
135void lcd_enable (bool on) 216void lcd_enable (bool on)
136{ 217{
diff --git a/firmware/target/arm/rk27xx/sd-rk27xx.c b/firmware/target/arm/rk27xx/sd-rk27xx.c
index ef9845d696..39a4330d2a 100644
--- a/firmware/target/arm/rk27xx/sd-rk27xx.c
+++ b/firmware/target/arm/rk27xx/sd-rk27xx.c
@@ -132,7 +132,7 @@ static inline bool card_detect_target(void)
132 return !(GPIO_PCDR & 0x80); 132 return !(GPIO_PCDR & 0x80);
133#elif defined(HM60X) || defined(HM801) 133#elif defined(HM60X) || defined(HM801)
134 return !(GPIO_PFDR & (1<<2)); 134 return !(GPIO_PFDR & (1<<2));
135#elif defined(MA9) 135#elif defined(MA9) || defined(MA9C)
136 return (GPIO_PCDR & 0x80); 136 return (GPIO_PCDR & 0x80);
137#else 137#else
138#error "Unknown target" 138#error "Unknown target"