From 452aa9a90eb9b8bf2a768e397fc50a9be8372e04 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Tue, 29 Oct 2013 17:07:16 -0400 Subject: [PATCH] Revert "am335x_evm: Add check for non-0 profile on GP EVM, update fdtfile" On further review, this change isn't helpful as our test environment will likely blow away this information as part of ensuring an otherwise known development environment, so just let them load the correct device tree as needed. This reverts commit bf9a9b6889de11b1fdea72ac5c0515653a25dc66. Signed-off-by: Tom Rini --- board/ti/am335x/board.c | 28 ---------------------------- board/ti/am335x/board.h | 34 ---------------------------------- board/ti/am335x/mux.c | 34 ++++++++++++++++++++++++++++++++++ include/configs/am335x_evm.h | 5 +---- 4 files changed, 35 insertions(+), 66 deletions(-) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index c8243dd374..b348d5f701 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -512,34 +512,6 @@ int board_late_init(void) strncpy(safe_string, (char *)header.name, sizeof(header.name)); safe_string[sizeof(header.name)] = 0; setenv("board_name", safe_string); - if (board_is_gp_evm(&header)) { - unsigned short profile = detect_daughter_board_profile(); - switch (profile) { - case PROFILE_1: - setenv("profile_number", "1"); - break; - case PROFILE_2: - setenv("profile_number", "2"); - break; - case PROFILE_3: - setenv("profile_number", "3"); - break; - case PROFILE_4: - setenv("profile_number", "4"); - break; - case PROFILE_5: - setenv("profile_number", "5"); - break; - case PROFILE_6: - setenv("profile_number", "6"); - break; - case PROFILE_7: - setenv("profile_number", "7"); - break; - default: - setenv("profile_number", "0"); - } - } strncpy(safe_string, (char *)header.version, sizeof(header.version)); safe_string[sizeof(header.version)] = 0; diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h index 6d4fbf875e..bc700d56fe 100644 --- a/board/ti/am335x/board.h +++ b/board/ti/am335x/board.h @@ -60,40 +60,6 @@ static inline int board_is_evm_15_or_later(struct am335x_baseboard_id *header) strncmp("1.5", header->version, 3) <= 0); } -/* - * The AM335x GP EVM, if daughter card(s) are connected, can have 8 - * different profiles. These profiles determine what peripherals are - * valid and need pinmux to be configured. - */ -#define PROFILE_NONE 0x0 -#define PROFILE_0 (1 << 0) -#define PROFILE_1 (1 << 1) -#define PROFILE_2 (1 << 2) -#define PROFILE_3 (1 << 3) -#define PROFILE_4 (1 << 4) -#define PROFILE_5 (1 << 5) -#define PROFILE_6 (1 << 6) -#define PROFILE_7 (1 << 7) -#define PROFILE_MASK 0x7 -#define PROFILE_ALL 0xFF - -/* CPLD registers */ -#define I2C_CPLD_ADDR 0x35 -#define CFG_REG 0x10 - -static inline unsigned short detect_daughter_board_profile(void) -{ - unsigned short val; - - if (i2c_probe(I2C_CPLD_ADDR)) - return PROFILE_NONE; - - if (i2c_read(I2C_CPLD_ADDR, CFG_REG, 1, (unsigned char *)(&val), 2)) - return PROFILE_NONE; - - return (1 << (val & PROFILE_MASK)); -} - /* * We have three pin mux functions that must exist. We must be able to enable * uart0, for initial output and i2c0 to read the main EEPROM. We then have a diff --git a/board/ti/am335x/mux.c b/board/ti/am335x/mux.c index 72ce663713..b2bfda5ea9 100644 --- a/board/ti/am335x/mux.c +++ b/board/ti/am335x/mux.c @@ -294,6 +294,40 @@ void enable_i2c0_pin_mux(void) configure_module_pin_mux(i2c0_pin_mux); } +/* + * The AM335x GP EVM, if daughter card(s) are connected, can have 8 + * different profiles. These profiles determine what peripherals are + * valid and need pinmux to be configured. + */ +#define PROFILE_NONE 0x0 +#define PROFILE_0 (1 << 0) +#define PROFILE_1 (1 << 1) +#define PROFILE_2 (1 << 2) +#define PROFILE_3 (1 << 3) +#define PROFILE_4 (1 << 4) +#define PROFILE_5 (1 << 5) +#define PROFILE_6 (1 << 6) +#define PROFILE_7 (1 << 7) +#define PROFILE_MASK 0x7 +#define PROFILE_ALL 0xFF + +/* CPLD registers */ +#define I2C_CPLD_ADDR 0x35 +#define CFG_REG 0x10 + +static unsigned short detect_daughter_board_profile(void) +{ + unsigned short val; + + if (i2c_probe(I2C_CPLD_ADDR)) + return PROFILE_NONE; + + if (i2c_read(I2C_CPLD_ADDR, CFG_REG, 1, (unsigned char *)(&val), 2)) + return PROFILE_NONE; + + return (1 << (val & PROFILE_MASK)); +} + void enable_board_pin_mux(struct am335x_baseboard_id *header) { /* Do board-specific muxes. */ diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index b80ef0b0ec..214473bcbb 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -158,10 +158,7 @@ "if test $board_name = A335BNLT; then " \ "setenv fdtfile am335x-boneblack.dtb; fi; " \ "if test $board_name = A33515BB; then " \ - "setenv fdtfile am335x-evm.dtb; " \ - "if test $profile_number != 0; then " \ - "setenv fdtfile am335x-evm-profile${profile_number}.dtb; " \ - "fi; fi; "\ + "setenv fdtfile am335x-evm.dtb; fi; " \ "if test $board_name = A335X_SK; then " \ "setenv fdtfile am335x-evmsk.dtb; fi; " \ "if test $fdtfile = undefined; then " \