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)  * Renesas Technology Europe RSK+ Support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (C) 2008 Paul Mundt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * Copyright (C) 2008 Peter Griffin <pgriffin@mpc-data.co.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  */
^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/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/platform_device.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/mtd/mtd.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/mtd/physmap.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/mtd/map.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/regulator/fixed.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/regulator/machine.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <asm/machvec.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <asm/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /* Dummy supplies, where voltage doesn't matter */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) static struct regulator_consumer_supply dummy_supplies[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	REGULATOR_SUPPLY("vddvario", "smsc911x"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	REGULATOR_SUPPLY("vdd33a", "smsc911x"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) static struct mtd_partition rsk_partitions[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 		.name		= "Bootloader",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 		.offset		= 0x00000000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 		.size		= 0x00040000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 		.mask_flags	= MTD_WRITEABLE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	}, {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 		.name		= "Kernel",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 		.offset		= MTDPART_OFS_NXTBLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 		.size		= 0x001c0000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	}, {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 		.name		= "Flash_FS",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 		.offset		= MTDPART_OFS_NXTBLK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 		.size		= MTDPART_SIZ_FULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) static struct physmap_flash_data flash_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	.parts			= rsk_partitions,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	.nr_parts		= ARRAY_SIZE(rsk_partitions),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	.width			= 2,
^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 struct resource flash_resource = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	.start		= 0x20000000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	.end		= 0x20400000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 	.flags		= IORESOURCE_MEM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) static struct platform_device flash_device = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	.name		= "physmap-flash",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	.id		= -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	.resource	= &flash_resource,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 	.num_resources	= 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 	.dev		= {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 		.platform_data = &flash_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) static struct platform_device *rsk_devices[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 	&flash_device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) static int __init rsk_devices_setup(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 	regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) 	return platform_add_devices(rsk_devices,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 				    ARRAY_SIZE(rsk_devices));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) device_initcall(rsk_devices_setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)  * The Machine Vector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) static struct sh_machine_vector mv_rsk __initmv = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) 	.mv_name        = "RSK+",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) };