summaryrefslogtreecommitdiff
path: root/arch/m68k/amiga/platform.c
blob: 027e4cae88ff91474e36e1c8f7f64ce4bdc6667b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
 *  Copyright (C) 2007-2009 Geert Uytterhoeven
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file COPYING in the main directory of this archive
 * for more details.
 */

#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/zorro.h>

#include <asm/amigahw.h>


#ifdef CONFIG_ZORRO

static const struct resource zorro_resources[] __initconst = {
	/* Zorro II regions (on Zorro II/III) */
	{
		.name	= "Zorro II exp",
		.start	= 0x00e80000,
		.end	= 0x00efffff,
		.flags	= IORESOURCE_MEM,
	}, {
		.name	= "Zorro II mem",
		.start	= 0x00200000,
		.end	= 0x009fffff,
		.flags	= IORESOURCE_MEM,
	},
	/* Zorro III regions (on Zorro III only) */
	{
		.name	= "Zorro III exp",
		.start	= 0xff000000,
		.end	= 0xffffffff,
		.flags	= IORESOURCE_MEM,
	}, {
		.name	= "Zorro III cfg",
		.start	= 0x40000000,
		.end	= 0x7fffffff,
		.flags	= IORESOURCE_MEM,
	}
};


static int __init amiga_init_bus(void)
{
	if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
		return -ENODEV;

	platform_device_register_simple("amiga-zorro", -1, zorro_resources,
					AMIGAHW_PRESENT(ZORRO3) ? 4 : 2);
	return 0;
}

subsys_initcall(amiga_init_bus);

#endif /* CONFIG_ZORRO */


static const struct resource a3000_scsi_resource __initconst = {
	.start	= 0xdd0000,
	.end	= 0xdd00ff,
	.flags	= IORESOURCE_MEM,
};


static const struct resource a4000t_scsi_resource __initconst = {
	.start	= 0xdd0000,
	.end	= 0xdd0fff,
	.flags	= IORESOURCE_MEM,
};


static int __init amiga_init_devices(void)
{
	if (!MACH_IS_AMIGA)
		return -ENODEV;

	/* video hardware */
	if (AMIGAHW_PRESENT(AMI_VIDEO))
		platform_device_register_simple("amiga-video", -1, NULL, 0);


	/* sound hardware */
	if (AMIGAHW_PRESENT(AMI_AUDIO))
		platform_device_register_simple("amiga-audio", -1, NULL, 0);


	/* storage interfaces */
	if (AMIGAHW_PRESENT(AMI_FLOPPY))
		platform_device_register_simple("amiga-floppy", -1, NULL, 0);

	if (AMIGAHW_PRESENT(A3000_SCSI))
		platform_device_register_simple("amiga-a3000-scsi", -1,
						&a3000_scsi_resource, 1);

	if (AMIGAHW_PRESENT(A4000_SCSI))
		platform_device_register_simple("amiga-a4000t-scsi", -1,
						&a4000t_scsi_resource, 1);

	return 0;
}

device_initcall(amiga_init_devices);