board-4430sdp.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * Board support file for OMAP4430 SDP.
  3. *
  4. * Copyright (C) 2009 Texas Instruments
  5. *
  6. * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
  7. *
  8. * Based on mach-omap2/board-3430sdp.c
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/io.h>
  18. #include <linux/gpio.h>
  19. #include <linux/usb/otg.h>
  20. #include <mach/hardware.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <asm/mach/map.h>
  24. #include <plat/board.h>
  25. #include <plat/common.h>
  26. #include <plat/control.h>
  27. #include <plat/timer-gp.h>
  28. #include <plat/usb.h>
  29. #include <asm/hardware/gic.h>
  30. #include <asm/hardware/cache-l2x0.h>
  31. static struct platform_device sdp4430_lcd_device = {
  32. .name = "sdp4430_lcd",
  33. .id = -1,
  34. };
  35. static struct platform_device *sdp4430_devices[] __initdata = {
  36. &sdp4430_lcd_device,
  37. };
  38. static struct omap_lcd_config sdp4430_lcd_config __initdata = {
  39. .ctrl_name = "internal",
  40. };
  41. static struct omap_board_config_kernel sdp4430_config[] __initdata = {
  42. { OMAP_TAG_LCD, &sdp4430_lcd_config },
  43. };
  44. #ifdef CONFIG_CACHE_L2X0
  45. static int __init omap_l2_cache_init(void)
  46. {
  47. extern void omap_smc1(u32 fn, u32 arg);
  48. void __iomem *l2cache_base;
  49. /* To avoid code running on other OMAPs in
  50. * multi-omap builds
  51. */
  52. if (!cpu_is_omap44xx())
  53. return -ENODEV;
  54. /* Static mapping, never released */
  55. l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
  56. BUG_ON(!l2cache_base);
  57. /* Enable PL310 L2 Cache controller */
  58. omap_smc1(0x102, 0x1);
  59. /* 32KB way size, 16-way associativity,
  60. * parity disabled
  61. */
  62. l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
  63. return 0;
  64. }
  65. early_initcall(omap_l2_cache_init);
  66. #endif
  67. static void __init gic_init_irq(void)
  68. {
  69. void __iomem *base;
  70. /* Static mapping, never released */
  71. base = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
  72. BUG_ON(!base);
  73. gic_dist_init(0, base, 29);
  74. /* Static mapping, never released */
  75. gic_cpu_base_addr = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
  76. BUG_ON(!gic_cpu_base_addr);
  77. gic_cpu_init(0, gic_cpu_base_addr);
  78. }
  79. static void __init omap_4430sdp_init_irq(void)
  80. {
  81. omap_board_config = sdp4430_config;
  82. omap_board_config_size = ARRAY_SIZE(sdp4430_config);
  83. omap2_init_common_hw(NULL, NULL);
  84. #ifdef CONFIG_OMAP_32K_TIMER
  85. omap2_gp_clockevent_set_gptimer(1);
  86. #endif
  87. gic_init_irq();
  88. omap_gpio_init();
  89. }
  90. static struct omap_musb_board_data musb_board_data = {
  91. .interface_type = MUSB_INTERFACE_UTMI,
  92. .mode = MUSB_PERIPHERAL,
  93. .power = 100,
  94. };
  95. static void __init omap_4430sdp_init(void)
  96. {
  97. platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
  98. omap_serial_init();
  99. /* OMAP4 SDP uses internal transceiver so register nop transceiver */
  100. usb_nop_xceiv_register();
  101. /* FIXME: allow multi-omap to boot until musb is updated for omap4 */
  102. if (!cpu_is_omap44xx())
  103. usb_musb_init(&musb_board_data);
  104. }
  105. static void __init omap_4430sdp_map_io(void)
  106. {
  107. omap2_set_globals_443x();
  108. omap44xx_map_common_io();
  109. }
  110. MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
  111. /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
  112. .phys_io = 0x48000000,
  113. .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
  114. .boot_params = 0x80000100,
  115. .map_io = omap_4430sdp_map_io,
  116. .init_irq = omap_4430sdp_init_irq,
  117. .init_machine = omap_4430sdp_init,
  118. .timer = &omap_timer,
  119. MACHINE_END