aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Hahn <B.Hahn@phytec.de>2024-03-06 17:18:31 +0100
committerFabio Estevam <festevam@gmail.com>2024-03-11 08:42:44 -0300
commit110d321a56c3ea1824104ea6148efe040adf995d (patch)
tree060eddb3bb5651f8976691098150424f4e2d648c
parent0981f8900f2b1f45a3f282b704012b5374fdd7a6 (diff)
downloadu-boot-110d321a56c3ea1824104ea6148efe040adf995d.zip
u-boot-110d321a56c3ea1824104ea6148efe040adf995d.tar.gz
u-boot-110d321a56c3ea1824104ea6148efe040adf995d.tar.bz2
board: phytec: common: phytec_som_detection: Add phytec_get_som_type
Add a function that gets the som_type from the EEPROM. Add an enum for the som_type. Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
-rw-r--r--board/phytec/common/phytec_som_detection.c10
-rw-r--r--board/phytec/common/phytec_som_detection.h8
2 files changed, 18 insertions, 0 deletions
diff --git a/board/phytec/common/phytec_som_detection.c b/board/phytec/common/phytec_som_detection.c
index c73bf97..f9607b0 100644
--- a/board/phytec/common/phytec_som_detection.c
+++ b/board/phytec/common/phytec_som_detection.c
@@ -203,6 +203,16 @@ u8 __maybe_unused phytec_get_rev(struct phytec_eeprom_data *data)
return api2->pcb_rev;
}
+u8 __maybe_unused phytec_get_som_type(struct phytec_eeprom_data *data)
+{
+ if (!data)
+ data = &eeprom_data;
+ if (data->api_rev < PHYTEC_API_REV2)
+ return PHYTEC_EEPROM_INVAL;
+
+ return data->data.data_api2.som_type;
+}
+
#else
inline int phytec_eeprom_data_setup(struct phytec_eeprom_data *data,
diff --git a/board/phytec/common/phytec_som_detection.h b/board/phytec/common/phytec_som_detection.h
index 1100924..7edbfa3 100644
--- a/board/phytec/common/phytec_som_detection.h
+++ b/board/phytec/common/phytec_som_detection.h
@@ -19,6 +19,13 @@ enum {
PHYTEC_API_REV2,
};
+enum phytec_som_type_str {
+ SOM_TYPE_PCM = 0,
+ SOM_TYPE_PCL,
+ SOM_TYPE_KSM,
+ SOM_TYPE_KSP,
+};
+
static const char * const phytec_som_type_str[] = {
"PCM",
"PCL",
@@ -67,5 +74,6 @@ void __maybe_unused phytec_print_som_info(struct phytec_eeprom_data *data);
char * __maybe_unused phytec_get_opt(struct phytec_eeprom_data *data);
u8 __maybe_unused phytec_get_rev(struct phytec_eeprom_data *data);
+u8 __maybe_unused phytec_get_som_type(struct phytec_eeprom_data *data);
#endif /* _PHYTEC_SOM_DETECTION_H */