blob: c625549901154be69d99693c85aae342d89c8e5e [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Tony Lindgrendbdf9ced2005-07-10 19:58:11 +01003 * linux/arch/arm/mach-omap1/board-generic.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
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.
Linus Torvalds1da177e2005-04-16 15:20:36 -070011 */
Russell King2f8163b2011-07-26 10:53:52 +010012#include <linux/gpio.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/kernel.h>
14#include <linux/init.h>
Tony Lindgren3179a012005-11-10 14:26:48 +000015#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Russell Kinga09e64f2008-08-05 16:14:15 +010017#include <mach/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21
Tony Lindgren70c494c2012-09-19 10:46:56 -070022#include <mach/mux.h>
Tony Lindgrenb924b202012-06-04 00:56:15 -070023
24#include <mach/usb.h>
25
Tony Lindgren4e653312011-11-10 22:45:17 +010026#include "common.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
Linus Torvalds1da177e2005-04-16 15:20:36 -070028/* assume no Mini-AB port */
29
Tony Lindgren3179a012005-11-10 14:26:48 +000030#ifdef CONFIG_ARCH_OMAP15XX
Linus Torvalds1da177e2005-04-16 15:20:36 -070031static struct omap_usb_config generic1510_usb_config __initdata = {
32 .register_host = 1,
33 .register_dev = 1,
34 .hmc_mode = 16,
35 .pins[0] = 3,
36};
37#endif
38
39#if defined(CONFIG_ARCH_OMAP16XX)
40static struct omap_usb_config generic1610_usb_config __initdata = {
Tony Lindgren7c38cf02005-09-08 23:07:38 +010041#ifdef CONFIG_USB_OTG
42 .otg = 1,
43#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 .register_host = 1,
45 .register_dev = 1,
46 .hmc_mode = 16,
47 .pins[0] = 6,
48};
49#endif
50
Linus Torvalds1da177e2005-04-16 15:20:36 -070051static void __init omap_generic_init(void)
52{
Tony Lindgren3179a012005-11-10 14:26:48 +000053#ifdef CONFIG_ARCH_OMAP15XX
Tony Lindgren9b6553c2006-04-02 17:46:30 +010054 if (cpu_is_omap15xx()) {
Janusz Krzysztofikc33da3a2009-10-22 14:47:42 -070055 /* mux pins for uarts */
56 omap_cfg_reg(UART1_TX);
57 omap_cfg_reg(UART1_RTS);
58 omap_cfg_reg(UART2_TX);
59 omap_cfg_reg(UART2_RTS);
60 omap_cfg_reg(UART3_TX);
61 omap_cfg_reg(UART3_RX);
62
Tony Lindgrendd0cdd82010-07-05 16:31:30 +030063 omap1_usb_init(&generic1510_usb_config);
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 }
65#endif
66#if defined(CONFIG_ARCH_OMAP16XX)
67 if (!cpu_is_omap1510()) {
Tony Lindgrendd0cdd82010-07-05 16:31:30 +030068 omap1_usb_init(&generic1610_usb_config);
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 }
70#endif
Tony Lindgren7c38cf02005-09-08 23:07:38 +010071
Tony Lindgren3179a012005-11-10 14:26:48 +000072 omap_serial_init();
Jarkko Nikula1ed16a82007-11-07 06:54:32 +020073 omap_register_i2c_bus(1, 100, NULL, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -070074}
75
Linus Torvalds1da177e2005-04-16 15:20:36 -070076MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
Russell Kinge9dea0c2005-07-03 17:38:58 +010077 /* Maintainer: Tony Lindgren <tony@atomide.com> */
Nicolas Pitre246e3892011-07-05 22:38:15 -040078 .atag_offset = 0x100,
Tony Lindgren7b88e622011-10-05 15:14:02 -070079 .map_io = omap16xx_map_io,
80 .init_early = omap1_init_early,
Tony Lindgren7b88e622011-10-05 15:14:02 -070081 .init_irq = omap1_init_irq,
Tony Lindgrenb6943312015-05-20 09:01:21 -070082 .handle_irq = omap1_handle_irq,
Russell Kinge9dea0c2005-07-03 17:38:58 +010083 .init_machine = omap_generic_init,
Shawn Guo82c3bd02012-04-26 13:49:29 +080084 .init_late = omap1_init_late,
Stephen Warren6bb27d72012-11-08 12:40:59 -070085 .init_time = omap1_timer_init,
Russell Kingbaa95882011-11-05 17:06:28 +000086 .restart = omap1_restart,
Linus Torvalds1da177e2005-04-16 15:20:36 -070087MACHINE_END