board-rx51.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * Board support file for Nokia N900 (aka RX-51).
  3. *
  4. * Copyright (C) 2007, 2008 Nokia
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/delay.h>
  14. #include <linux/err.h>
  15. #include <linux/clk.h>
  16. #include <linux/io.h>
  17. #include <linux/gpio.h>
  18. #include <linux/leds.h>
  19. #include <linux/usb/musb.h>
  20. #include <linux/platform_data/spi-omap2-mcspi.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/map.h>
  24. #include <linux/omap-dma.h>
  25. #include "common.h"
  26. #include "mux.h"
  27. #include "gpmc.h"
  28. #include "pm.h"
  29. #include "sdram-nokia.h"
  30. #define RX51_GPIO_SLEEP_IND 162
  31. static struct gpio_led gpio_leds[] = {
  32. {
  33. .name = "sleep_ind",
  34. .gpio = RX51_GPIO_SLEEP_IND,
  35. },
  36. };
  37. static struct gpio_led_platform_data gpio_led_info = {
  38. .leds = gpio_leds,
  39. .num_leds = ARRAY_SIZE(gpio_leds),
  40. };
  41. static struct platform_device leds_gpio = {
  42. .name = "leds-gpio",
  43. .id = -1,
  44. .dev = {
  45. .platform_data = &gpio_led_info,
  46. },
  47. };
  48. /*
  49. * cpuidle C-states definition for rx51.
  50. *
  51. * The 'exit_latency' field is the sum of sleep
  52. * and wake-up latencies.
  53. ---------------------------------------------
  54. | state | exit_latency | target_residency |
  55. ---------------------------------------------
  56. | C1 | 110 + 162 | 5 |
  57. | C2 | 106 + 180 | 309 |
  58. | C3 | 107 + 410 | 46057 |
  59. | C4 | 121 + 3374 | 46057 |
  60. | C5 | 855 + 1146 | 46057 |
  61. | C6 | 7580 + 4134 | 484329 |
  62. | C7 | 7505 + 15274 | 484329 |
  63. ---------------------------------------------
  64. */
  65. extern void __init rx51_peripherals_init(void);
  66. #ifdef CONFIG_OMAP_MUX
  67. static struct omap_board_mux board_mux[] __initdata = {
  68. { .reg_offset = OMAP_MUX_TERMINATOR },
  69. };
  70. #endif
  71. static struct omap_musb_board_data musb_board_data = {
  72. .interface_type = MUSB_INTERFACE_ULPI,
  73. .mode = MUSB_PERIPHERAL,
  74. .power = 0,
  75. };
  76. static void __init rx51_init(void)
  77. {
  78. struct omap_sdrc_params *sdrc_params;
  79. omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
  80. omap_serial_init();
  81. sdrc_params = nokia_get_sdram_timings();
  82. omap_sdrc_init(sdrc_params, sdrc_params);
  83. usb_musb_init(&musb_board_data);
  84. rx51_peripherals_init();
  85. /* Ensure SDRC pins are mux'd for self-refresh */
  86. omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
  87. omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
  88. platform_device_register(&leds_gpio);
  89. }
  90. static void __init rx51_reserve(void)
  91. {
  92. omap_reserve();
  93. }
  94. MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
  95. /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
  96. .atag_offset = 0x100,
  97. .reserve = rx51_reserve,
  98. .map_io = omap3_map_io,
  99. .init_early = omap3430_init_early,
  100. .init_irq = omap3_init_irq,
  101. .handle_irq = omap3_intc_handle_irq,
  102. .init_machine = rx51_init,
  103. .init_late = omap3430_init_late,
  104. .timer = &omap3_timer,
  105. .restart = omap3xxx_restart,
  106. MACHINE_END