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