From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 5/5] board: ti: AM57xx: Add detection logic for AM57xx-evm
Date: Tue, 3 Nov 2015 15:29:01 +0200 [thread overview]
Message-ID: <5638B69D.3010600@compulab.co.il> (raw)
In-Reply-To: <1446553362-29732-6-git-send-email-s-kipisz2@ti.com>
Hi Steve,
On 11/03/15 14:22, Steve Kipisz wrote:
[...]
> Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
> ---
> v2 Based on:
> master a6104737 ARM: at91: sama5: change the environment address to 0x6000
>
> Build testing: MAKEALL -s omap4 -s omap5 (no warnings/build errors)
> Boot Testing:
> am57xx_evm_nodt_config: http://pastebin.ubuntu.com/13039296/
> beagle_x15_config: http://pastebin.ubuntu.com/13039331/
>
> Changes in v2 (since v1):
> - move the board detection code into the new routine
> do_board_detect
> - eliminate board.h and move the ix_xxx into board.c
> - redo commit message to be more clear
>
> v1: http://marc.info/?t=144608007900002&r=1&w=2
> http://marc.info/?t=144608007900004&r=1&w=2
> (mailing list squashed original submission)
[...]
> +#define is_x15() board_am_is("BBRDX15_")
> +#define is_am572x_evm() board_am_is("AM572PM_")
I think board_is_* much more appropriate here...
> +
> #ifdef CONFIG_DRIVER_TI_CPSW
> #include <cpsw.h>
> #endif
> @@ -246,6 +249,54 @@ struct vcores_data beagle_x15_volts = {
> .iva.pmic = &tps659038,
> };
>
> +#ifdef CONFIG_SPL_BUILD
> +/* No env to setup for SPL */
> +static inline void setup_board_eeprom_env(void) { }
> +
> +/* Override function to read eeprom information */
> +void do_board_detect(void)
> +{
> + struct ti_am_eeprom *ep;
> + int rc;
> +
> + rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
> + CONFIG_EEPROM_CHIP_ADDRESS, &ep);
> + if (rc)
> + printf("ti_i2c_eeprom_init failed %d\n", rc);
> +}
Do you really need this in SPL?
> +
> +#else /* CONFIG_SPL_BUILD */
> +
> +static void setup_board_eeprom_env(void)
> +{
> + char *name = NULL;
How about:
char *name = "beagle_x15";
> + int rc;
> + struct ti_am_eeprom_printable p;
> +
> + rc = ti_i2c_eeprom_am_get_print(CONFIG_EEPROM_BUS_ADDRESS,
> + CONFIG_EEPROM_CHIP_ADDRESS, &p);
> + if (rc) {
> + printf("Invalid EEPROM data(@0x%p). Default to X15\n",
> + TI_AM_EEPROM_DATA);
> + goto invalid_eeprom;
> + }
> +
> + if (is_x15())
> + name = "beagle_x15";
This will not be needed if the above comment is implemented.
> + else if (is_am572x_evm())
> + name = "am57xx_evm";
> + else
> + printf("Unidentified board claims %s in eeprom header\n",
> + p.name);
> +
> +invalid_eeprom:
> + set_board_info_env(name, "beagle_x15", p.version, p.serial);
If the above comment is implemented, no more need for the
default_name parameter...
> +}
> +
> +/* Eeprom is alread read by SPL.. nothing more to do here.. */
> +
> +#endif /* CONFIG_SPL_BUILD */
[...]
--
Regards,
Igor.
next prev parent reply other threads:[~2015-11-03 13:29 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 12:22 [U-Boot] [PATCH v2 0/5] ARM: omap-common: Add board detection support for TI EVMs Steve Kipisz
2015-11-03 12:22 ` [U-Boot] [PATCH v2 1/5] ARM: OMAP4/5: Centralize early clock initialization Steve Kipisz
2015-11-03 16:07 ` Tom Rini
2015-11-04 8:32 ` Lokesh Vutla
2015-11-04 14:54 ` Steven Kipisz
2015-11-03 12:22 ` [U-Boot] [PATCH v2 2/5] ARM: OMAP4/5: Centralize gpi2c_init Steve Kipisz
2015-11-03 16:07 ` Tom Rini
2015-11-03 12:22 ` [U-Boot] [PATCH v2 3/5] ARM: omap-common: Add standard access for board description EEPROM Steve Kipisz
2015-11-03 13:16 ` Igor Grinberg
2015-11-03 15:13 ` Steven Kipisz
2015-11-03 15:26 ` Nishanth Menon
2015-11-03 16:07 ` Tom Rini
2015-11-03 16:11 ` Nishanth Menon
2015-11-03 17:02 ` Igor Grinberg
2015-11-03 17:45 ` Nishanth Menon
2015-11-03 21:07 ` Igor Grinberg
2015-11-03 21:13 ` Nishanth Menon
2015-11-03 12:22 ` [U-Boot] [PATCH v2 4/5] ARM: OMAP4/5: Add generic board detection hook Steve Kipisz
2015-11-03 16:07 ` Tom Rini
2015-11-03 12:22 ` [U-Boot] [PATCH v2 5/5] board: ti: AM57xx: Add detection logic for AM57xx-evm Steve Kipisz
2015-11-03 13:29 ` Igor Grinberg [this message]
2015-11-03 15:09 ` Steven Kipisz
2015-11-03 17:04 ` Igor Grinberg
2015-11-03 15:31 ` Nishanth Menon
2015-11-03 15:36 ` Steven Kipisz
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=5638B69D.3010600@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 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.