shannon.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * linux/arch/arm/mach-sa1100/shannon.c
  3. */
  4. #include <linux/init.h>
  5. #include <linux/device.h>
  6. #include <linux/kernel.h>
  7. #include <linux/platform_data/sa11x0-serial.h>
  8. #include <linux/tty.h>
  9. #include <linux/mtd/mtd.h>
  10. #include <linux/mtd/partitions.h>
  11. #include <video/sa1100fb.h>
  12. #include <mach/hardware.h>
  13. #include <asm/mach-types.h>
  14. #include <asm/setup.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/flash.h>
  17. #include <asm/mach/map.h>
  18. #include <linux/platform_data/mfd-mcp-sa11x0.h>
  19. #include <mach/shannon.h>
  20. #include <mach/irqs.h>
  21. #include "generic.h"
  22. static struct mtd_partition shannon_partitions[] = {
  23. {
  24. .name = "BLOB boot loader",
  25. .offset = 0,
  26. .size = 0x20000
  27. },
  28. {
  29. .name = "kernel",
  30. .offset = MTDPART_OFS_APPEND,
  31. .size = 0xe0000
  32. },
  33. {
  34. .name = "initrd",
  35. .offset = MTDPART_OFS_APPEND,
  36. .size = MTDPART_SIZ_FULL
  37. }
  38. };
  39. static struct flash_platform_data shannon_flash_data = {
  40. .map_name = "cfi_probe",
  41. .parts = shannon_partitions,
  42. .nr_parts = ARRAY_SIZE(shannon_partitions),
  43. };
  44. static struct resource shannon_flash_resource =
  45. DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_4M);
  46. static struct mcp_plat_data shannon_mcp_data = {
  47. .mccr0 = MCCR0_ADM,
  48. .sclk_rate = 11981000,
  49. };
  50. static struct sa1100fb_mach_info shannon_lcd_info = {
  51. .pixclock = 152500, .bpp = 8,
  52. .xres = 640, .yres = 480,
  53. .hsync_len = 4, .vsync_len = 3,
  54. .left_margin = 2, .upper_margin = 0,
  55. .right_margin = 1, .lower_margin = 0,
  56. .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
  57. .lccr0 = LCCR0_Color | LCCR0_Dual | LCCR0_Pas,
  58. .lccr3 = LCCR3_ACBsDiv(512),
  59. };
  60. static void __init shannon_init(void)
  61. {
  62. sa11x0_ppc_configure_mcp();
  63. sa11x0_register_lcd(&shannon_lcd_info);
  64. sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
  65. sa11x0_register_mcp(&shannon_mcp_data);
  66. }
  67. static void __init shannon_map_io(void)
  68. {
  69. sa1100_map_io();
  70. sa1100_register_uart(0, 3);
  71. sa1100_register_uart(1, 1);
  72. Ser1SDCR0 |= SDCR0_SUS;
  73. GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
  74. GPDR |= GPIO_UART_TXD | SHANNON_GPIO_CODEC_RESET;
  75. GPDR &= ~GPIO_UART_RXD;
  76. PPAR |= PPAR_UPR;
  77. /* reset the codec */
  78. GPCR = SHANNON_GPIO_CODEC_RESET;
  79. GPSR = SHANNON_GPIO_CODEC_RESET;
  80. }
  81. MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
  82. .atag_offset = 0x100,
  83. .map_io = shannon_map_io,
  84. .nr_irqs = SA1100_NR_IRQS,
  85. .init_irq = sa1100_init_irq,
  86. .init_time = sa1100_timer_init,
  87. .init_machine = shannon_init,
  88. .init_late = sa11x0_init_late,
  89. .restart = sa11x0_restart,
  90. MACHINE_END