1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-mmp/gplugd.c
5 * Support for the Marvell PXA168-based GuruPlug Display (gplugD) Platform.
8 #include <linux/init.h>
9 #include <linux/platform_device.h>
10 #include <linux/gpio.h>
11 #include <linux/gpio-pxa.h>
13 #include <asm/mach/arch.h>
14 #include <asm/mach-types.h>
18 #include "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 pxa_gpio_platform_data pxa168_gpio_pdata
= {
130 .irq_base
= MMP_GPIO_TO_IRQ(0),
133 static struct i2c_board_info gplugd_i2c_board_info
[] = {
140 /* Bring PHY out of reset by setting GPIO 104 */
141 static int gplugd_eth_init(void)
143 if (unlikely(gpio_request(104, "ETH_RESET_N"))) {
144 printk(KERN_ERR
"Can't get hold of GPIO 104 to bring Ethernet "
145 "PHY out of reset\n");
149 gpio_direction_output(104, 1);
154 struct pxa168_eth_platform_data gplugd_eth_platform_data
= {
157 .speed
= 0, /* Autonagotiation */
158 .intf
= PHY_INTERFACE_MODE_RMII
,
159 .init
= gplugd_eth_init
,
162 static void __init
select_disp_freq(void)
164 /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */
165 if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) {
166 printk(KERN_ERR
"Can't get hold of GPIO 35 to select display "
169 gpio_direction_output(35, 1);
173 if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
174 printk(KERN_ERR
"Can't get hold of GPIO 85 to select display "
177 gpio_direction_output(85, 0);
182 static void __init
gplugd_init(void)
184 mfp_config(ARRAY_AND_SIZE(gplugd_pin_config
));
188 /* on-chip devices */
191 pxa168_add_twsi(0, NULL
, ARRAY_AND_SIZE(gplugd_i2c_board_info
));
192 platform_device_add_data(&pxa168_device_gpio
, &pxa168_gpio_pdata
,
193 sizeof(struct pxa_gpio_platform_data
));
194 platform_device_register(&pxa168_device_gpio
);
196 pxa168_add_eth(&gplugd_eth_platform_data
);
199 MACHINE_START(GPLUGD
, "PXA168-based GuruPlug Display (gplugD) Platform")
200 .map_io
= mmp_map_io
,
201 .nr_irqs
= MMP_NR_IRQS
,
202 .init_irq
= pxa168_init_irq
,
203 .init_time
= pxa168_timer_init
,
204 .init_machine
= gplugd_init
,
205 .restart
= pxa168_restart
,