public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] MX51: mx51evk: Use struct to access SRSR register instead of offset
@ 2011-04-13  3:02 Fabio Estevam
  2011-04-13  3:08 ` Jason Liu
  2011-04-13 10:22 ` Sergei Shtylyov
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2011-04-13  3:02 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/freescale/mx51evk/mx51evk.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
index 02a765d..3f2217c 100644
--- a/board/freescale/mx51evk/mx51evk.c
+++ b/board/freescale/mx51evk/mx51evk.c
@@ -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;
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] MX51: mx51evk: Use struct to access SRSR register instead of offset
  2011-04-13  3:02 [U-Boot] [PATCH] MX51: mx51evk: Use struct to access SRSR register instead of offset Fabio Estevam
@ 2011-04-13  3:08 ` Jason Liu
  2011-04-13 10:22 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Liu @ 2011-04-13  3:08 UTC (permalink / raw)
  To: u-boot

2011/4/13 Fabio Estevam <festevam@gmail.com>:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> ?board/freescale/mx51evk/mx51evk.c | ? ?6 +++++-
> ?1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
> index 02a765d..3f2217c 100644
> --- a/board/freescale/mx51evk/mx51evk.c
> +++ b/board/freescale/mx51evk/mx51evk.c
> @@ -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.

> +
> ? ? ? ?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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] MX51: mx51evk: Use struct to access SRSR register instead of offset
  2011-04-13  3:02 [U-Boot] [PATCH] MX51: mx51evk: Use struct to access SRSR register instead of offset Fabio Estevam
  2011-04-13  3:08 ` Jason Liu
@ 2011-04-13 10:22 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2011-04-13 10:22 UTC (permalink / raw)
  To: u-boot

Hello.

On 13-04-2011 7:02, Fabio Estevam wrote:

> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
> ---
>   board/freescale/mx51evk/mx51evk.c |    6 +++++-
>   1 files changed, 5 insertions(+), 1 deletions(-)

> diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c
> index 02a765d..3f2217c 100644
> --- a/board/freescale/mx51evk/mx51evk.c
> +++ b/board/freescale/mx51evk/mx51evk.c
> @@ -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\.

> +	reset = src_regs->srsr;

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

WBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-13 10:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13  3:02 [U-Boot] [PATCH] MX51: mx51evk: Use struct to access SRSR register instead of offset Fabio Estevam
2011-04-13  3:08 ` Jason Liu
2011-04-13 10:22 ` Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox