summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/imx233/creative-zen/backlight-zen.c6
-rw-r--r--firmware/target/arm/imx233/creative-zen/button-target.h6
-rw-r--r--firmware/target/arm/imx233/creative-zen/button-zen.c16
-rw-r--r--firmware/target/arm/imx233/creative-zen/power-zen.c12
-rw-r--r--firmware/target/arm/imx233/emi-imx233.c2
-rw-r--r--firmware/target/arm/imx233/power-imx233.c4
-rw-r--r--firmware/target/arm/imx233/power-imx233.h9
-rw-r--r--firmware/target/arm/imx233/powermgmt-imx233.c2
8 files changed, 53 insertions, 4 deletions
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 @@
void _backlight_set_brightness(int level)
{
+#ifdef CREATIVE_ZENV
+ lcd_set_contrast(level);
+#else
unsigned val = (level + 200) * level / 1000;
if(level != 0)
{
@@ -39,14 +42,17 @@ void _backlight_set_brightness(int level)
}
else
imx233_pinctrl_set_gpio(1, 12, false);
+#endif
}
bool _backlight_init(void)
{
+#ifndef CREATIVE_ZENV
imx233_pinctrl_acquire(1, 12, "backlight_enable");
imx233_pinctrl_set_function(1, 12, PINCTRL_FUNCTION_GPIO);
imx233_pinctrl_enable_gpio(1, 12, true);
imx233_uartdbg_init(BAUD_38400);
+#endif
return true;
}
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);
#define BUTTON_TOPLEFT 0x00001000
#define BUTTON_TOPRIGHT 0x00002000
#endif
+#ifdef CREATIVE_ZENV
+#define BUTTON_VOL_UP 0x00004000
+#define BUTTON_VOL_DOWN 0x00008000
+#endif
-#define BUTTON_MAIN 0x00003fff
+#define BUTTON_MAIN 0x0000ffff
/* Software power-off */
#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[] =
{2945, BUTTON_PLAYPAUSE},
{3400, 0},
{0, IMX233_BUTTON_LRADC_END},
+#elif defined(CREATIVE_ZENV)
+ {190, IMX233_BUTTON_LRADC_HOLD},
+ {250, BUTTON_PLAYPAUSE},
+ {530, BUTTON_BACK},
+ {785, BUTTON_VOL_UP},
+ {1040, BUTTON_VOL_DOWN},
+ {1295, BUTTON_MENU},
+ {1540, BUTTON_UP},
+ {1800, BUTTON_SELECT},
+ {2070, BUTTON_LEFT},
+ {2315, BUTTON_RIGHT},
+ {2550, BUTTON_DOWN},
+ {3450, 0},
+ {0, IMX233_BUTTON_LRADC_END},
#elif defined(CREATIVE_ZENMOZAIC)
{0, IMX233_BUTTON_LRADC_HOLD},
{200, BUTTON_MENU},
@@ -100,7 +114,7 @@ bool headphones_inserted(void)
int button_read_device(void)
{
int btn = 0;
- if(BF_RD(POWER_STS, PSWITCH) == 1)
+ if(imx233_power_read_pswitch() == 1)
btn |= BUTTON_POWER;
return imx233_button_lradc_read(btn);
}
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)
bool tuner_powered(void)
{
return tuner_enable;
-} \ No newline at end of file
+}
+
+void ide_power_enable(bool on)
+{
+ (void) on;
+}
+
+bool ide_powered(void)
+{
+ return true;
+}
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)
{
struct imx233_emi_info_t info;
memset(&info, 0, sizeof(info));
+#if IMX233_SUBTARGET >= 3700
info.rows = 13 - BF_RD(DRAM_CTL10, ADDR_PINS);
info.columns = 12 - BF_RD(DRAM_CTL11, COLUMN_SIZE);
info.cas = BF_RD(DRAM_CTL13, CASLAT_LIN);
info.banks = 4;
info.chips = __builtin_popcount(BF_RD(DRAM_CTL14, CS_MAP));
info.size = 2 * (1 << (info.rows + info.columns)) * info.chips * info.banks;
+#endif
return info;
} \ 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)
void imx233_power_init(void)
{
+#if IMX233_SUBTARGET >= 3700
BF_CLR(POWER_MINPWR, HALF_FETS);
+#endif
/* setup vbusvalid parameters: set threshold to 4v and power up comparators */
BF_CLR(POWER_5VCTRL, VBUSVALID_TRSH);
BF_SETV(POWER_5VCTRL, VBUSVALID_TRSH, 1);
@@ -155,8 +157,10 @@ void imx233_power_init(void)
BF_SET(POWER_CTRL, POLARITY_VDD5V_GT_VDDIO);
BF_SET(POWER_CTRL, ENIRQ_VDD5V_GT_VDDIO);
/* make the vbusvalid detection way is not enabled */
+#if IMX233_SUBTARGET >= 3700
BF_CLR(POWER_CTRL, ENIRQ_VBUS_VALID);
#endif
+#endif
/* the VDD5V IRQ is shared by several sources, disable them */
#if IMX233_SUBTARGET >= 3700
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)
}
#endif
+static inline unsigned imx233_power_read_pswitch(void)
+{
+#if IMX233_SUBTARGET >= 3700
+ return BF_RD(POWER_STS, PSWITCH);
+#else
+ return BF_RD(DIGCTL_STATUS, PSWITCH);
+#endif
+}
+
#if IMX233_SUBTARGET < 3700
/* return -1 on error */
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)
{
imx233_power_set_charge_current(IMX233_CHARGE_CURRENT);
imx233_power_set_stop_current(IMX233_STOP_CURRENT);
+#if IMX233_SUBTARGET >= 3700
/* assume that adc_init was called and battery monitoring via LRADC setup */
BF_WR(POWER_BATTMONITOR, EN_BATADJ, 1);
-#if IMX233_SUBTARGET >= 3700
/* setup linear regulator offsets to 25 mV below to prevent contention between
* linear regulators and DCDC */
BF_WR(POWER_VDDDCTRL, LINREG_OFFSET, 2);