beri_machdep.c (245329) | beri_machdep.c (245330) |
---|---|
1/*- 2 * Copyright (c) 2006 Wojciech A. Koszek <wkoszek@FreeBSD.org> 3 * Copyright (c) 2012 Robert N. M. Watson 4 * All rights reserved. 5 * 6 * This software was developed by SRI International and the University of 7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 8 * ("CTSRD"), as part of the DARPA CRASH research programme. --- 15 unchanged lines hidden (view full) --- 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 Wojciech A. Koszek <wkoszek@FreeBSD.org> 3 * Copyright (c) 2012 Robert N. M. Watson 4 * All rights reserved. 5 * 6 * This software was developed by SRI International and the University of 7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 8 * ("CTSRD"), as part of the DARPA CRASH research programme. --- 15 unchanged lines hidden (view full) --- 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/mips/beri/beri_machdep.c 245329 2013-01-12 12:34:59Z rwatson $"); | 32__FBSDID("$FreeBSD: head/sys/mips/beri/beri_machdep.c 245330 2013-01-12 13:20:21Z rwatson $"); |
33 34#include "opt_ddb.h" 35#include "opt_platform.h" 36 37#include <sys/param.h> 38#include <sys/conf.h> 39#include <sys/kernel.h> 40#include <sys/systm.h> 41#include <sys/imgact.h> 42#include <sys/bio.h> 43#include <sys/buf.h> 44#include <sys/bus.h> 45#include <sys/cpu.h> 46#include <sys/cons.h> 47#include <sys/exec.h> | 33 34#include "opt_ddb.h" 35#include "opt_platform.h" 36 37#include <sys/param.h> 38#include <sys/conf.h> 39#include <sys/kernel.h> 40#include <sys/systm.h> 41#include <sys/imgact.h> 42#include <sys/bio.h> 43#include <sys/buf.h> 44#include <sys/bus.h> 45#include <sys/cpu.h> 46#include <sys/cons.h> 47#include <sys/exec.h> |
48#include <sys/linker.h> |
|
48#include <sys/ucontext.h> 49#include <sys/proc.h> 50#include <sys/kdb.h> 51#include <sys/ptrace.h> 52#include <sys/reboot.h> 53#include <sys/signalvar.h> 54#include <sys/sysent.h> 55#include <sys/sysproto.h> --- 9 unchanged lines hidden (view full) --- 65#include <vm/vm_page.h> 66#include <vm/vm_pager.h> 67 68#include <machine/clock.h> 69#include <machine/cpu.h> 70#include <machine/cpuregs.h> 71#include <machine/hwfunc.h> 72#include <machine/md_var.h> | 49#include <sys/ucontext.h> 50#include <sys/proc.h> 51#include <sys/kdb.h> 52#include <sys/ptrace.h> 53#include <sys/reboot.h> 54#include <sys/signalvar.h> 55#include <sys/sysent.h> 56#include <sys/sysproto.h> --- 9 unchanged lines hidden (view full) --- 66#include <vm/vm_page.h> 67#include <vm/vm_pager.h> 68 69#include <machine/clock.h> 70#include <machine/cpu.h> 71#include <machine/cpuregs.h> 72#include <machine/hwfunc.h> 73#include <machine/md_var.h> |
74#include <machine/metadata.h> |
|
73#include <machine/pmap.h> 74#include <machine/trap.h> 75 76extern int *edata; 77extern int *end; 78 79void 80platform_cpu_init() --- 49 unchanged lines hidden (view full) --- 130 __register_t a3) 131{ 132 vm_offset_t kernend; 133 uint64_t platform_counter_freq; 134 int argc = a0; 135 char **argv = (char **)a1; 136 char **envp = (char **)a2; 137 unsigned int memsize = a3; | 75#include <machine/pmap.h> 76#include <machine/trap.h> 77 78extern int *edata; 79extern int *end; 80 81void 82platform_cpu_init() --- 49 unchanged lines hidden (view full) --- 132 __register_t a3) 133{ 134 vm_offset_t kernend; 135 uint64_t platform_counter_freq; 136 int argc = a0; 137 char **argv = (char **)a1; 138 char **envp = (char **)a2; 139 unsigned int memsize = a3; |
140#ifdef FDT 141 vm_offset_t dtbp; 142 void *kmdp; 143#endif |
|
138 int i; 139 140 /* clear the BSS and SBSS segments */ 141 kernend = (vm_offset_t)&end; 142 memset(&edata, 0, kernend - (vm_offset_t)(&edata)); 143 144 mips_postboot_fixup(); 145 146 mips_pcpu0_init(); 147 148#ifdef FDT | 144 int i; 145 146 /* clear the BSS and SBSS segments */ 147 kernend = (vm_offset_t)&end; 148 memset(&edata, 0, kernend - (vm_offset_t)(&edata)); 149 150 mips_postboot_fixup(); 151 152 mips_pcpu0_init(); 153 154#ifdef FDT |
149#ifndef FDT_DTB_STATIC 150#error "mips_init with FDT requires FDT_DTB_STATIC" | 155 /* 156 * Find the dtb passed in by the boot loader (currently fictional). 157 */ 158 kmdp = preload_search_by_type("elf kernel"); 159 if (kmdp != NULL) 160 dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); 161 else 162 dtbp = (vm_offset_t)NULL; 163 164#if defined(FDT_DTB_STATIC) 165 /* 166 * In case the device tree blob was not retrieved (from metadata) try 167 * to use the statically embedded one. 168 */ 169 if (dtbp == (vm_offset_t)NULL) 170 dtbp = (vm_offset_t)&fdt_static_dtb; 171#else 172#error "Non-static FDT not yet supported on BERI" |
151#endif 152 153 if (OF_install(OFW_FDT, 0) == FALSE) 154 while (1); 155 if (OF_init(&fdt_static_dtb) != 0) 156 while (1); 157#endif 158 --- 29 unchanged lines hidden --- | 173#endif 174 175 if (OF_install(OFW_FDT, 0) == FALSE) 176 while (1); 177 if (OF_init(&fdt_static_dtb) != 0) 178 while (1); 179#endif 180 --- 29 unchanged lines hidden --- |