Skip to content

Commit

Permalink
powerpc/pasemi: Remove IOBMAP allocation from platform probe()
Browse files Browse the repository at this point in the history
These days, memblocks is available later, so we can just allocate it
as part of iob_init.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Benjamin Herrenschmidt authored and Michael Ellerman committed Jul 21, 2016
1 parent 166dd7d commit 388dc1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
15 changes: 5 additions & 10 deletions arch/powerpc/platforms/pasemi/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ int __init iob_init(struct device_node *dn)

pr_debug(" -> %s\n", __func__);

/* For 2G space, 8x64 pages (2^21 bytes) is max total l2 size */
iob_l2_base = (u32 *)__va(memblock_alloc_base(1UL<<21, 1UL<<21, 0x80000000));

printk(KERN_INFO "IOBMAP L2 allocated at: %p\n", iob_l2_base);

/* Allocate a spare page to map all invalid IOTLB pages. */
tmp = memblock_alloc(IOBMAP_PAGE_SIZE, IOBMAP_PAGE_SIZE);
if (!tmp)
Expand Down Expand Up @@ -260,13 +265,3 @@ void __init iommu_init_early_pasemi(void)
set_pci_dma_ops(&dma_iommu_ops);
}

void __init alloc_iobmap_l2(void)
{
#ifndef CONFIG_PPC_PASEMI_IOMMU
return;
#endif
/* For 2G space, 8x64 pages (2^21 bytes) is max total l2 size */
iob_l2_base = (u32 *)__va(memblock_alloc_base(1UL<<21, 1UL<<21, 0x80000000));

printk(KERN_INFO "IOBMAP L2 allocated at: %p\n", iob_l2_base);
}
1 change: 0 additions & 1 deletion arch/powerpc/platforms/pasemi/pasemi.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ extern void pas_pci_dma_dev_setup(struct pci_dev *dev);

extern void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);

extern void __init alloc_iobmap_l2(void);
extern void __init pasemi_map_registers(void);

/* Power savings modes, implemented in asm */
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/platforms/pasemi/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,6 @@ static int __init pas_probe(void)
!of_flat_dt_is_compatible(root, "pasemi,pwrficient"))
return 0;

alloc_iobmap_l2();

return 1;
}

Expand Down

0 comments on commit 388dc1c

Please sign in to comment.