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>
19 #include <proc/smp-regs.h>
26 # Secondary CPUs jump directly to the kernel entry point
28 # Must save primary CPU's D0-D2 registers as they hold boot parameters
33 mov CONFIG_KERNEL_TEXT_ADDRESS,a0
37 #endif /* CONFIG_SMP */
39 # first save parameters from bootloader
40 mov param_save_area,a0
46 mov decomp_stack+0x2000-4,a0
49 # invalidate and enable both of the caches
52 movhu d0,(a0) # turn off first
53 mov CHCTR_ICINV|CHCTR_DCINV,d0
57 btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
60 #ifdef CONFIG_MN10300_CACHE_ENABLED
61 #ifdef CONFIG_MN10300_CACHE_WBACK
62 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0
64 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0
66 movhu d0,(a0) # enable
81 # decompress the kernel
82 call decompress_kernel[],0
83 #ifdef CONFIG_MN10300_CACHE_WBACK
84 call mn10300_dcache_flush_inv[],0
87 # disable caches again
93 btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
96 mov param_save_area,a0
101 # jump to the kernel proper entry point
103 mov CONFIG_KERNEL_TEXT_ADDRESS,a0
107 ###############################################################################
109 # Cache flush routines
111 ###############################################################################
112 #ifdef CONFIG_MN10300_CACHE_WBACK
113 mn10300_dcache_flush_inv:
116 beq mn10300_dcache_flush_inv_end
118 mov L1_CACHE_NENTRIES,d1
121 mn10300_dcache_flush_inv_loop:
122 mov (DCACHE_PURGE_WAY0(0),a1),d0 # unconditional purge
123 mov (DCACHE_PURGE_WAY1(0),a1),d0 # unconditional purge
124 mov (DCACHE_PURGE_WAY2(0),a1),d0 # unconditional purge
125 mov (DCACHE_PURGE_WAY3(0),a1),d0 # unconditional purge
127 add L1_CACHE_BYTES,a1
129 bne mn10300_dcache_flush_inv_loop
131 mn10300_dcache_flush_inv_end:
133 #endif /* CONFIG_MN10300_CACHE_WBACK */
136 ###############################################################################
140 ###############################################################################