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/gpio.h>
14 #include <asm/mach/arch.h>
15 #include <asm/mach-types.h>
17 #include <mach/pxa168.h>
18 #include <mach/mfp-pxa168.h>
22 static unsigned long gplugd_pin_config
[] __initdata
= {
40 /* LCD & HDMI clock selection GPIO: 0: 74.176MHz, 1: 74.25 MHz */
42 GPIO36_GPIO
, /* CEC Interrupt */
105 GPIO104_GPIO
, /* Reset PHY */
114 /* SPI NOR Flash on SSP2 */
117 GPIO110_GPIO
, /* SPI_CSn */
129 static struct i2c_board_info gplugd_i2c_board_info
[] = {
136 /* Bring PHY out of reset by setting GPIO 104 */
137 static int gplugd_eth_init(void)
139 if (unlikely(gpio_request(104, "ETH_RESET_N"))) {
140 printk(KERN_ERR
"Can't get hold of GPIO 104 to bring Ethernet "
141 "PHY out of reset\n");
145 gpio_direction_output(104, 1);
150 struct pxa168_eth_platform_data gplugd_eth_platform_data
= {
153 .speed
= 0, /* Autonagotiation */
154 .init
= gplugd_eth_init
,
157 static void __init
select_disp_freq(void)
159 /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */
160 if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) {
161 printk(KERN_ERR
"Can't get hold of GPIO 35 to select display "
164 gpio_direction_output(35, 1);
168 if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
169 printk(KERN_ERR
"Can't get hold of GPIO 85 to select display "
172 gpio_direction_output(85, 0);
177 static void __init
gplugd_init(void)
179 mfp_config(ARRAY_AND_SIZE(gplugd_pin_config
));
183 /* on-chip devices */
186 pxa168_add_twsi(0, NULL
, ARRAY_AND_SIZE(gplugd_i2c_board_info
));
187 platform_device_register(&pxa168_device_gpio
);
189 pxa168_add_eth(&gplugd_eth_platform_data
);
192 MACHINE_START(GPLUGD
, "PXA168-based GuruPlug Display (gplugD) Platform")
193 .map_io
= mmp_map_io
,
194 .nr_irqs
= MMP_NR_IRQS
,
195 .init_irq
= pxa168_init_irq
,
196 .timer
= &pxa168_timer
,
197 .init_machine
= gplugd_init
,
198 .restart
= pxa168_restart
,