diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-01-05 15:20:41 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-01-21 18:52:28 +0100 |
commit | 69d0dae55bf3da2f356dbd03dba299c708133902 (patch) | |
tree | ff60084c40831c6f8f7b8806d54fe570c2d8955b | |
parent | b3abcb807b7f6202158a47668af7f2505b6dd25e (diff) | |
download | rockbox-69d0dae55bf3da2f356dbd03dba299c708133902.tar.gz rockbox-69d0dae55bf3da2f356dbd03dba299c708133902.zip |
Initial commit for the ZEN X-Fi Style
Change-Id: Ib25a357a7bafd2ef25f273cadff70fafbd8d4661
-rw-r--r-- | firmware/SOURCES | 6 | ||||
-rw-r--r-- | firmware/export/config.h | 5 | ||||
-rw-r--r-- | firmware/export/config/creativezenxfistyle.h | 200 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/backlight-zen.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/button-target.h | 8 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/button-zen.c | 46 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c | 311 | ||||
-rw-r--r-- | firmware/target/arm/imx233/sdmmc-imx233.c | 7 | ||||
-rw-r--r-- | rbutil/mkimxboot/dualboot.c | 11 | ||||
-rw-r--r-- | rbutil/mkimxboot/dualboot.h | 1 | ||||
-rw-r--r-- | rbutil/mkimxboot/dualboot/Makefile | 3 | ||||
-rw-r--r-- | rbutil/mkimxboot/dualboot/dualboot.c | 14 | ||||
-rw-r--r-- | rbutil/mkimxboot/mkimxboot.c | 6 | ||||
-rwxr-xr-x | tools/configure | 79 | ||||
-rw-r--r-- | tools/scramble.c | 4 |
15 files changed, 665 insertions, 44 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 4e8567cf7e..15f42a4011 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -1165,8 +1165,8 @@ target/arm/tms320dm320/creative-zvm/usb-creativezvm.c | |||
1165 | #endif /* CREATIVE_ZVx */ | 1165 | #endif /* CREATIVE_ZVx */ |
1166 | 1166 | ||
1167 | #if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) \ | 1167 | #if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) \ |
1168 | || defined(CREATIVE_ZENV) | 1168 | || defined(CREATIVE_ZENV) || defined(CREATIVE_ZENXFISTYLE) |
1169 | #ifndef BOOTLOADER | 1169 | #ifndef BOOTLOADER |
1170 | target/arm/imx233/fmradio-imx233.c | 1170 | target/arm/imx233/fmradio-imx233.c |
1171 | #endif | 1171 | #endif |
1172 | target/arm/imx233/creative-zen/backlight-zen.c | 1172 | target/arm/imx233/creative-zen/backlight-zen.c |
@@ -1176,6 +1176,8 @@ target/arm/imx233/creative-zen/lcd-zen.c | |||
1176 | target/arm/imx233/creative-zen/lcd-zenmozaic.c | 1176 | target/arm/imx233/creative-zen/lcd-zenmozaic.c |
1177 | # elif defined(CREATIVE_ZENV) | 1177 | # elif defined(CREATIVE_ZENV) |
1178 | target/arm/imx233/creative-zen/lcd-zenv.c | 1178 | target/arm/imx233/creative-zen/lcd-zenv.c |
1179 | # elif defined(CREATIVE_ZENXFISTYLE) | ||
1180 | target/arm/imx233/creative-zen/lcd-zenxfistyle.c | ||
1179 | #endif | 1181 | #endif |
1180 | target/arm/imx233/creative-zen/button-zen.c | 1182 | target/arm/imx233/creative-zen/button-zen.c |
1181 | target/arm/imx233/creative-zen/debug-zen.c | 1183 | target/arm/imx233/creative-zen/debug-zen.c |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 89e0036947..b72aa33fa9 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -259,9 +259,10 @@ | |||
259 | #define LCD_CREATIVEZEN 55 /* as used by the Creative ZEN (X-Fi) (LMS250GF03-001(S6D0139)) */ | 259 | #define LCD_CREATIVEZEN 55 /* as used by the Creative ZEN (X-Fi) (LMS250GF03-001(S6D0139)) */ |
260 | #define LCD_CREATIVEZENMOZAIC 56 /* as used by the Creative ZEN Mozaic (FGD0801) */ | 260 | #define LCD_CREATIVEZENMOZAIC 56 /* as used by the Creative ZEN Mozaic (FGD0801) */ |
261 | #define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */ | 261 | #define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */ |
262 | #define LCD_CREATIVEZENV 58 /* as used by the Creativr Zen V (Plus) */ | 262 | #define LCD_CREATIVEZENV 58 /* as used by the Creative Zen V (Plus) */ |
263 | #define LCD_SAMSUNGYPZ5 59 /* as used by Samsung YP-Z5 */ | 263 | #define LCD_SAMSUNGYPZ5 59 /* as used by Samsung YP-Z5 */ |
264 | #define LCD_IHIFI 60 /* as used by IHIFI 760/960 */ | 264 | #define LCD_IHIFI 60 /* as used by IHIFI 760/960 */ |
265 | #define LCD_CREATIVEZENXFISTYLE 61 /* as used by Creative Zen X-Fi Style */ | ||
265 | 266 | ||
266 | /* LCD_PIXELFORMAT */ | 267 | /* LCD_PIXELFORMAT */ |
267 | #define HORIZONTAL_PACKING 1 | 268 | #define HORIZONTAL_PACKING 1 |
@@ -556,6 +557,8 @@ Lyre prototype 1 */ | |||
556 | #include "config/ihifi760.h" | 557 | #include "config/ihifi760.h" |
557 | #elif defined(IHIFI960) | 558 | #elif defined(IHIFI960) |
558 | #include "config/ihifi960.h" | 559 | #include "config/ihifi960.h" |
560 | #elif defined(CREATIVE_ZENXFISTYLE) | ||
561 | #include "config/creativezenxfistyle.h" | ||
559 | #else | 562 | #else |
560 | /* no known platform */ | 563 | /* no known platform */ |
561 | #endif | 564 | #endif |
diff --git a/firmware/export/config/creativezenxfistyle.h b/firmware/export/config/creativezenxfistyle.h new file mode 100644 index 0000000000..ad692debb4 --- /dev/null +++ b/firmware/export/config/creativezenxfistyle.h | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | * This config file is for the Creative Zen X-Fi Style | ||
3 | */ | ||
4 | #define IMX233_SUBTARGET 3780 | ||
5 | #define IMX233_PACKAGE IMX233_BGA169 | ||
6 | #define IMX233_PARTITIONS IMX233_FREESCALE | ||
7 | |||
8 | /* For Rolo and boot loader */ | ||
9 | #define MODEL_NUMBER 94 | ||
10 | #define MODEL_NAME "Creative Zen X-Fi Style" | ||
11 | |||
12 | #define HW_SAMPR_CAPS SAMPR_CAP_ALL | ||
13 | |||
14 | /* define this if you have recording possibility */ | ||
15 | #define HAVE_RECORDING | ||
16 | |||
17 | #define REC_SAMPR_CAPS SAMPR_CAP_ALL | ||
18 | |||
19 | /* Default recording levels */ | ||
20 | #define DEFAULT_REC_MIC_GAIN 23 | ||
21 | #define DEFAULT_REC_LEFT_GAIN 23 | ||
22 | #define DEFAULT_REC_RIGHT_GAIN 23 | ||
23 | |||
24 | /* Define bitmask of input sources - recordable bitmask can be defined | ||
25 | explicitly if different */ | ||
26 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) | ||
27 | |||
28 | /* define this if you have a bitmap LCD display */ | ||
29 | #define HAVE_LCD_BITMAP | ||
30 | /* define this if you have a colour LCD */ | ||
31 | #define HAVE_LCD_COLOR | ||
32 | |||
33 | #ifndef BOOTLOADER | ||
34 | #define HAVE_ALBUMART | ||
35 | |||
36 | /* define this to enable bitmap scaling */ | ||
37 | #define HAVE_BMP_SCALING | ||
38 | |||
39 | /* define this to enable JPEG decoding */ | ||
40 | #define HAVE_JPEG | ||
41 | |||
42 | /* Define this if a programmable hotkey is mapped */ | ||
43 | #define HAVE_HOTKEY | ||
44 | |||
45 | /* define this if you have access to the quickscreen */ | ||
46 | #define HAVE_QUICKSCREEN | ||
47 | |||
48 | |||
49 | /* define this if you would like tagcache to build on this target */ | ||
50 | #define HAVE_TAGCACHE | ||
51 | |||
52 | /* define this if the target has volume keys which can be used in the lists */ | ||
53 | #define HAVE_VOLUME_IN_LIST | ||
54 | |||
55 | /* define this if you have LCD enable function */ | ||
56 | #define HAVE_LCD_ENABLE | ||
57 | |||
58 | /* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE | ||
59 | should be defined as well. | ||
60 | #define HAVE_LCD_SLEEP | ||
61 | #define HAVE_LCD_SLEEP_SETTING | ||
62 | */ | ||
63 | |||
64 | /* define this if you can flip your LCD | ||
65 | #define HAVE_LCD_FLIP | ||
66 | */ | ||
67 | |||
68 | /* define this if you can invert the colours on your LCD | ||
69 | #define HAVE_LCD_INVERT | ||
70 | */ | ||
71 | |||
72 | /* define this if you have a real-time clock */ | ||
73 | #define CONFIG_RTC RTC_IMX233 | ||
74 | |||
75 | /* define this if you have a real-time clock with alarm facilities */ | ||
76 | #define HAVE_RTC_ALARM | ||
77 | |||
78 | #endif /* !BOOTLOADER */ | ||
79 | |||
80 | /* define this if you have an i.MX23 codec */ | ||
81 | #define HAVE_IMX233_CODEC | ||
82 | |||
83 | #define CONFIG_TUNER STFM1000 | ||
84 | |||
85 | /* There is no hardware tone control */ | ||
86 | #define HAVE_SW_TONE_CONTROLS | ||
87 | |||
88 | #define CONFIG_KEYPAD CREATIVE_ZEN_PAD | ||
89 | #define HAVE_HEADPHONE_DETECTION | ||
90 | |||
91 | /* Define this to enable morse code input */ | ||
92 | #define HAVE_MORSE_INPUT | ||
93 | |||
94 | /* Define this if you do software codec */ | ||
95 | #define CONFIG_CODEC SWCODEC | ||
96 | |||
97 | /* LCD dimensions */ | ||
98 | #define LCD_WIDTH 320 | ||
99 | #define LCD_HEIGHT 240 | ||
100 | #define LCD_DEPTH 16 /* 65536 colours */ | ||
101 | #define LCD_PIXELFORMAT RGB565 /* rgb565 */ | ||
102 | |||
103 | /* Define this if you have a software controlled poweroff */ | ||
104 | #define HAVE_SW_POWEROFF | ||
105 | |||
106 | /* Some Sansa Fuzes seem to be FAT16 formatted */ | ||
107 | #define HAVE_FAT16SUPPORT | ||
108 | |||
109 | /* The number of bytes reserved for loadable codecs */ | ||
110 | #define CODEC_SIZE 0x100000 | ||
111 | |||
112 | /* The number of bytes reserved for loadable plugins */ | ||
113 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
114 | |||
115 | #define AB_REPEAT_ENABLE | ||
116 | |||
117 | /* Define this for LCD backlight available */ | ||
118 | #define HAVE_BACKLIGHT | ||
119 | #define HAVE_BACKLIGHT_BRIGHTNESS | ||
120 | |||
121 | /* Main LCD backlight brightness range and defaults */ | ||
122 | #define MIN_BRIGHTNESS_SETTING 0 | ||
123 | #define MAX_BRIGHTNESS_SETTING 100 | ||
124 | #define DEFAULT_BRIGHTNESS_SETTING 50 | ||
125 | |||
126 | /* Which backlight fading type? */ | ||
127 | #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING | ||
128 | |||
129 | /* define this if you have a flash memory storage */ | ||
130 | #define HAVE_FLASH_STORAGE | ||
131 | |||
132 | /* define this if the flash memory uses the SecureDigital Memory Card protocol */ | ||
133 | #define CONFIG_STORAGE STORAGE_SD | ||
134 | |||
135 | /* todo */ | ||
136 | #define BATTERY_CAPACITY_DEFAULT 550 /* default battery capacity */ | ||
137 | #define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */ | ||
138 | #define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */ | ||
139 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ | ||
140 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
141 | |||
142 | #define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE | ||
143 | |||
144 | /* Charging implemented in a target-specific algorithm */ | ||
145 | #define CONFIG_CHARGING CHARGING_TARGET | ||
146 | |||
147 | /* define this if the unit can be powered or charged via USB */ | ||
148 | #define HAVE_USB_POWER | ||
149 | |||
150 | /* Define this if you have an IMX233*/ | ||
151 | #define CONFIG_CPU IMX233 | ||
152 | |||
153 | /* Define this if you want to use the IMX233 i2c interface */ | ||
154 | #define CONFIG_I2C I2C_IMX233 | ||
155 | |||
156 | /* define current usage levels (based on battery bench) */ | ||
157 | #define CURRENT_NORMAL 35 | ||
158 | #define CURRENT_BACKLIGHT 30 | ||
159 | #define CURRENT_RECORD CURRENT_NORMAL | ||
160 | |||
161 | /* maximum charging current */ | ||
162 | #define CURRENT_MAX_CHG 200 | ||
163 | |||
164 | /* Define this to the CPU frequency */ | ||
165 | #define CPU_FREQ 454000000 | ||
166 | |||
167 | /* Type of LCD */ | ||
168 | #define CONFIG_LCD LCD_CREATIVEZENXFISTYLE | ||
169 | |||
170 | /* Offset ( in the firmware file's header ) to the file CRC and data. These are | ||
171 | only used when loading the old format rockbox.e200 file */ | ||
172 | #define FIRMWARE_OFFSET_FILE_CRC 0x0 | ||
173 | #define FIRMWARE_OFFSET_FILE_DATA 0x8 | ||
174 | |||
175 | /* USB On-the-go */ | ||
176 | #define CONFIG_USBOTG USBOTG_ARC | ||
177 | |||
178 | /* enable these for the experimental usb stack */ | ||
179 | #define HAVE_USBSTACK | ||
180 | //#define USB_HANDLED_BY_OF | ||
181 | #define USE_ROCKBOX_USB | ||
182 | #define USB_VENDOR_ID 0x041e | ||
183 | #define USB_PRODUCT_ID 0x200a | ||
184 | #define HAVE_USB_HID_MOUSE | ||
185 | #define HAVE_BOOTLOADER_USB_MODE | ||
186 | |||
187 | /* The ZEN X-Fi Style actually interesting partition table does not use 512-byte sector | ||
188 | * (usually 2048 logical sector size) */ | ||
189 | #define MAX_LOG_SECTOR_SIZE 2048 | ||
190 | |||
191 | /* Define this if you have adjustable CPU frequency */ | ||
192 | #define HAVE_ADJUSTABLE_CPU_FREQ | ||
193 | |||
194 | #define BOOTFILE_EXT "creative" | ||
195 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
196 | #define BOOTDIR "/.rockbox" | ||
197 | |||
198 | #define INCLUDE_TIMEOUT_API | ||
199 | |||
200 | |||
diff --git a/firmware/target/arm/imx233/creative-zen/backlight-zen.c b/firmware/target/arm/imx233/creative-zen/backlight-zen.c index 74e1e91a49..6d162817c8 100644 --- a/firmware/target/arm/imx233/creative-zen/backlight-zen.c +++ b/firmware/target/arm/imx233/creative-zen/backlight-zen.c | |||
@@ -26,10 +26,14 @@ | |||
26 | #include "backlight-target.h" | 26 | #include "backlight-target.h" |
27 | #include "uartdbg-imx233.h" | 27 | #include "uartdbg-imx233.h" |
28 | #include "pinctrl-imx233.h" | 28 | #include "pinctrl-imx233.h" |
29 | #include "pwm-imx233.h" | ||
29 | 30 | ||
30 | void _backlight_set_brightness(int level) | 31 | void _backlight_set_brightness(int level) |
31 | { | 32 | { |
32 | #ifdef CREATIVE_ZENV | 33 | #if defined(CREATIVE_ZENXFISTYLE) |
34 | imx233_pwm_setup_simple(4, 24000, level); | ||
35 | imx233_pwm_enable(4, true); | ||
36 | #elif defined(CREATIVE_ZENV) | ||
33 | lcd_set_contrast(level); | 37 | lcd_set_contrast(level); |
34 | #else | 38 | #else |
35 | unsigned val = (level + 200) * level / 1000; | 39 | unsigned val = (level + 200) * level / 1000; |
@@ -47,7 +51,7 @@ void _backlight_set_brightness(int level) | |||
47 | 51 | ||
48 | bool _backlight_init(void) | 52 | bool _backlight_init(void) |
49 | { | 53 | { |
50 | #ifndef CREATIVE_ZENV | 54 | #if !defined(CREATIVE_ZENV) && !defined(CREATIVE_ZENXFISTYLE) |
51 | imx233_pinctrl_acquire(1, 12, "backlight_enable"); | 55 | imx233_pinctrl_acquire(1, 12, "backlight_enable"); |
52 | imx233_pinctrl_set_function(1, 12, PINCTRL_FUNCTION_GPIO); | 56 | imx233_pinctrl_set_function(1, 12, PINCTRL_FUNCTION_GPIO); |
53 | imx233_pinctrl_enable_gpio(1, 12, true); | 57 | imx233_pinctrl_enable_gpio(1, 12, true); |
diff --git a/firmware/target/arm/imx233/creative-zen/button-target.h b/firmware/target/arm/imx233/creative-zen/button-target.h index 7974ae42ad..65521d66e4 100644 --- a/firmware/target/arm/imx233/creative-zen/button-target.h +++ b/firmware/target/arm/imx233/creative-zen/button-target.h | |||
@@ -25,10 +25,16 @@ | |||
25 | 25 | ||
26 | bool button_debug_screen(void); | 26 | bool button_debug_screen(void); |
27 | 27 | ||
28 | #if !defined(CREATIVE_ZENXFISTYLE) | ||
28 | #define HAS_BUTTON_HOLD | 29 | #define HAS_BUTTON_HOLD |
30 | #define IMX233_BUTTON_LRADC_HOLD_DET BLH_ADC | ||
31 | #endif | ||
29 | 32 | ||
33 | #if defined(CREATIVE_ZENXFISTYLE) | ||
34 | #define IMX233_BUTTON_LRADC_CHANNEL 2 | ||
35 | #else | ||
30 | #define IMX233_BUTTON_LRADC_CHANNEL 0 | 36 | #define IMX233_BUTTON_LRADC_CHANNEL 0 |
31 | #define IMX233_BUTTON_LRADC_HOLD_DET BLH_ADC | 37 | #endif |
32 | 38 | ||
33 | /* Main unit's buttons */ | 39 | /* Main unit's buttons */ |
34 | #define BUTTON_POWER 0x00000001 | 40 | #define BUTTON_POWER 0x00000001 |
diff --git a/firmware/target/arm/imx233/creative-zen/button-zen.c b/firmware/target/arm/imx233/creative-zen/button-zen.c index 8f20961a57..c0e7205675 100644 --- a/firmware/target/arm/imx233/creative-zen/button-zen.c +++ b/firmware/target/arm/imx233/creative-zen/button-zen.c | |||
@@ -25,6 +25,14 @@ | |||
25 | #include "power-imx233.h" | 25 | #include "power-imx233.h" |
26 | #include "button-lradc-imx233.h" | 26 | #include "button-lradc-imx233.h" |
27 | 27 | ||
28 | #if defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) | ||
29 | #define JACK_DET_BANK 2 | ||
30 | #define JACK_DET_PIN 8 | ||
31 | #elif defined(CREATIVE_ZENXFISTYLE) | ||
32 | #define JACK_DET_BANK 2 | ||
33 | #define JACK_DET_PIN 7 | ||
34 | #endif | ||
35 | |||
28 | struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] = | 36 | struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] = |
29 | { | 37 | { |
30 | #if defined(CREATIVE_ZEN) | 38 | #if defined(CREATIVE_ZEN) |
@@ -84,6 +92,18 @@ struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] = | |||
84 | {2945, BUTTON_PLAYPAUSE}, | 92 | {2945, BUTTON_PLAYPAUSE}, |
85 | {3400, 0}, | 93 | {3400, 0}, |
86 | {0, IMX233_BUTTON_LRADC_END}, | 94 | {0, IMX233_BUTTON_LRADC_END}, |
95 | #elif defined(CREATIVE_ZENXFISTYLE) | ||
96 | {230, BUTTON_MENU}, | ||
97 | {480, BUTTON_SHORTCUT}, | ||
98 | {690, BUTTON_UP}, | ||
99 | {920, BUTTON_LEFT}, | ||
100 | {1120, BUTTON_RIGHT}, | ||
101 | {1335, BUTTON_DOWN}, | ||
102 | {1565, BUTTON_SELECT}, | ||
103 | {2850, BUTTON_BACK}, | ||
104 | {3110, BUTTON_PLAYPAUSE}, | ||
105 | {3620, 0}, | ||
106 | {0, IMX233_BUTTON_LRADC_END}, | ||
87 | #else | 107 | #else |
88 | #error wrong target | 108 | #error wrong target |
89 | #endif | 109 | #endif |
@@ -92,29 +112,43 @@ struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] = | |||
92 | void button_init_device(void) | 112 | void button_init_device(void) |
93 | { | 113 | { |
94 | imx233_button_lradc_init(); | 114 | imx233_button_lradc_init(); |
95 | #if defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) | 115 | #ifdef HAVE_HEADPHONE_DETECTION |
96 | imx233_pinctrl_acquire(2, 8, "jack_detect"); | 116 | imx233_pinctrl_acquire(JACK_DET_BANK, JACK_DET_PIN, "jack_detect"); |
97 | imx233_pinctrl_set_function(2, 8, PINCTRL_FUNCTION_GPIO); | 117 | imx233_pinctrl_set_function(JACK_DET_BANK, JACK_DET_PIN, PINCTRL_FUNCTION_GPIO); |
98 | imx233_pinctrl_enable_gpio(2, 8, false); | 118 | imx233_pinctrl_enable_gpio(JACK_DET_BANK, JACK_DET_PIN, false); |
119 | #endif | ||
120 | #ifdef CREATIVE_ZENXFISTYLE | ||
121 | imx233_pinctrl_acquire(0, 11, "power_detect"); | ||
122 | imx233_pinctrl_set_function(0, 11, PINCTRL_FUNCTION_GPIO); | ||
123 | imx233_pinctrl_enable_gpio(0, 11, false); | ||
99 | #endif | 124 | #endif |
100 | } | 125 | } |
101 | 126 | ||
127 | #ifdef HAS_BUTTON_HOLD | ||
102 | bool button_hold(void) | 128 | bool button_hold(void) |
103 | { | 129 | { |
104 | return imx233_button_lradc_hold(); | 130 | return imx233_button_lradc_hold(); |
105 | } | 131 | } |
132 | #endif | ||
106 | 133 | ||
107 | #if defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) | 134 | #ifdef HAVE_HEADPHONE_DETECTION |
108 | bool headphones_inserted(void) | 135 | bool headphones_inserted(void) |
109 | { | 136 | { |
110 | return !imx233_pinctrl_get_gpio(2, 8); | 137 | return !imx233_pinctrl_get_gpio(JACK_DET_BANK, JACK_DET_PIN); |
111 | } | 138 | } |
112 | #endif | 139 | #endif |
113 | 140 | ||
114 | int button_read_device(void) | 141 | int button_read_device(void) |
115 | { | 142 | { |
116 | int btn = 0; | 143 | int btn = 0; |
144 | #ifdef CREATIVE_ZENXFISTYLE | ||
145 | /* The ZEN X-Fi Style uses a GPIO because both select and power are wired | ||
146 | * to PSWITCH resulting in slow and unreliable readings */ | ||
147 | if(!imx233_pinctrl_get_gpio(0, 11)) | ||
148 | btn |= BUTTON_POWER; | ||
149 | #else | ||
117 | if(imx233_power_read_pswitch() == 1) | 150 | if(imx233_power_read_pswitch() == 1) |
118 | btn |= BUTTON_POWER; | 151 | btn |= BUTTON_POWER; |
152 | #endif | ||
119 | return imx233_button_lradc_read(btn); | 153 | return imx233_button_lradc_read(btn); |
120 | } | 154 | } |
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c b/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c new file mode 100644 index 0000000000..5a4542ca67 --- /dev/null +++ b/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c | |||
@@ -0,0 +1,311 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (c) 2013 by Amaury Pouly | ||
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 <sys/types.h> /* off_t */ | ||
22 | #include <string.h> | ||
23 | #include "cpu.h" | ||
24 | #include "system.h" | ||
25 | #include "backlight-target.h" | ||
26 | #include "lcd.h" | ||
27 | #include "lcdif-imx233.h" | ||
28 | #include "clkctrl-imx233.h" | ||
29 | #include "pinctrl-imx233.h" | ||
30 | #include "logf.h" | ||
31 | |||
32 | #ifdef HAVE_LCD_ENABLE | ||
33 | static bool lcd_on; | ||
34 | #endif | ||
35 | static int lcd_model; | ||
36 | |||
37 | static inline uint32_t encode_16_to_18(uint32_t a) | ||
38 | { | ||
39 | return ((a & 0xff) << 1) | (((a >> 8) & 0xff) << 10); | ||
40 | } | ||
41 | |||
42 | static void lcd_write_reg(uint32_t reg, uint32_t data) | ||
43 | { | ||
44 | uint32_t old_reg = reg; | ||
45 | /* get back to 18-bit word length */ | ||
46 | imx233_lcdif_set_word_length(18); | ||
47 | reg = encode_16_to_18(reg); | ||
48 | data = encode_16_to_18(data); | ||
49 | |||
50 | imx233_lcdif_pio_send(false, 1, ®); | ||
51 | if(old_reg != 0x22) | ||
52 | imx233_lcdif_pio_send(true, 1, &data); | ||
53 | } | ||
54 | |||
55 | static void lcd_init_seq(void) | ||
56 | { | ||
57 | if(lcd_model == 0) | ||
58 | { | ||
59 | lcd_write_reg(0xe3, 0x3008); | ||
60 | lcd_write_reg(0xe7, 0x12); | ||
61 | lcd_write_reg(0xef, 0x1231); | ||
62 | lcd_write_reg(0x01, 0x100); | ||
63 | lcd_write_reg(0x02, 0x700); | ||
64 | lcd_write_reg(0x03, 0x1028); | ||
65 | lcd_write_reg(0x04, 0); | ||
66 | lcd_write_reg(0x08, 0x207); | ||
67 | lcd_write_reg(0x09, 0); | ||
68 | lcd_write_reg(0x0a, 0); | ||
69 | lcd_write_reg(0x0c, 0); | ||
70 | lcd_write_reg(0x0d, 0); | ||
71 | lcd_write_reg(0x0f, 0); | ||
72 | lcd_write_reg(0x10, 0); | ||
73 | lcd_write_reg(0x11, 7); | ||
74 | lcd_write_reg(0x12, 0); | ||
75 | lcd_write_reg(0x13, 0); | ||
76 | mdelay(200); | ||
77 | lcd_write_reg(0x10, 0x1490); | ||
78 | lcd_write_reg(0x11, 0x227); | ||
79 | mdelay(50); | ||
80 | lcd_write_reg(0x12, 0x9c); | ||
81 | mdelay(50); | ||
82 | lcd_write_reg(0x13, 0xc00); | ||
83 | lcd_write_reg(0x29, 5); | ||
84 | lcd_write_reg(0x2b, 0xc); | ||
85 | lcd_write_reg(0x20, 0xef); | ||
86 | lcd_write_reg(0x21, 0); | ||
87 | lcd_write_reg(0x30, 6); | ||
88 | lcd_write_reg(0x31, 0x703); | ||
89 | lcd_write_reg(0x32, 0x206); | ||
90 | lcd_write_reg(0x35, 4); | ||
91 | lcd_write_reg(0x36, 0x1a05); | ||
92 | lcd_write_reg(0x37, 0x600); | ||
93 | lcd_write_reg(0x38, 0x307); | ||
94 | lcd_write_reg(0x39, 0x707); | ||
95 | lcd_write_reg(0x3c, 0x400); | ||
96 | lcd_write_reg(0x3d, 0x50f); | ||
97 | lcd_write_reg(0x50, 0); | ||
98 | lcd_write_reg(0x51, 0xef); | ||
99 | lcd_write_reg(0x52, 0); | ||
100 | lcd_write_reg(0x53, 0x13f); | ||
101 | lcd_write_reg(0x60, 0xa700); | ||
102 | lcd_write_reg(0x61, 1); | ||
103 | lcd_write_reg(0x6a, 0); | ||
104 | lcd_write_reg(0x80, 0); | ||
105 | lcd_write_reg(0x81, 0); | ||
106 | lcd_write_reg(0x82, 0); | ||
107 | lcd_write_reg(0x83, 0); | ||
108 | lcd_write_reg(0x84, 0); | ||
109 | lcd_write_reg(0x85, 0); | ||
110 | lcd_write_reg(0x90, 0x10); | ||
111 | lcd_write_reg(0x92, 0x600); | ||
112 | lcd_write_reg(0x07, 0x133); | ||
113 | } | ||
114 | else | ||
115 | { | ||
116 | lcd_write_reg(0x01, 0x100); | ||
117 | lcd_write_reg(0x02, 0x700); | ||
118 | lcd_write_reg(0x03, 0x1028); | ||
119 | lcd_write_reg(0x04, 0); | ||
120 | lcd_write_reg(0x08, 0x207); | ||
121 | lcd_write_reg(0x09, 0); | ||
122 | lcd_write_reg(0x0a, 0); | ||
123 | lcd_write_reg(0x0c, 0); | ||
124 | lcd_write_reg(0x0d, 0); | ||
125 | lcd_write_reg(0x0f, 0); | ||
126 | lcd_write_reg(0x10, 0); | ||
127 | lcd_write_reg(0x11, 7); | ||
128 | lcd_write_reg(0x12, 0); | ||
129 | lcd_write_reg(0x13, 0); | ||
130 | mdelay(200); | ||
131 | lcd_write_reg(0x10, 0x1290); | ||
132 | lcd_write_reg(0x11, 0x227); | ||
133 | mdelay(50); | ||
134 | lcd_write_reg(0x12, 0x9c); | ||
135 | mdelay(50); | ||
136 | lcd_write_reg(0x13, 0x1f00); | ||
137 | lcd_write_reg(0x29, 0x30); | ||
138 | lcd_write_reg(0x2b, 0xd); | ||
139 | lcd_write_reg(0x20, 0xef); | ||
140 | lcd_write_reg(0x21, 0); | ||
141 | lcd_write_reg(0x30, 0x404); | ||
142 | lcd_write_reg(0x31, 0x404); | ||
143 | lcd_write_reg(0x32, 0x404); | ||
144 | lcd_write_reg(0x37, 0x303); | ||
145 | lcd_write_reg(0x38, 0x303); | ||
146 | lcd_write_reg(0x39, 0x303); | ||
147 | lcd_write_reg(0x35, 0x103); | ||
148 | lcd_write_reg(0x3c, 0x301); | ||
149 | lcd_write_reg(0x36, 0x1e00); | ||
150 | lcd_write_reg(0x3d, 0xf); | ||
151 | lcd_write_reg(0x50, 0); | ||
152 | lcd_write_reg(0x51, 0xef); | ||
153 | lcd_write_reg(0x52, 0); | ||
154 | lcd_write_reg(0x53, 0x13f); | ||
155 | lcd_write_reg(0x60, 0xa700); | ||
156 | lcd_write_reg(0x61, 0); | ||
157 | lcd_write_reg(0x6a, 0); | ||
158 | lcd_write_reg(0x80, 0); | ||
159 | lcd_write_reg(0x81, 0); | ||
160 | lcd_write_reg(0x82, 0); | ||
161 | lcd_write_reg(0x83, 0); | ||
162 | lcd_write_reg(0x84, 0); | ||
163 | lcd_write_reg(0x85, 0); | ||
164 | lcd_write_reg(0x2b, 0xd); | ||
165 | mdelay(50); | ||
166 | lcd_write_reg(0x90, 0x17); | ||
167 | lcd_write_reg(0x92, 0); | ||
168 | lcd_write_reg(0x93, 3); | ||
169 | lcd_write_reg(0x95, 0x110); | ||
170 | lcd_write_reg(0x97, 0); | ||
171 | lcd_write_reg(0x98, 0); | ||
172 | lcd_write_reg(0x07, 0x133); | ||
173 | } | ||
174 | } | ||
175 | |||
176 | void lcd_init_device(void) | ||
177 | { | ||
178 | /* clock at 24MHZ */ | ||
179 | imx233_clkctrl_enable(CLK_PIX, false); | ||
180 | imx233_clkctrl_set_div(CLK_PIX, 1); | ||
181 | imx233_clkctrl_set_bypass(CLK_PIX, true); /* use XTAL */ | ||
182 | imx233_clkctrl_enable(CLK_PIX, true); | ||
183 | imx233_lcdif_init(); | ||
184 | imx233_lcdif_set_lcd_databus_width(18); | ||
185 | imx233_lcdif_enable_underflow_recover(true); | ||
186 | imx233_lcdif_setup_system_pins(18); | ||
187 | imx233_lcdif_set_timings(2, 2, 2, 2); | ||
188 | |||
189 | imx233_pinctrl_acquire(2, 8, "lcd_model"); | ||
190 | imx233_pinctrl_set_function(2, 8, PINCTRL_FUNCTION_GPIO); | ||
191 | imx233_pinctrl_enable_gpio(2, 8, false); | ||
192 | lcd_model = imx233_pinctrl_get_gpio(2, 8); | ||
193 | |||
194 | // reset device | ||
195 | imx233_lcdif_reset_lcd(true); | ||
196 | mdelay(50); | ||
197 | imx233_lcdif_reset_lcd(false); | ||
198 | mdelay(10); | ||
199 | imx233_lcdif_reset_lcd(true); | ||
200 | |||
201 | lcd_init_seq(); | ||
202 | #ifdef HAVE_LCD_ENABLE | ||
203 | lcd_on = true; | ||
204 | #endif | ||
205 | } | ||
206 | |||
207 | #ifdef HAVE_LCD_ENABLE | ||
208 | bool lcd_active(void) | ||
209 | { | ||
210 | return lcd_on; | ||
211 | } | ||
212 | |||
213 | static void lcd_enable_seq(bool enable) | ||
214 | { | ||
215 | if(!enable) | ||
216 | { | ||
217 | } | ||
218 | else | ||
219 | { | ||
220 | } | ||
221 | } | ||
222 | |||
223 | void lcd_enable(bool enable) | ||
224 | { | ||
225 | if(lcd_on == enable) | ||
226 | return; | ||
227 | |||
228 | lcd_on = enable; | ||
229 | |||
230 | lcd_enable_seq(enable); | ||
231 | if(enable) | ||
232 | send_event(LCD_EVENT_ACTIVATION, NULL); | ||
233 | } | ||
234 | #endif | ||
235 | |||
236 | void lcd_update(void) | ||
237 | { | ||
238 | lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); | ||
239 | } | ||
240 | |||
241 | /* NOTE the LCD is rotated: it's a 240x320 panel with (0,0) being the bottom-left | ||
242 | * corner when the player is hold in landscape mode. This means x and y axis and | ||
243 | * exchanged and the y axis is reversed. */ | ||
244 | |||
245 | void lcd_update_rect(int x, int y, int w, int h) | ||
246 | { | ||
247 | #ifdef HAVE_LCD_ENABLE | ||
248 | if(!lcd_on) | ||
249 | return; | ||
250 | #endif | ||
251 | /* make sure the rectangle is included in the screen */ | ||
252 | x = MIN(x, LCD_WIDTH); | ||
253 | y = MIN(y, LCD_HEIGHT); | ||
254 | w = MIN(w, LCD_WIDTH - x); | ||
255 | h = MIN(h, LCD_HEIGHT - y); | ||
256 | |||
257 | imx233_lcdif_wait_ready(); | ||
258 | lcd_write_reg(0x50, LCD_HEIGHT - y - h); | ||
259 | lcd_write_reg(0x51, LCD_HEIGHT - y - 1); | ||
260 | lcd_write_reg(0x52, x); | ||
261 | lcd_write_reg(0x53, x + w - 1); | ||
262 | lcd_write_reg(0x20, LCD_HEIGHT - y - 1); | ||
263 | lcd_write_reg(0x21, x); | ||
264 | lcd_write_reg(0x22, 0); | ||
265 | imx233_lcdif_wait_ready(); | ||
266 | imx233_lcdif_set_word_length(16); | ||
267 | imx233_lcdif_set_byte_packing_format(0xf); /* two pixels per 32-bit word */ | ||
268 | |||
269 | /* there are two cases here: | ||
270 | * - either width = LCD_WIDTH and we can directly memcopy a part of lcd_framebuffer to FRAME | ||
271 | * and send it | ||
272 | * - either width != LCD_WIDTH and we have to build a contiguous copy of the rectangular area | ||
273 | * into FRAME before sending it (which is slower and doesn't use the hardware) | ||
274 | * In all cases, FRAME just acts as a temporary buffer. | ||
275 | * NOTE It's more interesting to do a copy to FRAME in all cases since in system mode | ||
276 | * the clock runs at 24MHz which provides barely 10MB/s bandwidth compared to >100MB/s | ||
277 | * for memcopy operations | ||
278 | */ | ||
279 | if(w == LCD_WIDTH) | ||
280 | { | ||
281 | memcpy((void *)FRAME, FBADDR(x,y), w * h * sizeof(fb_data)); | ||
282 | } | ||
283 | else | ||
284 | { | ||
285 | for(int i = 0; i < h; i++) | ||
286 | memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); | ||
287 | } | ||
288 | /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode | ||
289 | * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count | ||
290 | * field must be a multiple of 2. Furthermore, it seems the lcd controller doesn't | ||
291 | * really like when both w and h are even, probably because the writes to the GRAM | ||
292 | * are done on several words and the controller requires dummy writes. | ||
293 | * The workaround is to always make sure that we send a number of pixels which is | ||
294 | * a multiple of 4 so that both the lcdif and the controller are happy. If any | ||
295 | * of w or h is odd, we will send a copy of the first pixels as dummy writes. We will | ||
296 | * send at most 3 bytes. We then send (w * h + 3) / 4 x 4 bytes. | ||
297 | */ | ||
298 | if(w % 2 == 1 || h % 2 == 1) | ||
299 | { | ||
300 | /* copy three pixel after the last one */ | ||
301 | for(int i = 0; i < 3; i++) | ||
302 | *((fb_data *)FRAME + w * h + i) = *((fb_data *)FRAME + i); | ||
303 | /* WARNING we need to update w and h to reflect the pixel count BUT it | ||
304 | * has no relation to w * h (it can even be 2 * prime). Hopefully, w <= 240 and | ||
305 | * h <= 320 so w * h <= 76800 and (w * h + 3) / 4 <= 38400 which fits into | ||
306 | * a 16-bit integer (horizontal count). */ | ||
307 | h = (w * h + 3) / 4; | ||
308 | w = 4; | ||
309 | } | ||
310 | imx233_lcdif_dma_send((void *)FRAME_PHYS_ADDR, w, h); | ||
311 | } | ||
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c index 08eae021bc..8103e980d1 100644 --- a/firmware/target/arm/imx233/sdmmc-imx233.c +++ b/firmware/target/arm/imx233/sdmmc-imx233.c | |||
@@ -151,6 +151,13 @@ struct sdmmc_config_t sdmmc_config[] = | |||
151 | .ssp = 2, | 151 | .ssp = 2, |
152 | .mode = SD_MODE, | 152 | .mode = SD_MODE, |
153 | } | 153 | } |
154 | #elif defined(CREATIVE_ZENXFISTYLE) | ||
155 | { | ||
156 | .name = "internal/SD", | ||
157 | .flags = WINDOW, | ||
158 | .ssp = 2, | ||
159 | .mode = SD_MODE | ||
160 | }, | ||
154 | #elif defined(SONY_NWZE370) || defined(SONY_NWZE360) | 161 | #elif defined(SONY_NWZE370) || defined(SONY_NWZE360) |
155 | /* The Sony NWZ-E370 uses #B1P29 for power */ | 162 | /* The Sony NWZ-E370 uses #B1P29 for power */ |
156 | { | 163 | { |
diff --git a/rbutil/mkimxboot/dualboot.c b/rbutil/mkimxboot/dualboot.c index e2bbdae8a9..b991fe3f6e 100644 --- a/rbutil/mkimxboot/dualboot.c +++ b/rbutil/mkimxboot/dualboot.c | |||
@@ -89,3 +89,14 @@ unsigned char dualboot_nwze360[416] = { | |||
89 | 0x3d, 0x59, 0x85, 0xe2, 0x09, 0x5d, 0x85, 0xe2, 0x03, 0x80, 0xa0, 0xe1, 0xda, 0xff, 0xff, 0xea, | 89 | 0x3d, 0x59, 0x85, 0xe2, 0x09, 0x5d, 0x85, 0xe2, 0x03, 0x80, 0xa0, 0xe1, 0xda, 0xff, 0xff, 0xea, |
90 | 0x00, 0x40, 0x04, 0x80, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x01, 0x80 | 90 | 0x00, 0x40, 0x04, 0x80, 0x00, 0x00, 0x05, 0x80, 0x01, 0x00, 0xff, 0xff, 0x00, 0xc0, 0x01, 0x80 |
91 | }; | 91 | }; |
92 | unsigned char dualboot_zenxfistyle[136] = { | ||
93 | 0x10, 0x40, 0x2d, 0xe9, 0x00, 0x00, 0x00, 0xeb, 0x10, 0x80, 0xbd, 0xe8, 0x6c, 0x30, 0x9f, 0xe5, | ||
94 | 0xc0, 0x30, 0x93, 0xe5, 0x68, 0x30, 0x9f, 0xe5, 0x02, 0x21, 0xa0, 0xe3, 0x08, 0x20, 0x83, 0xe5, | ||
95 | 0x03, 0x21, 0x82, 0xe2, 0x08, 0x20, 0x83, 0xe5, 0xff, 0x24, 0x82, 0xe2, 0x78, 0x20, 0x83, 0xe5, | ||
96 | 0xc5, 0x24, 0x82, 0xe2, 0x24, 0x20, 0x83, 0xe5, 0x04, 0x20, 0xa0, 0xe3, 0x18, 0x20, 0x83, 0xe5, | ||
97 | 0x04, 0x20, 0x83, 0xe5, 0x03, 0x20, 0xa0, 0xe1, 0x10, 0x30, 0x92, 0xe5, 0x04, 0x00, 0x13, 0xe3, | ||
98 | 0xfc, 0xff, 0xff, 0x0a, 0x28, 0x30, 0x9f, 0xe5, 0x70, 0x30, 0x93, 0xe5, 0xff, 0x34, 0xc3, 0xe3, | ||
99 | 0x3f, 0x37, 0xc3, 0xe3, 0xcb, 0x3f, 0x43, 0xe2, 0x03, 0x30, 0x43, 0xe2, 0x63, 0x00, 0x53, 0xe3, | ||
100 | 0x00, 0x00, 0xa0, 0x93, 0x00, 0x00, 0x81, 0x85, 0x01, 0x00, 0xa0, 0x83, 0x1e, 0xff, 0x2f, 0xe1, | ||
101 | 0x00, 0x40, 0x04, 0x80, 0x00, 0x00, 0x05, 0x80 | ||
102 | }; | ||
diff --git a/rbutil/mkimxboot/dualboot.h b/rbutil/mkimxboot/dualboot.h index 17ee1979fb..65793811c7 100644 --- a/rbutil/mkimxboot/dualboot.h +++ b/rbutil/mkimxboot/dualboot.h | |||
@@ -5,3 +5,4 @@ extern unsigned char dualboot_zenxfi2[96]; | |||
5 | extern unsigned char dualboot_zenxfi3[56]; | 5 | extern unsigned char dualboot_zenxfi3[56]; |
6 | extern unsigned char dualboot_nwze370[416]; | 6 | extern unsigned char dualboot_nwze370[416]; |
7 | extern unsigned char dualboot_nwze360[416]; | 7 | extern unsigned char dualboot_nwze360[416]; |
8 | extern unsigned char dualboot_zenxfistyle[136]; | ||
diff --git a/rbutil/mkimxboot/dualboot/Makefile b/rbutil/mkimxboot/dualboot/Makefile index 500263c4bf..28e9643a3a 100644 --- a/rbutil/mkimxboot/dualboot/Makefile +++ b/rbutil/mkimxboot/dualboot/Makefile | |||
@@ -10,12 +10,13 @@ CFLAGS=-mcpu=arm926ej-s -std=gnu99 -I. -I$(REGS_PATH) -nostdlib -ffreestanding - | |||
10 | # 1) add x to the list in TARGETS | 10 | # 1) add x to the list in TARGETS |
11 | # 2) create a variable named OPT_x of the form: | 11 | # 2) create a variable named OPT_x of the form: |
12 | # OPT_x=target specific defines | 12 | # OPT_x=target specific defines |
13 | TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 | 13 | TARGETS=fuzeplus zenxfi2 zenxfi3 nwze370 nwze360 zenxfistyle |
14 | OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780 | 14 | OPT_fuzeplus=-DSANSA_FUZEPLUS -DIMX233_SUBTARGET=3780 |
15 | OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780 | 15 | OPT_zenxfi2=-DCREATIVE_ZENXFI2 -DIMX233_SUBTARGET=3780 |
16 | OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780 | 16 | OPT_zenxfi3=-DCREATIVE_ZENXFI3 -DIMX233_SUBTARGET=3780 |
17 | OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780 | 17 | OPT_nwze370=-DSONY_NWZE370 -DIMX233_SUBTARGET=3780 |
18 | OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780 | 18 | OPT_nwze360=-DSONY_NWZE360 -DIMX233_SUBTARGET=3780 |
19 | OPT_zenxfistyle=-DCREATIVE_ZENXFISTYLE -DIMX233_SUBTARGET=3780 | ||
19 | 20 | ||
20 | BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) | 21 | BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) |
21 | BOOTBINS=$(patsubst %, dualboot_%.arm-bin, $(TARGETS)) | 22 | BOOTBINS=$(patsubst %, dualboot_%.arm-bin, $(TARGETS)) |
diff --git a/rbutil/mkimxboot/dualboot/dualboot.c b/rbutil/mkimxboot/dualboot/dualboot.c index 3cca59bb8a..e841b12d74 100644 --- a/rbutil/mkimxboot/dualboot/dualboot.c +++ b/rbutil/mkimxboot/dualboot/dualboot.c | |||
@@ -184,6 +184,20 @@ static int boot_decision(int context) | |||
184 | } | 184 | } |
185 | return decision; | 185 | return decision; |
186 | } | 186 | } |
187 | #elif defined(CREATIVE_ZENXFISTYLE) | ||
188 | static int boot_decision(int context) | ||
189 | { | ||
190 | setup_lradc(2); // setup LRADC channel 2 to read keys | ||
191 | /* make a decision */ | ||
192 | int val = read_lradc(2); | ||
193 | /* boot to OF if left is hold | ||
194 | * NOTE: VDDIO is set to 3.1V initially and the resistor ladder is wired to | ||
195 | * VDDIO so these values are not the same as in the main binary which is | ||
196 | * calibrated for VDDIO=3.3V */ | ||
197 | if(val >= 815 && val < 915) | ||
198 | return BOOT_OF; | ||
199 | return BOOT_ROCK; | ||
200 | } | ||
187 | #else | 201 | #else |
188 | #warning You should define a target specific boot decision function | 202 | #warning You should define a target specific boot decision function |
189 | static int boot_decision(int context) | 203 | static int boot_decision(int context) |
diff --git a/rbutil/mkimxboot/mkimxboot.c b/rbutil/mkimxboot/mkimxboot.c index 1761fc9cb2..3897216e16 100644 --- a/rbutil/mkimxboot/mkimxboot.c +++ b/rbutil/mkimxboot/mkimxboot.c | |||
@@ -199,7 +199,7 @@ static const struct imx_model_desc_t imx_models[] = | |||
199 | 1, &zero_key, 0, 0x40000000 }, | 199 | 1, &zero_key, 0, 0x40000000 }, |
200 | [MODEL_ZENXFI3] = {"Zen X-Fi3", dualboot_zenxfi3, sizeof(dualboot_zenxfi3), "zxf3", 83, | 200 | [MODEL_ZENXFI3] = {"Zen X-Fi3", dualboot_zenxfi3, sizeof(dualboot_zenxfi3), "zxf3", 83, |
201 | 1, &zero_key, 0, 0x40000000 }, | 201 | 1, &zero_key, 0, 0x40000000 }, |
202 | [MODEL_ZENXFISTYLE] = {"Zen X-Fi Style", NULL, 0, "", -1, | 202 | [MODEL_ZENXFISTYLE] = {"Zen X-Fi Style", dualboot_zenxfistyle, sizeof(dualboot_zenxfistyle), "zxfs", 94, |
203 | 1, &zero_key, 0, 0x40000000 }, | 203 | 1, &zero_key, 0, 0x40000000 }, |
204 | [MODEL_ZENSTYLE] = {"Zen Style 100/300", NULL, 0, "", -1, | 204 | [MODEL_ZENSTYLE] = {"Zen Style 100/300", NULL, 0, "", -1, |
205 | 1, &zero_key, 0, 0x40000000 }, | 205 | 1, &zero_key, 0, 0x40000000 }, |
@@ -429,6 +429,10 @@ static enum imx_error_t patch_firmware(enum imx_model_t model, | |||
429 | return IMX_DONT_KNOW_HOW_TO_PATCH; | 429 | return IMX_DONT_KNOW_HOW_TO_PATCH; |
430 | } | 430 | } |
431 | break; | 431 | break; |
432 | case MODEL_ZENXFISTYLE: | ||
433 | /* The ZEN X-Fi Style uses the standard ____, host, play sections, patch after first | ||
434 | * call in ____ section. */ | ||
435 | return patch_std_zero_host_play(1, model, type, sb_file, boot_fw); | ||
432 | default: | 436 | default: |
433 | return IMX_DONT_KNOW_HOW_TO_PATCH; | 437 | return IMX_DONT_KNOW_HOW_TO_PATCH; |
434 | } | 438 | } |
diff --git a/tools/configure b/tools/configure index 1ac644597e..0f897836c9 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -1308,35 +1308,36 @@ cat <<EOF | |||
1308 | 34) M3/M3L 71) M:Robe 100 51) Sansa e200R | 1308 | 34) M3/M3L 71) M:Robe 100 51) Sansa e200R |
1309 | 52) Sansa c200 | 1309 | 52) Sansa c200 |
1310 | ==Creative== ==Philips== 53) Sansa m200 | 1310 | ==Creative== ==Philips== 53) Sansa m200 |
1311 | 90) Zen Vision:M 30GB 100) GoGear SA9200 54) Sansa c100 | 1311 | 89) Zen X-Fi Style 100) GoGear SA9200 54) Sansa c100 |
1312 | 91) Zen Vision:M 60GB 101) GoGear HDD1630/ 55) Sansa Clip | 1312 | 90) Zen Vision:M 30GB 101) GoGear HDD1630/ 55) Sansa Clip |
1313 | 92) Zen Vision HDD1830 56) Sansa e200v2 | 1313 | 91) Zen Vision:M 60GB HDD1830 56) Sansa e200v2 |
1314 | 93) Zen X-Fi2 102) GoGear HDD6330 57) Sansa m200v4 | 1314 | 92) Zen Vision 102) GoGear HDD6330 57) Sansa m200v4 |
1315 | 94) Zen X-Fi3 58) Sansa Fuze | 1315 | 93) Zen X-Fi2 58) Sansa Fuze |
1316 | 96) Zen X-Fi ==Meizu== 59) Sansa c200v2 | 1316 | 94) Zen X-Fi3 ==Meizu== 59) Sansa c200v2 |
1317 | 97) Zen X-Mozaic 110) M6SL 60) Sansa Clipv2 | 1317 | 96) Zen X-Fi 110) M6SL 60) Sansa Clipv2 |
1318 | 98) Zen 111) M6SP 61) Sansa View | 1318 | 97) Zen X-Mozaic 111) M6SP 61) Sansa View |
1319 | 112) M3 62) Sansa Clip+ | 1319 | 98) Zen 112) M3 62) Sansa Clip+ |
1320 | ==Onda== 63) Sansa Fuze v2 | 1320 | 63) Sansa Fuze v2 |
1321 | 120) VX747 ==Tatung== 64) Sansa Fuze+ | 1321 | ==Onda== ==Tatung== 64) Sansa Fuze+ |
1322 | 121) VX767 150) Elio TPJ-1022 65) Sansa Clip Zip | 1322 | 120) VX747 150) Elio TPJ-1022 65) Sansa Clip Zip |
1323 | 122) VX747+ 66) Sansa Connect | 1323 | 121) VX767 66) Sansa Connect |
1324 | 123) VX777 ==Packard Bell== | 1324 | 122) VX747+ ==Packard Bell== |
1325 | 160) Vibe 500 ==Logik== | 1325 | 123) VX777 160) Vibe 500 ==Logik== |
1326 | ==Samsung== 80) DAX 1GB MP3/DAB | 1326 | 80) DAX 1GB MP3/DAB |
1327 | 140) YH-820 ==MPIO== | 1327 | ==Samsung== ==MPIO== |
1328 | 141) YH-920 170) HD200 ==Lyre project== | 1328 | 140) YH-820 170) HD200 ==Lyre project== |
1329 | 142) YH-925 171) HD300 130) Lyre proto 1 | 1329 | 141) YH-920 171) HD300 130) Lyre proto 1 |
1330 | 143) YP-S3 131) Mini2440 | 1330 | 142) YH-925 131) Mini2440 |
1331 | 144) YP-Z5 | 1331 | 143) YP-S3 |
1332 | ==ROCKCHIP== | 1332 | 144) YP-Z5 ==ROCKCHIP== |
1333 | ==Application== 180) rk27xx generic ==HiFiMAN== | 1333 | 180) rk27xx generic ==HiFiMAN== |
1334 | 200) SDL 190) HM-60x | 1334 | ==Application== 190) HM-60x |
1335 | 201) Android ==HiFi E.T.== 191) HM-801 | 1335 | 200) SDL ==HiFi E.T.== 191) HM-801 |
1336 | 202) Nokia N8xx 210) MA9 | 1336 | 201) Android 210) MA9 |
1337 | 203) Nokia N900 211) MA9C ==Sony== | 1337 | 202) Nokia N8xx 211) MA9C ==Sony== |
1338 | 204) Pandora 212) MA8 220) NWZ-E370/E380 series | 1338 | 203) Nokia N900 212) MA8 220) NWZ-E370/E380 series |
1339 | 205) Samsung YP-R0 213) MA8C 221) NWZ-E360 series | 1339 | 204) Pandora 213) MA8C 221) NWZ-E360 series |
1340 | 205) Samsung YP-R0 | ||
1340 | 206) Android MIPS | 1341 | 206) Android MIPS |
1341 | 207) Android x86 | 1342 | 207) Android x86 |
1342 | 1343 | ||
@@ -2182,6 +2183,26 @@ fi | |||
2182 | t_model="logikdax" | 2183 | t_model="logikdax" |
2183 | ;; | 2184 | ;; |
2184 | 2185 | ||
2186 | 89|creativezenxfistyle) | ||
2187 | target_id=94 | ||
2188 | modelname="creativezenxfistyle" | ||
2189 | target="CREATIVE_ZENXFISTYLE" | ||
2190 | memory=64 | ||
2191 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | ||
2192 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | ||
2193 | tool="$rootdir/tools/scramble -add=zxfs" | ||
2194 | output="rockbox.creative" | ||
2195 | bootoutput="bootloader-zenxfistyle.creative" | ||
2196 | appextra="gui:recorder:radio" | ||
2197 | plugins="" | ||
2198 | swcodec="yes" | ||
2199 | toolset=$scramblebitmaptools | ||
2200 | t_cpu="arm" | ||
2201 | t_manufacturer="imx233" | ||
2202 | t_model="creative-zen" | ||
2203 | arm926ejscc | ||
2204 | ;; | ||
2205 | |||
2185 | 90|zenvisionm30gb) | 2206 | 90|zenvisionm30gb) |
2186 | target_id=35 | 2207 | target_id=35 |
2187 | modelname="zenvisionm30gb" | 2208 | modelname="zenvisionm30gb" |
diff --git a/tools/scramble.c b/tools/scramble.c index ba335d2f2d..5378be2853 100644 --- a/tools/scramble.c +++ b/tools/scramble.c | |||
@@ -129,7 +129,7 @@ void usage(void) | |||
129 | "\t m2v4, fuze, c2v2, clv2, y820, y920, y925, x747,\n" | 129 | "\t m2v4, fuze, c2v2, clv2, y820, y920, y925, x747,\n" |
130 | "\t 747p, x777, nn2g, m244, cli+, fuz2, hd20, hd30,\n" | 130 | "\t 747p, x777, nn2g, m244, cli+, fuz2, hd20, hd30,\n" |
131 | "\t ip6g, rk27, clzp, zxf2, zxf3, fuz+, e370, e360,\n" | 131 | "\t ip6g, rk27, clzp, zxf2, zxf3, fuz+, e370, e360,\n" |
132 | "\t zxfi, zmoz, zen, zenv, ypz5)\n"); | 132 | "\t zxfi, zmoz, zen, zenv, ypz5, zxfs)\n"); |
133 | printf("\nNo option results in Archos standard player/recorder format.\n"); | 133 | printf("\nNo option results in Archos standard player/recorder format.\n"); |
134 | 134 | ||
135 | exit(1); | 135 | exit(1); |
@@ -380,6 +380,8 @@ int main (int argc, char** argv) | |||
380 | modelnum = 89; | 380 | modelnum = 89; |
381 | else if (!strcmp(&argv[1][5], "zen")) /* Creative ZEN */ | 381 | else if (!strcmp(&argv[1][5], "zen")) /* Creative ZEN */ |
382 | modelnum = 90; | 382 | modelnum = 90; |
383 | else if (!strcmp(&argv[1][5], "zxfs")) /* Creative ZEN X-Fi Style */ | ||
384 | modelnum = 94; | ||
383 | else { | 385 | else { |
384 | fprintf(stderr, "unsupported model: %s\n", &argv[1][5]); | 386 | fprintf(stderr, "unsupported model: %s\n", &argv[1][5]); |
385 | return 2; | 387 | return 2; |