aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/i2c_eeprom_emul.c
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2022-05-05 13:11:42 -0400
committerTom Rini <trini@konsulko.com>2022-06-08 14:00:22 -0400
commit472caa69e3480dc8e3fe1dd929b528a599341768 (patch)
treee82b1ea4c9f312463ec7b9da9932867852778318 /drivers/misc/i2c_eeprom_emul.c
parent97d0f9bfdd025f0e7db8ff09238fe88d039c2a70 (diff)
test: Load mac address with i2c eeprom
This uses an i2c eeprom to load a mac address using the nvmem interface. Enable I2C_EEPROM for sandbox SPL since it is the only sandbox config which doesn't enable it eeprom. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/misc/i2c_eeprom_emul.c')
-rw-r--r--drivers/misc/i2c_eeprom_emul.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/misc/i2c_eeprom_emul.c b/drivers/misc/i2c_eeprom_emul.c
index 85b127c406..6f32087ede 100644
--- a/drivers/misc/i2c_eeprom_emul.c
+++ b/drivers/misc/i2c_eeprom_emul.c
@@ -171,11 +171,15 @@ static int sandbox_i2c_eeprom_probe(struct udevice *dev)
{
struct sandbox_i2c_flash_plat_data *plat = dev_get_plat(dev);
struct sandbox_i2c_flash *priv = dev_get_priv(dev);
+ /* For eth3 */
+ const u8 mac[] = { 0x02, 0x00, 0x11, 0x22, 0x33, 0x45 };
priv->data = calloc(1, plat->size);
if (!priv->data)
return -ENOMEM;
+ memcpy(&priv->data[24], mac, sizeof(mac));
+
return 0;
}