Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330352
b: refs/heads/master
c: 688ba1d
h: refs/heads/master
v: v3
  • Loading branch information
Jia Hongtao authored and Kumar Gala committed Sep 12, 2012
1 parent 7dd6e73 commit 1d1d1b6
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39be5b4a7f232870aad0b3c130791eacd0d34347
refs/heads/master: 688ba1dbee8a49a2efe507cd9ae69634d92bb640
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/include/asm/swiotlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ int __init swiotlb_setup_bus_notifier(void);

extern void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev);

#ifdef CONFIG_SWIOTLB
void swiotlb_detect_4g(void);
#else
static inline void swiotlb_detect_4g(void) {}
#endif

#endif /* __ASM_SWIOTLB_H */
20 changes: 20 additions & 0 deletions trunk/arch/powerpc/kernel/dma-swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,23 @@ int __init swiotlb_setup_bus_notifier(void)
&ppc_swiotlb_plat_bus_notifier);
return 0;
}

void swiotlb_detect_4g(void)
{
if ((memblock_end_of_DRAM() - 1) > 0xffffffff)
ppc_swiotlb_enable = 1;
}

static int __init swiotlb_late_init(void)
{
if (ppc_swiotlb_enable) {
swiotlb_print_info();
set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
} else {
swiotlb_free();
}

return 0;
}
subsys_initcall(swiotlb_late_init);
3 changes: 1 addition & 2 deletions trunk/arch/powerpc/mm/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ void __init mem_init(void)
unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize;

#ifdef CONFIG_SWIOTLB
if (ppc_swiotlb_enable)
swiotlb_init(1);
swiotlb_init(0);
#endif

num_physpages = memblock_phys_mem_size() >> PAGE_SHIFT;
Expand Down
10 changes: 2 additions & 8 deletions trunk/arch/powerpc/platforms/44x/currituck.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

#include <linux/init.h>
#include <linux/memblock.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/rtc.h>
Expand Down Expand Up @@ -159,13 +158,8 @@ static void __init ppc47x_setup_arch(void)

/* No need to check the DMA config as we /know/ our windows are all of
* RAM. Lets hope that doesn't change */
#ifdef CONFIG_SWIOTLB
if ((memblock_end_of_DRAM() - 1) > 0xffffffff) {
ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
}
#endif
swiotlb_detect_4g();

ppc47x_smp_init();
}

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/85xx/mpc85xx_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ static void __init mpc85xx_ds_setup_arch(void)
if (ppc_md.progress)
ppc_md.progress("mpc85xx_ds_setup_arch()", 0);

swiotlb_detect_4g();
mpc85xx_ds_pci_init();
mpc85xx_smp_init();

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/85xx/qemu_e500.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static void __init qemu_e500_setup_arch(void)
ppc_md.progress("qemu_e500_setup_arch()", 0);

fsl_pci_init();
swiotlb_detect_4g();
mpc85xx_smp_init();
}

Expand Down
5 changes: 1 addition & 4 deletions trunk/arch/powerpc/sysdev/fsl_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,11 +872,8 @@ void __devinit fsl_pci_init(void)
* we need SWIOTLB to handle buffers located outside of
* dma capable memory region
*/
if (memblock_end_of_DRAM() - 1 > max) {
if (memblock_end_of_DRAM() - 1 > max)
ppc_swiotlb_enable = 1;
set_pci_dma_ops(&swiotlb_dma_ops);
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
}
#endif
}
#endif

0 comments on commit 1d1d1b6

Please sign in to comment.