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
7b6288a6
Commit
7b6288a6
authored
Jun 25, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: pci domain support
parent
79a50a32
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
38 deletions
+31
-38
arch/ppc64/kernel/pSeries_pci.c
arch/ppc64/kernel/pSeries_pci.c
+16
-14
arch/ppc64/kernel/pci.c
arch/ppc64/kernel/pci.c
+13
-0
arch/ppc64/kernel/pci.h
arch/ppc64/kernel/pci.h
+0
-8
arch/ppc64/kernel/pci_dn.c
arch/ppc64/kernel/pci_dn.c
+1
-11
include/asm-ppc64/pci.h
include/asm-ppc64/pci.h
+1
-5
No files found.
arch/ppc64/kernel/pSeries_pci.c
View file @
7b6288a6
...
@@ -295,6 +295,7 @@ struct pci_controller *alloc_phb(struct device_node *dev,
...
@@ -295,6 +295,7 @@ struct pci_controller *alloc_phb(struct device_node *dev,
int
*
buid_vals
;
int
*
buid_vals
;
char
*
model
;
char
*
model
;
enum
phb_types
phb_type
;
enum
phb_types
phb_type
;
struct
property
*
of_prop
;
model
=
(
char
*
)
get_property
(
dev
,
"model"
,
NULL
);
model
=
(
char
*
)
get_property
(
dev
,
"model"
,
NULL
);
...
@@ -341,6 +342,21 @@ struct pci_controller *alloc_phb(struct device_node *dev,
...
@@ -341,6 +342,21 @@ struct pci_controller *alloc_phb(struct device_node *dev,
return
NULL
;
return
NULL
;
}
}
of_prop
=
(
struct
property
*
)
alloc_bootmem
(
sizeof
(
struct
property
)
+
sizeof
(
phb
->
global_number
));
if
(
!
of_prop
)
{
kfree
(
phb
);
return
NULL
;
}
memset
(
of_prop
,
0
,
sizeof
(
struct
property
));
of_prop
->
name
=
"linux,pci-domain"
;
of_prop
->
length
=
sizeof
(
phb
->
global_number
);
of_prop
->
value
=
(
unsigned
char
*
)
&
of_prop
[
1
];
memcpy
(
of_prop
->
value
,
&
phb
->
global_number
,
sizeof
(
phb
->
global_number
));
prom_add_property
(
dev
,
of_prop
);
phb
->
first_busno
=
bus_range
[
0
];
phb
->
first_busno
=
bus_range
[
0
];
phb
->
last_busno
=
bus_range
[
1
];
phb
->
last_busno
=
bus_range
[
1
];
...
@@ -352,26 +368,12 @@ struct pci_controller *alloc_phb(struct device_node *dev,
...
@@ -352,26 +368,12 @@ struct pci_controller *alloc_phb(struct device_node *dev,
if
(
buid_vals
==
NULL
)
{
if
(
buid_vals
==
NULL
)
{
phb
->
buid
=
0
;
phb
->
buid
=
0
;
}
else
{
}
else
{
struct
pci_bus
check
;
if
(
sizeof
(
check
.
number
)
==
1
||
sizeof
(
check
.
primary
)
==
1
||
sizeof
(
check
.
secondary
)
==
1
||
sizeof
(
check
.
subordinate
)
==
1
)
{
udbg_printf
(
"pSeries_pci: this system has large bus numbers and the kernel was not
\n
"
"built with the patch that fixes include/linux/pci.h struct pci_bus so
\n
"
"number, primary, secondary and subordinate are ints.
\n
"
);
panic
(
"pSeries_pci: this system has large bus numbers and the kernel was not
\n
"
"built with the patch that fixes include/linux/pci.h struct pci_bus so
\n
"
"number, primary, secondary and subordinate are ints.
\n
"
);
}
if
(
len
<
2
*
sizeof
(
int
))
if
(
len
<
2
*
sizeof
(
int
))
// Support for new OF that only has 1 integer for buid.
// Support for new OF that only has 1 integer for buid.
phb
->
buid
=
(
unsigned
long
)
buid_vals
[
0
];
phb
->
buid
=
(
unsigned
long
)
buid_vals
[
0
];
else
else
phb
->
buid
=
(((
unsigned
long
)
buid_vals
[
0
])
<<
32UL
)
|
phb
->
buid
=
(((
unsigned
long
)
buid_vals
[
0
])
<<
32UL
)
|
(((
unsigned
long
)
buid_vals
[
1
])
&
0xffffffff
);
(((
unsigned
long
)
buid_vals
[
1
])
&
0xffffffff
);
phb
->
first_busno
+=
(
phb
->
global_number
<<
8
);
phb
->
last_busno
+=
(
phb
->
global_number
<<
8
);
}
}
return
phb
;
return
phb
;
...
...
arch/ppc64/kernel/pci.c
View file @
7b6288a6
...
@@ -380,6 +380,19 @@ int pci_domain_nr(struct pci_bus *bus)
...
@@ -380,6 +380,19 @@ int pci_domain_nr(struct pci_bus *bus)
return
hose
->
global_number
;
return
hose
->
global_number
;
}
}
/* Set the name of the bus as it appears in /proc/bus/pci */
int
pci_name_bus
(
char
*
name
,
struct
pci_bus
*
bus
)
{
struct
pci_controller
*
hose
=
PCI_GET_PHB_PTR
(
bus
);
if
(
hose
->
buid
)
sprintf
(
name
,
"%04x:%02x"
,
pci_domain_nr
(
bus
),
bus
->
number
);
else
sprintf
(
name
,
"%02x"
,
bus
->
number
);
return
0
;
}
/*
/*
* Platform support for /proc/bus/pci/X/Y mmap()s,
* Platform support for /proc/bus/pci/X/Y mmap()s,
* modelled on the sparc64 implementation by Dave Miller.
* modelled on the sparc64 implementation by Dave Miller.
...
...
arch/ppc64/kernel/pci.h
View file @
7b6288a6
...
@@ -42,14 +42,6 @@ void pci_devs_phb_init(void);
...
@@ -42,14 +42,6 @@ void pci_devs_phb_init(void);
void
pci_fix_bus_sysdata
(
void
);
void
pci_fix_bus_sysdata
(
void
);
struct
device_node
*
fetch_dev_dn
(
struct
pci_dev
*
dev
);
struct
device_node
*
fetch_dev_dn
(
struct
pci_dev
*
dev
);
/*******************************************************************
* Helper macros for extracting data from pci structures.
* PCI_GET_PHB_PTR(struct pci_dev*) returns the Phb pointer.
* PCI_GET_PHB_NUMBER(struct pci_dev*) returns the Phb number.
* PCI_GET_BUS_NUMBER(struct pci_dev*) returns the bus number.
*******************************************************************/
#define PCI_GET_PHB_PTR(dev) (((struct device_node *)(dev)->sysdata)->phb)
#define PCI_GET_PHB_PTR(dev) (((struct device_node *)(dev)->sysdata)->phb)
#define PCI_GET_PHB_NUMBER(dev) (((dev)->bus->number&0x00FFFF00)>>8)
#define PCI_GET_BUS_NUMBER(dev) ((dev)->bus->number&0x0000FF)
#endif
/* __PPC_KERNEL_PCI_H__ */
#endif
/* __PPC_KERNEL_PCI_H__ */
arch/ppc64/kernel/pci_dn.c
View file @
7b6288a6
...
@@ -201,18 +201,8 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list)
...
@@ -201,18 +201,8 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list)
for
(
ln
=
bus_list
->
next
;
ln
!=
bus_list
;
ln
=
ln
->
next
)
{
for
(
ln
=
bus_list
->
next
;
ln
!=
bus_list
;
ln
=
ln
->
next
)
{
bus
=
pci_bus_b
(
ln
);
bus
=
pci_bus_b
(
ln
);
if
(
bus
->
self
)
{
if
(
bus
->
self
)
bus
->
sysdata
=
bus
->
self
->
sysdata
;
bus
->
sysdata
=
bus
->
self
->
sysdata
;
/* Also fixup the bus number on large bus systems to
* include the PHB# in the next byte
*/
phb
=
PCI_GET_DN
(
bus
)
->
phb
;
if
(
phb
&&
phb
->
buid
)
{
newnum
=
(
phb
->
global_number
<<
8
)
|
bus
->
number
;
bus
->
number
=
newnum
;
sprintf
(
bus
->
name
,
"PCI Bus #%x"
,
bus
->
number
);
}
}
pci_fixup_bus_sysdata_list
(
&
bus
->
children
);
pci_fixup_bus_sysdata_list
(
&
bus
->
children
);
}
}
}
}
...
...
include/asm-ppc64/pci.h
View file @
7b6288a6
...
@@ -89,11 +89,7 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
...
@@ -89,11 +89,7 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
extern
int
pci_domain_nr
(
struct
pci_bus
*
bus
);
extern
int
pci_domain_nr
(
struct
pci_bus
*
bus
);
/* Set the name of the bus as it appears in /proc/bus/pci */
/* Set the name of the bus as it appears in /proc/bus/pci */
static
inline
int
pci_name_bus
(
char
*
name
,
struct
pci_bus
*
bus
)
extern
int
pci_name_bus
(
char
*
name
,
struct
pci_bus
*
bus
);
{
sprintf
(
name
,
"%02x"
,
bus
->
number
);
return
0
;
}
struct
vm_area_struct
;
struct
vm_area_struct
;
/* Map a range of PCI memory or I/O space for a device into user space */
/* Map a range of PCI memory or I/O space for a device into user space */
...
...
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