Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72176dd0 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Michael Ellerman
Browse files

powerpc/mm: Use a helper for finding pte bits mapping I/O area



Use a helper instead of open coding with constants. A later patch will
drop the WIMG bits and use PowerISA 3.0 defines.

Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent e58e87ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -162,7 +162,7 @@ void btext_map(void)
	offset = ((unsigned long) dispDeviceBase) - base;
	offset = ((unsigned long) dispDeviceBase) - base;
	size = dispDeviceRowBytes * dispDeviceRect[3] + offset
	size = dispDeviceRowBytes * dispDeviceRect[3] + offset
		+ dispDeviceRect[0];
		+ dispDeviceRect[0];
	vbase = __ioremap(base, size, _PAGE_NO_CACHE);
	vbase = __ioremap(base, size, pgprot_val(pgprot_noncached_wc(__pgprot(0))));
	if (vbase == 0)
	if (vbase == 0)
		return;
		return;
	logicalDisplayBase = vbase + offset;
	logicalDisplayBase = vbase + offset;
+2 −2
Original line number Original line Diff line number Diff line
@@ -109,14 +109,14 @@ static void pci_process_ISA_OF_ranges(struct device_node *isa_node,
		size = 0x10000;
		size = 0x10000;


	__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
	__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
		     size, _PAGE_NO_CACHE|_PAGE_GUARDED);
		     size, pgprot_val(pgprot_noncached(__pgprot(0))));
	return;
	return;


inval_range:
inval_range:
	printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
	printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
	       "mapping 64k\n");
	       "mapping 64k\n");
	__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
	__ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
		     0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED);
		     0x10000, pgprot_val(pgprot_noncached(__pgprot(0))));
}
}




+1 −1
Original line number Original line Diff line number Diff line
@@ -159,7 +159,7 @@ static int pcibios_map_phb_io_space(struct pci_controller *hose)


	/* Establish the mapping */
	/* Establish the mapping */
	if (__ioremap_at(phys_page, area->addr, size_page,
	if (__ioremap_at(phys_page, area->addr, size_page,
			 _PAGE_NO_CACHE | _PAGE_GUARDED) == NULL)
			 pgprot_val(pgprot_noncached(__pgprot(0)))) == NULL)
		return -ENOMEM;
		return -ENOMEM;


	/* Fixup hose IO resource */
	/* Fixup hose IO resource */
+2 −2
Original line number Original line Diff line number Diff line
@@ -253,7 +253,7 @@ void __iomem * __ioremap(phys_addr_t addr, unsigned long size,


void __iomem * ioremap(phys_addr_t addr, unsigned long size)
void __iomem * ioremap(phys_addr_t addr, unsigned long size)
{
{
	unsigned long flags = _PAGE_NO_CACHE | _PAGE_GUARDED;
	unsigned long flags = pgprot_val(pgprot_noncached(__pgprot(0)));
	void *caller = __builtin_return_address(0);
	void *caller = __builtin_return_address(0);


	if (ppc_md.ioremap)
	if (ppc_md.ioremap)
@@ -263,7 +263,7 @@ void __iomem * ioremap(phys_addr_t addr, unsigned long size)


void __iomem * ioremap_wc(phys_addr_t addr, unsigned long size)
void __iomem * ioremap_wc(phys_addr_t addr, unsigned long size)
{
{
	unsigned long flags = _PAGE_NO_CACHE;
	unsigned long flags = pgprot_val(pgprot_noncached_wc(__pgprot(0)));
	void *caller = __builtin_return_address(0);
	void *caller = __builtin_return_address(0);


	if (ppc_md.ioremap)
	if (ppc_md.ioremap)
+1 −1
Original line number Original line Diff line number Diff line
@@ -216,7 +216,7 @@ static int __init setup_areas(struct spu *spu)
	}
	}


	spu->local_store = (__force void *)ioremap_prot(spu->local_store_phys,
	spu->local_store = (__force void *)ioremap_prot(spu->local_store_phys,
		LS_SIZE, _PAGE_NO_CACHE);
		LS_SIZE, pgprot_val(pgprot_noncached_wc(__pgprot(0))));


	if (!spu->local_store) {
	if (!spu->local_store) {
		pr_debug("%s:%d: ioremap local_store failed\n",
		pr_debug("%s:%d: ioremap local_store failed\n",
Loading