diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2009-11-17 04:06:48 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2010-02-27 12:31:09 -0500 |
commit | 80614e5ab1458ff3ccced4d6ba2fa386575c8d5c (patch) | |
tree | e34007d1ce2abb0c8c451764107973909798cac3 /arch/m68k/mac/config.c | |
parent | ec9cbe09899e36b5f216c3232215520dcf0320ab (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.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index e6666a30f24b..c8a4c39cef56 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -792,6 +792,32 @@ static struct mac_model mac_data_table[] = { | |||
792 | } | 792 | } |
793 | }; | 793 | }; |
794 | 794 | ||
795 | static struct resource scc_a_rsrcs[] = { | ||
796 | { .flags = IORESOURCE_MEM }, | ||
797 | { .flags = IORESOURCE_IRQ }, | ||
798 | }; | ||
799 | |||
800 | static struct resource scc_b_rsrcs[] = { | ||
801 | { .flags = IORESOURCE_MEM }, | ||
802 | { .flags = IORESOURCE_IRQ }, | ||
803 | }; | ||
804 | |||
805 | struct platform_device scc_a_pdev = { | ||
806 | .name = "scc", | ||
807 | .id = 0, | ||
808 | .num_resources = ARRAY_SIZE(scc_a_rsrcs), | ||
809 | .resource = scc_a_rsrcs, | ||
810 | }; | ||
811 | EXPORT_SYMBOL(scc_a_pdev); | ||
812 | |||
813 | struct platform_device scc_b_pdev = { | ||
814 | .name = "scc", | ||
815 | .id = 1, | ||
816 | .num_resources = ARRAY_SIZE(scc_b_rsrcs), | ||
817 | .resource = scc_b_rsrcs, | ||
818 | }; | ||
819 | EXPORT_SYMBOL(scc_b_pdev); | ||
820 | |||
795 | static void __init mac_identify(void) | 821 | static void __init mac_identify(void) |
796 | { | 822 | { |
797 | struct mac_model *m; | 823 | struct mac_model *m; |
@@ -814,6 +840,24 @@ static void __init mac_identify(void) | |||
814 | } | 840 | } |
815 | } | 841 | } |
816 | 842 | ||
843 | /* Set up serial port resources for the console initcall. */ | ||
844 | |||
845 | scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2; | ||
846 | scc_a_rsrcs[0].end = scc_a_rsrcs[0].start; | ||
847 | scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase; | ||
848 | scc_b_rsrcs[0].end = scc_b_rsrcs[0].start; | ||
849 | |||
850 | switch (macintosh_config->scc_type) { | ||
851 | case MAC_SCC_PSC: | ||
852 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A; | ||
853 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; | ||
854 | break; | ||
855 | default: | ||
856 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; | ||
857 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; | ||
858 | break; | ||
859 | } | ||
860 | |||
817 | /* | 861 | /* |
818 | * We need to pre-init the IOPs, if any. Otherwise | 862 | * We need to pre-init the IOPs, if any. Otherwise |
819 | * the serial console won't work if the user had | 863 | * the serial console won't work if the user had |
@@ -872,6 +916,13 @@ int __init mac_platform_init(void) | |||
872 | u8 *swim_base; | 916 | u8 *swim_base; |
873 | 917 | ||
874 | /* | 918 | /* |
919 | * Serial devices | ||
920 | */ | ||
921 | |||
922 | platform_device_register(&scc_a_pdev); | ||
923 | platform_device_register(&scc_b_pdev); | ||
924 | |||
925 | /* | ||
875 | * Floppy device | 926 | * Floppy device |
876 | */ | 927 | */ |
877 | 928 | ||