diff options
| author | Martin Michlmayr <tbm@cyrius.com> | 2010-06-13 15:00:16 -0400 |
|---|---|---|
| committer | Nicolas Pitre <nico@fluxnic.net> | 2010-07-16 22:01:57 -0400 |
| commit | b529ee4acfc65ecf4517ad4f22023d6a58e671a6 (patch) | |
| tree | f2c9bdf9ee89ebdcf92c8769b2cfe7250260be49 | |
| parent | 128190ebe92fee69f26d225036ba857e0fffb2e8 (diff) | |
[ARM] Kirkwood: Add support for HP t5325 Thin Client
Add support for the HP t5325 Thin Client. This thin client is based
on a Marvell Kirkwood chip at 1.2 GHz and features 512 MB RAM, 512 MB
SATA-attached flash and an XGI Volari Z11 GPU.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
| -rw-r--r-- | arch/arm/mach-kirkwood/Kconfig | 6 | ||||
| -rw-r--r-- | arch/arm/mach-kirkwood/Makefile | 1 | ||||
| -rw-r--r-- | arch/arm/mach-kirkwood/t5325-setup.c | 194 |
3 files changed, 201 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 29b2163b1fe3..427827107b4b 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
| @@ -99,6 +99,12 @@ config MACH_NET5BIG_V2 | |||
| 99 | Say 'Y' here if you want your kernel to support the | 99 | Say 'Y' here if you want your kernel to support the |
| 100 | LaCie 5Big Network v2 NAS. | 100 | LaCie 5Big Network v2 NAS. |
| 101 | 101 | ||
| 102 | config MACH_T5325 | ||
| 103 | bool "HP t5325 Thin Client" | ||
| 104 | help | ||
| 105 | Say 'Y' here if you want your kernel to support the | ||
| 106 | HP t5325 Thin Client. | ||
| 107 | |||
| 102 | endmenu | 108 | endmenu |
| 103 | 109 | ||
| 104 | endif | 110 | endif |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index c0cd5d362002..b7c5d5e62bc3 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
| @@ -14,5 +14,6 @@ obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o | |||
| 14 | obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o | 14 | obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o |
| 15 | obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o | 15 | obj-$(CONFIG_MACH_NET2BIG_V2) += netxbig_v2-setup.o |
| 16 | obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o | 16 | obj-$(CONFIG_MACH_NET5BIG_V2) += netxbig_v2-setup.o |
| 17 | obj-$(CONFIG_MACH_T5325) += t5325-setup.o | ||
| 17 | 18 | ||
| 18 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 19 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
diff --git a/arch/arm/mach-kirkwood/t5325-setup.c b/arch/arm/mach-kirkwood/t5325-setup.c new file mode 100644 index 000000000000..ad1e0f1fb1e7 --- /dev/null +++ b/arch/arm/mach-kirkwood/t5325-setup.c | |||
| @@ -0,0 +1,194 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * HP t5325 Thin Client setup | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Martin Michlmayr <tbm@cyrius.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or | ||
| 8 | * modify it under the terms of the GNU General Public License | ||
| 9 | * as published by the Free Software Foundation; either version | ||
| 10 | * 2 of the License, or (at your option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/kernel.h> | ||
| 14 | #include <linux/init.h> | ||
| 15 | #include <linux/platform_device.h> | ||
| 16 | #include <linux/mtd/physmap.h> | ||
| 17 | #include <linux/spi/flash.h> | ||
| 18 | #include <linux/spi/spi.h> | ||
| 19 | #include <linux/spi/orion_spi.h> | ||
| 20 | #include <linux/i2c.h> | ||
| 21 | #include <linux/mv643xx_eth.h> | ||
| 22 | #include <linux/ata_platform.h> | ||
| 23 | #include <linux/gpio.h> | ||
| 24 | #include <linux/gpio_keys.h> | ||
| 25 | #include <linux/input.h> | ||
| 26 | #include <asm/mach-types.h> | ||
| 27 | #include <asm/mach/arch.h> | ||
| 28 | #include <mach/kirkwood.h> | ||
| 29 | #include "common.h" | ||
| 30 | #include "mpp.h" | ||
| 31 | |||
| 32 | struct mtd_partition hp_t5325_partitions[] = { | ||
| 33 | { | ||
| 34 | .name = "u-boot env", | ||
| 35 | .size = SZ_64K, | ||
| 36 | .offset = SZ_512K + SZ_256K, | ||
| 37 | }, | ||
| 38 | { | ||
| 39 | .name = "permanent u-boot env", | ||
| 40 | .size = SZ_64K, | ||
| 41 | .offset = MTDPART_OFS_APPEND, | ||
| 42 | .mask_flags = MTD_WRITEABLE, | ||
| 43 | }, | ||
| 44 | { | ||
| 45 | .name = "HP env", | ||
| 46 | .size = SZ_64K, | ||
| 47 | .offset = MTDPART_OFS_APPEND, | ||
| 48 | }, | ||
| 49 | { | ||
| 50 | .name = "u-boot", | ||
| 51 | .size = SZ_512K, | ||
| 52 | .offset = 0, | ||
| 53 | .mask_flags = MTD_WRITEABLE, | ||
| 54 | }, | ||
| 55 | { | ||
| 56 | .name = "SSD firmware", | ||
| 57 | .size = SZ_256K, | ||
| 58 | .offset = SZ_512K, | ||
| 59 | }, | ||
| 60 | }; | ||
| 61 | |||
| 62 | const struct flash_platform_data hp_t5325_flash = { | ||
| 63 | .type = "mx25l8005", | ||
| 64 | .name = "spi_flash", | ||
| 65 | .parts = hp_t5325_partitions, | ||
| 66 | .nr_parts = ARRAY_SIZE(hp_t5325_partitions), | ||
| 67 | }; | ||
| 68 | |||
| 69 | struct spi_board_info __initdata hp_t5325_spi_slave_info[] = { | ||
| 70 | { | ||
| 71 | .modalias = "m25p80", | ||
| 72 | .platform_data = &hp_t5325_flash, | ||
| 73 | .irq = -1, | ||
| 74 | }, | ||
| 75 | }; | ||
| 76 | |||
| 77 | static struct mv643xx_eth_platform_data hp_t5325_ge00_data = { | ||
| 78 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
| 79 | }; | ||
| 80 | |||
| 81 | static struct mv_sata_platform_data hp_t5325_sata_data = { | ||
| 82 | .n_ports = 2, | ||
| 83 | }; | ||
| 84 | |||
| 85 | static struct gpio_keys_button hp_t5325_buttons[] = { | ||
| 86 | { | ||
| 87 | .code = KEY_POWER, | ||
| 88 | .gpio = 45, | ||
| 89 | .desc = "Power", | ||
| 90 | .active_low = 1, | ||
| 91 | }, | ||
| 92 | }; | ||
| 93 | |||
| 94 | static struct gpio_keys_platform_data hp_t5325_button_data = { | ||
| 95 | .buttons = hp_t5325_buttons, | ||
| 96 | .nbuttons = ARRAY_SIZE(hp_t5325_buttons), | ||
| 97 | }; | ||
| 98 | |||
| 99 | static struct platform_device hp_t5325_button_device = { | ||
| 100 | .name = "gpio-keys", | ||
| 101 | .id = -1, | ||
| 102 | .num_resources = 0, | ||
| 103 | .dev = { | ||
| 104 | .platform_data = &hp_t5325_button_data, | ||
| 105 | } | ||
| 106 | }; | ||
| 107 | |||
| 108 | static unsigned int hp_t5325_mpp_config[] __initdata = { | ||
| 109 | MPP0_NF_IO2, | ||
| 110 | MPP1_SPI_MOSI, | ||
| 111 | MPP2_SPI_SCK, | ||
| 112 | MPP3_SPI_MISO, | ||
| 113 | MPP4_NF_IO6, | ||
| 114 | MPP5_NF_IO7, | ||
| 115 | MPP6_SYSRST_OUTn, | ||
| 116 | MPP7_SPI_SCn, | ||
| 117 | MPP8_TW_SDA, | ||
| 118 | MPP9_TW_SCK, | ||
| 119 | MPP10_UART0_TXD, | ||
| 120 | MPP11_UART0_RXD, | ||
| 121 | MPP12_SD_CLK, | ||
| 122 | MPP13_GPIO, | ||
| 123 | MPP14_GPIO, | ||
| 124 | MPP15_GPIO, | ||
| 125 | MPP16_GPIO, | ||
| 126 | MPP17_GPIO, | ||
| 127 | MPP18_NF_IO0, | ||
| 128 | MPP19_NF_IO1, | ||
| 129 | MPP20_GPIO, | ||
| 130 | MPP21_GPIO, | ||
| 131 | MPP22_GPIO, | ||
| 132 | MPP23_GPIO, | ||
| 133 | MPP32_GPIO, | ||
| 134 | MPP33_GE1_13, | ||
| 135 | MPP39_AUDIO_I2SBCLK, | ||
| 136 | MPP40_AUDIO_I2SDO, | ||
| 137 | MPP41_AUDIO_I2SLRC, | ||
| 138 | MPP42_AUDIO_I2SMCLK, | ||
| 139 | MPP45_GPIO, /* Power button */ | ||
| 140 | MPP48_GPIO, /* Board power off */ | ||
| 141 | 0 | ||
| 142 | }; | ||
| 143 | |||
| 144 | #define HP_T5325_GPIO_POWER_OFF 48 | ||
| 145 | |||
| 146 | static void hp_t5325_power_off(void) | ||
| 147 | { | ||
| 148 | gpio_set_value(HP_T5325_GPIO_POWER_OFF, 1); | ||
| 149 | } | ||
| 150 | |||
| 151 | static void __init hp_t5325_init(void) | ||
| 152 | { | ||
| 153 | /* | ||
| 154 | * Basic setup. Needs to be called early. | ||
| 155 | */ | ||
| 156 | kirkwood_init(); | ||
| 157 | kirkwood_mpp_conf(hp_t5325_mpp_config); | ||
| 158 | |||
| 159 | kirkwood_uart0_init(); | ||
| 160 | spi_register_board_info(hp_t5325_spi_slave_info, | ||
| 161 | ARRAY_SIZE(hp_t5325_spi_slave_info)); | ||
| 162 | kirkwood_spi_init(); | ||
| 163 | kirkwood_i2c_init(); | ||
| 164 | kirkwood_ge00_init(&hp_t5325_ge00_data); | ||
| 165 | kirkwood_sata_init(&hp_t5325_sata_data); | ||
| 166 | kirkwood_ehci_init(); | ||
| 167 | platform_device_register(&hp_t5325_button_device); | ||
| 168 | |||
| 169 | if (gpio_request(HP_T5325_GPIO_POWER_OFF, "power-off") == 0 && | ||
| 170 | gpio_direction_output(HP_T5325_GPIO_POWER_OFF, 0) == 0) | ||
| 171 | pm_power_off = hp_t5325_power_off; | ||
| 172 | else | ||
| 173 | pr_err("t5325: failed to configure power-off GPIO\n"); | ||
| 174 | } | ||
| 175 | |||
| 176 | static int __init hp_t5325_pci_init(void) | ||
| 177 | { | ||
| 178 | if (machine_is_t5325()) | ||
| 179 | kirkwood_pcie_init(); | ||
| 180 | |||
| 181 | return 0; | ||
| 182 | } | ||
| 183 | subsys_initcall(hp_t5325_pci_init); | ||
| 184 | |||
| 185 | MACHINE_START(T5325, "HP t5325 Thin Client") | ||
| 186 | /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */ | ||
| 187 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
| 188 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
| 189 | .boot_params = 0x00000100, | ||
| 190 | .init_machine = hp_t5325_init, | ||
| 191 | .map_io = kirkwood_map_io, | ||
| 192 | .init_irq = kirkwood_init_irq, | ||
| 193 | .timer = &kirkwood_timer, | ||
| 194 | MACHINE_END | ||
