Skip to content

Commit

Permalink
Merge branch 'bugfix/update_jtag_disabling_api_v5.0' into 'release/v5.0'
Browse files Browse the repository at this point in the history
fix(esp_hw_support): fix API esp_hmac_disable_jtag() to disable JTAG (v5.0)

See merge request espressif/esp-idf!28502
  • Loading branch information
mahavirj committed Jan 24, 2024
2 parents 44593bf + 1cd2bb4 commit 4b13be6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions components/esp_hw_support/port/esp32c3/esp_hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ esp_err_t esp_hmac_jtag_enable(hmac_key_id_t key_id, const uint8_t *token)
esp_err_t esp_hmac_jtag_disable()
{
esp_crypto_hmac_lock_acquire();

ets_hmac_enable();
REG_SET_BIT(HMAC_SET_INVALIDATE_JTAG_REG, HMAC_INVALIDATE_JTAG);

ets_hmac_disable();
esp_crypto_hmac_lock_release();

ESP_LOGD(TAG, "Invalidate JTAG result register. JTAG disabled.");
Expand Down
6 changes: 3 additions & 3 deletions components/esp_hw_support/port/esp32h2/esp_hmac.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -169,9 +169,9 @@ esp_err_t esp_hmac_jtag_enable(hmac_key_id_t key_id, const uint8_t *token)
esp_err_t esp_hmac_jtag_disable()
{
esp_crypto_hmac_lock_acquire();

ets_hmac_enable();
REG_SET_BIT(HMAC_SET_INVALIDATE_JTAG_REG, HMAC_INVALIDATE_JTAG);

ets_hmac_disable();
esp_crypto_hmac_lock_release();

ESP_LOGD(TAG, "Invalidate JTAG result register. JTAG disabled.");
Expand Down
4 changes: 2 additions & 2 deletions components/esp_hw_support/port/esp32s2/esp_hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ esp_err_t esp_hmac_jtag_enable(hmac_key_id_t key_id, const uint8_t *token)
esp_err_t esp_hmac_jtag_disable()
{
esp_crypto_dma_lock_acquire();

ets_hmac_enable();
REG_WRITE(HMAC_SET_INVALIDATE_JTAG_REG, 1);

ets_hmac_disable();
esp_crypto_dma_lock_release();

ESP_LOGD(TAG, "Invalidate JTAG result register. JTAG disabled.");
Expand Down
4 changes: 2 additions & 2 deletions components/esp_hw_support/port/esp32s3/esp_hmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ esp_err_t esp_hmac_jtag_enable(hmac_key_id_t key_id, const uint8_t *token)
esp_err_t esp_hmac_jtag_disable()
{
esp_crypto_hmac_lock_acquire();

ets_hmac_enable();
REG_SET_BIT(HMAC_SET_INVALIDATE_JTAG_REG, HMAC_INVALIDATE_JTAG);

ets_hmac_disable();
esp_crypto_hmac_lock_release();

ESP_LOGD(TAG, "Invalidate JTAG result register. JTAG disabled.");
Expand Down

0 comments on commit 4b13be6

Please sign in to comment.