Remap PMC interrupt for all cores

This commit is contained in:
Oleksandr Tymoshenko 2012-03-24 06:28:15 +00:00
parent 634f9253e8
commit 5e608d0b09
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=233417
3 changed files with 12 additions and 11 deletions

View File

@ -176,4 +176,6 @@ typedef enum
/* Interrupts 129 - 135 are reserved */
} octeon_irq_t;
#define OCTEON_PMC_IRQ OCTEON_IRQ_4
#endif

View File

@ -260,6 +260,8 @@ octeon_debug_symbol(void)
void
octeon_ciu_reset(void)
{
uint64_t cvmctl;
/* Disable all CIU interrupts by default */
cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), 0);
cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2+1), 0);
@ -272,6 +274,14 @@ octeon_ciu_reset(void)
(1ull << (OCTEON_IRQ_MBOX0 - 8)) |
(1ull << (OCTEON_IRQ_MBOX1 - 8)));
#endif
/*
* Move the Performance Counter interrupt to OCTEON_PMC_IRQ
*/
cvmctl = mips_rd_cvmctl();
cvmctl &= ~(7 << 7);
cvmctl |= (OCTEON_PMC_IRQ + 2) << 7;
mips_wr_cvmctl(cvmctl);
}
static void

View File

@ -57,8 +57,6 @@ static int octeon_pmc_probe(device_t);
static int octeon_pmc_attach(device_t);
static int octeon_pmc_intr(void *);
#define OCTEON_PMC_IRQ 4
static void
octeon_pmc_identify(driver_t *drv, device_t parent)
{
@ -82,7 +80,6 @@ octeon_pmc_attach(device_t dev)
struct octeon_pmc_softc *sc;
int error;
int rid;
uint64_t cvmctl;
sc = device_get_softc(dev);
@ -103,14 +100,6 @@ octeon_pmc_attach(device_t dev)
return (error);
}
/*
* Move the Performance Counter interrupt to OCTEON_PMC_IRQ
*/
cvmctl = mips_rd_cvmctl();
cvmctl &= ~(7 << 7);
cvmctl |= (OCTEON_PMC_IRQ + 2) << 7;
mips_wr_cvmctl(cvmctl);
return (0);
}