License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2008-07-28 05:00:59 +08:00
|
|
|
/* asm/floppy.h: Sparc specific parts of the Floppy driver.
|
2008-07-18 12:55:51 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 1995 David S. Miller (davem@davemloft.net)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ASM_SPARC_FLOPPY_H
|
|
|
|
#define __ASM_SPARC_FLOPPY_H
|
|
|
|
|
2008-08-27 19:05:35 +08:00
|
|
|
#include <linux/of.h>
|
|
|
|
#include <linux/of_device.h>
|
|
|
|
|
2008-07-18 12:55:51 +08:00
|
|
|
#include <asm/pgtable.h>
|
|
|
|
#include <asm/idprom.h>
|
|
|
|
#include <asm/oplib.h>
|
|
|
|
#include <asm/auxio.h>
|
2014-04-22 03:39:24 +08:00
|
|
|
#include <asm/setup.h>
|
|
|
|
#include <asm/page.h>
|
2008-07-18 12:55:51 +08:00
|
|
|
#include <asm/irq.h>
|
|
|
|
|
|
|
|
/* We don't need no stinkin' I/O port allocation crap. */
|
|
|
|
#undef release_region
|
|
|
|
#undef request_region
|
|
|
|
#define release_region(X, Y) do { } while(0)
|
|
|
|
#define request_region(X, Y, Z) (1)
|
|
|
|
|
|
|
|
/* References:
|
|
|
|
* 1) Netbsd Sun floppy driver.
|
|
|
|
* 2) NCR 82077 controller manual
|
|
|
|
* 3) Intel 82077 controller manual
|
|
|
|
*/
|
|
|
|
struct sun_flpy_controller {
|
|
|
|
volatile unsigned char status_82072; /* Main Status reg. */
|
|
|
|
#define dcr_82072 status_82072 /* Digital Control reg. */
|
|
|
|
#define status1_82077 status_82072 /* Auxiliary Status reg. 1 */
|
|
|
|
|
|
|
|
volatile unsigned char data_82072; /* Data fifo. */
|
|
|
|
#define status2_82077 data_82072 /* Auxiliary Status reg. 2 */
|
|
|
|
|
|
|
|
volatile unsigned char dor_82077; /* Digital Output reg. */
|
|
|
|
volatile unsigned char tapectl_82077; /* What the? Tape control reg? */
|
|
|
|
|
|
|
|
volatile unsigned char status_82077; /* Main Status Register. */
|
|
|
|
#define drs_82077 status_82077 /* Digital Rate Select reg. */
|
|
|
|
|
|
|
|
volatile unsigned char data_82077; /* Data fifo. */
|
|
|
|
volatile unsigned char ___unused;
|
|
|
|
volatile unsigned char dir_82077; /* Digital Input reg. */
|
|
|
|
#define dcr_82077 dir_82077 /* Config Control reg. */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* You'll only ever find one controller on a SparcStation anyways. */
|
|
|
|
static struct sun_flpy_controller *sun_fdc = NULL;
|
|
|
|
|
|
|
|
struct sun_floppy_ops {
|
|
|
|
unsigned char (*fd_inb)(int port);
|
|
|
|
void (*fd_outb)(unsigned char value, int port);
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct sun_floppy_ops sun_fdops;
|
|
|
|
|
|
|
|
#define fd_inb(port) sun_fdops.fd_inb(port)
|
|
|
|
#define fd_outb(value,port) sun_fdops.fd_outb(value,port)
|
|
|
|
#define fd_enable_dma() sun_fd_enable_dma()
|
|
|
|
#define fd_disable_dma() sun_fd_disable_dma()
|
|
|
|
#define fd_request_dma() (0) /* nothing... */
|
|
|
|
#define fd_free_dma() /* nothing... */
|
|
|
|
#define fd_clear_dma_ff() /* nothing... */
|
|
|
|
#define fd_set_dma_mode(mode) sun_fd_set_dma_mode(mode)
|
|
|
|
#define fd_set_dma_addr(addr) sun_fd_set_dma_addr(addr)
|
|
|
|
#define fd_set_dma_count(count) sun_fd_set_dma_count(count)
|
|
|
|
#define fd_enable_irq() /* nothing... */
|
|
|
|
#define fd_disable_irq() /* nothing... */
|
|
|
|
#define fd_request_irq() sun_fd_request_irq()
|
|
|
|
#define fd_free_irq() /* nothing... */
|
|
|
|
#if 0 /* P3: added by Alain, these cause a MMU corruption. 19960524 XXX */
|
|
|
|
#define fd_dma_mem_alloc(size) ((unsigned long) vmalloc(size))
|
|
|
|
#define fd_dma_mem_free(addr,size) (vfree((void *)(addr)))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* XXX This isn't really correct. XXX */
|
|
|
|
#define get_dma_residue(x) (0)
|
|
|
|
|
|
|
|
#define FLOPPY0_TYPE 4
|
|
|
|
#define FLOPPY1_TYPE 0
|
|
|
|
|
|
|
|
/* Super paranoid... */
|
|
|
|
#undef HAVE_DISABLE_HLT
|
|
|
|
|
|
|
|
/* Here is where we catch the floppy driver trying to initialize,
|
|
|
|
* therefore this is where we call the PROM device tree probing
|
|
|
|
* routine etc. on the Sparc.
|
|
|
|
*/
|
|
|
|
#define FDC1 sun_floppy_init()
|
|
|
|
|
|
|
|
#define N_FDC 1
|
|
|
|
#define N_DRIVE 8
|
|
|
|
|
|
|
|
/* No 64k boundary crossing problems on the Sparc. */
|
|
|
|
#define CROSS_64KB(a,s) (0)
|
|
|
|
|
|
|
|
/* Routines unique to each controller type on a Sun. */
|
|
|
|
static void sun_set_dor(unsigned char value, int fdc_82077)
|
|
|
|
{
|
2012-05-12 12:39:48 +08:00
|
|
|
if (fdc_82077)
|
2008-07-18 12:55:51 +08:00
|
|
|
sun_fdc->dor_82077 = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned char sun_read_dir(void)
|
|
|
|
{
|
2012-05-12 12:39:48 +08:00
|
|
|
return sun_fdc->dir_82077;
|
2008-07-18 12:55:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned char sun_82072_fd_inb(int port)
|
|
|
|
{
|
|
|
|
udelay(5);
|
|
|
|
switch(port & 7) {
|
|
|
|
default:
|
|
|
|
printk("floppy: Asked to read unknown port %d\n", port);
|
|
|
|
panic("floppy: Port bolixed.");
|
|
|
|
case 4: /* FD_STATUS */
|
|
|
|
return sun_fdc->status_82072 & ~STATUS_DMA;
|
|
|
|
case 5: /* FD_DATA */
|
|
|
|
return sun_fdc->data_82072;
|
|
|
|
case 7: /* FD_DIR */
|
|
|
|
return sun_read_dir();
|
2011-06-03 22:45:23 +08:00
|
|
|
}
|
2008-07-18 12:55:51 +08:00
|
|
|
panic("sun_82072_fd_inb: How did I get here?");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sun_82072_fd_outb(unsigned char value, int port)
|
|
|
|
{
|
|
|
|
udelay(5);
|
|
|
|
switch(port & 7) {
|
|
|
|
default:
|
|
|
|
printk("floppy: Asked to write to unknown port %d\n", port);
|
|
|
|
panic("floppy: Port bolixed.");
|
|
|
|
case 2: /* FD_DOR */
|
|
|
|
sun_set_dor(value, 0);
|
|
|
|
break;
|
|
|
|
case 5: /* FD_DATA */
|
|
|
|
sun_fdc->data_82072 = value;
|
|
|
|
break;
|
|
|
|
case 7: /* FD_DCR */
|
|
|
|
sun_fdc->dcr_82072 = value;
|
|
|
|
break;
|
|
|
|
case 4: /* FD_STATUS */
|
|
|
|
sun_fdc->status_82072 = value;
|
|
|
|
break;
|
2011-06-03 22:45:23 +08:00
|
|
|
}
|
2008-07-18 12:55:51 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned char sun_82077_fd_inb(int port)
|
|
|
|
{
|
|
|
|
udelay(5);
|
|
|
|
switch(port & 7) {
|
|
|
|
default:
|
|
|
|
printk("floppy: Asked to read unknown port %d\n", port);
|
|
|
|
panic("floppy: Port bolixed.");
|
|
|
|
case 0: /* FD_STATUS_0 */
|
|
|
|
return sun_fdc->status1_82077;
|
|
|
|
case 1: /* FD_STATUS_1 */
|
|
|
|
return sun_fdc->status2_82077;
|
|
|
|
case 2: /* FD_DOR */
|
|
|
|
return sun_fdc->dor_82077;
|
|
|
|
case 3: /* FD_TDR */
|
|
|
|
return sun_fdc->tapectl_82077;
|
|
|
|
case 4: /* FD_STATUS */
|
|
|
|
return sun_fdc->status_82077 & ~STATUS_DMA;
|
|
|
|
case 5: /* FD_DATA */
|
|
|
|
return sun_fdc->data_82077;
|
|
|
|
case 7: /* FD_DIR */
|
|
|
|
return sun_read_dir();
|
2011-06-03 22:45:23 +08:00
|
|
|
}
|
2008-07-18 12:55:51 +08:00
|
|
|
panic("sun_82077_fd_inb: How did I get here?");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sun_82077_fd_outb(unsigned char value, int port)
|
|
|
|
{
|
|
|
|
udelay(5);
|
|
|
|
switch(port & 7) {
|
|
|
|
default:
|
|
|
|
printk("floppy: Asked to write to unknown port %d\n", port);
|
|
|
|
panic("floppy: Port bolixed.");
|
|
|
|
case 2: /* FD_DOR */
|
|
|
|
sun_set_dor(value, 1);
|
|
|
|
break;
|
|
|
|
case 5: /* FD_DATA */
|
|
|
|
sun_fdc->data_82077 = value;
|
|
|
|
break;
|
|
|
|
case 7: /* FD_DCR */
|
|
|
|
sun_fdc->dcr_82077 = value;
|
|
|
|
break;
|
|
|
|
case 4: /* FD_STATUS */
|
|
|
|
sun_fdc->status_82077 = value;
|
|
|
|
break;
|
|
|
|
case 3: /* FD_TDR */
|
|
|
|
sun_fdc->tapectl_82077 = value;
|
|
|
|
break;
|
2011-06-03 22:45:23 +08:00
|
|
|
}
|
2008-07-18 12:55:51 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* For pseudo-dma (Sun floppy drives have no real DMA available to
|
|
|
|
* them so we must eat the data fifo bytes directly ourselves) we have
|
|
|
|
* three state variables. doing_pdma tells our inline low-level
|
|
|
|
* assembly floppy interrupt entry point whether it should sit and eat
|
|
|
|
* bytes from the fifo or just transfer control up to the higher level
|
|
|
|
* floppy interrupt c-code. I tried very hard but I could not get the
|
|
|
|
* pseudo-dma to work in c-code without getting many overruns and
|
|
|
|
* underruns. If non-zero, doing_pdma encodes the direction of
|
|
|
|
* the transfer for debugging. 1=read 2=write
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Common routines to all controller types on the Sparc. */
|
|
|
|
static inline void virtual_dma_init(void)
|
|
|
|
{
|
|
|
|
/* nothing... */
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sun_fd_disable_dma(void)
|
|
|
|
{
|
|
|
|
doing_pdma = 0;
|
2012-05-14 04:23:16 +08:00
|
|
|
pdma_base = NULL;
|
2008-07-18 12:55:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sun_fd_set_dma_mode(int mode)
|
|
|
|
{
|
|
|
|
switch(mode) {
|
|
|
|
case DMA_MODE_READ:
|
|
|
|
doing_pdma = 1;
|
|
|
|
break;
|
|
|
|
case DMA_MODE_WRITE:
|
|
|
|
doing_pdma = 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printk("Unknown dma mode %d\n", mode);
|
|
|
|
panic("floppy: Giving up...");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sun_fd_set_dma_addr(char *buffer)
|
|
|
|
{
|
|
|
|
pdma_vaddr = buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sun_fd_set_dma_count(int length)
|
|
|
|
{
|
|
|
|
pdma_size = length;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sun_fd_enable_dma(void)
|
|
|
|
{
|
|
|
|
pdma_base = pdma_vaddr;
|
|
|
|
pdma_areasize = pdma_size;
|
|
|
|
}
|
|
|
|
|
2014-05-17 05:25:50 +08:00
|
|
|
int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler);
|
2008-07-18 12:55:51 +08:00
|
|
|
|
|
|
|
static int sun_fd_request_irq(void)
|
|
|
|
{
|
|
|
|
static int once = 0;
|
|
|
|
|
2011-04-18 19:25:44 +08:00
|
|
|
if (!once) {
|
2008-07-18 12:55:51 +08:00
|
|
|
once = 1;
|
2011-04-18 19:25:44 +08:00
|
|
|
return sparc_floppy_request_irq(FLOPPY_IRQ, floppy_interrupt);
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
2008-07-18 12:55:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct linux_prom_registers fd_regs[2];
|
|
|
|
|
|
|
|
static int sun_floppy_init(void)
|
|
|
|
{
|
2011-04-18 19:25:44 +08:00
|
|
|
struct platform_device *op;
|
|
|
|
struct device_node *dp;
|
2012-05-12 16:04:10 +08:00
|
|
|
struct resource r;
|
2008-07-18 12:55:51 +08:00
|
|
|
char state[128];
|
2012-05-12 16:04:10 +08:00
|
|
|
phandle fd_node;
|
|
|
|
phandle tnode;
|
2010-10-09 05:18:11 +08:00
|
|
|
int num_regs;
|
2008-07-18 12:55:51 +08:00
|
|
|
|
|
|
|
use_virtual_dma = 1;
|
|
|
|
|
|
|
|
/* Forget it if we aren't on a machine that could possibly
|
|
|
|
* ever have a floppy drive.
|
|
|
|
*/
|
2012-05-12 11:45:18 +08:00
|
|
|
if (sparc_cpu_model != sun4m) {
|
2008-07-18 12:55:51 +08:00
|
|
|
/* We certainly don't have a floppy controller. */
|
|
|
|
goto no_sun_fdc;
|
|
|
|
}
|
|
|
|
/* Well, try to find one. */
|
|
|
|
tnode = prom_getchild(prom_root_node);
|
|
|
|
fd_node = prom_searchsiblings(tnode, "obio");
|
2012-05-12 16:04:10 +08:00
|
|
|
if (fd_node != 0) {
|
2008-07-18 12:55:51 +08:00
|
|
|
tnode = prom_getchild(fd_node);
|
|
|
|
fd_node = prom_searchsiblings(tnode, "SUNW,fdtwo");
|
|
|
|
} else {
|
|
|
|
fd_node = prom_searchsiblings(tnode, "fd");
|
|
|
|
}
|
2012-05-12 16:04:10 +08:00
|
|
|
if (fd_node == 0) {
|
2008-07-18 12:55:51 +08:00
|
|
|
goto no_sun_fdc;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The sun4m lets us know if the controller is actually usable. */
|
2012-05-12 16:04:10 +08:00
|
|
|
if (prom_getproperty(fd_node, "status", state, sizeof(state)) != -1) {
|
2008-07-18 12:55:51 +08:00
|
|
|
if(!strcmp(state, "disabled")) {
|
|
|
|
goto no_sun_fdc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
num_regs = prom_getproperty(fd_node, "reg", (char *) fd_regs, sizeof(fd_regs));
|
|
|
|
num_regs = (num_regs / sizeof(fd_regs[0]));
|
|
|
|
prom_apply_obio_ranges(fd_regs, num_regs);
|
|
|
|
memset(&r, 0, sizeof(r));
|
|
|
|
r.flags = fd_regs[0].which_io;
|
|
|
|
r.start = fd_regs[0].phys_addr;
|
2012-05-12 16:04:10 +08:00
|
|
|
sun_fdc = of_ioremap(&r, 0, fd_regs[0].reg_size, "floppy");
|
2008-07-18 12:55:51 +08:00
|
|
|
|
2011-04-18 19:25:44 +08:00
|
|
|
/* Look up irq in platform_device.
|
|
|
|
* We try "SUNW,fdtwo" and "fd"
|
|
|
|
*/
|
2012-05-12 16:04:09 +08:00
|
|
|
op = NULL;
|
2011-04-18 19:25:44 +08:00
|
|
|
for_each_node_by_name(dp, "SUNW,fdtwo") {
|
|
|
|
op = of_find_device_by_node(dp);
|
|
|
|
if (op)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (!op) {
|
|
|
|
for_each_node_by_name(dp, "fd") {
|
|
|
|
op = of_find_device_by_node(dp);
|
|
|
|
if (op)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!op)
|
|
|
|
goto no_sun_fdc;
|
|
|
|
|
|
|
|
FLOPPY_IRQ = op->archdata.irqs[0];
|
|
|
|
|
2008-07-18 12:55:51 +08:00
|
|
|
/* Last minute sanity check... */
|
2012-05-12 16:04:10 +08:00
|
|
|
if (sun_fdc->status_82072 == 0xff) {
|
2008-07-18 12:55:51 +08:00
|
|
|
sun_fdc = NULL;
|
|
|
|
goto no_sun_fdc;
|
|
|
|
}
|
|
|
|
|
|
|
|
sun_fdops.fd_inb = sun_82077_fd_inb;
|
|
|
|
sun_fdops.fd_outb = sun_82077_fd_outb;
|
|
|
|
fdc_status = &sun_fdc->status_82077;
|
|
|
|
|
|
|
|
if (sun_fdc->dor_82077 == 0x80) {
|
|
|
|
sun_fdc->dor_82077 = 0x02;
|
|
|
|
if (sun_fdc->dor_82077 == 0x80) {
|
|
|
|
sun_fdops.fd_inb = sun_82072_fd_inb;
|
|
|
|
sun_fdops.fd_outb = sun_82072_fd_outb;
|
|
|
|
fdc_status = &sun_fdc->status_82072;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Success... */
|
|
|
|
allowed_drive_mask = 0x01;
|
|
|
|
return (int) sun_fdc;
|
|
|
|
|
|
|
|
no_sun_fdc:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sparc_eject(void)
|
|
|
|
{
|
|
|
|
set_dor(0x00, 0xff, 0x90);
|
|
|
|
udelay(500);
|
|
|
|
set_dor(0x00, 0x6f, 0x00);
|
|
|
|
udelay(500);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define fd_eject(drive) sparc_eject()
|
|
|
|
|
|
|
|
#define EXTRA_FLOPPY_PARAMS
|
|
|
|
|
2008-08-28 08:01:57 +08:00
|
|
|
static DEFINE_SPINLOCK(dma_spin_lock);
|
|
|
|
|
|
|
|
#define claim_dma_lock() \
|
|
|
|
({ unsigned long flags; \
|
|
|
|
spin_lock_irqsave(&dma_spin_lock, flags); \
|
|
|
|
flags; \
|
|
|
|
})
|
|
|
|
|
|
|
|
#define release_dma_lock(__flags) \
|
|
|
|
spin_unlock_irqrestore(&dma_spin_lock, __flags);
|
|
|
|
|
2008-07-18 12:55:51 +08:00
|
|
|
#endif /* !(__ASM_SPARC_FLOPPY_H) */
|