summaryrefslogtreecommitdiff
path: root/arch/arm/mach-kirkwood/csb1724-setup.c
blob: c5545f3ab1c4d240b138d47e8aacea608850d779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/* arch/arm/mach-kirkwood/csb1724-setup.c
 *
 * Copyright 2012 Codethink Limited.
 *	Ben Dooks <ben.dooks@codethink.co.uk>
 *
 * Cogent CSB1724 SoM setup.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mv643xx_eth.h>

#include <linux/mtd/partitions.h>
#include <linux/ata_platform.h>
#include <plat/mvsdio.h>

#include <asm/mach/arch.h>
#include <asm/mach-types.h>

#include "common.h"
#include "mpp.h"

static struct mtd_partition csb1724_nand_parts[] = {
	{
		.name		= "u-boot",
		.offset		= 0,
		.size		= SZ_1M,
	}, {
		.name		= "uImage",
		.offset		= MTDPART_OFS_NXTBLK,
		.size		= SZ_4M - SZ_1M,
	}, {
		.name		= "rootfs",
		.offset		= MTDPART_OFS_NXTBLK,
		.size		= MTDPART_SIZ_FULL
	},
};

static struct mv643xx_eth_platform_data csb1724_ge00_data = {
	.phy_addr	= MV643XX_ETH_PHY_ADDR(0),
};

static struct mv643xx_eth_platform_data csb1724_ge01_data = {
	.phy_addr	= MV643XX_ETH_PHY_ADDR(1),
};

static struct mv_sata_platform_data csb1724_sata_data = {
	.n_ports	= 2,
};

static struct mvsdio_platform_data csb1724_mvsdio_data = {
	.gpio_card_detect	= 38,
};

static unsigned int csb1724_mpp_config[] __initdata = {
	MPP0_NF_IO2,
	MPP1_NF_IO3,
	MPP2_NF_IO4,
	MPP3_NF_IO5,
	MPP4_NF_IO6,
	MPP5_NF_IO7,
	MPP8_TW0_SDA,
	MPP9_TW0_SCK,
	MPP12_SD_CLK,
	MPP13_SD_CMD,
	MPP14_SD_D0,
	MPP15_SD_D1,
	MPP16_SD_D2,
	MPP17_SD_D3,
	MPP18_NF_IO0,
	MPP19_NF_IO1,
	MPP20_GE1_TXD0,
	MPP21_GE1_TXD1,
	MPP22_GE1_TXD2,
	MPP23_GE1_TXD3,
	MPP24_GE1_RXD0,
	MPP25_GE1_RXD1,
	MPP26_GE1_RXD2,
	MPP27_GE1_RXD3,
	MPP30_GE1_RXCTL,
	MPP31_GE1_RXCLK,
	MPP32_GE1_TCLKOUT,
	MPP33_GE1_TXCTL,
	MPP34_SATA1_ACTn,
	MPP35_SATA0_ACTn,
	MPP36_TW1_SDA,
	MPP37_TW1_SCK,
};

static void __init csb1724_init(void)
{
	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_init();
	kirkwood_mpp_conf(csb1724_mpp_config);

	kirkwood_i2c_init();
	kirkwood_i2c1_init();
	kirkwood_ehci_init();
	kirkwood_uart0_init();
	kirkwood_ge00_init(&csb1724_ge00_data);
	kirkwood_ge01_init(&csb1724_ge01_data);
	kirkwood_sata_init(&csb1724_sata_data);
	kirkwood_sdio_init(&csb1724_mvsdio_data);

	kirkwood_nand_init(ARRAY_AND_SIZE(csb1724_nand_parts), 25);
}

static int __init csb1724_pci_init(void)
{
	if (machine_is_csb1724())
		kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0, KW_PCIE0 | KW_PCIE1);

	return 0;
}

subsys_initcall(csb1724_pci_init);

MACHINE_START(CSB1724, "Cogent CSB1724")
	.atag_offset	= 0x100,
	.init_machine	= csb1724_init,
	.map_io		= kirkwood_map_io,
	.init_early	= kirkwood_init_early,
	.init_irq	= kirkwood_init_irq,
	.timer		= &kirkwood_timer,
	.restart	= kirkwood_restart,
MACHINE_END