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
34f16cd8
Commit
34f16cd8
authored
Apr 26, 2002
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: pci_dma updates - remove excess syncs and general cleanup, from
Mike Corrigan
parent
5b78e64f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
288 additions
and
295 deletions
+288
-295
arch/ppc64/kernel/pSeries_lpar.c
arch/ppc64/kernel/pSeries_lpar.c
+20
-75
arch/ppc64/kernel/pci.c
arch/ppc64/kernel/pci.c
+2
-0
arch/ppc64/kernel/pci_dma.c
arch/ppc64/kernel/pci_dma.c
+261
-215
include/asm-ppc64/machdep.h
include/asm-ppc64/machdep.h
+2
-4
include/asm-ppc64/pci_dma.h
include/asm-ppc64/pci_dma.h
+3
-1
No files found.
arch/ppc64/kernel/pSeries_lpar.c
View file @
34f16cd8
...
...
@@ -219,7 +219,7 @@ long plpar_xirr(unsigned long *xirr_ret)
static
void
tce_build_pSeriesLP
(
struct
TceTable
*
tbl
,
long
tcenum
,
unsigned
long
uaddr
,
int
direction
)
{
u64
set
TceR
c
;
u64
set
_tce_r
c
;
union
Tce
tce
;
PPCDBG
(
PPCDBG_TCE
,
"build_tce: uaddr = 0x%lx
\n
"
,
uaddr
);
...
...
@@ -232,90 +232,35 @@ static void tce_build_pSeriesLP(struct TceTable *tbl, long tcenum,
tce
.
tceBits
.
readWrite
=
1
;
if
(
direction
!=
PCI_DMA_TODEVICE
)
tce
.
tceBits
.
pciWrite
=
1
;
set
TceR
c
=
plpar_tce_put
((
u64
)
tbl
->
index
,
set
_tce_r
c
=
plpar_tce_put
((
u64
)
tbl
->
index
,
(
u64
)
tcenum
<<
12
,
tce
.
wholeTce
);
/* Make sure the update is visible to hardware.
* ToDo: sync after setting *all* the tce's.
*/
__asm__
__volatile__
(
"sync"
:
:
:
"memory"
);
if
(
set
TceR
c
)
{
PPCDBG
(
PPCDBG_TCE
,
"setTce failed. rc=%ld
\n
"
,
setTceR
c
);
PPCDBG
(
PPCDBG_TCE
,
"
\t
index = 0x%lx
\n
"
,
(
u64
)
tbl
->
index
);
PPCDBG
(
PPCDBG_TCE
,
"
\t
tcenum = 0x%lx
\n
"
,
(
u64
)
tcenum
);
PPCDBG
(
PPCDBG_TCE
,
"
\t
tce val = 0x%lx
\n
"
,
tce
.
wholeTce
);
if
(
set
_tce_r
c
)
{
printk
(
"tce_build_pSeriesLP: plpar_tce_put failed. rc=%ld
\n
"
,
set_tce_r
c
);
printk
(
"
\t
index = 0x%lx
\n
"
,
(
u64
)
tbl
->
index
);
printk
(
"
\t
tcenum = 0x%lx
\n
"
,
(
u64
)
tcenum
);
printk
(
"
\t
tce val = 0x%lx
\n
"
,
tce
.
wholeTce
);
}
}
static
inline
void
free_tce_range
(
struct
TceTable
*
tbl
,
long
tcenum
,
unsigned
order
)
{
unsigned
long
flags
;
/* Lock the tce allocation bitmap */
spin_lock_irqsave
(
&
(
tbl
->
lock
),
flags
);
/* Do the actual work */
free_tce_range_nolock
(
tbl
,
tcenum
,
order
);
/* Unlock the tce allocation bitmap */
spin_unlock_irqrestore
(
&
(
tbl
->
lock
),
flags
);
}
static
void
tce_free_pSeriesLP
(
struct
TceTable
*
tbl
,
dma_addr_t
dma_addr
,
unsigned
order
,
unsigned
numPages
)
static
void
tce_free_one_pSeriesLP
(
struct
TceTable
*
tbl
,
long
tcenum
)
{
u64
setTceRc
;
long
tcenum
,
freeTce
,
maxTcenum
;
unsigned
i
;
u64
set_tce_rc
;
union
Tce
tce
;
maxTcenum
=
(
tbl
->
size
*
(
PAGE_SIZE
/
sizeof
(
union
Tce
)))
-
1
;
tcenum
=
dma_addr
>>
PAGE_SHIFT
;
freeTce
=
tcenum
-
tbl
->
startOffset
;
if
(
freeTce
>
maxTcenum
)
{
printk
(
"free_tces: tcenum > maxTcenum
\n
"
);
printk
(
"
\t
tcenum = 0x%lx
\n
"
,
tcenum
);
printk
(
"
\t
freeTce = 0x%lx
\n
"
,
freeTce
);
printk
(
"
\t
maxTcenum = 0x%lx
\n
"
,
maxTcenum
);
printk
(
"
\t
TCE Table = 0x%lx
\n
"
,
(
u64
)
tbl
);
printk
(
"
\t
bus# = 0x%lx
\n
"
,
(
u64
)
tbl
->
busNumber
);
printk
(
"
\t
size = 0x%lx
\n
"
,
(
u64
)
tbl
->
size
);
printk
(
"
\t
startOff = 0x%lx
\n
"
,
(
u64
)
tbl
->
startOffset
);
printk
(
"
\t
index = 0x%lx
\n
"
,
(
u64
)
tbl
->
index
);
return
;
}
for
(
i
=
0
;
i
<
numPages
;
++
i
)
{
tce
.
wholeTce
=
0
;
setTceRc
=
plpar_tce_put
((
u64
)
tbl
->
index
,
(
u64
)
tcenum
<<
12
,
/* note: not freeTce */
tce
.
wholeTce
);
if
(
setTceRc
)
{
printk
(
"tce_free: setTce failed
\n
"
);
printk
(
"
\t
rc = %ld
\n
"
,
setTceRc
);
printk
(
"
\t
index = 0x%lx
\n
"
,
(
u64
)
tbl
->
index
);
printk
(
"
\t
tcenum = 0x%lx
\n
"
,
(
u64
)
tcenum
);
printk
(
"
\t
freeTce = 0x%lx
\n
"
,
(
u64
)
freeTce
);
printk
(
"
\t
tce val = 0x%lx
\n
"
,
tce
.
wholeTce
);
}
++
tcenum
;
tce
.
wholeTce
=
0
;
set_tce_rc
=
plpar_tce_put
((
u64
)
tbl
->
index
,
(
u64
)
tcenum
<<
12
,
tce
.
wholeTce
);
if
(
set_tce_rc
)
{
printk
(
"tce_free_one_pSeriesLP: plpar_tce_put failed
\n
"
);
printk
(
"
\t
rc = %ld
\n
"
,
set_tce_rc
);
printk
(
"
\t
index = 0x%lx
\n
"
,
(
u64
)
tbl
->
index
);
printk
(
"
\t
tcenum = 0x%lx
\n
"
,
(
u64
)
tcenum
);
printk
(
"
\t
tce val = 0x%lx
\n
"
,
tce
.
wholeTce
);
}
/* Make sure the update is visible to hardware. */
__asm__
__volatile__
(
"sync"
:
:
:
"memory"
);
free_tce_range
(
tbl
,
freeTce
,
order
);
}
/* PowerPC Interrupts for lpar. */
...
...
@@ -446,7 +391,7 @@ void pSeriesLP_init_early(void)
pSeries_lpar_mm_init
();
ppc_md
.
tce_build
=
tce_build_pSeriesLP
;
ppc_md
.
tce_free
=
tce_fre
e_pSeriesLP
;
ppc_md
.
tce_free
_one
=
tce_free_on
e_pSeriesLP
;
#ifdef CONFIG_SMP
smp_init_pSeries
();
...
...
arch/ppc64/kernel/pci.c
View file @
34f16cd8
...
...
@@ -63,6 +63,8 @@ int pci_assign_all_busses = 0;
struct
pci_controller
*
hose_head
;
struct
pci_controller
**
hose_tail
=
&
hose_head
;
LIST_HEAD
(
iSeries_Global_Device_List
);
/*******************************************************************
* Counters and control flags.
*******************************************************************/
...
...
arch/ppc64/kernel/pci_dma.c
View file @
34f16cd8
This diff is collapsed.
Click to expand it.
include/asm-ppc64/machdep.h
View file @
34f16cd8
...
...
@@ -55,10 +55,8 @@ struct machdep_calls {
long
tcenum
,
unsigned
long
uaddr
,
int
direction
);
void
(
*
tce_free
)(
struct
TceTable
*
tbl
,
dma_addr_t
dma_addr
,
unsigned
order
,
unsigned
numPages
);
void
(
*
tce_free_one
)(
struct
TceTable
*
tbl
,
long
tcenum
);
void
(
*
smp_message_pass
)(
int
target
,
int
msg
,
...
...
include/asm-ppc64/pci_dma.h
View file @
34f16cd8
...
...
@@ -85,12 +85,14 @@ struct TceTableManagerCB {
u64
index
;
/* Index of this tce table (token?) */
u16
maxTceTableIndex
;
/* Max num of tables for partition */
u8
virtualBusFlag
;
/* Flag to indicate virtual bus */
u8
rsvd
[
5
];
u8
logicalSlot
;
/* IOA Tce Slot Index */
u8
rsvd
[
4
];
};
extern
struct
TceTable
virtBusTceTable
;
/* Tce table for virtual bus */
extern
void
create_tce_tables
(
void
);
extern
void
create_pci_bus_tce_table
(
unsigned
long
);
void
tce_init_pSeries
(
void
);
void
tce_init_iSeries
(
void
);
...
...
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