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
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * RSK+SH7264 Support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (C) 2012 Renesas Electronics Europe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/smsc911x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <asm/machvec.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <asm/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) static struct smsc911x_platform_config smsc911x_config = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 	.phy_interface	= PHY_INTERFACE_MODE_MII,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 	.irq_polarity	= SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 	.irq_type	= SMSC911X_IRQ_TYPE_OPEN_DRAIN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 	.flags		= SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) static struct resource smsc911x_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	[0] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 		.start		= 0x28000000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 		.end		= 0x280000ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 		.flags		= IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	[1] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 		.start		= 65,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 		.end		= 65,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 		.flags		= IORESOURCE_IRQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) static struct platform_device smsc911x_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	.name		= "smsc911x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	.id		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	.num_resources	= ARRAY_SIZE(smsc911x_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	.resource	= smsc911x_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 		.platform_data = &smsc911x_config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) static struct platform_device *rsk7264_devices[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	&smsc911x_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) static int __init rsk7264_devices_setup(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	return platform_add_devices(rsk7264_devices,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 				    ARRAY_SIZE(rsk7264_devices));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) device_initcall(rsk7264_devices_setup);