Deleted Added
full compact
xlp_machdep.c (233532) xlp_machdep.c (233533)
1/*-
2 * Copyright 2003-2011 Netlogic Microsystems (Netlogic). All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *

--- 14 unchanged lines hidden (view full) ---

23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 * THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * NETLOGIC_BSD */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright 2003-2011 Netlogic Microsystems (Netlogic). All rights
3 * reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *

--- 14 unchanged lines hidden (view full) ---

23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 * THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * NETLOGIC_BSD */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/mips/nlm/xlp_machdep.c 233532 2012-03-27 07:34:27Z jchandra $");
31__FBSDID("$FreeBSD: head/sys/mips/nlm/xlp_machdep.c 233533 2012-03-27 07:39:05Z jchandra $");
32
33#include "opt_ddb.h"
34#include "opt_platform.h"
35
36#include <sys/param.h>
37#include <sys/bus.h>
38#include <sys/conf.h>
39#include <sys/rtprio.h>

--- 151 unchanged lines hidden (view full) ---

191 case 0xf:
192 xlp_threads_per_core = 4;
193 xlp_mmuval = 3;
194 break;
195 default:
196 goto unsupp;
197 }
198
32
33#include "opt_ddb.h"
34#include "opt_platform.h"
35
36#include <sys/param.h>
37#include <sys/bus.h>
38#include <sys/conf.h>
39#include <sys/rtprio.h>

--- 151 unchanged lines hidden (view full) ---

191 case 0xf:
192 xlp_threads_per_core = 4;
193 xlp_mmuval = 3;
194 break;
195 default:
196 goto unsupp;
197 }
198
199 /* Take out cores which do not exist on chip */
199 /* Try to find the enabled cores from SYS block */
200 sysbase = nlm_get_sys_regbase(0);
201 cpu_rst_mask = nlm_read_sys_reg(sysbase, SYS_CPU_RESET) & 0xff;
200 sysbase = nlm_get_sys_regbase(0);
201 cpu_rst_mask = nlm_read_sys_reg(sysbase, SYS_CPU_RESET) & 0xff;
202
203 /* XLP 416 does not report this correctly, fix */
204 if (nlm_processor_id() == CHIP_PROCESSOR_ID_XLP_416)
205 cpu_rst_mask = 0xe;
206
207 /* Take out cores which do not exist on chip */
202 for (i = 1; i < XLP_MAX_CORES; i++) {
203 if ((cpu_rst_mask & (1 << i)) == 0)
204 cpu_map &= ~(0xfu << (4 * i));
205 }
206
207 /* Verify other cores' CPU masks */
208 for (i = 1; i < XLP_MAX_CORES; i++) {
209 core_thr_mask = (cpu_map >> (4 * i)) & 0xf;

--- 300 unchanged lines hidden (view full) ---

510{
511
512 /* Initialize pcpu stuff */
513 mips_pcpu0_init();
514
515 /* initialize console so that we have printf */
516 boothowto |= (RB_SERIAL | RB_MULTIPLE); /* Use multiple consoles */
517
208 for (i = 1; i < XLP_MAX_CORES; i++) {
209 if ((cpu_rst_mask & (1 << i)) == 0)
210 cpu_map &= ~(0xfu << (4 * i));
211 }
212
213 /* Verify other cores' CPU masks */
214 for (i = 1; i < XLP_MAX_CORES; i++) {
215 core_thr_mask = (cpu_map >> (4 * i)) & 0xf;

--- 300 unchanged lines hidden (view full) ---

516{
517
518 /* Initialize pcpu stuff */
519 mips_pcpu0_init();
520
521 /* initialize console so that we have printf */
522 boothowto |= (RB_SERIAL | RB_MULTIPLE); /* Use multiple consoles */
523
518 nlm_pic_irt_init(); /* complete before interrupts or console init */
524 nlm_pic_irt_init(0); /* complete before interrupts or console init */
519 init_static_kenv(boot1_env, sizeof(boot1_env));
520 xlp_bootargs_init(a0);
521
522 /* clockrate used by delay, so initialize it here */
525 init_static_kenv(boot1_env, sizeof(boot1_env));
526 xlp_bootargs_init(a0);
527
528 /* clockrate used by delay, so initialize it here */
523 xlp_cpu_frequency = xlp_get_cpu_frequency(0);
529 xlp_cpu_frequency = xlp_get_cpu_frequency(0, 0);
524 cpu_clock = xlp_cpu_frequency / 1000000;
525 mips_timer_early_init(xlp_cpu_frequency);
526
527 /* Init console please */
528 cninit();
529
530 /* Early core init and fixes for errata */
531 xlp_setup_core();

--- 178 unchanged lines hidden ---
530 cpu_clock = xlp_cpu_frequency / 1000000;
531 mips_timer_early_init(xlp_cpu_frequency);
532
533 /* Init console please */
534 cninit();
535
536 /* Early core init and fixes for errata */
537 xlp_setup_core();

--- 178 unchanged lines hidden ---