1 /* Boot entry point for MN10300 kernel
3 * Copyright (C) 2005 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.
12 #include <linux/init.h>
13 #include <linux/threads.h>
14 #include <linux/linkage.h>
15 #include <linux/serial_reg.h>
16 #include <asm/thread_info.h>
18 #include <asm/pgtable.h>
19 #include <asm/frame.inc>
20 #include <asm/param.h>
21 #include <unit/serial.h>
25 ###############################################################################
27 # bootloader entry point
29 ###############################################################################
31 .type _start,@function
33 # save commandline pointer
36 # preload the PGD pointer register
41 mov MMUCTR_IIV|MMUCTR_DIV,d0
43 mov MMUCTR_ITE|MMUCTR_DTE|MMUCTR_CE,d0
46 # turn on AM33v2 exception handling mode and set the trap table base
50 mov CONFIG_INTERRUPT_VECTOR_BASE,d0
53 # invalidate and enable both of the caches
56 movhu d0,(a0) # turn off first
57 mov CHCTR_ICINV|CHCTR_DCINV,d0
61 btst CHCTR_ICBUSY|CHCTR_DCBUSY,d0 # wait till not busy
64 #ifndef CONFIG_MN10300_CACHE_DISABLED
65 #ifdef CONFIG_MN10300_CACHE_WBACK
66 #ifndef CONFIG_MN10300_CACHE_WBACK_NOWRALLOC
67 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK,d0
69 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRBACK|CHCTR_DCALMD,d0
70 #endif /* CACHE_DISABLED */
72 mov CHCTR_ICEN|CHCTR_DCEN|CHCTR_DCWTMD_WRTHROUGH,d0
74 movhu d0,(a0) # enable
75 #endif /* NOWRALLOC */
77 # turn on RTS on the debug serial port if applicable
78 #ifdef CONFIG_MN10300_UNIT_ASB2305
79 bset UART_MCR_RTS,(ASB2305_DEBUG_MCR)
94 # retrieve the parameters (including command line) before we overwrite
100 mov redboot_command_line,a0
102 add COMMAND_LINE_SIZE,a1
111 mov redboot_platform_name,a0
113 add COMMAND_LINE_SIZE,a1
125 # set up the registers with recognisable rubbish in them
126 mov init_thread_union+THREAD_SIZE-12,sp
129 mov d0,(4,sp) # EPSW save area
131 mov d0,(8,sp) # PC save area
164 # set up the initial kernel stack
167 mov d0,(REG_ORIG_D0,fp)
169 # put different recognisable rubbish in the regs
200 # we may be holding current in E2
201 #ifdef CONFIG_MN10300_CURRENT_IN_E2
205 # initialise the processor and the unit
206 call processor_init[],0
209 #ifdef CONFIG_GDBSTUB
210 call gdbstub_init[],0
212 #ifdef CONFIG_GDBSTUB_IMMEDIATE
213 .globl __gdbstub_pause
220 .size _start, _start-.
224 * This is initialized to disallow all access to the low 2G region
225 * - the high 2G region is managed directly by the MMU
226 * - range 0x70000000-0x7C000000 are initialised for use by VMALLOC
230 ENTRY(swapper_pg_dir)
231 .space PTRS_PER_PGD*4
234 * The page tables are initialized to only 8MB here - the final page
235 * tables are set up later depending on memory size.
239 ENTRY(empty_zero_page)
243 ENTRY(empty_bad_page)
247 ENTRY(empty_bad_pte_table)
251 ENTRY(large_page_table)
255 ENTRY(kernel_vmalloc_ptes)
256 .space ((VMALLOC_END-VMALLOC_START)/PAGE_SIZE)*4