diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index cc25501..324b004 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -88,6 +88,12 @@ config MACH_NETSPACE_V2 Say 'Y' here if you want your kernel to support the LaCie Network Space v2 NAS. +config MACH_TK71 + bool "TK71 88F6281 based Q7 form factor board" + help + Say 'Y' here if you want your kernel to support the + TK71 88F6281 based Q7 form factor board. + config MACH_INETSPACE_V2 bool "LaCie Internet Space v2 NAS Board" help diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 295d7ba..f3a3c55 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o +obj-$(CONFIG_MACH_TK71) += tk71-setup.o obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o obj-$(CONFIG_MACH_NETSPACE_MAX_V2) += netspace_v2-setup.o diff --git a/arch/arm/mach-kirkwood/tk71-setup.c b/arch/arm/mach-kirkwood/tk71-setup.c new file mode 100644 index 0000000..1966a12 --- /dev/null +++ b/arch/arm/mach-kirkwood/tk71-setup.c @@ -0,0 +1,153 @@ +/* + * arch/arm/mach-kirkwood/tk71-setup.c + * based on + * arch/arm/mach-kirkwood/rd88f6281-setup.c + * + * TK71 Kirkwood based Q7 formfactor board + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "common.h" +#include "mpp.h" + +static struct mtd_partition tk71_nand_parts[] = { + { + .name = "u-boot", + .offset = 0, + .size = 0x80000 + }, { + .name = "u-boot-env", + .offset = MTDPART_OFS_NXTBLK, + .size = 0x80000 + }, { + .name = "kernel", + .offset = MTDPART_OFS_NXTBLK, + .size = 0x300000 + }, { + .name = "root", + .offset = MTDPART_OFS_NXTBLK, + .size = MTDPART_SIZ_FULL + }, +}; + +static struct mv643xx_eth_platform_data tk71_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(8), + /* in case a hardcoded MAC address is needed uncomment next line */ + /* .mac_addr = {0x00, 0x0c, 0xc6, 0x76, 0x76, 0x2b}, */ +}; + +static struct mv643xx_eth_platform_data tk71_ge01_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(28), + /* in case a hardcoded MAC address is needed uncomment next line */ + /* .mac_addr = {0x00, 0x0c, 0xc6, 0x76, 0x76, 0x2c}, */ +}; + +static struct mv_sata_platform_data tk71_sata_data = { + .n_ports = 2, +}; + +static struct mvsdio_platform_data tk71_mvsdio_data = { + .gpio_card_detect = 29, +}; + +static unsigned int tk71_mpp_config[] __initdata = { +#if 0 + MPP0_SPI_SCn, /* SPI - currently unused */ + MPP1_SPI_MOSI, + MPP2_SPI_SCK, + MPP3_SPI_MISO, +#endif + MPP7_PEX_RST_OUTn, /* PCIe #reset */ + MPP8_TW0_SDA, /* I2C */ + MPP9_TW0_SCK, /* I2C */ + MPP20_GE1_TXD0, /* second GigE */ + MPP21_GE1_TXD1, + MPP22_GE1_TXD2, + MPP23_GE1_TXD3, + MPP24_GE1_RXD0, + MPP25_GE1_RXD1, + MPP26_GE1_RXD2, + MPP27_GE1_RXD3, + MPP28_GPIO, /* PHY2 RESET */ + MPP29_GPIO, /* SDIO_CD# */ + MPP30_GE1_RXCTL, + MPP31_GE1_RXCLK, + MPP32_GE1_TCLKOUT, + MPP33_GE1_TXCTL, + MPP34_GPIO, /* SDIO_PWR# */ + 0 +}; + +static void __init tk71_init(void) +{ + /* + * Basic setup. Needs to be called early. + */ + kirkwood_init(); + + kirkwood_mpp_conf(tk71_mpp_config); + + kirkwood_uart0_init(); + + kirkwood_nand_init(ARRAY_AND_SIZE(tk71_nand_parts), 25); + + /* kirkwood_spi_init(); */ /* if you want to use SPI, uncomment this and MPP setup above*/ + + kirkwood_i2c_init(); + + /* eth0 */ + kirkwood_ge00_init(&tk71_ge00_data); + + /* eth1 */ + if (gpio_request(28, "PHY2 reset") != 0 || + gpio_direction_input(28) != 0) /* high-z */ + pr_err("can't deassert GPIO 28 (PHY2 reset)\n"); + else + kirkwood_ge01_init(&tk71_ge01_data); + + kirkwood_sata_init(&tk71_sata_data); + + kirkwood_ehci_init(); + + if (gpio_request(34, "SDIO Power Enable") != 0 || + gpio_direction_output(34, 0) != 0) /* low active */ + pr_err("can't set up GPIO 34 (SDIO Power Enable)\n"); + kirkwood_sdio_init(&tk71_mvsdio_data); +} + +static int __init tk71_pci_init(void) +{ + if (machine_is_tk71()) + kirkwood_pcie_init(KW_PCIE0); + + return 0; +} +subsys_initcall(tk71_pci_init); + +MACHINE_START(TK71, "TK71 Kirkwood based Q7 formfactor board") + /* Maintainer: Nils Faerber */ + .phys_io = KIRKWOOD_REGS_PHYS_BASE, + .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, + .boot_params = 0x00000100, + .init_machine = tk71_init, + .map_io = kirkwood_map_io, + .init_irq = kirkwood_init_irq, + .timer = &kirkwood_timer, +MACHINE_END