Commit 51db13aa authored by Linus Walleij's avatar Linus Walleij Committed by Russell King (Oracle)

ARM: 9388/2: mm: Type-annotate all per-processor assembly routines

Type tag the remaining per-processor assembly using the CFI
symbol macros, in addition to those that were previously tagged
for cache maintenance calls.

This will be used to finally provide proper C prototypes for
all these calls as well so that CFI can be made to work.
Tested-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarSami Tolvanen <samitolvanen@google.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
parent b4d20eff
...@@ -57,18 +57,20 @@ ...@@ -57,18 +57,20 @@
/* /*
* cpu_arm1020_proc_init() * cpu_arm1020_proc_init()
*/ */
ENTRY(cpu_arm1020_proc_init) SYM_TYPED_FUNC_START(cpu_arm1020_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm1020_proc_init)
/* /*
* cpu_arm1020_proc_fin() * cpu_arm1020_proc_fin()
*/ */
ENTRY(cpu_arm1020_proc_fin) SYM_TYPED_FUNC_START(cpu_arm1020_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm1020_proc_fin)
/* /*
* cpu_arm1020_reset(loc) * cpu_arm1020_reset(loc)
...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1020_proc_fin) ...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1020_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm1020_reset) SYM_TYPED_FUNC_START(cpu_arm1020_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1020_reset) ...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1020_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm1020_reset) SYM_FUNC_END(cpu_arm1020_reset)
.popsection .popsection
/* /*
* cpu_arm1020_do_idle() * cpu_arm1020_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm1020_do_idle) SYM_TYPED_FUNC_START(cpu_arm1020_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm1020_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -360,7 +363,7 @@ SYM_TYPED_FUNC_START(arm1020_dma_unmap_area) ...@@ -360,7 +363,7 @@ SYM_TYPED_FUNC_START(arm1020_dma_unmap_area)
SYM_FUNC_END(arm1020_dma_unmap_area) SYM_FUNC_END(arm1020_dma_unmap_area)
.align 5 .align 5
ENTRY(cpu_arm1020_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm1020_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mov ip, #0 mov ip, #0
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
...@@ -370,6 +373,7 @@ ENTRY(cpu_arm1020_dcache_clean_area) ...@@ -370,6 +373,7 @@ ENTRY(cpu_arm1020_dcache_clean_area)
bhi 1b bhi 1b
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm1020_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -381,7 +385,7 @@ ENTRY(cpu_arm1020_dcache_clean_area) ...@@ -381,7 +385,7 @@ ENTRY(cpu_arm1020_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm1020_switch_mm) SYM_TYPED_FUNC_START(cpu_arm1020_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mcr p15, 0, r3, c7, c10, 4 mcr p15, 0, r3, c7, c10, 4
...@@ -409,6 +413,7 @@ ENTRY(cpu_arm1020_switch_mm) ...@@ -409,6 +413,7 @@ ENTRY(cpu_arm1020_switch_mm)
mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
ret lr ret lr
SYM_FUNC_END(cpu_arm1020_switch_mm)
/* /*
* cpu_arm1020_set_pte(ptep, pte) * cpu_arm1020_set_pte(ptep, pte)
...@@ -416,7 +421,7 @@ ENTRY(cpu_arm1020_switch_mm) ...@@ -416,7 +421,7 @@ ENTRY(cpu_arm1020_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm1020_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm1020_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -427,6 +432,7 @@ ENTRY(cpu_arm1020_set_pte_ext) ...@@ -427,6 +432,7 @@ ENTRY(cpu_arm1020_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
ret lr ret lr
SYM_FUNC_END(cpu_arm1020_set_pte_ext)
.type __arm1020_setup, #function .type __arm1020_setup, #function
__arm1020_setup: __arm1020_setup:
......
...@@ -57,18 +57,20 @@ ...@@ -57,18 +57,20 @@
/* /*
* cpu_arm1020e_proc_init() * cpu_arm1020e_proc_init()
*/ */
ENTRY(cpu_arm1020e_proc_init) SYM_TYPED_FUNC_START(cpu_arm1020e_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm1020e_proc_init)
/* /*
* cpu_arm1020e_proc_fin() * cpu_arm1020e_proc_fin()
*/ */
ENTRY(cpu_arm1020e_proc_fin) SYM_TYPED_FUNC_START(cpu_arm1020e_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm1020e_proc_fin)
/* /*
* cpu_arm1020e_reset(loc) * cpu_arm1020e_reset(loc)
...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1020e_proc_fin) ...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1020e_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm1020e_reset) SYM_TYPED_FUNC_START(cpu_arm1020e_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1020e_reset) ...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1020e_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm1020e_reset) SYM_FUNC_END(cpu_arm1020e_reset)
.popsection .popsection
/* /*
* cpu_arm1020e_do_idle() * cpu_arm1020e_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm1020e_do_idle) SYM_TYPED_FUNC_START(cpu_arm1020e_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm1020e_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -347,7 +350,7 @@ SYM_TYPED_FUNC_START(arm1020e_dma_unmap_area) ...@@ -347,7 +350,7 @@ SYM_TYPED_FUNC_START(arm1020e_dma_unmap_area)
SYM_FUNC_END(arm1020e_dma_unmap_area) SYM_FUNC_END(arm1020e_dma_unmap_area)
.align 5 .align 5
ENTRY(cpu_arm1020e_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm1020e_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mov ip, #0 mov ip, #0
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
...@@ -356,6 +359,7 @@ ENTRY(cpu_arm1020e_dcache_clean_area) ...@@ -356,6 +359,7 @@ ENTRY(cpu_arm1020e_dcache_clean_area)
bhi 1b bhi 1b
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm1020e_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -367,7 +371,7 @@ ENTRY(cpu_arm1020e_dcache_clean_area) ...@@ -367,7 +371,7 @@ ENTRY(cpu_arm1020e_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm1020e_switch_mm) SYM_TYPED_FUNC_START(cpu_arm1020e_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mcr p15, 0, r3, c7, c10, 4 mcr p15, 0, r3, c7, c10, 4
...@@ -394,6 +398,7 @@ ENTRY(cpu_arm1020e_switch_mm) ...@@ -394,6 +398,7 @@ ENTRY(cpu_arm1020e_switch_mm)
mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm1020e_switch_mm)
/* /*
* cpu_arm1020e_set_pte(ptep, pte) * cpu_arm1020e_set_pte(ptep, pte)
...@@ -401,7 +406,7 @@ ENTRY(cpu_arm1020e_switch_mm) ...@@ -401,7 +406,7 @@ ENTRY(cpu_arm1020e_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm1020e_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm1020e_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -410,6 +415,7 @@ ENTRY(cpu_arm1020e_set_pte_ext) ...@@ -410,6 +415,7 @@ ENTRY(cpu_arm1020e_set_pte_ext)
#endif #endif
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
ret lr ret lr
SYM_FUNC_END(cpu_arm1020e_set_pte_ext)
.type __arm1020e_setup, #function .type __arm1020e_setup, #function
__arm1020e_setup: __arm1020e_setup:
......
...@@ -57,18 +57,20 @@ ...@@ -57,18 +57,20 @@
/* /*
* cpu_arm1022_proc_init() * cpu_arm1022_proc_init()
*/ */
ENTRY(cpu_arm1022_proc_init) SYM_TYPED_FUNC_START(cpu_arm1022_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm1022_proc_init)
/* /*
* cpu_arm1022_proc_fin() * cpu_arm1022_proc_fin()
*/ */
ENTRY(cpu_arm1022_proc_fin) SYM_TYPED_FUNC_START(cpu_arm1022_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm1022_proc_fin)
/* /*
* cpu_arm1022_reset(loc) * cpu_arm1022_reset(loc)
...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1022_proc_fin) ...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1022_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm1022_reset) SYM_TYPED_FUNC_START(cpu_arm1022_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1022_reset) ...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1022_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm1022_reset) SYM_FUNC_END(cpu_arm1022_reset)
.popsection .popsection
/* /*
* cpu_arm1022_do_idle() * cpu_arm1022_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm1022_do_idle) SYM_TYPED_FUNC_START(cpu_arm1022_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm1022_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -346,7 +349,7 @@ SYM_TYPED_FUNC_START(arm1022_dma_unmap_area) ...@@ -346,7 +349,7 @@ SYM_TYPED_FUNC_START(arm1022_dma_unmap_area)
SYM_FUNC_END(arm1022_dma_unmap_area) SYM_FUNC_END(arm1022_dma_unmap_area)
.align 5 .align 5
ENTRY(cpu_arm1022_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm1022_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mov ip, #0 mov ip, #0
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
...@@ -355,6 +358,7 @@ ENTRY(cpu_arm1022_dcache_clean_area) ...@@ -355,6 +358,7 @@ ENTRY(cpu_arm1022_dcache_clean_area)
bhi 1b bhi 1b
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm1022_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -366,7 +370,7 @@ ENTRY(cpu_arm1022_dcache_clean_area) ...@@ -366,7 +370,7 @@ ENTRY(cpu_arm1022_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm1022_switch_mm) SYM_TYPED_FUNC_START(cpu_arm1022_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments
...@@ -386,6 +390,7 @@ ENTRY(cpu_arm1022_switch_mm) ...@@ -386,6 +390,7 @@ ENTRY(cpu_arm1022_switch_mm)
mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm1022_switch_mm)
/* /*
* cpu_arm1022_set_pte_ext(ptep, pte, ext) * cpu_arm1022_set_pte_ext(ptep, pte, ext)
...@@ -393,7 +398,7 @@ ENTRY(cpu_arm1022_switch_mm) ...@@ -393,7 +398,7 @@ ENTRY(cpu_arm1022_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm1022_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm1022_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -402,6 +407,7 @@ ENTRY(cpu_arm1022_set_pte_ext) ...@@ -402,6 +407,7 @@ ENTRY(cpu_arm1022_set_pte_ext)
#endif #endif
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
ret lr ret lr
SYM_FUNC_END(cpu_arm1022_set_pte_ext)
.type __arm1022_setup, #function .type __arm1022_setup, #function
__arm1022_setup: __arm1022_setup:
......
...@@ -57,18 +57,20 @@ ...@@ -57,18 +57,20 @@
/* /*
* cpu_arm1026_proc_init() * cpu_arm1026_proc_init()
*/ */
ENTRY(cpu_arm1026_proc_init) SYM_TYPED_FUNC_START(cpu_arm1026_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm1026_proc_init)
/* /*
* cpu_arm1026_proc_fin() * cpu_arm1026_proc_fin()
*/ */
ENTRY(cpu_arm1026_proc_fin) SYM_TYPED_FUNC_START(cpu_arm1026_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm1026_proc_fin)
/* /*
* cpu_arm1026_reset(loc) * cpu_arm1026_reset(loc)
...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1026_proc_fin) ...@@ -81,7 +83,7 @@ ENTRY(cpu_arm1026_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm1026_reset) SYM_TYPED_FUNC_START(cpu_arm1026_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1026_reset) ...@@ -93,16 +95,17 @@ ENTRY(cpu_arm1026_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm1026_reset) SYM_FUNC_END(cpu_arm1026_reset)
.popsection .popsection
/* /*
* cpu_arm1026_do_idle() * cpu_arm1026_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm1026_do_idle) SYM_TYPED_FUNC_START(cpu_arm1026_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm1026_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -341,7 +344,7 @@ SYM_TYPED_FUNC_START(arm1026_dma_unmap_area) ...@@ -341,7 +344,7 @@ SYM_TYPED_FUNC_START(arm1026_dma_unmap_area)
SYM_FUNC_END(arm1026_dma_unmap_area) SYM_FUNC_END(arm1026_dma_unmap_area)
.align 5 .align 5
ENTRY(cpu_arm1026_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm1026_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
mov ip, #0 mov ip, #0
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
...@@ -350,6 +353,7 @@ ENTRY(cpu_arm1026_dcache_clean_area) ...@@ -350,6 +353,7 @@ ENTRY(cpu_arm1026_dcache_clean_area)
bhi 1b bhi 1b
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm1026_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -361,7 +365,7 @@ ENTRY(cpu_arm1026_dcache_clean_area) ...@@ -361,7 +365,7 @@ ENTRY(cpu_arm1026_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm1026_switch_mm) SYM_TYPED_FUNC_START(cpu_arm1026_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov r1, #0 mov r1, #0
#ifndef CONFIG_CPU_DCACHE_DISABLE #ifndef CONFIG_CPU_DCACHE_DISABLE
...@@ -376,6 +380,7 @@ ENTRY(cpu_arm1026_switch_mm) ...@@ -376,6 +380,7 @@ ENTRY(cpu_arm1026_switch_mm)
mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm1026_switch_mm)
/* /*
* cpu_arm1026_set_pte_ext(ptep, pte, ext) * cpu_arm1026_set_pte_ext(ptep, pte, ext)
...@@ -383,7 +388,7 @@ ENTRY(cpu_arm1026_switch_mm) ...@@ -383,7 +388,7 @@ ENTRY(cpu_arm1026_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm1026_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm1026_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -392,6 +397,7 @@ ENTRY(cpu_arm1026_set_pte_ext) ...@@ -392,6 +397,7 @@ ENTRY(cpu_arm1026_set_pte_ext)
#endif #endif
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
ret lr ret lr
SYM_FUNC_END(cpu_arm1026_set_pte_ext)
.type __arm1026_setup, #function .type __arm1026_setup, #function
__arm1026_setup: __arm1026_setup:
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
...@@ -35,24 +36,30 @@ ...@@ -35,24 +36,30 @@
* *
* Notes : This processor does not require these * Notes : This processor does not require these
*/ */
ENTRY(cpu_arm720_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm720_dcache_clean_area)
ENTRY(cpu_arm720_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm720_dcache_clean_area)
ENTRY(cpu_arm720_proc_fin) SYM_TYPED_FUNC_START(cpu_arm720_proc_init)
ret lr
SYM_FUNC_END(cpu_arm720_proc_init)
SYM_TYPED_FUNC_START(cpu_arm720_proc_fin)
mrc p15, 0, r0, c1, c0, 0 mrc p15, 0, r0, c1, c0, 0
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm720_proc_fin)
/* /*
* Function: arm720_proc_do_idle(void) * Function: arm720_proc_do_idle(void)
* Params : r0 = unused * Params : r0 = unused
* Purpose : put the processor in proper idle mode * Purpose : put the processor in proper idle mode
*/ */
ENTRY(cpu_arm720_do_idle) SYM_TYPED_FUNC_START(cpu_arm720_do_idle)
ret lr ret lr
SYM_FUNC_END(cpu_arm720_do_idle)
/* /*
* Function: arm720_switch_mm(unsigned long pgd_phys) * Function: arm720_switch_mm(unsigned long pgd_phys)
...@@ -60,7 +67,7 @@ ENTRY(cpu_arm720_do_idle) ...@@ -60,7 +67,7 @@ ENTRY(cpu_arm720_do_idle)
* Purpose : Perform a task switch, saving the old process' state and restoring * Purpose : Perform a task switch, saving the old process' state and restoring
* the new. * the new.
*/ */
ENTRY(cpu_arm720_switch_mm) SYM_TYPED_FUNC_START(cpu_arm720_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov r1, #0 mov r1, #0
mcr p15, 0, r1, c7, c7, 0 @ invalidate cache mcr p15, 0, r1, c7, c7, 0 @ invalidate cache
...@@ -68,6 +75,7 @@ ENTRY(cpu_arm720_switch_mm) ...@@ -68,6 +75,7 @@ ENTRY(cpu_arm720_switch_mm)
mcr p15, 0, r1, c8, c7, 0 @ flush TLB (v4) mcr p15, 0, r1, c8, c7, 0 @ flush TLB (v4)
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm720_switch_mm)
/* /*
* Function: arm720_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext) * Function: arm720_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext)
...@@ -76,11 +84,12 @@ ENTRY(cpu_arm720_switch_mm) ...@@ -76,11 +84,12 @@ ENTRY(cpu_arm720_switch_mm)
* Purpose : Set a PTE and flush it out of any WB cache * Purpose : Set a PTE and flush it out of any WB cache
*/ */
.align 5 .align 5
ENTRY(cpu_arm720_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm720_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext wc_disable=0 armv3_set_pte_ext wc_disable=0
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm720_set_pte_ext)
/* /*
* Function: arm720_reset * Function: arm720_reset
...@@ -88,7 +97,7 @@ ENTRY(cpu_arm720_set_pte_ext) ...@@ -88,7 +97,7 @@ ENTRY(cpu_arm720_set_pte_ext)
* Notes : This sets up everything for a reset * Notes : This sets up everything for a reset
*/ */
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm720_reset) SYM_TYPED_FUNC_START(cpu_arm720_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate cache mcr p15, 0, ip, c7, c7, 0 @ invalidate cache
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
...@@ -99,7 +108,7 @@ ENTRY(cpu_arm720_reset) ...@@ -99,7 +108,7 @@ ENTRY(cpu_arm720_reset)
bic ip, ip, #0x2100 @ ..v....s........ bic ip, ip, #0x2100 @ ..v....s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm720_reset) SYM_FUNC_END(cpu_arm720_reset)
.popsection .popsection
.type __arm710_setup, #function .type __arm710_setup, #function
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
...@@ -24,21 +25,32 @@ ...@@ -24,21 +25,32 @@
* *
* These are not required. * These are not required.
*/ */
ENTRY(cpu_arm740_proc_init) SYM_TYPED_FUNC_START(cpu_arm740_proc_init)
ENTRY(cpu_arm740_do_idle)
ENTRY(cpu_arm740_dcache_clean_area)
ENTRY(cpu_arm740_switch_mm)
ret lr ret lr
SYM_FUNC_END(cpu_arm740_proc_init)
SYM_TYPED_FUNC_START(cpu_arm740_do_idle)
ret lr
SYM_FUNC_END(cpu_arm740_do_idle)
SYM_TYPED_FUNC_START(cpu_arm740_dcache_clean_area)
ret lr
SYM_FUNC_END(cpu_arm740_dcache_clean_area)
SYM_TYPED_FUNC_START(cpu_arm740_switch_mm)
ret lr
SYM_FUNC_END(cpu_arm740_switch_mm)
/* /*
* cpu_arm740_proc_fin() * cpu_arm740_proc_fin()
*/ */
ENTRY(cpu_arm740_proc_fin) SYM_TYPED_FUNC_START(cpu_arm740_proc_fin)
mrc p15, 0, r0, c1, c0, 0 mrc p15, 0, r0, c1, c0, 0
bic r0, r0, #0x3f000000 @ bank/f/lock/s bic r0, r0, #0x3f000000 @ bank/f/lock/s
bic r0, r0, #0x0000000c @ w-buffer/cache bic r0, r0, #0x0000000c @ w-buffer/cache
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm740_proc_fin)
/* /*
* cpu_arm740_reset(loc) * cpu_arm740_reset(loc)
...@@ -46,14 +58,14 @@ ENTRY(cpu_arm740_proc_fin) ...@@ -46,14 +58,14 @@ ENTRY(cpu_arm740_proc_fin)
* Notes : This sets up everything for a reset * Notes : This sets up everything for a reset
*/ */
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm740_reset) SYM_TYPED_FUNC_START(cpu_arm740_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c0, 0 @ invalidate cache mcr p15, 0, ip, c7, c0, 0 @ invalidate cache
mrc p15, 0, ip, c1, c0, 0 @ get ctrl register mrc p15, 0, ip, c1, c0, 0 @ get ctrl register
bic ip, ip, #0x0000000c @ ............wc.. bic ip, ip, #0x0000000c @ ............wc..
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm740_reset) SYM_FUNC_END(cpu_arm740_reset)
.popsection .popsection
.type __arm740_setup, #function .type __arm740_setup, #function
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
...@@ -23,18 +24,29 @@ ...@@ -23,18 +24,29 @@
* cpu_arm7tdmi_switch_mm() * cpu_arm7tdmi_switch_mm()
* *
* These are not required. * These are not required.
*/ */
ENTRY(cpu_arm7tdmi_proc_init) SYM_TYPED_FUNC_START(cpu_arm7tdmi_proc_init)
ENTRY(cpu_arm7tdmi_do_idle) ret lr
ENTRY(cpu_arm7tdmi_dcache_clean_area) SYM_FUNC_END(cpu_arm7tdmi_proc_init)
ENTRY(cpu_arm7tdmi_switch_mm)
SYM_TYPED_FUNC_START(cpu_arm7tdmi_do_idle)
ret lr
SYM_FUNC_END(cpu_arm7tdmi_do_idle)
SYM_TYPED_FUNC_START(cpu_arm7tdmi_dcache_clean_area)
ret lr
SYM_FUNC_END(cpu_arm7tdmi_dcache_clean_area)
SYM_TYPED_FUNC_START(cpu_arm7tdmi_switch_mm)
ret lr ret lr
SYM_FUNC_END(cpu_arm7tdmi_switch_mm)
/* /*
* cpu_arm7tdmi_proc_fin() * cpu_arm7tdmi_proc_fin()
*/ */
ENTRY(cpu_arm7tdmi_proc_fin) SYM_TYPED_FUNC_START(cpu_arm7tdmi_proc_fin)
ret lr ret lr
SYM_FUNC_END(cpu_arm7tdmi_proc_fin)
/* /*
* Function: cpu_arm7tdmi_reset(loc) * Function: cpu_arm7tdmi_reset(loc)
...@@ -42,9 +54,9 @@ ENTRY(cpu_arm7tdmi_proc_fin) ...@@ -42,9 +54,9 @@ ENTRY(cpu_arm7tdmi_proc_fin)
* Purpose : Sets up everything for a reset and jump to the location for soft reset. * Purpose : Sets up everything for a reset and jump to the location for soft reset.
*/ */
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm7tdmi_reset) SYM_TYPED_FUNC_START(cpu_arm7tdmi_reset)
ret r0 ret r0
ENDPROC(cpu_arm7tdmi_reset) SYM_FUNC_END(cpu_arm7tdmi_reset)
.popsection .popsection
.type __arm7tdmi_setup, #function .type __arm7tdmi_setup, #function
......
...@@ -49,18 +49,20 @@ ...@@ -49,18 +49,20 @@
/* /*
* cpu_arm920_proc_init() * cpu_arm920_proc_init()
*/ */
ENTRY(cpu_arm920_proc_init) SYM_TYPED_FUNC_START(cpu_arm920_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm920_proc_init)
/* /*
* cpu_arm920_proc_fin() * cpu_arm920_proc_fin()
*/ */
ENTRY(cpu_arm920_proc_fin) SYM_TYPED_FUNC_START(cpu_arm920_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm920_proc_fin)
/* /*
* cpu_arm920_reset(loc) * cpu_arm920_reset(loc)
...@@ -73,7 +75,7 @@ ENTRY(cpu_arm920_proc_fin) ...@@ -73,7 +75,7 @@ ENTRY(cpu_arm920_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm920_reset) SYM_TYPED_FUNC_START(cpu_arm920_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -85,17 +87,17 @@ ENTRY(cpu_arm920_reset) ...@@ -85,17 +87,17 @@ ENTRY(cpu_arm920_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm920_reset) SYM_FUNC_END(cpu_arm920_reset)
.popsection .popsection
/* /*
* cpu_arm920_do_idle() * cpu_arm920_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm920_do_idle) SYM_TYPED_FUNC_START(cpu_arm920_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm920_do_idle)
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
...@@ -314,12 +316,13 @@ SYM_FUNC_END(arm920_dma_unmap_area) ...@@ -314,12 +316,13 @@ SYM_FUNC_END(arm920_dma_unmap_area)
#endif /* !CONFIG_CPU_DCACHE_WRITETHROUGH */ #endif /* !CONFIG_CPU_DCACHE_WRITETHROUGH */
ENTRY(cpu_arm920_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm920_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHE_DLINESIZE add r0, r0, #CACHE_DLINESIZE
subs r1, r1, #CACHE_DLINESIZE subs r1, r1, #CACHE_DLINESIZE
bhi 1b bhi 1b
ret lr ret lr
SYM_FUNC_END(cpu_arm920_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -331,7 +334,7 @@ ENTRY(cpu_arm920_dcache_clean_area) ...@@ -331,7 +334,7 @@ ENTRY(cpu_arm920_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm920_switch_mm) SYM_TYPED_FUNC_START(cpu_arm920_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov ip, #0 mov ip, #0
#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
...@@ -355,6 +358,7 @@ ENTRY(cpu_arm920_switch_mm) ...@@ -355,6 +358,7 @@ ENTRY(cpu_arm920_switch_mm)
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm920_switch_mm)
/* /*
* cpu_arm920_set_pte(ptep, pte, ext) * cpu_arm920_set_pte(ptep, pte, ext)
...@@ -362,7 +366,7 @@ ENTRY(cpu_arm920_switch_mm) ...@@ -362,7 +366,7 @@ ENTRY(cpu_arm920_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm920_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm920_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -370,21 +374,22 @@ ENTRY(cpu_arm920_set_pte_ext) ...@@ -370,21 +374,22 @@ ENTRY(cpu_arm920_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm920_set_pte_ext)
/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
.globl cpu_arm920_suspend_size .globl cpu_arm920_suspend_size
.equ cpu_arm920_suspend_size, 4 * 3 .equ cpu_arm920_suspend_size, 4 * 3
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_arm920_do_suspend) SYM_TYPED_FUNC_START(cpu_arm920_do_suspend)
stmfd sp!, {r4 - r6, lr} stmfd sp!, {r4 - r6, lr}
mrc p15, 0, r4, c13, c0, 0 @ PID mrc p15, 0, r4, c13, c0, 0 @ PID
mrc p15, 0, r5, c3, c0, 0 @ Domain ID mrc p15, 0, r5, c3, c0, 0 @ Domain ID
mrc p15, 0, r6, c1, c0, 0 @ Control register mrc p15, 0, r6, c1, c0, 0 @ Control register
stmia r0, {r4 - r6} stmia r0, {r4 - r6}
ldmfd sp!, {r4 - r6, pc} ldmfd sp!, {r4 - r6, pc}
ENDPROC(cpu_arm920_do_suspend) SYM_FUNC_END(cpu_arm920_do_suspend)
ENTRY(cpu_arm920_do_resume) SYM_TYPED_FUNC_START(cpu_arm920_do_resume)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
...@@ -394,7 +399,7 @@ ENTRY(cpu_arm920_do_resume) ...@@ -394,7 +399,7 @@ ENTRY(cpu_arm920_do_resume)
mcr p15, 0, r1, c2, c0, 0 @ TTB address mcr p15, 0, r1, c2, c0, 0 @ TTB address
mov r0, r6 @ control register mov r0, r6 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_arm920_do_resume) SYM_FUNC_END(cpu_arm920_do_resume)
#endif #endif
.type __arm920_setup, #function .type __arm920_setup, #function
......
...@@ -51,18 +51,20 @@ ...@@ -51,18 +51,20 @@
/* /*
* cpu_arm922_proc_init() * cpu_arm922_proc_init()
*/ */
ENTRY(cpu_arm922_proc_init) SYM_TYPED_FUNC_START(cpu_arm922_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm922_proc_init)
/* /*
* cpu_arm922_proc_fin() * cpu_arm922_proc_fin()
*/ */
ENTRY(cpu_arm922_proc_fin) SYM_TYPED_FUNC_START(cpu_arm922_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm922_proc_fin)
/* /*
* cpu_arm922_reset(loc) * cpu_arm922_reset(loc)
...@@ -75,7 +77,7 @@ ENTRY(cpu_arm922_proc_fin) ...@@ -75,7 +77,7 @@ ENTRY(cpu_arm922_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm922_reset) SYM_TYPED_FUNC_START(cpu_arm922_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -87,17 +89,17 @@ ENTRY(cpu_arm922_reset) ...@@ -87,17 +89,17 @@ ENTRY(cpu_arm922_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm922_reset) SYM_FUNC_END(cpu_arm922_reset)
.popsection .popsection
/* /*
* cpu_arm922_do_idle() * cpu_arm922_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm922_do_idle) SYM_TYPED_FUNC_START(cpu_arm922_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm922_do_idle)
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
...@@ -315,7 +317,7 @@ SYM_FUNC_END(arm922_dma_unmap_area) ...@@ -315,7 +317,7 @@ SYM_FUNC_END(arm922_dma_unmap_area)
#endif /* !CONFIG_CPU_DCACHE_WRITETHROUGH */ #endif /* !CONFIG_CPU_DCACHE_WRITETHROUGH */
ENTRY(cpu_arm922_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm922_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHE_DLINESIZE add r0, r0, #CACHE_DLINESIZE
...@@ -323,6 +325,7 @@ ENTRY(cpu_arm922_dcache_clean_area) ...@@ -323,6 +325,7 @@ ENTRY(cpu_arm922_dcache_clean_area)
bhi 1b bhi 1b
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm922_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -334,7 +337,7 @@ ENTRY(cpu_arm922_dcache_clean_area) ...@@ -334,7 +337,7 @@ ENTRY(cpu_arm922_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm922_switch_mm) SYM_TYPED_FUNC_START(cpu_arm922_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov ip, #0 mov ip, #0
#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
...@@ -358,6 +361,7 @@ ENTRY(cpu_arm922_switch_mm) ...@@ -358,6 +361,7 @@ ENTRY(cpu_arm922_switch_mm)
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm922_switch_mm)
/* /*
* cpu_arm922_set_pte_ext(ptep, pte, ext) * cpu_arm922_set_pte_ext(ptep, pte, ext)
...@@ -365,7 +369,7 @@ ENTRY(cpu_arm922_switch_mm) ...@@ -365,7 +369,7 @@ ENTRY(cpu_arm922_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm922_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm922_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -373,6 +377,7 @@ ENTRY(cpu_arm922_set_pte_ext) ...@@ -373,6 +377,7 @@ ENTRY(cpu_arm922_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
ret lr ret lr
SYM_FUNC_END(cpu_arm922_set_pte_ext)
.type __arm922_setup, #function .type __arm922_setup, #function
__arm922_setup: __arm922_setup:
......
...@@ -72,18 +72,20 @@ ...@@ -72,18 +72,20 @@
/* /*
* cpu_arm925_proc_init() * cpu_arm925_proc_init()
*/ */
ENTRY(cpu_arm925_proc_init) SYM_TYPED_FUNC_START(cpu_arm925_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm925_proc_init)
/* /*
* cpu_arm925_proc_fin() * cpu_arm925_proc_fin()
*/ */
ENTRY(cpu_arm925_proc_fin) SYM_TYPED_FUNC_START(cpu_arm925_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm925_proc_fin)
/* /*
* cpu_arm925_reset(loc) * cpu_arm925_reset(loc)
...@@ -96,14 +98,14 @@ ENTRY(cpu_arm925_proc_fin) ...@@ -96,14 +98,14 @@ ENTRY(cpu_arm925_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm925_reset) SYM_TYPED_FUNC_START(cpu_arm925_reset)
/* Send software reset to MPU and DSP */ /* Send software reset to MPU and DSP */
mov ip, #0xff000000 mov ip, #0xff000000
orr ip, ip, #0x00fe0000 orr ip, ip, #0x00fe0000
orr ip, ip, #0x0000ce00 orr ip, ip, #0x0000ce00
mov r4, #1 mov r4, #1
strh r4, [ip, #0x10] strh r4, [ip, #0x10]
ENDPROC(cpu_arm925_reset) SYM_FUNC_END(cpu_arm925_reset)
.popsection .popsection
mov ip, #0 mov ip, #0
...@@ -124,7 +126,7 @@ ENDPROC(cpu_arm925_reset) ...@@ -124,7 +126,7 @@ ENDPROC(cpu_arm925_reset)
* Called with IRQs disabled * Called with IRQs disabled
*/ */
.align 10 .align 10
ENTRY(cpu_arm925_do_idle) SYM_TYPED_FUNC_START(cpu_arm925_do_idle)
mov r0, #0 mov r0, #0
mrc p15, 0, r1, c1, c0, 0 @ Read control register mrc p15, 0, r1, c1, c0, 0 @ Read control register
mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer
...@@ -133,6 +135,7 @@ ENTRY(cpu_arm925_do_idle) ...@@ -133,6 +135,7 @@ ENTRY(cpu_arm925_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
mcr p15, 0, r1, c1, c0, 0 @ Restore ICache enable mcr p15, 0, r1, c1, c0, 0 @ Restore ICache enable
ret lr ret lr
SYM_FUNC_END(cpu_arm925_do_idle)
/* /*
* flush_icache_all() * flush_icache_all()
...@@ -368,7 +371,7 @@ SYM_TYPED_FUNC_START(arm925_dma_unmap_area) ...@@ -368,7 +371,7 @@ SYM_TYPED_FUNC_START(arm925_dma_unmap_area)
ret lr ret lr
SYM_FUNC_END(arm925_dma_unmap_area) SYM_FUNC_END(arm925_dma_unmap_area)
ENTRY(cpu_arm925_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm925_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHE_DLINESIZE add r0, r0, #CACHE_DLINESIZE
...@@ -377,6 +380,7 @@ ENTRY(cpu_arm925_dcache_clean_area) ...@@ -377,6 +380,7 @@ ENTRY(cpu_arm925_dcache_clean_area)
#endif #endif
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
ret lr ret lr
SYM_FUNC_END(cpu_arm925_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -388,7 +392,7 @@ ENTRY(cpu_arm925_dcache_clean_area) ...@@ -388,7 +392,7 @@ ENTRY(cpu_arm925_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm925_switch_mm) SYM_TYPED_FUNC_START(cpu_arm925_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov ip, #0 mov ip, #0
#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
...@@ -406,6 +410,7 @@ ENTRY(cpu_arm925_switch_mm) ...@@ -406,6 +410,7 @@ ENTRY(cpu_arm925_switch_mm)
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm925_switch_mm)
/* /*
* cpu_arm925_set_pte_ext(ptep, pte, ext) * cpu_arm925_set_pte_ext(ptep, pte, ext)
...@@ -413,7 +418,7 @@ ENTRY(cpu_arm925_switch_mm) ...@@ -413,7 +418,7 @@ ENTRY(cpu_arm925_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm925_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm925_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -423,6 +428,7 @@ ENTRY(cpu_arm925_set_pte_ext) ...@@ -423,6 +428,7 @@ ENTRY(cpu_arm925_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
ret lr ret lr
SYM_FUNC_END(cpu_arm925_set_pte_ext)
.type __arm925_setup, #function .type __arm925_setup, #function
__arm925_setup: __arm925_setup:
......
...@@ -41,18 +41,20 @@ ...@@ -41,18 +41,20 @@
/* /*
* cpu_arm926_proc_init() * cpu_arm926_proc_init()
*/ */
ENTRY(cpu_arm926_proc_init) SYM_TYPED_FUNC_START(cpu_arm926_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_arm926_proc_init)
/* /*
* cpu_arm926_proc_fin() * cpu_arm926_proc_fin()
*/ */
ENTRY(cpu_arm926_proc_fin) SYM_TYPED_FUNC_START(cpu_arm926_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm926_proc_fin)
/* /*
* cpu_arm926_reset(loc) * cpu_arm926_reset(loc)
...@@ -65,7 +67,7 @@ ENTRY(cpu_arm926_proc_fin) ...@@ -65,7 +67,7 @@ ENTRY(cpu_arm926_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm926_reset) SYM_TYPED_FUNC_START(cpu_arm926_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -77,7 +79,7 @@ ENTRY(cpu_arm926_reset) ...@@ -77,7 +79,7 @@ ENTRY(cpu_arm926_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm926_reset) SYM_FUNC_END(cpu_arm926_reset)
.popsection .popsection
/* /*
...@@ -86,7 +88,7 @@ ENDPROC(cpu_arm926_reset) ...@@ -86,7 +88,7 @@ ENDPROC(cpu_arm926_reset)
* Called with IRQs disabled * Called with IRQs disabled
*/ */
.align 10 .align 10
ENTRY(cpu_arm926_do_idle) SYM_TYPED_FUNC_START(cpu_arm926_do_idle)
mov r0, #0 mov r0, #0
mrc p15, 0, r1, c1, c0, 0 @ Read control register mrc p15, 0, r1, c1, c0, 0 @ Read control register
mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer
...@@ -99,6 +101,7 @@ ENTRY(cpu_arm926_do_idle) ...@@ -99,6 +101,7 @@ ENTRY(cpu_arm926_do_idle)
mcr p15, 0, r1, c1, c0, 0 @ Restore ICache enable mcr p15, 0, r1, c1, c0, 0 @ Restore ICache enable
msr cpsr_c, r3 @ Restore FIQ state msr cpsr_c, r3 @ Restore FIQ state
ret lr ret lr
SYM_FUNC_END(cpu_arm926_do_idle)
/* /*
* flush_icache_all() * flush_icache_all()
...@@ -331,7 +334,7 @@ SYM_TYPED_FUNC_START(arm926_dma_unmap_area) ...@@ -331,7 +334,7 @@ SYM_TYPED_FUNC_START(arm926_dma_unmap_area)
ret lr ret lr
SYM_FUNC_END(arm926_dma_unmap_area) SYM_FUNC_END(arm926_dma_unmap_area)
ENTRY(cpu_arm926_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm926_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHE_DLINESIZE add r0, r0, #CACHE_DLINESIZE
...@@ -340,6 +343,7 @@ ENTRY(cpu_arm926_dcache_clean_area) ...@@ -340,6 +343,7 @@ ENTRY(cpu_arm926_dcache_clean_area)
#endif #endif
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
ret lr ret lr
SYM_FUNC_END(cpu_arm926_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -351,7 +355,8 @@ ENTRY(cpu_arm926_dcache_clean_area) ...@@ -351,7 +355,8 @@ ENTRY(cpu_arm926_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_arm926_switch_mm)
SYM_TYPED_FUNC_START(cpu_arm926_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov ip, #0 mov ip, #0
#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
...@@ -367,6 +372,7 @@ ENTRY(cpu_arm926_switch_mm) ...@@ -367,6 +372,7 @@ ENTRY(cpu_arm926_switch_mm)
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm926_switch_mm)
/* /*
* cpu_arm926_set_pte_ext(ptep, pte, ext) * cpu_arm926_set_pte_ext(ptep, pte, ext)
...@@ -374,7 +380,7 @@ ENTRY(cpu_arm926_switch_mm) ...@@ -374,7 +380,7 @@ ENTRY(cpu_arm926_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_arm926_set_pte_ext) SYM_TYPED_FUNC_START(cpu_arm926_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -384,21 +390,22 @@ ENTRY(cpu_arm926_set_pte_ext) ...@@ -384,21 +390,22 @@ ENTRY(cpu_arm926_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_arm926_set_pte_ext)
/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
.globl cpu_arm926_suspend_size .globl cpu_arm926_suspend_size
.equ cpu_arm926_suspend_size, 4 * 3 .equ cpu_arm926_suspend_size, 4 * 3
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_arm926_do_suspend) SYM_TYPED_FUNC_START(cpu_arm926_do_suspend)
stmfd sp!, {r4 - r6, lr} stmfd sp!, {r4 - r6, lr}
mrc p15, 0, r4, c13, c0, 0 @ PID mrc p15, 0, r4, c13, c0, 0 @ PID
mrc p15, 0, r5, c3, c0, 0 @ Domain ID mrc p15, 0, r5, c3, c0, 0 @ Domain ID
mrc p15, 0, r6, c1, c0, 0 @ Control register mrc p15, 0, r6, c1, c0, 0 @ Control register
stmia r0, {r4 - r6} stmia r0, {r4 - r6}
ldmfd sp!, {r4 - r6, pc} ldmfd sp!, {r4 - r6, pc}
ENDPROC(cpu_arm926_do_suspend) SYM_FUNC_END(cpu_arm926_do_suspend)
ENTRY(cpu_arm926_do_resume) SYM_TYPED_FUNC_START(cpu_arm926_do_resume)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
...@@ -408,7 +415,7 @@ ENTRY(cpu_arm926_do_resume) ...@@ -408,7 +415,7 @@ ENTRY(cpu_arm926_do_resume)
mcr p15, 0, r1, c2, c0, 0 @ TTB address mcr p15, 0, r1, c2, c0, 0 @ TTB address
mov r0, r6 @ control register mov r0, r6 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_arm926_do_resume) SYM_FUNC_END(cpu_arm926_do_resume)
#endif #endif
.type __arm926_setup, #function .type __arm926_setup, #function
......
...@@ -26,19 +26,24 @@ ...@@ -26,19 +26,24 @@
* *
* These are not required. * These are not required.
*/ */
ENTRY(cpu_arm940_proc_init) SYM_TYPED_FUNC_START(cpu_arm940_proc_init)
ENTRY(cpu_arm940_switch_mm)
ret lr ret lr
SYM_FUNC_END(cpu_arm940_proc_init)
SYM_TYPED_FUNC_START(cpu_arm940_switch_mm)
ret lr
SYM_FUNC_END(cpu_arm940_switch_mm)
/* /*
* cpu_arm940_proc_fin() * cpu_arm940_proc_fin()
*/ */
ENTRY(cpu_arm940_proc_fin) SYM_TYPED_FUNC_START(cpu_arm940_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x00001000 @ i-cache bic r0, r0, #0x00001000 @ i-cache
bic r0, r0, #0x00000004 @ d-cache bic r0, r0, #0x00000004 @ d-cache
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm940_proc_fin)
/* /*
* cpu_arm940_reset(loc) * cpu_arm940_reset(loc)
...@@ -46,7 +51,7 @@ ENTRY(cpu_arm940_proc_fin) ...@@ -46,7 +51,7 @@ ENTRY(cpu_arm940_proc_fin)
* Notes : This sets up everything for a reset * Notes : This sets up everything for a reset
*/ */
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm940_reset) SYM_TYPED_FUNC_START(cpu_arm940_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c5, 0 @ flush I cache mcr p15, 0, ip, c7, c5, 0 @ flush I cache
mcr p15, 0, ip, c7, c6, 0 @ flush D cache mcr p15, 0, ip, c7, c6, 0 @ flush D cache
...@@ -56,16 +61,17 @@ ENTRY(cpu_arm940_reset) ...@@ -56,16 +61,17 @@ ENTRY(cpu_arm940_reset)
bic ip, ip, #0x00001000 @ i-cache bic ip, ip, #0x00001000 @ i-cache
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm940_reset) SYM_FUNC_END(cpu_arm940_reset)
.popsection .popsection
/* /*
* cpu_arm940_do_idle() * cpu_arm940_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm940_do_idle) SYM_TYPED_FUNC_START(cpu_arm940_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm940_do_idle)
/* /*
* flush_icache_all() * flush_icache_all()
...@@ -204,7 +210,7 @@ arm940_dma_inv_range: ...@@ -204,7 +210,7 @@ arm940_dma_inv_range:
* - end - virtual end address * - end - virtual end address
*/ */
arm940_dma_clean_range: arm940_dma_clean_range:
ENTRY(cpu_arm940_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm940_dcache_clean_area)
mov ip, #0 mov ip, #0
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
mov r1, #(CACHE_DSEGMENTS - 1) << 4 @ 4 segments mov r1, #(CACHE_DSEGMENTS - 1) << 4 @ 4 segments
...@@ -217,6 +223,7 @@ ENTRY(cpu_arm940_dcache_clean_area) ...@@ -217,6 +223,7 @@ ENTRY(cpu_arm940_dcache_clean_area)
#endif #endif
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
ret lr ret lr
SYM_FUNC_END(cpu_arm940_dcache_clean_area)
/* /*
* dma_flush_range(start, end) * dma_flush_range(start, end)
......
...@@ -33,19 +33,24 @@ ...@@ -33,19 +33,24 @@
* *
* These are not required. * These are not required.
*/ */
ENTRY(cpu_arm946_proc_init) SYM_TYPED_FUNC_START(cpu_arm946_proc_init)
ENTRY(cpu_arm946_switch_mm)
ret lr ret lr
SYM_FUNC_END(cpu_arm946_proc_init)
SYM_TYPED_FUNC_START(cpu_arm946_switch_mm)
ret lr
SYM_FUNC_END(cpu_arm946_switch_mm)
/* /*
* cpu_arm946_proc_fin() * cpu_arm946_proc_fin()
*/ */
ENTRY(cpu_arm946_proc_fin) SYM_TYPED_FUNC_START(cpu_arm946_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x00001000 @ i-cache bic r0, r0, #0x00001000 @ i-cache
bic r0, r0, #0x00000004 @ d-cache bic r0, r0, #0x00000004 @ d-cache
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_arm946_proc_fin)
/* /*
* cpu_arm946_reset(loc) * cpu_arm946_reset(loc)
...@@ -53,7 +58,7 @@ ENTRY(cpu_arm946_proc_fin) ...@@ -53,7 +58,7 @@ ENTRY(cpu_arm946_proc_fin)
* Notes : This sets up everything for a reset * Notes : This sets up everything for a reset
*/ */
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm946_reset) SYM_TYPED_FUNC_START(cpu_arm946_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c5, 0 @ flush I cache mcr p15, 0, ip, c7, c5, 0 @ flush I cache
mcr p15, 0, ip, c7, c6, 0 @ flush D cache mcr p15, 0, ip, c7, c6, 0 @ flush D cache
...@@ -63,16 +68,17 @@ ENTRY(cpu_arm946_reset) ...@@ -63,16 +68,17 @@ ENTRY(cpu_arm946_reset)
bic ip, ip, #0x00001000 @ i-cache bic ip, ip, #0x00001000 @ i-cache
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_arm946_reset) SYM_FUNC_END(cpu_arm946_reset)
.popsection .popsection
/* /*
* cpu_arm946_do_idle() * cpu_arm946_do_idle()
*/ */
.align 5 .align 5
ENTRY(cpu_arm946_do_idle) SYM_TYPED_FUNC_START(cpu_arm946_do_idle)
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_arm946_do_idle)
/* /*
* flush_icache_all() * flush_icache_all()
...@@ -312,7 +318,7 @@ SYM_TYPED_FUNC_START(arm946_dma_unmap_area) ...@@ -312,7 +318,7 @@ SYM_TYPED_FUNC_START(arm946_dma_unmap_area)
ret lr ret lr
SYM_FUNC_END(arm946_dma_unmap_area) SYM_FUNC_END(arm946_dma_unmap_area)
ENTRY(cpu_arm946_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_arm946_dcache_clean_area)
#ifndef CONFIG_CPU_DCACHE_WRITETHROUGH #ifndef CONFIG_CPU_DCACHE_WRITETHROUGH
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHE_DLINESIZE add r0, r0, #CACHE_DLINESIZE
...@@ -321,6 +327,7 @@ ENTRY(cpu_arm946_dcache_clean_area) ...@@ -321,6 +327,7 @@ ENTRY(cpu_arm946_dcache_clean_area)
#endif #endif
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
ret lr ret lr
SYM_FUNC_END(cpu_arm946_dcache_clean_area)
.type __arm946_setup, #function .type __arm946_setup, #function
__arm946_setup: __arm946_setup:
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
...@@ -24,17 +25,28 @@ ...@@ -24,17 +25,28 @@
* *
* These are not required. * These are not required.
*/ */
ENTRY(cpu_arm9tdmi_proc_init) SYM_TYPED_FUNC_START(cpu_arm9tdmi_proc_init)
ENTRY(cpu_arm9tdmi_do_idle)
ENTRY(cpu_arm9tdmi_dcache_clean_area)
ENTRY(cpu_arm9tdmi_switch_mm)
ret lr ret lr
SYM_FUNC_END(cpu_arm9tdmi_proc_init)
SYM_TYPED_FUNC_START(cpu_arm9tdmi_do_idle)
ret lr
SYM_FUNC_END(cpu_arm9tdmi_do_idle)
SYM_TYPED_FUNC_START(cpu_arm9tdmi_dcache_clean_area)
ret lr
SYM_FUNC_END(cpu_arm9tdmi_dcache_clean_area)
SYM_TYPED_FUNC_START(cpu_arm9tdmi_switch_mm)
ret lr
SYM_FUNC_END(cpu_arm9tdmi_switch_mm)
/* /*
* cpu_arm9tdmi_proc_fin() * cpu_arm9tdmi_proc_fin()
*/ */
ENTRY(cpu_arm9tdmi_proc_fin) SYM_TYPED_FUNC_START(cpu_arm9tdmi_proc_fin)
ret lr ret lr
SYM_FUNC_END(cpu_arm9tdmi_proc_fin)
/* /*
* Function: cpu_arm9tdmi_reset(loc) * Function: cpu_arm9tdmi_reset(loc)
...@@ -42,9 +54,9 @@ ENTRY(cpu_arm9tdmi_proc_fin) ...@@ -42,9 +54,9 @@ ENTRY(cpu_arm9tdmi_proc_fin)
* Purpose : Sets up everything for a reset and jump to the location for soft reset. * Purpose : Sets up everything for a reset and jump to the location for soft reset.
*/ */
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_arm9tdmi_reset) SYM_TYPED_FUNC_START(cpu_arm9tdmi_reset)
ret r0 ret r0
ENDPROC(cpu_arm9tdmi_reset) SYM_FUNC_END(cpu_arm9tdmi_reset)
.popsection .popsection
.type __arm9tdmi_setup, #function .type __arm9tdmi_setup, #function
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/hwcap.h> #include <asm/hwcap.h>
...@@ -26,13 +27,14 @@ ...@@ -26,13 +27,14 @@
/* /*
* cpu_fa526_proc_init() * cpu_fa526_proc_init()
*/ */
ENTRY(cpu_fa526_proc_init) SYM_TYPED_FUNC_START(cpu_fa526_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_fa526_proc_init)
/* /*
* cpu_fa526_proc_fin() * cpu_fa526_proc_fin()
*/ */
ENTRY(cpu_fa526_proc_fin) SYM_TYPED_FUNC_START(cpu_fa526_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
...@@ -40,6 +42,7 @@ ENTRY(cpu_fa526_proc_fin) ...@@ -40,6 +42,7 @@ ENTRY(cpu_fa526_proc_fin)
nop nop
nop nop
ret lr ret lr
SYM_FUNC_END(cpu_fa526_proc_fin)
/* /*
* cpu_fa526_reset(loc) * cpu_fa526_reset(loc)
...@@ -52,7 +55,7 @@ ENTRY(cpu_fa526_proc_fin) ...@@ -52,7 +55,7 @@ ENTRY(cpu_fa526_proc_fin)
*/ */
.align 4 .align 4
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_fa526_reset) SYM_TYPED_FUNC_START(cpu_fa526_reset)
/* TODO: Use CP8 if possible... */ /* TODO: Use CP8 if possible... */
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
...@@ -68,24 +71,25 @@ ENTRY(cpu_fa526_reset) ...@@ -68,24 +71,25 @@ ENTRY(cpu_fa526_reset)
nop nop
nop nop
ret r0 ret r0
ENDPROC(cpu_fa526_reset) SYM_FUNC_END(cpu_fa526_reset)
.popsection .popsection
/* /*
* cpu_fa526_do_idle() * cpu_fa526_do_idle()
*/ */
.align 4 .align 4
ENTRY(cpu_fa526_do_idle) SYM_TYPED_FUNC_START(cpu_fa526_do_idle)
ret lr ret lr
SYM_FUNC_END(cpu_fa526_do_idle)
SYM_TYPED_FUNC_START(cpu_fa526_dcache_clean_area)
ENTRY(cpu_fa526_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHE_DLINESIZE add r0, r0, #CACHE_DLINESIZE
subs r1, r1, #CACHE_DLINESIZE subs r1, r1, #CACHE_DLINESIZE
bhi 1b bhi 1b
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
ret lr ret lr
SYM_FUNC_END(cpu_fa526_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -97,7 +101,7 @@ ENTRY(cpu_fa526_dcache_clean_area) ...@@ -97,7 +101,7 @@ ENTRY(cpu_fa526_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 4 .align 4
ENTRY(cpu_fa526_switch_mm) SYM_TYPED_FUNC_START(cpu_fa526_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov ip, #0 mov ip, #0
#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
...@@ -113,6 +117,7 @@ ENTRY(cpu_fa526_switch_mm) ...@@ -113,6 +117,7 @@ ENTRY(cpu_fa526_switch_mm)
mcr p15, 0, ip, c8, c7, 0 @ invalidate UTLB mcr p15, 0, ip, c8, c7, 0 @ invalidate UTLB
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_fa526_switch_mm)
/* /*
* cpu_fa526_set_pte_ext(ptep, pte, ext) * cpu_fa526_set_pte_ext(ptep, pte, ext)
...@@ -120,7 +125,7 @@ ENTRY(cpu_fa526_switch_mm) ...@@ -120,7 +125,7 @@ ENTRY(cpu_fa526_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 4 .align 4
ENTRY(cpu_fa526_set_pte_ext) SYM_TYPED_FUNC_START(cpu_fa526_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -129,6 +134,7 @@ ENTRY(cpu_fa526_set_pte_ext) ...@@ -129,6 +134,7 @@ ENTRY(cpu_fa526_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_fa526_set_pte_ext)
.type __fa526_setup, #function .type __fa526_setup, #function
__fa526_setup: __fa526_setup:
......
...@@ -44,7 +44,7 @@ __cache_params: ...@@ -44,7 +44,7 @@ __cache_params:
/* /*
* cpu_feroceon_proc_init() * cpu_feroceon_proc_init()
*/ */
ENTRY(cpu_feroceon_proc_init) SYM_TYPED_FUNC_START(cpu_feroceon_proc_init)
mrc p15, 0, r0, c0, c0, 1 @ read cache type register mrc p15, 0, r0, c0, c0, 1 @ read cache type register
ldr r1, __cache_params ldr r1, __cache_params
mov r2, #(16 << 5) mov r2, #(16 << 5)
...@@ -62,11 +62,12 @@ ENTRY(cpu_feroceon_proc_init) ...@@ -62,11 +62,12 @@ ENTRY(cpu_feroceon_proc_init)
str_l r1, VFP_arch_feroceon, r2 str_l r1, VFP_arch_feroceon, r2
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_feroceon_proc_init)
/* /*
* cpu_feroceon_proc_fin() * cpu_feroceon_proc_fin()
*/ */
ENTRY(cpu_feroceon_proc_fin) SYM_TYPED_FUNC_START(cpu_feroceon_proc_fin)
#if defined(CONFIG_CACHE_FEROCEON_L2) && \ #if defined(CONFIG_CACHE_FEROCEON_L2) && \
!defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH) !defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH)
mov r0, #0 mov r0, #0
...@@ -79,6 +80,7 @@ ENTRY(cpu_feroceon_proc_fin) ...@@ -79,6 +80,7 @@ ENTRY(cpu_feroceon_proc_fin)
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_feroceon_proc_fin)
/* /*
* cpu_feroceon_reset(loc) * cpu_feroceon_reset(loc)
...@@ -91,7 +93,7 @@ ENTRY(cpu_feroceon_proc_fin) ...@@ -91,7 +93,7 @@ ENTRY(cpu_feroceon_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_feroceon_reset) SYM_TYPED_FUNC_START(cpu_feroceon_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -103,7 +105,7 @@ ENTRY(cpu_feroceon_reset) ...@@ -103,7 +105,7 @@ ENTRY(cpu_feroceon_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_feroceon_reset) SYM_FUNC_END(cpu_feroceon_reset)
.popsection .popsection
/* /*
...@@ -112,11 +114,12 @@ ENDPROC(cpu_feroceon_reset) ...@@ -112,11 +114,12 @@ ENDPROC(cpu_feroceon_reset)
* Called with IRQs disabled * Called with IRQs disabled
*/ */
.align 5 .align 5
ENTRY(cpu_feroceon_do_idle) SYM_TYPED_FUNC_START(cpu_feroceon_do_idle)
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer
mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ Wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_feroceon_do_idle)
/* /*
* flush_icache_all() * flush_icache_all()
...@@ -415,7 +418,7 @@ SYM_TYPED_FUNC_START(feroceon_dma_unmap_area) ...@@ -415,7 +418,7 @@ SYM_TYPED_FUNC_START(feroceon_dma_unmap_area)
SYM_FUNC_END(feroceon_dma_unmap_area) SYM_FUNC_END(feroceon_dma_unmap_area)
.align 5 .align 5
ENTRY(cpu_feroceon_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_feroceon_dcache_clean_area)
#if defined(CONFIG_CACHE_FEROCEON_L2) && \ #if defined(CONFIG_CACHE_FEROCEON_L2) && \
!defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH) !defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH)
mov r2, r0 mov r2, r0
...@@ -434,6 +437,7 @@ ENTRY(cpu_feroceon_dcache_clean_area) ...@@ -434,6 +437,7 @@ ENTRY(cpu_feroceon_dcache_clean_area)
#endif #endif
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
ret lr ret lr
SYM_FUNC_END(cpu_feroceon_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -445,7 +449,7 @@ ENTRY(cpu_feroceon_dcache_clean_area) ...@@ -445,7 +449,7 @@ ENTRY(cpu_feroceon_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_feroceon_switch_mm) SYM_TYPED_FUNC_START(cpu_feroceon_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
/* /*
* Note: we wish to call __flush_whole_cache but we need to preserve * Note: we wish to call __flush_whole_cache but we need to preserve
...@@ -466,6 +470,7 @@ ENTRY(cpu_feroceon_switch_mm) ...@@ -466,6 +470,7 @@ ENTRY(cpu_feroceon_switch_mm)
#else #else
ret lr ret lr
#endif #endif
SYM_FUNC_END(cpu_feroceon_switch_mm)
/* /*
* cpu_feroceon_set_pte_ext(ptep, pte, ext) * cpu_feroceon_set_pte_ext(ptep, pte, ext)
...@@ -473,7 +478,7 @@ ENTRY(cpu_feroceon_switch_mm) ...@@ -473,7 +478,7 @@ ENTRY(cpu_feroceon_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_feroceon_set_pte_ext) SYM_TYPED_FUNC_START(cpu_feroceon_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext wc_disable=0 armv3_set_pte_ext wc_disable=0
mov r0, r0 mov r0, r0
...@@ -485,21 +490,22 @@ ENTRY(cpu_feroceon_set_pte_ext) ...@@ -485,21 +490,22 @@ ENTRY(cpu_feroceon_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_feroceon_set_pte_ext)
/* Suspend/resume support: taken from arch/arm/mm/proc-arm926.S */ /* Suspend/resume support: taken from arch/arm/mm/proc-arm926.S */
.globl cpu_feroceon_suspend_size .globl cpu_feroceon_suspend_size
.equ cpu_feroceon_suspend_size, 4 * 3 .equ cpu_feroceon_suspend_size, 4 * 3
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_feroceon_do_suspend) SYM_TYPED_FUNC_START(cpu_feroceon_do_suspend)
stmfd sp!, {r4 - r6, lr} stmfd sp!, {r4 - r6, lr}
mrc p15, 0, r4, c13, c0, 0 @ PID mrc p15, 0, r4, c13, c0, 0 @ PID
mrc p15, 0, r5, c3, c0, 0 @ Domain ID mrc p15, 0, r5, c3, c0, 0 @ Domain ID
mrc p15, 0, r6, c1, c0, 0 @ Control register mrc p15, 0, r6, c1, c0, 0 @ Control register
stmia r0, {r4 - r6} stmia r0, {r4 - r6}
ldmfd sp!, {r4 - r6, pc} ldmfd sp!, {r4 - r6, pc}
ENDPROC(cpu_feroceon_do_suspend) SYM_FUNC_END(cpu_feroceon_do_suspend)
ENTRY(cpu_feroceon_do_resume) SYM_TYPED_FUNC_START(cpu_feroceon_do_resume)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
...@@ -509,7 +515,7 @@ ENTRY(cpu_feroceon_do_resume) ...@@ -509,7 +515,7 @@ ENTRY(cpu_feroceon_do_resume)
mcr p15, 0, r1, c2, c0, 0 @ TTB address mcr p15, 0, r1, c2, c0, 0 @ TTB address
mov r0, r6 @ control register mov r0, r6 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_feroceon_do_resume) SYM_FUNC_END(cpu_feroceon_do_resume)
#endif #endif
.type __feroceon_setup, #function .type __feroceon_setup, #function
......
...@@ -32,18 +32,20 @@ ...@@ -32,18 +32,20 @@
/* /*
* cpu_mohawk_proc_init() * cpu_mohawk_proc_init()
*/ */
ENTRY(cpu_mohawk_proc_init) SYM_TYPED_FUNC_START(cpu_mohawk_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_mohawk_proc_init)
/* /*
* cpu_mohawk_proc_fin() * cpu_mohawk_proc_fin()
*/ */
ENTRY(cpu_mohawk_proc_fin) SYM_TYPED_FUNC_START(cpu_mohawk_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1800 @ ...iz........... bic r0, r0, #0x1800 @ ...iz...........
bic r0, r0, #0x0006 @ .............ca. bic r0, r0, #0x0006 @ .............ca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_mohawk_proc_fin)
/* /*
* cpu_mohawk_reset(loc) * cpu_mohawk_reset(loc)
...@@ -58,7 +60,7 @@ ENTRY(cpu_mohawk_proc_fin) ...@@ -58,7 +60,7 @@ ENTRY(cpu_mohawk_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_mohawk_reset) SYM_TYPED_FUNC_START(cpu_mohawk_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -68,7 +70,7 @@ ENTRY(cpu_mohawk_reset) ...@@ -68,7 +70,7 @@ ENTRY(cpu_mohawk_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_mohawk_reset) SYM_FUNC_END(cpu_mohawk_reset)
.popsection .popsection
/* /*
...@@ -77,11 +79,12 @@ ENDPROC(cpu_mohawk_reset) ...@@ -77,11 +79,12 @@ ENDPROC(cpu_mohawk_reset)
* Called with IRQs disabled * Called with IRQs disabled
*/ */
.align 5 .align 5
ENTRY(cpu_mohawk_do_idle) SYM_TYPED_FUNC_START(cpu_mohawk_do_idle)
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c7, c10, 4 @ drain write buffer mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt mcr p15, 0, r0, c7, c0, 4 @ wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_mohawk_do_idle)
/* /*
* flush_icache_all() * flush_icache_all()
...@@ -296,13 +299,14 @@ SYM_TYPED_FUNC_START(mohawk_dma_unmap_area) ...@@ -296,13 +299,14 @@ SYM_TYPED_FUNC_START(mohawk_dma_unmap_area)
ret lr ret lr
SYM_FUNC_END(mohawk_dma_unmap_area) SYM_FUNC_END(mohawk_dma_unmap_area)
ENTRY(cpu_mohawk_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_mohawk_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHE_DLINESIZE add r0, r0, #CACHE_DLINESIZE
subs r1, r1, #CACHE_DLINESIZE subs r1, r1, #CACHE_DLINESIZE
bhi 1b bhi 1b
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
ret lr ret lr
SYM_FUNC_END(cpu_mohawk_dcache_clean_area)
/* /*
* cpu_mohawk_switch_mm(pgd) * cpu_mohawk_switch_mm(pgd)
...@@ -312,7 +316,7 @@ ENTRY(cpu_mohawk_dcache_clean_area) ...@@ -312,7 +316,7 @@ ENTRY(cpu_mohawk_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_mohawk_switch_mm) SYM_TYPED_FUNC_START(cpu_mohawk_switch_mm)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c14, 0 @ clean & invalidate all D cache mcr p15, 0, ip, c7, c14, 0 @ clean & invalidate all D cache
mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
...@@ -321,6 +325,7 @@ ENTRY(cpu_mohawk_switch_mm) ...@@ -321,6 +325,7 @@ ENTRY(cpu_mohawk_switch_mm)
mcr p15, 0, r0, c2, c0, 0 @ load page table pointer mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
ret lr ret lr
SYM_FUNC_END(cpu_mohawk_switch_mm)
/* /*
* cpu_mohawk_set_pte_ext(ptep, pte, ext) * cpu_mohawk_set_pte_ext(ptep, pte, ext)
...@@ -328,7 +333,7 @@ ENTRY(cpu_mohawk_switch_mm) ...@@ -328,7 +333,7 @@ ENTRY(cpu_mohawk_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_mohawk_set_pte_ext) SYM_TYPED_FUNC_START(cpu_mohawk_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext armv3_set_pte_ext
mov r0, r0 mov r0, r0
...@@ -336,11 +341,12 @@ ENTRY(cpu_mohawk_set_pte_ext) ...@@ -336,11 +341,12 @@ ENTRY(cpu_mohawk_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
ret lr ret lr
#endif #endif
SYM_FUNC_END(cpu_mohawk_set_pte_ext)
.globl cpu_mohawk_suspend_size .globl cpu_mohawk_suspend_size
.equ cpu_mohawk_suspend_size, 4 * 6 .equ cpu_mohawk_suspend_size, 4 * 6
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_mohawk_do_suspend) SYM_TYPED_FUNC_START(cpu_mohawk_do_suspend)
stmfd sp!, {r4 - r9, lr} stmfd sp!, {r4 - r9, lr}
mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
mrc p15, 0, r5, c15, c1, 0 @ CP access reg mrc p15, 0, r5, c15, c1, 0 @ CP access reg
...@@ -351,9 +357,9 @@ ENTRY(cpu_mohawk_do_suspend) ...@@ -351,9 +357,9 @@ ENTRY(cpu_mohawk_do_suspend)
bic r4, r4, #2 @ clear frequency change bit bic r4, r4, #2 @ clear frequency change bit
stmia r0, {r4 - r9} @ store cp regs stmia r0, {r4 - r9} @ store cp regs
ldmia sp!, {r4 - r9, pc} ldmia sp!, {r4 - r9, pc}
ENDPROC(cpu_mohawk_do_suspend) SYM_FUNC_END(cpu_mohawk_do_suspend)
ENTRY(cpu_mohawk_do_resume) SYM_TYPED_FUNC_START(cpu_mohawk_do_resume)
ldmia r0, {r4 - r9} @ load cp regs ldmia r0, {r4 - r9} @ load cp regs
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
...@@ -369,7 +375,7 @@ ENTRY(cpu_mohawk_do_resume) ...@@ -369,7 +375,7 @@ ENTRY(cpu_mohawk_do_resume)
mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg
mov r0, r9 @ control register mov r0, r9 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_mohawk_do_resume) SYM_FUNC_END(cpu_mohawk_do_resume)
#endif #endif
.type __mohawk_setup, #function .type __mohawk_setup, #function
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
...@@ -32,15 +33,16 @@ ...@@ -32,15 +33,16 @@
/* /*
* cpu_sa110_proc_init() * cpu_sa110_proc_init()
*/ */
ENTRY(cpu_sa110_proc_init) SYM_TYPED_FUNC_START(cpu_sa110_proc_init)
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching
ret lr ret lr
SYM_FUNC_END(cpu_sa110_proc_init)
/* /*
* cpu_sa110_proc_fin() * cpu_sa110_proc_fin()
*/ */
ENTRY(cpu_sa110_proc_fin) SYM_TYPED_FUNC_START(cpu_sa110_proc_fin)
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching mcr p15, 0, r0, c15, c2, 2 @ Disable clock switching
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
...@@ -48,6 +50,7 @@ ENTRY(cpu_sa110_proc_fin) ...@@ -48,6 +50,7 @@ ENTRY(cpu_sa110_proc_fin)
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_sa110_proc_fin)
/* /*
* cpu_sa110_reset(loc) * cpu_sa110_reset(loc)
...@@ -60,7 +63,7 @@ ENTRY(cpu_sa110_proc_fin) ...@@ -60,7 +63,7 @@ ENTRY(cpu_sa110_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_sa110_reset) SYM_TYPED_FUNC_START(cpu_sa110_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -72,7 +75,7 @@ ENTRY(cpu_sa110_reset) ...@@ -72,7 +75,7 @@ ENTRY(cpu_sa110_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_sa110_reset) SYM_FUNC_END(cpu_sa110_reset)
.popsection .popsection
/* /*
...@@ -88,7 +91,7 @@ ENDPROC(cpu_sa110_reset) ...@@ -88,7 +91,7 @@ ENDPROC(cpu_sa110_reset)
*/ */
.align 5 .align 5
ENTRY(cpu_sa110_do_idle) SYM_TYPED_FUNC_START(cpu_sa110_do_idle)
mcr p15, 0, ip, c15, c2, 2 @ disable clock switching mcr p15, 0, ip, c15, c2, 2 @ disable clock switching
ldr r1, =UNCACHEABLE_ADDR @ load from uncacheable loc ldr r1, =UNCACHEABLE_ADDR @ load from uncacheable loc
ldr r1, [r1, #0] @ force switch to MCLK ldr r1, [r1, #0] @ force switch to MCLK
...@@ -101,6 +104,7 @@ ENTRY(cpu_sa110_do_idle) ...@@ -101,6 +104,7 @@ ENTRY(cpu_sa110_do_idle)
mov r0, r0 @ safety mov r0, r0 @ safety
mcr p15, 0, r0, c15, c1, 2 @ enable clock switching mcr p15, 0, r0, c15, c1, 2 @ enable clock switching
ret lr ret lr
SYM_FUNC_END(cpu_sa110_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -113,12 +117,13 @@ ENTRY(cpu_sa110_do_idle) ...@@ -113,12 +117,13 @@ ENTRY(cpu_sa110_do_idle)
* addr: cache-unaligned virtual address * addr: cache-unaligned virtual address
*/ */
.align 5 .align 5
ENTRY(cpu_sa110_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_sa110_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #DCACHELINESIZE add r0, r0, #DCACHELINESIZE
subs r1, r1, #DCACHELINESIZE subs r1, r1, #DCACHELINESIZE
bhi 1b bhi 1b
ret lr ret lr
SYM_FUNC_END(cpu_sa110_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -130,7 +135,7 @@ ENTRY(cpu_sa110_dcache_clean_area) ...@@ -130,7 +135,7 @@ ENTRY(cpu_sa110_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_sa110_switch_mm) SYM_TYPED_FUNC_START(cpu_sa110_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
str lr, [sp, #-4]! str lr, [sp, #-4]!
bl v4wb_flush_kern_cache_all @ clears IP bl v4wb_flush_kern_cache_all @ clears IP
...@@ -140,6 +145,7 @@ ENTRY(cpu_sa110_switch_mm) ...@@ -140,6 +145,7 @@ ENTRY(cpu_sa110_switch_mm)
#else #else
ret lr ret lr
#endif #endif
SYM_FUNC_END(cpu_sa110_switch_mm)
/* /*
* cpu_sa110_set_pte_ext(ptep, pte, ext) * cpu_sa110_set_pte_ext(ptep, pte, ext)
...@@ -147,7 +153,7 @@ ENTRY(cpu_sa110_switch_mm) ...@@ -147,7 +153,7 @@ ENTRY(cpu_sa110_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_sa110_set_pte_ext) SYM_TYPED_FUNC_START(cpu_sa110_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext wc_disable=0 armv3_set_pte_ext wc_disable=0
mov r0, r0 mov r0, r0
...@@ -155,6 +161,7 @@ ENTRY(cpu_sa110_set_pte_ext) ...@@ -155,6 +161,7 @@ ENTRY(cpu_sa110_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_sa110_set_pte_ext)
.type __sa110_setup, #function .type __sa110_setup, #function
__sa110_setup: __sa110_setup:
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
...@@ -36,11 +37,12 @@ ...@@ -36,11 +37,12 @@
/* /*
* cpu_sa1100_proc_init() * cpu_sa1100_proc_init()
*/ */
ENTRY(cpu_sa1100_proc_init) SYM_TYPED_FUNC_START(cpu_sa1100_proc_init)
mov r0, #0 mov r0, #0
mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching mcr p15, 0, r0, c15, c1, 2 @ Enable clock switching
mcr p15, 0, r0, c9, c0, 5 @ Allow read-buffer operations from userland mcr p15, 0, r0, c9, c0, 5 @ Allow read-buffer operations from userland
ret lr ret lr
SYM_FUNC_END(cpu_sa1100_proc_init)
/* /*
* cpu_sa1100_proc_fin() * cpu_sa1100_proc_fin()
...@@ -49,13 +51,14 @@ ENTRY(cpu_sa1100_proc_init) ...@@ -49,13 +51,14 @@ ENTRY(cpu_sa1100_proc_init)
* - Disable interrupts * - Disable interrupts
* - Clean and turn off caches. * - Clean and turn off caches.
*/ */
ENTRY(cpu_sa1100_proc_fin) SYM_TYPED_FUNC_START(cpu_sa1100_proc_fin)
mcr p15, 0, ip, c15, c2, 2 @ Disable clock switching mcr p15, 0, ip, c15, c2, 2 @ Disable clock switching
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x000e @ ............wca. bic r0, r0, #0x000e @ ............wca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_sa1100_proc_fin)
/* /*
* cpu_sa1100_reset(loc) * cpu_sa1100_reset(loc)
...@@ -68,7 +71,7 @@ ENTRY(cpu_sa1100_proc_fin) ...@@ -68,7 +71,7 @@ ENTRY(cpu_sa1100_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_sa1100_reset) SYM_TYPED_FUNC_START(cpu_sa1100_reset)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches
mcr p15, 0, ip, c7, c10, 4 @ drain WB mcr p15, 0, ip, c7, c10, 4 @ drain WB
...@@ -80,7 +83,7 @@ ENTRY(cpu_sa1100_reset) ...@@ -80,7 +83,7 @@ ENTRY(cpu_sa1100_reset)
bic ip, ip, #0x1100 @ ...i...s........ bic ip, ip, #0x1100 @ ...i...s........
mcr p15, 0, ip, c1, c0, 0 @ ctrl register mcr p15, 0, ip, c1, c0, 0 @ ctrl register
ret r0 ret r0
ENDPROC(cpu_sa1100_reset) SYM_FUNC_END(cpu_sa1100_reset)
.popsection .popsection
/* /*
...@@ -95,7 +98,7 @@ ENDPROC(cpu_sa1100_reset) ...@@ -95,7 +98,7 @@ ENDPROC(cpu_sa1100_reset)
* 3 = switch to fast processor clock * 3 = switch to fast processor clock
*/ */
.align 5 .align 5
ENTRY(cpu_sa1100_do_idle) SYM_TYPED_FUNC_START(cpu_sa1100_do_idle)
mov r0, r0 @ 4 nop padding mov r0, r0 @ 4 nop padding
mov r0, r0 mov r0, r0
mov r0, r0 mov r0, r0
...@@ -111,6 +114,7 @@ ENTRY(cpu_sa1100_do_idle) ...@@ -111,6 +114,7 @@ ENTRY(cpu_sa1100_do_idle)
mov r0, r0 @ safety mov r0, r0 @ safety
mcr p15, 0, r0, c15, c1, 2 @ enable clock switching mcr p15, 0, r0, c15, c1, 2 @ enable clock switching
ret lr ret lr
SYM_FUNC_END(cpu_sa1100_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -123,12 +127,13 @@ ENTRY(cpu_sa1100_do_idle) ...@@ -123,12 +127,13 @@ ENTRY(cpu_sa1100_do_idle)
* addr: cache-unaligned virtual address * addr: cache-unaligned virtual address
*/ */
.align 5 .align 5
ENTRY(cpu_sa1100_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_sa1100_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #DCACHELINESIZE add r0, r0, #DCACHELINESIZE
subs r1, r1, #DCACHELINESIZE subs r1, r1, #DCACHELINESIZE
bhi 1b bhi 1b
ret lr ret lr
SYM_FUNC_END(cpu_sa1100_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -140,7 +145,7 @@ ENTRY(cpu_sa1100_dcache_clean_area) ...@@ -140,7 +145,7 @@ ENTRY(cpu_sa1100_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_sa1100_switch_mm) SYM_TYPED_FUNC_START(cpu_sa1100_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
str lr, [sp, #-4]! str lr, [sp, #-4]!
bl v4wb_flush_kern_cache_all @ clears IP bl v4wb_flush_kern_cache_all @ clears IP
...@@ -151,6 +156,7 @@ ENTRY(cpu_sa1100_switch_mm) ...@@ -151,6 +156,7 @@ ENTRY(cpu_sa1100_switch_mm)
#else #else
ret lr ret lr
#endif #endif
SYM_FUNC_END(cpu_sa1100_switch_mm)
/* /*
* cpu_sa1100_set_pte_ext(ptep, pte, ext) * cpu_sa1100_set_pte_ext(ptep, pte, ext)
...@@ -158,7 +164,7 @@ ENTRY(cpu_sa1100_switch_mm) ...@@ -158,7 +164,7 @@ ENTRY(cpu_sa1100_switch_mm)
* Set a PTE and flush it out * Set a PTE and flush it out
*/ */
.align 5 .align 5
ENTRY(cpu_sa1100_set_pte_ext) SYM_TYPED_FUNC_START(cpu_sa1100_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv3_set_pte_ext wc_disable=0 armv3_set_pte_ext wc_disable=0
mov r0, r0 mov r0, r0
...@@ -166,20 +172,21 @@ ENTRY(cpu_sa1100_set_pte_ext) ...@@ -166,20 +172,21 @@ ENTRY(cpu_sa1100_set_pte_ext)
mcr p15, 0, r0, c7, c10, 4 @ drain WB mcr p15, 0, r0, c7, c10, 4 @ drain WB
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_sa1100_set_pte_ext)
.globl cpu_sa1100_suspend_size .globl cpu_sa1100_suspend_size
.equ cpu_sa1100_suspend_size, 4 * 3 .equ cpu_sa1100_suspend_size, 4 * 3
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_sa1100_do_suspend) SYM_TYPED_FUNC_START(cpu_sa1100_do_suspend)
stmfd sp!, {r4 - r6, lr} stmfd sp!, {r4 - r6, lr}
mrc p15, 0, r4, c3, c0, 0 @ domain ID mrc p15, 0, r4, c3, c0, 0 @ domain ID
mrc p15, 0, r5, c13, c0, 0 @ PID mrc p15, 0, r5, c13, c0, 0 @ PID
mrc p15, 0, r6, c1, c0, 0 @ control reg mrc p15, 0, r6, c1, c0, 0 @ control reg
stmia r0, {r4 - r6} @ store cp regs stmia r0, {r4 - r6} @ store cp regs
ldmfd sp!, {r4 - r6, pc} ldmfd sp!, {r4 - r6, pc}
ENDPROC(cpu_sa1100_do_suspend) SYM_FUNC_END(cpu_sa1100_do_suspend)
ENTRY(cpu_sa1100_do_resume) SYM_TYPED_FUNC_START(cpu_sa1100_do_resume)
ldmia r0, {r4 - r6} @ load cp regs ldmia r0, {r4 - r6} @ load cp regs
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c8, c7, 0 @ flush I+D TLBs mcr p15, 0, ip, c8, c7, 0 @ flush I+D TLBs
...@@ -192,7 +199,7 @@ ENTRY(cpu_sa1100_do_resume) ...@@ -192,7 +199,7 @@ ENTRY(cpu_sa1100_do_resume)
mcr p15, 0, r5, c13, c0, 0 @ PID mcr p15, 0, r5, c13, c0, 0 @ PID
mov r0, r6 @ control register mov r0, r6 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_sa1100_do_resume) SYM_FUNC_END(cpu_sa1100_do_resume)
#endif #endif
.type __sa1100_setup, #function .type __sa1100_setup, #function
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* This is the "shell" of the ARMv6 processor support. * This is the "shell" of the ARMv6 processor support.
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/cfi_types.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
#include <asm/assembler.h> #include <asm/assembler.h>
...@@ -34,15 +35,17 @@ ...@@ -34,15 +35,17 @@
.arch armv6 .arch armv6
ENTRY(cpu_v6_proc_init) SYM_TYPED_FUNC_START(cpu_v6_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_v6_proc_init)
ENTRY(cpu_v6_proc_fin) SYM_TYPED_FUNC_START(cpu_v6_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x0006 @ .............ca. bic r0, r0, #0x0006 @ .............ca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_v6_proc_fin)
/* /*
* cpu_v6_reset(loc) * cpu_v6_reset(loc)
...@@ -55,14 +58,14 @@ ENTRY(cpu_v6_proc_fin) ...@@ -55,14 +58,14 @@ ENTRY(cpu_v6_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_v6_reset) SYM_TYPED_FUNC_START(cpu_v6_reset)
mrc p15, 0, r1, c1, c0, 0 @ ctrl register mrc p15, 0, r1, c1, c0, 0 @ ctrl register
bic r1, r1, #0x1 @ ...............m bic r1, r1, #0x1 @ ...............m
mcr p15, 0, r1, c1, c0, 0 @ disable MMU mcr p15, 0, r1, c1, c0, 0 @ disable MMU
mov r1, #0 mov r1, #0
mcr p15, 0, r1, c7, c5, 4 @ ISB mcr p15, 0, r1, c7, c5, 4 @ ISB
ret r0 ret r0
ENDPROC(cpu_v6_reset) SYM_FUNC_END(cpu_v6_reset)
.popsection .popsection
/* /*
...@@ -72,18 +75,20 @@ ENDPROC(cpu_v6_reset) ...@@ -72,18 +75,20 @@ ENDPROC(cpu_v6_reset)
* *
* IRQs are already disabled. * IRQs are already disabled.
*/ */
ENTRY(cpu_v6_do_idle) SYM_TYPED_FUNC_START(cpu_v6_do_idle)
mov r1, #0 mov r1, #0
mcr p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode mcr p15, 0, r1, c7, c10, 4 @ DWB - WFI may enter a low-power mode
mcr p15, 0, r1, c7, c0, 4 @ wait for interrupt mcr p15, 0, r1, c7, c0, 4 @ wait for interrupt
ret lr ret lr
SYM_FUNC_END(cpu_v6_do_idle)
ENTRY(cpu_v6_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_v6_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #D_CACHE_LINE_SIZE add r0, r0, #D_CACHE_LINE_SIZE
subs r1, r1, #D_CACHE_LINE_SIZE subs r1, r1, #D_CACHE_LINE_SIZE
bhi 1b bhi 1b
ret lr ret lr
SYM_FUNC_END(cpu_v6_dcache_clean_area)
/* /*
* cpu_v6_switch_mm(pgd_phys, tsk) * cpu_v6_switch_mm(pgd_phys, tsk)
...@@ -95,7 +100,7 @@ ENTRY(cpu_v6_dcache_clean_area) ...@@ -95,7 +100,7 @@ ENTRY(cpu_v6_dcache_clean_area)
* It is assumed that: * It is assumed that:
* - we are not using split page tables * - we are not using split page tables
*/ */
ENTRY(cpu_v6_switch_mm) SYM_TYPED_FUNC_START(cpu_v6_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mov r2, #0 mov r2, #0
mmid r1, r1 @ get mm->context.id mmid r1, r1 @ get mm->context.id
...@@ -113,6 +118,7 @@ ENTRY(cpu_v6_switch_mm) ...@@ -113,6 +118,7 @@ ENTRY(cpu_v6_switch_mm)
mcr p15, 0, r1, c13, c0, 1 @ set context ID mcr p15, 0, r1, c13, c0, 1 @ set context ID
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_v6_switch_mm)
/* /*
* cpu_v6_set_pte_ext(ptep, pte, ext) * cpu_v6_set_pte_ext(ptep, pte, ext)
...@@ -126,17 +132,18 @@ ENTRY(cpu_v6_switch_mm) ...@@ -126,17 +132,18 @@ ENTRY(cpu_v6_switch_mm)
*/ */
armv6_mt_table cpu_v6 armv6_mt_table cpu_v6
ENTRY(cpu_v6_set_pte_ext) SYM_TYPED_FUNC_START(cpu_v6_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
armv6_set_pte_ext cpu_v6 armv6_set_pte_ext cpu_v6
#endif #endif
ret lr ret lr
SYM_FUNC_END(cpu_v6_set_pte_ext)
/* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */ /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
.globl cpu_v6_suspend_size .globl cpu_v6_suspend_size
.equ cpu_v6_suspend_size, 4 * 6 .equ cpu_v6_suspend_size, 4 * 6
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_v6_do_suspend) SYM_TYPED_FUNC_START(cpu_v6_do_suspend)
stmfd sp!, {r4 - r9, lr} stmfd sp!, {r4 - r9, lr}
mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
...@@ -148,9 +155,9 @@ ENTRY(cpu_v6_do_suspend) ...@@ -148,9 +155,9 @@ ENTRY(cpu_v6_do_suspend)
mrc p15, 0, r9, c1, c0, 0 @ control register mrc p15, 0, r9, c1, c0, 0 @ control register
stmia r0, {r4 - r9} stmia r0, {r4 - r9}
ldmfd sp!, {r4- r9, pc} ldmfd sp!, {r4- r9, pc}
ENDPROC(cpu_v6_do_suspend) SYM_FUNC_END(cpu_v6_do_suspend)
ENTRY(cpu_v6_do_resume) SYM_TYPED_FUNC_START(cpu_v6_do_resume)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c14, 0 @ clean+invalidate D cache mcr p15, 0, ip, c7, c14, 0 @ clean+invalidate D cache
mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
...@@ -172,7 +179,7 @@ ENTRY(cpu_v6_do_resume) ...@@ -172,7 +179,7 @@ ENTRY(cpu_v6_do_resume)
mcr p15, 0, ip, c7, c5, 4 @ ISB mcr p15, 0, ip, c7, c5, 4 @ ISB
mov r0, r9 @ control register mov r0, r9 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_v6_do_resume) SYM_FUNC_END(cpu_v6_do_resume)
#endif #endif
string cpu_v6_name, "ARMv6-compatible processor" string cpu_v6_name, "ARMv6-compatible processor"
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* even on Cortex-A8 revisions not affected by 430973. * even on Cortex-A8 revisions not affected by 430973.
* If IBE is not set, the flush BTAC/BTB won't do anything. * If IBE is not set, the flush BTAC/BTB won't do anything.
*/ */
ENTRY(cpu_v7_switch_mm) SYM_TYPED_FUNC_START(cpu_v7_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mmid r1, r1 @ get mm->context.id mmid r1, r1 @ get mm->context.id
ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP) ALT_SMP(orr r0, r0, #TTB_FLAGS_SMP)
...@@ -59,7 +59,7 @@ ENTRY(cpu_v7_switch_mm) ...@@ -59,7 +59,7 @@ ENTRY(cpu_v7_switch_mm)
isb isb
#endif #endif
bx lr bx lr
ENDPROC(cpu_v7_switch_mm) SYM_FUNC_END(cpu_v7_switch_mm)
/* /*
* cpu_v7_set_pte_ext(ptep, pte) * cpu_v7_set_pte_ext(ptep, pte)
...@@ -71,7 +71,7 @@ ENDPROC(cpu_v7_switch_mm) ...@@ -71,7 +71,7 @@ ENDPROC(cpu_v7_switch_mm)
* - pte - PTE value to store * - pte - PTE value to store
* - ext - value for extended PTE bits * - ext - value for extended PTE bits
*/ */
ENTRY(cpu_v7_set_pte_ext) SYM_TYPED_FUNC_START(cpu_v7_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
str r1, [r0] @ linux version str r1, [r0] @ linux version
...@@ -106,7 +106,7 @@ ENTRY(cpu_v7_set_pte_ext) ...@@ -106,7 +106,7 @@ ENTRY(cpu_v7_set_pte_ext)
ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte
#endif #endif
bx lr bx lr
ENDPROC(cpu_v7_set_pte_ext) SYM_FUNC_END(cpu_v7_set_pte_ext)
/* /*
* Memory region attributes with SCTLR.TRE=1 * Memory region attributes with SCTLR.TRE=1
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* Set the translation table base pointer to be pgd_phys (physical address of * Set the translation table base pointer to be pgd_phys (physical address of
* the new TTB). * the new TTB).
*/ */
ENTRY(cpu_v7_switch_mm) SYM_TYPED_FUNC_START(cpu_v7_switch_mm)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
mmid r2, r2 mmid r2, r2
asid r2, r2 asid r2, r2
...@@ -51,7 +51,7 @@ ENTRY(cpu_v7_switch_mm) ...@@ -51,7 +51,7 @@ ENTRY(cpu_v7_switch_mm)
isb isb
#endif #endif
ret lr ret lr
ENDPROC(cpu_v7_switch_mm) SYM_FUNC_END(cpu_v7_switch_mm)
#ifdef __ARMEB__ #ifdef __ARMEB__
#define rl r3 #define rl r3
...@@ -68,7 +68,7 @@ ENDPROC(cpu_v7_switch_mm) ...@@ -68,7 +68,7 @@ ENDPROC(cpu_v7_switch_mm)
* - ptep - pointer to level 3 translation table entry * - ptep - pointer to level 3 translation table entry
* - pte - PTE value to store (64-bit in r2 and r3) * - pte - PTE value to store (64-bit in r2 and r3)
*/ */
ENTRY(cpu_v7_set_pte_ext) SYM_TYPED_FUNC_START(cpu_v7_set_pte_ext)
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
tst rl, #L_PTE_VALID tst rl, #L_PTE_VALID
beq 1f beq 1f
...@@ -87,7 +87,7 @@ ENTRY(cpu_v7_set_pte_ext) ...@@ -87,7 +87,7 @@ ENTRY(cpu_v7_set_pte_ext)
ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte ALT_UP (mcr p15, 0, r0, c7, c10, 1) @ flush_pte
#endif #endif
ret lr ret lr
ENDPROC(cpu_v7_set_pte_ext) SYM_FUNC_END(cpu_v7_set_pte_ext)
/* /*
* Memory region attributes for LPAE (defined in pgtable-3level.h): * Memory region attributes for LPAE (defined in pgtable-3level.h):
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* This is the "shell" of the ARMv7 processor support. * This is the "shell" of the ARMv7 processor support.
*/ */
#include <linux/arm-smccc.h> #include <linux/arm-smccc.h>
#include <linux/cfi_types.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/pgtable.h> #include <linux/pgtable.h>
...@@ -26,17 +27,17 @@ ...@@ -26,17 +27,17 @@
.arch armv7-a .arch armv7-a
ENTRY(cpu_v7_proc_init) SYM_TYPED_FUNC_START(cpu_v7_proc_init)
ret lr ret lr
ENDPROC(cpu_v7_proc_init) SYM_FUNC_END(cpu_v7_proc_init)
ENTRY(cpu_v7_proc_fin) SYM_TYPED_FUNC_START(cpu_v7_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1000 @ ...i............ bic r0, r0, #0x1000 @ ...i............
bic r0, r0, #0x0006 @ .............ca. bic r0, r0, #0x0006 @ .............ca.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
ENDPROC(cpu_v7_proc_fin) SYM_FUNC_END(cpu_v7_proc_fin)
/* /*
* cpu_v7_reset(loc, hyp) * cpu_v7_reset(loc, hyp)
...@@ -53,7 +54,7 @@ ENDPROC(cpu_v7_proc_fin) ...@@ -53,7 +54,7 @@ ENDPROC(cpu_v7_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_v7_reset) SYM_TYPED_FUNC_START(cpu_v7_reset)
mrc p15, 0, r2, c1, c0, 0 @ ctrl register mrc p15, 0, r2, c1, c0, 0 @ ctrl register
bic r2, r2, #0x1 @ ...............m bic r2, r2, #0x1 @ ...............m
THUMB( bic r2, r2, #1 << 30 ) @ SCTLR.TE (Thumb exceptions) THUMB( bic r2, r2, #1 << 30 ) @ SCTLR.TE (Thumb exceptions)
...@@ -64,7 +65,7 @@ ENTRY(cpu_v7_reset) ...@@ -64,7 +65,7 @@ ENTRY(cpu_v7_reset)
bne __hyp_soft_restart bne __hyp_soft_restart
#endif #endif
bx r0 bx r0
ENDPROC(cpu_v7_reset) SYM_FUNC_END(cpu_v7_reset)
.popsection .popsection
/* /*
...@@ -74,13 +75,13 @@ ENDPROC(cpu_v7_reset) ...@@ -74,13 +75,13 @@ ENDPROC(cpu_v7_reset)
* *
* IRQs are already disabled. * IRQs are already disabled.
*/ */
ENTRY(cpu_v7_do_idle) SYM_TYPED_FUNC_START(cpu_v7_do_idle)
dsb @ WFI may enter a low-power mode dsb @ WFI may enter a low-power mode
wfi wfi
ret lr ret lr
ENDPROC(cpu_v7_do_idle) SYM_FUNC_END(cpu_v7_do_idle)
ENTRY(cpu_v7_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_v7_dcache_clean_area)
ALT_SMP(W(nop)) @ MP extensions imply L1 PTW ALT_SMP(W(nop)) @ MP extensions imply L1 PTW
ALT_UP_B(1f) ALT_UP_B(1f)
ret lr ret lr
...@@ -91,38 +92,39 @@ ENTRY(cpu_v7_dcache_clean_area) ...@@ -91,38 +92,39 @@ ENTRY(cpu_v7_dcache_clean_area)
bhi 2b bhi 2b
dsb ishst dsb ishst
ret lr ret lr
ENDPROC(cpu_v7_dcache_clean_area) SYM_FUNC_END(cpu_v7_dcache_clean_area)
#ifdef CONFIG_ARM_PSCI #ifdef CONFIG_ARM_PSCI
.arch_extension sec .arch_extension sec
ENTRY(cpu_v7_smc_switch_mm) SYM_TYPED_FUNC_START(cpu_v7_smc_switch_mm)
stmfd sp!, {r0 - r3} stmfd sp!, {r0 - r3}
movw r0, #:lower16:ARM_SMCCC_ARCH_WORKAROUND_1 movw r0, #:lower16:ARM_SMCCC_ARCH_WORKAROUND_1
movt r0, #:upper16:ARM_SMCCC_ARCH_WORKAROUND_1 movt r0, #:upper16:ARM_SMCCC_ARCH_WORKAROUND_1
smc #0 smc #0
ldmfd sp!, {r0 - r3} ldmfd sp!, {r0 - r3}
b cpu_v7_switch_mm b cpu_v7_switch_mm
ENDPROC(cpu_v7_smc_switch_mm) SYM_FUNC_END(cpu_v7_smc_switch_mm)
.arch_extension virt .arch_extension virt
ENTRY(cpu_v7_hvc_switch_mm) SYM_TYPED_FUNC_START(cpu_v7_hvc_switch_mm)
stmfd sp!, {r0 - r3} stmfd sp!, {r0 - r3}
movw r0, #:lower16:ARM_SMCCC_ARCH_WORKAROUND_1 movw r0, #:lower16:ARM_SMCCC_ARCH_WORKAROUND_1
movt r0, #:upper16:ARM_SMCCC_ARCH_WORKAROUND_1 movt r0, #:upper16:ARM_SMCCC_ARCH_WORKAROUND_1
hvc #0 hvc #0
ldmfd sp!, {r0 - r3} ldmfd sp!, {r0 - r3}
b cpu_v7_switch_mm b cpu_v7_switch_mm
ENDPROC(cpu_v7_hvc_switch_mm) SYM_FUNC_END(cpu_v7_hvc_switch_mm)
#endif #endif
ENTRY(cpu_v7_iciallu_switch_mm)
SYM_TYPED_FUNC_START(cpu_v7_iciallu_switch_mm)
mov r3, #0 mov r3, #0
mcr p15, 0, r3, c7, c5, 0 @ ICIALLU mcr p15, 0, r3, c7, c5, 0 @ ICIALLU
b cpu_v7_switch_mm b cpu_v7_switch_mm
ENDPROC(cpu_v7_iciallu_switch_mm) SYM_FUNC_END(cpu_v7_iciallu_switch_mm)
ENTRY(cpu_v7_bpiall_switch_mm) SYM_TYPED_FUNC_START(cpu_v7_bpiall_switch_mm)
mov r3, #0 mov r3, #0
mcr p15, 0, r3, c7, c5, 6 @ flush BTAC/BTB mcr p15, 0, r3, c7, c5, 6 @ flush BTAC/BTB
b cpu_v7_switch_mm b cpu_v7_switch_mm
ENDPROC(cpu_v7_bpiall_switch_mm) SYM_FUNC_END(cpu_v7_bpiall_switch_mm)
string cpu_v7_name, "ARMv7 Processor" string cpu_v7_name, "ARMv7 Processor"
.align .align
...@@ -131,7 +133,7 @@ ENDPROC(cpu_v7_bpiall_switch_mm) ...@@ -131,7 +133,7 @@ ENDPROC(cpu_v7_bpiall_switch_mm)
.globl cpu_v7_suspend_size .globl cpu_v7_suspend_size
.equ cpu_v7_suspend_size, 4 * 9 .equ cpu_v7_suspend_size, 4 * 9
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_v7_do_suspend) SYM_TYPED_FUNC_START(cpu_v7_do_suspend)
stmfd sp!, {r4 - r11, lr} stmfd sp!, {r4 - r11, lr}
mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
mrc p15, 0, r5, c13, c0, 3 @ User r/o thread ID mrc p15, 0, r5, c13, c0, 3 @ User r/o thread ID
...@@ -150,9 +152,9 @@ ENTRY(cpu_v7_do_suspend) ...@@ -150,9 +152,9 @@ ENTRY(cpu_v7_do_suspend)
mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control
stmia r0, {r5 - r11} stmia r0, {r5 - r11}
ldmfd sp!, {r4 - r11, pc} ldmfd sp!, {r4 - r11, pc}
ENDPROC(cpu_v7_do_suspend) SYM_FUNC_END(cpu_v7_do_suspend)
ENTRY(cpu_v7_do_resume) SYM_TYPED_FUNC_START(cpu_v7_do_resume)
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
mcr p15, 0, ip, c13, c0, 1 @ set reserved context ID mcr p15, 0, ip, c13, c0, 1 @ set reserved context ID
...@@ -186,22 +188,22 @@ ENTRY(cpu_v7_do_resume) ...@@ -186,22 +188,22 @@ ENTRY(cpu_v7_do_resume)
dsb dsb
mov r0, r8 @ control register mov r0, r8 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_v7_do_resume) SYM_FUNC_END(cpu_v7_do_resume)
#endif #endif
.globl cpu_ca9mp_suspend_size .globl cpu_ca9mp_suspend_size
.equ cpu_ca9mp_suspend_size, cpu_v7_suspend_size + 4 * 2 .equ cpu_ca9mp_suspend_size, cpu_v7_suspend_size + 4 * 2
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_ca9mp_do_suspend) SYM_TYPED_FUNC_START(cpu_ca9mp_do_suspend)
stmfd sp!, {r4 - r5} stmfd sp!, {r4 - r5}
mrc p15, 0, r4, c15, c0, 1 @ Diagnostic register mrc p15, 0, r4, c15, c0, 1 @ Diagnostic register
mrc p15, 0, r5, c15, c0, 0 @ Power register mrc p15, 0, r5, c15, c0, 0 @ Power register
stmia r0!, {r4 - r5} stmia r0!, {r4 - r5}
ldmfd sp!, {r4 - r5} ldmfd sp!, {r4 - r5}
b cpu_v7_do_suspend b cpu_v7_do_suspend
ENDPROC(cpu_ca9mp_do_suspend) SYM_FUNC_END(cpu_ca9mp_do_suspend)
ENTRY(cpu_ca9mp_do_resume) SYM_TYPED_FUNC_START(cpu_ca9mp_do_resume)
ldmia r0!, {r4 - r5} ldmia r0!, {r4 - r5}
mrc p15, 0, r10, c15, c0, 1 @ Read Diagnostic register mrc p15, 0, r10, c15, c0, 1 @ Read Diagnostic register
teq r4, r10 @ Already restored? teq r4, r10 @ Already restored?
...@@ -210,7 +212,7 @@ ENTRY(cpu_ca9mp_do_resume) ...@@ -210,7 +212,7 @@ ENTRY(cpu_ca9mp_do_resume)
teq r5, r10 @ Already restored? teq r5, r10 @ Already restored?
mcrne p15, 0, r5, c15, c0, 0 @ No, so restore it mcrne p15, 0, r5, c15, c0, 0 @ No, so restore it
b cpu_v7_do_resume b cpu_v7_do_resume
ENDPROC(cpu_ca9mp_do_resume) SYM_FUNC_END(cpu_ca9mp_do_resume)
#endif #endif
#ifdef CONFIG_CPU_PJ4B #ifdef CONFIG_CPU_PJ4B
...@@ -220,18 +222,18 @@ ENDPROC(cpu_ca9mp_do_resume) ...@@ -220,18 +222,18 @@ ENDPROC(cpu_ca9mp_do_resume)
globl_equ cpu_pj4b_proc_fin, cpu_v7_proc_fin globl_equ cpu_pj4b_proc_fin, cpu_v7_proc_fin
globl_equ cpu_pj4b_reset, cpu_v7_reset globl_equ cpu_pj4b_reset, cpu_v7_reset
#ifdef CONFIG_PJ4B_ERRATA_4742 #ifdef CONFIG_PJ4B_ERRATA_4742
ENTRY(cpu_pj4b_do_idle) SYM_TYPED_FUNC_START(cpu_pj4b_do_idle)
dsb @ WFI may enter a low-power mode dsb @ WFI may enter a low-power mode
wfi wfi
dsb @barrier dsb @barrier
ret lr ret lr
ENDPROC(cpu_pj4b_do_idle) SYM_FUNC_END(cpu_pj4b_do_idle)
#else #else
globl_equ cpu_pj4b_do_idle, cpu_v7_do_idle globl_equ cpu_pj4b_do_idle, cpu_v7_do_idle
#endif #endif
globl_equ cpu_pj4b_dcache_clean_area, cpu_v7_dcache_clean_area globl_equ cpu_pj4b_dcache_clean_area, cpu_v7_dcache_clean_area
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_pj4b_do_suspend) SYM_TYPED_FUNC_START(cpu_pj4b_do_suspend)
stmfd sp!, {r6 - r10} stmfd sp!, {r6 - r10}
mrc p15, 1, r6, c15, c1, 0 @ save CP15 - extra features mrc p15, 1, r6, c15, c1, 0 @ save CP15 - extra features
mrc p15, 1, r7, c15, c2, 0 @ save CP15 - Aux Func Modes Ctrl 0 mrc p15, 1, r7, c15, c2, 0 @ save CP15 - Aux Func Modes Ctrl 0
...@@ -241,9 +243,9 @@ ENTRY(cpu_pj4b_do_suspend) ...@@ -241,9 +243,9 @@ ENTRY(cpu_pj4b_do_suspend)
stmia r0!, {r6 - r10} stmia r0!, {r6 - r10}
ldmfd sp!, {r6 - r10} ldmfd sp!, {r6 - r10}
b cpu_v7_do_suspend b cpu_v7_do_suspend
ENDPROC(cpu_pj4b_do_suspend) SYM_FUNC_END(cpu_pj4b_do_suspend)
ENTRY(cpu_pj4b_do_resume) SYM_TYPED_FUNC_START(cpu_pj4b_do_resume)
ldmia r0!, {r6 - r10} ldmia r0!, {r6 - r10}
mcr p15, 1, r6, c15, c1, 0 @ restore CP15 - extra features mcr p15, 1, r6, c15, c1, 0 @ restore CP15 - extra features
mcr p15, 1, r7, c15, c2, 0 @ restore CP15 - Aux Func Modes Ctrl 0 mcr p15, 1, r7, c15, c2, 0 @ restore CP15 - Aux Func Modes Ctrl 0
...@@ -251,7 +253,7 @@ ENTRY(cpu_pj4b_do_resume) ...@@ -251,7 +253,7 @@ ENTRY(cpu_pj4b_do_resume)
mcr p15, 1, r9, c15, c1, 1 @ restore CP15 - Aux Debug Modes Ctrl 1 mcr p15, 1, r9, c15, c1, 1 @ restore CP15 - Aux Debug Modes Ctrl 1
mcr p15, 0, r10, c9, c14, 0 @ restore CP15 - PMC mcr p15, 0, r10, c9, c14, 0 @ restore CP15 - PMC
b cpu_v7_do_resume b cpu_v7_do_resume
ENDPROC(cpu_pj4b_do_resume) SYM_FUNC_END(cpu_pj4b_do_resume)
#endif #endif
.globl cpu_pj4b_suspend_size .globl cpu_pj4b_suspend_size
.equ cpu_pj4b_suspend_size, cpu_v7_suspend_size + 4 * 5 .equ cpu_pj4b_suspend_size, cpu_v7_suspend_size + 4 * 5
......
...@@ -8,18 +8,19 @@ ...@@ -8,18 +8,19 @@
* This is the "shell" of the ARMv7-M processor support. * This is the "shell" of the ARMv7-M processor support.
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/cfi_types.h>
#include <asm/assembler.h> #include <asm/assembler.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/v7m.h> #include <asm/v7m.h>
#include "proc-macros.S" #include "proc-macros.S"
ENTRY(cpu_v7m_proc_init) SYM_TYPED_FUNC_START(cpu_v7m_proc_init)
ret lr ret lr
ENDPROC(cpu_v7m_proc_init) SYM_FUNC_END(cpu_v7m_proc_init)
ENTRY(cpu_v7m_proc_fin) SYM_TYPED_FUNC_START(cpu_v7m_proc_fin)
ret lr ret lr
ENDPROC(cpu_v7m_proc_fin) SYM_FUNC_END(cpu_v7m_proc_fin)
/* /*
* cpu_v7m_reset(loc) * cpu_v7m_reset(loc)
...@@ -31,9 +32,9 @@ ENDPROC(cpu_v7m_proc_fin) ...@@ -31,9 +32,9 @@ ENDPROC(cpu_v7m_proc_fin)
* - loc - location to jump to for soft reset * - loc - location to jump to for soft reset
*/ */
.align 5 .align 5
ENTRY(cpu_v7m_reset) SYM_TYPED_FUNC_START(cpu_v7m_reset)
ret r0 ret r0
ENDPROC(cpu_v7m_reset) SYM_FUNC_END(cpu_v7m_reset)
/* /*
* cpu_v7m_do_idle() * cpu_v7m_do_idle()
...@@ -42,36 +43,36 @@ ENDPROC(cpu_v7m_reset) ...@@ -42,36 +43,36 @@ ENDPROC(cpu_v7m_reset)
* *
* IRQs are already disabled. * IRQs are already disabled.
*/ */
ENTRY(cpu_v7m_do_idle) SYM_TYPED_FUNC_START(cpu_v7m_do_idle)
wfi wfi
ret lr ret lr
ENDPROC(cpu_v7m_do_idle) SYM_FUNC_END(cpu_v7m_do_idle)
ENTRY(cpu_v7m_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_v7m_dcache_clean_area)
ret lr ret lr
ENDPROC(cpu_v7m_dcache_clean_area) SYM_FUNC_END(cpu_v7m_dcache_clean_area)
/* /*
* There is no MMU, so here is nothing to do. * There is no MMU, so here is nothing to do.
*/ */
ENTRY(cpu_v7m_switch_mm) SYM_TYPED_FUNC_START(cpu_v7m_switch_mm)
ret lr ret lr
ENDPROC(cpu_v7m_switch_mm) SYM_FUNC_END(cpu_v7m_switch_mm)
.globl cpu_v7m_suspend_size .globl cpu_v7m_suspend_size
.equ cpu_v7m_suspend_size, 0 .equ cpu_v7m_suspend_size, 0
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_v7m_do_suspend) SYM_TYPED_FUNC_START(cpu_v7m_do_suspend)
ret lr ret lr
ENDPROC(cpu_v7m_do_suspend) SYM_FUNC_END(cpu_v7m_do_suspend)
ENTRY(cpu_v7m_do_resume) SYM_TYPED_FUNC_START(cpu_v7m_do_resume)
ret lr ret lr
ENDPROC(cpu_v7m_do_resume) SYM_FUNC_END(cpu_v7m_do_resume)
#endif #endif
ENTRY(cpu_cm7_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_cm7_dcache_clean_area)
dcache_line_size r2, r3 dcache_line_size r2, r3
movw r3, #:lower16:BASEADDR_V7M_SCB + V7M_SCB_DCCMVAC movw r3, #:lower16:BASEADDR_V7M_SCB + V7M_SCB_DCCMVAC
movt r3, #:upper16:BASEADDR_V7M_SCB + V7M_SCB_DCCMVAC movt r3, #:upper16:BASEADDR_V7M_SCB + V7M_SCB_DCCMVAC
...@@ -82,16 +83,16 @@ ENTRY(cpu_cm7_dcache_clean_area) ...@@ -82,16 +83,16 @@ ENTRY(cpu_cm7_dcache_clean_area)
bhi 1b bhi 1b
dsb dsb
ret lr ret lr
ENDPROC(cpu_cm7_dcache_clean_area) SYM_FUNC_END(cpu_cm7_dcache_clean_area)
ENTRY(cpu_cm7_proc_fin) SYM_TYPED_FUNC_START(cpu_cm7_proc_fin)
movw r2, #:lower16:(BASEADDR_V7M_SCB + V7M_SCB_CCR) movw r2, #:lower16:(BASEADDR_V7M_SCB + V7M_SCB_CCR)
movt r2, #:upper16:(BASEADDR_V7M_SCB + V7M_SCB_CCR) movt r2, #:upper16:(BASEADDR_V7M_SCB + V7M_SCB_CCR)
ldr r0, [r2] ldr r0, [r2]
bic r0, r0, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC) bic r0, r0, #(V7M_SCB_CCR_DC | V7M_SCB_CCR_IC)
str r0, [r2] str r0, [r2]
ret lr ret lr
ENDPROC(cpu_cm7_proc_fin) SYM_FUNC_END(cpu_cm7_proc_fin)
.section ".init.text", "ax" .section ".init.text", "ax"
......
...@@ -80,18 +80,20 @@ ...@@ -80,18 +80,20 @@
* *
* Nothing too exciting at the moment * Nothing too exciting at the moment
*/ */
ENTRY(cpu_xsc3_proc_init) SYM_TYPED_FUNC_START(cpu_xsc3_proc_init)
ret lr ret lr
SYM_FUNC_END(cpu_xsc3_proc_init)
/* /*
* cpu_xsc3_proc_fin() * cpu_xsc3_proc_fin()
*/ */
ENTRY(cpu_xsc3_proc_fin) SYM_TYPED_FUNC_START(cpu_xsc3_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1800 @ ...IZ........... bic r0, r0, #0x1800 @ ...IZ...........
bic r0, r0, #0x0006 @ .............CA. bic r0, r0, #0x0006 @ .............CA.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_xsc3_proc_fin)
/* /*
* cpu_xsc3_reset(loc) * cpu_xsc3_reset(loc)
...@@ -104,7 +106,7 @@ ENTRY(cpu_xsc3_proc_fin) ...@@ -104,7 +106,7 @@ ENTRY(cpu_xsc3_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_xsc3_reset) SYM_TYPED_FUNC_START(cpu_xsc3_reset)
mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
msr cpsr_c, r1 @ reset CPSR msr cpsr_c, r1 @ reset CPSR
mrc p15, 0, r1, c1, c0, 0 @ ctrl register mrc p15, 0, r1, c1, c0, 0 @ ctrl register
...@@ -118,7 +120,7 @@ ENTRY(cpu_xsc3_reset) ...@@ -118,7 +120,7 @@ ENTRY(cpu_xsc3_reset)
@ already containing those two last instructions to survive. @ already containing those two last instructions to survive.
mcr p15, 0, ip, c8, c7, 0 @ invalidate I and D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I and D TLBs
ret r0 ret r0
ENDPROC(cpu_xsc3_reset) SYM_FUNC_END(cpu_xsc3_reset)
.popsection .popsection
/* /*
...@@ -133,10 +135,11 @@ ENDPROC(cpu_xsc3_reset) ...@@ -133,10 +135,11 @@ ENDPROC(cpu_xsc3_reset)
*/ */
.align 5 .align 5
ENTRY(cpu_xsc3_do_idle) SYM_TYPED_FUNC_START(cpu_xsc3_do_idle)
mov r0, #1 mov r0, #1
mcr p14, 0, r0, c7, c0, 0 @ go to idle mcr p14, 0, r0, c7, c0, 0 @ go to idle
ret lr ret lr
SYM_FUNC_END(cpu_xsc3_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -341,12 +344,13 @@ SYM_TYPED_FUNC_START(xsc3_dma_unmap_area) ...@@ -341,12 +344,13 @@ SYM_TYPED_FUNC_START(xsc3_dma_unmap_area)
ret lr ret lr
SYM_FUNC_END(xsc3_dma_unmap_area) SYM_FUNC_END(xsc3_dma_unmap_area)
ENTRY(cpu_xsc3_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_xsc3_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line 1: mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line
add r0, r0, #CACHELINESIZE add r0, r0, #CACHELINESIZE
subs r1, r1, #CACHELINESIZE subs r1, r1, #CACHELINESIZE
bhi 1b bhi 1b
ret lr ret lr
SYM_FUNC_END(cpu_xsc3_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -358,7 +362,7 @@ ENTRY(cpu_xsc3_dcache_clean_area) ...@@ -358,7 +362,7 @@ ENTRY(cpu_xsc3_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_xsc3_switch_mm) SYM_TYPED_FUNC_START(cpu_xsc3_switch_mm)
clean_d_cache r1, r2 clean_d_cache r1, r2
mcr p15, 0, ip, c7, c5, 0 @ invalidate L1 I cache and BTB mcr p15, 0, ip, c7, c5, 0 @ invalidate L1 I cache and BTB
mcr p15, 0, ip, c7, c10, 4 @ data write barrier mcr p15, 0, ip, c7, c10, 4 @ data write barrier
...@@ -367,6 +371,7 @@ ENTRY(cpu_xsc3_switch_mm) ...@@ -367,6 +371,7 @@ ENTRY(cpu_xsc3_switch_mm)
mcr p15, 0, r0, c2, c0, 0 @ load page table pointer mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
mcr p15, 0, ip, c8, c7, 0 @ invalidate I and D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I and D TLBs
cpwait_ret lr, ip cpwait_ret lr, ip
SYM_FUNC_END(cpu_xsc3_switch_mm)
/* /*
* cpu_xsc3_set_pte_ext(ptep, pte, ext) * cpu_xsc3_set_pte_ext(ptep, pte, ext)
...@@ -392,7 +397,7 @@ cpu_xsc3_mt_table: ...@@ -392,7 +397,7 @@ cpu_xsc3_mt_table:
.long 0x00 @ unused .long 0x00 @ unused
.align 5 .align 5
ENTRY(cpu_xsc3_set_pte_ext) SYM_TYPED_FUNC_START(cpu_xsc3_set_pte_ext)
xscale_set_pte_ext_prologue xscale_set_pte_ext_prologue
tst r1, #L_PTE_SHARED @ shared? tst r1, #L_PTE_SHARED @ shared?
...@@ -405,6 +410,7 @@ ENTRY(cpu_xsc3_set_pte_ext) ...@@ -405,6 +410,7 @@ ENTRY(cpu_xsc3_set_pte_ext)
xscale_set_pte_ext_epilogue xscale_set_pte_ext_epilogue
ret lr ret lr
SYM_FUNC_END(cpu_xsc3_set_pte_ext)
.ltorg .ltorg
.align .align
...@@ -412,7 +418,7 @@ ENTRY(cpu_xsc3_set_pte_ext) ...@@ -412,7 +418,7 @@ ENTRY(cpu_xsc3_set_pte_ext)
.globl cpu_xsc3_suspend_size .globl cpu_xsc3_suspend_size
.equ cpu_xsc3_suspend_size, 4 * 6 .equ cpu_xsc3_suspend_size, 4 * 6
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_xsc3_do_suspend) SYM_TYPED_FUNC_START(cpu_xsc3_do_suspend)
stmfd sp!, {r4 - r9, lr} stmfd sp!, {r4 - r9, lr}
mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
mrc p15, 0, r5, c15, c1, 0 @ CP access reg mrc p15, 0, r5, c15, c1, 0 @ CP access reg
...@@ -423,9 +429,9 @@ ENTRY(cpu_xsc3_do_suspend) ...@@ -423,9 +429,9 @@ ENTRY(cpu_xsc3_do_suspend)
bic r4, r4, #2 @ clear frequency change bit bic r4, r4, #2 @ clear frequency change bit
stmia r0, {r4 - r9} @ store cp regs stmia r0, {r4 - r9} @ store cp regs
ldmia sp!, {r4 - r9, pc} ldmia sp!, {r4 - r9, pc}
ENDPROC(cpu_xsc3_do_suspend) SYM_FUNC_END(cpu_xsc3_do_suspend)
ENTRY(cpu_xsc3_do_resume) SYM_TYPED_FUNC_START(cpu_xsc3_do_resume)
ldmia r0, {r4 - r9} @ load cp regs ldmia r0, {r4 - r9} @ load cp regs
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
...@@ -441,7 +447,7 @@ ENTRY(cpu_xsc3_do_resume) ...@@ -441,7 +447,7 @@ ENTRY(cpu_xsc3_do_resume)
mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg
mov r0, r9 @ control register mov r0, r9 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_xsc3_do_resume) SYM_FUNC_END(cpu_xsc3_do_resume)
#endif #endif
.type __xsc3_setup, #function .type __xsc3_setup, #function
......
...@@ -112,22 +112,24 @@ clean_addr: .word CLEAN_ADDR ...@@ -112,22 +112,24 @@ clean_addr: .word CLEAN_ADDR
* *
* Nothing too exciting at the moment * Nothing too exciting at the moment
*/ */
ENTRY(cpu_xscale_proc_init) SYM_TYPED_FUNC_START(cpu_xscale_proc_init)
@ enable write buffer coalescing. Some bootloader disable it @ enable write buffer coalescing. Some bootloader disable it
mrc p15, 0, r1, c1, c0, 1 mrc p15, 0, r1, c1, c0, 1
bic r1, r1, #1 bic r1, r1, #1
mcr p15, 0, r1, c1, c0, 1 mcr p15, 0, r1, c1, c0, 1
ret lr ret lr
SYM_FUNC_END(cpu_xscale_proc_init)
/* /*
* cpu_xscale_proc_fin() * cpu_xscale_proc_fin()
*/ */
ENTRY(cpu_xscale_proc_fin) SYM_TYPED_FUNC_START(cpu_xscale_proc_fin)
mrc p15, 0, r0, c1, c0, 0 @ ctrl register mrc p15, 0, r0, c1, c0, 0 @ ctrl register
bic r0, r0, #0x1800 @ ...IZ........... bic r0, r0, #0x1800 @ ...IZ...........
bic r0, r0, #0x0006 @ .............CA. bic r0, r0, #0x0006 @ .............CA.
mcr p15, 0, r0, c1, c0, 0 @ disable caches mcr p15, 0, r0, c1, c0, 0 @ disable caches
ret lr ret lr
SYM_FUNC_END(cpu_xscale_proc_fin)
/* /*
* cpu_xscale_reset(loc) * cpu_xscale_reset(loc)
...@@ -142,7 +144,7 @@ ENTRY(cpu_xscale_proc_fin) ...@@ -142,7 +144,7 @@ ENTRY(cpu_xscale_proc_fin)
*/ */
.align 5 .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text, "ax"
ENTRY(cpu_xscale_reset) SYM_TYPED_FUNC_START(cpu_xscale_reset)
mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE mov r1, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
msr cpsr_c, r1 @ reset CPSR msr cpsr_c, r1 @ reset CPSR
mcr p15, 0, r1, c10, c4, 1 @ unlock I-TLB mcr p15, 0, r1, c10, c4, 1 @ unlock I-TLB
...@@ -160,7 +162,7 @@ ENTRY(cpu_xscale_reset) ...@@ -160,7 +162,7 @@ ENTRY(cpu_xscale_reset)
@ already containing those two last instructions to survive. @ already containing those two last instructions to survive.
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
ret r0 ret r0
ENDPROC(cpu_xscale_reset) SYM_FUNC_END(cpu_xscale_reset)
.popsection .popsection
/* /*
...@@ -175,10 +177,11 @@ ENDPROC(cpu_xscale_reset) ...@@ -175,10 +177,11 @@ ENDPROC(cpu_xscale_reset)
*/ */
.align 5 .align 5
ENTRY(cpu_xscale_do_idle) SYM_TYPED_FUNC_START(cpu_xscale_do_idle)
mov r0, #1 mov r0, #1
mcr p14, 0, r0, c7, c0, 0 @ Go to IDLE mcr p14, 0, r0, c7, c0, 0 @ Go to IDLE
ret lr ret lr
SYM_FUNC_END(cpu_xscale_do_idle)
/* ================================= CACHE ================================ */ /* ================================= CACHE ================================ */
...@@ -428,12 +431,13 @@ SYM_TYPED_FUNC_START(xscale_dma_unmap_area) ...@@ -428,12 +431,13 @@ SYM_TYPED_FUNC_START(xscale_dma_unmap_area)
ret lr ret lr
SYM_FUNC_END(xscale_dma_unmap_area) SYM_FUNC_END(xscale_dma_unmap_area)
ENTRY(cpu_xscale_dcache_clean_area) SYM_TYPED_FUNC_START(cpu_xscale_dcache_clean_area)
1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry 1: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
add r0, r0, #CACHELINESIZE add r0, r0, #CACHELINESIZE
subs r1, r1, #CACHELINESIZE subs r1, r1, #CACHELINESIZE
bhi 1b bhi 1b
ret lr ret lr
SYM_FUNC_END(cpu_xscale_dcache_clean_area)
/* =============================== PageTable ============================== */ /* =============================== PageTable ============================== */
...@@ -445,13 +449,14 @@ ENTRY(cpu_xscale_dcache_clean_area) ...@@ -445,13 +449,14 @@ ENTRY(cpu_xscale_dcache_clean_area)
* pgd: new page tables * pgd: new page tables
*/ */
.align 5 .align 5
ENTRY(cpu_xscale_switch_mm) SYM_TYPED_FUNC_START(cpu_xscale_switch_mm)
clean_d_cache r1, r2 clean_d_cache r1, r2
mcr p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB mcr p15, 0, ip, c7, c5, 0 @ Invalidate I cache & BTB
mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer mcr p15, 0, ip, c7, c10, 4 @ Drain Write (& Fill) Buffer
mcr p15, 0, r0, c2, c0, 0 @ load page table pointer mcr p15, 0, r0, c2, c0, 0 @ load page table pointer
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
cpwait_ret lr, ip cpwait_ret lr, ip
SYM_FUNC_END(cpu_xscale_switch_mm)
/* /*
* cpu_xscale_set_pte_ext(ptep, pte, ext) * cpu_xscale_set_pte_ext(ptep, pte, ext)
...@@ -479,7 +484,7 @@ cpu_xscale_mt_table: ...@@ -479,7 +484,7 @@ cpu_xscale_mt_table:
.long 0x00 @ unused .long 0x00 @ unused
.align 5 .align 5
ENTRY(cpu_xscale_set_pte_ext) SYM_TYPED_FUNC_START(cpu_xscale_set_pte_ext)
xscale_set_pte_ext_prologue xscale_set_pte_ext_prologue
@ @
...@@ -497,6 +502,7 @@ ENTRY(cpu_xscale_set_pte_ext) ...@@ -497,6 +502,7 @@ ENTRY(cpu_xscale_set_pte_ext)
xscale_set_pte_ext_epilogue xscale_set_pte_ext_epilogue
ret lr ret lr
SYM_FUNC_END(cpu_xscale_set_pte_ext)
.ltorg .ltorg
.align .align
...@@ -504,7 +510,7 @@ ENTRY(cpu_xscale_set_pte_ext) ...@@ -504,7 +510,7 @@ ENTRY(cpu_xscale_set_pte_ext)
.globl cpu_xscale_suspend_size .globl cpu_xscale_suspend_size
.equ cpu_xscale_suspend_size, 4 * 6 .equ cpu_xscale_suspend_size, 4 * 6
#ifdef CONFIG_ARM_CPU_SUSPEND #ifdef CONFIG_ARM_CPU_SUSPEND
ENTRY(cpu_xscale_do_suspend) SYM_TYPED_FUNC_START(cpu_xscale_do_suspend)
stmfd sp!, {r4 - r9, lr} stmfd sp!, {r4 - r9, lr}
mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
mrc p15, 0, r5, c15, c1, 0 @ CP access reg mrc p15, 0, r5, c15, c1, 0 @ CP access reg
...@@ -515,9 +521,9 @@ ENTRY(cpu_xscale_do_suspend) ...@@ -515,9 +521,9 @@ ENTRY(cpu_xscale_do_suspend)
bic r4, r4, #2 @ clear frequency change bit bic r4, r4, #2 @ clear frequency change bit
stmia r0, {r4 - r9} @ store cp regs stmia r0, {r4 - r9} @ store cp regs
ldmfd sp!, {r4 - r9, pc} ldmfd sp!, {r4 - r9, pc}
ENDPROC(cpu_xscale_do_suspend) SYM_FUNC_END(cpu_xscale_do_suspend)
ENTRY(cpu_xscale_do_resume) SYM_TYPED_FUNC_START(cpu_xscale_do_resume)
ldmia r0, {r4 - r9} @ load cp regs ldmia r0, {r4 - r9} @ load cp regs
mov ip, #0 mov ip, #0
mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
...@@ -530,7 +536,7 @@ ENTRY(cpu_xscale_do_resume) ...@@ -530,7 +536,7 @@ ENTRY(cpu_xscale_do_resume)
mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg
mov r0, r9 @ control register mov r0, r9 @ control register
b cpu_resume_mmu b cpu_resume_mmu
ENDPROC(cpu_xscale_do_resume) SYM_FUNC_END(cpu_xscale_do_resume)
#endif #endif
.type __xscale_setup, #function .type __xscale_setup, #function
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment