1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/mach-netx/nxdb500.c
5 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
8 #include <linux/dma-mapping.h>
9 #include <linux/init.h>
10 #include <linux/interrupt.h>
11 #include <linux/mtd/plat-ram.h>
12 #include <linux/platform_device.h>
13 #include <linux/amba/bus.h>
14 #include <linux/amba/clcd.h>
16 #include <mach/hardware.h>
17 #include <asm/mach-types.h>
18 #include <asm/mach/arch.h>
19 #include <mach/netx-regs.h>
20 #include <linux/platform_data/eth-netx.h>
25 static struct clcd_panel qvga = {
39 .vmode = FB_VMODE_NONINTERLACED,
44 .cntl = CNTL_LCDTFT | CNTL_BGR,
49 static inline int nxdb500_check(struct clcd_fb *fb, struct fb_var_screeninfo *var)
51 var->green.length = 5;
52 var->green.msb_right = 0;
54 return clcdfb_check(fb, var);
57 static int nxdb500_clcd_setup(struct clcd_fb *fb)
61 fb->fb.var.green.length = 5;
62 fb->fb.var.green.msb_right = 0;
64 /* enable asic control */
65 val = readl(NETX_SYSTEM_IOC_ACCESS_KEY);
66 writel(val, NETX_SYSTEM_IOC_ACCESS_KEY);
68 writel(3, NETX_SYSTEM_IOC_CR);
70 val = readl(NETX_PIO_OUTPIO);
71 writel(val | 1, NETX_PIO_OUTPIO);
73 val = readl(NETX_PIO_OEPIO);
74 writel(val | 1, NETX_PIO_OEPIO);
75 return netx_clcd_setup(fb);
78 static struct clcd_board clcd_data = {
80 .check = nxdb500_check,
81 .decode = clcdfb_decode,
82 .enable = netx_clcd_enable,
83 .setup = nxdb500_clcd_setup,
84 .mmap = netx_clcd_mmap,
85 .remove = netx_clcd_remove,
88 static struct netxeth_platform_data eth0_platform_data = {
92 static struct platform_device netx_eth0_device = {
98 .platform_data = ð0_platform_data,
102 static struct netxeth_platform_data eth1_platform_data = {
106 static struct platform_device netx_eth1_device = {
112 .platform_data = ð1_platform_data,
116 static struct resource netx_uart0_resources[] = {
120 .flags = IORESOURCE_MEM,
123 .start = (NETX_IRQ_UART0),
124 .end = (NETX_IRQ_UART0),
125 .flags = IORESOURCE_IRQ,
129 static struct platform_device netx_uart0_device = {
132 .num_resources = ARRAY_SIZE(netx_uart0_resources),
133 .resource = netx_uart0_resources,
136 static struct resource netx_uart1_resources[] = {
140 .flags = IORESOURCE_MEM,
143 .start = (NETX_IRQ_UART1),
144 .end = (NETX_IRQ_UART1),
145 .flags = IORESOURCE_IRQ,
149 static struct platform_device netx_uart1_device = {
152 .num_resources = ARRAY_SIZE(netx_uart1_resources),
153 .resource = netx_uart1_resources,
156 static struct resource netx_uart2_resources[] = {
160 .flags = IORESOURCE_MEM,
163 .start = (NETX_IRQ_UART2),
164 .end = (NETX_IRQ_UART2),
165 .flags = IORESOURCE_IRQ,
169 static struct platform_device netx_uart2_device = {
172 .num_resources = ARRAY_SIZE(netx_uart2_resources),
173 .resource = netx_uart2_resources,
176 static struct platform_device *devices[] __initdata = {
184 static void __init nxdb500_init(void)
186 netx_fb_init(&clcd_data, &qvga);
187 platform_add_devices(devices, ARRAY_SIZE(devices));
190 MACHINE_START(NXDB500, "Hilscher nxdb500")
191 .atag_offset = 0x100,
192 .map_io = netx_map_io,
193 .init_irq = netx_init_irq,
194 .init_time = netx_timer_init,
195 .init_machine = nxdb500_init,
196 .restart = netx_restart,