]> git.openfabrics.org - ~shefty/rdma-dev.git/blob - arch/arm/mach-sa1100/lart.c
Merge branch 'sa11x0-lcd' into sa11x0
[~shefty/rdma-dev.git] / arch / arm / mach-sa1100 / lart.c
1 /*
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
9 #include <video/sa1100fb.h>
10
11 #include <mach/hardware.h>
12 #include <asm/setup.h>
13 #include <asm/mach-types.h>
14 #include <asm/page.h>
15
16 #include <asm/mach/arch.h>
17 #include <asm/mach/map.h>
18 #include <asm/mach/serial_sa1100.h>
19 #include <mach/mcp.h>
20
21 #include "generic.h"
22
23
24 #warning "include/asm/arch-sa1100/ide.h needs fixing for lart"
25
26 static struct mcp_plat_data lart_mcp_data = {
27         .mccr0          = MCCR0_ADM,
28         .sclk_rate      = 11981000,
29 };
30
31 #ifdef LART_GREY_LCD
32 static 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
48 static 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
61 static 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
77 static 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
90 static void __init lart_init(void)
91 {
92         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
110         sa11x0_register_mcp(&lart_mcp_data);
111 }
112
113 static struct map_desc lart_io_desc[] __initdata = {
114         {       /* 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         }
125 };
126
127 static 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
142 MACHINE_START(LART, "LART")
143         .atag_offset    = 0x100,
144         .map_io         = lart_map_io,
145         .init_irq       = sa1100_init_irq,
146         .init_machine   = lart_init,
147         .timer          = &sa1100_timer,
148         .restart        = sa11x0_restart,
149 MACHINE_END