blob: f556b2059754480ce274d86f645afb419bb67dc8 [file] [log] [blame]
Mark F. Brown1bbd7082010-09-12 23:51:34 -04001/*
2 * linux/arch/arm/mach-mmp/teton_bga.c
3 *
4 * Support for the Marvell PXA168 Teton BGA Development Platform.
5 *
6 * Author: Mark F. Brown <mark.brown314@gmail.com>
7 *
8 * This code is based on aspenite.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * publishhed by the Free Software Foundation.
13 */
14
15#include <linux/init.h>
16#include <linux/kernel.h>
17#include <linux/platform_device.h>
18#include <linux/gpio.h>
Mark F. Brownd2ce6972010-09-12 23:51:35 -040019#include <linux/input.h>
20#include <plat/pxa27x_keypad.h>
Mark F. Brown1bbd7082010-09-12 23:51:34 -040021
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <mach/addr-map.h>
25#include <mach/mfp-pxa168.h>
26#include <mach/pxa168.h>
27#include <mach/teton_bga.h>
28
29#include "common.h"
30
31static unsigned long teton_bga_pin_config[] __initdata = {
32 /* UART1 */
33 GPIO107_UART1_TXD,
34 GPIO108_UART1_RXD,
Mark F. Brownd2ce6972010-09-12 23:51:35 -040035
36 /* Keypad */
37 GPIO109_KP_MKIN1,
38 GPIO110_KP_MKIN0,
39 GPIO111_KP_MKOUT7,
40 GPIO112_KP_MKOUT6,
41};
42
43static unsigned int teton_bga_matrix_key_map[] = {
44 KEY(0, 6, KEY_ESC),
45 KEY(0, 7, KEY_ENTER),
46 KEY(1, 6, KEY_LEFT),
47 KEY(1, 7, KEY_RIGHT),
48};
49
50static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
51 .matrix_key_rows = 2,
52 .matrix_key_cols = 8,
53 .matrix_key_map = teton_bga_matrix_key_map,
54 .matrix_key_map_size = ARRAY_SIZE(teton_bga_matrix_key_map),
55 .debounce_interval = 30,
Mark F. Brown1bbd7082010-09-12 23:51:34 -040056};
57
58static void __init teton_bga_init(void)
59{
60 mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config));
61
62 /* on-chip devices */
63 pxa168_add_uart(1);
Mark F. Brownd2ce6972010-09-12 23:51:35 -040064 pxa168_add_keypad(&teton_bga_keypad_info);
Mark F. Brown1bbd7082010-09-12 23:51:34 -040065}
66
67MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
68 .phys_io = APB_PHYS_BASE,
69 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
70 .map_io = mmp_map_io,
71 .nr_irqs = IRQ_BOARD_START,
72 .init_irq = pxa168_init_irq,
73 .timer = &pxa168_timer,
74 .init_machine = teton_bga_init,
75MACHINE_END