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
e0f2df2f
Commit
e0f2df2f
authored
Sep 17, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: we use rtas for all config accesses, so remove the unecessary ioremaps
parent
ec559266
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
158 deletions
+32
-158
arch/ppc64/kernel/iSeries_pci.c
arch/ppc64/kernel/iSeries_pci.c
+0
-1
arch/ppc64/kernel/pSeries_pci.c
arch/ppc64/kernel/pSeries_pci.c
+30
-55
arch/ppc64/kernel/pci.c
arch/ppc64/kernel/pci.c
+0
-6
arch/ppc64/kernel/pci_dma.c
arch/ppc64/kernel/pci_dma.c
+0
-63
include/asm-ppc64/pci-bridge.h
include/asm-ppc64/pci-bridge.h
+2
-33
No files found.
arch/ppc64/kernel/iSeries_pci.c
View file @
e0f2df2f
...
...
@@ -55,7 +55,6 @@ extern int global_phb_number;
extern
int
panic_timeout
;
extern
struct
device_node
*
allnodes
;
extern
unsigned
long
phb_tce_table_init
(
struct
pci_controller
*
phb
);
extern
unsigned
long
iSeries_Base_Io_Memory
;
extern
struct
pci_ops
iSeries_pci_ops
;
...
...
arch/ppc64/kernel/pSeries_pci.c
View file @
e0f2df2f
...
...
@@ -45,15 +45,13 @@
#include "open_pic.h"
#include "pci.h"
extern
struct
device_node
*
allnodes
;
/*******************************************************************
* Forward declares of prototypes.
*******************************************************************/
unsigned
long
find_and_init_phbs
(
void
);
struct
pci_controller
*
alloc_phb
(
struct
device_node
*
dev
,
char
*
model
,
unsigned
int
addr_size_words
)
;
void
pSeries_pcibios_fixup
(
void
);
static
int
rtas_fake_read
(
struct
device_node
*
dn
,
int
offset
,
int
nbytes
,
unsigned
long
*
returnval
);
struct
pci_controller
*
alloc_phb
(
struct
device_node
*
dev
,
char
*
model
,
unsigned
int
addr_size_words
)
;
static
int
rtas_fake_read
(
struct
device_node
*
dn
,
int
offset
,
int
nbytes
,
unsigned
long
*
returnval
);
/* RTAS tokens */
static
int
read_pci_config
;
...
...
@@ -467,44 +465,37 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
* Python
***************************************************************/
if
(
strstr
(
model
,
"Python"
))
{
unsigned
long
chip_regs
;
volatile
u32
*
tmp
,
i
;
PPCDBG
(
PPCDBG_PHBINIT
,
"
\t
Create python
\n
"
);
phb
=
pci_alloc_pci_controller
(
"PHB PY"
,
phb_type_python
);
if
(
phb
==
NULL
)
return
NULL
;
phb
->
cfg_addr
=
(
volatile
unsigned
long
*
)
ioremap
(
reg_struct
.
address
+
0xf8000
,
PAGE_SIZE
);
PPCDBG
(
PPCDBG_PHBINIT
,
"
\t
cfg_addr_r = 0x%lx
\n
"
,
reg_struct
.
address
+
0xf8000
);
PPCDBG
(
PPCDBG_PHBINIT
,
"
\t
cfg_addr_v = 0x%lx
\n
"
,
phb
->
cfg_addr
);
phb
->
cfg_data
=
(
char
*
)(
phb
->
cfg_addr
+
0x02
);
phb
->
phb_regs
=
(
volatile
unsigned
long
*
)
ioremap
(
reg_struct
.
address
+
0xf7000
,
PAGE_SIZE
);
phb
=
pci_alloc_pci_controller
(
"PHB PY"
,
phb_type_python
);
if
(
phb
==
NULL
)
return
NULL
;
/* Python's register file is 1 MB in size. */
phb
->
chip_regs
=
ioremap
(
reg_struct
.
address
&
~
(
0xfffffUL
),
0x100000
);
chip_regs
=
ioremap
(
reg_struct
.
address
&
~
(
0xfffffUL
),
0x100000
);
/*
* Firmware doesn't always clear this bit which is critical
* for good performance - Anton
*/
{
volatile
u32
*
tmp
,
i
;
#define PRG_CL_RESET_VALID 0x00010000
tmp
=
(
u32
*
)((
unsigned
long
)
phb
->
chip_regs
+
0xf6030
);
if
(
*
tmp
&
PRG_CL_RESET_VALID
)
{
printk
(
"Python workaround: "
);
*
tmp
&=
~
PRG_CL_RESET_VALID
;
/*
* We must read it back for changes to
* take effect
*/
i
=
*
tmp
;
printk
(
"reg0: %x
\n
"
,
i
);
}
tmp
=
(
u32
*
)((
unsigned
long
)
chip_regs
+
0xf6030
);
if
(
*
tmp
&
PRG_CL_RESET_VALID
)
{
printk
(
"Python workaround: "
);
*
tmp
&=
~
PRG_CL_RESET_VALID
;
/*
* We must read it back for changes to
* take effect
*/
i
=
*
tmp
;
printk
(
"reg0: %x
\n
"
,
i
);
}
/***************************************************************
...
...
@@ -514,28 +505,12 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
}
else
if
((
strstr
(
model
,
"Speedwagon"
))
||
(
strstr
(
model
,
"Winnipeg"
)))
{
PPCDBG
(
PPCDBG_PHBINIT
,
"
\t
Create speedwagon
\n
"
);
phb
=
pci_alloc_pci_controller
(
"PHB SW"
,
phb_type_speedwagon
);
if
(
phb
==
NULL
)
return
NULL
;
if
(
naca
->
platform
==
PLATFORM_PSERIES
)
{
phb
->
cfg_addr
=
(
volatile
unsigned
long
*
)
ioremap
(
reg_struct
.
address
+
0x140
,
PAGE_SIZE
);
phb
->
cfg_data
=
(
char
*
)(
phb
->
cfg_addr
-
0x02
);
/* minus is correct */
phb
->
phb_regs
=
(
volatile
unsigned
long
*
)
ioremap
(
reg_struct
.
address
,
PAGE_SIZE
);
/* Speedwagon's register file is 1 MB in size. */
phb
->
chip_regs
=
ioremap
(
reg_struct
.
address
&
~
(
0xfffffUL
),
0x100000
);
PPCDBG
(
PPCDBG_PHBINIT
,
"
\t
mapping chip_regs from 0x%lx -> 0x%lx
\n
"
,
reg_struct
.
address
&
0xfffff
,
phb
->
chip_regs
);
}
else
{
phb
->
cfg_addr
=
NULL
;
phb
->
cfg_data
=
NULL
;
phb
->
phb_regs
=
NULL
;
phb
->
chip_regs
=
NULL
;
}
phb
=
pci_alloc_pci_controller
(
"PHB SW"
,
phb_type_speedwagon
);
if
(
phb
==
NULL
)
return
NULL
;
phb
->
local_number
=
((
reg_struct
.
address
>>
12
)
&
0xf
)
-
0x8
;
/***************************************************************
* Trying to build a known just gets the code in trouble.
***************************************************************/
...
...
@@ -563,7 +538,7 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
buid_vals
=
(
int
*
)
get_property
(
dev
,
"ibm,fw-phb-id"
,
&
len
);
if
(
buid_vals
==
NULL
)
{
if
(
buid_vals
==
NULL
)
{
phb
->
buid
=
0
;
}
else
{
struct
pci_bus
check
;
...
...
arch/ppc64/kernel/pci.c
View file @
e0f2df2f
...
...
@@ -924,12 +924,6 @@ void dumpPci_Controller(struct pci_controller* phb)
udbg_printf
(
"
\t
pci_mem_offset= 0x%016LX
\n
"
,
phb
->
pci_mem_offset
);
udbg_printf
(
"
\t
pci_io_offset = 0x%016LX
\n
"
,
phb
->
pci_io_offset
);
udbg_printf
(
"
\t
cfg_addr = 0x%016LX
\n
"
,
phb
->
cfg_addr
);
udbg_printf
(
"
\t
cfg_data = 0x%016LX
\n
"
,
phb
->
cfg_data
);
udbg_printf
(
"
\t
phb_regs = 0x%016LX
\n
"
,
phb
->
phb_regs
);
udbg_printf
(
"
\t
chip_regs = 0x%016LX
\n
"
,
phb
->
chip_regs
);
udbg_printf
(
"
\t
Resources
\n
"
);
dumpResources
(
&
phb
->
io_resource
);
if
(
phb
->
mem_resource_count
>
0
)
dumpResources
(
&
phb
->
mem_resources
[
0
]);
...
...
arch/ppc64/kernel/pci_dma.c
View file @
e0f2df2f
...
...
@@ -1438,69 +1438,6 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems,
}
#endif
/*
* phb_tce_table_init
*
* Function: Display TCE config registers. Could be easily changed
* to initialize the hardware to use TCEs.
*/
unsigned
long
phb_tce_table_init
(
struct
pci_controller
*
phb
)
{
unsigned
int
r
,
cfg_rw
,
i
;
unsigned
long
r64
;
phandle
node
;
PPCDBG
(
PPCDBG_TCE
,
"phb_tce_table_init: start.
\n
"
);
node
=
((
struct
device_node
*
)(
phb
->
arch_data
))
->
node
;
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
phb = 0x%lx
\n
"
,
phb
);
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
phb->type = 0x%lx
\n
"
,
phb
->
type
);
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
phb->phb_regs = 0x%lx
\n
"
,
phb
->
phb_regs
);
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
phb->chip_regs = 0x%lx
\n
"
,
phb
->
chip_regs
);
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
phb: node = 0x%lx
\n
"
,
node
);
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
phb->arch_data = 0x%lx
\n
"
,
phb
->
arch_data
);
i
=
0
;
while
(
of_tce_table
[
i
].
node
)
{
if
(
of_tce_table
[
i
].
node
==
node
)
{
if
(
phb
->
type
==
phb_type_python
)
{
r
=
*
(((
unsigned
int
*
)
phb
->
phb_regs
)
+
(
0xf10
>>
2
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
TAR(low) = 0x%x
\n
"
,
r
);
r
=
*
(((
unsigned
int
*
)
phb
->
phb_regs
)
+
(
0xf00
>>
2
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
TAR(high) = 0x%x
\n
"
,
r
);
r
=
*
(((
unsigned
int
*
)
phb
->
phb_regs
)
+
(
0xfd0
>>
2
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
PHB cfg(rw) = 0x%x
\n
"
,
r
);
break
;
}
else
if
(
phb
->
type
==
phb_type_speedwagon
)
{
r64
=
*
(((
unsigned
long
*
)
phb
->
chip_regs
)
+
(
0x800
>>
3
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
NCFG = 0x%lx
\n
"
,
r64
);
r64
=
*
(((
unsigned
long
*
)
phb
->
chip_regs
)
+
(
0x580
>>
3
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
TAR0 = 0x%lx
\n
"
,
r64
);
r64
=
*
(((
unsigned
long
*
)
phb
->
chip_regs
)
+
(
0x588
>>
3
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
TAR1 = 0x%lx
\n
"
,
r64
);
r64
=
*
(((
unsigned
long
*
)
phb
->
chip_regs
)
+
(
0x590
>>
3
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
TAR2 = 0x%lx
\n
"
,
r64
);
r64
=
*
(((
unsigned
long
*
)
phb
->
chip_regs
)
+
(
0x598
>>
3
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
TAR3 = 0x%lx
\n
"
,
r64
);
cfg_rw
=
*
(((
unsigned
int
*
)
phb
->
chip_regs
)
+
((
0x160
+
(((
phb
->
local_number
)
+
8
)
<<
12
))
>>
2
));
PPCDBG
(
PPCDBG_TCEINIT
,
"
\t
cfg_rw = 0x%x
\n
"
,
cfg_rw
);
}
}
i
++
;
}
PPCDBG
(
PPCDBG_TCEINIT
,
"phb_tce_table_init: done
\n
"
);
return
(
0
);
}
/* These are called very early. */
void
tce_init_pSeries
(
void
)
{
...
...
include/asm-ppc64/pci-bridge.h
View file @
e0f2df2f
...
...
@@ -57,10 +57,6 @@ struct pci_controller {
unsigned
long
pci_io_offset
;
struct
pci_ops
*
ops
;
volatile
unsigned
long
*
cfg_addr
;
volatile
unsigned
char
*
cfg_data
;
volatile
unsigned
long
*
phb_regs
;
volatile
unsigned
long
*
chip_regs
;
/* Currently, we limit ourselves to 1 IO range and 3 mem
* ranges since the common pci_bus structure can't handle more
...
...
@@ -68,29 +64,13 @@ struct pci_controller {
struct
resource
io_resource
;
struct
resource
mem_resources
[
3
];
int
mem_resource_count
;
int
global_number
;
int
local_number
;
int
system_bus_number
;
int
global_number
;
int
local_number
;
unsigned
long
buid
;
unsigned
long
dma_window_base_cur
;
unsigned
long
dma_window_size
;
};
/* This version handles the new Uni-N host bridge, the iobase is now
* a per-device thing. I also added the memory base so PReP can
* be fixed to return 0xc0000000 (I didn't actually implement it)
*
* pci_dev_io_base() returns either a virtual (ioremap'ed) address or
* a physical address. In-kernel clients will use logical while the
* sys_pciconfig_iobase syscall returns a physical one to userland.
*/
void
*
pci_dev_io_base
(
unsigned
char
bus
,
unsigned
char
devfn
,
int
physical
);
void
*
pci_dev_mem_base
(
unsigned
char
bus
,
unsigned
char
devfn
);
/* Returns the root-bridge number (Uni-N number) of a device */
int
pci_dev_root_bridge
(
unsigned
char
bus
,
unsigned
char
devfn
);
/*
* pci_device_loc returns the bus number and device/function number
* for a device on a PCI bus, given its device_node struct.
...
...
@@ -99,16 +79,5 @@ int pci_dev_root_bridge(unsigned char bus, unsigned char devfn);
int
pci_device_loc
(
struct
device_node
*
dev
,
unsigned
char
*
bus_ptr
,
unsigned
char
*
devfn_ptr
);
struct
bridge_data
{
volatile
unsigned
int
*
cfg_addr
;
volatile
unsigned
char
*
cfg_data
;
void
*
io_base
;
/* virtual */
unsigned
long
io_base_phys
;
int
bus_number
;
int
max_bus
;
struct
bridge_data
*
next
;
struct
device_node
*
node
;
};
#endif
#endif
/* __KERNEL__ */
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