OSDN Git Service

Merge branch 'sa11x0-mcp' into sa11x0
[uclinux-h8/linux.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_ppc_configure_mcp();
111         sa11x0_register_mcp(&lart_mcp_data);
112 }
113
114 static struct map_desc lart_io_desc[] __initdata = {
115         {       /* main flash memory */
116                 .virtual        =  0xe8000000,
117                 .pfn            = __phys_to_pfn(0x00000000),
118                 .length         = 0x00400000,
119                 .type           = MT_DEVICE
120         }, {    /* main flash, alternative location */
121                 .virtual        =  0xec000000,
122                 .pfn            = __phys_to_pfn(0x08000000),
123                 .length         = 0x00400000,
124                 .type           = MT_DEVICE
125         }
126 };
127
128 static void __init lart_map_io(void)
129 {
130         sa1100_map_io();
131         iotable_init(lart_io_desc, ARRAY_SIZE(lart_io_desc));
132
133         sa1100_register_uart(0, 3);
134         sa1100_register_uart(1, 1);
135         sa1100_register_uart(2, 2);
136
137         GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
138         GPDR |= GPIO_UART_TXD;
139         GPDR &= ~GPIO_UART_RXD;
140         PPAR |= PPAR_UPR;
141 }
142
143 MACHINE_START(LART, "LART")
144         .atag_offset    = 0x100,
145         .map_io         = lart_map_io,
146         .init_irq       = sa1100_init_irq,
147         .init_machine   = lart_init,
148         .timer          = &sa1100_timer,
149         .restart        = sa11x0_restart,
150 MACHINE_END