Skip to contentSkip to conversation

cmd_bootm: fix compilation warning for assigned but never used variable

PATCH New Otavio Salvador 4 participants 33 messages Jun 23, 2012 – Jun 25, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 cmd_bootm: fix compilation warning for assigned but never used variable

The iflag variable was holding the return of disable_interrupts call but the value was not used in the method so we drop the assignment.

---
 common/cmd_bootm.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
common/cmd_bootm.c +1 -2
index 5685232..45e726a 100644
@@ -1587,7 +1587,6 @@ static int bootz_start(cmd_tbl_t *cmdtp, int flag, int argc,
 
 static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	ulong		iflag;
 	bootm_headers_t	images;
 
 	if (bootz_start(cmdtp, flag, argc, argv, &images))
@@ -1598,7 +1597,7 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	 * overwrite all exception vector code, so we cannot easily
 	 * recover from any failures any more...
 	 */
-	iflag = disable_interrupts();
+	disable_interrupts();
 
 #if defined(CONFIG_CMD_USB)
 	/*
Signature · 1 line
1.7.10
#1 lore raw

PATCH 2/4 mx53loco: add a comment about local copy of print_cpuinfo method

Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 board/freescale/mx53loco/mx53loco.c |    2 ++
 1 file changed, 2 insertions(+)
board/freescale/mx53loco/mx53loco.c +2 -0
index 445d022..9fae5e8 100644
@@ -413,6 +413,8 @@ int board_early_init_f(void)
 	return 0;
 }
 
+/* Needs to be available on the board file to be called in board_init,
+ * instead of normal order  */
 int print_cpuinfo(void)
 {
 	u32 cpurev;
Signature · 1 line
1.7.10
#2 lore raw

PATCH 2/4 mx53loco: add a comment about local copy of print_cpuinfo method

Ignore this; this has a new version sent to mailing list and this good in the middle.

Quoted 24 lines · Otavio Salvador
Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>

---
?board/freescale/mx53loco/mx53loco.c | ? ?2 ++
?1 file changed, 2 insertions(+)

board/freescale/mx53loco/mx53loco.c +2 -1
index 445d022..9fae5e8 100644
@@ -413,6 +413,8 @@ int board_early_init_f(void)
 ? ? ? ?return 0;
 ?}
 
+/* Needs to be available on the board file to be called in board_init,
+ * instead of normal order ?*/
 ?int print_cpuinfo(void)
 ?{
 ? ? ? ?u32 cpurev;
--

1.7.10

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#3 lore raw

PATCH 2/4 mx53loco: add a comment about local copy of print_cpuinfo method

In reply to Otavio Salvador

Dear Otavio Salvador,

Quoted 13 lines
Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 board/freescale/mx53loco/mx53loco.c |    2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/board/freescale/mx53loco/mx53loco.c index 445d022..9fae5e8 100644

board/freescale/mx53loco/mx53loco.c int board_early_init_f(void) · line 417

Quoted 5 lines
board/freescale/mx53loco/mx53loco.c +2 -0
@@ -413,6 +413,8 @@ int board_early_init_f(void)
 	return 0;
 }
 
+/* Needs to be available on the board file to be called in board_init,
+ * instead of normal order  */

Invalid multiline comment ;-)

board/freescale/mx53loco/mx53loco.c int board_early_init_f(void) · line 420

Quoted 3 lines
board/freescale/mx53loco/mx53loco.c +0 -0
 int print_cpuinfo(void)
 {
 	u32 cpurev;

Best regards,
Marek Vasut

#4 lore raw

PATCH 2/4 mx53loco: add a comment about local copy of print_cpuinfo method

In reply to Otavio Salvador

Dear Otavio Salvador,

Quoted 7 lines · In message <[email protected]> you…
Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 board/freescale/mx53loco/mx53loco.c |    2 ++
 1 file changed, 2 insertions(+)

Argh!!! Plese read
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

Please mark updated versions of a patch in the Subject:, and include a change log.

Quoted 2 lines

+/* Needs to be available on the board file to be called in board_init,
+ * instead of normal order */

This cmment makes no sense to me.

Also, this is incorrect multi-line comment style.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
First study the enemy.  Seek weakness.
	-- Romulan Commander, "Balance of Terror", stardate 1709.2
#5 lore raw

PATCH 2/4 mx53loco: add a comment about local copy of print_cpuinfo method

Quoted 2 lines · Wolfgang Denk

Please mark updated versions of a patch in the Subject:, and include a change log.

This was sent by mistake; the updated patch has been sent together. Sorry for the noise.

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#6 lore raw

PATCH 2/4 mx53loco: add a comment about local copy of print_cpuinfo method

Dear Otavio Salvador,

Quoted 6 lines · In message <CAP9ODKr7a4cfoxT3S_XZxYB22Y3nWYngJ+_pz52OzYv0pOYuxQ@mail.gmail.com>…
Quoted 2 lines · Wolfgang Denk

Please mark updated versions of a patch in the Subject:, and include a change log.

This was sent by mistake; the updated patch has been sent together. Sorry for the noise.

But the updated patch did not contaiy indication of an pdate either, nor any change log.

This is what I'm complaining about!

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Time is an illusion perpetrated by the manufacturers of space.
#7 lore raw

PATCH 2/4 mx53loco: add a comment about local copy of print_cpuinfo method

Quoted 4 lines · Wolfgang Denk

But the updated patch did not contaiy indication of an pdate either, nor any change log.

This is what I'm complaining about!

Stop complaining! I SAID SORRY... For the third time ... I sent it by mistake; read the another...

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#8 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

In reply to Otavio Salvador
Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 board/freescale/mx53loco/mx53loco.c |    5 +++++
 1 file changed, 5 insertions(+)
board/freescale/mx53loco/mx53loco.c +5 -0
index 445d022..5df1b18 100644
@@ -413,6 +413,11 @@ int board_early_init_f(void)
 	return 0;
 }
 
+/*
+ * Usually this is called too early printing a wrong information about
+ * the clock. To fix it we need to provide this local method and call
+ * it later in board_init.
+ */
 int print_cpuinfo(void)
 {
 	u32 cpurev;
Signature · 1 line
1.7.10
#9 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

Dear Otavio Salvador,

Quoted 13 lines · In message <[email protected]> you…
Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 board/freescale/mx53loco/mx53loco.c |    5 +++++
 1 file changed, 5 insertions(+)
board/freescale/mx53loco/mx53loco.c +0 -0
index 445d022..5df1b18 100644

board/freescale/mx53loco/mx53loco.c int board_early_init_f(void) · line 420

Quoted 8 lines
board/freescale/mx53loco/mx53loco.c +5 -0
@@ -413,6 +413,11 @@ int board_early_init_f(void)
 	return 0;
 }
 
+/*
+ * Usually this is called too early printing a wrong information about
+ * the clock. To fix it we need to provide this local method and call
+ * it later in board_init.
+ */

I don't like this change. It messes with the initialization sequence, which is not a good thing. Instead of shift more and more things backwards, we should fix any incorrect clock calculations here.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A star captain's most solemn oath is that he will give his life, even
his entire crew, rather than violate the Prime Directive.
	-- Kirk, "The Omega Glory", stardate unknown
#10 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

Quoted 10 lines · Wolfgang Denk
Quoted 5 lines

+/*
+ * Usually this is called too early printing a wrong information about
+ * the clock. To fix it we need to provide this local method and call
+ * it later in board_init.
+ */

I don't like this change. It messes with the initialization sequence, which is not a good thing. Instead of shift more and more things backwards, we should fix any incorrect clock calculations here.

Right however the clock calculation is right but in regular initialization sequence this information is printed too early so Fabio has moved it here to change this ordering.

I agree it is not the best solution but a comment here makes it clear why this has been done.

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#11 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

Quoted 10 lines · Otavio Salvador
Quoted 3 lines

I don't like this change. It messes with the initialization sequence, which is not a good thing. Instead of shift more and more things backwards, we should fix any incorrect clock calculations here.

Right however the clock calculation is right but in regular initialization sequence this information is printed too early so Fabio has moved it here to change this ordering.

I agree it is not the best solution but a comment here makes it clear why this has been done.

I don't think I was clear. I advocate the inclusion of this comment. I was temped to drop this method and Fabio explained why it was need. A day after, Ashok Kumar Reddy kourla (message id <[email protected]>) sent a patch to drop it too. So it is clear this needs a comment on code to avoid wasting people time trying to remove it.

I agree we can work in a way to remove this duplication but let's get this patch in and later we can clean it.

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#12 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

In reply to Otavio Salvador

Dear Otavio Salvador,

Quoted 4 lines · In message <CAP9ODKq7PUMpADOofz3uz3Rmg1B7SRK-goT07EW=ymJxJra=RA@mail.gmail.com>…

Right however the clock calculation is right but in regular initialization sequence this information is printed too early so Fabio has moved it here to change this ordering.

Who says it's "too early"? I claim it has been at the right place.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You have the capacity to learn from  mistakes.  You'll  learn  a  lot
today.
#13 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

Quoted 1 line · Wolfgang Denk

Who says it's "too early"? ?I claim it has been at the right place.

It needs I2C and when called in imx-common it doesn't have it enabled yet. Fabio, am I missing something?

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#14 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

Dear Otavio Salvador,

Quoted 5 lines · In message <CAP9ODKpkZKBjj8kJTwSAj-_ULzdpM-RfLo-oBQVU3QVmiAwsRg@mail.gmail.com>…
Quoted 1 line · Wolfgang Denk

Who says it's "too early"? =A0I claim it has been at the right place.

It needs I2C and when called in imx-common it doesn't have it enabled yet. Fabio, am I missing something?

This should be fixed, then. There are quite a number of systems that need I2C early - for example, sucht that store the envrionment in I2C attached EEPROM; thse need I2C to set the console baudrate, i. e. before printing the first character.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"What terrible way to die."
"There are no good ways."
	-- Sulu and Kirk, "That Which Survives", stardate unknown
reviewer
#15 lore raw

PATCH 2/4 mx53loco: Add a comment about local print_cpuinfo method in board file

Hi Wolfang,

Quoted 7 lines · Wolfgang Denk
Quoted 2 lines

It needs I2C and when called in imx-common it doesn't have it enabled yet. Fabio, am I missing something?

This should be fixed, then. ?There are quite a number of systems that need I2C early - for example, sucht that store the envrionment in I2C attached EEPROM; thse need I2C to set the console baudrate, i. e. before printing the first character.

Understood. I will work on fixing this.

Thanks,

Fabio Estevam

#16 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

In reply to Otavio Salvador

In case an unidentified CPU type is detected it now returns i.MX<unidentified>, in a const char.

Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/cpu/armv7/imx-common/cpu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/imx-common/cpu.c +2 -2
index b3195dd..77aac7d 100644
@@ -66,7 +66,7 @@ char *get_reset_cause(void)
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
 
-static char *get_imx_type(u32 imxtype)
+static const char *get_imx_type(u32 imxtype)
 {
 	switch (imxtype) {
 	case 0x63:
@@ -80,7 +80,7 @@ static char *get_imx_type(u32 imxtype)
 	case 0x53:
 		return "53";
 	default:
-		return "unknown";
+		return "<unidentified>";
 	}
 }
 
Signature · 1 line
1.7.10
#17 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Dear Otavio Salvador,

Quoted 2 lines · In message <[email protected]> you…

In case an unidentified CPU type is detected it now returns i.MX<unidentified>, in a const char.

...

arch/arm/cpu/armv7/imx-common/cpu.c char *get_reset_cause(void) · line 69

Quoted 2 lines
arch/arm/cpu/armv7/imx-common/cpu.c +1 -1
-static char *get_imx_type(u32 imxtype)
+static const char *get_imx_type(u32 imxtype)

I agree with the const change.

arch/arm/cpu/armv7/imx-common/cpu.c static char *get_imx_type(u32 imxtype) · line 83

Quoted 2 lines
arch/arm/cpu/armv7/imx-common/cpu.c +1 -1
-		return "unknown";
+		return "<unidentified>";

But in which way would "<unidentified>" be better than "unknown"? It just costs 7 more bytes of memory...

Please drop this change.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Success covers a multitude of blunders."       - George Bernard Shaw
#18 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Dear Wolfgang Denk,

Quoted 3 lines

Dear Otavio Salvador,

In message <[email protected]> you

Quoted 10 lines · wrote:
Quoted 2 lines

In case an unidentified CPU type is detected it now returns i.MX<unidentified>, in a const char.

...

arch/arm/cpu/armv7/imx-common/cpu.c char *get_reset_cause(void) · line 69

Quoted 2 lines
arch/arm/cpu/armv7/imx-common/cpu.c +1 -1
-static char *get_imx_type(u32 imxtype)
+static const char *get_imx_type(u32 imxtype)

I agree with the const change.

Quoted 5 lines

arch/arm/cpu/armv7/imx-common/cpu.c static char *get_imx_type(u32 imxtype) · line 83

Quoted 2 lines
arch/arm/cpu/armv7/imx-common/cpu.c +1 -1
-		return "unknown";
+		return "<unidentified>";

But in which way would "<unidentified>" be better than "unknown"? It just costs 7 more bytes of memory...

"i.MXunknown" is much more weird than "i.MX<unidentified>" . This is on my tap, Otavio is innocent with this one. btw. this would be static data, so adding 7 more bytes won't hurt anyone.

Quoted 5 lines

Please drop this change.

Best regards,

Wolfgang Denk

Best regards,
Marek Vasut

reviewer
#19 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Quoted 5 lines · Marek Vasut
Quoted 3 lines

But in which way would "<unidentified>" be better than "unknown"? ?It just costs 7 more bytes of memory...

"i.MXunknown" is much more weird than "i.MX<unidentified>" . This is on my tap,

I think both are equally weird. This message is so rare that I also agree that is not worth changing this string, as there is no real gain by doing so.

#20 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Dear Fabio Estevam,

Quoted 10 lines · Marek Vasut
Quoted 5 lines
Quoted 2 lines

But in which way would "<unidentified>" be better than "unknown"? It just costs 7 more bytes of memory...

"i.MXunknown" is much more weird than "i.MX<unidentified>" . This is on my tap,

I think both are equally weird. This message is so rare that I also agree that is not worth changing this string, as there is no real gain by doing so.

Ok, you got me by majority vote ;-)

Best regards,
Marek Vasut

#21 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 2 lines · In message <[email protected]> you wrote:

"i.MXunknown" is much more weird than "i.MX<unidentified>" . This is on my tap,

In which way is "unknown" different (or even more weird) than "unidentified"?

We could also print "i.MX???" to express whaty we are meaning. How about that?

Quoted 2 lines

Otavio is innocent with this one. btw. this would be static data, so adding 7 more bytes won't hurt anyone.

7 additional bytes of data that have no real use ar just 7 bytes wasted. I will routinely object when I see memory being wasted without benefit.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q: Why do PCs have a reset button on the front?
A: Because they are expected to run Microsoft operating systems.
#22 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Quoted 2 lines · Wolfgang Denk

We could also print "i.MX???" to express whaty we are meaning. ?How about that?

Will send a patch with that.

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#23 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Dear Otavio Salvador,

Quoted 5 lines · Wolfgang Denk
Quoted 2 lines

We could also print "i.MX???" to express whaty we are meaning. How about that?

Will send a patch with that.

What about i.MX<?> ?

Best regards,
Marek Vasut

#24 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Quoted 9 lines · Marek Vasut

Dear Otavio Salvador,

Quoted 5 lines · Wolfgang Denk
Quoted 2 lines

We could also print "i.MX???" to express whaty we are meaning. ?How about that?

Will send a patch with that.

What about i.MX<?> ?

I like it.

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#25 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

In reply to Marek Vasut

Dear Marek Vasut,

Quoted 9 lines · In message <[email protected]> you wrote:

Dear Otavio Salvador,

Quoted 5 lines · Wolfgang Denk
Quoted 2 lines

We could also print "i.MX???" to express whaty we are meaning. How about that?

Will send a patch with that.

What about i.MX<?> ?

Or i.MX{?} ? Or i.MX[?]? Or i.MX(?) ?

I really like these highly efficient bikeshed painting discussions.

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"There are three principal ways to lose money: wine, women, and engi-
neers. While the first two are more pleasant, the third is by far the
more certain."                           - Baron Rothschild, ca. 1800
#26 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

Quoted 9 lines · Wolfgang Denk

Dear Marek Vasut,

Quoted 6 lines · In message <[email protected]> you wrote:

Dear Otavio Salvador,

Quoted 4 lines · Wolfgang Denk
Quoted 2 lines

We could also print "i.MX???" to express whaty we are meaning. ?How about that?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Will send a patch with that.

What about i.MX<?> ?

Or i.MX{?} ? Or i.MX[?]? Or i.MX(?) ?

I really like these highly efficient bikeshed painting discussions.

I sent it using ??.

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br
#27 lore raw

PATCH 3/4 imx: Use a clear identification of an unidentified CPU type

In reply to Wolfgang Denk

Dear Wolfgang Denk,

Quoted 9 lines

Dear Marek Vasut,

Quoted 6 lines · In message <[email protected]> you wrote:

Dear Otavio Salvador,

Quoted 4 lines · Wolfgang Denk
Quoted 2 lines

We could also print "i.MX???" to express whaty we are meaning. How about that?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Will send a patch with that.

What about i.MX<?> ?

Or i.MX{?} ? Or i.MX[?]? Or i.MX(?) ?

I really like these highly efficient bikeshed painting discussions.

Well it's good as a distraction from hacking for a while, but I see you're getting annoyed.

Quoted 1 line

Wolfgang Denk

Best regards,
Marek Vasut

#28 lore raw

PATCH 4/4 mxs: generalize code for print_cpuinfo()

In reply to Otavio Salvador

The information now is gathered from HW_DIGCTL_CHIPID register and includes the revision of the chip on the output.

Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/mx28.c |   58 ++++++++++++++++++++++++++++++++++--
 1 file changed, 56 insertions(+), 2 deletions(-)
arch/arm/cpu/arm926ejs/mx28/mx28.c +56 -2
index a82ff25..15be605 100644
@@ -38,6 +38,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* Product code identification */
+#define CHIPID_MASK	(0xffff << 16)
+#define CHIPID_MX23	(0x3780 << 16)
+#define CHIPID_MX28	(0x2800 << 16)
+
 /* 1 second delay should be plenty of time for block reset. */
 #define	RESET_MAX_TIMEOUT	1000000
 
@@ -190,13 +195,62 @@ int arch_cpu_init(void)
 #endif
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
+static const char *get_cpu_type(void)
+{
+	struct mx28_digctl_regs *digctl_regs =
+		(struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
+
+	switch (readl(&digctl_regs->hw_digctl_chipid) & CHIPID_MASK) {
+	case CHIPID_MX28:
+		return "28";
+	case CHIPID_MX23:
+		return "23";
+	default:
+		return "<unknown>";
+	}
+}
+
+static const char *get_cpu_rev(void)
+{
+	struct mx28_digctl_regs *digctl_regs =
+		(struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
+	uint8_t rev = readl(&digctl_regs->hw_digctl_chipid) & 0x000000FF;
+
+	switch (readl(&digctl_regs->hw_digctl_chipid) & CHIPID_MASK) {
+	case CHIPID_MX28:
+		switch (rev) {
+		case 0x1:
+			return "TO1.2";
+		default:
+			return "<unknown>";
+		}
+	case CHIPID_MX23:
+		switch (rev) {
+		case 0x0:
+			return "TA1";
+		case 0x1:
+			return "TA2";
+		case 0x2:
+			return "TA3";
+		case 0x3:
+			return "TA4";
+		case 0x5:
+			return "TA5";
+		}
+	default:
+		return "<unknown>";
+	}
+}
+
 int print_cpuinfo(void)
 {
 	struct mx28_spl_data *data = (struct mx28_spl_data *)
 		((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf);
 
-	printf("Freescale i.MX28 family at %d MHz\n",
-			mxc_get_clock(MXC_ARM_CLK) / 1000000);
+	printf("CPU:   Freescale i.MX%s %s at %d MHz\n",
+		get_cpu_type(),
+		get_cpu_rev(),
+		mxc_get_clock(MXC_ARM_CLK) / 1000000);
 	printf("BOOT:  %s\n", mx28_boot_modes[data->boot_mode_idx].mode);
 	return 0;
 }
Signature · 1 line
1.7.10
#29 lore raw

PATCH 4/4 mxs: generalize code for print_cpuinfo()

Dear Otavio Salvador,

Quoted 17 lines

The information now is gathered from HW_DIGCTL_CHIPID register and includes the revision of the chip on the output.

Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/cpu/arm926ejs/mx28/mx28.c |   58

++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-)

(quoted diff) +0 -0

b/arch/arm/cpu/arm926ejs/mx28/mx28.c index a82ff25..15be605 100644

arch/arm/cpu/arm926ejs/mx28/mx28.c line 44

Quoted 7 lines
arch/arm/cpu/arm926ejs/mx28/mx28.c +4 -0
@@ -38,6 +38,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* Product code identification */
+#define CHIPID_MASK	(0xffff << 16)
+#define CHIPID_MX23	(0x3780 << 16)
+#define CHIPID_MX28	(0x2800 << 16)

Don't we have arch/arm/include/asm-mx28/regs-digctl.h ?

[...]

Rest seems ok

Best regards,
Marek Vasut

#30 lore raw

PATCH v2 4/4 mxs: generalize code for print_cpuinfo()

In reply to Otavio Salvador

The information now is gathered from HW_DIGCTL_CHIPID register and includes the revision of the chip on the output.

Cc Marek Vasut <[email protected]>
Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>

---
Changes since v1:
* Move mask and product code to regs-digctl.h

 arch/arm/cpu/arm926ejs/mx28/mx28.c           |   53 +++++++++++++++++++++++++-
 arch/arm/include/asm/arch-mx28/regs-digctl.h |    5 +++
 2 files changed, 56 insertions(+), 2 deletions(-)
arch/arm/cpu/arm926ejs/mx28/mx28.c +51 -2
index a82ff25..a6e5036 100644
@@ -190,13 +190,62 @@ int arch_cpu_init(void)
 #endif
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
+static const char *get_cpu_type(void)
+{
+	struct mx28_digctl_regs *digctl_regs =
+		(struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
+
+	switch (readl(&digctl_regs->hw_digctl_chipid) & HW_DIGCTL_CHIPID_MASK) {
+	case HW_DIGCTL_CHIPID_MX28:
+		return "28";
+	case HW_DIGCTL_CHIPID_MX23:
+		return "23";
+	default:
+		return "<unknown>";
+	}
+}
+
+static const char *get_cpu_rev(void)
+{
+	struct mx28_digctl_regs *digctl_regs =
+		(struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
+	uint8_t rev = readl(&digctl_regs->hw_digctl_chipid) & 0x000000FF;
+
+	switch (readl(&digctl_regs->hw_digctl_chipid) & HW_DIGCTL_CHIPID_MASK) {
+	case HW_DIGCTL_CHIPID_MX28:
+		switch (rev) {
+		case 0x1:
+			return "TO1.2";
+		default:
+			return "<unknown>";
+		}
+	case HW_DIGCTL_CHIPID_MX23:
+		switch (rev) {
+		case 0x0:
+			return "TA1";
+		case 0x1:
+			return "TA2";
+		case 0x2:
+			return "TA3";
+		case 0x3:
+			return "TA4";
+		case 0x5:
+			return "TA5";
+		}
+	default:
+		return "<unknown>";
+	}
+}
+
 int print_cpuinfo(void)
 {
 	struct mx28_spl_data *data = (struct mx28_spl_data *)
 		((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf);
 
-	printf("Freescale i.MX28 family at %d MHz\n",
-			mxc_get_clock(MXC_ARM_CLK) / 1000000);
+	printf("CPU:   Freescale i.MX%s %s at %d MHz\n",
+		get_cpu_type(),
+		get_cpu_rev(),
+		mxc_get_clock(MXC_ARM_CLK) / 1000000);
 	printf("BOOT:  %s\n", mx28_boot_modes[data->boot_mode_idx].mode);
 	return 0;
 }
arch/arm/include/asm/arch-mx28/regs-digctl.h +5 -0
index 9a63594..67f91e7 100644
@@ -152,4 +152,9 @@ struct mx28_digctl_regs {
 };
 #endif
 
+/* Product code identification */
+#define HW_DIGCTL_CHIPID_MASK	(0xffff << 16)
+#define HW_DIGCTL_CHIPID_MX23	(0x3780 << 16)
+#define HW_DIGCTL_CHIPID_MX28	(0x2800 << 16)
+
 #endif /* __MX28_REGS_DIGCTL_H__ */
Signature · 1 line
1.7.10
#31 lore raw

PATCH 1/4 cmd_bootm: fix compilation warning for assigned but never used variable

In reply to Otavio Salvador

Dear Otavio Salvador,

Quoted 7 lines · In message <[email protected]> you…

The iflag variable was holding the return of disable_interrupts call but the value was not used in the method so we drop the assignment.

---
 common/cmd_bootm.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Please rebase and update your patches; this specific problem for example has been fixed long ago:

commit a075a79f98cc3f5972a2ed80551c0873217aef7d

Author: Anatolij Gustschin <[email protected]>
Date:   Sat May 19 05:38:19 2012 +0000

common/cmd_bootm.c: Fix GCC 4.6 warning

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The more data I punch in this card,  the lighter it becomes, and the
lower the mailing cost."
                     - Stan Kelly-Bootle, "The Devil's DP Dictionary"
#32 lore raw

PATCH 1/4 cmd_bootm: fix compilation warning for assigned but never used variable

Quoted 8 lines · Wolfgang Denk

Please rebase and update your patches; this specific problem for example has been fixed long ago:

commit a075a79f98cc3f5972a2ed80551c0873217aef7d
Author: Anatolij Gustschin <[email protected]>
Date: ? Sat May 19 05:38:19 2012 +0000

? ?common/cmd_bootm.c: Fix GCC 4.6 warning

Ouch! I am basing my work on u-boot-imx; I think the imx tree needs to be rebased so we can have a good base of work.

Signature · 3 lines
Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems
E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br
Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br