4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
18 #include <asm/arch/cpu.h>
19 #include <asm/arch/hardware.h>
20 #include <asm/arch/common_def.h>
23 DECLARE_GLOBAL_DATA_PTR;
26 * I2C Address of on-board EEPROM
28 #define I2C_BASE_BOARD_ADDR 0x50
30 #define NO_OF_MAC_ADDR 3
35 struct am335x_baseboard_id {
41 char mac_addr[NO_OF_MAC_ADDR][ETH_ALEN];
44 static struct am335x_baseboard_id header;
46 static inline int board_is_bone(void)
48 return !strncmp(header.name, "A335BONE", NAME_LEN);
52 * Read header information from EEPROM into global structure.
56 /* Check if baseboard eeprom is available */
57 if (i2c_probe(I2C_BASE_BOARD_ADDR)) {
58 printf("Could not probe the EEPROM; something fundamentally "
59 "wrong on the I2C bus.\n");
63 /* read the eeprom using i2c */
64 if (i2c_read(I2C_BASE_BOARD_ADDR, 0, 2, (uchar *)&header,
66 printf("Could not read the EEPROM; something fundamentally"
67 " wrong on the I2C bus.\n");
71 if (header.magic != 0xEE3355AA) {
73 * read the eeprom using i2c again,
74 * but use only a 1 byte address
76 if (i2c_read(I2C_BASE_BOARD_ADDR, 0, 1, (uchar *)&header,
78 printf("Could not read the EEPROM; something "
79 "fundamentally wrong on the I2C bus.\n");
83 if (header.magic != 0xEE3355AA) {
84 printf("Incorrect magic number in EEPROM\n");
93 * Basic board specific setup
97 enable_uart0_pin_mux();
99 enable_i2c0_pin_mux();
100 enable_i2c1_pin_mux();
101 i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
102 if (read_eeprom() < 0)
103 printf("Could not get board ID.\n");
105 gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;