aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
authorAlexander Clouter <alex@digriz.org.uk>2010-01-18 18:38:19 -0500
committerNicolas Pitre <nico@fluxnic.net>2010-02-05 00:27:04 -0500
commitb2fdb5660fccc060e47658baad8911a963397ced (patch)
tree37988afbb7b8b58e8594de21bcf507ba6062fce7 /arch/arm/mach-kirkwood
parent639b9be60ec2045a0a59b2ea33479937c4b5acef (diff)
[ARM] kirkwood: combine support for openrd base/client support
Inspired by the mach-ep93xx flattening work, there is really not much difference between the OpenRD base and client board support so they should be merged together. Signed-off-by: Alexander Clouter <alex@digriz.org.uk> Acked-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/Kconfig11
-rw-r--r--arch/arm/mach-kirkwood/Makefile2
-rw-r--r--arch/arm/mach-kirkwood/openrd-setup.c118
-rw-r--r--arch/arm/mach-kirkwood/openrd_base-setup.c96
4 files changed, 130 insertions, 97 deletions
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index f6c6196a51fa..4ac6f463eb03 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -46,12 +46,23 @@ config MACH_TS41X
46 QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS 46 QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS
47 devices. 47 devices.
48 48
49config MACH_OPENRD
50 bool
51
49config MACH_OPENRD_BASE 52config MACH_OPENRD_BASE
50 bool "Marvell OpenRD Base Board" 53 bool "Marvell OpenRD Base Board"
54 select MACH_OPENRD
51 help 55 help
52 Say 'Y' here if you want your kernel to support the 56 Say 'Y' here if you want your kernel to support the
53 Marvell OpenRD Base Board. 57 Marvell OpenRD Base Board.
54 58
59config MACH_OPENRD_CLIENT
60 bool "Marvell OpenRD Client Board"
61 select MACH_OPENRD
62 help
63 Say 'Y' here if you want your kernel to support the
64 Marvell OpenRD Client Board.
65
55config MACH_NETSPACE_V2 66config MACH_NETSPACE_V2
56 bool "LaCie Network Space v2 NAS Board" 67 bool "LaCie Network Space v2 NAS Board"
57 help 68 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d4d7f53b0fb9..df91d0789f18 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -7,7 +7,7 @@ obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o 7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
8obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o 8obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
9obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o 9obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
10obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o 10obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o
11obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o 11obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o
12 12
13obj-$(CONFIG_CPU_IDLE) += cpuidle.o 13obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
new file mode 100644
index 000000000000..ad3f1ec33796
--- /dev/null
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -0,0 +1,118 @@
1/*
2 * arch/arm/mach-kirkwood/openrd-setup.c
3 *
4 * Marvell OpenRD (Base|Client) 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/ata_platform.h>
17#include <linux/mv643xx_eth.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <mach/kirkwood.h>
21#include <plat/mvsdio.h>
22#include "common.h"
23#include "mpp.h"
24
25static struct mtd_partition openrd_nand_parts[] = {
26 {
27 .name = "u-boot",
28 .offset = 0,
29 .size = SZ_1M,
30 .mask_flags = MTD_WRITEABLE
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 mv643xx_eth_platform_data openrd_ge00_data = {
43 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
44};
45
46static struct mv643xx_eth_platform_data openrd_ge01_data = {
47 .phy_addr = MV643XX_ETH_PHY_ADDR(24),
48};
49
50static struct mv_sata_platform_data openrd_sata_data = {
51 .n_ports = 2,
52};
53
54static struct mvsdio_platform_data openrd_mvsdio_data = {
55 .gpio_card_detect = 29, /* MPP29 used as SD card detect */
56};
57
58static unsigned int openrd_mpp_config[] __initdata = {
59 MPP29_GPIO,
60 0
61};
62
63static void __init openrd_init(void)
64{
65 /*
66 * Basic setup. Needs to be called early.
67 */
68 kirkwood_init();
69 kirkwood_mpp_conf(openrd_mpp_config);
70
71 kirkwood_uart0_init();
72 kirkwood_nand_init(ARRAY_AND_SIZE(openrd_nand_parts), 25);
73
74 kirkwood_ehci_init();
75
76 kirkwood_ge00_init(&openrd_ge00_data);
77 if (machine_is_openrd_client())
78 kirkwood_ge01_init(&openrd_ge01_data);
79 kirkwood_sata_init(&openrd_sata_data);
80 kirkwood_sdio_init(&openrd_mvsdio_data);
81
82 kirkwood_i2c_init();
83}
84
85static int __init openrd_pci_init(void)
86{
87 if (machine_is_openrd_base() || machine_is_openrd_client())
88 kirkwood_pcie_init();
89
90 return 0;
91}
92subsys_initcall(openrd_pci_init);
93
94#ifdef CONFIG_MACH_OPENRD_BASE
95MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
96 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
97 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
98 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
99 .boot_params = 0x00000100,
100 .init_machine = openrd_init,
101 .map_io = kirkwood_map_io,
102 .init_irq = kirkwood_init_irq,
103 .timer = &kirkwood_timer,
104MACHINE_END
105#endif
106
107#ifdef CONFIG_MACH_OPENRD_CLIENT
108MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
109 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
110 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
111 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
112 .boot_params = 0x00000100,
113 .init_machine = openrd_init,
114 .map_io = kirkwood_map_io,
115 .init_irq = kirkwood_init_irq,
116 .timer = &kirkwood_timer,
117MACHINE_END
118#endif
diff --git a/arch/arm/mach-kirkwood/openrd_base-setup.c b/arch/arm/mach-kirkwood/openrd_base-setup.c
deleted file mode 100644
index 77617c722299..000000000000
--- a/arch/arm/mach-kirkwood/openrd_base-setup.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/openrd_base-setup.c
3 *
4 * Marvell OpenRD Base 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/partitions.h>
15#include <linux/ata_platform.h>
16#include <linux/mv643xx_eth.h>
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <mach/kirkwood.h>
20#include <plat/mvsdio.h>
21#include "common.h"
22#include "mpp.h"
23
24static struct mtd_partition openrd_base_nand_parts[] = {
25 {
26 .name = "u-boot",
27 .offset = 0,
28 .size = SZ_1M
29 }, {
30 .name = "uImage",
31 .offset = MTDPART_OFS_NXTBLK,
32 .size = SZ_4M
33 }, {
34 .name = "root",
35 .offset = MTDPART_OFS_NXTBLK,
36 .size = MTDPART_SIZ_FULL
37 },
38};
39
40static struct mv643xx_eth_platform_data openrd_base_ge00_data = {
41 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
42};
43
44static struct mv_sata_platform_data openrd_base_sata_data = {
45 .n_ports = 2,
46};
47
48static struct mvsdio_platform_data openrd_base_mvsdio_data = {
49 .gpio_card_detect = 29, /* MPP29 used as SD card detect */
50};
51
52static unsigned int openrd_base_mpp_config[] __initdata = {
53 MPP29_GPIO,
54 0
55};
56
57static void __init openrd_base_init(void)
58{
59 /*
60 * Basic setup. Needs to be called early.
61 */
62 kirkwood_init();
63 kirkwood_mpp_conf(openrd_base_mpp_config);
64
65 kirkwood_uart0_init();
66 kirkwood_nand_init(ARRAY_AND_SIZE(openrd_base_nand_parts), 25);
67
68 kirkwood_ehci_init();
69
70 kirkwood_ge00_init(&openrd_base_ge00_data);
71 kirkwood_sata_init(&openrd_base_sata_data);
72 kirkwood_sdio_init(&openrd_base_mvsdio_data);
73
74 kirkwood_i2c_init();
75}
76
77static int __init openrd_base_pci_init(void)
78{
79 if (machine_is_openrd_base())
80 kirkwood_pcie_init();
81
82 return 0;
83 }
84subsys_initcall(openrd_base_pci_init);
85
86
87MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
88 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
89 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
90 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
91 .boot_params = 0x00000100,
92 .init_machine = openrd_base_init,
93 .map_io = kirkwood_map_io,
94 .init_irq = kirkwood_init_irq,
95 .timer = &kirkwood_timer,
96MACHINE_END