diff options
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boot/Makefile | 8 | ||||
-rw-r--r-- | arch/sh/include/asm/dma-mapping.h | 28 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/shmobile/cpuidle.c | 10 | ||||
-rw-r--r-- | arch/sh/kernel/dma-nommu.c | 4 | ||||
-rw-r--r-- | arch/sh/mm/consistent.c | 6 |
5 files changed, 29 insertions, 27 deletions
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile index e4ea31a62c55..58592dfa5cb6 100644 --- a/arch/sh/boot/Makefile +++ b/arch/sh/boot/Makefile | |||
@@ -8,8 +8,6 @@ | |||
8 | # Copyright (C) 1999 Stuart Menefy | 8 | # Copyright (C) 1999 Stuart Menefy |
9 | # | 9 | # |
10 | 10 | ||
11 | MKIMAGE := $(srctree)/scripts/mkuboot.sh | ||
12 | |||
13 | # | 11 | # |
14 | # Assign safe dummy values if these variables are not defined, | 12 | # Assign safe dummy values if these variables are not defined, |
15 | # in order to suppress error message. | 13 | # in order to suppress error message. |
@@ -61,10 +59,8 @@ KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \ | |||
61 | $(KERNEL_MEMORY) + \ | 59 | $(KERNEL_MEMORY) + \ |
62 | $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') | 60 | $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') |
63 | 61 | ||
64 | quiet_cmd_uimage = UIMAGE $@ | 62 | UIMAGE_LOADADDR = $(KERNEL_LOAD) |
65 | cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ | 63 | UIMAGE_ENTRYADDR = $(KERNEL_ENTRY) |
66 | -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \ | ||
67 | -n 'Linux-$(KERNELRELEASE)' -d $< $@ | ||
68 | 64 | ||
69 | $(obj)/vmlinux.bin: vmlinux FORCE | 65 | $(obj)/vmlinux.bin: vmlinux FORCE |
70 | $(call if_changed,objcopy) | 66 | $(call if_changed,objcopy) |
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index 1a73c3e759a7..8bd965e00a15 100644 --- a/arch/sh/include/asm/dma-mapping.h +++ b/arch/sh/include/asm/dma-mapping.h | |||
@@ -52,25 +52,31 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
52 | return dma_addr == 0; | 52 | return dma_addr == 0; |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 55 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
56 | dma_addr_t *dma_handle, gfp_t gfp) | 56 | |
57 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
58 | dma_addr_t *dma_handle, gfp_t gfp, | ||
59 | struct dma_attrs *attrs) | ||
57 | { | 60 | { |
58 | struct dma_map_ops *ops = get_dma_ops(dev); | 61 | struct dma_map_ops *ops = get_dma_ops(dev); |
59 | void *memory; | 62 | void *memory; |
60 | 63 | ||
61 | if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) | 64 | if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) |
62 | return memory; | 65 | return memory; |
63 | if (!ops->alloc_coherent) | 66 | if (!ops->alloc) |
64 | return NULL; | 67 | return NULL; |
65 | 68 | ||
66 | memory = ops->alloc_coherent(dev, size, dma_handle, gfp); | 69 | memory = ops->alloc(dev, size, dma_handle, gfp, attrs); |
67 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); | 70 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); |
68 | 71 | ||
69 | return memory; | 72 | return memory; |
70 | } | 73 | } |
71 | 74 | ||
72 | static inline void dma_free_coherent(struct device *dev, size_t size, | 75 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
73 | void *vaddr, dma_addr_t dma_handle) | 76 | |
77 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
78 | void *vaddr, dma_addr_t dma_handle, | ||
79 | struct dma_attrs *attrs) | ||
74 | { | 80 | { |
75 | struct dma_map_ops *ops = get_dma_ops(dev); | 81 | struct dma_map_ops *ops = get_dma_ops(dev); |
76 | 82 | ||
@@ -78,14 +84,16 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
78 | return; | 84 | return; |
79 | 85 | ||
80 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); | 86 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); |
81 | if (ops->free_coherent) | 87 | if (ops->free) |
82 | ops->free_coherent(dev, size, vaddr, dma_handle); | 88 | ops->free(dev, size, vaddr, dma_handle, attrs); |
83 | } | 89 | } |
84 | 90 | ||
85 | /* arch/sh/mm/consistent.c */ | 91 | /* arch/sh/mm/consistent.c */ |
86 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 92 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
87 | dma_addr_t *dma_addr, gfp_t flag); | 93 | dma_addr_t *dma_addr, gfp_t flag, |
94 | struct dma_attrs *attrs); | ||
88 | extern void dma_generic_free_coherent(struct device *dev, size_t size, | 95 | extern void dma_generic_free_coherent(struct device *dev, size_t size, |
89 | void *vaddr, dma_addr_t dma_handle); | 96 | void *vaddr, dma_addr_t dma_handle, |
97 | struct dma_attrs *attrs); | ||
90 | 98 | ||
91 | #endif /* __ASM_SH_DMA_MAPPING_H */ | 99 | #endif /* __ASM_SH_DMA_MAPPING_H */ |
diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c index 6d62eb40e750..1ddc876d3b26 100644 --- a/arch/sh/kernel/cpu/shmobile/cpuidle.c +++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c | |||
@@ -29,7 +29,6 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev, | |||
29 | int index) | 29 | int index) |
30 | { | 30 | { |
31 | unsigned long allowed_mode = SUSP_SH_SLEEP; | 31 | unsigned long allowed_mode = SUSP_SH_SLEEP; |
32 | ktime_t before, after; | ||
33 | int requested_state = index; | 32 | int requested_state = index; |
34 | int allowed_state; | 33 | int allowed_state; |
35 | int k; | 34 | int k; |
@@ -47,19 +46,16 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev, | |||
47 | */ | 46 | */ |
48 | k = min_t(int, allowed_state, requested_state); | 47 | k = min_t(int, allowed_state, requested_state); |
49 | 48 | ||
50 | before = ktime_get(); | ||
51 | sh_mobile_call_standby(cpuidle_mode[k]); | 49 | sh_mobile_call_standby(cpuidle_mode[k]); |
52 | after = ktime_get(); | ||
53 | |||
54 | dev->last_residency = (int)ktime_to_ns(ktime_sub(after, before)) >> 10; | ||
55 | 50 | ||
56 | return k; | 51 | return k; |
57 | } | 52 | } |
58 | 53 | ||
59 | static struct cpuidle_device cpuidle_dev; | 54 | static struct cpuidle_device cpuidle_dev; |
60 | static struct cpuidle_driver cpuidle_driver = { | 55 | static struct cpuidle_driver cpuidle_driver = { |
61 | .name = "sh_idle", | 56 | .name = "sh_idle", |
62 | .owner = THIS_MODULE, | 57 | .owner = THIS_MODULE, |
58 | .en_core_tk_irqen = 1, | ||
63 | }; | 59 | }; |
64 | 60 | ||
65 | void sh_mobile_setup_cpuidle(void) | 61 | void sh_mobile_setup_cpuidle(void) |
diff --git a/arch/sh/kernel/dma-nommu.c b/arch/sh/kernel/dma-nommu.c index 3c55b87f8b63..5b0bfcda6d0b 100644 --- a/arch/sh/kernel/dma-nommu.c +++ b/arch/sh/kernel/dma-nommu.c | |||
@@ -63,8 +63,8 @@ static void nommu_sync_sg(struct device *dev, struct scatterlist *sg, | |||
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | struct dma_map_ops nommu_dma_ops = { | 65 | struct dma_map_ops nommu_dma_ops = { |
66 | .alloc_coherent = dma_generic_alloc_coherent, | 66 | .alloc = dma_generic_alloc_coherent, |
67 | .free_coherent = dma_generic_free_coherent, | 67 | .free = dma_generic_free_coherent, |
68 | .map_page = nommu_map_page, | 68 | .map_page = nommu_map_page, |
69 | .map_sg = nommu_map_sg, | 69 | .map_sg = nommu_map_sg, |
70 | #ifdef CONFIG_DMA_NONCOHERENT | 70 | #ifdef CONFIG_DMA_NONCOHERENT |
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index f251b5f27652..b81d9dbf9fef 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
@@ -33,7 +33,8 @@ static int __init dma_init(void) | |||
33 | fs_initcall(dma_init); | 33 | fs_initcall(dma_init); |
34 | 34 | ||
35 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 35 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
36 | dma_addr_t *dma_handle, gfp_t gfp) | 36 | dma_addr_t *dma_handle, gfp_t gfp, |
37 | struct dma_attrs *attrs) | ||
37 | { | 38 | { |
38 | void *ret, *ret_nocache; | 39 | void *ret, *ret_nocache; |
39 | int order = get_order(size); | 40 | int order = get_order(size); |
@@ -64,7 +65,8 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, | |||
64 | } | 65 | } |
65 | 66 | ||
66 | void dma_generic_free_coherent(struct device *dev, size_t size, | 67 | void dma_generic_free_coherent(struct device *dev, size_t size, |
67 | void *vaddr, dma_addr_t dma_handle) | 68 | void *vaddr, dma_addr_t dma_handle, |
69 | struct dma_attrs *attrs) | ||
68 | { | 70 | { |
69 | int order = get_order(size); | 71 | int order = get_order(size); |
70 | unsigned long pfn = dma_handle >> PAGE_SHIFT; | 72 | unsigned long pfn = dma_handle >> PAGE_SHIFT; |