2 * arch/arm/mach-netx/nxeb500hmi.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 nxeb500hmi_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 nxeb500hmi_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 /* GPIO 14 is used for display enable on newer boards */
84 writel(9, NETX_GPIO_CFG(14));
86 val = readl(NETX_PIO_OUTPIO);
87 writel(val | 1, NETX_PIO_OUTPIO);
89 val = readl(NETX_PIO_OEPIO);
90 writel(val | 1, NETX_PIO_OEPIO);
91 return netx_clcd_setup(fb);
94 static struct clcd_board clcd_data = {
96 .check = nxeb500hmi_check,
97 .decode = clcdfb_decode,
98 .enable = netx_clcd_enable,
99 .setup = nxeb500hmi_clcd_setup,
100 .mmap = netx_clcd_mmap,
101 .remove = netx_clcd_remove,
104 static struct netxeth_platform_data eth0_platform_data = {
108 static struct platform_device netx_eth0_device = {
114 .platform_data = ð0_platform_data,
118 static struct netxeth_platform_data eth1_platform_data = {
122 static struct platform_device netx_eth1_device = {
128 .platform_data = ð1_platform_data,
132 static struct resource netx_cf_resources[] = {
136 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
140 static struct platform_device netx_cf_device = {
143 .resource = netx_cf_resources,
144 .num_resources = ARRAY_SIZE(netx_cf_resources),
147 static struct resource netx_uart0_resources[] = {
151 .flags = IORESOURCE_MEM,
154 .start = (NETX_IRQ_UART0),
155 .end = (NETX_IRQ_UART0),
156 .flags = IORESOURCE_IRQ,
160 static struct platform_device netx_uart0_device = {
163 .num_resources = ARRAY_SIZE(netx_uart0_resources),
164 .resource = netx_uart0_resources,
167 static struct platform_device *devices[] __initdata = {
174 static void __init nxeb500hmi_init(void)
176 netx_fb_init(&clcd_data, &qvga);
177 platform_add_devices(devices, ARRAY_SIZE(devices));
180 MACHINE_START(NXEB500HMI, "Hilscher nxeb500hmi")
181 .atag_offset = 0x100,
182 .map_io = netx_map_io,
183 .init_irq = netx_init_irq,
184 .handle_irq = vic_handle_irq,
185 .timer = &netx_timer,
186 .init_machine = nxeb500hmi_init,
187 .restart = netx_restart,