From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] compulab: eeprom: select i2c bus when querying for board rev
Date: Thu, 3 Sep 2015 11:35:25 +0300 [thread overview]
Message-ID: <55E8064D.9050901@compulab.co.il> (raw)
In-Reply-To: <1441209920-10583-2-git-send-email-nikita@compulab.co.il>
Hi Nikita,
On 09/02/15 19:05, Nikita Kiryanov wrote:
> Add support for selecting which eeprom is queried for board revision by
> extending cl_eeprom_get_board_rev() to accept an i2c bus number.
>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
> board/compulab/cm_fx6/cm_fx6.c | 2 +-
> board/compulab/cm_t35/cm_t35.c | 2 +-
> board/compulab/common/eeprom.c | 4 ++--
> board/compulab/common/eeprom.h | 4 ++--
> 4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
> index 3ad1216..572111d 100644
> --- a/board/compulab/cm_fx6/cm_fx6.c
> +++ b/board/compulab/cm_fx6/cm_fx6.c
> @@ -708,7 +708,7 @@ int dram_init(void)
>
> u32 get_board_rev(void)
> {
> - return cl_eeprom_get_board_rev();
> + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
> }
>
> static struct mxc_serial_platdata cm_fx6_mxc_serial_plat = {
> diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
> index 398c573..26c6a81 100644
> --- a/board/compulab/cm_t35/cm_t35.c
> +++ b/board/compulab/cm_t35/cm_t35.c
> @@ -105,7 +105,7 @@ int board_init(void)
> */
> u32 get_board_rev(void)
> {
> - return cl_eeprom_get_board_rev();
> + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
> };
>
> int misc_init_r(void)
> diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c
> index 77bcea4..aaacd2e 100644
> --- a/board/compulab/common/eeprom.c
> +++ b/board/compulab/common/eeprom.c
> @@ -121,7 +121,7 @@ static u32 board_rev;
> * Routine: cl_eeprom_get_board_rev
> * Description: read system revision from eeprom
> */
> -u32 cl_eeprom_get_board_rev(void)
> +u32 cl_eeprom_get_board_rev(uint eeprom_bus)
> {
> char str[5]; /* Legacy representation can contain at most 4 digits */
> uint offset = BOARD_REV_OFFSET_LEGACY;
> @@ -129,7 +129,7 @@ u32 cl_eeprom_get_board_rev(void)
> if (board_rev)
> return board_rev;
>
> - if (cl_eeprom_setup(CONFIG_SYS_I2C_EEPROM_BUS))
> + if (cl_eeprom_setup(eeprom_bus))
> return 0;
>
> if (cl_eeprom_layout != LAYOUT_LEGACY)
> diff --git a/board/compulab/common/eeprom.h b/board/compulab/common/eeprom.h
> index 50c6b02..e74c379 100644
> --- a/board/compulab/common/eeprom.h
> +++ b/board/compulab/common/eeprom.h
> @@ -12,13 +12,13 @@
>
> #ifdef CONFIG_SYS_I2C
> int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus);
> -u32 cl_eeprom_get_board_rev(void);
> +u32 cl_eeprom_get_board_rev(uint eeprom_bus);
> #else
> static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus)
> {
> return 1;
> }
> -static inline u32 cl_eeprom_get_board_rev(void)
> +static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus)
> {
> return 0;
> }
>
--
Regards,
Igor.
next prev parent reply other threads:[~2015-09-03 8:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 16:05 [U-Boot] [PATCH 0/3] cm-fx6 updates for Utilite Nikita Kiryanov
2015-09-02 16:05 ` [U-Boot] [PATCH 1/3] compulab: eeprom: select i2c bus when querying for board rev Nikita Kiryanov
2015-09-03 8:35 ` Igor Grinberg [this message]
2015-09-02 16:05 ` [U-Boot] [PATCH 2/3] compulab: eeprom: add support for obtaining product name Nikita Kiryanov
2015-09-03 8:45 ` Igor Grinberg
2015-09-02 16:05 ` [U-Boot] [PATCH 3/3] arm: mx6: cm-fx6: modify device tree for old revisions of utilite Nikita Kiryanov
2015-09-03 8:57 ` Igor Grinberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55E8064D.9050901@compulab.co.il \
--to=grinberg@compulab.co.il \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox