diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-11-18 20:07:02 +0000 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-11-18 21:44:06 +0000 |
commit | 977a6c3ce7a2ab960590e9d997388cca2e4c29ee (patch) | |
tree | 092ef21d5f2123fee784de7d1ee719270c30c6de | |
parent | a8b816ae9cc00fe216e43d9bd9276b5d8cf12b25 (diff) | |
download | rockbox-977a6c3ce7a2ab960590e9d997388cca2e4c29ee.tar.gz rockbox-977a6c3ce7a2ab960590e9d997388cca2e4c29ee.zip |
Initial commit for the Creative ZEN V
Change-Id: I3408cfdf742ea5995d5c87bf76653f436e1ec2b0
-rw-r--r-- | firmware/SOURCES | 5 | ||||
-rw-r--r-- | firmware/export/config.h | 3 | ||||
-rw-r--r-- | firmware/export/config/creativezenv.h | 196 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/backlight-zen.c | 6 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/button-target.h | 6 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/button-zen.c | 16 | ||||
-rw-r--r-- | firmware/target/arm/imx233/creative-zen/power-zen.c | 12 | ||||
-rw-r--r-- | firmware/target/arm/imx233/emi-imx233.c | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx233/power-imx233.c | 4 | ||||
-rw-r--r-- | firmware/target/arm/imx233/power-imx233.h | 9 | ||||
-rw-r--r-- | firmware/target/arm/imx233/powermgmt-imx233.c | 2 | ||||
-rw-r--r-- | rbutil/mkzenboot/dualboot.c | 13 | ||||
-rw-r--r-- | rbutil/mkzenboot/dualboot.h | 1 | ||||
-rw-r--r-- | rbutil/mkzenboot/dualboot/Makefile | 3 | ||||
-rw-r--r-- | rbutil/mkzenboot/dualboot/dualboot.c | 4 | ||||
-rw-r--r-- | rbutil/mkzenboot/mkzenboot.c | 4 | ||||
-rwxr-xr-x | tools/configure | 20 | ||||
-rw-r--r-- | tools/scramble.c | 4 |
18 files changed, 300 insertions, 10 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index b96912e880..49a4edcc1d 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -1163,13 +1163,16 @@ target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c | |||
1163 | target/arm/tms320dm320/creative-zvm/usb-creativezvm.c | 1163 | target/arm/tms320dm320/creative-zvm/usb-creativezvm.c |
1164 | #endif /* CREATIVE_ZVx */ | 1164 | #endif /* CREATIVE_ZVx */ |
1165 | 1165 | ||
1166 | #if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) | 1166 | #if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) || defined(CREATIVE_ZENMOZAIC) \ |
1167 | || defined(CREATIVE_ZENV) | ||
1167 | target/arm/imx233/creative-zen/fmradio-i2c-zen.c | 1168 | target/arm/imx233/creative-zen/fmradio-i2c-zen.c |
1168 | target/arm/imx233/creative-zen/backlight-zen.c | 1169 | target/arm/imx233/creative-zen/backlight-zen.c |
1169 | # if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) | 1170 | # if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) |
1170 | target/arm/imx233/creative-zen/lcd-zen.c | 1171 | target/arm/imx233/creative-zen/lcd-zen.c |
1171 | # elif defined(CREATIVE_ZENMOZAIC) | 1172 | # elif defined(CREATIVE_ZENMOZAIC) |
1172 | target/arm/imx233/creative-zen/lcd-zenmozaic.c | 1173 | target/arm/imx233/creative-zen/lcd-zenmozaic.c |
1174 | # elif defined(CREATIVE_ZENV) | ||
1175 | target/arm/imx233/creative-zen/lcd-zenv.c | ||
1173 | #endif | 1176 | #endif |
1174 | target/arm/imx233/creative-zen/button-zen.c | 1177 | target/arm/imx233/creative-zen/button-zen.c |
1175 | target/arm/imx233/creative-zen/debug-zen.c | 1178 | target/arm/imx233/creative-zen/debug-zen.c |
diff --git a/firmware/export/config.h b/firmware/export/config.h index ffe34fb81b..3c4c72c054 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -257,6 +257,7 @@ | |||
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 | #define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */ |
260 | #define LCD_CREATIVEZENV 58 /* as used by the Creativr Zen V (Plus) */ | ||
260 | 261 | ||
261 | /* LCD_PIXELFORMAT */ | 262 | /* LCD_PIXELFORMAT */ |
262 | #define HORIZONTAL_PACKING 1 | 263 | #define HORIZONTAL_PACKING 1 |
@@ -531,6 +532,8 @@ Lyre prototype 1 */ | |||
531 | #include "config/creativezenmozaic.h" | 532 | #include "config/creativezenmozaic.h" |
532 | #elif defined(CREATIVE_ZEN) | 533 | #elif defined(CREATIVE_ZEN) |
533 | #include "config/creativezen.h" | 534 | #include "config/creativezen.h" |
535 | #elif defined(CREATIVE_ZENV) | ||
536 | #include "config/creativezenv.h" | ||
534 | #elif defined(MA9) | 537 | #elif defined(MA9) |
535 | #include "config/hifietma9.h" | 538 | #include "config/hifietma9.h" |
536 | #elif defined(MA9C) | 539 | #elif defined(MA9C) |
diff --git a/firmware/export/config/creativezenv.h b/firmware/export/config/creativezenv.h new file mode 100644 index 0000000000..e1758488ec --- /dev/null +++ b/firmware/export/config/creativezenv.h | |||
@@ -0,0 +1,196 @@ | |||
1 | /* | ||
2 | * This config file is for the Creative ZEN V | ||
3 | */ | ||
4 | #define IMX233_SUBTARGET 3600 | ||
5 | #define IMX233_PACKAGE IMX233_BGA169 | ||
6 | #define IMX233_PARTITIONS IMX233_CREATIVE | ||
7 | |||
8 | /* For Rolo and boot loader */ | ||
9 | #define MODEL_NUMBER 85 | ||
10 | #define MODEL_NAME "Creative ZEN V" | ||
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 | ||
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 | /* define this if you would like tagcache to build on this target */ | ||
49 | #define HAVE_TAGCACHE | ||
50 | |||
51 | /* define this if the target has volume keys which can be used in the lists */ | ||
52 | #define HAVE_VOLUME_IN_LIST | ||
53 | |||
54 | /* define this if you have LCD enable function */ | ||
55 | //#define HAVE_LCD_ENABLE | ||
56 | |||
57 | /* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE | ||
58 | should be defined as well. | ||
59 | #define HAVE_LCD_SLEEP | ||
60 | #define HAVE_LCD_SLEEP_SETTING | ||
61 | */ | ||
62 | |||
63 | /* define this if you can flip your LCD | ||
64 | #define HAVE_LCD_FLIP | ||
65 | */ | ||
66 | |||
67 | /* define this if you can invert the colours on your LCD | ||
68 | #define HAVE_LCD_INVERT | ||
69 | */ | ||
70 | |||
71 | /* define this if you have a real-time clock */ | ||
72 | #define CONFIG_RTC RTC_IMX233 | ||
73 | |||
74 | /* define this if you have a real-time clock with alarm facilities */ | ||
75 | #define HAVE_RTC_ALARM | ||
76 | |||
77 | #endif /* !BOOTLOADER */ | ||
78 | |||
79 | /* define this if you have an i.MX23 codec */ | ||
80 | #define HAVE_IMX233_CODEC | ||
81 | |||
82 | /* There is no hardware tone control */ | ||
83 | #define HAVE_SW_TONE_CONTROLS | ||
84 | |||
85 | #define CONFIG_KEYPAD CREATIVE_ZEN_PAD | ||
86 | |||
87 | /* Define this to enable morse code input */ | ||
88 | #define HAVE_MORSE_INPUT | ||
89 | |||
90 | /* Define this if you do software codec */ | ||
91 | #define CONFIG_CODEC SWCODEC | ||
92 | |||
93 | /* LCD dimensions */ | ||
94 | #define LCD_WIDTH 132 | ||
95 | #define LCD_HEIGHT 132 | ||
96 | #define LCD_DEPTH 16 /* 65536 colours */ | ||
97 | #define LCD_PIXELFORMAT RGB565 /* rgb565 */ | ||
98 | |||
99 | /* Define this if you have a software controlled poweroff */ | ||
100 | #define HAVE_SW_POWEROFF | ||
101 | |||
102 | /* Some devices seem to be FAT16 formatted */ | ||
103 | #define HAVE_FAT16SUPPORT | ||
104 | |||
105 | /* The number of bytes reserved for loadable codecs */ | ||
106 | #define CODEC_SIZE 0x100000 | ||
107 | |||
108 | /* The number of bytes reserved for loadable plugins */ | ||
109 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
110 | |||
111 | #define AB_REPEAT_ENABLE | ||
112 | |||
113 | /* Define this for LCD backlight available */ | ||
114 | #define HAVE_BACKLIGHT | ||
115 | #define HAVE_BACKLIGHT_BRIGHTNESS | ||
116 | |||
117 | /* Main LCD backlight brightness range and defaults */ | ||
118 | #define MIN_BRIGHTNESS_SETTING 0 | ||
119 | #define MAX_BRIGHTNESS_SETTING 16 | ||
120 | #define DEFAULT_BRIGHTNESS_SETTING 10 | ||
121 | |||
122 | /* Which backlight fading type? */ | ||
123 | #define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING | ||
124 | |||
125 | /* define this if you have a flash memory storage */ | ||
126 | #define HAVE_FLASH_STORAGE | ||
127 | |||
128 | /* define this if the flash memory uses the SecureDigital Memory Card protocol */ | ||
129 | #define CONFIG_STORAGE STORAGE_ATA | ||
130 | |||
131 | /* todo */ | ||
132 | #define BATTERY_CAPACITY_DEFAULT 550 /* default battery capacity */ | ||
133 | #define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */ | ||
134 | #define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */ | ||
135 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ | ||
136 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
137 | |||
138 | #define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE | ||
139 | |||
140 | /* Charging implemented in a target-specific algorithm */ | ||
141 | //#warning FIXME change this to CHARGING_TARGET when powermgmt is ready | ||
142 | #define CONFIG_CHARGING CHARGING_TARGET | ||
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 an IMX233*/ | ||
148 | #define CONFIG_CPU IMX233 | ||
149 | |||
150 | /* Define this if you want to use the IMX233 i2c interface */ | ||
151 | #define CONFIG_I2C I2C_IMX233 | ||
152 | |||
153 | /* define current usage levels (based on battery bench) */ | ||
154 | #define CURRENT_NORMAL 35 | ||
155 | #define CURRENT_BACKLIGHT 30 | ||
156 | #define CURRENT_RECORD CURRENT_NORMAL | ||
157 | |||
158 | /* maximum charging current */ | ||
159 | #define CURRENT_MAX_CHG 200 | ||
160 | |||
161 | /* Define this to the CPU frequency */ | ||
162 | #define CPU_FREQ 454000000 | ||
163 | |||
164 | /* Type of LCD */ | ||
165 | #define CONFIG_LCD LCD_CREATIVEZENV | ||
166 | |||
167 | /* 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 */ | ||
169 | #define FIRMWARE_OFFSET_FILE_CRC 0x0 | ||
170 | #define FIRMWARE_OFFSET_FILE_DATA 0x8 | ||
171 | |||
172 | /* USB On-the-go */ | ||
173 | #define CONFIG_USBOTG USBOTG_ARC | ||
174 | |||
175 | /* enable these for the experimental usb stack */ | ||
176 | #define HAVE_USBSTACK | ||
177 | //#define USB_HANDLED_BY_OF | ||
178 | #define USE_ROCKBOX_USB | ||
179 | #define USB_VENDOR_ID 0x041e | ||
180 | #define USB_PRODUCT_ID 0x4133 | ||
181 | #define HAVE_USB_HID_MOUSE | ||
182 | #define HAVE_BOOTLOADER_USB_MODE | ||
183 | |||
184 | /* Define this if you have adjustable CPU frequency */ | ||
185 | //#define HAVE_ADJUSTABLE_CPU_FREQ | ||
186 | |||
187 | /* Virtual LED (icon) */ | ||
188 | #define CONFIG_LED LED_VIRTUAL | ||
189 | |||
190 | #define BOOTFILE_EXT "creative" | ||
191 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
192 | #define BOOTDIR "/.rockbox" | ||
193 | |||
194 | #define INCLUDE_TIMEOUT_API | ||
195 | |||
196 | |||
diff --git a/firmware/target/arm/imx233/creative-zen/backlight-zen.c b/firmware/target/arm/imx233/creative-zen/backlight-zen.c index 0d223b52e9..74e1e91a49 100644 --- a/firmware/target/arm/imx233/creative-zen/backlight-zen.c +++ b/firmware/target/arm/imx233/creative-zen/backlight-zen.c | |||
@@ -29,6 +29,9 @@ | |||
29 | 29 | ||
30 | void _backlight_set_brightness(int level) | 30 | void _backlight_set_brightness(int level) |
31 | { | 31 | { |
32 | #ifdef CREATIVE_ZENV | ||
33 | lcd_set_contrast(level); | ||
34 | #else | ||
32 | unsigned val = (level + 200) * level / 1000; | 35 | unsigned val = (level + 200) * level / 1000; |
33 | if(level != 0) | 36 | if(level != 0) |
34 | { | 37 | { |
@@ -39,14 +42,17 @@ void _backlight_set_brightness(int level) | |||
39 | } | 42 | } |
40 | else | 43 | else |
41 | imx233_pinctrl_set_gpio(1, 12, false); | 44 | imx233_pinctrl_set_gpio(1, 12, false); |
45 | #endif | ||
42 | } | 46 | } |
43 | 47 | ||
44 | bool _backlight_init(void) | 48 | bool _backlight_init(void) |
45 | { | 49 | { |
50 | #ifndef CREATIVE_ZENV | ||
46 | imx233_pinctrl_acquire(1, 12, "backlight_enable"); | 51 | imx233_pinctrl_acquire(1, 12, "backlight_enable"); |
47 | imx233_pinctrl_set_function(1, 12, PINCTRL_FUNCTION_GPIO); | 52 | imx233_pinctrl_set_function(1, 12, PINCTRL_FUNCTION_GPIO); |
48 | imx233_pinctrl_enable_gpio(1, 12, true); | 53 | imx233_pinctrl_enable_gpio(1, 12, true); |
49 | imx233_uartdbg_init(BAUD_38400); | 54 | imx233_uartdbg_init(BAUD_38400); |
55 | #endif | ||
50 | return true; | 56 | return true; |
51 | } | 57 | } |
52 | 58 | ||
diff --git a/firmware/target/arm/imx233/creative-zen/button-target.h b/firmware/target/arm/imx233/creative-zen/button-target.h index cddff4d9cc..7974ae42ad 100644 --- a/firmware/target/arm/imx233/creative-zen/button-target.h +++ b/firmware/target/arm/imx233/creative-zen/button-target.h | |||
@@ -47,8 +47,12 @@ bool button_debug_screen(void); | |||
47 | #define BUTTON_TOPLEFT 0x00001000 | 47 | #define BUTTON_TOPLEFT 0x00001000 |
48 | #define BUTTON_TOPRIGHT 0x00002000 | 48 | #define BUTTON_TOPRIGHT 0x00002000 |
49 | #endif | 49 | #endif |
50 | #ifdef CREATIVE_ZENV | ||
51 | #define BUTTON_VOL_UP 0x00004000 | ||
52 | #define BUTTON_VOL_DOWN 0x00008000 | ||
53 | #endif | ||
50 | 54 | ||
51 | #define BUTTON_MAIN 0x00003fff | 55 | #define BUTTON_MAIN 0x0000ffff |
52 | 56 | ||
53 | /* Software power-off */ | 57 | /* Software power-off */ |
54 | #define POWEROFF_BUTTON BUTTON_POWER | 58 | #define POWEROFF_BUTTON BUTTON_POWER |
diff --git a/firmware/target/arm/imx233/creative-zen/button-zen.c b/firmware/target/arm/imx233/creative-zen/button-zen.c index 1997f91357..8f20961a57 100644 --- a/firmware/target/arm/imx233/creative-zen/button-zen.c +++ b/firmware/target/arm/imx233/creative-zen/button-zen.c | |||
@@ -57,6 +57,20 @@ struct imx233_button_lradc_mapping_t imx233_button_lradc_mapping[] = | |||
57 | {2945, BUTTON_PLAYPAUSE}, | 57 | {2945, BUTTON_PLAYPAUSE}, |
58 | {3400, 0}, | 58 | {3400, 0}, |
59 | {0, IMX233_BUTTON_LRADC_END}, | 59 | {0, IMX233_BUTTON_LRADC_END}, |
60 | #elif defined(CREATIVE_ZENV) | ||
61 | {190, IMX233_BUTTON_LRADC_HOLD}, | ||
62 | {250, BUTTON_PLAYPAUSE}, | ||
63 | {530, BUTTON_BACK}, | ||
64 | {785, BUTTON_VOL_UP}, | ||
65 | {1040, BUTTON_VOL_DOWN}, | ||
66 | {1295, BUTTON_MENU}, | ||
67 | {1540, BUTTON_UP}, | ||
68 | {1800, BUTTON_SELECT}, | ||
69 | {2070, BUTTON_LEFT}, | ||
70 | {2315, BUTTON_RIGHT}, | ||
71 | {2550, BUTTON_DOWN}, | ||
72 | {3450, 0}, | ||
73 | {0, IMX233_BUTTON_LRADC_END}, | ||
60 | #elif defined(CREATIVE_ZENMOZAIC) | 74 | #elif defined(CREATIVE_ZENMOZAIC) |
61 | {0, IMX233_BUTTON_LRADC_HOLD}, | 75 | {0, IMX233_BUTTON_LRADC_HOLD}, |
62 | {200, BUTTON_MENU}, | 76 | {200, BUTTON_MENU}, |
@@ -100,7 +114,7 @@ bool headphones_inserted(void) | |||
100 | int button_read_device(void) | 114 | int button_read_device(void) |
101 | { | 115 | { |
102 | int btn = 0; | 116 | int btn = 0; |
103 | if(BF_RD(POWER_STS, PSWITCH) == 1) | 117 | if(imx233_power_read_pswitch() == 1) |
104 | btn |= BUTTON_POWER; | 118 | btn |= BUTTON_POWER; |
105 | return imx233_button_lradc_read(btn); | 119 | return imx233_button_lradc_read(btn); |
106 | } | 120 | } |
diff --git a/firmware/target/arm/imx233/creative-zen/power-zen.c b/firmware/target/arm/imx233/creative-zen/power-zen.c index 2c68325432..c1ad5989c0 100644 --- a/firmware/target/arm/imx233/creative-zen/power-zen.c +++ b/firmware/target/arm/imx233/creative-zen/power-zen.c | |||
@@ -58,4 +58,14 @@ bool tuner_power(bool enable) | |||
58 | bool tuner_powered(void) | 58 | bool tuner_powered(void) |
59 | { | 59 | { |
60 | return tuner_enable; | 60 | return tuner_enable; |
61 | } \ No newline at end of file | 61 | } |
62 | |||
63 | void ide_power_enable(bool on) | ||
64 | { | ||
65 | (void) on; | ||
66 | } | ||
67 | |||
68 | bool ide_powered(void) | ||
69 | { | ||
70 | return true; | ||
71 | } | ||
diff --git a/firmware/target/arm/imx233/emi-imx233.c b/firmware/target/arm/imx233/emi-imx233.c index 1ae6e22f48..259ada0e94 100644 --- a/firmware/target/arm/imx233/emi-imx233.c +++ b/firmware/target/arm/imx233/emi-imx233.c | |||
@@ -196,11 +196,13 @@ struct imx233_emi_info_t imx233_emi_get_info(void) | |||
196 | { | 196 | { |
197 | struct imx233_emi_info_t info; | 197 | struct imx233_emi_info_t info; |
198 | memset(&info, 0, sizeof(info)); | 198 | memset(&info, 0, sizeof(info)); |
199 | #if IMX233_SUBTARGET >= 3700 | ||
199 | info.rows = 13 - BF_RD(DRAM_CTL10, ADDR_PINS); | 200 | info.rows = 13 - BF_RD(DRAM_CTL10, ADDR_PINS); |
200 | info.columns = 12 - BF_RD(DRAM_CTL11, COLUMN_SIZE); | 201 | info.columns = 12 - BF_RD(DRAM_CTL11, COLUMN_SIZE); |
201 | info.cas = BF_RD(DRAM_CTL13, CASLAT_LIN); | 202 | info.cas = BF_RD(DRAM_CTL13, CASLAT_LIN); |
202 | info.banks = 4; | 203 | info.banks = 4; |
203 | info.chips = __builtin_popcount(BF_RD(DRAM_CTL14, CS_MAP)); | 204 | info.chips = __builtin_popcount(BF_RD(DRAM_CTL14, CS_MAP)); |
204 | info.size = 2 * (1 << (info.rows + info.columns)) * info.chips * info.banks; | 205 | info.size = 2 * (1 << (info.rows + info.columns)) * info.chips * info.banks; |
206 | #endif | ||
205 | return info; | 207 | return info; |
206 | } \ No newline at end of file | 208 | } \ No newline at end of file |
diff --git a/firmware/target/arm/imx233/power-imx233.c b/firmware/target/arm/imx233/power-imx233.c index b0e614afe7..af333dea59 100644 --- a/firmware/target/arm/imx233/power-imx233.c +++ b/firmware/target/arm/imx233/power-imx233.c | |||
@@ -124,7 +124,9 @@ void INT_VDD5V(void) | |||
124 | 124 | ||
125 | void imx233_power_init(void) | 125 | void imx233_power_init(void) |
126 | { | 126 | { |
127 | #if IMX233_SUBTARGET >= 3700 | ||
127 | BF_CLR(POWER_MINPWR, HALF_FETS); | 128 | BF_CLR(POWER_MINPWR, HALF_FETS); |
129 | #endif | ||
128 | /* setup vbusvalid parameters: set threshold to 4v and power up comparators */ | 130 | /* setup vbusvalid parameters: set threshold to 4v and power up comparators */ |
129 | BF_CLR(POWER_5VCTRL, VBUSVALID_TRSH); | 131 | BF_CLR(POWER_5VCTRL, VBUSVALID_TRSH); |
130 | BF_SETV(POWER_5VCTRL, VBUSVALID_TRSH, 1); | 132 | BF_SETV(POWER_5VCTRL, VBUSVALID_TRSH, 1); |
@@ -155,8 +157,10 @@ void imx233_power_init(void) | |||
155 | BF_SET(POWER_CTRL, POLARITY_VDD5V_GT_VDDIO); | 157 | BF_SET(POWER_CTRL, POLARITY_VDD5V_GT_VDDIO); |
156 | BF_SET(POWER_CTRL, ENIRQ_VDD5V_GT_VDDIO); | 158 | BF_SET(POWER_CTRL, ENIRQ_VDD5V_GT_VDDIO); |
157 | /* make the vbusvalid detection way is not enabled */ | 159 | /* make the vbusvalid detection way is not enabled */ |
160 | #if IMX233_SUBTARGET >= 3700 | ||
158 | BF_CLR(POWER_CTRL, ENIRQ_VBUS_VALID); | 161 | BF_CLR(POWER_CTRL, ENIRQ_VBUS_VALID); |
159 | #endif | 162 | #endif |
163 | #endif | ||
160 | /* the VDD5V IRQ is shared by several sources, disable them */ | 164 | /* the VDD5V IRQ is shared by several sources, disable them */ |
161 | #if IMX233_SUBTARGET >= 3700 | 165 | #if IMX233_SUBTARGET >= 3700 |
162 | BF_CLR(POWER_CTRL, ENIRQ_PSWITCH); | 166 | BF_CLR(POWER_CTRL, ENIRQ_PSWITCH); |
diff --git a/firmware/target/arm/imx233/power-imx233.h b/firmware/target/arm/imx233/power-imx233.h index 59ffcd37a2..9888bebe1f 100644 --- a/firmware/target/arm/imx233/power-imx233.h +++ b/firmware/target/arm/imx233/power-imx233.h | |||
@@ -119,6 +119,15 @@ static inline void imx233_power_set_dcdc_freq(bool pll, unsigned freq) | |||
119 | } | 119 | } |
120 | #endif | 120 | #endif |
121 | 121 | ||
122 | static inline unsigned imx233_power_read_pswitch(void) | ||
123 | { | ||
124 | #if IMX233_SUBTARGET >= 3700 | ||
125 | return BF_RD(POWER_STS, PSWITCH); | ||
126 | #else | ||
127 | return BF_RD(DIGCTL_STATUS, PSWITCH); | ||
128 | #endif | ||
129 | } | ||
130 | |||
122 | #if IMX233_SUBTARGET < 3700 | 131 | #if IMX233_SUBTARGET < 3700 |
123 | /* return -1 on error */ | 132 | /* return -1 on error */ |
124 | int imx233_power_sense_die_temperature(int *min, int *max); | 133 | int imx233_power_sense_die_temperature(int *min, int *max); |
diff --git a/firmware/target/arm/imx233/powermgmt-imx233.c b/firmware/target/arm/imx233/powermgmt-imx233.c index 9819406974..895c91dda2 100644 --- a/firmware/target/arm/imx233/powermgmt-imx233.c +++ b/firmware/target/arm/imx233/powermgmt-imx233.c | |||
@@ -48,9 +48,9 @@ void imx233_powermgmt_init(void) | |||
48 | { | 48 | { |
49 | imx233_power_set_charge_current(IMX233_CHARGE_CURRENT); | 49 | imx233_power_set_charge_current(IMX233_CHARGE_CURRENT); |
50 | imx233_power_set_stop_current(IMX233_STOP_CURRENT); | 50 | imx233_power_set_stop_current(IMX233_STOP_CURRENT); |
51 | #if IMX233_SUBTARGET >= 3700 | ||
51 | /* assume that adc_init was called and battery monitoring via LRADC setup */ | 52 | /* assume that adc_init was called and battery monitoring via LRADC setup */ |
52 | BF_WR(POWER_BATTMONITOR, EN_BATADJ, 1); | 53 | BF_WR(POWER_BATTMONITOR, EN_BATADJ, 1); |
53 | #if IMX233_SUBTARGET >= 3700 | ||
54 | /* setup linear regulator offsets to 25 mV below to prevent contention between | 54 | /* setup linear regulator offsets to 25 mV below to prevent contention between |
55 | * linear regulators and DCDC */ | 55 | * linear regulators and DCDC */ |
56 | BF_WR(POWER_VDDDCTRL, LINREG_OFFSET, 2); | 56 | BF_WR(POWER_VDDDCTRL, LINREG_OFFSET, 2); |
diff --git a/rbutil/mkzenboot/dualboot.c b/rbutil/mkzenboot/dualboot.c index 42baada495..4c98468b3b 100644 --- a/rbutil/mkzenboot/dualboot.c +++ b/rbutil/mkzenboot/dualboot.c | |||
@@ -41,3 +41,16 @@ unsigned char dualboot_zen[168] = { | |||
41 | 0x00, 0x00, 0x05, 0x80, 0xa4, 0x00, 0x00, 0x41, 0xda, 0x00, 0xeb, 0x1c, 0x00, 0x00, 0x00, 0x00, | 41 | 0x00, 0x00, 0x05, 0x80, 0xa4, 0x00, 0x00, 0x41, 0xda, 0x00, 0xeb, 0x1c, 0x00, 0x00, 0x00, 0x00, |
42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
43 | }; | 43 | }; |
44 | unsigned char dualboot_zenv[168] = { | ||
45 | 0x10, 0x40, 0x2d, 0xe9, 0x7c, 0x30, 0x9f, 0xe5, 0x00, 0x30, 0x93, 0xe5, 0x78, 0x20, 0x9f, 0xe5, | ||
46 | 0x00, 0x00, 0x92, 0xe5, 0x74, 0x20, 0x9f, 0xe5, 0x02, 0x11, 0xa0, 0xe3, 0x08, 0x10, 0x82, 0xe5, | ||
47 | 0x03, 0x11, 0x81, 0xe2, 0x08, 0x10, 0x82, 0xe5, 0xff, 0x14, 0x81, 0xe2, 0x58, 0x10, 0x82, 0xe5, | ||
48 | 0xc2, 0x14, 0x81, 0xe2, 0x24, 0x10, 0x82, 0xe5, 0x01, 0x10, 0xa0, 0xe3, 0x18, 0x10, 0x82, 0xe5, | ||
49 | 0x04, 0x10, 0x82, 0xe5, 0x02, 0x10, 0xa0, 0xe1, 0x10, 0x20, 0x91, 0xe5, 0x01, 0x00, 0x12, 0xe3, | ||
50 | 0xfc, 0xff, 0xff, 0x0a, 0x34, 0x20, 0x9f, 0xe5, 0x50, 0x20, 0x92, 0xe5, 0xff, 0x24, 0xc2, 0xe3, | ||
51 | 0x3f, 0x27, 0xc2, 0xe3, 0xa5, 0x2e, 0x42, 0xe2, 0x0a, 0x20, 0x42, 0xe2, 0x63, 0x00, 0x52, 0xe3, | ||
52 | 0x00, 0x30, 0xa0, 0x93, 0x20, 0x00, 0x83, 0x95, 0x14, 0x20, 0x9f, 0xe5, 0x00, 0x00, 0x92, 0xe5, | ||
53 | 0x33, 0xff, 0x2f, 0xe1, 0x10, 0x80, 0xbd, 0xe8, 0xa0, 0x00, 0x00, 0x61, 0x9c, 0x00, 0x00, 0x61, | ||
54 | 0x00, 0x00, 0x05, 0x80, 0xa4, 0x00, 0x00, 0x61, 0xda, 0x00, 0xeb, 0x1c, 0x00, 0x00, 0x00, 0x00, | ||
55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
56 | }; | ||
diff --git a/rbutil/mkzenboot/dualboot.h b/rbutil/mkzenboot/dualboot.h index c6c2d402d0..2497d2900c 100644 --- a/rbutil/mkzenboot/dualboot.h +++ b/rbutil/mkzenboot/dualboot.h | |||
@@ -3,3 +3,4 @@ | |||
3 | extern unsigned char dualboot_zenmozaic[168]; | 3 | extern unsigned char dualboot_zenmozaic[168]; |
4 | extern unsigned char dualboot_zenxfi[168]; | 4 | extern unsigned char dualboot_zenxfi[168]; |
5 | extern unsigned char dualboot_zen[168]; | 5 | extern unsigned char dualboot_zen[168]; |
6 | extern unsigned char dualboot_zenv[168]; | ||
diff --git a/rbutil/mkzenboot/dualboot/Makefile b/rbutil/mkzenboot/dualboot/Makefile index cc8c604f6e..752cc3ca28 100644 --- a/rbutil/mkzenboot/dualboot/Makefile +++ b/rbutil/mkzenboot/dualboot/Makefile | |||
@@ -11,10 +11,11 @@ LDFLAGS= | |||
11 | # 1) add x to the list in TARGETS | 11 | # 1) add x to the list in TARGETS |
12 | # 2) create a variable named OPT_x of the form: | 12 | # 2) create a variable named OPT_x of the form: |
13 | # OPT_x=target specific defines | 13 | # OPT_x=target specific defines |
14 | TARGETS=zenmozaic zenxfi zen | 14 | TARGETS=zenmozaic zenxfi zen zenv |
15 | OPT_zenmozaic=-DCREATIVE_ZENMOZAIC -DIMX233_SUBTARGET=3700 | 15 | OPT_zenmozaic=-DCREATIVE_ZENMOZAIC -DIMX233_SUBTARGET=3700 |
16 | OPT_zenxfi=-DCREATIVE_ZENXFI -DIMX233_SUBTARGET=3700 | 16 | OPT_zenxfi=-DCREATIVE_ZENXFI -DIMX233_SUBTARGET=3700 |
17 | OPT_zen=-DCREATIVE_ZEN -DIMX233_SUBTARGET=3700 | 17 | OPT_zen=-DCREATIVE_ZEN -DIMX233_SUBTARGET=3700 |
18 | OPT_zenv=-DCREATIVE_ZENV -DIMX233_SUBTARGET=3600 | ||
18 | 19 | ||
19 | BOOTLDS=$(patsubst %, dualboot_%.lds, $(TARGETS)) | 20 | BOOTLDS=$(patsubst %, dualboot_%.lds, $(TARGETS)) |
20 | BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) | 21 | BOOTOBJS=$(patsubst %, dualboot_%.o, $(TARGETS)) |
diff --git a/rbutil/mkzenboot/dualboot/dualboot.c b/rbutil/mkzenboot/dualboot/dualboot.c index d0587fa65d..0b32772afb 100644 --- a/rbutil/mkzenboot/dualboot/dualboot.c +++ b/rbutil/mkzenboot/dualboot/dualboot.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "regs-pinctrl.h" | 21 | #include "regs-pinctrl.h" |
22 | #include "regs-power.h" | 22 | #include "regs-power.h" |
23 | #include "regs-lradc.h" | 23 | #include "regs-lradc.h" |
24 | #include "regs-digctl.h" | ||
24 | 25 | ||
25 | typedef unsigned long uint32_t; | 26 | typedef unsigned long uint32_t; |
26 | 27 | ||
@@ -83,7 +84,8 @@ static inline void __attribute__((noreturn)) power_down() | |||
83 | * Boot decision functions | 84 | * Boot decision functions |
84 | */ | 85 | */ |
85 | 86 | ||
86 | #if defined(CREATIVE_ZENMOZAIC) || defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) | 87 | #if defined(CREATIVE_ZENMOZAIC) || defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) \ |
88 | || defined(CREATIVE_ZENV) | ||
87 | static enum boot_t boot_decision() | 89 | static enum boot_t boot_decision() |
88 | { | 90 | { |
89 | setup_lradc(0); // setup LRADC channel 0 to read keys | 91 | setup_lradc(0); // setup LRADC channel 0 to read keys |
diff --git a/rbutil/mkzenboot/mkzenboot.c b/rbutil/mkzenboot/mkzenboot.c index 0a597d1a91..2817b7e666 100644 --- a/rbutil/mkzenboot/mkzenboot.c +++ b/rbutil/mkzenboot/mkzenboot.c | |||
@@ -94,7 +94,7 @@ static struct player_info_t zen_players[] = | |||
94 | {"Zen SleekPhoto", null_key_v1, tl_zsp_key, true, NULL}, | 94 | {"Zen SleekPhoto", null_key_v1, tl_zsp_key, true, NULL}, |
95 | {"Zen Touch", null_key_v1, tl_zt_key, true, NULL}, | 95 | {"Zen Touch", null_key_v1, tl_zt_key, true, NULL}, |
96 | {"Zen Xtra", null_key_v1, tl_zx_key, true, NULL}, | 96 | {"Zen Xtra", null_key_v1, tl_zx_key, true, NULL}, |
97 | {"Zen V", null_key_v3, tl_zenv_key, false, NULL}, | 97 | {"Zen V", null_key_v3, tl_zenv_key, false, "Creative ZEN V"}, |
98 | {"Zen V Plus", null_key_v3, tl_zenvp_key, false, NULL}, | 98 | {"Zen V Plus", null_key_v3, tl_zenvp_key, false, NULL}, |
99 | {"Zen V Video", null_key_v3, tl_zenvv_key, false, NULL}, | 99 | {"Zen V Video", null_key_v3, tl_zenvv_key, false, NULL}, |
100 | {NULL, NULL, NULL, false, NULL} | 100 | {NULL, NULL, NULL, false, NULL} |
@@ -130,7 +130,7 @@ static const struct zen_model_desc_t zen_models[] = | |||
130 | }, | 130 | }, |
131 | [MODEL_ZENV] = | 131 | [MODEL_ZENV] = |
132 | { | 132 | { |
133 | "Zen V", "zenv", 85, 0x60000000, NULL, 0 | 133 | "Zen V", "zenv", 85, 0x61000000, dualboot_zenv, sizeof(dualboot_zenv) |
134 | }, | 134 | }, |
135 | [MODEL_ZENXFI] = | 135 | [MODEL_ZENXFI] = |
136 | { | 136 | { |
diff --git a/tools/configure b/tools/configure index fac8607f79..71bd8d6029 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -2282,6 +2282,26 @@ fi | |||
2282 | arm926ejscc | 2282 | arm926ejscc |
2283 | ;; | 2283 | ;; |
2284 | 2284 | ||
2285 | 95|creativezenv) | ||
2286 | target_id=85 | ||
2287 | modelname="creativezenv" | ||
2288 | target="CREATIVE_ZENV" | ||
2289 | memory=32 | ||
2290 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | ||
2291 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | ||
2292 | tool="$rootdir/tools/scramble -add=zenv" | ||
2293 | output="rockbox.creative" | ||
2294 | bootoutput="bootloader-zenv.creative" | ||
2295 | appextra="radio:gui:recorder" | ||
2296 | plugins="" | ||
2297 | swcodec="yes" | ||
2298 | toolset=$scramblebitmaptools | ||
2299 | t_cpu="arm" | ||
2300 | t_manufacturer="imx233" | ||
2301 | t_model="creative-zen" | ||
2302 | arm926ejscc | ||
2303 | ;; | ||
2304 | |||
2285 | 96|creativezenxfi) | 2305 | 96|creativezenxfi) |
2286 | target_id=86 | 2306 | target_id=86 |
2287 | modelname="creativezenxfi" | 2307 | modelname="creativezenxfi" |
diff --git a/tools/scramble.c b/tools/scramble.c index 25f71e089c..ef7c41befb 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)\n"); | 132 | "\t zxfi, zmoz, zen, zenv)\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); |
@@ -366,6 +366,8 @@ int main (int argc, char** argv) | |||
366 | modelnum = 82; | 366 | modelnum = 82; |
367 | else if (!strcmp(&argv[1][5], "zxf3")) /* Creative Zen X-Fi3 */ | 367 | else if (!strcmp(&argv[1][5], "zxf3")) /* Creative Zen X-Fi3 */ |
368 | modelnum = 83; | 368 | modelnum = 83; |
369 | else if (!strcmp(&argv[1][5], "zenv")) /* Creative Zen V */ | ||
370 | modelnum = 85; | ||
369 | else if (!strcmp(&argv[1][5], "zxfi")) /* Creative ZEN X-Fi */ | 371 | else if (!strcmp(&argv[1][5], "zxfi")) /* Creative ZEN X-Fi */ |
370 | modelnum = 86; | 372 | modelnum = 86; |
371 | else if (!strcmp(&argv[1][5], "zmoz")) /* Creative ZEN Mozaic*/ | 373 | else if (!strcmp(&argv[1][5], "zmoz")) /* Creative ZEN Mozaic*/ |