summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/board/gta0x/init.c
diff options
context:
space:
mode:
authorMychaela Falconia <mychaela.falconia@gmail.com>2019-02-12 01:26:22 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-02-12 01:28:08 +0700
commit432dbdf3b446b292e4445e0483c40bac07e11776 (patch)
treec7467ac109a0249d39a07660541c991af037ec4c /src/target/firmware/board/gta0x/init.c
parente74c5212b587b1a6e0154b60d3cf7d4e122de071 (diff)
firmware/board/gta0x: fix GPIO and ASIC_CONF_REG configuration
Most Calypso peripheral interface signals are unconnected on Openmoko GTA0x. Let's configure them to be GPIOs in IO_CONF_REG, then configure them to be outputs in IO_CNTL_REG, then set the outputs to 0 in ARMIO_LATCH_OUT. Change-Id: I306ffacb623d2b06a188f84026ccadab408d1676
Diffstat (limited to 'src/target/firmware/board/gta0x/init.c')
-rw-r--r--src/target/firmware/board/gta0x/init.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/target/firmware/board/gta0x/init.c b/src/target/firmware/board/gta0x/init.c
index 4f49e802..b93f79c7 100644
--- a/src/target/firmware/board/gta0x/init.c
+++ b/src/target/firmware/board/gta0x/init.c
@@ -49,29 +49,26 @@
#define ARMIO_LATCH_OUT 0xfffe4802
#define IO_CNTL_REG 0xfffe4804
#define ASIC_CONF_REG 0xfffef008
+#define IO_CONF_REG 0xfffef00a
static void board_io_init(void)
{
uint16_t reg;
reg = readw(ASIC_CONF_REG);
- /* LCD Set I/O(3) / SA0 to I/O(3) mode */
- reg &= ~(1 << 10);
- /* Set function pins to I2C Mode */
- reg |= ((1 << 12) | (1 << 7)); /* SCL / SDA */
/* TWL3025: Set SPI+RIF RX clock to rising edge */
reg |= (1 << 13) | (1 << 14);
writew(reg, ASIC_CONF_REG);
- /* LCD Set I/O(3) to output mode */
- reg = readw(IO_CNTL_REG);
- reg &= ~(1 << 3);
- writew(reg, IO_CNTL_REG);
-
- /* LCD Set I/O(3) output low */
- reg = readw(ARMIO_LATCH_OUT);
- reg &= ~(1 << 3);
- writew(reg, ARMIO_LATCH_OUT);
+ /*
+ * Most Calypso peripheral interface signals are unconnected
+ * on this modem. We configure them to be GPIOs in IO_CONF_REG,
+ * then configure them to be outputs in IO_CNTL_REG, then set
+ * the outputs to 0 in ARMIO_LATCH_OUT.
+ */
+ writew(0x03F5, IO_CONF_REG);
+ writew(0xC000, IO_CNTL_REG);
+ writew(0x0000, ARMIO_LATCH_OUT);
}
void board_init(int with_irq)