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)  *  Support for Cogent CSB726
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Copyright (c) 2008 Dmitry Eremin-Solenikov
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/gpio/machine.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/mtd/physmap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/mtd/partitions.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/sm501.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/smsc911x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/platform_data/i2c-pxa.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 <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include "csb726.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include "pxa27x.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/platform_data/mmc-pxamci.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/platform_data/usb-ohci-pxa27x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <mach/audio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include <mach/smemc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include "generic.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) #include "devices.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * n/a: 2, 5, 6, 7, 8, 23, 24, 25, 26, 27, 87, 88, 89,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * nu: 58 -- 77, 90, 91, 93, 102, 105-108, 114-116,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * XXX: 21,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  * XXX: 79 CS_3 for LAN9215 or PSKTSEL on R2, R3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * XXX: 33 CS_5 for LAN9215 on R1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) static unsigned long csb726_pin_config[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	GPIO78_nCS_2, /* EXP_CS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	GPIO79_nCS_3, /* SMSC9215 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	GPIO80_nCS_4, /* SM501 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	GPIO52_GPIO, /* #SMSC9251 int */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	GPIO53_GPIO, /* SM501 int */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	GPIO1_GPIO, /* GPIO0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	GPIO11_GPIO, /* GPIO1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	GPIO9_GPIO, /* GPIO2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	GPIO10_GPIO, /* GPIO3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	GPIO16_PWM0_OUT, /* or GPIO4 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	GPIO17_PWM1_OUT, /* or GPIO5 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	GPIO94_GPIO, /* GPIO6 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	GPIO95_GPIO, /* GPIO7 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	GPIO96_GPIO, /* GPIO8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	GPIO97_GPIO, /* GPIO9 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	GPIO15_GPIO, /* EXP_IRQ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	GPIO18_RDY, /* EXP_WAIT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	GPIO0_GPIO, /* PWR_INT */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	GPIO104_GPIO, /* PWR_OFF */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	GPIO12_GPIO, /* touch irq */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	GPIO13_SSP2_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	GPIO14_SSP2_SFRM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	MFP_CFG_OUT(GPIO19, AF1, DRIVE_LOW),/* SSP2_SYSCLK */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	GPIO22_SSP2_SCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	GPIO81_SSP3_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	GPIO82_SSP3_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	GPIO83_SSP3_SFRM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	GPIO84_SSP3_SCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	GPIO20_GPIO, /* SDIO int */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	GPIO32_MMC_CLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	GPIO92_MMC_DAT_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	GPIO109_MMC_DAT_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	GPIO110_MMC_DAT_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	GPIO111_MMC_DAT_3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	GPIO112_MMC_CMD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	GPIO100_GPIO, /* SD CD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	GPIO101_GPIO, /* SD WP */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	GPIO28_AC97_BITCLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	GPIO29_AC97_SDATA_IN_0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	GPIO30_AC97_SDATA_OUT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	GPIO31_AC97_SYNC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	GPIO113_AC97_nRESET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	GPIO34_FFUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	GPIO35_FFUART_CTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	GPIO36_FFUART_DCD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	GPIO37_FFUART_DSR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	GPIO38_FFUART_RI,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	GPIO39_FFUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	GPIO40_FFUART_DTR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	GPIO41_FFUART_RTS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	GPIO42_BTUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	GPIO43_BTUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	GPIO44_BTUART_CTS,
^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) 	GPIO46_STUART_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	GPIO47_STUART_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	GPIO48_nPOE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	GPIO49_nPWE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	GPIO50_nPIOR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	GPIO51_nPIOW,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	GPIO54_nPCE_2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	GPIO55_nPREG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	GPIO56_nPWAIT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	GPIO57_nIOIS16, /* maybe unused */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	GPIO85_nPCE_1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	GPIO98_GPIO, /* CF IRQ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	GPIO99_GPIO, /* CF CD */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	GPIO103_GPIO, /* Reset */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	GPIO117_I2C_SCL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	GPIO118_I2C_SDA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) static struct pxamci_platform_data csb726_mci = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	.detect_delay_ms	= 500,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	.ocr_mask		= MMC_VDD_32_33|MMC_VDD_33_34,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	/* FIXME setpower */
^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) static struct gpiod_lookup_table csb726_mci_gpio_table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	.dev_id = "pxa2xx-mci.0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	.table = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		/* Card detect on GPIO 100 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		GPIO_LOOKUP("gpio-pxa", CSB726_GPIO_MMC_DETECT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 			    "cd", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		/* Write protect on GPIO 101 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		GPIO_LOOKUP("gpio-pxa", CSB726_GPIO_MMC_RO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 			    "wp", GPIO_ACTIVE_LOW),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		{ },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static struct pxaohci_platform_data csb726_ohci_platform_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	.port_mode	= PMM_NPS_MODE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	.flags		= ENABLE_PORT1 | NO_OC_PROTECTION,
^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) static struct mtd_partition csb726_flash_partitions[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		.name		= "Bootloader",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		.offset		= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		.size		= CSB726_FLASH_uMON,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		.mask_flags	= MTD_WRITEABLE  /* force read-only */
^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) 		.name		= "root",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		.offset		= MTDPART_OFS_APPEND,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		.size		= MTDPART_SIZ_FULL,
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) static struct physmap_flash_data csb726_flash_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	.width		= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	.parts		= csb726_flash_partitions,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	.nr_parts	= ARRAY_SIZE(csb726_flash_partitions),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) static struct resource csb726_flash_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 		.start          = PXA_CS0_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		.end            = PXA_CS0_PHYS + CSB726_FLASH_SIZE - 1 ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		.flags          = IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) static struct platform_device csb726_flash = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	.name           = "physmap-flash",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	.dev            = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		.platform_data  = &csb726_flash_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	.resource       = csb726_flash_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	.num_resources  = ARRAY_SIZE(csb726_flash_resources),
^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 resource csb726_sm501_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		.start          = PXA_CS4_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		.end            = PXA_CS4_PHYS + SZ_8M - 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		.flags          = IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		.name		= "sm501-localmem",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		.start          = PXA_CS4_PHYS + SZ_64M - SZ_2M,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		.end            = PXA_CS4_PHYS + SZ_64M - 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		.flags          = IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		.name		= "sm501-regs",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		.start		= CSB726_IRQ_SM501,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		.end		= CSB726_IRQ_SM501,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		.flags		= IORESOURCE_IRQ,
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) static struct sm501_initdata csb726_sm501_initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) /*	.devices	= SM501_USE_USB_HOST, */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	.devices	= SM501_USE_USB_HOST | SM501_USE_UART0 | SM501_USE_UART1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) static struct sm501_platdata csb726_sm501_platdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	.init		= &csb726_sm501_initdata,
^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) static struct platform_device csb726_sm501 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	.name		= "sm501",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	.id		= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	.num_resources	= ARRAY_SIZE(csb726_sm501_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	.resource	= csb726_sm501_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		.platform_data = &csb726_sm501_platdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	},
^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) static struct resource csb726_lan_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		.start	= PXA_CS3_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		.end	= PXA_CS3_PHYS + SZ_64K - 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 		.flags	= IORESOURCE_MEM,
^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) 		.start	= CSB726_IRQ_LAN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 		.end	= CSB726_IRQ_LAN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) struct smsc911x_platform_config csb726_lan_config = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	.irq_type	= SMSC911X_IRQ_TYPE_PUSH_PULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	.flags		= SMSC911X_USE_32BIT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	.phy_interface	= PHY_INTERFACE_MODE_MII,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) static struct platform_device csb726_lan = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	.name		= "smsc911x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 	.id		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	.num_resources	= ARRAY_SIZE(csb726_lan_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	.resource	= csb726_lan_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 		.platform_data	= &csb726_lan_config,
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) static struct platform_device *devices[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	&csb726_flash,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	&csb726_sm501,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	&csb726_lan,
^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 csb726_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) /*	__raw_writel(0x7ffc3ffc, MSC1); *//* LAN9215/EXP_CS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) /*	__raw_writel(0x06697ff4, MSC2); *//* none/SM501 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	__raw_writel((__raw_readl(MSC2) & ~0xffff) | 0x7ff4, MSC2); /* SM501 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	pxa_set_ffuart_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	pxa_set_btuart_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 	pxa_set_stuart_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 	pxa_set_i2c_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 	pxa27x_set_i2c_power_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	gpiod_add_lookup_table(&csb726_mci_gpio_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	pxa_set_mci_info(&csb726_mci);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 	pxa_set_ohci_info(&csb726_ohci_platform_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	pxa_set_ac97_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	platform_add_devices(devices, ARRAY_SIZE(devices));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) MACHINE_START(CSB726, "Cogent CSB726")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	.atag_offset	= 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	.map_io         = pxa27x_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	.nr_irqs	= PXA_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 	.init_irq       = pxa27x_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 	.handle_irq       = pxa27x_handle_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 	.init_machine   = csb726_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 	.init_time	= pxa_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 	.restart	= pxa_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) MACHINE_END