1 // SPDX-License-Identifier: GPL-2.0
3 * linux/arch/sh/boards/se/7721/setup.c
5 * Copyright (C) 2008 Renesas Solutions Corp.
7 * Hitachi UL SolutionEngine 7721 Support.
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <mach-se/mach/se7721.h>
12 #include <mach-se/mach/mrshpc.h>
13 #include <asm/machvec.h>
15 #include <asm/heartbeat.h>
17 static unsigned char heartbeat_bit_pos
[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
19 static struct heartbeat_data heartbeat_data
= {
20 .bit_pos
= heartbeat_bit_pos
,
21 .nr_bits
= ARRAY_SIZE(heartbeat_bit_pos
),
24 static struct resource heartbeat_resource
= {
27 .flags
= IORESOURCE_MEM
| IORESOURCE_MEM_16BIT
,
30 static struct platform_device heartbeat_device
= {
34 .platform_data
= &heartbeat_data
,
37 .resource
= &heartbeat_resource
,
40 static struct resource cf_ide_resources
[] = {
42 .start
= PA_MRSHPC_IO
+ 0x1f0,
43 .end
= PA_MRSHPC_IO
+ 0x1f0 + 8 ,
44 .flags
= IORESOURCE_IO
,
47 .start
= PA_MRSHPC_IO
+ 0x1f0 + 0x206,
48 .end
= PA_MRSHPC_IO
+ 0x1f0 + 8 + 0x206 + 8,
49 .flags
= IORESOURCE_IO
,
53 .flags
= IORESOURCE_IRQ
,
57 static struct platform_device cf_ide_device
= {
58 .name
= "pata_platform",
60 .num_resources
= ARRAY_SIZE(cf_ide_resources
),
61 .resource
= cf_ide_resources
,
64 static struct platform_device
*se7721_devices
[] __initdata
= {
69 static int __init
se7721_devices_setup(void)
71 mrshpc_setup_windows();
72 return platform_add_devices(se7721_devices
, ARRAY_SIZE(se7721_devices
));
74 device_initcall(se7721_devices_setup
);
76 static void __init
se7721_setup(char **cmdline_p
)
79 __raw_writew(0x0000, 0xA405010C); /* PGCR */
80 __raw_writew(0x0000, 0xA405010E); /* PHCR */
81 __raw_writew(0x00AA, 0xA4050118); /* PPCR */
82 __raw_writew(0x0000, 0xA4050124); /* PSELA */
88 struct sh_machine_vector mv_se7721 __initmv
= {
89 .mv_name
= "Solution Engine 7721",
90 .mv_setup
= se7721_setup
,
91 .mv_init_irq
= init_se7721_IRQ
,