3 * HP t5325 Thin Client setup
5 * Copyright (C) 2010 Martin Michlmayr <tbm@cyrius.com>
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.
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 <sound/alc5623.h>
27 #include <asm/mach-types.h>
28 #include <asm/mach/arch.h>
29 #include <mach/kirkwood.h>
33 struct mtd_partition hp_t5325_partitions[] = {
37 .offset = SZ_512K + SZ_256K,
40 .name = "permanent u-boot env",
42 .offset = MTDPART_OFS_APPEND,
43 .mask_flags = MTD_WRITEABLE,
48 .offset = MTDPART_OFS_APPEND,
54 .mask_flags = MTD_WRITEABLE,
57 .name = "SSD firmware",
63 const struct flash_platform_data hp_t5325_flash = {
66 .parts = hp_t5325_partitions,
67 .nr_parts = ARRAY_SIZE(hp_t5325_partitions),
70 struct spi_board_info __initdata hp_t5325_spi_slave_info[] = {
73 .platform_data = &hp_t5325_flash,
78 static struct mv643xx_eth_platform_data hp_t5325_ge00_data = {
79 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
82 static struct mv_sata_platform_data hp_t5325_sata_data = {
86 static struct gpio_keys_button hp_t5325_buttons[] = {
95 static struct gpio_keys_platform_data hp_t5325_button_data = {
96 .buttons = hp_t5325_buttons,
97 .nbuttons = ARRAY_SIZE(hp_t5325_buttons),
100 static struct platform_device hp_t5325_button_device = {
105 .platform_data = &hp_t5325_button_data,
109 static unsigned int hp_t5325_mpp_config[] __initdata = {
141 MPP45_GPIO, /* Power button */
142 MPP48_GPIO, /* Board power off */
146 static struct alc5623_platform_data alc5621_data = {
148 .jack_det_ctrl = 0x4810,
151 static struct i2c_board_info i2c_board_info[] __initdata = {
153 I2C_BOARD_INFO("alc5621", 0x1a),
154 .platform_data = &alc5621_data,
158 #define HP_T5325_GPIO_POWER_OFF 48
160 static void hp_t5325_power_off(void)
162 gpio_set_value(HP_T5325_GPIO_POWER_OFF, 1);
165 static void __init hp_t5325_init(void)
168 * Basic setup. Needs to be called early.
171 kirkwood_mpp_conf(hp_t5325_mpp_config);
173 kirkwood_uart0_init();
174 spi_register_board_info(hp_t5325_spi_slave_info,
175 ARRAY_SIZE(hp_t5325_spi_slave_info));
178 kirkwood_ge00_init(&hp_t5325_ge00_data);
179 kirkwood_sata_init(&hp_t5325_sata_data);
180 kirkwood_ehci_init();
181 platform_device_register(&hp_t5325_button_device);
183 i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
184 kirkwood_audio_init();
186 if (gpio_request(HP_T5325_GPIO_POWER_OFF, "power-off") == 0 &&
187 gpio_direction_output(HP_T5325_GPIO_POWER_OFF, 0) == 0)
188 pm_power_off = hp_t5325_power_off;
190 pr_err("t5325: failed to configure power-off GPIO\n");
193 static int __init hp_t5325_pci_init(void)
195 if (machine_is_t5325())
196 kirkwood_pcie_init(KW_PCIE0);
200 subsys_initcall(hp_t5325_pci_init);
202 MACHINE_START(T5325, "HP t5325 Thin Client")
203 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
204 .boot_params = 0x00000100,
205 .init_machine = hp_t5325_init,
206 .map_io = kirkwood_map_io,
207 .init_early = kirkwood_init_early,
208 .init_irq = kirkwood_init_irq,
209 .timer = &kirkwood_timer,