2004-10-27 02:04:59

by Mark Fortescue

[permalink] [raw]
Subject: PATCH for Sun4c clones with an 82077 FDC

Hi All,

I have been having trouble working out why my sun4c sparc clone could not
find the floppy drive. I was being blind as floppy.h assumes that all
sun4c machines only have an 82072 FDC. This asumption is not valid for
some clones (OPUS Personal Mainframe 5000 sun4c sparc1 clone for one).

The patch below checks to see if it is an 82072 using a simple test before
assuming that we have an 82072. It works on my clone but it needs to be
checked on a sun4c system with an 82072 FDC.

Can someone with a sun4c system that has an 82072 check it to see if it
works for them. The extra two printk messages are more for diagnostics
when the patch is being tested (via prom console). If it does not break
82072 sun4c systems then the two diagnostic messages can be removed. If it
does break the 82072 sun4c systems, then a more complicated test is
needed that does not.

Regards
Mark Fortescue.
-------------------------------------------------------------------------
##############################################################################
#
# Mark Fortescue ([email protected])
#
# Linux 2.6.8.1 Sparc Floppy Disc Controller Enhancement
# Some sun4c systems have an 82077 FDC so we must detect this
# early on or it does not get detected as it has a different
# memory map.
#
#
##############################################################################
diff -rupd ref-2.6.8.1/include/asm-sparc/floppy.h linux-2.6.8.1/include/asm-sparc/floppy.h
--- ref-2.6.8.1/include/asm-sparc/floppy.h Sat Aug 14 11:54:46 2004
+++ linux-2.6.8.1/include/asm-sparc/floppy.h Wed Oct 27 02:37:41 2004
@@ -333,12 +333,22 @@ static int sun_floppy_init(void)
goto no_sun_fdc;
}

- if(sparc_cpu_model == sun4c) {
+ /* Mark Fortescue <[email protected]>
+ * Some sun4c clones have an 80277 FDC so do a simple test.
+ * This is based on what I beleive is the test SunOS 4.1.1 does.
+ */
+ if ((sun_fdc->dor_82077 == sun_fdc->status_82072) &&
+ (sun_fdc->status_82077 == sun_fdc->status_82072) &&
+ (sparc_cpu_model == sun4c)) {
+ /* extern unsigned long auxio_register; */ /* P3 */
+
+ printk ("Sparc FDC is 82072\n");
sun_fdops.fd_inb = sun_82072_fd_inb;
sun_fdops.fd_outb = sun_82072_fd_outb;
fdc_status = &sun_fdc->status_82072;
/* printk("AUXIO @0x%lx\n", auxio_register); */ /* P3 */
} else {
+ printk ("Sparc FDC is 82077\n");
sun_fdops.fd_inb = sun_82077_fd_inb;
sun_fdops.fd_outb = sun_82077_fd_outb;
fdc_status = &sun_fdc->status_82077;
----------------------------------------------------------------------------


2004-10-27 02:27:48

by William Lee Irwin III

[permalink] [raw]
Subject: Re: PATCH for Sun4c clones with an 82077 FDC

On Wed, Oct 27, 2004 at 03:03:34AM +0100, Mark Fortescue wrote:
> I have been having trouble working out why my sun4c sparc clone could not
> find the floppy drive. I was being blind as floppy.h assumes that all
> sun4c machines only have an 82072 FDC. This asumption is not valid for
> some clones (OPUS Personal Mainframe 5000 sun4c sparc1 clone for one).
> The patch below checks to see if it is an 82072 using a simple test before
> assuming that we have an 82072. It works on my clone but it needs to be
> checked on a sun4c system with an 82072 FDC.
> Can someone with a sun4c system that has an 82072 check it to see if it
> works for them. The extra two printk messages are more for diagnostics
> when the patch is being tested (via prom console). If it does not break
> 82072 sun4c systems then the two diagnostic messages can be removed. If it
> does break the 82072 sun4c systems, then a more complicated test is
> needed that does not.

Okay, can this be done without media? I have the sun4c's, but not floppy
media. I suppose I could obtain some for the occasion.


-- wli

2004-10-27 12:07:38

by Mark Fortescue

[permalink] [raw]
Subject: Re: PATCH for Sun4c clones with an 82077 FDC

Hi William,

Yes it can. All it is trying to do is determin the type of FDC on boot.
Build up a new kernel (with prom console) and start it up with "-p
console=prom" or similar command line options so you can see the
diagnostics as the kernel starts up.

Regards
Mark Fortescue.

On Tue, 26 Oct 2004, William Lee Irwin III wrote:

> On Wed, Oct 27, 2004 at 03:03:34AM +0100, Mark Fortescue wrote:
> > I have been having trouble working out why my sun4c sparc clone could not
> > find the floppy drive. I was being blind as floppy.h assumes that all
> > sun4c machines only have an 82072 FDC. This asumption is not valid for
> > some clones (OPUS Personal Mainframe 5000 sun4c sparc1 clone for one).
> > The patch below checks to see if it is an 82072 using a simple test before
> > assuming that we have an 82072. It works on my clone but it needs to be
> > checked on a sun4c system with an 82072 FDC.
> > Can someone with a sun4c system that has an 82072 check it to see if it
> > works for them. The extra two printk messages are more for diagnostics
> > when the patch is being tested (via prom console). If it does not break
> > 82072 sun4c systems then the two diagnostic messages can be removed. If it
> > does break the 82072 sun4c systems, then a more complicated test is
> > needed that does not.
>
> Okay, can this be done without media? I have the sun4c's, but not floppy
> media. I suppose I could obtain some for the occasion.
>
>
> -- wli
>