History log of /u-boot/board/phytec/common/phytec_som_detection.c
Revision Date Author Comments
# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 9ac776b2 30-Apr-2024 Tom Rini <trini@konsulko.com>

board: phytec: Remove <common.h> and add needed includes

Remove <common.h> from this board vendor directory and when needed
add missing include files directly.

Acked-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Tom Rini <trini@konsulko.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e8fc2eff 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 1e5de690 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# 8fe6e9a0 19-Apr-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# f1c6f579 19-Apr-2024 Daniel Schultz <d.schultz@phytec.de>

board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e1897784 12-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

board: phytec: define get_som_type also when SoM detection is disabled

define the phytec_get_som_type function also when the SoM detection is
disabled.

Fixes:
commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type")

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 110d321a 06-Mar-2024 Benjamin Hahn <B.Hahn@phytec.de>

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>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 1aebea9b 15-Jan-2024 Yannic Moog <y.moog@phytec.de>

board: phytec: fix link error when disabling PHYTEC_SOM_DETECTION

Commit aa7858fe5e2e ("board: phytec: som_detection: move definitions to
source file") moved function definitions from header to source file.
Makefile however was not updated to unconditionally (from
[..]_SOM_DETECTION) build the imx8 and phytec som detection units.
Also remove unused includes that cause build failures on arm 32bit
boards. SoM detection shall support 32bit boards as well, but arch
specific code should not be included in the generic module.

Fixes: aa7858fe5e2e ("board: phytec: som_detection: move definitions to source file")
Signed-off-by: Yannic Moog <y.moog@phytec.de>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# e2449ee9 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix uninitialized bug

When som_type does not match any case, it is uninitialized and the
function still tries to print the SoM info. Rather, this is an error
condition and the function should abort prematurely. Highlight this by
printing an error message and returning early.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# aa7858fe 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: som_detection: move definitions to source file

Move all function definitions in {phytec|imx8m}_som_detection from the
header to the source file to prevent potential linker error regarding
multiple definitions. Also move the #if blocks with the definitions.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 71714cda 20-Dec-2023 Yannic Moog <y.moog@phytec.de>

board: phytec: phytec_som_detection: fix eeprom_data zero check

In phytec_eeprom_data_init, after reading eeprom data into buffer, it is
checked whether all bytes are 0x0 by iterating over chunks of the
buffer. The offset, or index of the chunk, was never changed, leading to
repeated comparison of only the first chunk. Use array notation and
access chunk via array index to compare all chunks of the buffer.

Signed-off-by: Yannic Moog <y.moog@phytec.de>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>


# 44c82e7c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: common: phytec_som_detection: Add helper for PCB revision

Add helper function to read out the PCB revision of a PHYTEC SoM.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>


# dc22188c 17-Aug-2023 Teresa Remmet <t.remmet@phytec.de>

board: phytec: Add common PHYTEC SoM detection

Recent shipped PHYTEC SoMs come with an i2c EEPROM containing
information about the hardware such as board revision and variant.
This can be used for RAM detection and loading device tree overlays
during kernel start.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Yannic Moog <y.moog@phytec.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>