Patchwork [U-Boot,08/12] da850: pass board revision info to kernel

login
register
mail settings
Submitter nagabhushana.netagunte@ti.com
Date Aug. 2, 2011, 3:43 p.m.
Message ID <1312299792-16415-9-git-send-email-nagabhushana.netagunte@ti.com>
Download mbox | patch
Permalink /patch/107951/
State Changes Requested
Headers show

Comments

nagabhushana.netagunte@ti.com - Aug. 2, 2011, 3:43 p.m.
From: Manjunathappa, Prakash <prakash.pm@ti.com>

The Spectrum Digital AM18xx EVM contains I2C EEPROM compared
da850/omap-l138 Logic PD EVMs. This information is used to differentiate
the EVMs and is passed to kernel via second byte of ATAG_REVISION.

Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Signed-off-by: Nagabhushana Netagunte <nagabhushana.netagunte@ti.com>
---
 board/davinci/da8xxevm/da850evm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Wolfgang Denk - Aug. 2, 2011, 4:27 p.m.
Dear nagabhushana.netagunte@ti.com,

In message <1312299792-16415-9-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> From: Manjunathappa, Prakash <prakash.pm@ti.com>
> 
> The Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> da850/omap-l138 Logic PD EVMs. ...

Sorry, I cannot parse this.  Please reformulate.

> +	/* Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> +	   da850/omap-l138 Logic PD EVMs. This information is used to
> +	   differentiate the EVMs and is passed to kernel via second
> +	   byte of ATAG_REVISION. */

Incorrect multiline comment style.

> +	if (i2c_probe(0x50) == 0)
> +		rev |= 0x100;

Would it not be better to provide #defines instead of these hardwired
magic numbers (both address and mask)?

Best regards,

Wolfgang Denk
nagabhushana.netagunte@ti.com - Aug. 9, 2011, 1:52 p.m.
Hi Denk,

Thanks for comments.

Agree with you. We need to find a better way to find about board revision than the current method which depends on presence of i2c EEPROM on the board.

I will drop this patch also from this series. I will device a better patch
And submit later.

Thanks,
Nag

On Tue, Aug 02, 2011 at 21:57:32, Wolfgang Denk wrote:
> Dear nagabhushana.netagunte@ti.com,
> 
> In message <1312299792-16415-9-git-send-email-nagabhushana.netagunte@ti.com> you wrote:
> > From: Manjunathappa, Prakash <prakash.pm@ti.com>
> > 
> > The Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> > da850/omap-l138 Logic PD EVMs. ...
> 
> Sorry, I cannot parse this.  Please reformulate.
> 
> > +	/* Spectrum Digital AM18xx EVM contains I2C EEPROM compared
> > +	   da850/omap-l138 Logic PD EVMs. This information is used to
> > +	   differentiate the EVMs and is passed to kernel via second
> > +	   byte of ATAG_REVISION. */
> 
> Incorrect multiline comment style.
> 
> > +	if (i2c_probe(0x50) == 0)
> > +		rev |= 0x100;
> 
> Would it not be better to provide #defines instead of these hardwired magic numbers (both address and mask)?
> 
> Best regards,
> 
> Wolfgang Denk
> 
> -- 
> 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@denx.de What the gods would destroy they first submit to  an  IEEE  standards committee.
>

Patch

diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 86c6777..eb9c915 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -217,6 +217,14 @@  u32 get_board_rev(void)
 	else if (maxcpuclk >= 372000000)
 		rev = 1;
 
+	/* Spectrum Digital AM18xx EVM contains I2C EEPROM compared
+	   da850/omap-l138 Logic PD EVMs. This information is used to
+	   differentiate the EVMs and is passed to kernel via second
+	   byte of ATAG_REVISION. */
+
+	if (i2c_probe(0x50) == 0)
+		rev |= 0x100;
+
 	return rev;
 }