All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
@ 2013-08-30 10:07 Shengzhou Liu
  2013-08-30 13:56 ` Timur Tabi
  0 siblings, 1 reply; 4+ messages in thread
From: Shengzhou Liu @ 2013-08-30 10:07 UTC (permalink / raw)
  To: u-boot

Some boards use System EEPROM with 128-bytes instead of 256-bytes.
Since we regard 256-bytes EEPROM as standard EEPROM with default
value for MAX_NUM_PORTS. For those non-256-bytes EEPROM, we can
redefine MAX_NUM_PORTS in board-specific file to override the
default MAX_NUM_PORTS.

This patch doesn't impact on previous existing boards.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 board/freescale/common/sys_eeprom.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index d2ed036..1b69315 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -34,7 +34,11 @@
 #endif
 
 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
+/* some boards with non-256-bytes EEPROM have special define */
+/* for MAX_NUM_PORTS in board-specific file */
+#ifndef MAX_NUM_PORTS
 #define MAX_NUM_PORTS	23
+#endif
 #define NXID_VERSION	1
 #endif
 
-- 
1.8.0

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

* [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
  2013-08-30 10:07 [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM Shengzhou Liu
@ 2013-08-30 13:56 ` Timur Tabi
  2013-09-03 17:29   ` York Sun
  0 siblings, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2013-08-30 13:56 UTC (permalink / raw)
  To: u-boot

On Fri, Aug 30, 2013 at 5:07 AM, Shengzhou Liu
<Shengzhou.Liu@freescale.com> wrote:

>  #ifdef CONFIG_SYS_I2C_EEPROM_NXID
> +/* some boards with non-256-bytes EEPROM have special define */
> +/* for MAX_NUM_PORTS in board-specific file */
> +#ifndef MAX_NUM_PORTS
>  #define MAX_NUM_PORTS  23
> +#endif
>  #define NXID_VERSION   1
>  #endif

I'll have to think about this.  On one hand, this works.  As long as
the board-specific value of MAX_NUM_PORTS is valid, then it will work.

On the other hand, it's fragile and violates the specification.  An
NXID v1 EEPROM has the CRC at offset 0xFC.  I'm just not sure it
really matters.

York, I'm okay with this patch if you are.  You're the one maintaining
this code now.  Is there anyone left at Freescale who cares about the
integrity of the EEPROM specification?

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

* [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
  2013-08-30 13:56 ` Timur Tabi
@ 2013-09-03 17:29   ` York Sun
  2013-09-04  2:37     ` Liu Shengzhou-B36685
  0 siblings, 1 reply; 4+ messages in thread
From: York Sun @ 2013-09-03 17:29 UTC (permalink / raw)
  To: u-boot

On 08/30/2013 06:56 AM, Timur Tabi wrote:
> On Fri, Aug 30, 2013 at 5:07 AM, Shengzhou Liu
> <Shengzhou.Liu@freescale.com> wrote:
> 
>>  #ifdef CONFIG_SYS_I2C_EEPROM_NXID
>> +/* some boards with non-256-bytes EEPROM have special define */
>> +/* for MAX_NUM_PORTS in board-specific file */
>> +#ifndef MAX_NUM_PORTS
>>  #define MAX_NUM_PORTS  23
>> +#endif
>>  #define NXID_VERSION   1
>>  #endif
> 
> I'll have to think about this.  On one hand, this works.  As long as
> the board-specific value of MAX_NUM_PORTS is valid, then it will work.
> 
> On the other hand, it's fragile and violates the specification.  An
> NXID v1 EEPROM has the CRC at offset 0xFC.  I'm just not sure it
> really matters.

We need to verify the CRC is still valid.

> 
> York, I'm okay with this patch if you are.  You're the one maintaining
> this code now.  Is there anyone left at Freescale who cares about the
> integrity of the EEPROM specification?

Some many boards pop up from different design groups. Unfortunately not
all came to us to review. It is often too late when we find the design
is different.

York

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

* [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
  2013-09-03 17:29   ` York Sun
@ 2013-09-04  2:37     ` Liu Shengzhou-B36685
  0 siblings, 0 replies; 4+ messages in thread
From: Liu Shengzhou-B36685 @ 2013-09-04  2:37 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: sun york-R58495
> Sent: Wednesday, September 04, 2013 1:29 AM
> To: Timur Tabi
> Cc: Liu Shengzhou-B36685; U-Boot Mailing List
> Subject: Re: [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to adapt non-
> 256-bytes EEPROM
> 
> On 08/30/2013 06:56 AM, Timur Tabi wrote:
> > On Fri, Aug 30, 2013 at 5:07 AM, Shengzhou Liu
> > <Shengzhou.Liu@freescale.com> wrote:
> >
> >>  #ifdef CONFIG_SYS_I2C_EEPROM_NXID
> >> +/* some boards with non-256-bytes EEPROM have special define */
> >> +/* for MAX_NUM_PORTS in board-specific file */ #ifndef MAX_NUM_PORTS
> >>  #define MAX_NUM_PORTS  23
> >> +#endif
> >>  #define NXID_VERSION   1
> >>  #endif
> >
> > I'll have to think about this.  On one hand, this works.  As long as
> > the board-specific value of MAX_NUM_PORTS is valid, then it will work.
> >
> > On the other hand, it's fragile and violates the specification.  An
> > NXID v1 EEPROM has the CRC at offset 0xFC.  I'm just not sure it
> > really matters.
> 
> We need to verify the CRC is still valid.

It had been verified on P1010RDB-PB with 128 Bytes, The CRC is still
at the end of EEPROM and is still valid.

-Shengzhou

> >
> > York, I'm okay with this patch if you are.  You're the one maintaining
> > this code now.  Is there anyone left at Freescale who cares about the
> > integrity of the EEPROM specification?
> 
> Some many boards pop up from different design groups. Unfortunately not all came
> to us to review. It is often too late when we find the design is different.
> 
> York

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

end of thread, other threads:[~2013-09-04  2:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30 10:07 [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM Shengzhou Liu
2013-08-30 13:56 ` Timur Tabi
2013-09-03 17:29   ` York Sun
2013-09-04  2:37     ` Liu Shengzhou-B36685

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.