diff options
| author | Robert Schwebel <robert@schwebel.de> | 2008-01-08 02:44:23 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-28 08:13:20 -0500 |
| commit | 34e31d871ee4b6a9f6c5504da7d6dcc24967844c (patch) | |
| tree | ab6f518113f9d13445c514ad5f36f0c5e2b6167f | |
| parent | e7b3dc7ef1e27fd5713a0df71f82c0a27de1c2eb (diff) | |
[ARM] 4744/1: pcm027: add support for phyCORE-PXA270 CPU module
This patch adds main support for the generic phyCORE-PXA270 CPU module
(aka PCM-027). Its as generic as possible to support any kind of baseboard.
Note: Neither the CPU module nor the pcm027.c implementation can work without
a baseboard support. Baseboard support can be added by the PCM-990 or any
custom variant.
V2:
After comments by Eric Miao:
- Currently unsupported devices moved into separate patch
- direct call of baseboard initialisation
V3:
After comments by Russell King
- sort include files
- setting RTC bit for power control removed
- style problems fixed (discovered by checkpatch.pl)
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/mach-pxa/Kconfig | 5 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/Makefile | 1 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/pcm027.c | 216 | ||||
| -rw-r--r-- | include/asm-arm/arch-pxa/irqs.h | 10 | ||||
| -rw-r--r-- | include/asm-arm/arch-pxa/pcm027.h | 75 |
5 files changed, 306 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index c73da5e33067..958303c100b0 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
| @@ -123,6 +123,11 @@ config MACH_MAGICIAN | |||
| 123 | select PXA27x | 123 | select PXA27x |
| 124 | select IWMMXT | 124 | select IWMMXT |
| 125 | 125 | ||
| 126 | config MACH_PCM027 | ||
| 127 | bool "Phytec phyCORE-PXA270 CPU module (PCM-027)" | ||
| 128 | select PXA27x | ||
| 129 | select IWMMXT | ||
| 130 | |||
| 126 | endchoice | 131 | endchoice |
| 127 | 132 | ||
| 128 | if PXA_SHARPSL | 133 | if PXA_SHARPSL |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 5e9aec57642d..61d301805c80 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
| @@ -20,6 +20,7 @@ obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o cor | |||
| 20 | obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o | 20 | obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o |
| 21 | obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o | 21 | obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o |
| 22 | obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o | 22 | obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o |
| 23 | obj-$(CONFIG_MACH_PCM027) += pcm027.o | ||
| 23 | obj-$(CONFIG_MACH_TOSA) += tosa.o | 24 | obj-$(CONFIG_MACH_TOSA) += tosa.o |
| 24 | obj-$(CONFIG_MACH_EM_X270) += em-x270.o | 25 | obj-$(CONFIG_MACH_EM_X270) += em-x270.o |
| 25 | obj-$(CONFIG_MACH_MAGICIAN) += magician.o | 26 | obj-$(CONFIG_MACH_MAGICIAN) += magician.o |
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c new file mode 100644 index 000000000000..540c3bba5f9a --- /dev/null +++ b/arch/arm/mach-pxa/pcm027.c | |||
| @@ -0,0 +1,216 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/mach-pxa/pcm027.c | ||
| 3 | * Support for the Phytec phyCORE-PXA270 CPU card (aka PCM-027). | ||
| 4 | * | ||
| 5 | * Refer | ||
| 6 | * http://www.phytec.com/products/sbc/ARM-XScale/phyCORE-XScale-PXA270.html | ||
| 7 | * for additional hardware info | ||
| 8 | * | ||
| 9 | * Author: Juergen Kilb | ||
| 10 | * Created: April 05, 2005 | ||
| 11 | * Copyright: Phytec Messtechnik GmbH | ||
| 12 | * e-Mail: armlinux@phytec.de | ||
| 13 | * | ||
| 14 | * based on Intel Mainstone Board | ||
| 15 | * | ||
| 16 | * Copyright 2007 Juergen Beisert @ Pengutronix (j.beisert@pengutronix.de) | ||
| 17 | * | ||
| 18 | * This program is free software; you can redistribute it and/or modify | ||
| 19 | * it under the terms of the GNU General Public License version 2 as | ||
| 20 | * published by the Free Software Foundation. | ||
| 21 | */ | ||
| 22 | |||
| 23 | #include <linux/irq.h> | ||
| 24 | #include <linux/platform_device.h> | ||
| 25 | #include <linux/mtd/physmap.h> | ||
| 26 | #include <linux/spi/spi.h> | ||
| 27 | #include <linux/leds.h> | ||
| 28 | #include <asm/mach-types.h> | ||
| 29 | #include <asm/mach/arch.h> | ||
| 30 | #include <asm/arch/hardware.h> | ||
| 31 | #include <asm/arch/pxa-regs.h> | ||
| 32 | #include <asm/arch/pxa2xx_spi.h> | ||
| 33 | #include <asm/arch/pcm027.h> | ||
| 34 | #include "generic.h" | ||
| 35 | |||
| 36 | /* | ||
| 37 | * ABSTRACT: | ||
| 38 | * | ||
| 39 | * The PXA270 processor comes with a bunch of hardware on its silicon. | ||
| 40 | * Not all of this hardware can be used at the same time and not all | ||
| 41 | * is routed to module's connectors. Also it depends on the baseboard, what | ||
| 42 | * kind of hardware can be used in which way. | ||
| 43 | * -> So this file supports the main devices on the CPU card only! | ||
| 44 | * Refer pcm990-baseboard.c how to extend this features to get a full | ||
| 45 | * blown system with many common interfaces. | ||
| 46 | * | ||
| 47 | * The PCM-027 supports the following interfaces through its connectors and | ||
| 48 | * will be used in pcm990-baseboard.c: | ||
| 49 | * | ||
| 50 | * - LCD support | ||
| 51 | * - MMC support | ||
| 52 | * - IDE/CF card | ||
| 53 | * - FFUART | ||
| 54 | * - BTUART | ||
| 55 | * - IRUART | ||
| 56 | * - AC97 | ||
| 57 | * - SSP | ||
| 58 | * - SSP3 | ||
| 59 | * | ||
| 60 | * Claimed GPIOs: | ||
| 61 | * GPIO0 -> IRQ input from RTC | ||
| 62 | * GPIO2 -> SYS_ENA*) | ||
| 63 | * GPIO3 -> PWR_SCL | ||
| 64 | * GPIO4 -> PWR_SDA | ||
| 65 | * GPIO5 -> PowerCap0*) | ||
| 66 | * GPIO6 -> PowerCap1*) | ||
| 67 | * GPIO7 -> PowerCap2*) | ||
| 68 | * GPIO8 -> PowerCap3*) | ||
| 69 | * GPIO15 -> /CS1 | ||
| 70 | * GPIO20 -> /CS2 | ||
| 71 | * GPIO21 -> /CS3 | ||
| 72 | * GPIO33 -> /CS5 network controller select | ||
| 73 | * GPIO52 -> IRQ from network controller | ||
| 74 | * GPIO78 -> /CS2 | ||
| 75 | * GPIO80 -> /CS4 | ||
| 76 | * GPIO90 -> LED0 | ||
| 77 | * GPIO91 -> LED1 | ||
| 78 | * GPIO114 -> IRQ from CAN controller | ||
| 79 | * GPIO117 -> SCL | ||
| 80 | * GPIO118 -> SDA | ||
| 81 | * | ||
| 82 | * *) CPU internal use only | ||
| 83 | */ | ||
| 84 | |||
| 85 | /* | ||
| 86 | * SMC91x network controller specific stuff | ||
| 87 | */ | ||
| 88 | static struct resource smc91x_resources[] = { | ||
| 89 | [0] = { | ||
| 90 | .start = PCM027_ETH_PHYS + 0x300, | ||
| 91 | .end = PCM027_ETH_PHYS + PCM027_ETH_SIZE, | ||
| 92 | .flags = IORESOURCE_MEM, | ||
| 93 | }, | ||
| 94 | [1] = { | ||
| 95 | .start = PCM027_ETH_IRQ, | ||
| 96 | .end = PCM027_ETH_IRQ, | ||
| 97 | /* note: smc91x's driver doesn't use the trigger bits yet */ | ||
| 98 | .flags = IORESOURCE_IRQ | PCM027_ETH_IRQ_EDGE, | ||
| 99 | } | ||
| 100 | }; | ||
| 101 | |||
| 102 | static struct platform_device smc91x_device = { | ||
| 103 | .name = "smc91x", | ||
| 104 | .id = 0, | ||
| 105 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
| 106 | .resource = smc91x_resources, | ||
| 107 | }; | ||
| 108 | |||
| 109 | static struct physmap_flash_data pcm027_flash_data = { | ||
| 110 | .width = 4, | ||
| 111 | }; | ||
| 112 | |||
| 113 | static struct resource pcm027_flash_resource = { | ||
| 114 | .start = PCM027_FLASH_PHYS, | ||
| 115 | .end = PCM027_FLASH_PHYS + PCM027_FLASH_SIZE - 1 , | ||
| 116 | .flags = IORESOURCE_MEM, | ||
| 117 | }; | ||
| 118 | |||
| 119 | static struct platform_device pcm027_flash = { | ||
| 120 | .name = "physmap-flash", | ||
| 121 | .id = 0, | ||
| 122 | .dev = { | ||
| 123 | .platform_data = &pcm027_flash_data, | ||
| 124 | }, | ||
| 125 | .resource = &pcm027_flash_resource, | ||
| 126 | .num_resources = 1, | ||
| 127 | }; | ||
| 128 | |||
| 129 | #ifdef CONFIG_LEDS_GPIO | ||
| 130 | |||
| 131 | static struct gpio_led pcm027_led[] = { | ||
| 132 | { | ||
| 133 | .name = "led0:red", /* FIXME */ | ||
| 134 | .gpio = PCM027_LED_CPU | ||
| 135 | }, | ||
| 136 | { | ||
| 137 | .name = "led1:green", /* FIXME */ | ||
| 138 | .gpio = PCM027_LED_HEARD_BEAT | ||
| 139 | }, | ||
| 140 | }; | ||
| 141 | |||
| 142 | static struct gpio_led_platform_data pcm027_led_data = { | ||
| 143 | .num_leds = ARRAY_SIZE(pcm027_led), | ||
| 144 | .leds = pcm027_led | ||
| 145 | }; | ||
| 146 | |||
| 147 | static struct platform_device pcm027_led_dev = { | ||
| 148 | .name = "leds-gpio", | ||
| 149 | .id = 0, | ||
| 150 | .dev = { | ||
| 151 | .platform_data = &pcm027_led_data, | ||
| 152 | }, | ||
| 153 | }; | ||
| 154 | |||
| 155 | #endif /* CONFIG_LEDS_GPIO */ | ||
| 156 | |||
| 157 | /* | ||
| 158 | * declare the available device resources on this board | ||
| 159 | */ | ||
| 160 | static struct platform_device *devices[] __initdata = { | ||
| 161 | &smc91x_device, | ||
| 162 | &pcm027_flash, | ||
| 163 | #ifdef CONFIG_LEDS_GPIO | ||
| 164 | &pcm027_led_dev | ||
| 165 | #endif | ||
| 166 | }; | ||
| 167 | |||
| 168 | /* | ||
| 169 | * pcm027_init - breath some life into the board | ||
| 170 | */ | ||
| 171 | static void __init pcm027_init(void) | ||
| 172 | { | ||
| 173 | /* system bus arbiter setting | ||
| 174 | * - Core_Park | ||
| 175 | * - LCD_wt:DMA_wt:CORE_Wt = 2:3:4 | ||
| 176 | */ | ||
| 177 | ARB_CNTRL = ARB_CORE_PARK | 0x234; | ||
| 178 | |||
| 179 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
| 180 | |||
| 181 | /* LEDs (on demand only) */ | ||
| 182 | #ifdef CONFIG_LEDS_GPIO | ||
| 183 | pxa_gpio_mode(PCM027_LED_CPU | GPIO_OUT); | ||
| 184 | pxa_gpio_mode(PCM027_LED_HEARD_BEAT | GPIO_OUT); | ||
| 185 | #endif /* CONFIG_LEDS_GPIO */ | ||
| 186 | |||
| 187 | /* at last call the baseboard to initialize itself */ | ||
| 188 | #ifdef CONFIG_MACH_PCM990_BASEBOARD | ||
| 189 | pcm990_baseboard_init(); | ||
| 190 | #endif | ||
| 191 | } | ||
| 192 | |||
| 193 | static void __init pcm027_map_io(void) | ||
| 194 | { | ||
| 195 | pxa_map_io(); | ||
| 196 | |||
| 197 | /* initialize sleep mode regs (wake-up sources, etc) */ | ||
| 198 | PGSR0 = 0x01308000; | ||
| 199 | PGSR1 = 0x00CF0002; | ||
| 200 | PGSR2 = 0x0E294000; | ||
| 201 | PGSR3 = 0x0000C000; | ||
| 202 | PWER = 0x40000000 | PWER_GPIO0 | PWER_GPIO1; | ||
| 203 | PRER = 0x00000000; | ||
| 204 | PFER = 0x00000003; | ||
| 205 | } | ||
| 206 | |||
| 207 | MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270") | ||
| 208 | /* Maintainer: Pengutronix */ | ||
| 209 | .boot_params = 0xa0000100, | ||
| 210 | .phys_io = 0x40000000, | ||
| 211 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
| 212 | .map_io = pcm027_map_io, | ||
| 213 | .init_irq = pxa27x_init_irq, | ||
| 214 | .timer = &pxa_timer, | ||
| 215 | .init_machine = pcm027_init, | ||
| 216 | MACHINE_END | ||
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h index b76ee6d1f5b4..c562b972a4a6 100644 --- a/include/asm-arm/arch-pxa/irqs.h +++ b/include/asm-arm/arch-pxa/irqs.h | |||
| @@ -180,7 +180,8 @@ | |||
| 180 | #define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) | 180 | #define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) |
| 181 | #elif defined(CONFIG_ARCH_LUBBOCK) || \ | 181 | #elif defined(CONFIG_ARCH_LUBBOCK) || \ |
| 182 | defined(CONFIG_MACH_LOGICPD_PXA270) || \ | 182 | defined(CONFIG_MACH_LOGICPD_PXA270) || \ |
| 183 | defined(CONFIG_MACH_MAINSTONE) | 183 | defined(CONFIG_MACH_MAINSTONE) || \ |
| 184 | defined(CONFIG_MACH_PCM027) | ||
| 184 | #define NR_IRQS (IRQ_BOARD_END) | 185 | #define NR_IRQS (IRQ_BOARD_END) |
| 185 | #else | 186 | #else |
| 186 | #define NR_IRQS (IRQ_BOARD_START) | 187 | #define NR_IRQS (IRQ_BOARD_START) |
| @@ -227,6 +228,13 @@ | |||
| 227 | #define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2) | 228 | #define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2) |
| 228 | #define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3) | 229 | #define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3) |
| 229 | 230 | ||
| 231 | /* phyCORE-PXA270 (PCM027) Interrupts */ | ||
| 232 | #define PCM027_IRQ(x) (IRQ_BOARD_START + (x)) | ||
| 233 | #define PCM027_BTDET_IRQ PCM027_IRQ(0) | ||
| 234 | #define PCM027_FF_RI_IRQ PCM027_IRQ(1) | ||
| 235 | #define PCM027_MMCDET_IRQ PCM027_IRQ(2) | ||
| 236 | #define PCM027_PM_5V_IRQ PCM027_IRQ(3) | ||
| 237 | |||
| 230 | /* ITE8152 irqs */ | 238 | /* ITE8152 irqs */ |
| 231 | /* add IT8152 IRQs beyond BOARD_END */ | 239 | /* add IT8152 IRQs beyond BOARD_END */ |
| 232 | #ifdef CONFIG_PCI_HOST_ITE8152 | 240 | #ifdef CONFIG_PCI_HOST_ITE8152 |
diff --git a/include/asm-arm/arch-pxa/pcm027.h b/include/asm-arm/arch-pxa/pcm027.h new file mode 100644 index 000000000000..7beae1472c3e --- /dev/null +++ b/include/asm-arm/arch-pxa/pcm027.h | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/asm-arm/arch-pxa/pcm027.h | ||
| 3 | * | ||
| 4 | * (c) 2003 Phytec Messtechnik GmbH <armlinux@phytec.de> | ||
| 5 | * (c) 2007 Juergen Beisert <j.beisert@pengutronix.de> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | /* | ||
| 23 | * Definitions of CPU card resources only | ||
| 24 | */ | ||
| 25 | |||
| 26 | /* I2C RTC */ | ||
| 27 | #define PCM027_RTC_IRQ_GPIO 0 | ||
| 28 | #define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO) | ||
| 29 | #define PCM027_RTC_IRQ_EDGE IRQ_TYPE_EDGE_FALLING | ||
| 30 | #define ADR_PCM027_RTC 0x51 /* I2C address */ | ||
| 31 | |||
| 32 | /* I2C EEPROM */ | ||
| 33 | #define ADR_PCM027_EEPROM 0x54 /* I2C address */ | ||
| 34 | |||
| 35 | /* Ethernet chip (SMSC91C111) */ | ||
| 36 | #define PCM027_ETH_IRQ_GPIO 52 | ||
| 37 | #define PCM027_ETH_IRQ IRQ_GPIO(PCM027_ETH_IRQ_GPIO) | ||
| 38 | #define PCM027_ETH_IRQ_EDGE IRQ_TYPE_EDGE_RISING | ||
| 39 | #define PCM027_ETH_PHYS PXA_CS5_PHYS | ||
| 40 | #define PCM027_ETH_SIZE (1*1024*1024) | ||
| 41 | |||
| 42 | /* CAN controller SJA1000 (unsupported yet) */ | ||
| 43 | #define PCM027_CAN_IRQ_GPIO 114 | ||
| 44 | #define PCM027_CAN_IRQ IRQ_GPIO(PCM027_CAN_IRQ_GPIO) | ||
| 45 | #define PCM027_CAN_IRQ_EDGE IRQ_TYPE_EDGE_FALLING | ||
| 46 | #define PCM027_CAN_PHYS 0x22000000 | ||
| 47 | #define PCM027_CAN_SIZE 0x100 | ||
| 48 | |||
| 49 | /* SPI GPIO expander (unsupported yet) */ | ||
| 50 | #define PCM027_EGPIO_IRQ_GPIO 27 | ||
| 51 | #define PCM027_EGPIO_IRQ IRQ_GPIO(PCM027_EGPIO_IRQ_GPIO) | ||
| 52 | #define PCM027_EGPIO_IRQ_EDGE IRQ_TYPE_EDGE_FALLING | ||
| 53 | #define PCM027_EGPIO_CS 24 | ||
| 54 | /* | ||
| 55 | * TODO: Switch this pin from dedicated usage to GPIO if | ||
| 56 | * more than the MAX7301 device is connected to this SPI bus | ||
| 57 | */ | ||
| 58 | #define PCM027_EGPIO_CS_MODE GPIO24_SFRM_MD | ||
| 59 | |||
| 60 | /* Flash memory */ | ||
| 61 | #define PCM027_FLASH_PHYS 0x00000000 | ||
| 62 | #define PCM027_FLASH_SIZE 0x02000000 | ||
| 63 | |||
| 64 | /* onboard LEDs connected to GPIO */ | ||
| 65 | #define PCM027_LED_CPU 90 | ||
| 66 | #define PCM027_LED_HEARD_BEAT 91 | ||
| 67 | |||
| 68 | /* | ||
| 69 | * This CPU module needs a baseboard to work. After basic initializing | ||
| 70 | * its own devices, it calls baseboard's init function. | ||
| 71 | * TODO: Add your own basebaord init function and call it from | ||
| 72 | * inside pcm027_init(). This example here is for the developmen board. | ||
| 73 | * Refer pcm990-baseboard.c | ||
| 74 | */ | ||
| 75 | extern void pcm990_baseboard_init(void); | ||
