blob: 58cfe9f1a687e6e1c8794f5ff5f37c6b4fcd7cb9 [file] [log] [blame]
Nicolas Pitre5f0fbf92008-09-16 13:05:53 -04001#ifndef _ASM_FIXMAP_H
2#define _ASM_FIXMAP_H
3
Liu Huaa05e54c2014-04-18 09:43:32 +01004#define FIXADDR_START 0xffc00000UL
Rob Herring836a2412014-07-02 02:01:15 -05005#define FIXADDR_END 0xfff00000UL
Mark Salterb615bbb2014-08-13 09:04:49 -07006#define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE)
Nicolas Pitre5f0fbf92008-09-16 13:05:53 -04007
Mark Salterb615bbb2014-08-13 09:04:49 -07008#include <asm/kmap_types.h>
Stefan Agnera5f4c562015-08-13 00:01:52 +01009#include <asm/pgtable.h>
Nicolas Pitre5f0fbf92008-09-16 13:05:53 -040010
Mark Salterb615bbb2014-08-13 09:04:49 -070011enum fixed_addresses {
Stefan Agnera5f4c562015-08-13 00:01:52 +010012 FIX_EARLYCON_MEM_BASE,
13 __end_of_permanent_fixed_addresses,
14
15 FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses,
Mark Salterb615bbb2014-08-13 09:04:49 -070016 FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,
Nicolas Pitre5f0fbf92008-09-16 13:05:53 -040017
Rabin Vincentab0615e2014-04-24 23:28:57 +020018 /* Support writing RO kernel text via kprobes, jump labels, etc. */
19 FIX_TEXT_POKE0,
20 FIX_TEXT_POKE1,
21
Mark Salterb615bbb2014-08-13 09:04:49 -070022 __end_of_fixed_addresses
23};
Nicolas Pitre5f0fbf92008-09-16 13:05:53 -040024
Stefan Agnera5f4c562015-08-13 00:01:52 +010025#define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN | L_PTE_DIRTY)
26
27#define FIXMAP_PAGE_NORMAL (FIXMAP_PAGE_COMMON | L_PTE_MT_WRITEBACK)
28
29/* Used by set_fixmap_(io|nocache), both meant for mapping a device */
30#define FIXMAP_PAGE_IO (FIXMAP_PAGE_COMMON | L_PTE_MT_DEV_SHARED | L_PTE_SHARED)
31#define FIXMAP_PAGE_NOCACHE FIXMAP_PAGE_IO
32
Kees Cook99b4ac92014-04-04 23:27:49 +020033void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot);
Stefan Agnera5f4c562015-08-13 00:01:52 +010034void __init early_fixmap_init(void);
Kees Cook99b4ac92014-04-04 23:27:49 +020035
Mark Salterb615bbb2014-08-13 09:04:49 -070036#include <asm-generic/fixmap.h>
Nicolas Pitre5f0fbf92008-09-16 13:05:53 -040037
38#endif