summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-19 11:13:58 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-12-19 11:13:58 +0000
commit40ec54305250e9a4a5e54a293abb974121d4a110 (patch)
tree7b96a79ea493ea18432eb73efa3c1954e6699b5f
parent9bf93ba0075adf2b9e3291497e06918634d39880 (diff)
downloadrockbox-40ec54305250e9a4a5e54a293abb974121d4a110.tar.gz
rockbox-40ec54305250e9a4a5e54a293abb974121d4a110.zip
* Add support for Onda VX747+ (FS#9674 by Olivier Barbut)
* Fix Onda VX767 support * Small cleanup git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19481 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-x[-rw-r--r--]bootloader/SOURCES2
-rwxr-xr-x[-rw-r--r--]bootloader/ondavx747.c55
-rwxr-xr-x[-rw-r--r--]docs/CREDITS1
-rwxr-xr-x[-rw-r--r--]firmware/SOURCES2
-rwxr-xr-x[-rw-r--r--]firmware/export/config-ondavx747.h2
-rwxr-xr-xfirmware/export/config-ondavx747p.h164
-rwxr-xr-x[-rw-r--r--]firmware/export/config-ondavx767.h16
-rwxr-xr-x[-rw-r--r--]firmware/export/config.h6
-rwxr-xr-x[-rw-r--r--]firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c27
-rwxr-xr-x[-rw-r--r--]firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h20
-rwxr-xr-xtools/configure25
11 files changed, 255 insertions, 65 deletions
diff --git a/bootloader/SOURCES b/bootloader/SOURCES
index 67c0d0eb74..693644df5e 100644..100755
--- a/bootloader/SOURCES
+++ b/bootloader/SOURCES
@@ -40,7 +40,7 @@ meizu_m6sl.c
40meizu_m6sp.c 40meizu_m6sp.c
41#elif defined(MEIZU_M3) 41#elif defined(MEIZU_M3)
42meizu_m3.c 42meizu_m3.c
43#elif defined(ONDA_VX747) || defined(ONDA_VX767) 43#elif defined(ONDA_VX747) || defined(ONDA_VX747P) || defined(ONDA_VX767)
44ondavx747.c 44ondavx747.c
45#elif defined(CREATIVE_ZVx) 45#elif defined(CREATIVE_ZVx)
46creativezvm.c 46creativezvm.c
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c
index 13c537b9be..0695dc0190 100644..100755
--- a/bootloader/ondavx747.c
+++ b/bootloader/ondavx747.c
@@ -21,11 +21,15 @@
21 21
22#include <stdio.h> 22#include <stdio.h>
23#include <stdarg.h> 23#include <stdarg.h>
24#include <string.h>
24#include "config.h" 25#include "config.h"
25#include "jz4740.h" 26#include "jz4740.h"
26#include "backlight.h" 27#include "backlight.h"
27#include "font.h" 28#include "font.h"
28#include "lcd.h" 29#include "lcd.h"
30#include "ata.h"
31#include "usb.h"
32#include "storage.h"
29#include "system.h" 33#include "system.h"
30#include "button.h" 34#include "button.h"
31#include "timefuncs.h" 35#include "timefuncs.h"
@@ -33,14 +37,9 @@
33#include "common.h" 37#include "common.h"
34#include "mipsregs.h" 38#include "mipsregs.h"
35 39
36static void audiotest(void) 40#ifdef ONDA_VX747P
37{ 41 #define ONDA_VX747
38 __i2s_internal_codec(); 42#endif
39 __aic_enable();
40 __aic_reset();
41 __aic_select_i2s();
42 __aic_enable_loopback();
43}
44 43
45int main(void) 44int main(void)
46{ 45{
@@ -54,12 +53,16 @@ int main(void)
54 53
55 backlight_init(); 54 backlight_init();
56 55
56#if 0 /* Enable this when multi storage works */
57 storage_init(); 57 storage_init();
58#else
59 ata_init();
60#endif
58 61
59 int touch, btn; 62 int touch, btn;
60 char datetime[30]; 63 char datetime[30];
61 reset_screen(); 64 reset_screen();
62 printf("Rockbox bootloader v0.000001"); 65 printf("Rockbox bootloader v0.0001");
63 printf("REG_EMC_SACR0: 0x%x", REG_EMC_SACR0); 66 printf("REG_EMC_SACR0: 0x%x", REG_EMC_SACR0);
64 printf("REG_EMC_SACR1: 0x%x", REG_EMC_SACR1); 67 printf("REG_EMC_SACR1: 0x%x", REG_EMC_SACR1);
65 printf("REG_EMC_SACR2: 0x%x", REG_EMC_SACR2); 68 printf("REG_EMC_SACR2: 0x%x", REG_EMC_SACR2);
@@ -85,46 +88,20 @@ int main(void)
85 if(read_c0_config1() & (1 << 6)) printf(" * CP2 available"); 88 if(read_c0_config1() & (1 << 6)) printf(" * CP2 available");
86 printf("C0_STATUS: 0x%x", read_c0_status()); 89 printf("C0_STATUS: 0x%x", read_c0_status());
87 90
88#if 0 91 lcd_puts_scroll(0, 25, "This is a very very long scrolling line.... VERY LONG VERY LONG VERY LONG VERY LONG VERY LONG VERY LONG!!!!!");
89 unsigned char testdata[4096]; 92
90 char msg[30];
91 int j = 1;
92 while(1)
93 {
94 memset(testdata, 0, 4096);
95 reset_screen();
96 jz_nand_read(0, j, &testdata);
97 printf("Page %d", j);
98 int i;
99 for(i=0; i<768; i+=16)
100 {
101 snprintf(msg, 30, "%02x%02x%02x%02x%02x%02x%02x%02x %02x%02x%02x%02x%02x%02x%02x%02x",
102 testdata[i], testdata[i+1], testdata[i+2], testdata[i+3], testdata[i+4], testdata[i+5], testdata[i+6], testdata[i+7],
103 testdata[i+8], testdata[i+9], testdata[i+10], testdata[i+11], testdata[i+12], testdata[i+13], testdata[i+14], testdata[i+15]
104 );
105 printf(msg);
106 }
107 while(!((btn = button_read_device(&touch)) & (BUTTON_VOL_UP|BUTTON_VOL_DOWN)));
108 if(btn & BUTTON_VOL_UP)
109 j++;
110 if(btn & BUTTON_VOL_DOWN)
111 j--;
112 if(j<0)
113 j = 0;
114 }
115#endif
116 while(1) 93 while(1)
117 { 94 {
118#ifdef ONDA_VX747 95#ifdef ONDA_VX747
119#if 1 96#if 1
120 btn = button_get(false); 97 btn = button_get(false);
121 touch = button_get_data(); 98 touch = button_get_data();
122#else 99#else /* button_get() has performance issues */
123 btn = button_read_device(&touch); 100 btn = button_read_device(&touch);
124#endif 101#endif
125#else 102#else
126 btn = button_read_device(); 103 btn = button_read_device();
127#endif 104#endif /* ONDA_VX747 */
128#define KNOP(x,y) lcd_set_foreground(LCD_BLACK); \ 105#define KNOP(x,y) lcd_set_foreground(LCD_BLACK); \
129 if(btn & x) \ 106 if(btn & x) \
130 lcd_set_foreground(LCD_WHITE); \ 107 lcd_set_foreground(LCD_WHITE); \
diff --git a/docs/CREDITS b/docs/CREDITS
index aef990ecaf..0fdcd27dbe 100644..100755
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -439,6 +439,7 @@ Anton Veretenenko
439Vicente Ibarra 439Vicente Ibarra
440Rui Araújo 440Rui Araújo
441Brian Cloutier 441Brian Cloutier
442Olivier Barbut
442 443
443 444
444The libmad team 445The libmad team
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 278fcda9d6..711a7c0c56 100644..100755
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -1215,7 +1215,7 @@ target/mips/ingenic_jz47xx/usb-jz4740.c
1215drivers/nand_id.c 1215drivers/nand_id.c
1216#endif 1216#endif
1217 1217
1218#ifdef ONDA_VX747 1218#if defined(ONDA_VX747) || defined(ONDA_VX747P)
1219target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx747.c 1219target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx747.c
1220target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c 1220target/mips/ingenic_jz47xx/onda_vx747/lcd-onda_vx747.c
1221target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c 1221target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
diff --git a/firmware/export/config-ondavx747.h b/firmware/export/config-ondavx747.h
index e92e5a9829..2856e7e16d 100644..100755
--- a/firmware/export/config-ondavx747.h
+++ b/firmware/export/config-ondavx747.h
@@ -161,6 +161,4 @@
161#define USB_VENDOR_ID 0x041e 161#define USB_VENDOR_ID 0x041e
162#define USB_PRODUCT_ID 0x4133 162#define USB_PRODUCT_ID 0x4133
163 163
164#include <stdbool.h> /* HACKY */
165
166#endif 164#endif
diff --git a/firmware/export/config-ondavx747p.h b/firmware/export/config-ondavx747p.h
new file mode 100755
index 0000000000..5c4d3e7aea
--- /dev/null
+++ b/firmware/export/config-ondavx747p.h
@@ -0,0 +1,164 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Olivier Barbut
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/*
23 * This config file is for the Onda VX747+
24 */
25#define TARGET_TREE /* this target is using the target tree system */
26
27#define CONFIG_SDRAM_START 0x80004000
28
29#define ONDA_VX747P 1
30
31#define MODEL_NAME "Onda VX747+"
32
33/* For Rolo and boot loader */
34#define MODEL_NUMBER 44
35
36//#define HAVE_ATA_SD
37//#define HAVE_HOTSWAP
38
39//#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD)
40#define CONFIG_STORAGE STORAGE_RAMDISK /* Multivolume currently handled at firmware/target/ level */
41
42#define CONFIG_NAND NAND_CC
43
44#define HAVE_MULTIVOLUME
45
46/* define this if you have a bitmap LCD display */
47#define HAVE_LCD_BITMAP
48
49/* define this if you have a colour LCD */
50#define HAVE_LCD_COLOR
51
52/* define this if you have access to the quickscreen */
53#define HAVE_QUICKSCREEN
54
55/* define this if you have access to the pitchscreen */
56#define HAVE_PITCHSCREEN
57
58/* define this if you would like tagcache to build on this target */
59#define HAVE_TAGCACHE
60
61/* define this if the target has volume keys which can be used in the lists */
62#define HAVE_VOLUME_IN_LIST
63
64/* LCD dimensions */
65#define CONFIG_LCD LCD_ONDAVX747
66
67#define LCD_WIDTH 240
68#define LCD_HEIGHT 400
69
70#define LCD_DEPTH 16 /* 16bit colours */
71#define LCD_PIXELFORMAT RGB565 /* rgb565 */
72
73/* Define this if your LCD can be enabled/disabled */
74#define HAVE_LCD_ENABLE
75
76#define CONFIG_KEYPAD ONDAVX747_PAD
77#define HAVE_TOUCHSCREEN
78#define HAVE_BUTTON_DATA
79
80/* Define this if you do software codec */
81#define CONFIG_CODEC SWCODEC
82
83/* define this if you have a real-time clock */
84#define CONFIG_RTC RTC_JZ47XX
85
86/* Define this for LCD backlight available */
87#define HAVE_BACKLIGHT
88
89#define HAVE_BACKLIGHT_BRIGHTNESS
90
91/* Main LCD backlight brightness range and defaults */
92#define MIN_BRIGHTNESS_SETTING 100
93#define MAX_BRIGHTNESS_SETTING 300
94#define DEFAULT_BRIGHTNESS_SETTING 300 /* "full brightness" */
95#define DEFAULT_DIMNESS_SETTING 100 /* "most dim" */
96
97/* Define this if you have a software controlled poweroff */
98//#define HAVE_SW_POWEROFF
99
100/* The number of bytes reserved for loadable codecs */
101#define CODEC_SIZE 0x100000
102
103/* The number of bytes reserved for loadable plugins */
104#define PLUGIN_BUFFER_SIZE 0x100000
105
106/* Define this if you have the */
107//#define HAVE_INGENIC_CODEC
108
109#define CONFIG_I2C I2C_JZ47XX
110
111/* TLV320 has no tone controls, so we use the software ones */
112//#define HAVE_SW_TONE_CONTROLS
113
114/*#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \
115 SAMPR_CAP_11)*/
116
117#define BATTERY_CAPACITY_DEFAULT 1250 /* default battery capacity */
118#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
119#define BATTERY_CAPACITY_MAX 2500 /* max. capacity selectable */
120#define BATTERY_CAPACITY_INC 100 /* capacity increment */
121#define BATTERY_TYPES_COUNT 1 /* only one type */
122
123/* Hardware controlled charging with monitoring */
124//#define CONFIG_CHARGING CHARGING_MONITOR
125
126#ifndef SIMULATOR
127
128/* Define this if you have a Ingenic JZ4732 */
129#define CONFIG_CPU JZ4732
130
131/* define this if the hardware can be powered off while charging */
132#define HAVE_POWEROFF_WHILE_CHARGING
133
134/* Define this to the CPU frequency */
135#define CPU_FREQ 3686400
136
137/* define this if you have a flash memory storage */
138#define HAVE_FLASH_STORAGE
139
140/* Virtual LED (icon) */
141#define CONFIG_LED LED_VIRTUAL
142
143/* define this if the backlight can be set to a brightness */
144#define __BACKLIGHT_INIT
145
146/* Offset ( in the firmware file's header ) to the file CRC */
147#define FIRMWARE_OFFSET_FILE_CRC 0
148
149/* Offset ( in the firmware file's header ) to the real data */
150#define FIRMWARE_OFFSET_FILE_DATA 8
151
152/* Define this if you have adjustable CPU frequency */
153/* #define HAVE_ADJUSTABLE_CPU_FREQ */
154
155#define BOOTFILE_EXT "vx747p"
156#define BOOTFILE "rockbox." BOOTFILE_EXT
157#define BOOTDIR "/.rockbox"
158
159#define CONFIG_USBOTG USBOTG_JZ4740
160#define HAVE_USBSTACK
161#define USB_VENDOR_ID 0x041e
162#define USB_PRODUCT_ID 0x4133
163
164#endif
diff --git a/firmware/export/config-ondavx767.h b/firmware/export/config-ondavx767.h
index 7a635b50e9..7216ef0d35 100644..100755
--- a/firmware/export/config-ondavx767.h
+++ b/firmware/export/config-ondavx767.h
@@ -33,11 +33,13 @@
33/* For Rolo and boot loader */ 33/* For Rolo and boot loader */
34#define MODEL_NUMBER 36 34#define MODEL_NUMBER 36
35 35
36/* define this if you use an ATA controller */ 36//#define HAVE_ATA_SD
37//#define CONFIG_STORAGE STORAGE_ATA 37//#define HAVE_HOTSWAP
38 38
39#define HAVE_ATA_SD 39//#define CONFIG_STORAGE (STORAGE_NAND | STORAGE_SD)
40#define HAVE_HOTSWAP 40#define CONFIG_STORAGE STORAGE_RAMDISK /* Multivolume currently handled at firmware/target/ level */
41
42#define CONFIG_NAND NAND_CC
41 43
42#define HAVE_MULTIVOLUME 44#define HAVE_MULTIVOLUME
43 45
@@ -152,11 +154,9 @@
152#define BOOTFILE "rockbox." BOOTFILE_EXT 154#define BOOTFILE "rockbox." BOOTFILE_EXT
153#define BOOTDIR "/.rockbox" 155#define BOOTDIR "/.rockbox"
154 156
155/*#define CONFIG_USBOTG USBOTG_INGENIC 157#define CONFIG_USBOTG USBOTG_JZ4740
156#define HAVE_USBSTACK 158#define HAVE_USBSTACK
157#define USB_VENDOR_ID 0x041e 159#define USB_VENDOR_ID 0x041e
158#define USB_PRODUCT_ID 0x4133*/ 160#define USB_PRODUCT_ID 0x4133
159
160#include <stdbool.h> /* HACKY */
161 161
162#endif 162#endif
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 221e9a8124..75aa76a898 100644..100755
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -316,6 +316,8 @@
316#include "config-meizu-m3.h" 316#include "config-meizu-m3.h"
317#elif defined(ONDA_VX747) 317#elif defined(ONDA_VX747)
318#include "config-ondavx747.h" 318#include "config-ondavx747.h"
319#elif defined(ONDA_VX747P)
320#include "config-ondavx747p.h"
319#elif defined(ONDA_VX767) 321#elif defined(ONDA_VX767)
320#include "config-ondavx767.h" 322#include "config-ondavx767.h"
321#elif defined(SANSA_CLIP) 323#elif defined(SANSA_CLIP)
@@ -634,4 +636,8 @@
634#define STORAGE_GET_INFO 636#define STORAGE_GET_INFO
635#endif 637#endif
636 638
639#ifdef CPU_MIPS
640#include <stdbool.h> /* MIPS GCC fix? */
641#endif
642
637#endif /* __CONFIG_H__ */ 643#endif /* __CONFIG_H__ */
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
index 2624eb3d82..1aa98819fe 100644..100755
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/sadc-onda_vx747.c
@@ -27,11 +27,22 @@
27#include "powermgmt.h" 27#include "powermgmt.h"
28#include "kernel.h" 28#include "kernel.h"
29 29
30#ifdef ONDA_VX747
30#define BTN_OFF (1 << 29) 31#define BTN_OFF (1 << 29)
31#define BTN_VOL_DOWN (1 << 27) 32#define BTN_VOL_DOWN (1 << 27)
32#define BTN_HOLD (1 << 16) 33#define BTN_HOLD (1 << 16)
33#define BTN_MENU (1 << 1) 34#define BTN_MENU (1 << 1)
34#define BTN_VOL_UP (1 << 0) 35#define BTN_VOL_UP (1 << 0)
36#elif defined(ONDA_VX747P)
37#define BTN_OFF (1 << 29)
38#define BTN_VOL_DOWN (1 << 27)
39#define BTN_HOLD (1 << 22) /* on REG_GPIO_PXPIN(2) */
40#define BTN_MENU (1 << 20)
41#define BTN_VOL_UP (1 << 19)
42#else
43#error No buttons defined!
44#endif
45
35#define BTN_MASK (BTN_OFF | BTN_VOL_DOWN | \ 46#define BTN_MASK (BTN_OFF | BTN_VOL_DOWN | \
36 BTN_MENU | BTN_VOL_UP) 47 BTN_MENU | BTN_VOL_UP)
37 48
@@ -130,11 +141,19 @@ void button_init_device(void)
130 REG_SADC_CTRL = (~(SADC_CTRL_PENDM | SADC_CTRL_PENUM | SADC_CTRL_TSRDYM | SADC_CTRL_PBATRDYM)); 141 REG_SADC_CTRL = (~(SADC_CTRL_PENDM | SADC_CTRL_PENUM | SADC_CTRL_TSRDYM | SADC_CTRL_PBATRDYM));
131 REG_SADC_ENA = (SADC_ENA_TSEN | SADC_ENA_PBATEN); 142 REG_SADC_ENA = (SADC_ENA_TSEN | SADC_ENA_PBATEN);
132 143
144#ifdef ONDA_VX747
133 __gpio_as_input(32*3 + 29); 145 __gpio_as_input(32*3 + 29);
134 __gpio_as_input(32*3 + 27); 146 __gpio_as_input(32*3 + 27);
135 __gpio_as_input(32*3 + 16); 147 __gpio_as_input(32*3 + 16);
136 __gpio_as_input(32*3 + 1); 148 __gpio_as_input(32*3 + 1);
137 __gpio_as_input(32*3 + 0); 149 __gpio_as_input(32*3 + 0);
150#elif defined(ONDA_VX747P)
151 __gpio_as_input(32*3 + 29);
152 __gpio_as_input(32*3 + 27);
153 __gpio_as_input(32*3 + 20);
154 __gpio_as_input(32*3 + 19);
155 __gpio_as_input(32*2 + 22);
156#endif
138 157
139 mutex_init(&battery_mtx); 158 mutex_init(&battery_mtx);
140} 159}
@@ -173,7 +192,13 @@ int button_read_device(int *data)
173 int ret = 0, tmp; 192 int ret = 0, tmp;
174 193
175 /* Filter button events out if HOLD button is pressed at firmware/ level */ 194 /* Filter button events out if HOLD button is pressed at firmware/ level */
176 if((~REG_GPIO_PXPIN(3)) & BTN_HOLD) 195 if(
196#ifdef ONDA_VX747
197 (~REG_GPIO_PXPIN(3)) & BTN_HOLD
198#elif defined(ONDA_VX747P)
199 (~REG_GPIO_PXPIN(2)) & BTN_HOLD
200#endif
201 )
177 return 0; 202 return 0;
178 203
179 tmp = (~REG_GPIO_PXPIN(3)) & BTN_MASK; 204 tmp = (~REG_GPIO_PXPIN(3)) & BTN_MASK;
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h
index c681bdaa12..887d7415d0 100644..100755
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h
@@ -24,23 +24,19 @@
24 24
25#include "config.h" 25#include "config.h"
26 26
27#define __gpio_as_usb_detect() \
28do { \
29 REG_GPIO_PXFUNS(3) = 0x10000000; \
30 REG_GPIO_PXSELS(3) = 0x10000000; \
31 REG_GPIO_PXPES(3) = 0x10000000; \
32} while (0)
33
34#define GPIO_UDC_DETE (32 * 3 + 28) 27#define GPIO_UDC_DETE (32 * 3 + 28)
35#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE) 28#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE)
36 29
37static inline void usb_init_gpio(void) 30#define USB_INIT_GPIO() \
38{ 31{ \
39 __gpio_as_usb_detect(); 32 REG_GPIO_PXFUNS(3) = 0x10000000; \
40 system_enable_irq(IRQ_UDC); 33 REG_GPIO_PXSELS(3) = 0x10000000; \
41 __gpio_as_input(GPIO_UDC_DETE); 34 REG_GPIO_PXPES(3) = 0x10000000; \
35 __gpio_as_input(GPIO_UDC_DETE); \
42} 36}
43 37
38#define USB_DRV_CONNECTED() (__gpio_get_pin(GPIO_UDC_DETE) == 1)
39
44int usb_detect(void); 40int usb_detect(void);
45void usb_init_device(void); 41void usb_init_device(void);
46bool usb_drv_connected(void); 42bool usb_drv_connected(void);
diff --git a/tools/configure b/tools/configure
index 1d98ca8a6c..979d8cea7c 100755
--- a/tools/configure
+++ b/tools/configure
@@ -711,7 +711,7 @@ cat <<EOF
711 ==Onda== 80) DAX 1GB MP3/DAB 711 ==Onda== 80) DAX 1GB MP3/DAB
712 120) VX747 ==Meizu== 712 120) VX747 ==Meizu==
713 121) VX767 110) M6SL 713 121) VX767 110) M6SL
714 111) M6SP 714 122) VX747+ 111) M6SP
715 112) M3 715 112) M3
716 716
717EOF 717EOF
@@ -1938,6 +1938,29 @@ fi
1938 t_manufacturer="ingenic_jz47xx" 1938 t_manufacturer="ingenic_jz47xx"
1939 t_model="onda_vx767" 1939 t_model="onda_vx767"
1940 ;; 1940 ;;
1941
1942 122|ondavx747p)
1943 target_id=54
1944 modelname="ondavx747p"
1945 target="-DONDA_VX747P"
1946 memory=16 #FIXME
1947 mipselcc
1948 tool="cp"
1949 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1950 bmp2rb_native="$rootdir/tools/bmp2rb -f 4"
1951 output="rockbox.vx747p"
1952 appextra="recorder:gui"
1953 plugins="no" #FIXME
1954 swcodec="yes"
1955 toolset=$genericbitmaptools
1956 boottool="cp"
1957 bootoutput="rockboot.vx747p"
1958 # architecture, manufacturer and model for the target-tree build
1959 t_cpu="mips"
1960 t_manufacturer="ingenic_jz47xx"
1961 t_model="onda_vx747"
1962 ;;
1963
1941 *) 1964 *)
1942 echo "Please select a supported target platform!" 1965 echo "Please select a supported target platform!"
1943 exit 7 1966 exit 7