Commit aead951d authored by Finn Thain's avatar Finn Thain Committed by Kelsey Skunberg

m68k: mac: Fix IOP status/control register writes

BugLink: https://bugs.launchpad.net/bugs/1892822

[ Upstream commit 931fc82a ]

When writing values to the IOP status/control register make sure those
values do not have any extraneous bits that will clear interrupt flags.

To place the SCC IOP into bypass mode would be desirable but this is not
achieved by writing IOP_DMAINACTIVE | IOP_RUN | IOP_AUTOINC | IOP_BYPASS
to the control register. Drop this ineffective register write.

Remove the flawed and unused iop_bypass() function. Make use of the
unused iop_stop() function.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Cc: Joshua Thompson <funaho@jurai.org>
Link: https://lore.kernel.org/r/09bcb7359a1719a18b551ee515da3c4c3cf709e6.1590880333.git.fthain@telegraphics.com.auSigned-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 7a41b74b
...@@ -173,7 +173,7 @@ static __inline__ void iop_writeb(volatile struct mac_iop *iop, __u16 addr, __u8 ...@@ -173,7 +173,7 @@ static __inline__ void iop_writeb(volatile struct mac_iop *iop, __u16 addr, __u8
static __inline__ void iop_stop(volatile struct mac_iop *iop) static __inline__ void iop_stop(volatile struct mac_iop *iop)
{ {
iop->status_ctrl &= ~IOP_RUN; iop->status_ctrl = IOP_AUTOINC;
} }
static __inline__ void iop_start(volatile struct mac_iop *iop) static __inline__ void iop_start(volatile struct mac_iop *iop)
...@@ -181,14 +181,9 @@ static __inline__ void iop_start(volatile struct mac_iop *iop) ...@@ -181,14 +181,9 @@ static __inline__ void iop_start(volatile struct mac_iop *iop)
iop->status_ctrl = IOP_RUN | IOP_AUTOINC; iop->status_ctrl = IOP_RUN | IOP_AUTOINC;
} }
static __inline__ void iop_bypass(volatile struct mac_iop *iop)
{
iop->status_ctrl |= IOP_BYPASS;
}
static __inline__ void iop_interrupt(volatile struct mac_iop *iop) static __inline__ void iop_interrupt(volatile struct mac_iop *iop)
{ {
iop->status_ctrl |= IOP_IRQ; iop->status_ctrl = IOP_IRQ | IOP_RUN | IOP_AUTOINC;
} }
static int iop_alive(volatile struct mac_iop *iop) static int iop_alive(volatile struct mac_iop *iop)
...@@ -239,7 +234,6 @@ void __init iop_preinit(void) ...@@ -239,7 +234,6 @@ void __init iop_preinit(void)
} else { } else {
iop_base[IOP_NUM_SCC] = (struct mac_iop *) SCC_IOP_BASE_QUADRA; iop_base[IOP_NUM_SCC] = (struct mac_iop *) SCC_IOP_BASE_QUADRA;
} }
iop_base[IOP_NUM_SCC]->status_ctrl = 0x87;
iop_scc_present = 1; iop_scc_present = 1;
} else { } else {
iop_base[IOP_NUM_SCC] = NULL; iop_base[IOP_NUM_SCC] = NULL;
...@@ -251,7 +245,7 @@ void __init iop_preinit(void) ...@@ -251,7 +245,7 @@ void __init iop_preinit(void)
} else { } else {
iop_base[IOP_NUM_ISM] = (struct mac_iop *) ISM_IOP_BASE_QUADRA; iop_base[IOP_NUM_ISM] = (struct mac_iop *) ISM_IOP_BASE_QUADRA;
} }
iop_base[IOP_NUM_ISM]->status_ctrl = 0; iop_stop(iop_base[IOP_NUM_ISM]);
iop_ism_present = 1; iop_ism_present = 1;
} else { } else {
iop_base[IOP_NUM_ISM] = NULL; iop_base[IOP_NUM_ISM] = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment