diff options
Diffstat (limited to 'board/ge/common')
-rw-r--r-- | board/ge/common/Kconfig | 7 | ||||
-rw-r--r-- | board/ge/common/Makefile | 3 | ||||
-rw-r--r-- | board/ge/common/ge_rtc.c (renamed from board/ge/common/ge_common.c) | 0 | ||||
-rw-r--r-- | board/ge/common/ge_rtc.h (renamed from board/ge/common/ge_common.h) | 0 | ||||
-rw-r--r-- | board/ge/common/vpd_reader.c | 12 | ||||
-rw-r--r-- | board/ge/common/vpd_reader.h | 23 |
6 files changed, 34 insertions, 11 deletions
diff --git a/board/ge/common/Kconfig b/board/ge/common/Kconfig new file mode 100644 index 0000000000..323ed1f996 --- /dev/null +++ b/board/ge/common/Kconfig @@ -0,0 +1,7 @@ +config GE_VPD + bool "Enable GE VPD Support" + default y + +config GE_RTC + bool "Enable GE RTC Support" + default y diff --git a/board/ge/common/Makefile b/board/ge/common/Makefile index 8a21dcb8b5..8bd44e3c8a 100644 --- a/board/ge/common/Makefile +++ b/board/ge/common/Makefile @@ -2,4 +2,5 @@ # # Copyright 2017 General Electric Company -obj-y := vpd_reader.o ge_common.o +obj-$(CONFIG_GE_VPD) += vpd_reader.o +obj-$(CONFIG_GE_RTC) += ge_rtc.o diff --git a/board/ge/common/ge_common.c b/board/ge/common/ge_rtc.c index 48c3778046..48c3778046 100644 --- a/board/ge/common/ge_common.c +++ b/board/ge/common/ge_rtc.c diff --git a/board/ge/common/ge_common.h b/board/ge/common/ge_rtc.h index d33486d082..d33486d082 100644 --- a/board/ge/common/ge_common.h +++ b/board/ge/common/ge_rtc.h diff --git a/board/ge/common/vpd_reader.c b/board/ge/common/vpd_reader.c index d42b00da2f..421fee5922 100644 --- a/board/ge/common/vpd_reader.c +++ b/board/ge/common/vpd_reader.c @@ -110,9 +110,9 @@ static const size_t HEADER_BLOCK_ECC_LEN = 4; 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; @@ -200,9 +200,9 @@ static int vpd_reader(size_t size, u8 *data, struct vpd_cache *userdata, } } -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; diff --git a/board/ge/common/vpd_reader.h b/board/ge/common/vpd_reader.h index 3045b7e21e..0c51dc57e9 100644 --- a/board/ge/common/vpd_reader.h +++ b/board/ge/common/vpd_reader.h @@ -16,7 +16,22 @@ struct vpd_cache; * * 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)); |