[PATCH 01/13] kp_imx53: Switch to using a local namespace for ID EEPROM

Lukasz Majewski lukma at denx.de
Wed Aug 18 10:03:38 CEST 2021


Hi Tom,

> This platform does not use any of the standard EEPROM functionality
> and instead provides its own.  Use a local namespace for the I2C
> related defines to access the EEPROM.
> 
> Cc: Lukasz Majewski <lukma at denx.de>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
>  board/k+p/kp_imx53/kp_id_rev.c | 9 ++++++---
>  include/configs/kp_imx53.h     | 3 ---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/board/k+p/kp_imx53/kp_id_rev.c
> b/board/k+p/kp_imx53/kp_id_rev.c index 7103a3e0f2b5..9f93cf008ce8
> 100644 --- a/board/k+p/kp_imx53/kp_id_rev.c
> +++ b/board/k+p/kp_imx53/kp_id_rev.c
> @@ -64,6 +64,10 @@ void show_eeprom(void)
>  	eth_env_set_enetaddr("ethaddr", p);
>  }
>  
> +#define I2C_EEPROM_BUS_NUM	1
> +#define I2C_EEPROM_ADDR		0x50
> +#define I2C_EEPROM_ADDR_LEN	2
> +
>  int read_eeprom(void)
>  {
>  	struct udevice *dev;
> @@ -72,9 +76,8 @@ int read_eeprom(void)
>  	if (eeprom_has_been_read)
>  		return 0;
>  
> -	ret = i2c_get_chip_for_busnum(CONFIG_SYS_EEPROM_BUS_NUM,
> -				      CONFIG_SYS_I2C_EEPROM_ADDR,
> -
> CONFIG_SYS_I2C_EEPROM_ADDR_LEN, &dev);
> +	ret = i2c_get_chip_for_busnum(I2C_EEPROM_BUS_NUM,
> I2C_EEPROM_ADDR,
> +				      I2C_EEPROM_ADDR_LEN, &dev);
>  	if (ret) {
>  		printf("Cannot find EEPROM !\n");
>  		return ret;
> diff --git a/include/configs/kp_imx53.h b/include/configs/kp_imx53.h
> index c94882846efa..87f4841af05c 100644
> --- a/include/configs/kp_imx53.h
> +++ b/include/configs/kp_imx53.h
> @@ -20,9 +20,6 @@
>  #define CONFIG_MXC_USB_FLAGS	0
>  
>  #define CONFIG_SYS_I2C_MXC
> -#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
> -#define CONFIG_SYS_EEPROM_BUS_NUM 1
> -#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
>  
>  /* Command definition */
>  #define CONFIG_LOADADDR		0x72000000	/* loadaddr
> env var */

Acked-by: Lukasz Majewski <lukma at denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210818/b91ea988/attachment.sig>


More information about the U-Boot mailing list