From 432dbdf3b446b292e4445e0483c40bac07e11776 Mon Sep 17 00:00:00 2001 From: Mychaela Falconia Date: Tue, 12 Feb 2019 01:26:22 +0700 Subject: 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 --- src/target/firmware/board/gta0x/init.c | 23 ++++++++++------------- 1 file 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) -- cgit v1.2.3