diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2009-06-10 00:38:45 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-14 23:26:19 -0400 |
commit | 5c6fc8db768fb9990ee67ab052896fd46fbe2651 (patch) | |
tree | a1e3e051c68ea4101344acffba5ca14363224360 /arch/powerpc/platforms/ps3/system-bus.c | |
parent | ca971ea39fa92add0fa596ad80affd7db781d762 (diff) |
powerpc/cell: Extract duplicated IOPTE_* to <asm/iommu.h>
Both arch/powerpc/platforms/cell/iommu.c and arch/powerpc/platforms/ps3/mm.c
contain the same Cell IOMMU page table entry definitions. Extract them and move
them to <asm/iommu.h>, while adding a CBE_ prefix.
This also allows them to be used by drivers.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/ps3/system-bus.c')
-rw-r--r-- | arch/powerpc/platforms/ps3/system-bus.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 9a73d0238639..9fead0faf38b 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/udbg.h> | 27 | #include <asm/udbg.h> |
28 | #include <asm/lv1call.h> | 28 | #include <asm/lv1call.h> |
29 | #include <asm/firmware.h> | 29 | #include <asm/firmware.h> |
30 | #include <asm/iommu.h> | ||
30 | 31 | ||
31 | #include "platform.h" | 32 | #include "platform.h" |
32 | 33 | ||
@@ -531,7 +532,8 @@ static void * ps3_alloc_coherent(struct device *_dev, size_t size, | |||
531 | } | 532 | } |
532 | 533 | ||
533 | result = ps3_dma_map(dev->d_region, virt_addr, size, dma_handle, | 534 | result = ps3_dma_map(dev->d_region, virt_addr, size, dma_handle, |
534 | IOPTE_PP_W | IOPTE_PP_R | IOPTE_SO_RW | IOPTE_M); | 535 | CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | |
536 | CBE_IOPTE_SO_RW | CBE_IOPTE_M); | ||
535 | 537 | ||
536 | if (result) { | 538 | if (result) { |
537 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", | 539 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", |
@@ -575,7 +577,8 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page, | |||
575 | 577 | ||
576 | result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, | 578 | result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, |
577 | &bus_addr, | 579 | &bus_addr, |
578 | IOPTE_PP_R | IOPTE_PP_W | IOPTE_SO_RW | IOPTE_M); | 580 | CBE_IOPTE_PP_R | CBE_IOPTE_PP_W | |
581 | CBE_IOPTE_SO_RW | CBE_IOPTE_M); | ||
579 | 582 | ||
580 | if (result) { | 583 | if (result) { |
581 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", | 584 | pr_debug("%s:%d: ps3_dma_map failed (%d)\n", |
@@ -596,16 +599,16 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page, | |||
596 | u64 iopte_flag; | 599 | u64 iopte_flag; |
597 | void *ptr = page_address(page) + offset; | 600 | void *ptr = page_address(page) + offset; |
598 | 601 | ||
599 | iopte_flag = IOPTE_M; | 602 | iopte_flag = CBE_IOPTE_M; |
600 | switch (direction) { | 603 | switch (direction) { |
601 | case DMA_BIDIRECTIONAL: | 604 | case DMA_BIDIRECTIONAL: |
602 | iopte_flag |= IOPTE_PP_R | IOPTE_PP_W | IOPTE_SO_RW; | 605 | iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW; |
603 | break; | 606 | break; |
604 | case DMA_TO_DEVICE: | 607 | case DMA_TO_DEVICE: |
605 | iopte_flag |= IOPTE_PP_R | IOPTE_SO_R; | 608 | iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_SO_R; |
606 | break; | 609 | break; |
607 | case DMA_FROM_DEVICE: | 610 | case DMA_FROM_DEVICE: |
608 | iopte_flag |= IOPTE_PP_W | IOPTE_SO_RW; | 611 | iopte_flag |= CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW; |
609 | break; | 612 | break; |
610 | default: | 613 | default: |
611 | /* not happned */ | 614 | /* not happned */ |