2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <linux/types.h>
22 #include <linux/init.h>
23 #include <linux/kernel.h>
24 #include <linux/memory.h>
25 #include <linux/platform_device.h>
26 #include <linux/gpio.h>
27 #include <linux/smsc911x.h>
29 #include <mach/hardware.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/time.h>
33 #include <asm/mach/map.h>
34 #include <mach/common.h>
36 #include <asm/setup.h>
37 #include <mach/board-mx31lite.h>
38 #include <mach/imx-uart.h>
39 #include <mach/iomux-mx3.h>
40 #include <mach/irqs.h>
44 * This file contains the board-specific initialization routines.
47 static unsigned int mx31lite_pins[] = {
54 IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO),
57 static struct imxuart_platform_data uart_pdata = {
58 .flags = IMXUART_HAVE_RTSCTS,
61 static struct smsc911x_platform_config smsc911x_config = {
62 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
63 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
64 .flags = SMSC911X_USE_16BIT,
67 static struct resource smsc911x_resources[] = {
69 .start = CS4_BASE_ADDR,
70 .end = CS4_BASE_ADDR + 0x100,
71 .flags = IORESOURCE_MEM,
74 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6),
75 .end = IOMUX_TO_IRQ(MX31_PIN_SFS6),
76 .flags = IORESOURCE_IRQ,
80 static struct platform_device smsc911x_device = {
83 .num_resources = ARRAY_SIZE(smsc911x_resources),
84 .resource = smsc911x_resources,
86 .platform_data = &smsc911x_config,
91 * This structure defines the MX31 memory map.
93 static struct map_desc mx31lite_io_desc[] __initdata = {
95 .virtual = SPBA0_BASE_ADDR_VIRT,
96 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
98 .type = MT_DEVICE_NONSHARED
100 .virtual = CS4_BASE_ADDR_VIRT,
101 .pfn = __phys_to_pfn(CS4_BASE_ADDR),
108 * Set up static virtual mappings.
110 void __init mx31lite_map_io(void)
113 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
117 * Board specific initialization.
119 static void __init mxc_board_init(void)
121 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
124 mxc_register_device(&mxc_uart_device0, &uart_pdata);
126 /* SMSC9117 IRQ pin */
127 gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6));
128 platform_device_register(&smsc911x_device);
131 static void __init mx31lite_timer_init(void)
133 mx31_clocks_init(26000000);
136 struct sys_timer mx31lite_timer = {
137 .init = mx31lite_timer_init,
141 * The following uses standard kernel macros defined in arch.h in order to
142 * initialize __mach_desc_MX31LITE data structure.
145 MACHINE_START(MX31LITE, "LogicPD MX31 LITEKIT")
146 /* Maintainer: Freescale Semiconductor, Inc. */
147 .phys_io = AIPS1_BASE_ADDR,
148 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
149 .boot_params = PHYS_OFFSET + 0x100,
150 .map_io = mx31lite_map_io,
151 .init_irq = mxc_init_irq,
152 .init_machine = mxc_board_init,
153 .timer = &mx31lite_timer,