Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  arch/arm/mach-pxa/colibri-pxa320.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Support for Toradex PXA320/310 based Colibri module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Daniel Mack <daniel@caiaq.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *  Matthias Meier <matthias.j.meier@gmx.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/gpio/machine.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <asm/mach-types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/sizes.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <asm/mach/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include "pxa320.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include "colibri.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <linux/platform_data/video-pxafb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <linux/platform_data/usb-ohci-pxa27x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <mach/audio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include "pxa27x-udc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include "udc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include "generic.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #include "devices.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) #ifdef	CONFIG_MACH_COLIBRI_EVALBOARD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	/* MMC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	GPIO22_MMC1_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	GPIO23_MMC1_CMD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	GPIO18_MMC1_DAT0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	GPIO19_MMC1_DAT1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	GPIO20_MMC1_DAT2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	GPIO21_MMC1_DAT3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	GPIO28_GPIO,	/* SD detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	/* UART 1 configuration (may be set by bootloader) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	GPIO99_UART1_CTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	GPIO104_UART1_RTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	GPIO97_UART1_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	GPIO98_UART1_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	GPIO101_UART1_DTR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	GPIO103_UART1_DSR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	GPIO100_UART1_DCD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	GPIO102_UART1_RI,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	/* UART 2 configuration */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	GPIO109_UART2_CTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	GPIO112_UART2_RTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	GPIO110_UART2_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	GPIO111_UART2_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	/* UART 3 configuration */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	GPIO30_UART3_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	GPIO31_UART3_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	/* UHC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	GPIO2_2_USBH_PEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	GPIO3_2_USBH_PWR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	/* I2C */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	GPIO32_I2C_SCL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	GPIO33_I2C_SDA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	/* PCMCIA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	MFP_CFG(GPIO59, AF7),	/* PRST ; AF7 to tristate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	MFP_CFG(GPIO61, AF7),	/* PCE1 ; AF7 to tristate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	MFP_CFG(GPIO60, AF7),	/* PCE2 ; AF7 to tristate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	MFP_CFG(GPIO62, AF7),	/* PCD ; AF7 to tristate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	MFP_CFG(GPIO56, AF7),	/* PSKTSEL ; AF7 to tristate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	GPIO27_GPIO,		/* RDnWR ; input/tristate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	GPIO50_GPIO,		/* PREG ; input/tristate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	GPIO2_RDY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	GPIO5_NPIOR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	GPIO6_NPIOW,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	GPIO7_NPIOS16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	GPIO8_NPWAIT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	GPIO29_GPIO,		/* PRDY (READY GPIO) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	GPIO57_GPIO,		/* PPEN (POWER GPIO) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	GPIO81_GPIO,		/* PCD (DETECT GPIO) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	GPIO77_GPIO,		/* PRST (RESET GPIO) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	GPIO53_GPIO,		/* PBVD1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	GPIO79_GPIO,		/* PBVD2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	GPIO54_GPIO,		/* POE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) #if defined(CONFIG_AX88796)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) #define COLIBRI_ETH_IRQ_GPIO	mfp_to_gpio(GPIO36_GPIO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  * Asix AX88796 Ethernet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) static struct ax_plat_data colibri_asix_platdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	.flags		= 0, /* defined later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	.wordlength	= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) static struct resource colibri_asix_resource[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	[0] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		.start = PXA3xx_CS2_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		.end   = PXA3xx_CS2_PHYS + (0x20 * 2) - 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		.flags = IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	[1] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		.start = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		.end   = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) static struct platform_device asix_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	.name		= "ax88796",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	.id		= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	.num_resources 	= ARRAY_SIZE(colibri_asix_resource),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	.resource	= colibri_asix_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		.platform_data = &colibri_asix_platdata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) static mfp_cfg_t colibri_pxa320_eth_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	GPIO3_nCS2,			/* AX88796 chip select */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	GPIO36_GPIO | MFP_PULL_HIGH	/* AX88796 IRQ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) static void __init colibri_pxa320_init_eth(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	colibri_pxa3xx_init_eth(&colibri_asix_platdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_eth_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	platform_device_register(&asix_device);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static inline void __init colibri_pxa320_init_eth(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) #endif /* CONFIG_AX88796 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) static struct gpiod_lookup_table gpio_vbus_gpiod_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	.dev_id = "gpio-vbus",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	.table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		GPIO_LOOKUP("gpio-pxa", MFP_PIN_GPIO96,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 			    "vbus", GPIO_ACTIVE_HIGH),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) static struct platform_device colibri_pxa320_gpio_vbus = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	.name	= "gpio-vbus",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	.id	= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) static void colibri_pxa320_udc_command(int cmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	if (cmd == PXA2XX_UDC_CMD_CONNECT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		UP2OCR = UP2OCR_HXOE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) static struct pxa2xx_udc_mach_info colibri_pxa320_udc_info __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	.udc_command		= colibri_pxa320_udc_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	.gpio_pullup		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) static void __init colibri_pxa320_init_udc(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	pxa_set_udc_info(&colibri_pxa320_udc_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	gpiod_add_lookup_table(&gpio_vbus_gpiod_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	platform_device_register(&colibri_pxa320_gpio_vbus);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) static inline void colibri_pxa320_init_udc(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	GPIO6_2_LCD_LDD_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	GPIO7_2_LCD_LDD_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	GPIO8_2_LCD_LDD_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	GPIO9_2_LCD_LDD_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	GPIO10_2_LCD_LDD_4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	GPIO11_2_LCD_LDD_5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	GPIO12_2_LCD_LDD_6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	GPIO13_2_LCD_LDD_7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	GPIO63_LCD_LDD_8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	GPIO64_LCD_LDD_9,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	GPIO65_LCD_LDD_10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	GPIO66_LCD_LDD_11,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	GPIO67_LCD_LDD_12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	GPIO68_LCD_LDD_13,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	GPIO69_LCD_LDD_14,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	GPIO70_LCD_LDD_15,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	GPIO71_LCD_LDD_16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	GPIO72_LCD_LDD_17,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	GPIO73_LCD_CS_N,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	GPIO74_LCD_VSYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	GPIO14_2_LCD_FCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	GPIO15_2_LCD_LCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	GPIO16_2_LCD_PCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	GPIO17_2_LCD_BIAS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) static void __init colibri_pxa320_init_lcd(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_lcd_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) static inline void colibri_pxa320_init_lcd(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #if	defined(CONFIG_SND_AC97_CODEC) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	defined(CONFIG_SND_AC97_CODEC_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) static mfp_cfg_t colibri_pxa320_ac97_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	GPIO34_AC97_SYSCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	GPIO35_AC97_SDATA_IN_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	GPIO37_AC97_SDATA_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	GPIO38_AC97_SYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	GPIO39_AC97_BITCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	GPIO40_AC97_nACRESET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) static inline void __init colibri_pxa320_init_ac97(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_ac97_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	pxa_set_ac97_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) static inline void colibri_pxa320_init_ac97(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) void __init colibri_pxa320_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	colibri_pxa320_init_eth();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	colibri_pxa3xx_init_nand();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	colibri_pxa320_init_lcd();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	colibri_pxa320_init_ac97();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	colibri_pxa320_init_udc();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	/* Evalboard init */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	colibri_evalboard_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	.atag_offset	= 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	.init_machine	= colibri_pxa320_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	.map_io		= pxa3xx_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	.nr_irqs	= PXA_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	.init_irq	= pxa3xx_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	.handle_irq	= pxa3xx_handle_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	.init_time	= pxa_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	.restart	= pxa_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) MACHINE_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)