Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3f03b7d9
Commit
3f03b7d9
authored
Jan 13, 2003
by
Greg Ungerer
Committed by
Linus Torvalds
Jan 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] remove obsolete code from comempci.c
parent
d50f4996
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
248 deletions
+0
-248
arch/m68knommu/kernel/comempci.c
arch/m68knommu/kernel/comempci.c
+0
-248
No files found.
arch/m68knommu/kernel/comempci.c
View file @
3f03b7d9
...
...
@@ -338,254 +338,6 @@ unsigned long pcibios_fixup(unsigned long mem_start, unsigned long mem_end)
/*****************************************************************************/
int
pcibios_present
(
void
)
{
return
(
pci_bus_is_present
);
}
/*****************************************************************************/
int
pcibios_read_config_dword
(
unsigned
char
bus
,
unsigned
char
dev
,
unsigned
char
offset
,
unsigned
int
*
val
)
{
volatile
unsigned
long
*
rp
;
unsigned
long
idsel
,
fnsel
;
#ifdef DEBUGPCI
printk
(
"pcibios_read_config_dword(bus=%x,dev=%x,offset=%x,val=%x)
\n
"
,
bus
,
dev
,
offset
,
val
);
#endif
if
(
bus
||
((
pci_slotmask
&
(
0x1
<<
PCI_SLOT
(
dev
)))
==
0
))
{
*
val
=
0xffffffff
;
return
(
PCIBIOS_SUCCESSFUL
);
}
rp
=
(
volatile
unsigned
long
*
)
COMEM_BASE
;
idsel
=
COMEM_DA_CFGRD
|
COMEM_DA_ADDR
(
0x1
<<
((
dev
>>
3
)
+
16
));
fnsel
=
(
dev
&
0x7
)
<<
8
;
rp
[
LREG
(
COMEM_DAHBASE
)]
=
idsel
;
*
val
=
rp
[
LREG
(
COMEM_PCIBUS
+
(
offset
&
0xfc
)
+
fnsel
)];
#if 1
/* If we get back what we wrote, then nothing there */
/* This is pretty dodgy, but, hey, what else do we do?? */
if
(
!
offset
&&
(
*
val
==
((
idsel
&
0xfffff000
)
|
(
offset
&
0x00000fff
))))
*
val
=
0xffffffff
;
#endif
return
(
PCIBIOS_SUCCESSFUL
);
}
/*****************************************************************************/
int
pcibios_read_config_word
(
unsigned
char
bus
,
unsigned
char
dev
,
unsigned
char
offset
,
unsigned
short
*
val
)
{
volatile
unsigned
long
*
rp
;
volatile
unsigned
short
*
bp
;
unsigned
long
idsel
,
fnsel
;
unsigned
char
swapoffset
;
#ifdef DEBUGPCI
printk
(
"pcibios_read_config_word(bus=%x,dev=%x,offset=%x)
\n
"
,
bus
,
dev
,
offset
);
#endif
if
(
bus
||
((
pci_slotmask
&
(
0x1
<<
PCI_SLOT
(
dev
)))
==
0
))
{
*
val
=
0xffff
;
return
(
PCIBIOS_SUCCESSFUL
);
}
rp
=
(
volatile
unsigned
long
*
)
COMEM_BASE
;
bp
=
(
volatile
unsigned
short
*
)
COMEM_BASE
;
idsel
=
COMEM_DA_CFGRD
|
COMEM_DA_ADDR
(
0x1
<<
((
dev
>>
3
)
+
16
));
fnsel
=
(
dev
&
0x7
)
<<
8
;
swapoffset
=
(
offset
&
0xfc
)
+
(
~
offset
&
0x02
);
rp
[
LREG
(
COMEM_DAHBASE
)]
=
idsel
;
*
val
=
bp
[
WREG
(
COMEM_PCIBUS
+
swapoffset
+
fnsel
)];
return
(
PCIBIOS_SUCCESSFUL
);
}
/*****************************************************************************/
int
pcibios_read_config_byte
(
unsigned
char
bus
,
unsigned
char
dev
,
unsigned
char
offset
,
unsigned
char
*
val
)
{
volatile
unsigned
long
*
rp
;
volatile
unsigned
char
*
bp
;
unsigned
long
idsel
,
fnsel
;
unsigned
char
swapoffset
;
#ifdef DEBUGPCI
printk
(
"pcibios_read_config_byte(bus=%x,dev=%x,offset=%x)
\n
"
,
bus
,
dev
,
offset
);
#endif
if
(
bus
||
((
pci_slotmask
&
(
0x1
<<
PCI_SLOT
(
dev
)))
==
0
))
{
*
val
=
0xff
;
return
(
PCIBIOS_SUCCESSFUL
);
}
rp
=
(
volatile
unsigned
long
*
)
COMEM_BASE
;
bp
=
(
volatile
unsigned
char
*
)
COMEM_BASE
;
idsel
=
COMEM_DA_CFGRD
|
COMEM_DA_ADDR
(
0x1
<<
((
dev
>>
3
)
+
16
));
fnsel
=
(
dev
&
0x7
)
<<
8
;
swapoffset
=
(
offset
&
0xfc
)
+
(
~
offset
&
0x03
);
rp
[
LREG
(
COMEM_DAHBASE
)]
=
idsel
;
*
val
=
bp
[(
COMEM_PCIBUS
+
swapoffset
+
fnsel
)];
return
(
PCIBIOS_SUCCESSFUL
);
}
/*****************************************************************************/
int
pcibios_write_config_dword
(
unsigned
char
bus
,
unsigned
char
dev
,
unsigned
char
offset
,
unsigned
int
val
)
{
volatile
unsigned
long
*
rp
;
unsigned
long
idsel
,
fnsel
;
#ifdef DEBUGPCI
printk
(
"pcibios_write_config_dword(bus=%x,dev=%x,offset=%x,val=%x)
\n
"
,
bus
,
dev
,
offset
,
val
);
#endif
if
(
bus
||
((
pci_slotmask
&
(
0x1
<<
PCI_SLOT
(
dev
)))
==
0
))
return
(
PCIBIOS_SUCCESSFUL
);
rp
=
(
volatile
unsigned
long
*
)
COMEM_BASE
;
idsel
=
COMEM_DA_CFGRD
|
COMEM_DA_ADDR
(
0x1
<<
((
dev
>>
3
)
+
16
));
fnsel
=
(
dev
&
0x7
)
<<
8
;
rp
[
LREG
(
COMEM_DAHBASE
)]
=
idsel
;
rp
[
LREG
(
COMEM_PCIBUS
+
(
offset
&
0xfc
)
+
fnsel
)]
=
val
;
return
(
PCIBIOS_SUCCESSFUL
);
}
/*****************************************************************************/
int
pcibios_write_config_word
(
unsigned
char
bus
,
unsigned
char
dev
,
unsigned
char
offset
,
unsigned
short
val
)
{
volatile
unsigned
long
*
rp
;
volatile
unsigned
short
*
bp
;
unsigned
long
idsel
,
fnsel
;
unsigned
char
swapoffset
;
#ifdef DEBUGPCI
printk
(
"pcibios_write_config_word(bus=%x,dev=%x,offset=%x,val=%x)
\n
"
,
bus
,
dev
,
offset
,
val
);
#endif
if
(
bus
||
((
pci_slotmask
&
(
0x1
<<
PCI_SLOT
(
dev
)))
==
0
))
return
(
PCIBIOS_SUCCESSFUL
);
rp
=
(
volatile
unsigned
long
*
)
COMEM_BASE
;
bp
=
(
volatile
unsigned
short
*
)
COMEM_BASE
;
idsel
=
COMEM_DA_CFGRD
|
COMEM_DA_ADDR
(
0x1
<<
((
dev
>>
3
)
+
16
));
fnsel
=
(
dev
&
0x7
)
<<
8
;
swapoffset
=
(
offset
&
0xfc
)
+
(
~
offset
&
0x02
);
rp
[
LREG
(
COMEM_DAHBASE
)]
=
idsel
;
bp
[
WREG
(
COMEM_PCIBUS
+
swapoffset
+
fnsel
)]
=
val
;
return
(
PCIBIOS_SUCCESSFUL
);
}
/*****************************************************************************/
int
pcibios_write_config_byte
(
unsigned
char
bus
,
unsigned
char
dev
,
unsigned
char
offset
,
unsigned
char
val
)
{
volatile
unsigned
long
*
rp
;
volatile
unsigned
char
*
bp
;
unsigned
long
idsel
,
fnsel
;
unsigned
char
swapoffset
;
#ifdef DEBUGPCI
printk
(
"pcibios_write_config_byte(bus=%x,dev=%x,offset=%x,val=%x)
\n
"
,
bus
,
dev
,
offset
,
val
);
#endif
if
(
bus
||
((
pci_slotmask
&
(
0x1
<<
PCI_SLOT
(
dev
)))
==
0
))
return
(
PCIBIOS_SUCCESSFUL
);
rp
=
(
volatile
unsigned
long
*
)
COMEM_BASE
;
bp
=
(
volatile
unsigned
char
*
)
COMEM_BASE
;
idsel
=
COMEM_DA_CFGRD
|
COMEM_DA_ADDR
(
0x1
<<
((
dev
>>
3
)
+
16
));
fnsel
=
(
dev
&
0x7
)
<<
8
;
swapoffset
=
(
offset
&
0xfc
)
+
(
~
offset
&
0x03
);
rp
[
LREG
(
COMEM_DAHBASE
)]
=
idsel
;
bp
[(
COMEM_PCIBUS
+
swapoffset
+
fnsel
)]
=
val
;
return
(
PCIBIOS_SUCCESSFUL
);
}
/*****************************************************************************/
int
pcibios_find_device
(
unsigned
short
vendor
,
unsigned
short
devid
,
unsigned
short
index
,
unsigned
char
*
bus
,
unsigned
char
*
dev
)
{
unsigned
int
vendev
,
val
;
unsigned
char
devnr
;
#ifdef DEBUGPCI
printk
(
"pcibios_find_device(vendor=%04x,devid=%04x,index=%d)
\n
"
,
vendor
,
devid
,
index
);
#endif
if
(
vendor
==
0xffff
)
return
(
PCIBIOS_BAD_VENDOR_ID
);
vendev
=
(
devid
<<
16
)
|
vendor
;
for
(
devnr
=
0
;
(
devnr
<
32
);
devnr
++
)
{
pcibios_read_config_dword
(
0
,
devnr
,
PCI_VENDOR_ID
,
&
val
);
if
(
vendev
==
val
)
{
if
(
index
--
==
0
)
{
*
bus
=
0
;
*
dev
=
devnr
;
return
(
PCIBIOS_SUCCESSFUL
);
}
}
}
return
(
PCIBIOS_DEVICE_NOT_FOUND
);
}
/*****************************************************************************/
int
pcibios_find_class
(
unsigned
int
class
,
unsigned
short
index
,
unsigned
char
*
bus
,
unsigned
char
*
dev
)
{
unsigned
int
val
;
unsigned
char
devnr
;
#ifdef DEBUGPCI
printk
(
"pcibios_find_class(class=%04x,index=%d)
\n
"
,
class
,
index
);
#endif
/* FIXME: this ignores multi-function devices... */
for
(
devnr
=
0
;
(
devnr
<
128
);
devnr
+=
8
)
{
pcibios_read_config_dword
(
0
,
devnr
,
PCI_CLASS_REVISION
,
&
val
);
if
((
val
>>
8
)
==
class
)
{
if
(
index
--
==
0
)
{
*
bus
=
0
;
*
dev
=
devnr
;
return
(
PCIBIOS_SUCCESSFUL
);
}
}
}
return
(
PCIBIOS_DEVICE_NOT_FOUND
);
}
/*****************************************************************************/
/*
* Local routines to interrcept the standard I/O and vector handling
* code. Don't include this 'till now - initialization code above needs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment