xref: /openbmc/linux/arch/arm/mach-footbridge/isa.c (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds  *  linux/arch/arm/mach-footbridge/isa.c
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  *  Copyright (C) 2004 Russell King.
61da177e4SLinus Torvalds  */
71da177e4SLinus Torvalds #include <linux/init.h>
81da177e4SLinus Torvalds #include <linux/serial_8250.h>
91da177e4SLinus Torvalds 
101da177e4SLinus Torvalds #include <asm/irq.h>
11382b4480SRussell King #include <asm/hardware/dec21285.h>
12382b4480SRussell King 
13382b4480SRussell King #include "common.h"
141da177e4SLinus Torvalds 
15cba774aeSRussell King static struct resource rtc_resources[] = {
16cba774aeSRussell King 	[0] = {
17cba774aeSRussell King 		.start	= 0x70,
18cba774aeSRussell King 		.end	= 0x73,
19cba774aeSRussell King 		.flags	= IORESOURCE_IO,
20cba774aeSRussell King 	},
21cba774aeSRussell King 	[1] = {
22cba774aeSRussell King 		.start	= IRQ_ISA_RTC_ALARM,
23cba774aeSRussell King 		.end	= IRQ_ISA_RTC_ALARM,
24cba774aeSRussell King 		.flags	= IORESOURCE_IRQ,
25cba774aeSRussell King 	}
26cba774aeSRussell King };
27cba774aeSRussell King 
28cba774aeSRussell King static struct platform_device rtc_device = {
29cba774aeSRussell King 	.name		= "rtc_cmos",
30cba774aeSRussell King 	.id		= -1,
31cba774aeSRussell King 	.resource	= rtc_resources,
32cba774aeSRussell King 	.num_resources	= ARRAY_SIZE(rtc_resources),
33cba774aeSRussell King };
34cba774aeSRussell King 
35cba774aeSRussell King static struct resource serial_resources[] = {
36cba774aeSRussell King 	[0] = {
37cba774aeSRussell King 		.start	= 0x3f8,
38cba774aeSRussell King 		.end	= 0x3ff,
39cba774aeSRussell King 		.flags	= IORESOURCE_IO,
40cba774aeSRussell King 	},
41cba774aeSRussell King 	[1] = {
42cba774aeSRussell King 		.start	= 0x2f8,
43cba774aeSRussell King 		.end	= 0x2ff,
44cba774aeSRussell King 		.flags	= IORESOURCE_IO,
45cba774aeSRussell King 	},
46cba774aeSRussell King };
47cba774aeSRussell King 
481da177e4SLinus Torvalds static struct plat_serial8250_port serial_platform_data[] = {
491da177e4SLinus Torvalds 	{
501da177e4SLinus Torvalds 		.iobase		= 0x3f8,
511da177e4SLinus Torvalds 		.irq		= IRQ_ISA_UART,
521da177e4SLinus Torvalds 		.uartclk	= 1843200,
531da177e4SLinus Torvalds 		.regshift	= 0,
541da177e4SLinus Torvalds 		.iotype		= UPIO_PORT,
551da177e4SLinus Torvalds 		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
561da177e4SLinus Torvalds 	},
571da177e4SLinus Torvalds 	{
581da177e4SLinus Torvalds 		.iobase		= 0x2f8,
591da177e4SLinus Torvalds 		.irq		= IRQ_ISA_UART2,
601da177e4SLinus Torvalds 		.uartclk	= 1843200,
611da177e4SLinus Torvalds 		.regshift	= 0,
621da177e4SLinus Torvalds 		.iotype		= UPIO_PORT,
631da177e4SLinus Torvalds 		.flags		= UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
641da177e4SLinus Torvalds 	},
651da177e4SLinus Torvalds 	{ },
661da177e4SLinus Torvalds };
671da177e4SLinus Torvalds 
681da177e4SLinus Torvalds static struct platform_device serial_device = {
691da177e4SLinus Torvalds 	.name			= "serial8250",
706df29debSRussell King 	.id			= PLAT8250_DEV_PLATFORM,
711da177e4SLinus Torvalds 	.dev			= {
721da177e4SLinus Torvalds 		.platform_data	= serial_platform_data,
731da177e4SLinus Torvalds 	},
74cba774aeSRussell King 	.resource		= serial_resources,
75cba774aeSRussell King 	.num_resources		= ARRAY_SIZE(serial_resources),
761da177e4SLinus Torvalds };
771da177e4SLinus Torvalds 
footbridge_isa_init(void)781da177e4SLinus Torvalds static int __init footbridge_isa_init(void)
791da177e4SLinus Torvalds {
80382b4480SRussell King 	int err = 0;
81cba774aeSRussell King 
82382b4480SRussell King 	/* Personal server doesn't have RTC */
83382b4480SRussell King 	isa_rtc_init();
84cba774aeSRussell King 	err = platform_device_register(&rtc_device);
85cba774aeSRussell King 	if (err)
86cba774aeSRussell King 		printk(KERN_ERR "Unable to register RTC device: %d\n", err);
87*b6dd8284SArnd Bergmann 
88cba774aeSRussell King 	err = platform_device_register(&serial_device);
89cba774aeSRussell King 	if (err)
90cba774aeSRussell King 		printk(KERN_ERR "Unable to register serial device: %d\n", err);
91cba774aeSRussell King 	return 0;
921da177e4SLinus Torvalds }
931da177e4SLinus Torvalds 
941da177e4SLinus Torvalds arch_initcall(footbridge_isa_init);
95