2 * LILLY-1131 module support
4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
6 * based on code for other MX31 boards,
8 * Copyright 2005-2007 Freescale Semiconductor
9 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
10 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <linux/types.h>
28 #include <linux/init.h>
29 #include <linux/clk.h>
30 #include <linux/platform_device.h>
31 #include <linux/interrupt.h>
32 #include <linux/smsc911x.h>
33 #include <linux/mtd/physmap.h>
35 #include <asm/mach-types.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/time.h>
38 #include <asm/mach/map.h>
40 #include <mach/hardware.h>
41 #include <mach/common.h>
42 #include <mach/iomux-mx3.h>
43 #include <mach/board-mx31lilly.h>
48 * This file contains module-specific initialization routines for LILLY-1131.
49 * Initialization of peripherals found on the baseboard is implemented in the
50 * appropriate baseboard support code.
53 /* SMSC ethernet support */
55 static struct resource smsc91x_resources[] = {
57 .start = CS4_BASE_ADDR,
58 .end = CS4_BASE_ADDR + 0xffff,
59 .flags = IORESOURCE_MEM,
62 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
63 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
64 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
68 static struct smsc911x_platform_config smsc911x_config = {
69 .phy_interface = PHY_INTERFACE_MODE_MII,
70 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
71 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
72 .flags = SMSC911X_USE_32BIT |
73 SMSC911X_SAVE_MAC_ADDRESS |
74 SMSC911X_FORCE_INTERNAL_PHY,
77 static struct platform_device smsc91x_device = {
80 .num_resources = ARRAY_SIZE(smsc91x_resources),
81 .resource = smsc91x_resources,
83 .platform_data = &smsc911x_config,
88 static struct physmap_flash_data nor_flash_data = {
92 static struct resource nor_flash_resource = {
95 .flags = IORESOURCE_MEM,
98 static struct platform_device physmap_flash_device = {
99 .name = "physmap-flash",
102 .platform_data = &nor_flash_data,
104 .resource = &nor_flash_resource,
108 static struct platform_device *devices[] __initdata = {
110 &physmap_flash_device,
113 static int mx31lilly_baseboard;
114 core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444);
116 static void __init mx31lilly_board_init(void)
118 switch (mx31lilly_baseboard) {
119 case MX31LILLY_NOBOARD:
125 printk(KERN_ERR "Illegal mx31lilly_baseboard type %d\n",
126 mx31lilly_baseboard);
129 mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
131 platform_add_devices(devices, ARRAY_SIZE(devices));
134 static void __init mx31lilly_timer_init(void)
136 mx31_clocks_init(26000000);
139 static struct sys_timer mx31lilly_timer = {
140 .init = mx31lilly_timer_init,
143 MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
144 .phys_io = AIPS1_BASE_ADDR,
145 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
146 .boot_params = PHYS_OFFSET + 0x100,
147 .map_io = mx31_map_io,
148 .init_irq = mxc_init_irq,
149 .init_machine = mx31lilly_board_init,
150 .timer = &mx31lilly_timer,