Skip to contentSkip to conversation

board: ge: bx50v3: set eth0 MAC address

PATCH New Jose Alarcon 2 participants 3 messages Aug 22, 2017 – Sep 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: ge: bx50v3: set eth0 MAC address

This patch modifies U-Boot to read the FEC MAC address from EEPROM and program it to the hardware -- replacing earlier functionality which attempted to set the MAC address from user-space.

Tested on bx50v3. Verified that FEC MAC address is set correctly. Corrupted first MAC octet in EEPROM, and verified that the BCH error correction worked.
Set EEPROM to all 0xFF, and verified that FEC MAC address was random (through two boots).

Ian Ray (1):
board: ge: bx50v3: set eth0 MAC address

 board/ge/bx50v3/Makefile     |   2 +-
 board/ge/bx50v3/bx50v3.c     | 109 +++++++++++++++++++++
 board/ge/bx50v3/vpd_reader.c | 228 +++++++++++++++++++++++++++++++++++++++++++
 board/ge/bx50v3/vpd_reader.h |  25 +++++
 include/configs/ge_bx50v3.h  |  15 +++
 5 files changed, 378 insertions(+), 1 deletion(-)
 create mode 100644 board/ge/bx50v3/vpd_reader.c
 create mode 100644 board/ge/bx50v3/vpd_reader.h
Signature · 1 line
2.10.1
#1 lore raw

PATCH 1/1 board: ge: bx50v3: set eth0 MAC address

From: Ian Ray <[email protected]>

Define i2c mux configuration. Add new vpd_reader which is used to read vital product data. Read VPD from EEPROM and set eth0 MAC address.

---
 board/ge/bx50v3/Makefile     |   2 +-
 board/ge/bx50v3/bx50v3.c     | 109 +++++++++++++++++++++
 board/ge/bx50v3/vpd_reader.c | 228 +++++++++++++++++++++++++++++++++++++++++++
 board/ge/bx50v3/vpd_reader.h |  25 +++++
 include/configs/ge_bx50v3.h  |  15 +++
 5 files changed, 378 insertions(+), 1 deletion(-)
 create mode 100644 board/ge/bx50v3/vpd_reader.c
 create mode 100644 board/ge/bx50v3/vpd_reader.h
board/ge/bx50v3/Makefile +1 -1
index bcd149f..2fff27b 100644
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-y  := bx50v3.o
+obj-y  := bx50v3.o vpd_reader.o
board/ge/bx50v3/bx50v3.c +109 -0

129 lines not on this page · raw message

board/ge/bx50v3/vpd_reader.c new file +228 -0

228 lines not on this page · raw message

board/ge/bx50v3/vpd_reader.h new file +25 -0
new file mode 100644
index 0000000..efa172a
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2016 General Electric Company
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include "common.h"
+
+/*
+ * Read VPD from given data, verify content, and call callback
+ * for each vital product data block.
+ *
+ * Returns Non-zero on error.  Negative numbers encode errno.
+ */
+int vpd_reader(
+	size_t size,
+	uint8_t * data,
+	void * userdata,
+	int (*fn)(
+	    void * userdata,
+	    uint8_t id,
+	    uint8_t version,
+	    uint8_t type,
+	    size_t size,
+	    uint8_t const * data));
include/configs/ge_bx50v3.h +15 -0
index d090cdd..278940a 100644
@@ -313,4 +313,19 @@
 #define CONFIG_SYS_I2C_MXC_I2C2
 #define CONFIG_SYS_I2C_MXC_I2C3
 
+#define CONFIG_SYS_NUM_I2C_BUSES        9
+#define CONFIG_SYS_I2C_MAX_HOPS         1
+#define CONFIG_SYS_I2C_BUSES	{	{0, {I2C_NULL_HOP} }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 0} } }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 1} } }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 2} } }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 3} } }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 4} } }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 5} } }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 6} } }, \
+					{0, {{I2C_MUX_PCA9547, 0x70, 7} } }, \
+				}
+
+#define CONFIG_BCH
+
 #endif	/* __GE_BX50V3_CONFIG_H */
Signature · 1 line
2.10.1
#2 lore raw

PATCH 1/1 board: ge: bx50v3: set eth0 MAC address

Quoted 8 lines · Jose Alarcon

From: Ian Ray <[email protected]>

Define i2c mux configuration. Add new vpd_reader which is used to read vital product data. Read VPD from EEPROM and set eth0 MAC address.

---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================