2 * arch/arm/mach-pnx4008/core.c
4 * PNX4008 core startup code
6 * Authors: Vitaly Wool, Dmitry Chigirev,
7 * Grigory Tolstolytkin, Dmitry Pervushin <source@mvista.com>
9 * Based on reference code received from Philips:
10 * Copyright (C) 2003 Philips Semiconductors
12 * 2005 (c) MontaVista Software, Inc. This file is licensed under
13 * the terms of the GNU General Public License version 2. This program
14 * is licensed "as is" without any warranty of any kind, whether express
18 #include <linux/kernel.h>
19 #include <linux/types.h>
21 #include <linux/interrupt.h>
22 #include <linux/list.h>
23 #include <linux/init.h>
24 #include <linux/ioport.h>
25 #include <linux/serial_8250.h>
26 #include <linux/device.h>
27 #include <linux/spi/spi.h>
29 #include <asm/hardware.h>
32 #include <asm/setup.h>
33 #include <asm/mach-types.h>
34 #include <asm/pgtable.h>
36 #include <asm/system.h>
38 #include <asm/mach/arch.h>
39 #include <asm/mach/irq.h>
40 #include <asm/mach/map.h>
41 #include <asm/mach/time.h>
43 #include <asm/arch/irq.h>
44 #include <asm/arch/clock.h>
45 #include <asm/arch/dma.h>
47 struct resource spipnx_0_resources[] = {
49 .start = PNX4008_SPI1_BASE,
50 .end = PNX4008_SPI1_BASE + SZ_4K,
51 .flags = IORESOURCE_MEM,
53 .start = PER_SPI1_REC_XMIT,
54 .flags = IORESOURCE_DMA,
57 .flags = IORESOURCE_IRQ,
63 struct resource spipnx_1_resources[] = {
65 .start = PNX4008_SPI2_BASE,
66 .end = PNX4008_SPI2_BASE + SZ_4K,
67 .flags = IORESOURCE_MEM,
69 .start = PER_SPI2_REC_XMIT,
70 .flags = IORESOURCE_DMA,
73 .flags = IORESOURCE_IRQ,
79 static struct spi_board_info spi_board_info[] __initdata = {
82 .max_speed_hz = 1000000,
88 static struct platform_device spipnx_1 = {
91 .num_resources = ARRAY_SIZE(spipnx_0_resources),
92 .resource = spipnx_0_resources,
94 .coherent_dma_mask = 0xFFFFFFFF,
98 static struct platform_device spipnx_2 = {
101 .num_resources = ARRAY_SIZE(spipnx_1_resources),
102 .resource = spipnx_1_resources,
104 .coherent_dma_mask = 0xFFFFFFFF,
108 static struct plat_serial8250_port platform_serial_ports[] = {
110 .membase = (void *)__iomem(IO_ADDRESS(PNX4008_UART5_BASE)),
111 .mapbase = (unsigned long)PNX4008_UART5_BASE,
113 .uartclk = PNX4008_UART_CLK,
116 .flags = UPF_BOOT_AUTOCONF | UPF_BUGGY_UART | UPF_SKIP_TEST,
119 .membase = (void *)__iomem(IO_ADDRESS(PNX4008_UART3_BASE)),
120 .mapbase = (unsigned long)PNX4008_UART3_BASE,
122 .uartclk = PNX4008_UART_CLK,
125 .flags = UPF_BOOT_AUTOCONF | UPF_BUGGY_UART | UPF_SKIP_TEST,
130 static struct platform_device serial_device = {
131 .name = "serial8250",
132 .id = PLAT8250_DEV_PLATFORM,
134 .platform_data = &platform_serial_ports,
138 static struct platform_device *devices[] __initdata = {
145 extern void pnx4008_uart_init(void);
147 static void __init pnx4008_init(void)
149 /*disable all START interrupt sources,
150 and clear all START interrupt flags */
151 __raw_writel(0, START_INT_ER_REG(SE_PIN_BASE_INT));
152 __raw_writel(0, START_INT_ER_REG(SE_INT_BASE_INT));
153 __raw_writel(0xffffffff, START_INT_RSR_REG(SE_PIN_BASE_INT));
154 __raw_writel(0xffffffff, START_INT_RSR_REG(SE_INT_BASE_INT));
156 platform_add_devices(devices, ARRAY_SIZE(devices));
157 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
158 /* Switch on the UART clocks */
162 static struct map_desc pnx4008_io_desc[] __initdata = {
164 .virtual = IO_ADDRESS(PNX4008_IRAM_BASE),
165 .pfn = __phys_to_pfn(PNX4008_IRAM_BASE),
169 .virtual = IO_ADDRESS(PNX4008_NDF_FLASH_BASE),
170 .pfn = __phys_to_pfn(PNX4008_NDF_FLASH_BASE),
171 .length = SZ_1M - SZ_128K,
174 .virtual = IO_ADDRESS(PNX4008_JPEG_CONFIG_BASE),
175 .pfn = __phys_to_pfn(PNX4008_JPEG_CONFIG_BASE),
176 .length = SZ_128K * 3,
179 .virtual = IO_ADDRESS(PNX4008_DMA_CONFIG_BASE),
180 .pfn = __phys_to_pfn(PNX4008_DMA_CONFIG_BASE),
184 .virtual = IO_ADDRESS(PNX4008_AHB2FAB_BASE),
185 .pfn = __phys_to_pfn(PNX4008_AHB2FAB_BASE),
191 void __init pnx4008_map_io(void)
193 iotable_init(pnx4008_io_desc, ARRAY_SIZE(pnx4008_io_desc));
196 extern struct sys_timer pnx4008_timer;
198 MACHINE_START(PNX4008, "Philips PNX4008")
199 /* Maintainer: MontaVista Software Inc. */
200 .phys_io = 0x40090000,
201 .io_pg_offst = (0xf4090000 >> 18) & 0xfffc,
202 .boot_params = 0x80000100,
203 .map_io = pnx4008_map_io,
204 .init_irq = pnx4008_init_irq,
205 .init_machine = pnx4008_init,
206 .timer = &pnx4008_timer,