2 * arch/arm/mach-netx/nxdb500.c
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include <linux/dma-mapping.h>
21 #include <linux/init.h>
22 #include <linux/interrupt.h>
23 #include <linux/mtd/plat-ram.h>
24 #include <linux/platform_device.h>
25 #include <linux/amba/bus.h>
26 #include <linux/amba/clcd.h>
28 #include <mach/hardware.h>
29 #include <asm/mach-types.h>
30 #include <asm/mach/arch.h>
31 #include <asm/hardware/vic.h>
32 #include <mach/netx-regs.h>
38 static struct clcd_panel qvga = {
52 .vmode = FB_VMODE_NONINTERLACED,
57 .cntl = CNTL_LCDTFT | CNTL_BGR,
62 static inline int nxdb500_check(struct clcd_fb *fb, struct fb_var_screeninfo *var)
64 var->green.length = 5;
65 var->green.msb_right = 0;
67 return clcdfb_check(fb, var);
70 static int nxdb500_clcd_setup(struct clcd_fb *fb)
74 fb->fb.var.green.length = 5;
75 fb->fb.var.green.msb_right = 0;
77 /* enable asic control */
78 val = readl(NETX_SYSTEM_IOC_ACCESS_KEY);
79 writel(val, NETX_SYSTEM_IOC_ACCESS_KEY);
81 writel(3, NETX_SYSTEM_IOC_CR);
83 val = readl(NETX_PIO_OUTPIO);
84 writel(val | 1, NETX_PIO_OUTPIO);
86 val = readl(NETX_PIO_OEPIO);
87 writel(val | 1, NETX_PIO_OEPIO);
88 return netx_clcd_setup(fb);
91 static struct clcd_board clcd_data = {
93 .check = nxdb500_check,
94 .decode = clcdfb_decode,
95 .enable = netx_clcd_enable,
96 .setup = nxdb500_clcd_setup,
97 .mmap = netx_clcd_mmap,
98 .remove = netx_clcd_remove,
101 static struct netxeth_platform_data eth0_platform_data = {
105 static struct platform_device netx_eth0_device = {
111 .platform_data = ð0_platform_data,
115 static struct netxeth_platform_data eth1_platform_data = {
119 static struct platform_device netx_eth1_device = {
125 .platform_data = ð1_platform_data,
129 static struct resource netx_uart0_resources[] = {
133 .flags = IORESOURCE_MEM,
136 .start = (NETX_IRQ_UART0),
137 .end = (NETX_IRQ_UART0),
138 .flags = IORESOURCE_IRQ,
142 static struct platform_device netx_uart0_device = {
145 .num_resources = ARRAY_SIZE(netx_uart0_resources),
146 .resource = netx_uart0_resources,
149 static struct resource netx_uart1_resources[] = {
153 .flags = IORESOURCE_MEM,
156 .start = (NETX_IRQ_UART1),
157 .end = (NETX_IRQ_UART1),
158 .flags = IORESOURCE_IRQ,
162 static struct platform_device netx_uart1_device = {
165 .num_resources = ARRAY_SIZE(netx_uart1_resources),
166 .resource = netx_uart1_resources,
169 static struct resource netx_uart2_resources[] = {
173 .flags = IORESOURCE_MEM,
176 .start = (NETX_IRQ_UART2),
177 .end = (NETX_IRQ_UART2),
178 .flags = IORESOURCE_IRQ,
182 static struct platform_device netx_uart2_device = {
185 .num_resources = ARRAY_SIZE(netx_uart2_resources),
186 .resource = netx_uart2_resources,
189 static struct platform_device *devices[] __initdata = {
197 static void __init nxdb500_init(void)
199 netx_fb_init(&clcd_data, &qvga);
200 platform_add_devices(devices, ARRAY_SIZE(devices));
203 MACHINE_START(NXDB500, "Hilscher nxdb500")
204 .atag_offset = 0x100,
205 .map_io = netx_map_io,
206 .init_irq = netx_init_irq,
207 .handle_irq = vic_handle_irq,
208 .timer = &netx_timer,
209 .init_machine = nxdb500_init,
210 .restart = netx_restart,