summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h
diff options
context:
space:
mode:
authorDana Conrad <dconrad@fastmail.com>2021-06-26 12:07:11 -0500
committerAidan MacDonald <amachronic@protonmail.com>2021-07-18 12:14:35 +0000
commit3e7a09cb0dee0ee04b5c77f427bf89d990ec8d0b (patch)
treebe1eb7e1d4166f60b245a0603e9f7dc11e1f5614 /firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h
parent64a24591aec049682167b193700a07572fc04c4c (diff)
downloadrockbox-3e7a09cb0dee0ee04b5c77f427bf89d990ec8d0b.tar.gz
rockbox-3e7a09cb0dee0ee04b5c77f427bf89d990ec8d0b.zip
New Port: Eros Q Native
What works: - LCD: 16-bit RGB565 - all buttons, including scrollwheel - SD Card - Battery level and charging/not charging status - USB - audio - sample rate switching - HP / LO detect, with "safe" fixed LO volume - LO volume will only be put to user-defined max volume if headphones are not present. - rtc - Plugins build, tried a couple and they seem OK - Bootloader, installable to nand via usbboot What doesn't work: - Dual Boot - power on/off has intermittent, low volume audio click (sometimes it's completely silent, sometimes there's a click) - Audio uses 16-bit volume scaling, so clicking/popping is pretty bad at lower volumes - need 32 bit volume scaling, 24 bit I2S data - USB HID keys not yet defined - no jztool support Unknowns: - Stereo Switch pins: Direction select, AC_DC (probably not even hooked up) - What is the actual purpose of the Stereo Swtich? - How does the bluetooth module connect? "Someday" stuff: - get LCD working at higher bit depth - Bluetooth Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h')
-rw-r--r--firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h b/firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h
new file mode 100644
index 0000000000..376eae136e
--- /dev/null
+++ b/firmware/target/mips/ingenic_x1000/erosqnative/gpio-target.h
@@ -0,0 +1,71 @@
1/* -------------------- NOTES ------------------- */
2
3/* I don't think we have any devices on I2C1, the pins /may/ be reused. */
4/* DEFINE_PINGROUP(I2C1, GPIO_C, 3 << 26, GPIOF_DEVICE(0)) */
5
6/* OF has SD Card power listed as 0x2a - PB10, but it seems to work without. */
7
8/* I think BT power reg is pin 0x53 - C19 */
9
10/* USB_DETECT D3 chosen by trial-and-error. */
11
12/* I have a suspicion this isn't right for AXP_IRQ,
13 * and it's not used right now anyway. copied from m3k. */
14/* DEFINE_GPIO(AXP_IRQ, GPIO_PB(10), GPIOF_INPUT) */
15
16/* ---------------------------------------------- */
17
18/* Name Port Pins Function */
19DEFINE_PINGROUP(LCD_DATA, GPIO_A, 0xffff << 0, GPIOF_DEVICE(1))
20DEFINE_PINGROUP(LCD_CONTROL, GPIO_B, 0x1a << 16, GPIOF_DEVICE(1))
21DEFINE_PINGROUP(MSC0, GPIO_A, 0x3f << 20, GPIOF_DEVICE(1))
22DEFINE_PINGROUP(SFC, GPIO_A, 0x3f << 26, GPIOF_DEVICE(1))
23DEFINE_PINGROUP(I2S, GPIO_B, 0x1f << 0, GPIOF_DEVICE(1))
24DEFINE_PINGROUP(I2C2, GPIO_D, 3 << 0, GPIOF_DEVICE(1))
25
26/* Name Pin Function */
27/* mute DAC - 0 - mute, 1 - play. Affects both HP and LO. */
28DEFINE_GPIO(PCM5102A_XMIT, GPIO_PB(12), GPIOF_OUTPUT(0))
29
30/* mute HP amp, no effect on LO. 0 - mute, 1 - play */
31DEFINE_GPIO(MAX97220_SHDN, GPIO_PB(8), GPIOF_OUTPUT(0))
32
33/* mute audio mux, only affects Headphone out.
34 * 0 - play, 1 - mute */
35DEFINE_GPIO(ISL54405_MUTE, GPIO_PB(15), GPIOF_OUTPUT(1))
36
37/* switches HP on/off - 0 HP on, 1 hp off, has no effect on LO.
38 * As best I can tell, it switches HP Out sources between HP amp and something
39 * not implemented - there seem to be resistors missing. */
40DEFINE_GPIO(ISL54405_SEL, GPIO_PB(5), GPIOF_OUTPUT(0))
41
42/* DAC AVDD */
43DEFINE_GPIO(PCM5102A_ANALOG_PWR, GPIO_PB(9), GPIOF_OUTPUT(0))
44
45/* Headphone Amp power */
46DEFINE_GPIO(MAX97220_POWER, GPIO_PB(6), GPIOF_OUTPUT(0))
47
48/* SD card */
49DEFINE_GPIO(MSC0_CD, GPIO_PB(11), GPIOF_INPUT)
50
51/* USB */
52DEFINE_GPIO(USB_DETECT, GPIO_PD(3), GPIOF_INPUT)
53DEFINE_GPIO(USB_DRVVBUS, GPIO_PB(25), GPIOF_OUTPUT(0))
54
55/* LCD */
56DEFINE_GPIO(LCD_PWR, GPIO_PB(14), GPIOF_OUTPUT(0))
57DEFINE_GPIO(LCD_RESET, GPIO_PB(13), GPIOF_OUTPUT(0))
58DEFINE_GPIO(LCD_CE, GPIO_PB(18), GPIOF_OUTPUT(1))
59DEFINE_GPIO(LCD_RD, GPIO_PB(16), GPIOF_OUTPUT(1))
60
61/* Buttons */
62DEFINE_GPIO(BTN_PLAY, GPIO_PA(16), GPIOF_INPUT)
63DEFINE_GPIO(BTN_VOL_UP, GPIO_PA(17), GPIOF_INPUT)
64DEFINE_GPIO(BTN_VOL_DOWN, GPIO_PA(19), GPIOF_INPUT)
65DEFINE_GPIO(BTN_POWER, GPIO_PB(7), GPIOF_INPUT)
66DEFINE_GPIO(BTN_MENU, GPIO_PB(28), GPIOF_INPUT)
67DEFINE_GPIO(BTN_BACK, GPIO_PD(5), GPIOF_INPUT)
68DEFINE_GPIO(BTN_PREV, GPIO_PD(4), GPIOF_INPUT)
69DEFINE_GPIO(BTN_NEXT, GPIO_PC(24), GPIOF_INPUT)
70DEFINE_GPIO(BTN_SCROLL_A, GPIO_PB(24), GPIOF_INPUT)
71DEFINE_GPIO(BTN_SCROLL_B, GPIO_PB(23), GPIOF_INPUT)