diff options
Diffstat (limited to 'apps/osmocomBB/osmocomBB/board/compal_e88/init.c')
-rwxr-xr-x | apps/osmocomBB/osmocomBB/board/compal_e88/init.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/apps/osmocomBB/osmocomBB/board/compal_e88/init.c b/apps/osmocomBB/osmocomBB/board/compal_e88/init.c new file mode 100755 index 0000000000..89a4e61ef9 --- /dev/null +++ b/apps/osmocomBB/osmocomBB/board/compal_e88/init.c @@ -0,0 +1,42 @@ +/* Initialization for the Compal E88 (Motorola C115...C123) */ + +/* (C) 2010 by Harald Welte <laforge@gnumonks.org> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include <stdint.h> +#include <stdio.h> + +#define ARMIO_LATCH_OUT 0xfffe4802 +#define IO_CNTL_REG 0xfffe4804 +#define ASIC_CONF_REG 0xfffef008 + +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); +} |