diff options
| author | Marek BehĂșn <[email protected]> | 2024-04-04 09:50:56 +0200 |
|---|---|---|
| committer | Stefan Roese <[email protected]> | 2024-04-04 10:45:27 +0200 |
| commit | 77b0e0c151481c2cf585cedce303017a3eeef875 (patch) | |
| tree | aace146eed2711b85df3f275e6e927bae01e0404 | |
| parent | 59840f7b93e91d855b48a3378f7620bc869a6ed7 (diff) | |
arm: mvebu: turris_omnia: Disable Atmel SHA node if not present
If the FEAT_CRYPTO feature bit is present in MCU features, the board
crypto is implemented by MCU and the Atmel SHA chip is not present.
Disable Atmel SHA device-tree node in that case.
Signed-off-by: Marek BehĂșn <[email protected]>
Reviewed-by: Stefan Roese <[email protected]>
| -rw-r--r-- | board/CZ.NIC/turris_omnia/turris_omnia.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index b2f0088e5e8..3b7a71bdad2 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -1007,6 +1007,25 @@ static int fixup_mcu_gpio_in_eth_wan_node(void *blob) return 0; } +static void fixup_atsha_node(void *blob) +{ + int node; + + if (!omnia_mcu_has_feature(FEAT_CRYPTO)) + return; + + node = fdt_node_offset_by_compatible(blob, -1, "atmel,atsha204a"); + if (node < 0) { + printf("Cannot find ATSHA204A node!\n"); + return; + } + + if (fdt_status_disabled(blob, node) < 0) + printf("Cannot disable ATSHA204A node!\n"); + else + debug("Disabled ATSHA204A node\n"); +} + #endif #if IS_ENABLED(CONFIG_OF_BOARD_FIXUP) @@ -1020,6 +1039,8 @@ int board_fix_fdt(void *blob) fixup_msata_port_nodes(blob); fixup_wwan_port_nodes(blob); + fixup_atsha_node(blob); + return 0; } #endif @@ -1211,6 +1232,8 @@ int ft_board_setup(void *blob, struct bd_info *bd) fixup_msata_port_nodes(blob); fixup_wwan_port_nodes(blob); + fixup_atsha_node(blob); + return 0; } #endif |
