diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-08-05 14:54:11 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-08 14:32:08 +0200 |
commit | dbbe6037f5cafc42d97c3b577f1d617f41495816 (patch) | |
tree | 7dc2a86c993734431f57b03cc8fd2acd39a060e1 /include/ddr_spd.h | |
parent | cd5fc818a2d79d0a477b57dbd64f36dc876f4abb (diff) | |
download | barebox-dbbe6037f5cafc42d97c3b577f1d617f41495816.tar.gz |
pbl: generalize fsl i2c_early API into pbl_i2c
The prebootloader is inherently board-specific, so it's natural to
hardcode the i2c driver used and we only support fsl_i2c at the moment
anyway. For abstractions used by different prebootloaders though
(e.g. PMIC writing, SPD EEPROM decoding), it would be good for generic
code to use a pbl_i2c abstraction, so it can be reused across PBLs using
different I2C controllers. Add such an abstraction and use it where
appropriate.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.barebox.org/20220805125413.1046239-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/ddr_spd.h')
-rw-r--r-- | include/ddr_spd.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/ddr_spd.h b/include/ddr_spd.h index 6e63d90e5e..bcc2171d2a 100644 --- a/include/ddr_spd.h +++ b/include/ddr_spd.h @@ -6,7 +6,7 @@ #ifndef _DDR_SPD_H_ #define _DDR_SPD_H_ -#include <i2c/i2c.h> +#include <pbl/i2c.h> /* * Format from "JEDEC Standard No. 21-C, @@ -574,8 +574,7 @@ void ddr2_spd_dump(const struct ddr2_spd_eeprom *spd); int ddr3_spd_check(const struct ddr3_spd_eeprom *spd); int ddr4_spd_check(const struct ddr4_spd_eeprom *spd); -int spd_read_eeprom(void *ctx, - int (*xfer)(void *ctx, struct i2c_msg *msgs, int num), +int spd_read_eeprom(struct pbl_i2c *i2c, uint8_t addr, void *buf); #endif /* _DDR_SPD_H_ */ |