Re: [U-Boot] [PATCH V5 7/7] board: ti: AM57xx: Add detection logic for AM57xx-evm

2016-02-26 Thread Tom Rini
On Wed, Feb 24, 2016 at 12:30:58PM -0600, Steve Kipisz wrote:

> Current AM57xx evm supports both BeagleBoard-X15
> (http://beagleboard.org/x15) and AM57xx EVM
> (http://www.ti.com/tool/tmdxevm5728).
> 
> The AM572x EValuation Module(EVM) provides an affordable platform to
> quickly start evaluation of Sitara. ARM Cortex-A15 AM57x Processors
> (AM5728, AM5726, AM5718, AM5716) and accelerate development for HMI,
> machine vision, networking, medical imaging and many other industrial
> applications. This EVM is based on the same BeagleBoard-X15 Chassis
> and adds mPCIe, mSATA, LCD, touchscreen, Camera, push button and TI's
> wlink8 offering.
> 
> Since the EEPROM contents are compatible between the BeagleBoard-X15 and
> the AM57xx-evm, we add support for the detection logic to enable
> support for various user programmable scripting capability.
> 
> NOTE: U-boot configuration is currently a superset of AM57xx evm and
> BeagleBoard-X15 and no additional configuration tweaking is needed.
> 
> This change also sets up the stage for future support of TI AM57xx EVMs
> to the same base bootloader build.
> 
> Signed-off-by: Steve Kipisz 
> Signed-off-by: Lokesh Vutla 
> Signed-off-by: Nishanth Menon 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 7/7] board: ti: AM57xx: Add detection logic for AM57xx-evm

2016-02-25 Thread Nishanth Menon
On 02/25/2016 01:06 AM, Lokesh Vutla wrote:
> [..snip..]
> 

[...]

>>  "setenv fdtfile dra72-evm.dtb; fi;" \
>>  "if test $board_name = beagle_x15; then " \
>>  "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
>> +"if test $board_name = am57xx_evm; then " \
>> +"setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
> 
> Is it the same dtb file for am57xx_evm as well? or is this intentional
> and will be updated later?


Yes - it should be the same dtb file for 2 reasons:
A) At this point in patch, we dont want to break am57xx-evm -
mentioned in diffstat to remind ourselves.
B) we are attempting to move all these "cape" like variants into
device tree overlays -> in which case the same dtb is reused even for
am57xx-evm, and overlay with panel and touchscreen for the "gpevm"
panel board.

So, in almost with 80% certainty, we might not introduce a
am57xx_evm.dtb in upstream - we really dont need to. In fact, upstream
kernel and current master u-boot does bootup successfully, and would
like to maintain it so (point A).

-- 
Regards,
Nishanth Menon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5 7/7] board: ti: AM57xx: Add detection logic for AM57xx-evm

2016-02-24 Thread Lokesh Vutla

[..snip..]


diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
index 6308cab8e680..1fffdb18fbcd 100644
--- a/include/configs/am57xx_evm.h
+++ b/include/configs/am57xx_evm.h
@@ -88,4 +88,8 @@
  #define CONFIG_SYS_SCSI_MAX_DEVICE(CONFIG_SYS_SCSI_MAX_SCSI_ID * \
CONFIG_SYS_SCSI_MAX_LUN)

+/* EEPROM */
+#define CONFIG_EEPROM_CHIP_ADDRESS 0x50
+#define CONFIG_EEPROM_BUS_ADDRESS 0
+
  #endif /* __CONFIG_AM57XX_EVM_H */
diff --git a/include/configs/ti_omap5_common.h 
b/include/configs/ti_omap5_common.h
index d164e6abd450..d373cbc44a16 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -117,6 +117,8 @@
"setenv fdtfile dra72-evm.dtb; fi;" \
"if test $board_name = beagle_x15; then " \
"setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
+   "if test $board_name = am57xx_evm; then " \
+   "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \


Is it the same dtb file for am57xx_evm as well? or is this intentional
and will be updated later?

Thanks and regards,
Lokesh



"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; 
\0" \
"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile};\0" \


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V5 7/7] board: ti: AM57xx: Add detection logic for AM57xx-evm

2016-02-24 Thread Steve Kipisz
Current AM57xx evm supports both BeagleBoard-X15
(http://beagleboard.org/x15) and AM57xx EVM
(http://www.ti.com/tool/tmdxevm5728).

The AM572x EValuation Module(EVM) provides an affordable platform to
quickly start evaluation of Sitara. ARM Cortex-A15 AM57x Processors
(AM5728, AM5726, AM5718, AM5716) and accelerate development for HMI,
machine vision, networking, medical imaging and many other industrial
applications. This EVM is based on the same BeagleBoard-X15 Chassis
and adds mPCIe, mSATA, LCD, touchscreen, Camera, push button and TI's
wlink8 offering.

Since the EEPROM contents are compatible between the BeagleBoard-X15 and
the AM57xx-evm, we add support for the detection logic to enable
support for various user programmable scripting capability.

NOTE: U-boot configuration is currently a superset of AM57xx evm and
BeagleBoard-X15 and no additional configuration tweaking is needed.

This change also sets up the stage for future support of TI AM57xx EVMs
to the same base bootloader build.

Signed-off-by: Steve Kipisz 
Signed-off-by: Lokesh Vutla 
Signed-off-by: Nishanth Menon 
---

V5:
  - bug fixes for sys_info updates
  - updated for newer API usage
  - beagle-x15 and gpevm share the same dtb in findfdt - to ensure backward 
compatibility.

v4: https://patchwork.ozlabs.org/patch/540769/

v3:  https://patchwork.ozlabs.org/patch/540195/

v2:  http://marc.info/?t=14465534463&r=1&w=2

v1:  http://marc.info/?t=14460800792&r=1&w=2
http://marc.info/?t=14460800794&r=1&w=2
(mailing list squashed original submission)

 arch/arm/cpu/armv7/omap5/Kconfig  |  1 +
 board/ti/am57xx/Kconfig   |  2 ++
 board/ti/am57xx/board.c   | 70 ++-
 include/configs/am57xx_evm.h  |  4 +++
 include/configs/ti_omap5_common.h |  2 ++
 5 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig
index bfa264eccc57..f265b34b6383 100644
--- a/arch/arm/cpu/armv7/omap5/Kconfig
+++ b/arch/arm/cpu/armv7/omap5/Kconfig
@@ -15,6 +15,7 @@ config TARGET_DRA7XX_EVM
 
 config TARGET_BEAGLE_X15
bool "BeagleBoard X15"
+   select TI_I2C_BOARD_DETECT
 
 endchoice
 
diff --git a/board/ti/am57xx/Kconfig b/board/ti/am57xx/Kconfig
index bdb779511b66..17745ff7ea65 100644
--- a/board/ti/am57xx/Kconfig
+++ b/board/ti/am57xx/Kconfig
@@ -9,4 +9,6 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
default "am57xx_evm"
 
+source "board/ti/common/Kconfig"
+
 endif
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 042f9ab1965a..d712ab0571ea 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -30,8 +30,12 @@
 #include 
 #include 
 
+#include "../common/board_detect.h"
 #include "mux_data.h"
 
+#define board_is_x15() board_ti_is("BBRDX15_")
+#define board_is_am572x_evm()  board_ti_is("AM572PM_")
+
 #ifdef CONFIG_DRIVER_TI_CPSW
 #include 
 #endif
@@ -41,8 +45,10 @@ DECLARE_GLOBAL_DATA_PTR;
 /* GPIO 7_11 */
 #define GPIO_DDR_VTT_EN 203
 
+#define SYSINFO_BOARD_NAME_MAX_LEN 45
+
 const struct omap_sysinfo sysinfo = {
-   "Board: BeagleBoard x15\n"
+   "Board: UNKNOWN(BeagleBoard X15?) REV UNKNOWN\n"
 };
 
 static const struct dmm_lisa_map_regs beagle_x15_lisa_regs = {
@@ -246,6 +252,66 @@ 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)
+{
+   int rc;
+
+   rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
+ CONFIG_EEPROM_CHIP_ADDRESS);
+   if (rc)
+   printf("ti_i2c_eeprom_init failed %d\n", rc);
+}
+
+#else  /* CONFIG_SPL_BUILD */
+
+/* Override function to read eeprom information: actual i2c read done by SPL*/
+void do_board_detect(void)
+{
+   char *bname = NULL;
+   int rc;
+
+   rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
+ CONFIG_EEPROM_CHIP_ADDRESS);
+   if (rc)
+   printf("ti_i2c_eeprom_init failed %d\n", rc);
+
+   if (board_is_x15())
+   bname = "BeagleBoard X15";
+   else if (board_is_am572x_evm())
+   bname = "AM572x EVM";
+
+   if (bname)
+   snprintf(sysinfo.board_string, SYSINFO_BOARD_NAME_MAX_LEN,
+"Board: %s REV %s\n", bname, board_ti_get_rev());
+}
+
+static void setup_board_eeprom_env(void)
+{
+   char *name = "beagle_x15";
+   int rc;
+
+   rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
+ CONFIG_EEPROM_CHIP_ADDRESS);
+   if (rc)
+   goto invalid_eeprom;
+
+   if (board_is_am572x_evm())
+   name = "am57xx_evm";
+   else
+   printf("Unidentified board claims %s in eeprom header\n",
+  board_ti_get_name()