Loading Documentation/arm/memory.txt +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ fffe8000 fffeffff DTCM mapping area for platforms with fffe0000 fffe7fff ITCM mapping area for platforms with ITCM mounted inside the CPU. ffc00000 ffdfffff Fixmap mapping region. Addresses provided ffc00000 ffefffff Fixmap mapping region. Addresses provided by fix_to_virt() will be located here. fee00000 feffffff Mapping of PCI I/O space. This is a static Loading arch/arm/Kconfig +11 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,17 @@ config ARM_DMA_USE_IOMMU select ARM_HAS_SG_CHAIN select NEED_SG_DMA_LENGTH config EARLY_IOREMAP bool "Provide early_ioremap() support for kernel initialization" depends on MMU select GENERIC_EARLY_IOREMAP help Provide a mechanism for kernel initialisation code to temporarily map, in a highmem-agnostic way, memory pages in before ioremap() and friends are available (before paging_init() has run). It uses the same virtual memory range as kmap so all early mappings must be unmapped before paging_init() is called. if ARM_DMA_USE_IOMMU config ARM_DMA_IOMMU_ALIGNMENT Loading arch/arm/include/asm/Kbuild +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ generic-y += auxvec.h generic-y += bitsperlong.h generic-y += cputime.h generic-y += current.h generic-y += early_ioremap.h generic-y += emergency-restart.h generic-y += errno.h generic-y += exec.h Loading arch/arm/include/asm/fixmap.h +34 −17 Original line number Diff line number Diff line #ifndef _ASM_FIXMAP_H #define _ASM_FIXMAP_H #include <linux/kernel.h> #include <asm/pgtable.h> #include <asm/kmap_types.h> #define FIXADDR_START 0xffc00000UL #define FIXADDR_TOP 0xffe00000UL #define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START) #define FIXADDR_END 0xfff00000UL #define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE) /* * 224 temporary boot-time mappings, used by early_ioremap(), * before ioremap() is functional. * * (P)re-using the FIXADDR region, which is used for highmem * later on, and statically aligned to 1MB. */ #define NR_FIX_BTMAPS 32 #define FIX_BTMAPS_SLOTS 7 #define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS) enum fixed_addresses { FIX_EARLYCON_MEM_BASE, __end_of_permanent_fixed_addresses, FIX_BTMAP_END = __end_of_permanent_fixed_addresses, FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1, #define FIX_KMAP_NR_PTES (FIXADDR_SIZE >> PAGE_SHIFT) FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses, FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1, __end_of_fixed_addresses = (FIXADDR_END - FIXADDR_START) >> PAGE_SHIFT, }; #define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT)) #define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT) #define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN) extern void __this_fixmap_does_not_exist(void); #define FIXMAP_PAGE_NORMAL (FIXMAP_PAGE_COMMON | L_PTE_MT_WRITEBACK) #define FIXMAP_PAGE_IO (FIXMAP_PAGE_COMMON | L_PTE_MT_DEV_SHARED | L_PTE_SHARED | L_PTE_DIRTY) #define FIXMAP_PAGE_NOCACHE FIXMAP_PAGE_IO static inline unsigned long fix_to_virt(const unsigned int idx) { if (idx >= FIX_KMAP_NR_PTES) __this_fixmap_does_not_exist(); return __fix_to_virt(idx); } extern void __early_set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags); static inline unsigned int virt_to_fix(const unsigned long vaddr) { BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); return __virt_to_fix(vaddr); } #include <asm-generic/fixmap.h> #endif arch/arm/include/asm/io.h +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm-generic/pci_iomap.h> #include <asm/early_ioremap.h> #include <linux/msm_rtb.h> #include <xen/xen.h> Loading Loading
Documentation/arm/memory.txt +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ fffe8000 fffeffff DTCM mapping area for platforms with fffe0000 fffe7fff ITCM mapping area for platforms with ITCM mounted inside the CPU. ffc00000 ffdfffff Fixmap mapping region. Addresses provided ffc00000 ffefffff Fixmap mapping region. Addresses provided by fix_to_virt() will be located here. fee00000 feffffff Mapping of PCI I/O space. This is a static Loading
arch/arm/Kconfig +11 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,17 @@ config ARM_DMA_USE_IOMMU select ARM_HAS_SG_CHAIN select NEED_SG_DMA_LENGTH config EARLY_IOREMAP bool "Provide early_ioremap() support for kernel initialization" depends on MMU select GENERIC_EARLY_IOREMAP help Provide a mechanism for kernel initialisation code to temporarily map, in a highmem-agnostic way, memory pages in before ioremap() and friends are available (before paging_init() has run). It uses the same virtual memory range as kmap so all early mappings must be unmapped before paging_init() is called. if ARM_DMA_USE_IOMMU config ARM_DMA_IOMMU_ALIGNMENT Loading
arch/arm/include/asm/Kbuild +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ generic-y += auxvec.h generic-y += bitsperlong.h generic-y += cputime.h generic-y += current.h generic-y += early_ioremap.h generic-y += emergency-restart.h generic-y += errno.h generic-y += exec.h Loading
arch/arm/include/asm/fixmap.h +34 −17 Original line number Diff line number Diff line #ifndef _ASM_FIXMAP_H #define _ASM_FIXMAP_H #include <linux/kernel.h> #include <asm/pgtable.h> #include <asm/kmap_types.h> #define FIXADDR_START 0xffc00000UL #define FIXADDR_TOP 0xffe00000UL #define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START) #define FIXADDR_END 0xfff00000UL #define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE) /* * 224 temporary boot-time mappings, used by early_ioremap(), * before ioremap() is functional. * * (P)re-using the FIXADDR region, which is used for highmem * later on, and statically aligned to 1MB. */ #define NR_FIX_BTMAPS 32 #define FIX_BTMAPS_SLOTS 7 #define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS) enum fixed_addresses { FIX_EARLYCON_MEM_BASE, __end_of_permanent_fixed_addresses, FIX_BTMAP_END = __end_of_permanent_fixed_addresses, FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1, #define FIX_KMAP_NR_PTES (FIXADDR_SIZE >> PAGE_SHIFT) FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses, FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1, __end_of_fixed_addresses = (FIXADDR_END - FIXADDR_START) >> PAGE_SHIFT, }; #define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT)) #define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT) #define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN) extern void __this_fixmap_does_not_exist(void); #define FIXMAP_PAGE_NORMAL (FIXMAP_PAGE_COMMON | L_PTE_MT_WRITEBACK) #define FIXMAP_PAGE_IO (FIXMAP_PAGE_COMMON | L_PTE_MT_DEV_SHARED | L_PTE_SHARED | L_PTE_DIRTY) #define FIXMAP_PAGE_NOCACHE FIXMAP_PAGE_IO static inline unsigned long fix_to_virt(const unsigned int idx) { if (idx >= FIX_KMAP_NR_PTES) __this_fixmap_does_not_exist(); return __fix_to_virt(idx); } extern void __early_set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags); static inline unsigned int virt_to_fix(const unsigned long vaddr) { BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); return __virt_to_fix(vaddr); } #include <asm-generic/fixmap.h> #endif
arch/arm/include/asm/io.h +1 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ #include <asm/byteorder.h> #include <asm/memory.h> #include <asm-generic/pci_iomap.h> #include <asm/early_ioremap.h> #include <linux/msm_rtb.h> #include <xen/xen.h> Loading