[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot / 2011.09git / 0003-am335x_evm-single-byte-address-EEPROM-for-board-iden.patch
1 From 52165b34c2fbcfe93f4cfabb616c2feb3ea7344f Mon Sep 17 00:00:00 2001
2 From: Jason Kridner <jdk@ti.com>
3 Date: Thu, 13 Oct 2011 23:50:35 -0400
4 Subject: [PATCH 3/4] am335x_evm: single-byte address EEPROM for board identifier
6 The BeagleBone has an EEPROM that uses a single byte address instead of a
7 2-byte address used by the EVM versions. This simply adds a quick attempt
8 at reading the board identifier header with a 1-byte address if the header
9 signature isn't correct using a 2-byte address.
11 This is only build tested. Having a script to program the expected EEPROM
12 contents would help me reduce my time to test this.
14 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
15 ---
16 board/ti/am335x/evm.c | 14 ++++++++++++--
17 1 files changed, 12 insertions(+), 2 deletions(-)
19 diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c
20 index af34bfd..f484a3c 100755
21 --- a/board/ti/am335x/evm.c
22 +++ b/board/ti/am335x/evm.c
23 @@ -496,8 +496,18 @@ int board_init(void)
24 }
26 if (header.magic != 0xEE3355AA) {
27 - printf("Incorrect magic number in EEPROM\n");
28 - goto err_out;
29 + /* read the eeprom using i2c again, but use only a 1 byte address */
30 + if (i2c_read(I2C_BASE_BOARD_ADDR, 0, 1, (uchar *)&header,
31 + sizeof(header))) {
32 + printf("Could not read the EEPROM; something fundamentally"
33 + " wrong on the I2C bus.\n");
34 + goto err_out;
35 + }
36 +
37 + if (header.magic != 0xEE3355AA) {
38 + printf("Incorrect magic number in EEPROM\n");
39 + goto err_out;
40 + }
41 }
43 detect_daughter_board();
44 --
45 1.6.6.1