diff options
| author | Stefan Schmidt <stefan@datenfreihafen.org> | 2008-07-09 03:08:17 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-10 08:44:55 -0400 |
| commit | 9ab24e4ef0b4e0a7eb8ea897c6178139aab3b260 (patch) | |
| tree | 10bc8842f0c2e94033e892f5458a6bdab46533a9 | |
| parent | a5f426bda73a743fd105274fe299d446d50e692e (diff) | |
[ARM] 5162/1: Common code for the Motorola EZX GSM phones
Common code for the different EZX GSM phones. Functions to control framebuffer,
backlight power, OHCI and UART init.
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/mach-pxa/Kconfig | 36 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/Makefile | 1 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/ezx.c | 220 |
3 files changed, 257 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index faa2c3f6c1af..3818b4720221 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
| @@ -220,6 +220,42 @@ config PCM990_DISPLAY_NONE | |||
| 220 | endchoice | 220 | endchoice |
| 221 | 221 | ||
| 222 | 222 | ||
| 223 | config PXA_EZX | ||
| 224 | bool "Motorola EZX Platform" | ||
| 225 | select PXA27x | ||
| 226 | select IWMMXT | ||
| 227 | select HAVE_PWM | ||
| 228 | |||
| 229 | config MACH_EZX_A780 | ||
| 230 | bool "Motorola EZX A780" | ||
| 231 | default y | ||
| 232 | depends on PXA_EZX | ||
| 233 | |||
| 234 | config MACH_EZX_E680 | ||
| 235 | bool "Motorola EZX E680" | ||
| 236 | default y | ||
| 237 | depends on PXA_EZX | ||
| 238 | |||
| 239 | config MACH_EZX_A1200 | ||
| 240 | bool "Motorola EZX A1200" | ||
| 241 | default y | ||
| 242 | depends on PXA_EZX | ||
| 243 | |||
| 244 | config MACH_EZX_A910 | ||
| 245 | bool "Motorola EZX A910" | ||
| 246 | default y | ||
| 247 | depends on PXA_EZX | ||
| 248 | |||
| 249 | config MACH_EZX_E6 | ||
| 250 | bool "Motorola EZX E6" | ||
| 251 | default y | ||
| 252 | depends on PXA_EZX | ||
| 253 | |||
| 254 | config MACH_EZX_E2 | ||
| 255 | bool "Motorola EZX E2" | ||
| 256 | default y | ||
| 257 | depends on PXA_EZX | ||
| 258 | |||
| 223 | endmenu | 259 | endmenu |
| 224 | 260 | ||
| 225 | config PXA25x | 261 | config PXA25x |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index c4dfbe87fc4e..1dded6499d0b 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
| @@ -46,6 +46,7 @@ endif | |||
| 46 | obj-$(CONFIG_MACH_LITTLETON) += littleton.o | 46 | obj-$(CONFIG_MACH_LITTLETON) += littleton.o |
| 47 | 47 | ||
| 48 | obj-$(CONFIG_MACH_ARMCORE) += cm-x270.o | 48 | obj-$(CONFIG_MACH_ARMCORE) += cm-x270.o |
| 49 | obj-$(CONFIG_PXA_EZX) += ezx.o | ||
| 49 | 50 | ||
| 50 | # Support for blinky lights | 51 | # Support for blinky lights |
| 51 | led-y := leds.o | 52 | led-y := leds.o |
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c new file mode 100644 index 000000000000..0143eed65398 --- /dev/null +++ b/arch/arm/mach-pxa/ezx.c | |||
| @@ -0,0 +1,220 @@ | |||
| 1 | /* | ||
| 2 | * ezx.c - Common code for the EZX platform. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2005-2006 Harald Welte <laforge@openezx.org>, | ||
| 5 | * 2007-2008 Daniel Ribeiro <drwyrm@gmail.com>, | ||
| 6 | * 2007-2008 Stefan Schmidt <stefan@datenfreihafen.org> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/kernel.h> | ||
| 15 | #include <linux/init.h> | ||
| 16 | #include <linux/platform_device.h> | ||
| 17 | #include <linux/delay.h> | ||
| 18 | #include <linux/pwm_backlight.h> | ||
| 19 | |||
| 20 | #include <asm/setup.h> | ||
| 21 | #include <asm/arch/pxafb.h> | ||
| 22 | #include <asm/arch/ohci.h> | ||
| 23 | #include <asm/arch/i2c.h> | ||
| 24 | |||
| 25 | #include <asm/arch/mfp-pxa27x.h> | ||
| 26 | #include <asm/arch/pxa-regs.h> | ||
| 27 | #include <asm/arch/pxa2xx-regs.h> | ||
| 28 | #include <asm/mach-types.h> | ||
| 29 | #include <asm/mach/arch.h> | ||
| 30 | |||
| 31 | #include "devices.h" | ||
| 32 | #include "generic.h" | ||
| 33 | |||
| 34 | static struct platform_pwm_backlight_data ezx_backlight_data = { | ||
| 35 | .pwm_id = 0, | ||
| 36 | .max_brightness = 1023, | ||
| 37 | .dft_brightness = 1023, | ||
| 38 | .pwm_period_ns = 78770, | ||
| 39 | }; | ||
| 40 | |||
| 41 | static struct platform_device ezx_backlight_device = { | ||
| 42 | .name = "pwm-backlight", | ||
| 43 | .dev = { | ||
| 44 | .parent = &pxa27x_device_pwm0.dev, | ||
| 45 | .platform_data = &ezx_backlight_data, | ||
| 46 | }, | ||
| 47 | }; | ||
| 48 | |||
| 49 | static struct pxafb_mode_info mode_ezx_old = { | ||
| 50 | .pixclock = 150000, | ||
| 51 | .xres = 240, | ||
| 52 | .yres = 320, | ||
| 53 | .bpp = 16, | ||
| 54 | .hsync_len = 10, | ||
| 55 | .left_margin = 20, | ||
| 56 | .right_margin = 10, | ||
| 57 | .vsync_len = 2, | ||
| 58 | .upper_margin = 3, | ||
| 59 | .lower_margin = 2, | ||
| 60 | .sync = 0, | ||
| 61 | }; | ||
| 62 | |||
| 63 | static struct pxafb_mach_info ezx_fb_info_1 = { | ||
| 64 | .modes = &mode_ezx_old, | ||
| 65 | .num_modes = 1, | ||
| 66 | .lcd_conn = LCD_COLOR_TFT_16BPP, | ||
| 67 | }; | ||
| 68 | |||
| 69 | static struct pxafb_mode_info mode_72r89803y01 = { | ||
| 70 | .pixclock = 192308, | ||
| 71 | .xres = 240, | ||
| 72 | .yres = 320, | ||
| 73 | .bpp = 32, | ||
| 74 | .depth = 18, | ||
| 75 | .hsync_len = 10, | ||
| 76 | .left_margin = 20, | ||
| 77 | .right_margin = 10, | ||
| 78 | .vsync_len = 2, | ||
| 79 | .upper_margin = 3, | ||
| 80 | .lower_margin = 2, | ||
| 81 | .sync = 0, | ||
| 82 | }; | ||
| 83 | |||
| 84 | static struct pxafb_mach_info ezx_fb_info_2 = { | ||
| 85 | .modes = &mode_72r89803y01, | ||
| 86 | .num_modes = 1, | ||
| 87 | .lcd_conn = LCD_COLOR_TFT_18BPP, | ||
| 88 | }; | ||
| 89 | |||
| 90 | static struct platform_device *devices[] __initdata = { | ||
| 91 | &ezx_backlight_device, | ||
| 92 | }; | ||
| 93 | |||
| 94 | static unsigned long ezx_pin_config[] __initdata = { | ||
| 95 | /* PWM backlight */ | ||
| 96 | GPIO16_PWM0_OUT, | ||
| 97 | |||
| 98 | /* BTUART */ | ||
| 99 | GPIO42_BTUART_RXD, | ||
| 100 | GPIO43_BTUART_TXD, | ||
| 101 | GPIO44_BTUART_CTS, | ||
| 102 | GPIO45_BTUART_RTS, | ||
| 103 | |||
| 104 | /* STUART */ | ||
| 105 | GPIO46_STUART_RXD, | ||
| 106 | GPIO47_STUART_TXD, | ||
| 107 | |||
| 108 | /* For A780 support (connected with Neptune GSM chip) */ | ||
| 109 | GPIO30_USB_P3_2, /* ICL_TXENB */ | ||
| 110 | GPIO31_USB_P3_6, /* ICL_VPOUT */ | ||
| 111 | GPIO90_USB_P3_5, /* ICL_VPIN */ | ||
| 112 | GPIO91_USB_P3_1, /* ICL_XRXD */ | ||
| 113 | GPIO56_USB_P3_4, /* ICL_VMOUT */ | ||
| 114 | GPIO113_USB_P3_3, /* /ICL_VMIN */ | ||
| 115 | }; | ||
| 116 | |||
| 117 | static void __init ezx_init(void) | ||
| 118 | { | ||
| 119 | pxa2xx_mfp_config(ARRAY_AND_SIZE(ezx_pin_config)); | ||
| 120 | pxa_set_i2c_info(NULL); | ||
| 121 | if (machine_is_ezx_a780() || machine_is_ezx_e680()) | ||
| 122 | set_pxa_fb_info(&ezx_fb_info_1); | ||
| 123 | else | ||
| 124 | set_pxa_fb_info(&ezx_fb_info_2); | ||
| 125 | |||
| 126 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
| 127 | } | ||
| 128 | |||
| 129 | static void __init ezx_fixup(struct machine_desc *desc, struct tag *tags, | ||
| 130 | char **cmdline, struct meminfo *mi) | ||
| 131 | { | ||
| 132 | /* We have two ram chips. First one with 32MB at 0xA0000000 and a second | ||
| 133 | * 16MB one at 0xAC000000 | ||
| 134 | */ | ||
| 135 | mi->nr_banks = 2; | ||
| 136 | mi->bank[0].start = 0xa0000000; | ||
| 137 | mi->bank[0].node = 0; | ||
| 138 | mi->bank[0].size = (32*1024*1024); | ||
| 139 | mi->bank[1].start = 0xac000000; | ||
| 140 | mi->bank[1].node = 1; | ||
| 141 | mi->bank[1].size = (16*1024*1024); | ||
| 142 | } | ||
| 143 | |||
| 144 | #ifdef CONFIG_MACH_EZX_A780 | ||
| 145 | MACHINE_START(EZX_A780, "Motorola EZX A780") | ||
| 146 | .phys_io = 0x40000000, | ||
| 147 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
| 148 | .fixup = ezx_fixup, | ||
| 149 | .boot_params = 0xa0000100, | ||
| 150 | .map_io = pxa_map_io, | ||
| 151 | .init_irq = pxa27x_init_irq, | ||
| 152 | .timer = &pxa_timer, | ||
| 153 | .init_machine = &ezx_init, | ||
| 154 | MACHINE_END | ||
| 155 | #endif | ||
| 156 | |||
| 157 | #ifdef CONFIG_MACH_EZX_E680 | ||
| 158 | MACHINE_START(EZX_E680, "Motorola EZX E680") | ||
| 159 | .phys_io = 0x40000000, | ||
| 160 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
| 161 | .fixup = ezx_fixup, | ||
| 162 | .boot_params = 0xa0000100, | ||
| 163 | .map_io = pxa_map_io, | ||
| 164 | .init_irq = pxa27x_init_irq, | ||
| 165 | .timer = &pxa_timer, | ||
| 166 | .init_machine = &ezx_init, | ||
| 167 | MACHINE_END | ||
| 168 | #endif | ||
| 169 | |||
| 170 | #ifdef CONFIG_MACH_EZX_A1200 | ||
| 171 | MACHINE_START(EZX_A1200, "Motorola EZX A1200") | ||
| 172 | .phys_io = 0x40000000, | ||
| 173 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
| 174 | .fixup = ezx_fixup, | ||
| 175 | .boot_params = 0xa0000100, | ||
| 176 | .map_io = pxa_map_io, | ||
| 177 | .init_irq = pxa27x_init_irq, | ||
| 178 | .timer = &pxa_timer, | ||
| 179 | .init_machine = &ezx_init, | ||
| 180 | MACHINE_END | ||
| 181 | #endif | ||
| 182 | |||
| 183 | #ifdef CONFIG_MACH_EZX_A910 | ||
| 184 | MACHINE_START(EZX_A910, "Motorola EZX A910") | ||
| 185 | .phys_io = 0x40000000, | ||
| 186 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
| 187 | .fixup = ezx_fixup, | ||
| 188 | .boot_params = 0xa0000100, | ||
| 189 | .map_io = pxa_map_io, | ||
| 190 | .init_irq = pxa27x_init_irq, | ||
| 191 | .timer = &pxa_timer, | ||
| 192 | .init_machine = &ezx_init, | ||
| 193 | MACHINE_END | ||
| 194 | #endif | ||
| 195 | |||
| 196 | #ifdef CONFIG_MACH_EZX_E6 | ||
| 197 | MACHINE_START(EZX_E6, "Motorola EZX E6") | ||
| 198 | .phys_io = 0x40000000, | ||
| 199 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
| 200 | .fixup = ezx_fixup, | ||
| 201 | .boot_params = 0xa0000100, | ||
| 202 | .map_io = pxa_map_io, | ||
| 203 | .init_irq = pxa27x_init_irq, | ||
| 204 | .timer = &pxa_timer, | ||
| 205 | .init_machine = &ezx_init, | ||
| 206 | MACHINE_END | ||
| 207 | #endif | ||
| 208 | |||
| 209 | #ifdef CONFIG_MACH_EZX_E2 | ||
| 210 | MACHINE_START(EZX_E2, "Motorola EZX E2") | ||
| 211 | .phys_io = 0x40000000, | ||
| 212 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
| 213 | .fixup = ezx_fixup, | ||
| 214 | .boot_params = 0xa0000100, | ||
| 215 | .map_io = pxa_map_io, | ||
| 216 | .init_irq = pxa27x_init_irq, | ||
| 217 | .timer = &pxa_timer, | ||
| 218 | .init_machine = &ezx_init, | ||
| 219 | MACHINE_END | ||
| 220 | #endif | ||
