Re: [PATCH 05/13] siemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace

2021-08-18 Thread Tom Rini
On Wed, Aug 18, 2021 at 11:02:28AM +0200, Anatolij Gustschin wrote:
> On Tue, 17 Aug 2021 17:59:40 -0400
> Tom Rini tr...@konsulko.com wrote:
> 
> > The instances of CONFIG_SYS_I2C_EEPROM_ADDR on these platforms doesn't
> > match up with the rest of the EERPOM related defines in U-Boot.  Move
> > these out of the CONFIG namespace rather than make complex Kconfig
> > logic.
> > 
> > Cc: Samuel Egli 
> > Cc: Anatolij Gustschin 
> > Cc: Heiko Schocher 
> > Signed-off-by: Tom Rini 
> 
> Reviewed-by: Anatolij Gustschin 
> 
> But probably some more cleanup in other board config headers needed,
> see comment below.
> 
> ...
> > diff --git a/include/configs/draco.h b/include/configs/draco.h
> > index 396eb7ded500..7c1f071d99ec 100644
> > --- a/include/configs/draco.h
> > +++ b/include/configs/draco.h
> > @@ -32,10 +32,6 @@
> >  /* I2C Configuration */
> >  #define CONFIG_SYS_I2C_SPEED   10
> >  
> > -#define CONFIG_SYS_I2C_EEPROM_ADDR  0x50
> > -#define EEPROM_ADDR_DDR3 0x90
> > -#define EEPROM_ADDR_CHIP 0x120
> 
> these defines are also in
> 
>  include/configs/etamin.h
>  include/configs/rastaban.h
>  include/configs/thuban.h

Yes, it would be good for the board maintainers to follow up with more
clean-up and migrate some siemens-specific symbols to Kconfig.  I'm
trying to not get too far off track and focus on just getting symbols in
to Kconfig or out of CONFIG namespace right now.  Thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 05/13] siemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace

2021-08-18 Thread Anatolij Gustschin
On Tue, 17 Aug 2021 17:59:40 -0400
Tom Rini tr...@konsulko.com wrote:

> The instances of CONFIG_SYS_I2C_EEPROM_ADDR on these platforms doesn't
> match up with the rest of the EERPOM related defines in U-Boot.  Move
> these out of the CONFIG namespace rather than make complex Kconfig
> logic.
> 
> Cc: Samuel Egli 
> Cc: Anatolij Gustschin 
> Cc: Heiko Schocher 
> Signed-off-by: Tom Rini 

Reviewed-by: Anatolij Gustschin 

But probably some more cleanup in other board config headers needed,
see comment below.

...
> diff --git a/include/configs/draco.h b/include/configs/draco.h
> index 396eb7ded500..7c1f071d99ec 100644
> --- a/include/configs/draco.h
> +++ b/include/configs/draco.h
> @@ -32,10 +32,6 @@
>  /* I2C Configuration */
>  #define CONFIG_SYS_I2C_SPEED 10
>  
> -#define CONFIG_SYS_I2C_EEPROM_ADDR  0x50
> -#define EEPROM_ADDR_DDR3 0x90
> -#define EEPROM_ADDR_CHIP 0x120

these defines are also in

 include/configs/etamin.h
 include/configs/rastaban.h
 include/configs/thuban.h

--
Anatolij


Re: [PATCH 05/13] siemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace

2021-08-17 Thread Heiko Schocher
Hello Tom,

On 17.08.21 23:59, Tom Rini wrote:
> The instances of CONFIG_SYS_I2C_EEPROM_ADDR on these platforms doesn't
> match up with the rest of the EERPOM related defines in U-Boot.  Move
> these out of the CONFIG namespace rather than make complex Kconfig
> logic.
> 
> Cc: Samuel Egli 
> Cc: Anatolij Gustschin 
> Cc: Heiko Schocher 
> Signed-off-by: Tom Rini 
> ---
>  board/siemens/common/board.c |  3 ++-
>  board/siemens/draco/board.c  | 12 
>  include/configs/draco.h  |  4 
>  3 files changed, 10 insertions(+), 9 deletions(-)

Reviewed-by: Heiko Schocher 

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de


[PATCH 05/13] siemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace

2021-08-17 Thread Tom Rini
The instances of CONFIG_SYS_I2C_EEPROM_ADDR on these platforms doesn't
match up with the rest of the EERPOM related defines in U-Boot.  Move
these out of the CONFIG namespace rather than make complex Kconfig
logic.

Cc: Samuel Egli 
Cc: Anatolij Gustschin 
Cc: Heiko Schocher 
Signed-off-by: Tom Rini 
---
 board/siemens/common/board.c |  3 ++-
 board/siemens/draco/board.c  | 12 
 include/configs/draco.h  |  4 
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c
index 1bdf404ac3eb..56283660d377 100644
--- a/board/siemens/common/board.c
+++ b/board/siemens/common/board.c
@@ -70,6 +70,7 @@ void sdram_init(void)
 #endif /* #ifdef CONFIG_SPL_BUILD */
 
 #ifndef CONFIG_SPL_BUILD
+#define FACTORYSET_EEPROM_ADDR 0x50
 /*
  * Basic board specific setup.  Pinmux has been handled already.
  */
@@ -87,7 +88,7 @@ int board_init(void)
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
 #ifdef CONFIG_FACTORYSET
-   factoryset_read_eeprom(CONFIG_SYS_I2C_EEPROM_ADDR);
+   factoryset_read_eeprom(FACTORYSET_EEPROM_ADDR);
 #endif
 
gpmc_init();
diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c
index af35bc188e31..f898bba4b0ee 100644
--- a/board/siemens/draco/board.c
+++ b/board/siemens/draco/board.c
@@ -132,12 +132,16 @@ struct am335x_nand_geometry {
u8 nand_bus;
 };
 
+#define EEPROM_ADDR0x50
+#define EEPROM_ADDR_DDR3   0x90
+#define EEPROM_ADDR_CHIP   0x120
+
 static int draco_read_nand_geometry(void)
 {
struct am335x_nand_geometry geo;
 
/* Read NAND geometry */
-   if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x80, 2,
+   if (i2c_read(EEPROM_ADDR, 0x80, 2,
 (uchar *), sizeof(struct am335x_nand_geometry))) {
printf("Could not read the NAND geomtery; something 
fundamentally wrong on the I2C bus.\n");
return -EIO;
@@ -160,20 +164,20 @@ static int draco_read_nand_geometry(void)
 static int read_eeprom(void)
 {
/* Check if baseboard eeprom is available */
-   if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) {
+   if (i2c_probe(EEPROM_ADDR)) {
printf("Could not probe the EEPROM; something fundamentally 
wrong on the I2C bus.\n");
return 1;
}
 
 #ifdef CONFIG_SPL_BUILD
/* Read Siemens eeprom data (DDR3) */
-   if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_DDR3, 2,
+   if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_DDR3, 2,
 (uchar *), sizeof(struct ddr3_data))) {
printf("Could not read the EEPROM; something fundamentally 
wrong on the I2C bus.\nUse default DDR3 timings\n");
set_default_ddr3_timings();
}
/* Read Siemens eeprom data (CHIP) */
-   if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_CHIP, 2,
+   if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_CHIP, 2,
 (uchar *), sizeof(settings.chip)))
printf("Could not read chip settings\n");
 
diff --git a/include/configs/draco.h b/include/configs/draco.h
index 396eb7ded500..7c1f071d99ec 100644
--- a/include/configs/draco.h
+++ b/include/configs/draco.h
@@ -32,10 +32,6 @@
 /* I2C Configuration */
 #define CONFIG_SYS_I2C_SPEED   10
 
-#define CONFIG_SYS_I2C_EEPROM_ADDR  0x50
-#define EEPROM_ADDR_DDR3 0x90
-#define EEPROM_ADDR_CHIP 0x120
-
 #define CONFIG_FACTORYSET
 
 /* Define own nand partitions */
-- 
2.17.1