blob: 8059cc0905c6063e5dc079f9b03545d28d90bb5d [file] [log] [blame]
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -05001/*
2 * linux/arch/arm/mach-mmp/flint.c
3 *
4 * Support for the Marvell Flint Development Platform.
5 *
6 * Copyright (C) 2009 Marvell International Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * publishhed by the Free Software Foundation.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/smc91x.h>
17#include <linux/io.h>
18#include <linux/gpio.h>
Haojian Zhuang0bd86962010-09-08 09:42:42 -040019#include <linux/interrupt.h>
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -050020
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23#include <mach/addr-map.h>
24#include <mach/mfp-mmp2.h>
25#include <mach/mmp2.h>
Rob Herring8661fb92012-01-03 16:50:40 -060026#include <mach/irqs.h>
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -050027
28#include "common.h"
29
Rob Herring8661fb92012-01-03 16:50:40 -060030#define FLINT_NR_IRQS (MMP_NR_IRQS + 48)
Haojian Zhuang0bd86962010-09-08 09:42:42 -040031
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -050032static unsigned long flint_pin_config[] __initdata = {
33 /* UART1 */
34 GPIO45_UART1_RXD,
35 GPIO46_UART1_TXD,
36
37 /* UART2 */
38 GPIO47_UART2_RXD,
39 GPIO48_UART2_TXD,
40
41 /* SMC */
42 GPIO151_SMC_SCLK,
43 GPIO145_SMC_nCS0,
44 GPIO146_SMC_nCS1,
45 GPIO152_SMC_BE0,
46 GPIO153_SMC_BE1,
47 GPIO154_SMC_IRQ,
48 GPIO113_SMC_RDY,
49
50 /*Ethernet*/
Eric Miaoa8fb0b52010-12-18 21:57:07 +080051 GPIO155_GPIO,
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -050052
53 /* DFI */
54 GPIO168_DFI_D0,
55 GPIO167_DFI_D1,
56 GPIO166_DFI_D2,
57 GPIO165_DFI_D3,
58 GPIO107_DFI_D4,
59 GPIO106_DFI_D5,
60 GPIO105_DFI_D6,
61 GPIO104_DFI_D7,
62 GPIO111_DFI_D8,
63 GPIO164_DFI_D9,
64 GPIO163_DFI_D10,
65 GPIO162_DFI_D11,
66 GPIO161_DFI_D12,
67 GPIO110_DFI_D13,
68 GPIO109_DFI_D14,
69 GPIO108_DFI_D15,
70 GPIO143_ND_nCS0,
71 GPIO144_ND_nCS1,
72 GPIO147_ND_nWE,
73 GPIO148_ND_nRE,
74 GPIO150_ND_ALE,
75 GPIO149_ND_CLE,
76 GPIO112_ND_RDY0,
77 GPIO160_ND_RDY1,
78};
79
80static struct smc91x_platdata flint_smc91x_info = {
81 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
82};
83
84static struct resource smc91x_resources[] = {
85 [0] = {
86 .start = SMC_CS1_PHYS_BASE + 0x300,
87 .end = SMC_CS1_PHYS_BASE + 0xfffff,
88 .flags = IORESOURCE_MEM,
89 },
90 [1] = {
Haojian Zhuang4929f5a2011-10-10 16:03:51 +080091 .start = MMP_GPIO_TO_IRQ(155),
92 .end = MMP_GPIO_TO_IRQ(155),
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -050093 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
94 }
95};
96
97static struct platform_device smc91x_device = {
98 .name = "smc91x",
99 .id = 0,
100 .dev = {
101 .platform_data = &flint_smc91x_info,
102 },
103 .num_resources = ARRAY_SIZE(smc91x_resources),
104 .resource = smc91x_resources,
105};
106
107static void __init flint_init(void)
108{
109 mfp_config(ARRAY_AND_SIZE(flint_pin_config));
110
111 /* on-chip devices */
112 mmp2_add_uart(1);
113 mmp2_add_uart(2);
Haojian Zhuang157d2642011-10-17 20:37:52 +0800114 platform_device_register(&mmp2_device_gpio);
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -0500115
116 /* off-chip devices */
117 platform_device_register(&smc91x_device);
118}
119
120MACHINE_START(FLINT, "Flint Development Platform")
Eric Miao80228872010-07-15 17:50:13 +0800121 .map_io = mmp_map_io,
Haojian Zhuang0bd86962010-09-08 09:42:42 -0400122 .nr_irqs = FLINT_NR_IRQS,
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -0500123 .init_irq = mmp2_init_irq,
124 .timer = &mmp2_timer,
125 .init_machine = flint_init,
Russell King9854a382011-11-05 15:40:09 +0000126 .restart = mmp_restart,
Haojian Zhuang2f7e8fa2009-12-04 09:41:28 -0500127MACHINE_END