Deleted Added
full compact
xlr_machdep.c (211814) xlr_machdep.c (211893)
1/*-
2 * Copyright (c) 2006-2009 RMI Corporation
3 * Copyright (c) 2002-2004 Juli Mallett <jmallett@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 */
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006-2009 RMI Corporation
3 * Copyright (c) 2002-2004 Juli Mallett <jmallett@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 */
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/mips/rmi/xlr_machdep.c 211814 2010-08-25 13:37:55Z jchandra $");
29__FBSDID("$FreeBSD: head/sys/mips/rmi/xlr_machdep.c 211893 2010-08-27 19:53:57Z jchandra $");
30
31#include "opt_ddb.h"
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/conf.h>
36#include <sys/rtprio.h>
37#include <sys/systm.h>

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

300 int i, level, irq;
301
302 mtx_init(&xlr_pic_lock, "pic", NULL, MTX_SPIN);
303 xlr_write_reg(mmio, PIC_CTRL, 0);
304
305 /* Initialize all IRT entries */
306 for (i = 0; i < PIC_NUM_IRTS; i++) {
307 irq = PIC_INTR_TO_IRQ(i);
30
31#include "opt_ddb.h"
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/conf.h>
36#include <sys/rtprio.h>
37#include <sys/systm.h>

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

300 int i, level, irq;
301
302 mtx_init(&xlr_pic_lock, "pic", NULL, MTX_SPIN);
303 xlr_write_reg(mmio, PIC_CTRL, 0);
304
305 /* Initialize all IRT entries */
306 for (i = 0; i < PIC_NUM_IRTS; i++) {
307 irq = PIC_INTR_TO_IRQ(i);
308 level = PIC_IRQ_IS_EDGE_TRIGGERED(irq);
308 level = PIC_IS_EDGE_TRIGGERED(i);
309
310 /* Bind all PIC irqs to cpu 0 */
311 xlr_write_reg(mmio, PIC_IRT_0(i), 0x01);
312
313 /*
314 * Use local scheduling and high polarity for all IRTs
315 * Invalidate all IRTs, by default
316 */

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

570
571 /* Setup interrupts for secondary CPUs here */
572 stat = mips_rd_status();
573 KASSERT((stat & MIPS_SR_INT_IE) == 0,
574 ("Interrupts enabled in %s!", __func__));
575 stat |= MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT;
576 mips_wr_status(stat);
577
309
310 /* Bind all PIC irqs to cpu 0 */
311 xlr_write_reg(mmio, PIC_IRT_0(i), 0x01);
312
313 /*
314 * Use local scheduling and high polarity for all IRTs
315 * Invalidate all IRTs, by default
316 */

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

570
571 /* Setup interrupts for secondary CPUs here */
572 stat = mips_rd_status();
573 KASSERT((stat & MIPS_SR_INT_IE) == 0,
574 ("Interrupts enabled in %s!", __func__));
575 stat |= MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT;
576 mips_wr_status(stat);
577
578 xlr_unmask_hard_irq((void *)IRQ_IPI);
579 xlr_unmask_hard_irq((void *)IRQ_TIMER);
578 xlr_enable_irq(IRQ_IPI);
579 xlr_enable_irq(IRQ_TIMER);
580 if (xlr_thr_id() == 0) {
581 xlr_msgring_cpu_init();
580 if (xlr_thr_id() == 0) {
581 xlr_msgring_cpu_init();
582 xlr_unmask_hard_irq((void *)IRQ_MSGRING);
582 xlr_enable_irq(IRQ_MSGRING);
583 }
584
585 return;
586}
587
588int
589platform_ipi_intrnum(void)
590{

--- 39 unchanged lines hidden ---
583 }
584
585 return;
586}
587
588int
589platform_ipi_intrnum(void)
590{

--- 39 unchanged lines hidden ---