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
Kirill Smelkov
linux
Commits
f3e488ec
Commit
f3e488ec
authored
Aug 11, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPARC: Implement pcic_present which walks OBP tree, use it always in sbus_init.
parent
cafe8464
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
10 deletions
+51
-10
arch/sparc64/kernel/pci.c
arch/sparc64/kernel/pci.c
+47
-0
drivers/sbus/sbus.c
drivers/sbus/sbus.c
+4
-10
No files found.
arch/sparc64/kernel/pci.c
View file @
f3e488ec
...
...
@@ -114,6 +114,53 @@ static void pci_controller_init(char *model_name, int namelen, int node)
printk
(
"PCI: Ignoring controller...
\n
"
);
}
static
int
pci_is_controller
(
char
*
model_name
,
int
namelen
,
int
node
)
{
int
i
;
for
(
i
=
0
;
i
<
PCI_NUM_CONTROLLER_TYPES
;
i
++
)
{
if
(
!
strncmp
(
model_name
,
pci_controller_table
[
i
].
model_name
,
namelen
))
{
return
1
;
}
}
return
0
;
}
/* Is there some PCI controller in the system? */
int
pcic_present
(
void
)
{
char
namebuf
[
16
];
int
node
;
node
=
prom_getchild
(
prom_root_node
);
while
((
node
=
prom_searchsiblings
(
node
,
"pci"
))
!=
0
)
{
int
len
,
ret
;
len
=
prom_getproperty
(
node
,
"model"
,
namebuf
,
sizeof
(
namebuf
));
ret
=
0
;
if
(
len
>
0
)
{
ret
=
pci_is_controller
(
namebuf
,
len
,
node
);
}
else
{
len
=
prom_getproperty
(
node
,
"compatible"
,
namebuf
,
sizeof
(
namebuf
));
if
(
len
>
0
)
ret
=
pci_controller_init
(
namebuf
,
len
,
node
);
}
if
(
ret
)
return
ret
;
node
=
prom_getsibling
(
node
);
if
(
!
node
)
break
;
}
return
0
;
}
/* Find each controller in the system, attach and initialize
* software state structure for each and link into the
* pci_controller_root. Setup the controller enough such
...
...
drivers/sbus/sbus.c
View file @
f3e488ec
...
...
@@ -16,14 +16,15 @@
#include <asm/oplib.h>
#include <asm/bpp.h>
#include <asm/irq.h>
#ifdef CONFIG_SPARC32
#include <asm/pcic.h>
/* pcic_present */
#endif
struct
sbus_bus
*
sbus_root
=
NULL
;
static
struct
linux_prom_irqs
irqs
[
PROMINTR_MAX
]
__initdata
=
{
{
0
}
};
#ifdef CONFIG_PCI
extern
int
pcic_present
(
void
);
#endif
/* Perhaps when I figure out more about the iommu we'll put a
* device registration routine here that probe_sbus() calls to
* setup the iommu for each Sbus.
...
...
@@ -336,17 +337,10 @@ static int __init sbus_init(void)
(
nd
=
prom_getchild
(
iommund
))
==
0
||
(
nd
=
prom_searchsiblings
(
nd
,
"sbus"
))
==
0
)
{
#ifdef CONFIG_PCI
#ifdef CONFIG_SPARC32
if
(
!
pcic_present
())
{
prom_printf
(
"Neither SBUS nor PCI found.
\n
"
);
prom_halt
();
}
#else
if
(
!
pcibios_present
())
{
prom_printf
(
"Neither SBUS nor PCI found.
\n
"
);
prom_halt
();
}
#endif
return
0
;
#else
/* No reason to run further - the data access trap will occur. */
...
...
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