diff options
Diffstat (limited to 'include/asm-mips/mach-generic')
| -rw-r--r-- | include/asm-mips/mach-generic/gpio.h | 15 | ||||
| -rw-r--r-- | include/asm-mips/mach-generic/ioremap.h | 11 | ||||
| -rw-r--r-- | include/asm-mips/mach-generic/spaces.h | 64 |
3 files changed, 65 insertions, 25 deletions
diff --git a/include/asm-mips/mach-generic/gpio.h b/include/asm-mips/mach-generic/gpio.h new file mode 100644 index 000000000000..6eaf5efedf3a --- /dev/null +++ b/include/asm-mips/mach-generic/gpio.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef __ASM_MACH_GENERIC_GPIO_H | ||
| 2 | #define __ASM_MACH_GENERIC_GPIO_H | ||
| 3 | |||
| 4 | int gpio_request(unsigned gpio, const char *label); | ||
| 5 | void gpio_free(unsigned gpio); | ||
| 6 | int gpio_direction_input(unsigned gpio); | ||
| 7 | int gpio_direction_output(unsigned gpio, int value); | ||
| 8 | int gpio_get_value(unsigned gpio); | ||
| 9 | void gpio_set_value(unsigned gpio, int value); | ||
| 10 | int gpio_to_irq(unsigned gpio); | ||
| 11 | int irq_to_gpio(unsigned irq); | ||
| 12 | |||
| 13 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
| 14 | |||
| 15 | #endif /* __ASM_MACH_GENERIC_GPIO_H */ | ||
diff --git a/include/asm-mips/mach-generic/ioremap.h b/include/asm-mips/mach-generic/ioremap.h index 9b64ff6e485d..b379938d47f0 100644 --- a/include/asm-mips/mach-generic/ioremap.h +++ b/include/asm-mips/mach-generic/ioremap.h | |||
| @@ -20,4 +20,15 @@ static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | |||
| 20 | return phys_addr; | 20 | return phys_addr; |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
| 24 | unsigned long flags) | ||
| 25 | { | ||
| 26 | return NULL; | ||
| 27 | } | ||
| 28 | |||
| 29 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
| 30 | { | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | |||
| 23 | #endif /* __ASM_MACH_GENERIC_IOREMAP_H */ | 34 | #endif /* __ASM_MACH_GENERIC_IOREMAP_H */ |
diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h index 0ae9997bc9a8..c9fa4b14968d 100644 --- a/include/asm-mips/mach-generic/spaces.h +++ b/include/asm-mips/mach-generic/spaces.h | |||
| @@ -10,38 +10,54 @@ | |||
| 10 | #ifndef _ASM_MACH_GENERIC_SPACES_H | 10 | #ifndef _ASM_MACH_GENERIC_SPACES_H |
| 11 | #define _ASM_MACH_GENERIC_SPACES_H | 11 | #define _ASM_MACH_GENERIC_SPACES_H |
| 12 | 12 | ||
| 13 | #include <linux/const.h> | ||
| 14 | |||
| 15 | /* | ||
| 16 | * This gives the physical RAM offset. | ||
| 17 | */ | ||
| 18 | #ifndef PHYS_OFFSET | ||
| 19 | #define PHYS_OFFSET _AC(0, UL) | ||
| 20 | #endif | ||
| 13 | 21 | ||
| 14 | #ifdef CONFIG_32BIT | 22 | #ifdef CONFIG_32BIT |
| 15 | 23 | ||
| 16 | #define CAC_BASE 0x80000000 | 24 | #define CAC_BASE _AC(0x80000000, UL) |
| 17 | #define IO_BASE 0xa0000000 | 25 | #define IO_BASE _AC(0xa0000000, UL) |
| 18 | #define UNCAC_BASE 0xa0000000 | 26 | #define UNCAC_BASE _AC(0xa0000000, UL) |
| 19 | #define MAP_BASE 0xc0000000 | ||
| 20 | 27 | ||
| 21 | /* | 28 | #ifndef MAP_BASE |
| 22 | * This handles the memory map. | 29 | #define MAP_BASE _AC(0xc0000000, UL) |
| 23 | * We handle pages at KSEG0 for kernels with 32 bit address space. | 30 | #endif |
| 24 | */ | ||
| 25 | #define PAGE_OFFSET 0x80000000UL | ||
| 26 | 31 | ||
| 27 | /* | 32 | /* |
| 28 | * Memory above this physical address will be considered highmem. | 33 | * Memory above this physical address will be considered highmem. |
| 29 | */ | 34 | */ |
| 30 | #ifndef HIGHMEM_START | 35 | #ifndef HIGHMEM_START |
| 31 | #define HIGHMEM_START 0x20000000UL | 36 | #define HIGHMEM_START _AC(0x20000000, UL) |
| 32 | #endif | 37 | #endif |
| 33 | 38 | ||
| 34 | #endif /* CONFIG_32BIT */ | 39 | #endif /* CONFIG_32BIT */ |
| 35 | 40 | ||
| 36 | #ifdef CONFIG_64BIT | 41 | #ifdef CONFIG_64BIT |
| 37 | 42 | ||
| 38 | /* | 43 | #ifndef CAC_BASE |
| 39 | * This handles the memory map. | ||
| 40 | */ | ||
| 41 | #ifdef CONFIG_DMA_NONCOHERENT | 44 | #ifdef CONFIG_DMA_NONCOHERENT |
| 42 | #define PAGE_OFFSET 0x9800000000000000UL | 45 | #define CAC_BASE _AC(0x9800000000000000, UL) |
| 43 | #else | 46 | #else |
| 44 | #define PAGE_OFFSET 0xa800000000000000UL | 47 | #define CAC_BASE _AC(0xa800000000000000, UL) |
| 48 | #endif | ||
| 49 | #endif | ||
| 50 | |||
| 51 | #ifndef IO_BASE | ||
| 52 | #define IO_BASE _AC(0x9000000000000000, UL) | ||
| 53 | #endif | ||
| 54 | |||
| 55 | #ifndef UNCAC_BASE | ||
| 56 | #define UNCAC_BASE _AC(0x9000000000000000, UL) | ||
| 57 | #endif | ||
| 58 | |||
| 59 | #ifndef MAP_BASE | ||
| 60 | #define MAP_BASE _AC(0xc000000000000000, UL) | ||
| 45 | #endif | 61 | #endif |
| 46 | 62 | ||
| 47 | /* | 63 | /* |
| @@ -50,22 +66,20 @@ | |||
| 50 | * in the distant future. Nobody will care for a few years :-) | 66 | * in the distant future. Nobody will care for a few years :-) |
| 51 | */ | 67 | */ |
| 52 | #ifndef HIGHMEM_START | 68 | #ifndef HIGHMEM_START |
| 53 | #define HIGHMEM_START (1UL << 59UL) | 69 | #define HIGHMEM_START (_AC(1, UL) << _AC(59, UL)) |
| 54 | #endif | 70 | #endif |
| 55 | 71 | ||
| 56 | #ifdef CONFIG_DMA_NONCOHERENT | ||
| 57 | #define CAC_BASE 0x9800000000000000UL | ||
| 58 | #else | ||
| 59 | #define CAC_BASE 0xa800000000000000UL | ||
| 60 | #endif | ||
| 61 | #define IO_BASE 0x9000000000000000UL | ||
| 62 | #define UNCAC_BASE 0x9000000000000000UL | ||
| 63 | #define MAP_BASE 0xc000000000000000UL | ||
| 64 | |||
| 65 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) | 72 | #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) |
| 66 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) | 73 | #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) |
| 67 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) | 74 | #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) |
| 68 | 75 | ||
| 69 | #endif /* CONFIG_64BIT */ | 76 | #endif /* CONFIG_64BIT */ |
| 70 | 77 | ||
| 78 | /* | ||
| 79 | * This handles the memory map. | ||
| 80 | */ | ||
| 81 | #ifndef PAGE_OFFSET | ||
| 82 | #define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET) | ||
| 83 | #endif | ||
| 84 | |||
| 71 | #endif /* __ASM_MACH_GENERIC_SPACES_H */ | 85 | #endif /* __ASM_MACH_GENERIC_SPACES_H */ |
