int board_init(void)
{
- if (!read_vpd(&vpd, vpd_callback)) {
+ if (!read_i2c_vpd(&vpd, vpd_callback)) {
int ret, rescan;
vpd.is_read = true;
static const u8 ECC_BLOCK_ID = 0xFF;
-static int vpd_reader(size_t size, u8 *data, struct vpd_cache *userdata,
- int (*fn)(struct vpd_cache *, u8 id, u8 version, u8 type,
- size_t size, u8 const *data))
+int vpd_reader(size_t size, u8 *data, struct vpd_cache *userdata,
+ int (*fn)(struct vpd_cache *, u8 id, u8 version, u8 type,
+ size_t size, u8 const *data))
{
if (size < HEADER_BLOCK_LEN || !data || !fn)
return -EINVAL;
}
}
-int read_vpd(struct vpd_cache *cache,
- int (*process_block)(struct vpd_cache *, u8 id, u8 version,
- u8 type, size_t size, u8 const *data))
+int read_i2c_vpd(struct vpd_cache *cache,
+ int (*process_block)(struct vpd_cache *, u8 id, u8 version,
+ u8 type, size_t size, u8 const *data))
{
struct udevice *dev;
int ret;
*
* Returns Non-zero on error. Negative numbers encode errno.
*/
-int read_vpd(struct vpd_cache *cache,
- int (*process_block)(struct vpd_cache *,
- u8 id, u8 version, u8 type,
- size_t size, u8 const *data));
+int read_i2c_vpd(struct vpd_cache *cache,
+ int (*process_block)(struct vpd_cache *, u8 id, u8 version,
+ u8 type, size_t size, u8 const *data));
+
+/*
+ * Read VPD from given data, verify content, call callback for each vital
+ * product data block.
+ *
+ * size: size of the raw VPD data in bytes
+ * data: raw VPD data read from device
+ * cache: structure used by process block to store VPD information
+ * process_block: callback called for each VPD data block
+ *
+ * Returns Non-zero on error. Negative numbers encode errno.
+ */
+
+int vpd_reader(size_t size, u8 *data, struct vpd_cache *cache,
+ int (*process_block)(struct vpd_cache *, u8 id, u8 version, u8 type,
+ size_t size, u8 const *data));
struct vpd_cache vpd;
memset(&vpd, 0, sizeof(vpd));
- res = read_vpd(&vpd, vpd_callback);
+ res = read_i2c_vpd(&vpd, vpd_callback);
if (!res)
process_vpd(&vpd);
else