This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
reset cause bits for pxa
- From: jani at iv dot ro
- To: ecos-patches at sources dot redhat dot com
- Date: Fri, 5 Sep 2003 12:16:05 +0300
- Subject: reset cause bits for pxa
Along with the noisy tabbing changes below there's the definition of the bits in the
Reset Controller Status Register which can be used to determine what caused the reset.
For instance redboot needs to see if it was sleep reset so it can correctly return to
a suspended linux kernel just like in the SA1100. That code needs to go in hal startup
code and is beyond the scope of this patch :)
Jani
Index: hal/arm/xscale/pxa2x0/current//ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/pxa2x0/current/ChangeLog,v
retrieving revision 1.5
diff -d -u -r1.5 ChangeLog
--- hal/arm/xscale/pxa2x0/current//ChangeLog 8 Aug 2003 19:29:11 -0000 1.5
+++ hal/arm/xscale/pxa2x0/current//ChangeLog 5 Sep 2003 09:07:38 -0000
@@ -1,3 +1,8 @@
+2003-09-05 Jani Monoses <jani@iv.ro>
+
+ * include/hal_pxa2x0.h: Add RCSR bit definitions which encode
+ the cause of reset. Make use of whitespace more consistent.
+
2003-08-08 Gary Thomas <gary@mind.be>
* src/pxa2x0_misc.c:
Index: hal/arm/xscale/pxa2x0/current//include/hal_pxa2x0.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/xscale/pxa2x0/current/include/hal_pxa2x0.h,v
retrieving revision 1.2
diff -d -u -r1.2 hal_pxa2x0.h
--- hal/arm/xscale/pxa2x0/current//include/hal_pxa2x0.h 8 Aug 2003 19:29:11 -0000 1.2
+++ hal/arm/xscale/pxa2x0/current//include/hal_pxa2x0.h 5 Sep 2003 09:07:40 -0000
@@ -101,7 +101,7 @@
#define PXA2X0_DCSR13 PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x0034 )
#define PXA2X0_DCSR14 PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x0038 )
#define PXA2X0_DCSR15 PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x003c )
-#define PXA2X0_DINT PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x00f0 )
+#define PXA2X0_DINT PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x00f0 )
#define PXA2X0_DRCMR0 PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x0100 )
#define PXA2X0_DRCMR1 PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x0104 )
#define PXA2X0_DRCMR2 PXA2X0_REGISTER( PXA2X0_DMA_CTL_BASE+0x0108 )
@@ -241,11 +241,11 @@
// I2C
#define PXA2X0_I2C_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0300000 )
-#define PXA2X0_IBMR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1680 )
-#define PXA2X0_IDBR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1688 )
-#define PXA2X0_ICR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1690 )
-#define PXA2X0_ISR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1698 )
-#define PXA2X0_ISAR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x16a0 )
+#define PXA2X0_IBMR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1680 )
+#define PXA2X0_IDBR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1688 )
+#define PXA2X0_ICR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1690 )
+#define PXA2X0_ISR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x1698 )
+#define PXA2X0_ISAR PXA2X0_REGISTER( PXA2X0_I2C_BASE+0x16a0 )
// I2S
@@ -256,30 +256,30 @@
#define PXA2X0_SAIMR PXA2X0_REGISTER( PXA2X0_I2S_BASE+0x0014 )
#define PXA2X0_SAICR PXA2X0_REGISTER( PXA2X0_I2S_BASE+0x0018 )
#define PXA2X0_SADIV PXA2X0_REGISTER( PXA2X0_I2S_BASE+0x0060 )
-#define PXA2X0_SADR PXA2X0_REGISTER( PXA2X0_I2S_BASE+0x0080 )
+#define PXA2X0_SADR PXA2X0_REGISTER( PXA2X0_I2S_BASE+0x0080 )
// AC97
#define PXA2X0_AC97_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0500000 )
-#define PXA2X0_POCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0000 )
-#define PXA2X0_PICR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0004 )
-#define PXA2X0_MCCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0008 )
-#define PXA2X0_GCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x000c )
-#define PXA2X0_POSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0010 )
-#define PXA2X0_PISR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0014 )
-#define PXA2X0_MCSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0018 )
-#define PXA2X0_GSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x001c )
-#define PXA2X0_CAR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0020 )
-#define PXA2X0_PCDR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0040 )
-#define PXA2X0_MCDR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0060 )
-#define PXA2X0_MOCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0100 )
-#define PXA2X0_MICR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0108 )
-#define PXA2X0_MOSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0110 )
-#define PXA2X0_MISR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0118 )
-#define PXA2X0_MODR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0140 )
-#define PXA2X0_AC97_PRIM_AUDIO_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0200 )
-#define PXA2X0_AC97_SEC_AUDIO_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0300 )
-#define PXA2X0_AC97_PRIM_MODEM_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0400 )
-#define PXA2X0_AC97_SEC_MODEM_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0500 )
+#define PXA2X0_POCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0000 )
+#define PXA2X0_PICR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0004 )
+#define PXA2X0_MCCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0008 )
+#define PXA2X0_GCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x000c )
+#define PXA2X0_POSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0010 )
+#define PXA2X0_PISR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0014 )
+#define PXA2X0_MCSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0018 )
+#define PXA2X0_GSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x001c )
+#define PXA2X0_CAR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0020 )
+#define PXA2X0_PCDR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0040 )
+#define PXA2X0_MCDR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0060 )
+#define PXA2X0_MOCR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0100 )
+#define PXA2X0_MICR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0108 )
+#define PXA2X0_MOSR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0110 )
+#define PXA2X0_MISR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0118 )
+#define PXA2X0_MODR PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0140 )
+#define PXA2X0_AC97_PRIM_AUDIO_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0200 )
+#define PXA2X0_AC97_SEC_AUDIO_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0300 )
+#define PXA2X0_AC97_PRIM_MODEM_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0400 )
+#define PXA2X0_AC97_SEC_MODEM_BASE PXA2X0_REGISTER( PXA2X0_AC97_BASE+0x0500 )
// UDC
#define PXA2X0_UDC_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0600000 )
@@ -350,16 +350,16 @@
#define PXA2X0_ICCR0 PXA2X0_REGISTER( PXA2X0_ICP_BASE+0x0000 )
#define PXA2X0_ICCR1 PXA2X0_REGISTER( PXA2X0_ICP_BASE+0x0004 )
#define PXA2X0_ICCR2 PXA2X0_REGISTER( PXA2X0_ICP_BASE+0x0008 )
-#define PXA2X0_ICDR PXA2X0_REGISTER( PXA2X0_ICP_BASE+0x000c )
+#define PXA2X0_ICDR PXA2X0_REGISTER( PXA2X0_ICP_BASE+0x000c )
#define PXA2X0_ICSR0 PXA2X0_REGISTER( PXA2X0_ICP_BASE+0x0014 )
#define PXA2X0_ICSR1 PXA2X0_REGISTER( PXA2X0_ICP_BASE+0x0018 )
// RTC
#define PXA2X0_RTC_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0900000 )
-#define PXA2X0_RCNR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x0000 )
-#define PXA2X0_RTAR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x0004 )
-#define PXA2X0_RTSR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x0008 )
-#define PXA2X0_RTTR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x000c )
+#define PXA2X0_RCNR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x0000 )
+#define PXA2X0_RTAR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x0004 )
+#define PXA2X0_RTSR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x0008 )
+#define PXA2X0_RTTR PXA2X0_REGISTER( PXA2X0_RTC_BASE+0x000c )
// OS Timer
#define PXA2X0_OSTIMER_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0a00000 )
@@ -367,10 +367,10 @@
#define PXA2X0_OSMR1 PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0004 )
#define PXA2X0_OSMR2 PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0008 )
#define PXA2X0_OSMR3 PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x000c )
-#define PXA2X0_OSCR PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0010 )
-#define PXA2X0_OSSR PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0014 )
-#define PXA2X0_OWER PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0018 )
-#define PXA2X0_OIER PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x001c )
+#define PXA2X0_OSCR PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0010 )
+#define PXA2X0_OSSR PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0014 )
+#define PXA2X0_OWER PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x0018 )
+#define PXA2X0_OIER PXA2X0_REGISTER( PXA2X0_OSTIMER_BASE+0x001c )
#define PXA2X0_OSSR_TIMER0 (0x1 << 0)
#define PXA2X0_OSSR_TIMER1 (0x1 << 1)
@@ -398,12 +398,12 @@
// Interrupt Control
#define PXA2X0_IC_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0d00000 )
-#define PXA2X0_ICIP PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0000 )
-#define PXA2X0_ICMR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0004 )
-#define PXA2X0_ICLR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0008 )
-#define PXA2X0_ICFP PXA2X0_REGISTER( PXA2X0_IC_BASE+0x000c )
-#define PXA2X0_ICPR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0010 )
-#define PXA2X0_ICCR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0014 )
+#define PXA2X0_ICIP PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0000 )
+#define PXA2X0_ICMR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0004 )
+#define PXA2X0_ICLR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0008 )
+#define PXA2X0_ICFP PXA2X0_REGISTER( PXA2X0_IC_BASE+0x000c )
+#define PXA2X0_ICPR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0010 )
+#define PXA2X0_ICCR PXA2X0_REGISTER( PXA2X0_IC_BASE+0x0014 )
// GPIO
#define PXA2X0_GPIO_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0e00000 )
@@ -445,26 +445,31 @@
// Power Manager and Reset Control
#define PXA2X0_PM_BASE ( PXA2X0_PERIPHERALS_BASE + 0x0f00000 )
-#define PXA2X0_PMCR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0000 )
-#define PXA2X0_PSSR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0004 )
-#define PXA2X0_PSPR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0008 )
-#define PXA2X0_PWER PXA2X0_REGISTER( PXA2X0_PM_BASE+0x000c )
-#define PXA2X0_PRER PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0010 )
-#define PXA2X0_PFER PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0014 )
-#define PXA2X0_PEDR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0018 )
-#define PXA2X0_PCFR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x001c )
+#define PXA2X0_PMCR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0000 )
+#define PXA2X0_PSSR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0004 )
+#define PXA2X0_PSPR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0008 )
+#define PXA2X0_PWER PXA2X0_REGISTER( PXA2X0_PM_BASE+0x000c )
+#define PXA2X0_PRER PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0010 )
+#define PXA2X0_PFER PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0014 )
+#define PXA2X0_PEDR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0018 )
+#define PXA2X0_PCFR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x001c )
#define PXA2X0_PGSR0 PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0020 )
#define PXA2X0_PGSR1 PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0024 )
#define PXA2X0_PGSR2 PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0028 )
-#define PXA2X0_RCSR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0030 )
+#define PXA2X0_RCSR PXA2X0_REGISTER( PXA2X0_PM_BASE+0x0030 )
+
+#define PXA2X0_RCSR_HWR (1<<0)
+#define PXA2X0_RCSR_WDR (1<<1)
+#define PXA2X0_RCSR_SMR (1<<2)
+#define PXA2X0_RCSR_GPR (1<<3)
// SSP
#define PXA2X0_SSP_BASE ( PXA2X0_PERIPHERALS_BASE + 0x1000000 )
#define PXA2X0_SSCR0 PXA2X0_REGISTER( PXA2X0_SSP_BASE+0x0000 )
#define PXA2X0_SSCR1 PXA2X0_REGISTER( PXA2X0_SSP_BASE+0x0004 )
-#define PXA2X0_SSSR PXA2X0_REGISTER( PXA2X0_SSP_BASE+0x0008 )
+#define PXA2X0_SSSR PXA2X0_REGISTER( PXA2X0_SSP_BASE+0x0008 )
#define PXA2X0_SSITR PXA2X0_REGISTER( PXA2X0_SSP_BASE+0x000c )
-#define PXA2X0_SSDR PXA2X0_REGISTER( PXA2X0_SSP_BASE+0x0010 )
+#define PXA2X0_SSDR PXA2X0_REGISTER( PXA2X0_SSP_BASE+0x0010 )
// MMC Controller
#define PXA2X0_MMC_BASE ( PXA2X0_PERIPHERALS_BASE + 0x1100000 )
@@ -489,9 +494,9 @@
// Clocks Manager
#define PXA2X0_CLK_BASE ( PXA2X0_PERIPHERALS_BASE + 0x1300000 )
-#define PXA2X0_CCCR PXA2X0_REGISTER( PXA2X0_CLK_BASE+0x0000 )
-#define PXA2X0_CKEN PXA2X0_REGISTER( PXA2X0_CLK_BASE+0x0004 )
-#define PXA2X0_CSCC PXA2X0_REGISTER( PXA2X0_CLK_BASE+0x0008 )
+#define PXA2X0_CCCR PXA2X0_REGISTER( PXA2X0_CLK_BASE+0x0000 )
+#define PXA2X0_CKEN PXA2X0_REGISTER( PXA2X0_CLK_BASE+0x0004 )
+#define PXA2X0_CSCC PXA2X0_REGISTER( PXA2X0_CLK_BASE+0x0008 )
// Memory Clock
#define PXA2X0_CCCR_L09 (0x1f)
#define PXA2X0_CCCR_L27 (0x01)
@@ -524,20 +529,20 @@
#define PXA2X0_FSADR1 PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0214 )
#define PXA2X0_FIDR1 PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0218 )
#define PXA2X0_LDCMD1 PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x021c )
-#define PXA2X0_FBR0 PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0020 )
-#define PXA2X0_FBR1 PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0024 )
-#define PXA2X0_LCSR PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0038 )
+#define PXA2X0_FBR0 PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0020 )
+#define PXA2X0_FBR1 PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0024 )
+#define PXA2X0_LCSR PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0038 )
#define PXA2X0_LIIDR PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x003c )
#define PXA2X0_TRGBR PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0040 )
-#define PXA2X0_TCR PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0044 )
+#define PXA2X0_TCR PXA2X0_REGISTER( PXA2X0_LCD_BASE+0x0044 )
// Memory Controller
#define PXA2X0_MDCNFG PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0000 )
#define PXA2X0_MDREFR PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0004 )
-#define PXA2X0_MSC0 PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0008 )
-#define PXA2X0_MSC1 PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x000c )
-#define PXA2X0_MSC2 PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0010 )
-#define PXA2X0_MECR PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0014 )
+#define PXA2X0_MSC0 PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0008 )
+#define PXA2X0_MSC1 PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x000c )
+#define PXA2X0_MSC2 PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0010 )
+#define PXA2X0_MECR PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0014 )
#define PXA2X0_SXCNFG PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x001c )
#define PXA2X0_SXMRS PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0024 )
#define PXA2X0_MCMEM0 PXA2X0_REGISTER( PXA2X0_MEMORY_CTL_BASE+0x0028 )