aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-03-19 19:10:40 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-03-19 19:10:40 -0400
commit7d83f8fca517b123cf0136503a9e50974f65ec49 (patch)
tree92ed1faaf112e98e29a00efc99e1a4e6c79e6a8e /arch/arm/mach-kirkwood
parentbe093beb608edf821b45fe00a8a080fb5c6ed4af (diff)
parent569106c70e49ad67c69fa7d43a2a5218e63a4619 (diff)
Merge branch 'master' of git://git.marvell.com/orion into devel
Conflicts: arch/arm/mach-mx1/devices.c
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/Kconfig6
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/common.c56
-rw-r--r--arch/arm/mach-kirkwood/common.h5
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c67
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h2
-rw-r--r--arch/arm/mach-kirkwood/mpp.c97
-rw-r--r--arch/arm/mach-kirkwood/mpp.h303
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c9
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c19
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c136
11 files changed, 677 insertions, 26 deletions
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 3600cd9f0519..532443622a17 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -20,6 +20,12 @@ config MACH_RD88F6281
20 Say 'Y' here if you want your kernel to support the 20 Say 'Y' here if you want your kernel to support the
21 Marvell RD-88F6281 Reference Board. 21 Marvell RD-88F6281 Reference Board.
22 22
23config MACH_SHEEVAPLUG
24 bool "Marvell SheevaPlug Reference Board"
25 help
26 Say 'Y' here if you want your kernel to support the
27 Marvell SheevaPlug Reference Board.
28
23endmenu 29endmenu
24 30
25endif 31endif
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index b96c55dad343..de81b4b5bd33 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,5 +1,6 @@
1obj-y += common.o addr-map.o irq.o pcie.o 1obj-y += common.o addr-map.o irq.o pcie.o mpp.o
2 2
3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o 3obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o
4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o 4obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o 5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
6obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index b3404b7775b3..9f012551794d 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -24,6 +24,7 @@
24#include <mach/kirkwood.h> 24#include <mach/kirkwood.h>
25#include <plat/cache-feroceon-l2.h> 25#include <plat/cache-feroceon-l2.h>
26#include <plat/ehci-orion.h> 26#include <plat/ehci-orion.h>
27#include <plat/mvsdio.h>
27#include <plat/mv_xor.h> 28#include <plat/mv_xor.h>
28#include <plat/orion_nand.h> 29#include <plat/orion_nand.h>
29#include <plat/time.h> 30#include <plat/time.h>
@@ -254,7 +255,7 @@ static struct resource kirkwood_rtc_resource = {
254 .flags = IORESOURCE_MEM, 255 .flags = IORESOURCE_MEM,
255}; 256};
256 257
257void __init kirkwood_rtc_init(void) 258static void __init kirkwood_rtc_init(void)
258{ 259{
259 platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1); 260 platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1);
260} 261}
@@ -296,6 +297,50 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
296 297
297 298
298/***************************************************************************** 299/*****************************************************************************
300 * SD/SDIO/MMC
301 ****************************************************************************/
302static struct resource mvsdio_resources[] = {
303 [0] = {
304 .start = SDIO_PHYS_BASE,
305 .end = SDIO_PHYS_BASE + SZ_1K - 1,
306 .flags = IORESOURCE_MEM,
307 },
308 [1] = {
309 .start = IRQ_KIRKWOOD_SDIO,
310 .end = IRQ_KIRKWOOD_SDIO,
311 .flags = IORESOURCE_IRQ,
312 },
313};
314
315static u64 mvsdio_dmamask = 0xffffffffUL;
316
317static struct platform_device kirkwood_sdio = {
318 .name = "mvsdio",
319 .id = -1,
320 .dev = {
321 .dma_mask = &mvsdio_dmamask,
322 .coherent_dma_mask = 0xffffffff,
323 },
324 .num_resources = ARRAY_SIZE(mvsdio_resources),
325 .resource = mvsdio_resources,
326};
327
328void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
329{
330 u32 dev, rev;
331
332 kirkwood_pcie_id(&dev, &rev);
333 if (rev == 0) /* catch all Kirkwood Z0's */
334 mvsdio_data->clock = 100000000;
335 else
336 mvsdio_data->clock = 200000000;
337 mvsdio_data->dram = &kirkwood_mbus_dram_info;
338 kirkwood_sdio.dev.platform_data = mvsdio_data;
339 platform_device_register(&kirkwood_sdio);
340}
341
342
343/*****************************************************************************
299 * SPI 344 * SPI
300 ****************************************************************************/ 345 ****************************************************************************/
301static struct orion_spi_info kirkwood_spi_plat_data = { 346static struct orion_spi_info kirkwood_spi_plat_data = {
@@ -502,7 +547,7 @@ static struct platform_device kirkwood_xor01_channel = {
502 }, 547 },
503}; 548};
504 549
505void __init kirkwood_xor0_init(void) 550static void __init kirkwood_xor0_init(void)
506{ 551{
507 platform_device_register(&kirkwood_xor0_shared); 552 platform_device_register(&kirkwood_xor0_shared);
508 553
@@ -600,7 +645,7 @@ static struct platform_device kirkwood_xor11_channel = {
600 }, 645 },
601}; 646};
602 647
603void __init kirkwood_xor1_init(void) 648static void __init kirkwood_xor1_init(void)
604{ 649{
605 platform_device_register(&kirkwood_xor1_shared); 650 platform_device_register(&kirkwood_xor1_shared);
606 651
@@ -708,4 +753,9 @@ void __init kirkwood_init(void)
708#ifdef CONFIG_CACHE_FEROCEON_L2 753#ifdef CONFIG_CACHE_FEROCEON_L2
709 kirkwood_l2_init(); 754 kirkwood_l2_init();
710#endif 755#endif
756
757 /* internal devices that every board has */
758 kirkwood_rtc_init();
759 kirkwood_xor0_init();
760 kirkwood_xor1_init();
711} 761}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index fe367c18e722..9e5282684d58 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -14,6 +14,7 @@
14struct dsa_platform_data; 14struct dsa_platform_data;
15struct mv643xx_eth_platform_data; 15struct mv643xx_eth_platform_data;
16struct mv_sata_platform_data; 16struct mv_sata_platform_data;
17struct mvsdio_platform_data;
17 18
18/* 19/*
19 * Basic Kirkwood init functions used early by machine-setup. 20 * Basic Kirkwood init functions used early by machine-setup.
@@ -33,13 +34,11 @@ void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
33void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data); 34void kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data);
34void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq); 35void kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq);
35void kirkwood_pcie_init(void); 36void kirkwood_pcie_init(void);
36void kirkwood_rtc_init(void);
37void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); 37void kirkwood_sata_init(struct mv_sata_platform_data *sata_data);
38void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data);
38void kirkwood_spi_init(void); 39void kirkwood_spi_init(void);
39void kirkwood_uart0_init(void); 40void kirkwood_uart0_init(void);
40void kirkwood_uart1_init(void); 41void kirkwood_uart1_init(void);
41void kirkwood_xor0_init(void);
42void kirkwood_xor1_init(void);
43 42
44extern struct sys_timer kirkwood_timer; 43extern struct sys_timer kirkwood_timer;
45 44
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index a14c2948c62a..5505d5837752 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -11,18 +11,59 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/nand.h> 14#include <linux/mtd/nand.h>
18#include <linux/timer.h> 15#include <linux/mtd/partitions.h>
19#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
20#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
21#include <asm/mach-types.h> 18#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
23#include <asm/mach/pci.h>
24#include <mach/kirkwood.h> 20#include <mach/kirkwood.h>
21#include <plat/orion_nand.h>
22#include <plat/mvsdio.h>
25#include "common.h" 23#include "common.h"
24#include "mpp.h"
25
26static struct mtd_partition db88f6281_nand_parts[] = {
27 {
28 .name = "u-boot",
29 .offset = 0,
30 .size = SZ_1M
31 }, {
32 .name = "uImage",
33 .offset = MTDPART_OFS_NXTBLK,
34 .size = SZ_4M
35 }, {
36 .name = "root",
37 .offset = MTDPART_OFS_NXTBLK,
38 .size = MTDPART_SIZ_FULL
39 },
40};
41
42static struct resource db88f6281_nand_resource = {
43 .flags = IORESOURCE_MEM,
44 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
45 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
46 KIRKWOOD_NAND_MEM_SIZE - 1,
47};
48
49static struct orion_nand_data db88f6281_nand_data = {
50 .parts = db88f6281_nand_parts,
51 .nr_parts = ARRAY_SIZE(db88f6281_nand_parts),
52 .cle = 0,
53 .ale = 1,
54 .width = 8,
55 .chip_delay = 25,
56};
57
58static struct platform_device db88f6281_nand_flash = {
59 .name = "orion_nand",
60 .id = -1,
61 .dev = {
62 .platform_data = &db88f6281_nand_data,
63 },
64 .resource = &db88f6281_nand_resource,
65 .num_resources = 1,
66};
26 67
27static struct mv643xx_eth_platform_data db88f6281_ge00_data = { 68static struct mv643xx_eth_platform_data db88f6281_ge00_data = {
28 .phy_addr = MV643XX_ETH_PHY_ADDR(8), 69 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
@@ -32,18 +73,32 @@ static struct mv_sata_platform_data db88f6281_sata_data = {
32 .n_ports = 2, 73 .n_ports = 2,
33}; 74};
34 75
76static struct mvsdio_platform_data db88f6281_mvsdio_data = {
77 .gpio_write_protect = 37,
78 .gpio_card_detect = 38,
79};
80
81static unsigned int db88f6281_mpp_config[] __initdata = {
82 MPP37_GPIO,
83 MPP38_GPIO,
84 0
85};
86
35static void __init db88f6281_init(void) 87static void __init db88f6281_init(void)
36{ 88{
37 /* 89 /*
38 * Basic setup. Needs to be called early. 90 * Basic setup. Needs to be called early.
39 */ 91 */
40 kirkwood_init(); 92 kirkwood_init();
93 kirkwood_mpp_conf(db88f6281_mpp_config);
41 94
42 kirkwood_ehci_init(); 95 kirkwood_ehci_init();
43 kirkwood_ge00_init(&db88f6281_ge00_data); 96 kirkwood_ge00_init(&db88f6281_ge00_data);
44 kirkwood_rtc_init();
45 kirkwood_sata_init(&db88f6281_sata_data); 97 kirkwood_sata_init(&db88f6281_sata_data);
46 kirkwood_uart0_init(); 98 kirkwood_uart0_init();
99 kirkwood_sdio_init(&db88f6281_mvsdio_data);
100
101 platform_device_register(&db88f6281_nand_flash);
47} 102}
48 103
49static int __init db88f6281_pci_init(void) 104static int __init db88f6281_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index ada480c0e197..d3db30fe763b 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -116,5 +116,7 @@
116 116
117#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) 117#define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000)
118 118
119#define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000)
120
119 121
120#endif 122#endif
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c
new file mode 100644
index 000000000000..63c44934391a
--- /dev/null
+++ b/arch/arm/mach-kirkwood/mpp.c
@@ -0,0 +1,97 @@
1/*
2 * arch/arm/mach-kirkwood/mpp.c
3 *
4 * MPP functions for Marvell Kirkwood SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
14#include <linux/io.h>
15#include <asm/gpio.h>
16#include <mach/hardware.h>
17#include "common.h"
18#include "mpp.h"
19
20static unsigned int __init kirkwood_variant(void)
21{
22 u32 dev, rev;
23
24 kirkwood_pcie_id(&dev, &rev);
25
26 if (dev == MV88F6281_DEV_ID && rev >= MV88F6281_REV_A0)
27 return MPP_F6281_MASK;
28 if (dev == MV88F6192_DEV_ID && rev >= MV88F6192_REV_A0)
29 return MPP_F6192_MASK;
30 if (dev == MV88F6180_DEV_ID)
31 return MPP_F6180_MASK;
32
33 printk(KERN_ERR "MPP setup: unknown kirkwood variant "
34 "(dev %#x rev %#x)\n", dev, rev);
35 return 0;
36}
37
38#define MPP_CTRL(i) (DEV_BUS_VIRT_BASE + (i) * 4)
39#define MPP_NR_REGS (1 + MPP_MAX/8)
40
41void __init kirkwood_mpp_conf(unsigned int *mpp_list)
42{
43 u32 mpp_ctrl[MPP_NR_REGS];
44 unsigned int variant_mask;
45 int i;
46
47 variant_mask = kirkwood_variant();
48 if (!variant_mask)
49 return;
50
51 printk(KERN_DEBUG "initial MPP regs:");
52 for (i = 0; i < MPP_NR_REGS; i++) {
53 mpp_ctrl[i] = readl(MPP_CTRL(i));
54 printk(" %08x", mpp_ctrl[i]);
55 }
56 printk("\n");
57
58 while (*mpp_list) {
59 unsigned int num = MPP_NUM(*mpp_list);
60 unsigned int sel = MPP_SEL(*mpp_list);
61 int shift, gpio_mode;
62
63 if (num > MPP_MAX) {
64 printk(KERN_ERR "kirkwood_mpp_conf: invalid MPP "
65 "number (%u)\n", num);
66 continue;
67 }
68 if (!(*mpp_list & variant_mask)) {
69 printk(KERN_WARNING
70 "kirkwood_mpp_conf: requested MPP%u config "
71 "unavailable on this hardware\n", num);
72 continue;
73 }
74
75 shift = (num & 7) << 2;
76 mpp_ctrl[num / 8] &= ~(0xf << shift);
77 mpp_ctrl[num / 8] |= sel << shift;
78
79 gpio_mode = 0;
80 if (*mpp_list & MPP_INPUT_MASK)
81 gpio_mode |= GPIO_INPUT_OK;
82 if (*mpp_list & MPP_OUTPUT_MASK)
83 gpio_mode |= GPIO_OUTPUT_OK;
84 if (sel != 0)
85 gpio_mode = 0;
86 orion_gpio_set_valid(num, gpio_mode);
87
88 mpp_list++;
89 }
90
91 printk(KERN_DEBUG " final MPP regs:");
92 for (i = 0; i < MPP_NR_REGS; i++) {
93 writel(mpp_ctrl[i], MPP_CTRL(i));
94 printk(" %08x", mpp_ctrl[i]);
95 }
96 printk("\n");
97}
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h
new file mode 100644
index 000000000000..45cccb743107
--- /dev/null
+++ b/arch/arm/mach-kirkwood/mpp.h
@@ -0,0 +1,303 @@
1/*
2 * linux/arch/arm/mach-kirkwood/mpp.h -- Multi Purpose Pins
3 *
4 * Copyright 2009: Marvell Technology Group Ltd.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#ifndef __KIRKWOOD_MPP_H
12#define __KIRKWOOD_MPP_H
13
14#define MPP(_num, _sel, _in, _out, _F6180, _F6190, _F6192, _F6281) ( \
15 /* MPP number */ ((_num) & 0xff) | \
16 /* MPP select value */ (((_sel) & 0xf) << 8) | \
17 /* may be input signal */ ((!!(_in)) << 12) | \
18 /* may be output signal */ ((!!(_out)) << 13) | \
19 /* available on F6180 */ ((!!(_F6180)) << 14) | \
20 /* available on F6190 */ ((!!(_F6190)) << 15) | \
21 /* available on F6192 */ ((!!(_F6192)) << 16) | \
22 /* available on F6281 */ ((!!(_F6281)) << 17))
23
24#define MPP_NUM(x) ((x) & 0xff)
25#define MPP_SEL(x) (((x) >> 8) & 0xf)
26
27 /* num sel i o 6180 6190 6192 6281 */
28
29#define MPP_INPUT_MASK MPP( 0, 0x0, 1, 0, 0, 0, 0, 0 )
30#define MPP_OUTPUT_MASK MPP( 0, 0x0, 0, 1, 0, 0, 0, 0 )
31
32#define MPP_F6180_MASK MPP( 0, 0x0, 0, 0, 1, 0, 0, 0 )
33#define MPP_F6190_MASK MPP( 0, 0x0, 0, 0, 0, 1, 0, 0 )
34#define MPP_F6192_MASK MPP( 0, 0x0, 0, 0, 0, 0, 1, 0 )
35#define MPP_F6281_MASK MPP( 0, 0x0, 0, 0, 0, 0, 0, 1 )
36
37#define MPP0_GPIO MPP( 0, 0x0, 1, 1, 1, 1, 1, 1 )
38#define MPP0_NF_IO2 MPP( 0, 0x1, 1, 1, 1, 1, 1, 1 )
39#define MPP0_SPI_SCn MPP( 0, 0x2, 0, 1, 1, 1, 1, 1 )
40
41#define MPP1_GPO MPP( 1, 0x0, 0, 1, 1, 1, 1, 1 )
42#define MPP1_NF_IO3 MPP( 1, 0x1, 1, 1, 1, 1, 1, 1 )
43#define MPP1_SPI_MOSI MPP( 1, 0x2, 0, 1, 1, 1, 1, 1 )
44
45#define MPP2_GPO MPP( 2, 0x0, 0, 1, 1, 1, 1, 1 )
46#define MPP2_NF_IO4 MPP( 2, 0x1, 1, 1, 1, 1, 1, 1 )
47#define MPP2_SPI_SCK MPP( 2, 0x2, 0, 1, 1, 1, 1, 1 )
48
49#define MPP3_GPO MPP( 3, 0x0, 0, 1, 1, 1, 1, 1 )
50#define MPP3_NF_IO5 MPP( 3, 0x1, 1, 1, 1, 1, 1, 1 )
51#define MPP3_SPI_MISO MPP( 3, 0x2, 1, 0, 1, 1, 1, 1 )
52
53#define MPP4_GPIO MPP( 4, 0x0, 1, 1, 1, 1, 1, 1 )
54#define MPP4_NF_IO6 MPP( 4, 0x1, 1, 1, 1, 1, 1, 1 )
55#define MPP4_UART0_RXD MPP( 4, 0x2, 1, 0, 1, 1, 1, 1 )
56#define MPP4_SATA1_ACTn MPP( 4, 0x5, 0, 1, 0, 0, 1, 1 )
57#define MPP4_PTP_CLK MPP( 4, 0xd, 1, 0, 1, 1, 1, 1 )
58
59#define MPP5_GPO MPP( 5, 0x0, 0, 1, 1, 1, 1, 1 )
60#define MPP5_NF_IO7 MPP( 5, 0x1, 1, 1, 1, 1, 1, 1 )
61#define MPP5_UART0_TXD MPP( 5, 0x2, 0, 1, 1, 1, 1, 1 )
62#define MPP5_PTP_TRIG_GEN MPP( 5, 0x4, 0, 1, 1, 1, 1, 1 )
63#define MPP5_SATA0_ACTn MPP( 5, 0x5, 0, 1, 0, 1, 1, 1 )
64
65#define MPP6_SYSRST_OUTn MPP( 6, 0x1, 0, 1, 1, 1, 1, 1 )
66#define MPP6_SPI_MOSI MPP( 6, 0x2, 0, 1, 1, 1, 1, 1 )
67#define MPP6_PTP_TRIG_GEN MPP( 6, 0x3, 0, 1, 1, 1, 1, 1 )
68
69#define MPP7_GPO MPP( 7, 0x0, 0, 1, 1, 1, 1, 1 )
70#define MPP7_PEX_RST_OUTn MPP( 7, 0x1, 0, 1, 1, 1, 1, 1 )
71#define MPP7_SPI_SCn MPP( 7, 0x2, 0, 1, 1, 1, 1, 1 )
72#define MPP7_PTP_TRIG_GEN MPP( 7, 0x3, 0, 1, 1, 1, 1, 1 )
73
74#define MPP8_GPIO MPP( 8, 0x0, 1, 1, 1, 1, 1, 1 )
75#define MPP8_TW_SDA MPP( 8, 0x1, 1, 1, 1, 1, 1, 1 )
76#define MPP8_UART0_RTS MPP( 8, 0x2, 0, 1, 1, 1, 1, 1 )
77#define MPP8_UART1_RTS MPP( 8, 0x3, 0, 1, 1, 1, 1, 1 )
78#define MPP8_MII0_RXERR MPP( 8, 0x4, 1, 0, 0, 1, 1, 1 )
79#define MPP8_SATA1_PRESENTn MPP( 8, 0x5, 0, 1, 0, 0, 1, 1 )
80#define MPP8_PTP_CLK MPP( 8, 0xc, 1, 0, 1, 1, 1, 1 )
81#define MPP8_MII0_COL MPP( 8, 0xd, 1, 0, 1, 1, 1, 1 )
82
83#define MPP9_GPIO MPP( 9, 0x0, 1, 1, 1, 1, 1, 1 )
84#define MPP9_TW_SCK MPP( 9, 0x1, 1, 1, 1, 1, 1, 1 )
85#define MPP9_UART0_CTS MPP( 9, 0x2, 1, 0, 1, 1, 1, 1 )
86#define MPP9_UART1_CTS MPP( 9, 0x3, 1, 0, 1, 1, 1, 1 )
87#define MPP9_SATA0_PRESENTn MPP( 9, 0x5, 0, 1, 0, 1, 1, 1 )
88#define MPP9_PTP_EVENT_REQ MPP( 9, 0xc, 1, 0, 1, 1, 1, 1 )
89#define MPP9_MII0_CRS MPP( 9, 0xd, 1, 0, 1, 1, 1, 1 )
90
91#define MPP10_GPO MPP( 10, 0x0, 0, 1, 1, 1, 1, 1 )
92#define MPP10_SPI_SCK MPP( 10, 0x2, 0, 1, 1, 1, 1, 1 )
93#define MPP10_UArt0_TXD MPP( 10, 0X3, 0, 1, 1, 1, 1, 1 )
94#define MPP10_SATA1_ACTn MPP( 10, 0x5, 0, 1, 0, 0, 1, 1 )
95#define MPP10_PTP_TRIG_GEN MPP( 10, 0xc, 0, 1, 1, 1, 1, 1 )
96
97#define MPP11_GPIO MPP( 11, 0x0, 1, 1, 1, 1, 1, 1 )
98#define MPP11_SPI_MISO MPP( 11, 0x2, 1, 0, 1, 1, 1, 1 )
99#define MPP11_UArt0_RXD MPP( 11, 0x3, 1, 0, 1, 1, 1, 1 )
100#define MPP11_PTP_EVENT_REQ MPP( 11, 0x4, 1, 0, 1, 1, 1, 1 )
101#define MPP11_PTP_TRIG_GEN MPP( 11, 0xc, 0, 1, 1, 1, 1, 1 )
102#define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1 )
103#define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1 )
104
105#define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1 )
106#define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1 )
107
108#define MPP13_GPIO MPP( 13, 0x0, 1, 1, 1, 1, 1, 1 )
109#define MPP13_SD_CMD MPP( 13, 0x1, 1, 1, 1, 1, 1, 1 )
110#define MPP13_UART1_TXD MPP( 13, 0x3, 0, 1, 1, 1, 1, 1 )
111
112#define MPP14_GPIO MPP( 14, 0x0, 1, 1, 1, 1, 1, 1 )
113#define MPP14_SD_D0 MPP( 14, 0x1, 1, 1, 1, 1, 1, 1 )
114#define MPP14_UART1_RXD MPP( 14, 0x3, 1, 0, 1, 1, 1, 1 )
115#define MPP14_SATA1_PRESENTn MPP( 14, 0x4, 0, 1, 0, 0, 1, 1 )
116#define MPP14_MII0_COL MPP( 14, 0xd, 1, 0, 1, 1, 1, 1 )
117
118#define MPP15_GPIO MPP( 15, 0x0, 1, 1, 1, 1, 1, 1 )
119#define MPP15_SD_D1 MPP( 15, 0x1, 1, 1, 1, 1, 1, 1 )
120#define MPP15_UART0_RTS MPP( 15, 0x2, 0, 1, 1, 1, 1, 1 )
121#define MPP15_UART1_TXD MPP( 15, 0x3, 0, 1, 1, 1, 1, 1 )
122#define MPP15_SATA0_ACTn MPP( 15, 0x4, 0, 1, 0, 1, 1, 1 )
123
124#define MPP16_GPIO MPP( 16, 0x0, 1, 1, 1, 1, 1, 1 )
125#define MPP16_SD_D2 MPP( 16, 0x1, 1, 1, 1, 1, 1, 1 )
126#define MPP16_UART0_CTS MPP( 16, 0x2, 1, 0, 1, 1, 1, 1 )
127#define MPP16_UART1_RXD MPP( 16, 0x3, 1, 0, 1, 1, 1, 1 )
128#define MPP16_SATA1_ACTn MPP( 16, 0x4, 0, 1, 0, 0, 1, 1 )
129#define MPP16_MII0_CRS MPP( 16, 0xd, 1, 0, 1, 1, 1, 1 )
130
131#define MPP17_GPIO MPP( 17, 0x0, 1, 1, 1, 1, 1, 1 )
132#define MPP17_SD_D3 MPP( 17, 0x1, 1, 1, 1, 1, 1, 1 )
133#define MPP17_SATA0_PRESENTn MPP( 17, 0x4, 0, 1, 0, 1, 1, 1 )
134
135#define MPP18_GPO MPP( 18, 0x0, 0, 1, 1, 1, 1, 1 )
136#define MPP18_NF_IO0 MPP( 18, 0x1, 1, 1, 1, 1, 1, 1 )
137
138#define MPP19_GPO MPP( 19, 0x0, 0, 1, 1, 1, 1, 1 )
139#define MPP19_NF_IO1 MPP( 19, 0x1, 1, 1, 1, 1, 1, 1 )
140
141#define MPP20_GPIO MPP( 20, 0x0, 1, 1, 0, 1, 1, 1 )
142#define MPP20_TSMP0 MPP( 20, 0x1, 1, 1, 0, 0, 1, 1 )
143#define MPP20_TDM_CH0_TX_QL MPP( 20, 0x2, 0, 1, 0, 0, 1, 1 )
144#define MPP20_GE1_0 MPP( 20, 0x3, 0, 0, 0, 1, 1, 1 )
145#define MPP20_AUDIO_SPDIFI MPP( 20, 0x4, 1, 0, 0, 0, 1, 1 )
146#define MPP20_SATA1_ACTn MPP( 20, 0x5, 0, 1, 0, 0, 1, 1 )
147
148#define MPP21_GPIO MPP( 21, 0x0, 1, 1, 0, 1, 1, 1 )
149#define MPP21_TSMP1 MPP( 21, 0x1, 1, 1, 0, 0, 1, 1 )
150#define MPP21_TDM_CH0_RX_QL MPP( 21, 0x2, 0, 1, 0, 0, 1, 1 )
151#define MPP21_GE1_1 MPP( 21, 0x3, 0, 0, 0, 1, 1, 1 )
152#define MPP21_AUDIO_SPDIFO MPP( 21, 0x4, 0, 1, 0, 0, 1, 1 )
153#define MPP21_SATA0_ACTn MPP( 21, 0x5, 0, 1, 0, 1, 1, 1 )
154
155#define MPP22_GPIO MPP( 22, 0x0, 1, 1, 0, 1, 1, 1 )
156#define MPP22_TSMP2 MPP( 22, 0x1, 1, 1, 0, 0, 1, 1 )
157#define MPP22_TDM_CH2_TX_QL MPP( 22, 0x2, 0, 1, 0, 0, 1, 1 )
158#define MPP22_GE1_2 MPP( 22, 0x3, 0, 0, 0, 1, 1, 1 )
159#define MPP22_AUDIO_SPDIFRMKCLK MPP( 22, 0x4, 0, 1, 0, 0, 1, 1 )
160#define MPP22_SATA1_PRESENTn MPP( 22, 0x5, 0, 1, 0, 0, 1, 1 )
161
162#define MPP23_GPIO MPP( 23, 0x0, 1, 1, 0, 1, 1, 1 )
163#define MPP23_TSMP3 MPP( 23, 0x1, 1, 1, 0, 0, 1, 1 )
164#define MPP23_TDM_CH2_RX_QL MPP( 23, 0x2, 1, 0, 0, 0, 1, 1 )
165#define MPP23_GE1_3 MPP( 23, 0x3, 0, 0, 0, 1, 1, 1 )
166#define MPP23_AUDIO_I2SBCLK MPP( 23, 0x4, 0, 1, 0, 0, 1, 1 )
167#define MPP23_SATA0_PRESENTn MPP( 23, 0x5, 0, 1, 0, 1, 1, 1 )
168
169#define MPP24_GPIO MPP( 24, 0x0, 1, 1, 0, 1, 1, 1 )
170#define MPP24_TSMP4 MPP( 24, 0x1, 1, 1, 0, 0, 1, 1 )
171#define MPP24_TDM_SPI_CS0 DEV( 24, 0x2, 0, 1, 0, 0, 1, 1 )
172#define MPP24_GE1_4 MPP( 24, 0x3, 0, 0, 0, 1, 1, 1 )
173#define MPP24_AUDIO_I2SDO MPP( 24, 0x4, 0, 1, 0, 0, 1, 1 )
174
175#define MPP25_GPIO MPP( 25, 0x0, 1, 1, 0, 1, 1, 1 )
176#define MPP25_TSMP5 MPP( 25, 0x1, 1, 1, 0, 0, 1, 1 )
177#define MPP25_TDM_SPI_SCK MPP( 25, 0x2, 0, 1, 0, 0, 1, 1 )
178#define MPP25_GE1_5 MPP( 25, 0x3, 0, 0, 0, 1, 1, 1 )
179#define MPP25_AUDIO_I2SLRCLK MPP( 25, 0x4, 0, 1, 0, 0, 1, 1 )
180
181#define MPP26_GPIO MPP( 26, 0x0, 1, 1, 0, 1, 1, 1 )
182#define MPP26_TSMP6 MPP( 26, 0x1, 1, 1, 0, 0, 1, 1 )
183#define MPP26_TDM_SPI_MISO MPP( 26, 0x2, 1, 0, 0, 0, 1, 1 )
184#define MPP26_GE1_6 MPP( 26, 0x3, 0, 0, 0, 1, 1, 1 )
185#define MPP26_AUDIO_I2SMCLK MPP( 26, 0x4, 0, 1, 0, 0, 1, 1 )
186
187#define MPP27_GPIO MPP( 27, 0x0, 1, 1, 0, 1, 1, 1 )
188#define MPP27_TSMP7 MPP( 27, 0x1, 1, 1, 0, 0, 1, 1 )
189#define MPP27_TDM_SPI_MOSI MPP( 27, 0x2, 0, 1, 0, 0, 1, 1 )
190#define MPP27_GE1_7 MPP( 27, 0x3, 0, 0, 0, 1, 1, 1 )
191#define MPP27_AUDIO_I2SDI MPP( 27, 0x4, 1, 0, 0, 0, 1, 1 )
192
193#define MPP28_GPIO MPP( 28, 0x0, 1, 1, 0, 1, 1, 1 )
194#define MPP28_TSMP8 MPP( 28, 0x1, 1, 1, 0, 0, 1, 1 )
195#define MPP28_TDM_CODEC_INTn MPP( 28, 0x2, 0, 0, 0, 0, 1, 1 )
196#define MPP28_GE1_8 MPP( 28, 0x3, 0, 0, 0, 1, 1, 1 )
197#define MPP28_AUDIO_EXTCLK MPP( 28, 0x4, 1, 0, 0, 0, 1, 1 )
198
199#define MPP29_GPIO MPP( 29, 0x0, 1, 1, 0, 1, 1, 1 )
200#define MPP29_TSMP9 MPP( 29, 0x1, 1, 1, 0, 0, 1, 1 )
201#define MPP29_TDM_CODEC_RSTn MPP( 29, 0x2, 0, 0, 0, 0, 1, 1 )
202#define MPP29_GE1_9 MPP( 29, 0x3, 0, 0, 0, 1, 1, 1 )
203
204#define MPP30_GPIO MPP( 30, 0x0, 1, 1, 0, 1, 1, 1 )
205#define MPP30_TSMP10 MPP( 30, 0x1, 1, 1, 0, 0, 1, 1 )
206#define MPP30_TDM_PCLK MPP( 30, 0x2, 1, 1, 0, 0, 1, 1 )
207#define MPP30_GE1_10 MPP( 30, 0x3, 0, 0, 0, 1, 1, 1 )
208
209#define MPP31_GPIO MPP( 31, 0x0, 1, 1, 0, 1, 1, 1 )
210#define MPP31_TSMP11 MPP( 31, 0x1, 1, 1, 0, 0, 1, 1 )
211#define MPP31_TDM_FS MPP( 31, 0x2, 1, 1, 0, 0, 1, 1 )
212#define MPP31_GE1_11 MPP( 31, 0x3, 0, 0, 0, 1, 1, 1 )
213
214#define MPP32_GPIO MPP( 32, 0x0, 1, 1, 0, 1, 1, 1 )
215#define MPP32_TSMP12 MPP( 32, 0x1, 1, 1, 0, 0, 1, 1 )
216#define MPP32_TDM_DRX MPP( 32, 0x2, 1, 0, 0, 0, 1, 1 )
217#define MPP32_GE1_12 MPP( 32, 0x3, 0, 0, 0, 1, 1, 1 )
218
219#define MPP33_GPIO MPP( 33, 0x0, 1, 1, 0, 1, 1, 1 )
220#define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 )
221#define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 )
222
223#define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1 )
224#define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1 )
225#define MPP34_GE1_14 MPP( 34, 0x3, 0, 0, 0, 1, 1, 1 )
226
227#define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1 )
228#define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1 )
229#define MPP35_GE1_15 MPP( 35, 0x3, 0, 0, 0, 1, 1, 1 )
230#define MPP35_SATA0_ACTn MPP( 35, 0x5, 0, 1, 0, 1, 1, 1 )
231#define MPP35_MII0_RXERR MPP( 35, 0xc, 1, 0, 1, 1, 1, 1 )
232
233#define MPP36_GPIO MPP( 36, 0x0, 1, 1, 1, 0, 0, 1 )
234#define MPP36_TSMP0 MPP( 36, 0x1, 1, 1, 0, 0, 0, 1 )
235#define MPP36_TDM_SPI_CS1 MPP( 36, 0x2, 0, 1, 0, 0, 0, 1 )
236#define MPP36_AUDIO_SPDIFI MPP( 36, 0x4, 1, 0, 1, 0, 0, 1 )
237
238#define MPP37_GPIO MPP( 37, 0x0, 1, 1, 1, 0, 0, 1 )
239#define MPP37_TSMP1 MPP( 37, 0x1, 1, 1, 0, 0, 0, 1 )
240#define MPP37_TDM_CH2_TX_QL MPP( 37, 0x2, 0, 1, 0, 0, 0, 1 )
241#define MPP37_AUDIO_SPDIFO MPP( 37, 0x4, 0, 1, 1, 0, 0, 1 )
242
243#define MPP38_GPIO MPP( 38, 0x0, 1, 1, 1, 0, 0, 1 )
244#define MPP38_TSMP2 MPP( 38, 0x1, 1, 1, 0, 0, 0, 1 )
245#define MPP38_TDM_CH2_RX_QL MPP( 38, 0x2, 0, 1, 0, 0, 0, 1 )
246#define MPP38_AUDIO_SPDIFRMLCLK MPP( 38, 0x4, 0, 1, 1, 0, 0, 1 )
247
248#define MPP39_GPIO MPP( 39, 0x0, 1, 1, 1, 0, 0, 1 )
249#define MPP39_TSMP3 MPP( 39, 0x1, 1, 1, 0, 0, 0, 1 )
250#define MPP39_TDM_SPI_CS0 MPP( 39, 0x2, 0, 1, 0, 0, 0, 1 )
251#define MPP39_AUDIO_I2SBCLK MPP( 39, 0x4, 0, 1, 1, 0, 0, 1 )
252
253#define MPP40_GPIO MPP( 40, 0x0, 1, 1, 1, 0, 0, 1 )
254#define MPP40_TSMP4 MPP( 40, 0x1, 1, 1, 0, 0, 0, 1 )
255#define MPP40_TDM_SPI_SCK MPP( 40, 0x2, 0, 1, 0, 0, 0, 1 )
256#define MPP40_AUDIO_I2SDO MPP( 40, 0x4, 0, 1, 1, 0, 0, 1 )
257
258#define MPP41_GPIO MPP( 41, 0x0, 1, 1, 1, 0, 0, 1 )
259#define MPP41_TSMP5 MPP( 41, 0x1, 1, 1, 0, 0, 0, 1 )
260#define MPP41_TDM_SPI_MISO MPP( 41, 0x2, 1, 0, 0, 0, 0, 1 )
261#define MPP41_AUDIO_I2SLRC MPP( 41, 0x4, 0, 1, 1, 0, 0, 1 )
262
263#define MPP42_GPIO MPP( 42, 0x0, 1, 1, 1, 0, 0, 1 )
264#define MPP42_TSMP6 MPP( 42, 0x1, 1, 1, 0, 0, 0, 1 )
265#define MPP42_TDM_SPI_MOSI MPP( 42, 0x2, 0, 1, 0, 0, 0, 1 )
266#define MPP42_AUDIO_I2SMCLK MPP( 42, 0x4, 0, 1, 1, 0, 0, 1 )
267
268#define MPP43_GPIO MPP( 43, 0x0, 1, 1, 1, 0, 0, 1 )
269#define MPP43_TSMP7 MPP( 43, 0x1, 1, 1, 0, 0, 0, 1 )
270#define MPP43_TDM_CODEC_INTn MPP( 43, 0x2, 0, 0, 0, 0, 0, 1 )
271#define MPP43_AUDIO_I2SDI MPP( 43, 0x4, 1, 0, 1, 0, 0, 1 )
272
273#define MPP44_GPIO MPP( 44, 0x0, 1, 1, 1, 0, 0, 1 )
274#define MPP44_TSMP8 MPP( 44, 0x1, 1, 1, 0, 0, 0, 1 )
275#define MPP44_TDM_CODEC_RSTn MPP( 44, 0x2, 0, 0, 0, 0, 0, 1 )
276#define MPP44_AUDIO_EXTCLK MPP( 44, 0x4, 1, 0, 1, 0, 0, 1 )
277
278#define MPP45_GPIO MPP( 45, 0x0, 1, 1, 0, 0, 0, 1 )
279#define MPP45_TSMP9 MPP( 45, 0x1, 1, 1, 0, 0, 0, 1 )
280#define MPP45_TDM_PCLK MPP( 45, 0x2, 1, 1, 0, 0, 0, 1 )
281
282#define MPP46_GPIO MPP( 46, 0x0, 1, 1, 0, 0, 0, 1 )
283#define MPP46_TSMP10 MPP( 46, 0x1, 1, 1, 0, 0, 0, 1 )
284#define MPP46_TDM_FS MPP( 46, 0x2, 1, 1, 0, 0, 0, 1 )
285
286#define MPP47_GPIO MPP( 47, 0x0, 1, 1, 0, 0, 0, 1 )
287#define MPP47_TSMP11 MPP( 47, 0x1, 1, 1, 0, 0, 0, 1 )
288#define MPP47_TDM_DRX MPP( 47, 0x2, 1, 0, 0, 0, 0, 1 )
289
290#define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1 )
291#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1 )
292#define MPP48_TDM_DTX MPP( 48. 0x2, 0, 1, 0, 0, 0, 1 )
293
294#define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1 )
295#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1 )
296#define MPP49_TDM_CH0_RX_QL MPP( 49, 0x2, 0, 1, 0, 0, 0, 1 )
297#define MPP49_PTP_CLK MPP( 49, 0x5, 1, 0, 0, 0, 0, 1 )
298
299#define MPP_MAX 49
300
301void kirkwood_mpp_conf(unsigned int *mpp_list);
302
303#endif
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index b1d1a87a6821..2f0e4ef3db0f 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -11,11 +11,8 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/nand.h> 14#include <linux/mtd/nand.h>
18#include <linux/timer.h> 15#include <linux/mtd/partitions.h>
19#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
20#include <linux/mv643xx_eth.h> 17#include <linux/mv643xx_eth.h>
21#include <linux/spi/flash.h> 18#include <linux/spi/flash.h>
@@ -23,7 +20,6 @@
23#include <linux/spi/orion_spi.h> 20#include <linux/spi/orion_spi.h>
24#include <asm/mach-types.h> 21#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
26#include <asm/mach/pci.h>
27#include <mach/kirkwood.h> 23#include <mach/kirkwood.h>
28#include "common.h" 24#include "common.h"
29 25
@@ -61,14 +57,11 @@ static void __init rd88f6192_init(void)
61 57
62 kirkwood_ehci_init(); 58 kirkwood_ehci_init();
63 kirkwood_ge00_init(&rd88f6192_ge00_data); 59 kirkwood_ge00_init(&rd88f6192_ge00_data);
64 kirkwood_rtc_init();
65 kirkwood_sata_init(&rd88f6192_sata_data); 60 kirkwood_sata_init(&rd88f6192_sata_data);
66 spi_register_board_info(rd88F6192_spi_slave_info, 61 spi_register_board_info(rd88F6192_spi_slave_info,
67 ARRAY_SIZE(rd88F6192_spi_slave_info)); 62 ARRAY_SIZE(rd88F6192_spi_slave_info));
68 kirkwood_spi_init(); 63 kirkwood_spi_init();
69 kirkwood_uart0_init(); 64 kirkwood_uart0_init();
70 kirkwood_xor0_init();
71 kirkwood_xor1_init();
72} 65}
73 66
74static int __init rd88f6192_pci_init(void) 67static int __init rd88f6192_pci_init(void)
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 9a0e905d10cd..c3deea5e3cad 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -11,21 +11,20 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/irq.h> 14#include <linux/irq.h>
16#include <linux/mtd/physmap.h>
17#include <linux/mtd/nand.h> 15#include <linux/mtd/nand.h>
18#include <linux/timer.h> 16#include <linux/mtd/partitions.h>
19#include <linux/ata_platform.h> 17#include <linux/ata_platform.h>
20#include <linux/mv643xx_eth.h> 18#include <linux/mv643xx_eth.h>
21#include <linux/ethtool.h> 19#include <linux/ethtool.h>
22#include <net/dsa.h> 20#include <net/dsa.h>
23#include <asm/mach-types.h> 21#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
25#include <asm/mach/pci.h>
26#include <mach/kirkwood.h> 23#include <mach/kirkwood.h>
24#include <plat/mvsdio.h>
27#include <plat/orion_nand.h> 25#include <plat/orion_nand.h>
28#include "common.h" 26#include "common.h"
27#include "mpp.h"
29 28
30static struct mtd_partition rd88f6281_nand_parts[] = { 29static struct mtd_partition rd88f6281_nand_parts[] = {
31 { 30 {
@@ -91,6 +90,15 @@ static struct mv_sata_platform_data rd88f6281_sata_data = {
91 .n_ports = 2, 90 .n_ports = 2,
92}; 91};
93 92
93static struct mvsdio_platform_data rd88f6281_mvsdio_data = {
94 .gpio_card_detect = 28,
95};
96
97static unsigned int rd88f6281_mpp_config[] __initdata = {
98 MPP28_GPIO,
99 0
100};
101
94static void __init rd88f6281_init(void) 102static void __init rd88f6281_init(void)
95{ 103{
96 u32 dev, rev; 104 u32 dev, rev;
@@ -99,6 +107,7 @@ static void __init rd88f6281_init(void)
99 * Basic setup. Needs to be called early. 107 * Basic setup. Needs to be called early.
100 */ 108 */
101 kirkwood_init(); 109 kirkwood_init();
110 kirkwood_mpp_conf(rd88f6281_mpp_config);
102 111
103 kirkwood_ehci_init(); 112 kirkwood_ehci_init();
104 113
@@ -112,8 +121,8 @@ static void __init rd88f6281_init(void)
112 } 121 }
113 kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ); 122 kirkwood_ge00_switch_init(&rd88f6281_switch_data, NO_IRQ);
114 123
115 kirkwood_rtc_init();
116 kirkwood_sata_init(&rd88f6281_sata_data); 124 kirkwood_sata_init(&rd88f6281_sata_data);
125 kirkwood_sdio_init(&rd88f6281_mvsdio_data);
117 kirkwood_uart0_init(); 126 kirkwood_uart0_init();
118 127
119 platform_device_register(&rd88f6281_nand_flash); 128 platform_device_register(&rd88f6281_nand_flash);
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
new file mode 100644
index 000000000000..831e4a56cae1
--- /dev/null
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -0,0 +1,136 @@
1/*
2 * arch/arm/mach-kirkwood/sheevaplug-setup.c
3 *
4 * Marvell SheevaPlug Reference Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h>
16#include <linux/mv643xx_eth.h>
17#include <linux/gpio.h>
18#include <linux/leds.h>
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <mach/kirkwood.h>
22#include <plat/mvsdio.h>
23#include <plat/orion_nand.h>
24#include "common.h"
25#include "mpp.h"
26
27static struct mtd_partition sheevaplug_nand_parts[] = {
28 {
29 .name = "u-boot",
30 .offset = 0,
31 .size = SZ_1M
32 }, {
33 .name = "uImage",
34 .offset = MTDPART_OFS_NXTBLK,
35 .size = SZ_4M
36 }, {
37 .name = "root",
38 .offset = MTDPART_OFS_NXTBLK,
39 .size = MTDPART_SIZ_FULL
40 },
41};
42
43static struct resource sheevaplug_nand_resource = {
44 .flags = IORESOURCE_MEM,
45 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
46 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
47 KIRKWOOD_NAND_MEM_SIZE - 1,
48};
49
50static struct orion_nand_data sheevaplug_nand_data = {
51 .parts = sheevaplug_nand_parts,
52 .nr_parts = ARRAY_SIZE(sheevaplug_nand_parts),
53 .cle = 0,
54 .ale = 1,
55 .width = 8,
56 .chip_delay = 25,
57};
58
59static struct platform_device sheevaplug_nand_flash = {
60 .name = "orion_nand",
61 .id = -1,
62 .dev = {
63 .platform_data = &sheevaplug_nand_data,
64 },
65 .resource = &sheevaplug_nand_resource,
66 .num_resources = 1,
67};
68
69static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
70 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
71};
72
73static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
74 // unfortunately the CD signal has not been connected */
75};
76
77static struct gpio_led sheevaplug_led_pins[] = {
78 {
79 .name = "plug:green:health",
80 .default_trigger = "default-on",
81 .gpio = 49,
82 .active_low = 1,
83 },
84};
85
86static struct gpio_led_platform_data sheevaplug_led_data = {
87 .leds = sheevaplug_led_pins,
88 .num_leds = ARRAY_SIZE(sheevaplug_led_pins),
89};
90
91static struct platform_device sheevaplug_leds = {
92 .name = "leds-gpio",
93 .id = -1,
94 .dev = {
95 .platform_data = &sheevaplug_led_data,
96 }
97};
98
99static unsigned int sheevaplug_mpp_config[] __initdata = {
100 MPP29_GPIO, /* USB Power Enable */
101 MPP49_GPIO, /* LED */
102 0
103};
104
105static void __init sheevaplug_init(void)
106{
107 /*
108 * Basic setup. Needs to be called early.
109 */
110 kirkwood_init();
111 kirkwood_mpp_conf(sheevaplug_mpp_config);
112
113 kirkwood_uart0_init();
114
115 if (gpio_request(29, "USB Power Enable") != 0 ||
116 gpio_direction_output(29, 1) != 0)
117 printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
118 kirkwood_ehci_init();
119
120 kirkwood_ge00_init(&sheevaplug_ge00_data);
121 kirkwood_sdio_init(&sheevaplug_mvsdio_data);
122
123 platform_device_register(&sheevaplug_nand_flash);
124 platform_device_register(&sheevaplug_leds);
125}
126
127MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
128 /* Maintainer: shadi Ammouri <shadi@marvell.com> */
129 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
130 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
131 .boot_params = 0x00000100,
132 .init_machine = sheevaplug_init,
133 .map_io = kirkwood_map_io,
134 .init_irq = kirkwood_init_irq,
135 .timer = &kirkwood_timer,
136MACHINE_END