Skip to content

Commit

Permalink
mac68k: replace mac68k SCC code with platform device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Finn Thain authored and Geert Uytterhoeven committed Feb 27, 2010
1 parent ec9cbe0 commit 80614e5
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 522 deletions.
6 changes: 1 addition & 5 deletions arch/m68k/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,6 @@ config GVPIOEXT_PLIP
Say Y to enable doing IP over the parallel port on your GVP
IO-Extender card, N otherwise.

config MAC_SCC
tristate "Macintosh serial support"
depends on MAC

config MAC_HID
bool
depends on INPUT_ADBHID
Expand Down Expand Up @@ -595,7 +591,7 @@ config DN_SERIAL

config SERIAL_CONSOLE
bool "Support for serial port console"
depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL)
---help---
If you say Y here, it will be possible to use a serial port as the
system console (the system console is the device which receives all
Expand Down
2 changes: 0 additions & 2 deletions arch/m68k/configs/mac_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,7 @@ CONFIG_HIDRAW=y
#
# Character devices
#
CONFIG_MAC_SCC=y
CONFIG_MAC_HID=y
CONFIG_SERIAL_CONSOLE=y

#
# File systems
Expand Down
1 change: 0 additions & 1 deletion arch/m68k/configs/multi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,6 @@ CONFIG_ATARI_MIDI=y
CONFIG_ATARI_DSP56K=m
CONFIG_AMIGA_BUILTIN_SERIAL=y
CONFIG_MULTIFACE_III_TTY=m
CONFIG_MAC_SCC=y
CONFIG_MAC_HID=y
CONFIG_MVME147_SCC=y
CONFIG_SERIAL167=y
Expand Down
25 changes: 0 additions & 25 deletions arch/m68k/include/asm/machw.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,4 @@
#define VIDEOMEMSIZE (4096*1024)
#define VIDEOMEMMASK (-4096*1024)

#ifndef __ASSEMBLY__

#include <linux/types.h>

#if 0
/*
** SCC Z8530
*/

#define MAC_SCC_BAS (0x50F04000)
struct MAC_SCC
{
u_char cha_a_ctrl;
u_char char_dummy1;
u_char cha_a_data;
u_char char_dummy2;
u_char cha_b_ctrl;
u_char char_dummy3;
u_char cha_b_data;
};
# define mac_scc ((*(volatile struct SCC*)MAC_SCC_BAS))
#endif

#endif /* __ASSEMBLY__ */

#endif /* linux/machw.h */
22 changes: 5 additions & 17 deletions arch/m68k/include/asm/macints.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#define VIA1_SOURCE_BASE 8
#define VIA2_SOURCE_BASE 16
#define MAC_SCC_SOURCE_BASE 24
#define PSC3_SOURCE_BASE 24
#define PSC4_SOURCE_BASE 32
#define PSC5_SOURCE_BASE 40
Expand Down Expand Up @@ -96,26 +95,12 @@
#define IRQ_PSC3_2 (26)
#define IRQ_PSC3_3 (27)

/* Level 4 (SCC) interrupts */
#define IRQ_SCC (32)
#define IRQ_SCCA (33)
#define IRQ_SCCB (34)
#if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */
/* SCC interrupts */
#define IRQ_SCCB_TX (32)
#define IRQ_SCCB_STAT (33)
#define IRQ_SCCB_RX (34)
#define IRQ_SCCB_SPCOND (35)
#define IRQ_SCCA_TX (36)
#define IRQ_SCCA_STAT (37)
#define IRQ_SCCA_RX (38)
#define IRQ_SCCA_SPCOND (39)
#endif

/* Level 4 (PSC, AV Macs only) interrupts */
#define IRQ_PSC4_0 (32)
#define IRQ_PSC4_1 (33)
#define IRQ_MAC_SCC_A IRQ_PSC4_1
#define IRQ_PSC4_2 (34)
#define IRQ_MAC_SCC_B IRQ_PSC4_2
#define IRQ_PSC4_3 (35)
#define IRQ_MAC_MACE_DMA IRQ_PSC4_3

Expand Down Expand Up @@ -146,6 +131,9 @@
#define IRQ_BABOON_2 (66)
#define IRQ_BABOON_3 (67)

/* On non-PSC machines, the serial ports share an IRQ */
#define IRQ_MAC_SCC IRQ_AUTO_4

#define SLOT2IRQ(x) (x + 47)
#define IRQ2SLOT(x) (x - 47)

Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/mac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#

obj-y := config.o macints.o iop.o via.o oss.o psc.o \
baboon.o macboing.o debug.o misc.o
baboon.o macboing.o misc.o
51 changes: 51 additions & 0 deletions arch/m68k/mac/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -871,6 +915,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
*/
Expand Down
Loading

0 comments on commit 80614e5

Please sign in to comment.