Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161691993
D24661.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D24661.diff
View Options
Index: head/sys/dev/ic/z8530.h
===================================================================
--- head/sys/dev/ic/z8530.h
+++ head/sys/dev/ic/z8530.h
@@ -32,15 +32,14 @@
#define _DEV_IC_Z8530_H_
/*
- * Channel B control: 0
- * Channel B data: 1
- * Channel A control: 2
- * Channel A data: 3
+ * legacy: SUN compatible
+ * escc: Macintosh
+ * legacy escc
+ * Channel B control: 0 0
+ * Channel B data: 1 1
+ * Channel A control: 2 16
+ * Channel A data: 3 17
*/
-
-/* The following apply when using a device-scoped bus handle */
-#define CHAN_A 2
-#define CHAN_B 0
#define REG_CTRL 0
#define REG_DATA 1
Index: head/sys/dev/scc/scc_bfe.h
===================================================================
--- head/sys/dev/scc/scc_bfe.h
+++ head/sys/dev/scc/scc_bfe.h
@@ -114,7 +114,8 @@
extern struct scc_class scc_quicc_class;
extern struct scc_class scc_sab82532_class;
-extern struct scc_class scc_z8530_class;
+extern struct scc_class scc_z8530_escc_class;
+extern struct scc_class scc_z8530_legacy_class;
struct scc_softc {
KOBJ_FIELDS;
Index: head/sys/dev/scc/scc_bfe_macio.c
===================================================================
--- head/sys/dev/scc/scc_bfe_macio.c
+++ head/sys/dev/scc/scc_bfe_macio.c
@@ -55,9 +55,10 @@
sc = device_get_softc(dev);
nm = ofw_bus_get_name(dev);
+ /* Attach to modern escc (channel shift 4 bits) */
if (!strcmp(nm, "escc")) {
device_set_desc(dev, "Zilog Z8530 dual channel SCC");
- sc->sc_class = &scc_z8530_class;
+ sc->sc_class = &scc_z8530_escc_class;
return (scc_bfe_probe(dev, MACIO_REGSHFT, MACIO_RCLK, 0));
}
return (ENXIO);
Index: head/sys/dev/scc/scc_dev_z8530.c
===================================================================
--- head/sys/dev/scc/scc_dev_z8530.c
+++ head/sys/dev/scc/scc_dev_z8530.c
@@ -51,6 +51,10 @@
static int z8530_bfe_ipend(struct scc_softc *);
static int z8530_bfe_probe(struct scc_softc *);
+/* Channel B is always at 0 offset. */
+#define CHAN_A (-(sc->sc_class->cl_range))
+#define CHAN_B 0
+
static kobj_method_t z8530_methods[] = {
KOBJMETHOD(scc_attach, z8530_bfe_attach),
KOBJMETHOD(scc_iclear, z8530_bfe_iclear),
@@ -59,14 +63,32 @@
KOBJMETHOD_END
};
-struct scc_class scc_z8530_class = {
- "z8530 class",
+/*
+ * escc (macio) spacing.
+ */
+struct scc_class scc_z8530_escc_class = {
+ "z8530 escc class",
z8530_methods,
sizeof(struct scc_softc),
.cl_channels = 2,
.cl_class = SCC_CLASS_Z8530,
.cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
- .cl_range = CHAN_B - CHAN_A,
+ /* Negative .cl_range signifies this is channel spacing. */
+ .cl_range = (CHAN_B - 16),
+};
+
+/*
+ * SUN compatible channel spacing.
+ */
+struct scc_class scc_z8530_legacy_class = {
+ "z8530 legacy class",
+ z8530_methods,
+ sizeof(struct scc_softc),
+ .cl_channels = 2,
+ .cl_class = SCC_CLASS_Z8530,
+ .cl_modes = SCC_MODE_ASYNC | SCC_MODE_BISYNC | SCC_MODE_HDLC,
+ /* Negative .cl_range signifies this is channel spacing. */
+ .cl_range = (CHAN_B - 2),
};
/* Multiplexed I/O. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jul 7, 12:04 AM (5 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34774268
Default Alt Text
D24661.diff (2 KB)
Attached To
Mode
D24661: [PowerPC] Fix scc z8530 driver
Attached
Detach File
Event Timeline
Log In to Comment