2 * linux/arch/arm/mach-mmp/gplugd.c
4 * Support for the Marvell PXA168-based GuruPlug Display (gplugD) Platform.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * publishhed by the Free Software Foundation.
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/gpio.h>
15 #include <asm/mach/arch.h>
16 #include <asm/mach-types.h>
18 #include <mach/irqs.h>
19 #include <mach/pxa168.h>
20 #include <mach/mfp-pxa168.h>
24 static unsigned long gplugd_pin_config[] __initdata = {
42 /* LCD & HDMI clock selection GPIO: 0: 74.176MHz, 1: 74.25 MHz */
44 GPIO36_GPIO, /* CEC Interrupt */
107 GPIO104_GPIO, /* Reset PHY */
116 /* SPI NOR Flash on SSP2 */
119 GPIO110_GPIO, /* SPI_CSn */
131 static struct i2c_board_info gplugd_i2c_board_info[] = {
138 /* Bring PHY out of reset by setting GPIO 104 */
139 static int gplugd_eth_init(void)
141 if (unlikely(gpio_request(104, "ETH_RESET_N"))) {
142 printk(KERN_ERR "Can't get hold of GPIO 104 to bring Ethernet "
143 "PHY out of reset\n");
147 gpio_direction_output(104, 1);
152 struct pxa168_eth_platform_data gplugd_eth_platform_data = {
155 .speed = 0, /* Autonagotiation */
156 .init = gplugd_eth_init,
159 static void __init select_disp_freq(void)
161 /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */
162 if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) {
163 printk(KERN_ERR "Can't get hold of GPIO 35 to select display "
166 gpio_direction_output(35, 1);
170 if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
171 printk(KERN_ERR "Can't get hold of GPIO 85 to select display "
174 gpio_direction_output(85, 0);
179 static void __init gplugd_init(void)
181 mfp_config(ARRAY_AND_SIZE(gplugd_pin_config));
185 /* on-chip devices */
188 pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
189 platform_device_register(&pxa168_device_gpio);
191 pxa168_add_eth(&gplugd_eth_platform_data);
194 MACHINE_START(GPLUGD, "PXA168-based GuruPlug Display (gplugD) Platform")
195 .map_io = mmp_map_io,
196 .nr_irqs = MMP_NR_IRQS,
197 .init_irq = pxa168_init_irq,
198 .init_time = pxa168_timer_init,
199 .init_machine = gplugd_init,
200 .restart = pxa168_restart,