[PATCH 4/5] ARM: novena: Read Ethernet MAC address from EEPROM

John Watts contact at jookia.org
Mon Jan 23 01:55:02 PST 2023


On Mon, Jan 23, 2023 at 10:33:05AM +0100, Sascha Hauer wrote:
> > +static struct novena_eeprom *novena_read_eeprom(void)
> > +{
> > +	size_t read;
> > +	loff_t max = sizeof(struct novena_eeprom);
> > +	void *eeprom;
> > +
> > +	int rc = read_file_2("/dev/eeprom0", &read, &eeprom, max);
> 
> And here is the point where you have to request that the EEPROM is
> actually availabe to support the deep probe mechanism. Before reading
> the EEPROM add a call to:
> 
> 	of_device_ensure_probed_by_alias("eeprom0");
> 
> Nowadays the read-MAC-address-from-EEPROM thingy would likely be done
> using nvmem cells which would boil this code down to device tree changes
> only. If you're feeling brave you could change this, I won't insist on
> it though.
> 
> Sascha

That makes sense, I'll switch to the new board setup in V2.

Using nvmem cells would work better for this case, but in the future I will
need to read the EEPROM anyway to implement some features specific to the
laptop based on the features flag. I figured I'd get the EEPROM loading done
now rather than later, though if this is jumping the gun I can just change
it to an nvmem patch.

John



More information about the barebox mailing list