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)  *  linux/arch/arm/mach-pxa/colibri-pxa270.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Support for Toradex PXA270 based Colibri module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *  Daniel Mack <daniel@caiaq.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Marek Vasut <marek.vasut@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/moduleparam.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/mtd/mtd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/mtd/partitions.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/mtd/physmap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/regulator/machine.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/ucb1400.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <asm/mach/flash.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <asm/mach-types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/sizes.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include <mach/audio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include "colibri.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include "pxa27x.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) #include "devices.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) #include "generic.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * Evaluation board MFP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #ifdef	 CONFIG_MACH_COLIBRI_EVALBOARD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	/* MMC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	GPIO32_MMC_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	GPIO92_MMC_DAT_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	GPIO109_MMC_DAT_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	GPIO110_MMC_DAT_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	GPIO111_MMC_DAT_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	GPIO112_MMC_CMD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	GPIO0_GPIO,	/* SD detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	/* FFUART */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	GPIO39_FFUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	GPIO34_FFUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	/* UHC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	GPIO88_USBH1_PWR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	GPIO89_USBH1_PEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	GPIO119_USBH2_PWR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	GPIO120_USBH2_PEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	/* PCMCIA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	GPIO85_nPCE_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	GPIO54_nPCE_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	GPIO55_nPREG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	GPIO50_nPIOR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	GPIO51_nPIOW,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	GPIO49_nPWE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	GPIO48_nPOE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	GPIO57_nIOIS16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	GPIO56_nPWAIT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	GPIO104_PSKTSEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	GPIO53_GPIO,	/* RESET */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	GPIO83_GPIO,	/* BVD1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	GPIO82_GPIO,	/* BVD2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	GPIO1_GPIO,	/* READY */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	GPIO84_GPIO,	/* DETECT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	GPIO107_GPIO,	/* PPEN */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	/* I2C */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	GPIO117_I2C_SCL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	GPIO118_I2C_SDA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #ifdef	CONFIG_MACH_COLIBRI_PXA270_INCOME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) static mfp_cfg_t income_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	/* MMC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	GPIO32_MMC_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	GPIO92_MMC_DAT_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	GPIO109_MMC_DAT_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	GPIO110_MMC_DAT_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	GPIO111_MMC_DAT_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	GPIO112_MMC_CMD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	GPIO0_GPIO,	/* SD detect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	GPIO1_GPIO,	/* SD read-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	/* FFUART */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	GPIO39_FFUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	GPIO34_FFUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	/* BFUART */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	GPIO42_BTUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	GPIO43_BTUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	GPIO45_BTUART_RTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	/* STUART */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	GPIO46_STUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	GPIO47_STUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	/* UHC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	GPIO88_USBH1_PWR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	GPIO89_USBH1_PEN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	/* LCD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	GPIOxx_LCD_TFT_16BPP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	/* PWM */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	GPIO16_PWM0_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	/* I2C */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	GPIO117_I2C_SCL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	GPIO118_I2C_SDA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	/* LED */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	GPIO54_GPIO,	/* LED A */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	GPIO55_GPIO,	/* LED B */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) static mfp_cfg_t income_pin_config[] __initdata = {};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #endif
^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)  * Pin configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	/* Ethernet */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	GPIO78_nCS_2,	/* Ethernet CS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	GPIO114_GPIO,	/* Ethernet IRQ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	/* AC97 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	GPIO28_AC97_BITCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	GPIO29_AC97_SDATA_IN_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	GPIO30_AC97_SDATA_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	GPIO31_AC97_SYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	GPIO95_AC97_nRESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	GPIO98_AC97_SYSCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	GPIO113_GPIO,	/* Touchscreen IRQ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  * NOR Flash
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) static struct mtd_partition colibri_partitions[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		.name =		"Bootloader",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		.offset =	0x00000000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		.size =		0x00040000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		.mask_flags =	MTD_WRITEABLE	/* force read-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	}, {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		.name =		"Kernel",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		.offset =	0x00040000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		.size =		0x00400000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		.mask_flags =	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	}, {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		.name =		"Rootfs",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		.offset =	0x00440000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		.size =		MTDPART_SIZ_FULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		.mask_flags =	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) static struct physmap_flash_data colibri_flash_data[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		.width		= 4,			/* bankwidth in bytes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 		.parts		= colibri_partitions,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 		.nr_parts	= ARRAY_SIZE(colibri_partitions)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) static struct resource colibri_pxa270_flash_resource = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	.start	= PXA_CS0_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	.end	= PXA_CS0_PHYS + SZ_32M - 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	.flags	= IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) static struct platform_device colibri_pxa270_flash_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	.name	= "physmap-flash",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	.id	= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	.dev 	= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		.platform_data = colibri_flash_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	.resource = &colibri_pxa270_flash_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	.num_resources = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) static void __init colibri_pxa270_nor_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	platform_device_register(&colibri_pxa270_flash_device);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) static inline void colibri_pxa270_nor_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)  * Ethernet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) static struct resource colibri_pxa270_dm9000_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		.start	= PXA_CS2_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 		.end	= PXA_CS2_PHYS + 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		.flags	= IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 		.start	= PXA_CS2_PHYS + 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 		.end	= PXA_CS2_PHYS + 4 + 500,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		.flags	= IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 		.start	= PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		.end	= PXA_GPIO_TO_IRQ(GPIO114_COLIBRI_PXA270_ETH_IRQ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) static struct platform_device colibri_pxa270_dm9000_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	.name		= "dm9000",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	.id		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	.num_resources	= ARRAY_SIZE(colibri_pxa270_dm9000_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	.resource	= colibri_pxa270_dm9000_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) static void __init colibri_pxa270_eth_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	platform_device_register(&colibri_pxa270_dm9000_device);
^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_pxa270_eth_init(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) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)  * Audio and Touchscreen
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) #if	defined(CONFIG_TOUCHSCREEN_UCB1400) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) static pxa2xx_audio_ops_t colibri_pxa270_ac97_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	.reset_gpio	= 95,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) static struct ucb1400_pdata colibri_pxa270_ucb1400_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	.irq		= PXA_GPIO_TO_IRQ(GPIO113_COLIBRI_PXA270_TS_IRQ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) static struct platform_device colibri_pxa270_ucb1400_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	.name		= "ucb1400_core",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	.id		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 		.platform_data = &colibri_pxa270_ucb1400_pdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) static void __init colibri_pxa270_tsc_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	pxa_set_ac97_info(&colibri_pxa270_ac97_pdata);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	platform_device_register(&colibri_pxa270_ucb1400_device);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) static inline void colibri_pxa270_tsc_init(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) static int colibri_pxa270_baseboard;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) core_param(colibri_pxa270_baseboard, colibri_pxa270_baseboard, int, 0444);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) static void __init colibri_pxa270_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 	colibri_pxa270_nor_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	colibri_pxa270_eth_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	colibri_pxa270_tsc_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 	switch (colibri_pxa270_baseboard) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	case COLIBRI_EVALBOARD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 		pxa2xx_mfp_config(ARRAY_AND_SIZE(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 			colibri_pxa270_evalboard_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 		colibri_evalboard_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 	case COLIBRI_PXA270_INCOME:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 		pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 		colibri_pxa270_income_boardinit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 		printk(KERN_ERR "Illegal colibri_pxa270_baseboard type %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 				colibri_pxa270_baseboard);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	regulator_has_full_constraints();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) /* The "Income s.r.o. SH-Dmaster PXA270 SBC" board can be booted either
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)  * with the INCOME mach type or with COLIBRI and the kernel parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)  * "colibri_pxa270_baseboard=1"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) static void __init colibri_pxa270_income_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 	colibri_pxa270_baseboard = COLIBRI_PXA270_INCOME;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 	colibri_pxa270_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 	.atag_offset	= 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 	.init_machine	= colibri_pxa270_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 	.map_io		= pxa27x_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	.nr_irqs	= PXA_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	.init_irq	= pxa27x_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 	.handle_irq	= pxa27x_handle_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	.init_time	= pxa_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 	.restart	= pxa_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) MACHINE_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 	.atag_offset	= 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 	.init_machine	= colibri_pxa270_income_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 	.map_io		= pxa27x_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 	.nr_irqs	= PXA_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	.init_irq	= pxa27x_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 	.handle_irq	= pxa27x_handle_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	.init_time	= pxa_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 	.restart	= pxa_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) MACHINE_END
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330)