board-n8x0.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /*
  2. * linux/arch/arm/mach-omap2/board-n8x0.c
  3. *
  4. * Copyright (C) 2005-2009 Nokia Corporation
  5. * Author: Juha Yrjola <juha.yrjola@nokia.com>
  6. *
  7. * Modified from mach-omap2/board-generic.c
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/clk.h>
  14. #include <linux/delay.h>
  15. #include <linux/gpio.h>
  16. #include <linux/init.h>
  17. #include <linux/io.h>
  18. #include <linux/stddef.h>
  19. #include <linux/spi/spi.h>
  20. #include <linux/usb/musb.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach-types.h>
  23. #include <mach/board.h>
  24. #include <mach/common.h>
  25. #include <mach/irqs.h>
  26. #include <mach/mcspi.h>
  27. #include <mach/onenand.h>
  28. #include <mach/serial.h>
  29. static struct omap2_mcspi_device_config p54spi_mcspi_config = {
  30. .turbo_mode = 0,
  31. .single_channel = 1,
  32. };
  33. static struct spi_board_info n800_spi_board_info[] __initdata = {
  34. {
  35. .modalias = "p54spi",
  36. .bus_num = 2,
  37. .chip_select = 0,
  38. .max_speed_hz = 48000000,
  39. .controller_data = &p54spi_mcspi_config,
  40. },
  41. };
  42. #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
  43. defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
  44. static struct mtd_partition onenand_partitions[] = {
  45. {
  46. .name = "bootloader",
  47. .offset = 0,
  48. .size = 0x20000,
  49. .mask_flags = MTD_WRITEABLE, /* Force read-only */
  50. },
  51. {
  52. .name = "config",
  53. .offset = MTDPART_OFS_APPEND,
  54. .size = 0x60000,
  55. },
  56. {
  57. .name = "kernel",
  58. .offset = MTDPART_OFS_APPEND,
  59. .size = 0x200000,
  60. },
  61. {
  62. .name = "initfs",
  63. .offset = MTDPART_OFS_APPEND,
  64. .size = 0x400000,
  65. },
  66. {
  67. .name = "rootfs",
  68. .offset = MTDPART_OFS_APPEND,
  69. .size = MTDPART_SIZ_FULL,
  70. },
  71. };
  72. static struct omap_onenand_platform_data board_onenand_data = {
  73. .cs = 0,
  74. .gpio_irq = 26,
  75. .parts = onenand_partitions,
  76. .nr_parts = ARRAY_SIZE(onenand_partitions),
  77. .flags = ONENAND_SYNC_READ,
  78. };
  79. static void __init n8x0_onenand_init(void)
  80. {
  81. gpmc_onenand_init(&board_onenand_data);
  82. }
  83. #else
  84. static void __init n8x0_onenand_init(void) {}
  85. #endif
  86. static void __init n8x0_map_io(void)
  87. {
  88. omap2_set_globals_242x();
  89. omap2_map_common_io();
  90. }
  91. static void __init n8x0_init_irq(void)
  92. {
  93. omap2_init_common_hw(NULL, NULL);
  94. omap_init_irq();
  95. omap_gpio_init();
  96. }
  97. static void __init n8x0_init_machine(void)
  98. {
  99. /* FIXME: add n810 spi devices */
  100. spi_register_board_info(n800_spi_board_info,
  101. ARRAY_SIZE(n800_spi_board_info));
  102. omap_serial_init();
  103. n8x0_onenand_init();
  104. }
  105. MACHINE_START(NOKIA_N800, "Nokia N800")
  106. .phys_io = 0x48000000,
  107. .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  108. .boot_params = 0x80000100,
  109. .map_io = n8x0_map_io,
  110. .init_irq = n8x0_init_irq,
  111. .init_machine = n8x0_init_machine,
  112. .timer = &omap_timer,
  113. MACHINE_END
  114. MACHINE_START(NOKIA_N810, "Nokia N810")
  115. .phys_io = 0x48000000,
  116. .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  117. .boot_params = 0x80000100,
  118. .map_io = n8x0_map_io,
  119. .init_irq = n8x0_init_irq,
  120. .init_machine = n8x0_init_machine,
  121. .timer = &omap_timer,
  122. MACHINE_END
  123. MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
  124. .phys_io = 0x48000000,
  125. .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
  126. .boot_params = 0x80000100,
  127. .map_io = n8x0_map_io,
  128. .init_irq = n8x0_init_irq,
  129. .init_machine = n8x0_init_machine,
  130. .timer = &omap_timer,
  131. MACHINE_END