1 /* Boot entry point for a compressed MN10300 kernel
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
15 #include <linux/linkage.h>
16 #include <asm/cpu-regs.h>
17 #include <asm/cache.h>
21 # first save off parameters from bootloader
22 mov param_save_area,a0
28 mov decomp_stack+0x2000-4,a0
31 # invalidate and enable both of the caches
34 movhu d0,(a0) # turn off first
35 mov CHCTR_ICINV|CHCTR_DCINV,d0
39 btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
42 #ifdef CONFIG_MN10300_CACHE_ENABLED
43 #ifdef CONFIG_MN10300_CACHE_WBACK
44 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0
46 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0
48 movhu d0,(a0) # enable
63 # decompress the kernel
64 call decompress_kernel[],0
65 #ifdef CONFIG_MN10300_CACHE_WBACK
66 call mn10300_dcache_flush_inv[],0
69 # disable caches again
75 btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
78 mov param_save_area,a0
83 # jump to the kernel proper entry point
85 mov CONFIG_KERNEL_TEXT_ADDRESS,a0
89 ###############################################################################
91 # Cache flush routines
93 ###############################################################################
94 #ifdef CONFIG_MN10300_CACHE_WBACK
95 mn10300_dcache_flush_inv:
98 beq mn10300_dcache_flush_inv_end
100 mov L1_CACHE_NENTRIES,d1
103 mn10300_dcache_flush_inv_loop:
104 mov (DCACHE_PURGE_WAY0(0),a1),d0 # unconditional purge
105 mov (DCACHE_PURGE_WAY1(0),a1),d0 # unconditional purge
106 mov (DCACHE_PURGE_WAY2(0),a1),d0 # unconditional purge
107 mov (DCACHE_PURGE_WAY3(0),a1),d0 # unconditional purge
109 add L1_CACHE_BYTES,a1
111 bne mn10300_dcache_flush_inv_loop
113 mn10300_dcache_flush_inv_end:
115 #endif /* CONFIG_MN10300_CACHE_WBACK */
118 ###############################################################################
122 ###############################################################################