sb_machdep.c (204689) | sb_machdep.c (205364) |
---|---|
1/*- 2 * Copyright (c) 2007 Bruce M. Simpson. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2007 Bruce M. Simpson. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/mips/sibyte/sb_machdep.c 204689 2010-03-04 05:23:08Z neel $"); | 28__FBSDID("$FreeBSD: head/sys/mips/sibyte/sb_machdep.c 205364 2010-03-20 05:49:06Z neel $"); |
29 30#include <sys/param.h> 31#include <machine/cpuregs.h> 32 33#include "opt_ddb.h" 34#include "opt_kdb.h" 35 36#include <sys/param.h> --- 11 unchanged lines hidden (view full) --- 48#include <sys/proc.h> 49#include <sys/kdb.h> 50#include <sys/ptrace.h> 51#include <sys/reboot.h> 52#include <sys/signalvar.h> 53#include <sys/sysent.h> 54#include <sys/sysproto.h> 55#include <sys/user.h> | 29 30#include <sys/param.h> 31#include <machine/cpuregs.h> 32 33#include "opt_ddb.h" 34#include "opt_kdb.h" 35 36#include <sys/param.h> --- 11 unchanged lines hidden (view full) --- 48#include <sys/proc.h> 49#include <sys/kdb.h> 50#include <sys/ptrace.h> 51#include <sys/reboot.h> 52#include <sys/signalvar.h> 53#include <sys/sysent.h> 54#include <sys/sysproto.h> 55#include <sys/user.h> |
56#include <sys/timetc.h> |
|
56 57#include <vm/vm.h> 58#include <vm/vm_object.h> 59#include <vm/vm_page.h> 60#include <vm/vm_pager.h> 61 62#include <machine/cache.h> 63#include <machine/clock.h> --- 295 unchanged lines hidden (view full) --- 359 return (0); 360 } 361#else 362 return (-1); 363#endif /* CFE */ 364} 365#endif /* SMP */ 366 | 57 58#include <vm/vm.h> 59#include <vm/vm_object.h> 60#include <vm/vm_page.h> 61#include <vm/vm_pager.h> 62 63#include <machine/cache.h> 64#include <machine/clock.h> --- 295 unchanged lines hidden (view full) --- 360 return (0); 361 } 362#else 363 return (-1); 364#endif /* CFE */ 365} 366#endif /* SMP */ 367 |
368static u_int 369sb_get_timecount(struct timecounter *tc) 370{ 371 372 return ((u_int)sb_zbbus_cycle_count()); 373} 374 375static void 376sb_timecounter_init(void) 377{ 378 static struct timecounter sb_timecounter = { 379 sb_get_timecount, 380 NULL, 381 ~0u, 382 0, 383 "sibyte_zbbus_counter", 384 2000 385 }; 386 387 /* 388 * The ZBbus cycle counter runs at half the cpu frequency. 389 */ 390 sb_timecounter.tc_frequency = sb_cpu_speed() / 2; 391 platform_timecounter = &sb_timecounter; 392} 393 |
|
367void 368platform_start(__register_t a0, __register_t a1, __register_t a2, 369 __register_t a3) 370{ 371 /* 372 * Make sure that kseg0 is mapped cacheable-coherent 373 */ 374 kseg0_map_coherent(); 375 376 /* clear the BSS and SBSS segments */ 377 memset(&edata, 0, (vm_offset_t)&end - (vm_offset_t)&edata); 378 mips_postboot_fixup(); 379 380 sb_intr_init(0); | 394void 395platform_start(__register_t a0, __register_t a1, __register_t a2, 396 __register_t a3) 397{ 398 /* 399 * Make sure that kseg0 is mapped cacheable-coherent 400 */ 401 kseg0_map_coherent(); 402 403 /* clear the BSS and SBSS segments */ 404 memset(&edata, 0, (vm_offset_t)&end - (vm_offset_t)&edata); 405 mips_postboot_fixup(); 406 407 sb_intr_init(0); |
408 sb_timecounter_init(); |
|
381 382 /* Initialize pcpu stuff */ 383 mips_pcpu0_init(); 384 385#ifdef CFE 386 /* 387 * Initialize CFE firmware trampolines before 388 * we initialize the low-level console. --- 6 unchanged lines hidden (view full) --- 395 if (a3 == CFE_EPTSEAL) 396 cfe_init(a0, a2); 397#endif 398 cninit(); 399 400 mips_init(); 401 402 mips_timer_init_params(sb_cpu_speed(), 0); | 409 410 /* Initialize pcpu stuff */ 411 mips_pcpu0_init(); 412 413#ifdef CFE 414 /* 415 * Initialize CFE firmware trampolines before 416 * we initialize the low-level console. --- 6 unchanged lines hidden (view full) --- 423 if (a3 == CFE_EPTSEAL) 424 cfe_init(a0, a2); 425#endif 426 cninit(); 427 428 mips_init(); 429 430 mips_timer_init_params(sb_cpu_speed(), 0); |
431 432 set_cputicker(sb_zbbus_cycle_count, sb_cpu_speed() / 2, 1); |
|
403} | 433} |