Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
Russell King | e1b7a72 | 2012-01-14 11:50:04 +0000 | [diff] [blame] | 9 | #include <video/sa1100fb.h> |
| 10 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 11 | #include <mach/hardware.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <asm/setup.h> |
| 13 | #include <asm/mach-types.h> |
Russell King | 5876ee9 | 2009-04-26 13:56:01 +0100 | [diff] [blame] | 14 | #include <asm/page.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
| 16 | #include <asm/mach/arch.h> |
| 17 | #include <asm/mach/map.h> |
| 18 | #include <asm/mach/serial_sa1100.h> |
Arnd Bergmann | a1fd844 | 2012-08-24 15:17:38 +0200 | [diff] [blame] | 19 | #include <linux/platform_data/mfd-mcp-sa11x0.h> |
Rob Herring | f314f33 | 2012-02-24 00:06:51 +0100 | [diff] [blame] | 20 | #include <mach/irqs.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
| 22 | #include "generic.h" |
| 23 | |
| 24 | |
| 25 | #warning "include/asm/arch-sa1100/ide.h needs fixing for lart" |
| 26 | |
Russell King | 323cdfc | 2005-08-18 10:10:46 +0100 | [diff] [blame] | 27 | static struct mcp_plat_data lart_mcp_data = { |
| 28 | .mccr0 = MCCR0_ADM, |
| 29 | .sclk_rate = 11981000, |
| 30 | }; |
| 31 | |
Russell King | e1b7a72 | 2012-01-14 11:50:04 +0000 | [diff] [blame] | 32 | #ifdef LART_GREY_LCD |
| 33 | static struct sa1100fb_mach_info lart_grey_info = { |
| 34 | .pixclock = 150000, .bpp = 4, |
| 35 | .xres = 320, .yres = 240, |
| 36 | |
| 37 | .hsync_len = 1, .vsync_len = 1, |
| 38 | .left_margin = 4, .upper_margin = 0, |
| 39 | .right_margin = 2, .lower_margin = 0, |
| 40 | |
| 41 | .cmap_greyscale = 1, |
| 42 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
| 43 | |
| 44 | .lccr0 = LCCR0_Mono | LCCR0_Sngl | LCCR0_Pas | LCCR0_4PixMono, |
| 45 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512), |
| 46 | }; |
| 47 | #endif |
| 48 | #ifdef LART_COLOR_LCD |
| 49 | static struct sa1100fb_mach_info lart_color_info = { |
| 50 | .pixclock = 150000, .bpp = 16, |
| 51 | .xres = 320, .yres = 240, |
| 52 | |
| 53 | .hsync_len = 2, .vsync_len = 3, |
| 54 | .left_margin = 69, .upper_margin = 14, |
| 55 | .right_margin = 8, .lower_margin = 4, |
| 56 | |
| 57 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, |
| 58 | .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512), |
| 59 | }; |
| 60 | #endif |
| 61 | #ifdef LART_VIDEO_OUT |
| 62 | static struct sa1100fb_mach_info lart_video_info = { |
| 63 | .pixclock = 39721, .bpp = 16, |
| 64 | .xres = 640, .yres = 480, |
| 65 | |
| 66 | .hsync_len = 95, .vsync_len = 2, |
| 67 | .left_margin = 40, .upper_margin = 32, |
| 68 | .right_margin = 24, .lower_margin = 11, |
| 69 | |
| 70 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
| 71 | |
| 72 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, |
| 73 | .lccr3 = LCCR3_OutEnL | LCCR3_PixFlEdg | LCCR3_ACBsDiv(512), |
| 74 | }; |
| 75 | #endif |
| 76 | |
| 77 | #ifdef LART_KIT01_LCD |
| 78 | static struct sa1100fb_mach_info lart_kit01_info = { |
| 79 | .pixclock = 63291, .bpp = 16, |
| 80 | .xres = 640, .yres = 480, |
| 81 | |
| 82 | .hsync_len = 64, .vsync_len = 3, |
| 83 | .left_margin = 122, .upper_margin = 45, |
| 84 | .right_margin = 10, .lower_margin = 10, |
| 85 | |
| 86 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, |
| 87 | .lccr3 = LCCR3_OutEnH | LCCR3_PixFlEdg |
| 88 | }; |
| 89 | #endif |
| 90 | |
Russell King | 323cdfc | 2005-08-18 10:10:46 +0100 | [diff] [blame] | 91 | static void __init lart_init(void) |
| 92 | { |
Russell King | e1b7a72 | 2012-01-14 11:50:04 +0000 | [diff] [blame] | 93 | struct sa1100fb_mach_info *inf = NULL; |
| 94 | |
| 95 | #ifdef LART_GREY_LCD |
| 96 | inf = &lart_grey_info; |
| 97 | #endif |
| 98 | #ifdef LART_COLOR_LCD |
| 99 | inf = &lart_color_info; |
| 100 | #endif |
| 101 | #ifdef LART_VIDEO_OUT |
| 102 | inf = &lart_video_info; |
| 103 | #endif |
| 104 | #ifdef LART_KIT01_LCD |
| 105 | inf = &lart_kit01_info; |
| 106 | #endif |
| 107 | |
| 108 | if (inf) |
| 109 | sa11x0_register_lcd(inf); |
| 110 | |
Russell King | e36e26a | 2012-01-20 22:24:07 +0000 | [diff] [blame] | 111 | sa11x0_ppc_configure_mcp(); |
Russell King | 7a5b4e1 | 2009-10-06 14:55:53 +0100 | [diff] [blame] | 112 | sa11x0_register_mcp(&lart_mcp_data); |
Russell King | 323cdfc | 2005-08-18 10:10:46 +0100 | [diff] [blame] | 113 | } |
| 114 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | static struct map_desc lart_io_desc[] __initdata = { |
Deepak Saxena | 92519d8 | 2005-10-28 15:19:04 +0100 | [diff] [blame] | 116 | { /* main flash memory */ |
| 117 | .virtual = 0xe8000000, |
| 118 | .pfn = __phys_to_pfn(0x00000000), |
| 119 | .length = 0x00400000, |
| 120 | .type = MT_DEVICE |
| 121 | }, { /* main flash, alternative location */ |
| 122 | .virtual = 0xec000000, |
| 123 | .pfn = __phys_to_pfn(0x08000000), |
| 124 | .length = 0x00400000, |
| 125 | .type = MT_DEVICE |
| 126 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | }; |
| 128 | |
| 129 | static void __init lart_map_io(void) |
| 130 | { |
| 131 | sa1100_map_io(); |
| 132 | iotable_init(lart_io_desc, ARRAY_SIZE(lart_io_desc)); |
| 133 | |
| 134 | sa1100_register_uart(0, 3); |
| 135 | sa1100_register_uart(1, 1); |
| 136 | sa1100_register_uart(2, 2); |
| 137 | |
| 138 | GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD); |
| 139 | GPDR |= GPIO_UART_TXD; |
| 140 | GPDR &= ~GPIO_UART_RXD; |
| 141 | PPAR |= PPAR_UPR; |
| 142 | } |
| 143 | |
| 144 | MACHINE_START(LART, "LART") |
Nicolas Pitre | 17f4425 | 2011-07-05 22:38:17 -0400 | [diff] [blame] | 145 | .atag_offset = 0x100, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 146 | .map_io = lart_map_io, |
Rob Herring | f314f33 | 2012-02-24 00:06:51 +0100 | [diff] [blame] | 147 | .nr_irqs = SA1100_NR_IRQS, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 148 | .init_irq = sa1100_init_irq, |
Russell King | 323cdfc | 2005-08-18 10:10:46 +0100 | [diff] [blame] | 149 | .init_machine = lart_init, |
Shawn Guo | 7fea1ba | 2012-04-26 21:22:45 +0800 | [diff] [blame] | 150 | .init_late = sa11x0_init_late, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | .timer = &sa1100_timer, |
Russell King | d9ca583 | 2011-11-05 10:28:50 +0000 | [diff] [blame] | 152 | .restart = sa11x0_restart, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 153 | MACHINE_END |