Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * linux/arch/arm/mach-omap1/board-generic.c
0004  *
0005  * Modified from board-innovator1510.c
0006  *
0007  * Code for generic OMAP board. Should work on many OMAP systems where
0008  * the device drivers take care of all the necessary hardware initialization.
0009  * Do not put any board specific code to this file; create a new machine
0010  * type if you need custom low-level initializations.
0011  */
0012 #include <linux/gpio.h>
0013 #include <linux/kernel.h>
0014 #include <linux/init.h>
0015 #include <linux/platform_device.h>
0016 
0017 #include <asm/mach-types.h>
0018 #include <asm/mach/arch.h>
0019 #include <asm/mach/map.h>
0020 
0021 #include "hardware.h"
0022 #include "mux.h"
0023 #include "usb.h"
0024 #include "common.h"
0025 
0026 /* assume no Mini-AB port */
0027 
0028 #ifdef CONFIG_ARCH_OMAP15XX
0029 static struct omap_usb_config generic1510_usb_config __initdata = {
0030     .register_host  = 1,
0031     .register_dev   = 1,
0032     .hmc_mode   = 16,
0033     .pins[0]    = 3,
0034 };
0035 #endif
0036 
0037 #if defined(CONFIG_ARCH_OMAP16XX)
0038 static struct omap_usb_config generic1610_usb_config __initdata = {
0039 #ifdef CONFIG_USB_OTG
0040     .otg        = 1,
0041 #endif
0042     .register_host  = 1,
0043     .register_dev   = 1,
0044     .hmc_mode   = 16,
0045     .pins[0]    = 6,
0046 };
0047 #endif
0048 
0049 static void __init omap_generic_init(void)
0050 {
0051 #ifdef CONFIG_ARCH_OMAP15XX
0052     if (cpu_is_omap15xx()) {
0053         /* mux pins for uarts */
0054         omap_cfg_reg(UART1_TX);
0055         omap_cfg_reg(UART1_RTS);
0056         omap_cfg_reg(UART2_TX);
0057         omap_cfg_reg(UART2_RTS);
0058         omap_cfg_reg(UART3_TX);
0059         omap_cfg_reg(UART3_RX);
0060 
0061         omap1_usb_init(&generic1510_usb_config);
0062     }
0063 #endif
0064 #if defined(CONFIG_ARCH_OMAP16XX)
0065     if (!cpu_is_omap1510()) {
0066         omap1_usb_init(&generic1610_usb_config);
0067     }
0068 #endif
0069 
0070     omap_serial_init();
0071     omap_register_i2c_bus(1, 100, NULL, 0);
0072 }
0073 
0074 MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
0075     /* Maintainer: Tony Lindgren <tony@atomide.com> */
0076     .atag_offset    = 0x100,
0077     .map_io     = omap16xx_map_io,
0078     .init_early = omap1_init_early,
0079     .init_irq   = omap1_init_irq,
0080     .handle_irq = omap1_handle_irq,
0081     .init_machine   = omap_generic_init,
0082     .init_late  = omap1_init_late,
0083     .init_time  = omap1_timer_init,
0084     .restart    = omap1_restart,
0085 MACHINE_END