board: ti: common: Add generic AM6x board detection functions
authorGuillaume La Roque (TI.com) <glaroque@baylibre.com>
Mon, 3 Nov 2025 18:40:02 +0000 (19:40 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 7 Nov 2025 22:06:40 +0000 (16:06 -0600)
commit46684bb0369879413015c93c61998ff2986e0617
tree4e9a9a40a385c3c32c7909c56699e28cfb827bca
parent6a56d10fdcf1309d2070b62dc15e80a047da971b
board: ti: common: Add generic AM6x board detection functions

Add two new generic functions for AM6x family boards to simplify
board-specific implementations:

- do_board_detect_am6(): Generic board detection function that reads
  the on-board EEPROM. It first attempts to read at the configured
  address, and if that fails, tries the alternate address
  (CONFIG_EEPROM_CHIP_ADDRESS + 1). This provides a common
  implementation that can be used across different AM6x boards.

- setup_serial_am6(): Sets up the serial number environment variable
  from the EEPROM data. The serial number is converted from
  hexadecimal string format to a 16-character hexadecimal
  representation and stored in the "serial#" environment variable.

Both functions are protected by CONFIG_IS_ENABLED(TI_I2C_BOARD_DETECT)
and are designed to be used by AM62x, AM64x, AM65x, and other AM6x
family boards.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Guillaume La Roque (TI.com) <glaroque@baylibre.com>
board/ti/common/board_detect.c
board/ti/common/board_detect.h