blob: 463a322a425b0736c0b040aa4992b62562ec1570 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/mach-sa1100/lart.c
3 */
4
5#include <linux/init.h>
6#include <linux/kernel.h>
7#include <linux/tty.h>
8
Russell Kinge1b7a722012-01-14 11:50:04 +00009#include <video/sa1100fb.h>
10
Russell Kinga09e64f2008-08-05 16:14:15 +010011#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <asm/setup.h>
13#include <asm/mach-types.h>
Russell King5876ee92009-04-26 13:56:01 +010014#include <asm/page.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <asm/mach/serial_sa1100.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010019#include <mach/mcp.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21#include "generic.h"
22
23
24#warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
25
Russell King323cdfc2005-08-18 10:10:46 +010026static struct mcp_plat_data lart_mcp_data = {
27 .mccr0 = MCCR0_ADM,
28 .sclk_rate = 11981000,
29};
30
Russell Kinge1b7a722012-01-14 11:50:04 +000031#ifdef LART_GREY_LCD
32static struct sa1100fb_mach_info lart_grey_info = {
33 .pixclock = 150000, .bpp = 4,
34 .xres = 320, .yres = 240,
35
36 .hsync_len = 1, .vsync_len = 1,
37 .left_margin = 4, .upper_margin = 0,
38 .right_margin = 2, .lower_margin = 0,
39
40 .cmap_greyscale = 1,
41 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
42
43 .lccr0 = LCCR0_Mono | LCCR0_Sngl | LCCR0_Pas | LCCR0_4PixMono,
44 .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
45};
46#endif
47#ifdef LART_COLOR_LCD
48static struct sa1100fb_mach_info lart_color_info = {
49 .pixclock = 150000, .bpp = 16,
50 .xres = 320, .yres = 240,
51
52 .hsync_len = 2, .vsync_len = 3,
53 .left_margin = 69, .upper_margin = 14,
54 .right_margin = 8, .lower_margin = 4,
55
56 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
57 .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
58};
59#endif
60#ifdef LART_VIDEO_OUT
61static struct sa1100fb_mach_info lart_video_info = {
62 .pixclock = 39721, .bpp = 16,
63 .xres = 640, .yres = 480,
64
65 .hsync_len = 95, .vsync_len = 2,
66 .left_margin = 40, .upper_margin = 32,
67 .right_margin = 24, .lower_margin = 11,
68
69 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
70
71 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
72 .lccr3 = LCCR3_OutEnL | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512),
73};
74#endif
75
76#ifdef LART_KIT01_LCD
77static struct sa1100fb_mach_info lart_kit01_info = {
78 .pixclock = 63291, .bpp = 16,
79 .xres = 640, .yres = 480,
80
81 .hsync_len = 64, .vsync_len = 3,
82 .left_margin = 122, .upper_margin = 45,
83 .right_margin = 10, .lower_margin = 10,
84
85 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
86 .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg
87};
88#endif
89
Russell King323cdfc2005-08-18 10:10:46 +010090static void __init lart_init(void)
91{
Russell Kinge1b7a722012-01-14 11:50:04 +000092 struct sa1100fb_mach_info *inf = NULL;
93
94#ifdef LART_GREY_LCD
95 inf = &lart_grey_info;
96#endif
97#ifdef LART_COLOR_LCD
98 inf = &lart_color_info;
99#endif
100#ifdef LART_VIDEO_OUT
101 inf = &lart_video_info;
102#endif
103#ifdef LART_KIT01_LCD
104 inf = &lart_kit01_info;
105#endif
106
107 if (inf)
108 sa11x0_register_lcd(inf);
109
Russell King7a5b4e12009-10-06 14:55:53 +0100110 sa11x0_register_mcp(&lart_mcp_data);
Russell King323cdfc2005-08-18 10:10:46 +0100111}
112
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113static struct map_desc lart_io_desc[] __initdata = {
Deepak Saxena92519d82005-10-28 15:19:04 +0100114 { /* main flash memory */
115 .virtual = 0xe8000000,
116 .pfn = __phys_to_pfn(0x00000000),
117 .length = 0x00400000,
118 .type = MT_DEVICE
119 }, { /* main flash, alternative location */
120 .virtual = 0xec000000,
121 .pfn = __phys_to_pfn(0x08000000),
122 .length = 0x00400000,
123 .type = MT_DEVICE
124 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125};
126
127static void __init lart_map_io(void)
128{
129 sa1100_map_io();
130 iotable_init(lart_io_desc, ARRAY_SIZE(lart_io_desc));
131
132 sa1100_register_uart(0, 3);
133 sa1100_register_uart(1, 1);
134 sa1100_register_uart(2, 2);
135
136 GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
137 GPDR |= GPIO_UART_TXD;
138 GPDR &= ~GPIO_UART_RXD;
139 PPAR |= PPAR_UPR;
140}
141
142MACHINE_START(LART, "LART")
Nicolas Pitre17f44252011-07-05 22:38:17 -0400143 .atag_offset = 0x100,
Russell Kinge9dea0c2005-07-03 17:38:58 +0100144 .map_io = lart_map_io,
145 .init_irq = sa1100_init_irq,
Russell King323cdfc2005-08-18 10:10:46 +0100146 .init_machine = lart_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147 .timer = &sa1100_timer,
Russell Kingd9ca5832011-11-05 10:28:50 +0000148 .restart = sa11x0_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149MACHINE_END