blob: abe6ca39853a47f26963b4af02830a8d13d7bdbc [file] [log] [blame]
Daniel Mack9a4cd7a2008-07-05 10:02:53 +02001/*
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.
5 *
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.
10 *
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.
15 *
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
19 */
20
21#include <linux/types.h>
22#include <linux/init.h>
23#include <linux/kernel.h>
24#include <linux/memory.h>
25
Russell Kinga09e64f2008-08-05 16:14:15 +010026#include <mach/hardware.h>
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020027#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
Juergen Beisert9e8a30d2008-07-05 10:02:53 +020029#include <asm/mach/time.h>
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020030#include <asm/mach/map.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010031#include <mach/common.h>
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020032#include <asm/page.h>
33#include <asm/setup.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010034#include <mach/board-mx31lite.h>
Magnus Liljaa854b8a2009-04-14 22:00:03 +020035#include <mach/imx-uart.h>
36#include <mach/iomux-mx3.h>
37#include "devices.h"
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020038
39/*
40 * This file contains the board-specific initialization routines.
41 */
42
Magnus Liljaa854b8a2009-04-14 22:00:03 +020043static unsigned int mx31lite_pins[] = {
44 /* UART1 */
45 MX31_PIN_CTS1__CTS1,
46 MX31_PIN_RTS1__RTS1,
47 MX31_PIN_TXD1__TXD1,
48 MX31_PIN_RXD1__RXD1,
49};
50
51static struct imxuart_platform_data uart_pdata = {
52 .flags = IMXUART_HAVE_RTSCTS,
53};
54
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020055/*
56 * This structure defines the MX31 memory map.
57 */
58static struct map_desc mx31lite_io_desc[] __initdata = {
59 {
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020060 .virtual = SPBA0_BASE_ADDR_VIRT,
61 .pfn = __phys_to_pfn(SPBA0_BASE_ADDR),
62 .length = SPBA0_SIZE,
Russell King9b727ab2008-09-07 12:45:01 +010063 .type = MT_DEVICE_NONSHARED
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020064 }, {
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020065 .virtual = CS4_BASE_ADDR_VIRT,
66 .pfn = __phys_to_pfn(CS4_BASE_ADDR),
67 .length = CS4_SIZE,
68 .type = MT_DEVICE
69 }
70};
71
72/*
73 * Set up static virtual mappings.
74 */
75void __init mx31lite_map_io(void)
76{
Sascha Hauercd4a05f2009-04-02 22:32:10 +020077 mx31_map_io();
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020078 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
79}
80
81/*
82 * Board specific initialization.
83 */
84static void __init mxc_board_init(void)
85{
Magnus Liljaa854b8a2009-04-14 22:00:03 +020086 mxc_iomux_setup_multiple_pins(mx31lite_pins, ARRAY_SIZE(mx31lite_pins),
87 "mx31lite");
88
89 mxc_register_device(&mxc_uart_device0, &uart_pdata);
Daniel Mack9a4cd7a2008-07-05 10:02:53 +020090}
91
Juergen Beisert9e8a30d2008-07-05 10:02:53 +020092static void __init mx31lite_timer_init(void)
93{
Sascha Hauer30c730f2009-02-16 14:36:49 +010094 mx31_clocks_init(26000000);
Juergen Beisert9e8a30d2008-07-05 10:02:53 +020095}
96
97struct sys_timer mx31lite_timer = {
98 .init = mx31lite_timer_init,
99};
100
Daniel Mack9a4cd7a2008-07-05 10:02:53 +0200101/*
102 * The following uses standard kernel macros defined in arch.h in order to
103 * initialize __mach_desc_MX31LITE data structure.
104 */
105
106MACHINE_START(MX31LITE, "LogicPD MX31 LITEKIT")
107 /* Maintainer: Freescale Semiconductor, Inc. */
108 .phys_io = AIPS1_BASE_ADDR,
109 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
110 .boot_params = PHYS_OFFSET + 0x100,
111 .map_io = mx31lite_map_io,
112 .init_irq = mxc_init_irq,
113 .init_machine = mxc_board_init,
Juergen Beisert9e8a30d2008-07-05 10:02:53 +0200114 .timer = &mx31lite_timer,
Daniel Mack9a4cd7a2008-07-05 10:02:53 +0200115MACHINE_END