board-generic.c 2.0 KB

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