mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
BEV needs to be zero in single-vector mode; Interrupts go to EBASE+0x200
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4153 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -161,8 +161,9 @@ __reset:
|
|||||||
* Name: _gen_exception
|
* Name: _gen_exception
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* General Exception Vector Handler. Jumps to _exception_handler. NOTE:
|
* General Exception Vector Handler. Jumps to _exception_handler. This
|
||||||
* we set the BEV bit in the status register so all interrupt vectors
|
* vector will be positioned at 0xbfc00180 by the linker script. NOTE:
|
||||||
|
* If we set the BEV bit in the status register so all interrupt vectors
|
||||||
* should go through the _bev_exception.
|
* should go through the _bev_exception.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@@ -182,11 +183,40 @@ _gen_exception:
|
|||||||
nop
|
nop
|
||||||
.end _gen_exception
|
.end _gen_exception
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: _ebase_exception
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Interrupt Exception Vector Handler. Jumps to _int_handler. This
|
||||||
|
* vector will be positioned at 0xbfc00200 by the linker script. NOTE:
|
||||||
|
* Several vectors (JTAG, TLB fills, etc.) could come through this vector.
|
||||||
|
* However, this is intended to serve vectors in PIC32MX single vector
|
||||||
|
* mode: The EBASE register will be set to 0xbfc00000 and the vector
|
||||||
|
* should go to EBASE + 0x0200.
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* Does not return
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
.section .ebase_excpt,"ax",@progbits
|
||||||
|
.set noreorder
|
||||||
|
.ent _ebase_exception
|
||||||
|
_ebase_exception:
|
||||||
|
la k0, _int_handler
|
||||||
|
jr k0
|
||||||
|
nop
|
||||||
|
.end _ebase_exception
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: _bev_exception
|
* Name: _bev_exception
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Boot Exception Vector Handler. Jumps to _exception_handler
|
* Boot Exception Vector Handler. Jumps to _exception_handler. This
|
||||||
|
* vector will be positioned at 0xbfc00380 by the linker script.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
@@ -209,7 +239,8 @@ _bev_exception:
|
|||||||
* Name: _int_exception
|
* Name: _int_exception
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Interrupt Exception Vector Handler. Jumps to _int_handler
|
* Interrupt Exception Vector Handler. Jumps to _int_handler. This
|
||||||
|
* vector will be positioned at 0xbfc00400 by the linker script.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
|
|||||||
@@ -114,7 +114,9 @@ void up_irqinitialize(void)
|
|||||||
regval |= CP0_STATUS_BEV;
|
regval |= CP0_STATUS_BEV;
|
||||||
cp0_putstatus(regval);
|
cp0_putstatus(regval);
|
||||||
|
|
||||||
/* Set the EBASE value to the beginning of boot FLASH */
|
/* Set the EBASE value to the beginning of boot FLASH. In single-vector
|
||||||
|
* mode, interrupt vectors should go to EBASE + 0x0200 0r 0xbfc00200.
|
||||||
|
*/
|
||||||
|
|
||||||
cp0_putebase(0xbfc00000);
|
cp0_putebase(0xbfc00000);
|
||||||
|
|
||||||
@@ -128,10 +130,10 @@ void up_irqinitialize(void)
|
|||||||
regval |= CP0_CAUSE_IV;
|
regval |= CP0_CAUSE_IV;
|
||||||
cp0_putcause(regval);
|
cp0_putcause(regval);
|
||||||
|
|
||||||
/* Clear the EXL bit in the STATUS register */
|
/* Clear the EXL and BEV bits in the STATUS register */
|
||||||
|
|
||||||
regval = cp0_getstatus();
|
regval = cp0_getstatus();
|
||||||
regval &= ~CP0_STATUS_EXL;
|
regval &= ~(CP0_STATUS_EXL | CP0_STATUS_BEV);
|
||||||
cp0_putstatus(regval);
|
cp0_putstatus(regval);
|
||||||
|
|
||||||
/* Configure multi- or single- vector interrupts */
|
/* Configure multi- or single- vector interrupts */
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ MEMORY
|
|||||||
|
|
||||||
kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384
|
kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384
|
||||||
kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128
|
kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128
|
||||||
|
kseg1_ebexcpt (rx) : ORIGIN = 0xbfc00200, LENGTH = 128
|
||||||
kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128
|
kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128
|
||||||
kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128
|
kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128
|
||||||
kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16
|
kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16
|
||||||
@@ -125,6 +126,11 @@ SECTIONS
|
|||||||
KEEP (*(.gen_excpt))
|
KEEP (*(.gen_excpt))
|
||||||
} > kseg1_genexcpt
|
} > kseg1_genexcpt
|
||||||
|
|
||||||
|
.ebase_excpt :
|
||||||
|
{
|
||||||
|
KEEP (*(.ebase_excpt))
|
||||||
|
} > kseg1_ebexcpt
|
||||||
|
|
||||||
.bev_excpt :
|
.bev_excpt :
|
||||||
{
|
{
|
||||||
KEEP (*(.bev_excpt))
|
KEEP (*(.bev_excpt))
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ MEMORY
|
|||||||
|
|
||||||
kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384
|
kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384
|
||||||
kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128
|
kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128
|
||||||
|
kseg1_ebexcpt (rx) : ORIGIN = 0xbfc00200, LENGTH = 128
|
||||||
|
kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128
|
||||||
kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128
|
kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128
|
||||||
kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16
|
kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16
|
||||||
kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168
|
kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168
|
||||||
@@ -124,6 +126,11 @@ SECTIONS
|
|||||||
KEEP (*(.gen_excpt))
|
KEEP (*(.gen_excpt))
|
||||||
} > kseg1_genexcpt
|
} > kseg1_genexcpt
|
||||||
|
|
||||||
|
.ebase_excpt :
|
||||||
|
{
|
||||||
|
KEEP (*(.ebase_excpt))
|
||||||
|
} > kseg1_ebexcpt
|
||||||
|
|
||||||
.bev_excpt :
|
.bev_excpt :
|
||||||
{
|
{
|
||||||
KEEP (*(.bev_excpt))
|
KEEP (*(.bev_excpt))
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ MEMORY
|
|||||||
|
|
||||||
kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384
|
kseg1_reset (rx) : ORIGIN = 0xbfc00000, LENGTH = 384
|
||||||
kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128
|
kseg1_genexcpt (rx) : ORIGIN = 0xbfc00180, LENGTH = 128
|
||||||
|
kseg1_ebexcpt (rx) : ORIGIN = 0xbfc00200, LENGTH = 128
|
||||||
|
kseg1_bevexcpt (rx) : ORIGIN = 0xbfc00380, LENGTH = 128
|
||||||
kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128
|
kseg1_intexcpt (rx) : ORIGIN = 0xbfc00400, LENGTH = 128
|
||||||
kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16
|
kseg1_dbgexcpt (rx) : ORIGIN = 0xbfc00480, LENGTH = 16
|
||||||
kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168
|
kseg0_bootmem (rx) : ORIGIN = 0x9fc00490, LENGTH = 8192-1168
|
||||||
@@ -124,6 +126,11 @@ SECTIONS
|
|||||||
KEEP (*(.gen_excpt))
|
KEEP (*(.gen_excpt))
|
||||||
} > kseg1_genexcpt
|
} > kseg1_genexcpt
|
||||||
|
|
||||||
|
.ebase_excpt :
|
||||||
|
{
|
||||||
|
KEEP (*(.ebase_excpt))
|
||||||
|
} > kseg1_ebexcpt
|
||||||
|
|
||||||
.bev_excpt :
|
.bev_excpt :
|
||||||
{
|
{
|
||||||
KEEP (*(.bev_excpt))
|
KEEP (*(.bev_excpt))
|
||||||
|
|||||||
Reference in New Issue
Block a user