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)  * linux/arch/sh/boards/lbox/setup.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (C) 2007 Nobuhiro Iwamatsu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * NTT COMWARE L-BOX RE2 Support
^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/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/ata_platform.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/addrspace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <mach/lboxre2.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <asm/io.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static struct resource cf_ide_resources[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 	[0] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 		.start  = 0x1f0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 		.end    = 0x1f0 + 8 ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 		.flags  = IORESOURCE_IO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	[1] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 		.start  = 0x1f0 + 0x206,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 		.end    = 0x1f0 +8 + 0x206 + 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 		.flags  = IORESOURCE_IO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	[2] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 		.start  = IRQ_CF0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 		.flags  = IORESOURCE_IRQ,
^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) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) static struct platform_device cf_ide_device  = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	.name           = "pata_platform",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	.id             = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	.num_resources  = ARRAY_SIZE(cf_ide_resources),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	.resource       = cf_ide_resources,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) static struct platform_device *lboxre2_devices[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)        &cf_ide_device,
^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 int __init lboxre2_devices_setup(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 	u32 cf0_io_base;	/* Boot CF base address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 	pgprot_t prot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	unsigned long paddrbase, psize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	/* open I/O area window */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 	paddrbase = virt_to_phys((void*)PA_AREA5_IO);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	psize = PAGE_SIZE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 	prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 	cf0_io_base = (u32)ioremap_prot(paddrbase, psize, pgprot_val(prot));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	if (!cf0_io_base) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 		printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 	cf_ide_resources[0].start += cf0_io_base ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	cf_ide_resources[0].end   += cf0_io_base ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 	cf_ide_resources[1].start += cf0_io_base ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 	cf_ide_resources[1].end   += cf0_io_base ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 	return platform_add_devices(lboxre2_devices,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 			ARRAY_SIZE(lboxre2_devices));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) device_initcall(lboxre2_devices_setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)  * The Machine Vector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) static struct sh_machine_vector mv_lboxre2 __initmv = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) 	.mv_name		= "L-BOX RE2",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) 	.mv_init_irq		= init_lboxre2_IRQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) };