[PATCH v1] board: ti: am57xx: Add board detection logic for am57xx evm

Add board detection logic for the AM57xx EVM. More information about
the EVM can be found here
http://www.ti.com/tool/tmdxevm5728

The AM572x Evaluation Module 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. It is a development platform based on the dual ARM
Cortex-A15, dual C66x DSP processor that is integrated with tons of
connectivity such as PCIe, SATA, HDMI, USB 3.0/2.0, Dual Gigabit
Ethernet, and more.

The AM572x Evaluation Module also integrates video and 3D/2D graphics
acceleration, as well as a quad-core Programmable Real-time Unit (PRU)
and dual ARM Cortex-M4 cores.

Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>

Add board detection logic for the AM57xx EVM. More information about
the EVM can be found here
http://www.ti.com/tool/tmdxevm5728

The AM572x Evaluation Module 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. It is a development platform based on the dual ARM
Cortex-A15, dual C66x DSP processor that is integrated with tons of
connectivity such as PCIe, SATA, HDMI, USB 3.0/2.0, Dual Gigabit
Ethernet, and more.

The AM572x Evaluation Module also integrates video and 3D/2D graphics
acceleration, as well as a quad-core Programmable Real-time Unit (PRU)
and dual ARM Cortex-M4 cores.

Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
---
board/ti/am57xx/board.c | 4 +++-
board/ti/am57xx/board.h | 5 +++++
include/configs/ti_omap5_common.h | 2 ++
3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 869bbe7..d075a49 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -277,6 +277,8 @@ int board_late_init(void)
    */
   if (board_is_x15())
     setenv("board_name", "beagle_x15");

The above change depends on a previous patch which introduces
board_is_x15() and then builds on it, However, the patch is not
submitted as a proper series in the right order.

+ if (board_is_evm())
+ setenv("board_name", "am57xx_evm");

   return 0;
}
@@ -304,7 +306,7 @@ void recalibrate_iodelay(void)
     }
   }

- if (board_is_x15())
+ if ((board_is_x15() || board_is_evm()))
     __recalibrate_iodelay(core_padconf_array_essential,
       ARRAY_SIZE(core_padconf_array_essential),
       iodelay_cfg_array, ARRAY_SIZE(iodelay_cfg_array));
diff --git a/board/ti/am57xx/board.h b/board/ti/am57xx/board.h
index 55719ce..a380a58 100644
--- a/board/ti/am57xx/board.h
+++ b/board/ti/am57xx/board.h
@@ -26,4 +26,9 @@ static inline int board_is_x15(void)
{
   return !strncmp(am57xx_board_name, "BBRDX15_", HDR_NAME_LEN);
}
+
+static inline int board_is_evm(void)
+{
+ return !strncmp(am57xx_board_name, "AM572PM_", HDR_NAME_LEN);
+}
#endif
diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h
index 5acbc92..ae6e2a5 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -120,6 +120,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-evm.dtb; fi;" \

Further, no such DTB exists in upstream kernel -> I suggest splitting
out this specific change out of the series and repost once upstream
kernel has support for the same.