Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 //
0003 // Copyright 2007 Simtec Electronics
0004 //  http://www.simtec.co.uk/products/EB2410ITX/
0005 //  http://armlinux.simtec.co.uk/
0006 //  Ben Dooks <ben@simtec.co.uk>
0007 
0008 #include <linux/kernel.h>
0009 #include <linux/types.h>
0010 #include <linux/init.h>
0011 #include <linux/interrupt.h>
0012 
0013 #include <linux/platform_device.h>
0014 #include <linux/ata_platform.h>
0015 
0016 #include <asm/mach-types.h>
0017 
0018 #include <asm/mach/arch.h>
0019 #include <asm/mach/map.h>
0020 #include <asm/mach/irq.h>
0021 
0022 #include "map.h"
0023 #include "irqs.h"
0024 
0025 #include "bast.h"
0026 
0027 /* IDE ports */
0028 
0029 static struct pata_platform_info bast_ide_platdata = {
0030     .ioport_shift   = 5,
0031 };
0032 
0033 static struct resource bast_ide0_resource[] = {
0034     [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRI, 8 * 0x20),
0035     [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDEPRIAUX + (6 * 0x20), 0x20),
0036     [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE0),
0037 };
0038 
0039 static struct platform_device bast_device_ide0 = {
0040     .name       = "pata_platform",
0041     .id     = 0,
0042     .num_resources  = ARRAY_SIZE(bast_ide0_resource),
0043     .resource   = bast_ide0_resource,
0044     .dev        = {
0045         .platform_data = &bast_ide_platdata,
0046         .coherent_dma_mask = ~0,
0047     }
0048 
0049 };
0050 
0051 static struct resource bast_ide1_resource[] = {
0052     [0] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESEC, 8 * 0x20),
0053     [1] = DEFINE_RES_MEM(BAST_IDE_CS + BAST_PA_IDESECAUX + (6 * 0x20), 0x20),
0054     [2] = DEFINE_RES_IRQ(BAST_IRQ_IDE1),
0055 };
0056 
0057 static struct platform_device bast_device_ide1 = {
0058     .name       = "pata_platform",
0059     .id     = 1,
0060     .num_resources  = ARRAY_SIZE(bast_ide1_resource),
0061     .resource   = bast_ide1_resource,
0062     .dev        = {
0063         .platform_data = &bast_ide_platdata,
0064         .coherent_dma_mask = ~0,
0065     }
0066 };
0067 
0068 static struct platform_device *bast_ide_devices[] __initdata = {
0069     &bast_device_ide0,
0070     &bast_device_ide1,
0071 };
0072 
0073 static __init int bast_ide_init(void)
0074 {
0075     if (machine_is_bast() || machine_is_vr1000())
0076         return platform_add_devices(bast_ide_devices,
0077                         ARRAY_SIZE(bast_ide_devices));
0078 
0079     return 0;
0080 }
0081 
0082 fs_initcall(bast_ide_init);