Eric Miao | a3929f3 | 2009-03-20 13:27:30 +0800 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-mmp/tavorevb.c |
| 3 | * |
| 4 | * Support for the Marvell PXA910-based TavorEVB Development Platform. |
| 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 version 2 as |
| 8 | * publishhed by the Free Software Foundation. |
| 9 | */ |
Russell King | 2f8163b | 2011-07-26 10:53:52 +0100 | [diff] [blame] | 10 | #include <linux/gpio.h> |
Eric Miao | a3929f3 | 2009-03-20 13:27:30 +0800 | [diff] [blame] | 11 | #include <linux/init.h> |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/smc91x.h> |
Linus Walleij | f55be1b | 2011-09-28 09:11:30 +0100 | [diff] [blame] | 15 | #include <linux/gpio.h> |
Eric Miao | a3929f3 | 2009-03-20 13:27:30 +0800 | [diff] [blame] | 16 | |
| 17 | #include <asm/mach-types.h> |
| 18 | #include <asm/mach/arch.h> |
| 19 | #include <mach/addr-map.h> |
| 20 | #include <mach/mfp-pxa910.h> |
| 21 | #include <mach/pxa910.h> |
Eric Miao | a3929f3 | 2009-03-20 13:27:30 +0800 | [diff] [blame] | 22 | |
| 23 | #include "common.h" |
| 24 | |
| 25 | static unsigned long tavorevb_pin_config[] __initdata = { |
| 26 | /* UART2 */ |
| 27 | GPIO47_UART2_RXD, |
| 28 | GPIO48_UART2_TXD, |
| 29 | |
| 30 | /* SMC */ |
| 31 | SM_nCS0_nCS0, |
| 32 | SM_ADV_SM_ADV, |
| 33 | SM_SCLK_SM_SCLK, |
| 34 | SM_SCLK_SM_SCLK, |
| 35 | SM_BE0_SM_BE0, |
| 36 | SM_BE1_SM_BE1, |
| 37 | |
| 38 | /* DFI */ |
| 39 | DF_IO0_ND_IO0, |
| 40 | DF_IO1_ND_IO1, |
| 41 | DF_IO2_ND_IO2, |
| 42 | DF_IO3_ND_IO3, |
| 43 | DF_IO4_ND_IO4, |
| 44 | DF_IO5_ND_IO5, |
| 45 | DF_IO6_ND_IO6, |
| 46 | DF_IO7_ND_IO7, |
| 47 | DF_IO8_ND_IO8, |
| 48 | DF_IO9_ND_IO9, |
| 49 | DF_IO10_ND_IO10, |
| 50 | DF_IO11_ND_IO11, |
| 51 | DF_IO12_ND_IO12, |
| 52 | DF_IO13_ND_IO13, |
| 53 | DF_IO14_ND_IO14, |
| 54 | DF_IO15_ND_IO15, |
| 55 | DF_nCS0_SM_nCS2_nCS0, |
| 56 | DF_ALE_SM_WEn_ND_ALE, |
| 57 | DF_CLE_SM_OEn_ND_CLE, |
| 58 | DF_WEn_DF_WEn, |
| 59 | DF_REn_DF_REn, |
| 60 | DF_RDY0_DF_RDY0, |
| 61 | }; |
| 62 | |
| 63 | static struct smc91x_platdata tavorevb_smc91x_info = { |
| 64 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
| 65 | }; |
| 66 | |
| 67 | static struct resource smc91x_resources[] = { |
| 68 | [0] = { |
| 69 | .start = SMC_CS1_PHYS_BASE + 0x300, |
| 70 | .end = SMC_CS1_PHYS_BASE + 0xfffff, |
| 71 | .flags = IORESOURCE_MEM, |
| 72 | }, |
| 73 | [1] = { |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame^] | 74 | .start = MMP_GPIO_TO_IRQ(80), |
| 75 | .end = MMP_GPIO_TO_IRQ(80), |
Eric Miao | a3929f3 | 2009-03-20 13:27:30 +0800 | [diff] [blame] | 76 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
| 77 | } |
| 78 | }; |
| 79 | |
| 80 | static struct platform_device smc91x_device = { |
| 81 | .name = "smc91x", |
| 82 | .id = 0, |
| 83 | .dev = { |
| 84 | .platform_data = &tavorevb_smc91x_info, |
| 85 | }, |
| 86 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 87 | .resource = smc91x_resources, |
| 88 | }; |
| 89 | |
| 90 | static void __init tavorevb_init(void) |
| 91 | { |
| 92 | mfp_config(ARRAY_AND_SIZE(tavorevb_pin_config)); |
| 93 | |
| 94 | /* on-chip devices */ |
| 95 | pxa910_add_uart(1); |
| 96 | |
| 97 | /* off-chip devices */ |
| 98 | platform_device_register(&smc91x_device); |
| 99 | } |
| 100 | |
| 101 | MACHINE_START(TAVOREVB, "PXA910 Evaluation Board (aka TavorEVB)") |
Eric Miao | 8022887 | 2010-07-15 17:50:13 +0800 | [diff] [blame] | 102 | .map_io = mmp_map_io, |
Eric Miao | a3929f3 | 2009-03-20 13:27:30 +0800 | [diff] [blame] | 103 | .init_irq = pxa910_init_irq, |
| 104 | .timer = &pxa910_timer, |
| 105 | .init_machine = tavorevb_init, |
| 106 | MACHINE_END |