summaryrefslogtreecommitdiffstats
path: root/arch/m68k/mac/config.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2009-11-17 20:06:48 +1100
committerGeert Uytterhoeven <geert@linux-m68k.org>2010-02-27 18:31:09 +0100
commit80614e5ab1458ff3ccced4d6ba2fa386575c8d5c (patch)
treee34007d1ce2abb0c8c451764107973909798cac3 /arch/m68k/mac/config.c
parentec9cbe09899e36b5f216c3232215520dcf0320ab (diff)
mac68k: replace mac68k SCC code with platform device
Remove the old 68k Mac serial port code and a lot of related cruft. Add new SCC platform devices to mac 68k platform. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/mac/config.c')
-rw-r--r--arch/m68k/mac/config.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index e6666a30f24..c8a4c39cef5 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -792,6 +792,32 @@ static struct mac_model mac_data_table[] = {
}
};
+static struct resource scc_a_rsrcs[] = {
+ { .flags = IORESOURCE_MEM },
+ { .flags = IORESOURCE_IRQ },
+};
+
+static struct resource scc_b_rsrcs[] = {
+ { .flags = IORESOURCE_MEM },
+ { .flags = IORESOURCE_IRQ },
+};
+
+struct platform_device scc_a_pdev = {
+ .name = "scc",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(scc_a_rsrcs),
+ .resource = scc_a_rsrcs,
+};
+EXPORT_SYMBOL(scc_a_pdev);
+
+struct platform_device scc_b_pdev = {
+ .name = "scc",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(scc_b_rsrcs),
+ .resource = scc_b_rsrcs,
+};
+EXPORT_SYMBOL(scc_b_pdev);
+
static void __init mac_identify(void)
{
struct mac_model *m;
@@ -814,6 +840,24 @@ static void __init mac_identify(void)
}
}
+ /* Set up serial port resources for the console initcall. */
+
+ scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
+ scc_a_rsrcs[0].end = scc_a_rsrcs[0].start;
+ scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
+ scc_b_rsrcs[0].end = scc_b_rsrcs[0].start;
+
+ switch (macintosh_config->scc_type) {
+ case MAC_SCC_PSC:
+ scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A;
+ scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B;
+ break;
+ default:
+ scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC;
+ scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC;
+ break;
+ }
+
/*
* We need to pre-init the IOPs, if any. Otherwise
* the serial console won't work if the user had
@@ -872,6 +916,13 @@ int __init mac_platform_init(void)
u8 *swim_base;
/*
+ * Serial devices
+ */
+
+ platform_device_register(&scc_a_pdev);
+ platform_device_register(&scc_b_pdev);
+
+ /*
* Floppy device
*/