summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_jz47xx/onda_vx747
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-01-27 00:38:58 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-01-27 00:38:58 +0000
commita4e7bc383ed296b532a648a02db62a06c99c9ad8 (patch)
tree97ab9a2d4441aebeae7a76ef1c448f10883daadf /firmware/target/mips/ingenic_jz47xx/onda_vx747
parent95577c7996e7a79a71a12e27433cbd5126c0ccd8 (diff)
downloadrockbox-a4e7bc383ed296b532a648a02db62a06c99c9ad8.tar.gz
rockbox-a4e7bc383ed296b532a648a02db62a06c99c9ad8.zip
Onda VX747:
* Implement lcd_flip() * Add support for multiple banks in NAND driver * Add basic I²C driver (untested) * Get audio back working * Add power driver * Other minor fixes and cleanups git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19863 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/onda_vx747')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h19
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c28
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c43
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h2
4 files changed, 73 insertions, 19 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h
index ba324c1dcb..aed2b9cfea 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h
@@ -39,29 +39,12 @@ int _sd_write_sectors(unsigned long start, int count, const void* buf);
39int _sd_init(void); 39int _sd_init(void);
40 40
41#define MMC_CD_PIN (29 + 1 * 32) /* Pin to check card insertion */ 41#define MMC_CD_PIN (29 + 1 * 32) /* Pin to check card insertion */
42//#define MMC_POWER_PIN (22 + 2 * 32) /* Pin to enable/disable card power */
43
44#ifdef MMC_POWER_PIN
45#define MMC_POWER_OFF() \
46do { \
47 __gpio_clear_pin(MMC_POWER_PIN); \
48} while (0)
49
50#define MMC_POWER_ON() \
51do { \
52 __gpio_set_pin(MMC_POWER_PIN); \
53} while (0)
54#endif
55 42
56static inline void mmc_init_gpio(void) 43static inline void mmc_init_gpio(void)
57{ 44{
58 __gpio_as_msc(); 45 __gpio_as_msc();
59 __gpio_as_input(MMC_CD_PIN); 46 __gpio_as_input(MMC_CD_PIN);
60#ifdef MMC_POWER_PIN 47 //__gpio_enable_pull(32*3+29);
61 __gpio_as_func0(MMC_POWER_PIN);
62 __gpio_as_output(MMC_POWER_PIN);
63#endif
64 __gpio_enable_pull(32*3+29);
65 __gpio_enable_pull(32*3+10); 48 __gpio_enable_pull(32*3+10);
66 __gpio_enable_pull(32*3+11); 49 __gpio_enable_pull(32*3+11);
67 __gpio_enable_pull(32*3+12); 50 __gpio_enable_pull(32*3+12);
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c
index faed5ecda2..c07a191bbe 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c
@@ -240,6 +240,34 @@ void lcd_set_target(short x, short y, short width, short height)
240 SLCD_SET_COMMAND(REG_RW_GRAM); /* write data to GRAM */ 240 SLCD_SET_COMMAND(REG_RW_GRAM); /* write data to GRAM */
241} 241}
242 242
243void lcd_set_flip(bool yesno)
244{
245 int i;
246
247 __cpm_start_lcd();
248#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
249 if(yesno)
250 {
251 SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_HWM));
252 }
253 else
254 {
255 SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_VID | ENTRY_MODE_HID | ENTRY_MODE_HWM));
256 }
257#else
258 if(yesno)
259 {
260 SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_HID | ENTRY_MODE_AM));
261 }
262 else
263 {
264 SLCD_SEND_COMMAND(REG_ENTRY_MODE, (ENTRY_MODE_BGR | ENTRY_MODE_VID | ENTRY_MODE_AM));
265 }
266#endif
267 DELAY;
268 __cpm_stop_lcd();
269}
270
243void lcd_on(void) 271void lcd_on(void)
244{ 272{
245 _display_on(); 273 _display_on();
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c
new file mode 100644
index 0000000000..374bc110d6
--- /dev/null
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c
@@ -0,0 +1,43 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2009 by Maurus Cuelenaere
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "power.h"
24#include "jz4740.h"
25
26/* TQ7051 chip */
27#define USB_CHARGER_GPIO (32*1+30) /* STAT port */
28
29/* Detect which power sources are present. */
30unsigned int power_input_status(void)
31{
32 unsigned int status = 0;
33
34 if (__gpio_get_pin(USB_CHARGER_GPIO))
35 status |= POWER_INPUT_USB_CHARGER;
36
37 return status;
38}
39
40void power_init(void)
41{
42 __gpio_as_input(USB_CHARGER_GPIO);
43}
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h
index fbb14b7ac4..0b17bebfc2 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h
@@ -24,7 +24,7 @@
24 24
25#include "config.h" 25#include "config.h"
26 26
27#define GPIO_UDC_DETE (32 * 3 + 28) 27#define GPIO_UDC_DETE (32 * 3 + 28) /* A18 = ADP_CHK */
28#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE) 28#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE)
29#define USB_GPIO_IRQ GPIO124 29#define USB_GPIO_IRQ GPIO124
30 30