board-generic.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * linux/arch/arm/mach-omap1/board-generic.c
  3. *
  4. * Modified from board-innovator1510.c
  5. *
  6. * Code for generic OMAP board. Should work on many OMAP systems where
  7. * the device drivers take care of all the necessary hardware initialization.
  8. * Do not put any board specific code to this file; create a new machine
  9. * type if you need custom low-level initializations.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/gpio.h>
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <mach/hardware.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <asm/mach/map.h>
  23. #include <mach/mux.h>
  24. #include <mach/usb.h>
  25. #include "common.h"
  26. /* assume no Mini-AB port */
  27. #ifdef CONFIG_ARCH_OMAP15XX
  28. static struct omap_usb_config generic1510_usb_config __initdata = {
  29. .register_host = 1,
  30. .register_dev = 1,
  31. .hmc_mode = 16,
  32. .pins[0] = 3,
  33. };
  34. #endif
  35. #if defined(CONFIG_ARCH_OMAP16XX)
  36. static struct omap_usb_config generic1610_usb_config __initdata = {
  37. #ifdef CONFIG_USB_OTG
  38. .otg = 1,
  39. #endif
  40. .register_host = 1,
  41. .register_dev = 1,
  42. .hmc_mode = 16,
  43. .pins[0] = 6,
  44. };
  45. #endif
  46. static void __init omap_generic_init(void)
  47. {
  48. #ifdef CONFIG_ARCH_OMAP15XX
  49. if (cpu_is_omap15xx()) {
  50. /* mux pins for uarts */
  51. omap_cfg_reg(UART1_TX);
  52. omap_cfg_reg(UART1_RTS);
  53. omap_cfg_reg(UART2_TX);
  54. omap_cfg_reg(UART2_RTS);
  55. omap_cfg_reg(UART3_TX);
  56. omap_cfg_reg(UART3_RX);
  57. omap1_usb_init(&generic1510_usb_config);
  58. }
  59. #endif
  60. #if defined(CONFIG_ARCH_OMAP16XX)
  61. if (!cpu_is_omap1510()) {
  62. omap1_usb_init(&generic1610_usb_config);
  63. }
  64. #endif
  65. omap_serial_init();
  66. omap_register_i2c_bus(1, 100, NULL, 0);
  67. }
  68. MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
  69. /* Maintainer: Tony Lindgren <tony@atomide.com> */
  70. .atag_offset = 0x100,
  71. .map_io = omap16xx_map_io,
  72. .init_early = omap1_init_early,
  73. .init_irq = omap1_init_irq,
  74. .handle_irq = omap1_handle_irq,
  75. .init_machine = omap_generic_init,
  76. .init_late = omap1_init_late,
  77. .init_time = omap1_timer_init,
  78. .restart = omap1_restart,
  79. MACHINE_END