Skip to content

Commit 5676be2

Browse files
Sukadev Bhattiprolumpe
authored andcommitted
powerpc/vas: Define vas_win_paste_addr()
Define an interface that the NX drivers can use to find the physical paste address of a send window. This interface is expected to be used with the mmap() operation of the NX driver's device. i.e the user space process can use driver's mmap() operation to map the send window's paste address into their address space and then use copy and paste instructions to submit the CRBs to the NX engine. Note that kernel drivers will use vas_paste_crb() directly and don't need this interface. Signed-off-by: Sukadev Bhattiprolu <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 9d2a4d7 commit 5676be2

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

arch/powerpc/include/asm/vas.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#ifndef _ASM_POWERPC_VAS_H
1111
#define _ASM_POWERPC_VAS_H
1212

13+
struct vas_window;
14+
1315
/*
1416
* Min and max FIFO sizes are based on Version 1.05 Section 3.1.4.25
1517
* (Local FIFO Size Register) of the VAS workbook.
@@ -165,4 +167,9 @@ int vas_copy_crb(void *crb, int offset);
165167
*/
166168
int vas_paste_crb(struct vas_window *win, int offset, bool re);
167169

170+
/*
171+
* Return the power bus paste address associated with @win so the caller
172+
* can map that address into their address space.
173+
*/
174+
extern u64 vas_win_paste_addr(struct vas_window *win);
168175
#endif /* __ASM_POWERPC_VAS_H */

arch/powerpc/platforms/powernv/vas-window.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ static void compute_paste_address(struct vas_window *window, u64 *addr, int *len
4040
pr_debug("Txwin #%d: Paste addr 0x%llx\n", winid, *addr);
4141
}
4242

43+
u64 vas_win_paste_addr(struct vas_window *win)
44+
{
45+
u64 addr;
46+
47+
compute_paste_address(win, &addr, NULL);
48+
49+
return addr;
50+
}
51+
EXPORT_SYMBOL(vas_win_paste_addr);
52+
4353
static inline void get_hvwc_mmio_bar(struct vas_window *window,
4454
u64 *start, int *len)
4555
{

0 commit comments

Comments
 (0)