Skip to contentSkip to conversation

MX51: mx51evk: Use struct to access SRSR register instead of offset

PATCH Superseded Fabio Estevam 3 participants 3 messages Apr 13, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MX51: mx51evk: Use struct to access SRSR register instead of offset

---
 board/freescale/mx51evk/mx51evk.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
board/freescale/mx51evk/mx51evk.c +5 -1
index 02a765d..3f2217c 100644
@@ -431,6 +431,10 @@ int board_late_init(void)
 
 int checkboard(void)
 {
+	u32 reset;
+	struct src *src_regs = (struct src *)SRC_BASE_ADDR;
+	reset = src_regs->srsr;
+
 	puts("Board: MX51EVK ");
 
 	switch (system_rev & 0xff) {
@@ -452,7 +456,7 @@ int checkboard(void)
 		break;
 	}
 
-	switch (__raw_readl(SRC_BASE_ADDR + 0x8)) {
+	switch (reset) {
 	case 0x0001:
 		puts("POR");
 		break;
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 MX51: mx51evk: Use struct to access SRSR register instead of offset

2011/4/13 Fabio Estevam <[email protected]>:

Quoted 10 lines

---
?board/freescale/mx51evk/mx51evk.c | ? ?6 +++++-
?1 files changed, 5 insertions(+), 1 deletions(-)

board/freescale/mx51evk/mx51evk.c +0 -0
index 02a765d..3f2217c 100644

board/freescale/mx51evk/mx51evk.c int board_late_init(void) · line 436

Quoted 6 lines
board/freescale/mx51evk/mx51evk.c +3 -0
@@ -431,6 +431,10 @@ int board_late_init(void)
 
 ?int checkboard(void)
 ?{
+ ? ? ? u32 reset;
+ ? ? ? struct src *src_regs = (struct src *)SRC_BASE_ADDR;
+ ? ? ? reset = src_regs->srsr;

Would better to use __raw_readl(&src_regs->srsr) here.

Quoted 21 lines
board/freescale/mx51evk/mx51evk.c +2 -1
+
 ? ? ? ?puts("Board: MX51EVK ");
 
 ? ? ? ?switch (system_rev & 0xff) {
@@ -452,7 +456,7 @@ int checkboard(void)
 ? ? ? ? ? ? ? ?break;
 ? ? ? ?}
 
- ? ? ? switch (__raw_readl(SRC_BASE_ADDR + 0x8)) {
+ ? ? ? switch (reset) {

? ? ? ?case 0x0001:
? ? ? ? ? ? ? ?puts("POR");
? ? ? ? ? ? ? ?break;
--
1.6.0.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#2 lore raw

PATCH 1/1 MX51: mx51evk: Use struct to access SRSR register instead of offset

In reply to Fabio Estevam

Hello.

Quoted 10 lines · Fabio Estevam
---
  board/freescale/mx51evk/mx51evk.c |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)
board/freescale/mx51evk/mx51evk.c +0 -0
index 02a765d..3f2217c 100644

board/freescale/mx51evk/mx51evk.c int board_late_init(void) · line 435

Quoted 5 lines
board/freescale/mx51evk/mx51evk.c +2 -0
@@ -431,6 +431,10 @@ int board_late_init(void)
 
  int checkboard(void)
  {
+	u32 reset;
+	struct src *src_regs = (struct src *)SRC_BASE_ADDR;

Should be an emoty line here\.

board/freescale/mx51evk/mx51evk.c int board_late_init(void) · line 436

Quoted 1 line
board/freescale/mx51evk/mx51evk.c +1 -0
+	reset = src_regs->srsr;

Why not declare this variable later than 'src_regs' and just initialize it?

WBR, Sergei