2 * arch/arm/mach-kirkwood/tk71-setup.c
4 * arch/arm/mach-kirkwood/rd88f6281-setup.c
6 * TK71 Kirkwood based Q7 formfactor board
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <linux/irq.h>
17 #include <linux/mtd/nand.h>
18 #include <linux/mtd/partitions.h>
19 #include <linux/ata_platform.h>
20 #include <linux/mv643xx_eth.h>
21 #include <linux/gpio.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <mach/kirkwood.h>
25 #include <plat/mvsdio.h>
26 #include <plat/orion_nand.h>
30 static struct mtd_partition tk71_nand_parts[] = {
37 .offset = MTDPART_OFS_NXTBLK,
41 .offset = MTDPART_OFS_NXTBLK,
45 .offset = MTDPART_OFS_NXTBLK,
46 .size = MTDPART_SIZ_FULL
50 static struct mv643xx_eth_platform_data tk71_ge00_data = {
51 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
52 /* in case a hardcoded MAC address is needed uncomment next line */
53 /* .mac_addr = {0x00, 0x0c, 0xc6, 0x76, 0x76, 0x2b}, */
56 static struct mv643xx_eth_platform_data tk71_ge01_data = {
57 .phy_addr = MV643XX_ETH_PHY_ADDR(28),
58 /* in case a hardcoded MAC address is needed uncomment next line */
59 /* .mac_addr = {0x00, 0x0c, 0xc6, 0x76, 0x76, 0x2c}, */
62 static struct mv_sata_platform_data tk71_sata_data = {
66 static struct mvsdio_platform_data tk71_mvsdio_data = {
67 .gpio_card_detect = 29,
70 static unsigned int tk71_mpp_config[] __initdata = {
72 MPP0_SPI_SCn, /* SPI - currently unused */
77 MPP7_PEX_RST_OUTn, /* PCIe #reset */
78 MPP8_TW0_SDA, /* I2C */
79 MPP9_TW0_SCK, /* I2C */
80 MPP20_GE1_TXD0, /* second GigE */
88 MPP28_GPIO, /* PHY2 RESET */
89 MPP29_GPIO, /* SDIO_CD# */
94 MPP34_GPIO, /* SDIO_PWR# */
98 static void __init tk71_init(void)
101 * Basic setup. Needs to be called early.
105 kirkwood_mpp_conf(tk71_mpp_config);
107 kirkwood_uart0_init();
109 kirkwood_nand_init(ARRAY_AND_SIZE(tk71_nand_parts), 25);
111 /* kirkwood_spi_init(); */ /* if you want to use SPI, uncomment this and MPP setup above*/
116 kirkwood_ge00_init(&tk71_ge00_data);
119 if (gpio_request(28, "PHY2 reset") != 0 ||
120 gpio_direction_input(28) != 0) /* high-z */
121 pr_err("can't deassert GPIO 28 (PHY2 reset)\n");
123 kirkwood_ge01_init(&tk71_ge01_data);
125 kirkwood_sata_init(&tk71_sata_data);
127 kirkwood_ehci_init();
129 if (gpio_request(34, "SDIO Power Enable") != 0 ||
130 gpio_direction_output(34, 0) != 0) /* low active */
131 pr_err("can't set up GPIO 34 (SDIO Power Enable)\n");
132 kirkwood_sdio_init(&tk71_mvsdio_data);
135 static int __init tk71_pci_init(void)
137 if (machine_is_tk71())
138 kirkwood_pcie_init(KW_PCIE0);
142 subsys_initcall(tk71_pci_init);
144 MACHINE_START(TK71, "TK71 Kirkwood based Q7 formfactor board")
145 /* Maintainer: Nils Faerber <nils.faerber@kernelconcepts.de> */
146 .atag_offset = 0x00000100,
147 .init_machine = tk71_init,
148 .map_io = kirkwood_map_io,
149 .init_early = kirkwood_init_early,
150 .init_irq = kirkwood_init_irq,
151 .timer = &kirkwood_timer,
152 .restart = kirkwood_restart,