Skip to content
Snippets Groups Projects
Commit 25afe55d authored by Lokesh Vutla's avatar Lokesh Vutla Committed by Tom Rini
Browse files

ARM: DRA7: Enable EEPROM support


Enable EEPROM support for DRA74-evm.

Acked-by: default avatarNishanth Menon <nm@ti.com>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
Signed-off-by: default avatarLokesh Vutla <lokeshvutla@ti.com>
parent d3b98a9e
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ config TARGET_OMAP5_UEVM ...@@ -12,6 +12,7 @@ config TARGET_OMAP5_UEVM
config TARGET_DRA7XX_EVM config TARGET_DRA7XX_EVM
bool "TI DRA7XX" bool "TI DRA7XX"
select TI_I2C_BOARD_DETECT
config TARGET_BEAGLE_X15 config TARGET_BEAGLE_X15
bool "BeagleBoard X15" bool "BeagleBoard X15"
......
...@@ -17,4 +17,7 @@ config CONS_INDEX ...@@ -17,4 +17,7 @@ config CONS_INDEX
The DRA7xx (and AM57x) SoC has a total of 6 UARTs available to it. The DRA7xx (and AM57x) SoC has a total of 6 UARTs available to it.
Depending on your specific board you may want something other than UART1 Depending on your specific board you may want something other than UART1
here. here.
source "board/ti/common/Kconfig"
endif endif
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <common.h> #include <common.h>
#include <palmas.h> #include <palmas.h>
#include <sata.h> #include <sata.h>
#include <linux/string.h>
#include <asm/gpio.h> #include <asm/gpio.h>
#include <usb.h> #include <usb.h>
#include <linux/usb/gadget.h> #include <linux/usb/gadget.h>
...@@ -27,6 +28,11 @@ ...@@ -27,6 +28,11 @@
#include <ti-usb-phy-uboot.h> #include <ti-usb-phy-uboot.h>
#include "mux_data.h" #include "mux_data.h"
#include "../common/board_detect.h"
#define board_is_dra74x_evm() board_ti_is("5777xCPU")
#define board_is_dra74x_revh_or_later() board_is_dra74x_evm() && \
(strncmp("H", board_ti_get_rev(), 1) <= 0)
#ifdef CONFIG_DRIVER_TI_CPSW #ifdef CONFIG_DRIVER_TI_CPSW
#include <cpsw.h> #include <cpsw.h>
...@@ -37,8 +43,10 @@ DECLARE_GLOBAL_DATA_PTR; ...@@ -37,8 +43,10 @@ DECLARE_GLOBAL_DATA_PTR;
/* GPIO 7_11 */ /* GPIO 7_11 */
#define GPIO_DDR_VTT_EN 203 #define GPIO_DDR_VTT_EN 203
#define SYSINFO_BOARD_NAME_MAX_LEN 37
const struct omap_sysinfo sysinfo = { const struct omap_sysinfo sysinfo = {
"Board: DRA7xx\n" "Board: UNKNOWN(DRA7 EVM) REV UNKNOWN\n"
}; };
/** /**
...@@ -57,16 +65,59 @@ int board_init(void) ...@@ -57,16 +65,59 @@ int board_init(void)
int board_late_init(void) int board_late_init(void)
{ {
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
if (omap_revision() == DRA722_ES1_0) char *name = "unknown";
setenv("board_name", "dra72x");
if (is_dra72x())
name = "dra72x";
else else
setenv("board_name", "dra7xx"); name = "dra7xx";
set_board_info_env(name);
omap_die_id_serial(); omap_die_id_serial();
#endif #endif
return 0; return 0;
} }
#ifdef CONFIG_SPL_BUILD
void do_board_detect(void)
{
int rc;
rc = ti_i2c_eeprom_dra7_get(CONFIG_EEPROM_BUS_ADDRESS,
CONFIG_EEPROM_CHIP_ADDRESS);
if (rc)
printf("ti_i2c_eeprom_init failed %d\n", rc);
}
#else
void do_board_detect(void)
{
char *bname = NULL;
int rc;
rc = ti_i2c_eeprom_dra7_get(CONFIG_EEPROM_BUS_ADDRESS,
CONFIG_EEPROM_CHIP_ADDRESS);
if (rc)
printf("ti_i2c_eeprom_init failed %d\n", rc);
if (board_is_dra74x_evm()) {
bname = "DRA74x EVM";
/* If EEPROM is not populated */
} else {
if (is_dra72x())
bname = "DRA72x EVM";
else
bname = "DRA74x EVM";
}
if (bname)
snprintf(sysinfo.board_string, SYSINFO_BOARD_NAME_MAX_LEN,
"Board: %s REV %s\n", bname, board_ti_get_rev());
}
#endif /* CONFIG_SPL_BUILD */
void set_muxconf_regs_essential(void) void set_muxconf_regs_essential(void)
{ {
do_set_mux32((*ctrl)->control_padconf_core_base, do_set_mux32((*ctrl)->control_padconf_core_base,
......
...@@ -341,4 +341,8 @@ ...@@ -341,4 +341,8 @@
#endif #endif
#endif /* NOR support */ #endif /* NOR support */
/* EEPROM */
#define CONFIG_EEPROM_CHIP_ADDRESS 0x50
#define CONFIG_EEPROM_BUS_ADDRESS 0
#endif /* __CONFIG_DRA7XX_EVM_H */ #endif /* __CONFIG_DRA7XX_EVM_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment