--- zzzz-none-000/linux-4.1.52/arch/arm/mm/mmu.c 2018-05-28 02:26:45.000000000 +0000 +++ bcm63-7530ax-731/linux-4.1.52/arch/arm/mm/mmu.c 2022-03-02 11:37:12.000000000 +0000 @@ -281,6 +281,15 @@ .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, .domain = DOMAIN_KERNEL, }, +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_PLAT_BCM63XX_ACP) + [MT_DEVICE_NONSECURED] = { + .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | + L_PTE_SHARED, + .prot_l1 = PMD_TYPE_TABLE, + .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S | PMD_SECT_NS, + .domain = DOMAIN_IO, + }, +#endif /* CONFIG_BCM_KF_ARM_BCM963XX && CONFIG_PLAT_BCM63XX_ACP */ #ifndef CONFIG_ARM_LPAE [MT_MINICLEAN] = { .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE, @@ -349,6 +358,14 @@ .prot_l1 = PMD_TYPE_TABLE, .domain = DOMAIN_KERNEL, }, +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_PLAT_BCM63XX_ACP) + [MT_MEMORY_NONSECURED] = { + .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY, + .prot_l1 = PMD_TYPE_TABLE, + .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_NS, + .domain = DOMAIN_KERNEL, + }, +#endif /* CONFIG_BCM_KF_ARM_BCM963XX && CONFIG_PLAT_BCM63XX_ACP */ }; const struct mem_type *get_mem_type(unsigned int type) @@ -570,6 +587,10 @@ mem_types[MT_MEMORY_DMA_READY].prot_pte |= L_PTE_SHARED; mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= PMD_SECT_S; mem_types[MT_MEMORY_RWX_NONCACHED].prot_pte |= L_PTE_SHARED; +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_PLAT_BCM63XX_ACP) + mem_types[MT_MEMORY_NONSECURED].prot_sect |= PMD_SECT_S; + mem_types[MT_MEMORY_NONSECURED].prot_pte |= L_PTE_SHARED; +#endif /* CONFIG_BCM_KF_ARM_BCM963XX && CONFIG_PLAT_BCM63XX_ACP */ } } @@ -633,6 +654,10 @@ mem_types[MT_MEMORY_DMA_READY].prot_pte |= kern_pgprot; mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= ecc_mask; mem_types[MT_ROM].prot_sect |= cp->pmd; +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) && defined(CONFIG_PLAT_BCM63XX_ACP) + mem_types[MT_MEMORY_NONSECURED].prot_sect |= ecc_mask | cp->pmd; + mem_types[MT_MEMORY_NONSECURED].prot_pte |= kern_pgprot; +#endif /* CONFIG_BCM_KF_ARM_BCM963XX && CONFIG_PLAT_BCM63XX_ACP */ switch (cp->pmd) { case PMD_SECT_WT: @@ -841,7 +866,11 @@ * offsets, and we take full advantage of sections and * supersections. */ +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) +void __init create_mapping(struct map_desc *md) +#else static void __init create_mapping(struct map_desc *md) +#endif { unsigned long addr, length, end; phys_addr_t phys;