Daniel Schultz | 0bee885 | 2024-04-19 08:55:40 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | /* |
| 3 | * Copyright (C) 2024 PHYTEC Messtechnik GmbH |
| 4 | * Author: Daniel Schultz <d.schultz@phytec.de> |
| 5 | */ |
| 6 | |
| 7 | #ifndef _PHYTEC_AM6_SOM_DETECTION_H |
| 8 | #define _PHYTEC_AM6_SOM_DETECTION_H |
| 9 | |
| 10 | #include "phytec_som_detection.h" |
| 11 | |
| 12 | #define PHYTEC_AM62X_SOM 71 |
| 13 | #define PHYTEC_AM64X_SOM 72 |
| 14 | #define PHYTEC_EEPROM_VALUE_X 0x21 |
| 15 | #define PHYTEC_EEPROM_NOR_FLASH_64MB_QSPI 0xC |
| 16 | |
| 17 | int __maybe_unused phytec_am6_detect(struct phytec_eeprom_data *data); |
| 18 | u8 __maybe_unused phytec_get_am6_ddr_size(struct phytec_eeprom_data *data); |
| 19 | u8 __maybe_unused phytec_get_am6_spi(struct phytec_eeprom_data *data); |
| 20 | u8 __maybe_unused phytec_get_am6_eth(struct phytec_eeprom_data *data); |
| 21 | u8 __maybe_unused phytec_get_am6_rtc(struct phytec_eeprom_data *data); |
| 22 | |
| 23 | static inline int phytec_am6_is_qspi(struct phytec_eeprom_data *data) |
| 24 | { |
| 25 | u8 spi = phytec_get_am6_spi(data); |
| 26 | |
| 27 | if (spi == PHYTEC_EEPROM_VALUE_X) |
| 28 | return 0; |
| 29 | return spi <= PHYTEC_EEPROM_NOR_FLASH_64MB_QSPI; |
| 30 | } |
| 31 | |
| 32 | static inline int phytec_am6_is_ospi(struct phytec_eeprom_data *data) |
| 33 | { |
| 34 | return phytec_get_am6_spi(data) > PHYTEC_EEPROM_NOR_FLASH_64MB_QSPI; |
| 35 | } |
| 36 | #endif /* _PHYTEC_AM6_SOM_DETECTION_H */ |