Message ID | 20140519095949.GD5113@arm.com |
---|---|
State | New |
Headers | show |
Dear Catalin Marinas, On Mon, 19 May 2014 10:59:49 +0100, Catalin Marinas wrote: > The patch is fine but for this to work in the UP case we need to fix > MT_UNCACHED definition for sections. It seems to create SO memory but > not necessarily writable (unless I miss something). Anyway, untested, > something like this: I justed tested in !CONFIG_SMP on Armada 38x, and writing to a PCI I/O mapping works in both the MT_UNCACHED and MT_DEVICE cases. Thomas
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index b68c6b22e1c8..db1bf8cb3a3e 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -267,7 +267,7 @@ static struct mem_type mem_types[] = { [MT_UNCACHED] = { .prot_pte = PROT_PTE_DEVICE, .prot_l1 = PMD_TYPE_TABLE, - .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, + .prot_sect = PROT_SECT_DEVICE, .domain = DOMAIN_IO, }, [MT_CACHECLEAN] = { @@ -461,6 +461,7 @@ static void __init build_mem_type_table(void) mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_XN; mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_XN; mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_XN; + mem_types[MT_UNCACHED].prot_sect |= PMD_SECT_XN; /* Also setup NX memory mapping */ mem_types[MT_MEMORY_RW].prot_sect |= PMD_SECT_XN;