Skip to content

Commit d431971

Browse files
committed
Merge branch 'feat/ci_check_ll_rw_register_half_word_v5.3' into 'release/v5.3'
fix(hal): LL function read write the register by half-world (v5.3) See merge request espressif/esp-idf!31722
2 parents 2c84e2e + ab5b9a0 commit d431971

File tree

15 files changed

+54
-52
lines changed

15 files changed

+54
-52
lines changed

components/hal/esp32/include/hal/sdio_slave_ll.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#pragma once
1818

1919
#include "hal/sdio_slave_types.h"
20+
#include "hal/misc.h"
2021
#include "soc/slc_struct.h"
2122
#include "soc/slc_reg.h"
2223
#include "soc/host_struct.h"
@@ -514,7 +515,7 @@ static inline void sdio_slave_ll_host_send_int(slc_dev_t *slc, const sdio_slave_
514515
{
515516
//use registers in SLC to trigger, rather than write HOST registers directly
516517
//other interrupts than tohost interrupts are not supported yet
517-
slc->intvec_tohost.slc0_intvec = (*mask);
518+
HAL_FORCE_MODIFY_U32_REG_FIELD(slc->intvec_tohost, slc0_intvec, *mask);
518519
}
519520

520521
/**

components/hal/esp32c6/include/hal/etm_ll.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -98,7 +98,7 @@ static inline bool etm_ll_is_channel_enabled(soc_etm_dev_t *hw, uint32_t chan)
9898
*/
9999
static inline void etm_ll_channel_set_event(soc_etm_dev_t *hw, uint32_t chan, uint32_t event)
100100
{
101-
hw->channel[chan].evt_id.evt_id = event;
101+
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->channel[chan].eid, evt_id, event);
102102
}
103103

104104
/**
@@ -110,10 +110,10 @@ static inline void etm_ll_channel_set_event(soc_etm_dev_t *hw, uint32_t chan, ui
110110
*/
111111
static inline void etm_ll_channel_set_task(soc_etm_dev_t *hw, uint32_t chan, uint32_t task)
112112
{
113-
hw->channel[chan].task_id.task_id = task;
113+
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->channel[chan].tid, task_id, task);
114114
}
115115

116-
#define etm_ll_is_lpcore_wakeup_triggered() lp_aon_ll_get_lpcore_etm_wakeup_flag()
116+
#define etm_ll_is_lpcore_wakeup_triggered() lp_aon_ll_get_lpcore_etm_wakeup_flag()
117117

118118
#define etm_ll_clear_lpcore_wakeup_status() lp_aon_ll_clear_lpcore_etm_wakeup_flag()
119119

components/hal/esp32c6/include/hal/sdio_slave_ll.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#pragma once
1818

1919
#include "hal/sdio_slave_types.h"
20+
#include "hal/misc.h"
2021
#include "soc/slc_struct.h"
2122
#include "soc/slc_reg.h"
2223
#include "soc/host_struct.h"
@@ -503,7 +504,7 @@ static inline void sdio_slave_ll_host_send_int(slc_dev_t *slc, const sdio_slave_
503504
{
504505
//use registers in SLC to trigger, rather than write HOST registers directly
505506
//other interrupts than tohost interrupts are not supported yet
506-
slc->slcintvec_tohost.slc0_tohost_intvec = (*mask);
507+
HAL_FORCE_MODIFY_U32_REG_FIELD(slc->slcintvec_tohost, slc0_tohost_intvec, *mask);
507508
}
508509

509510
/**

components/hal/esp32h2/include/hal/etm_ll.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static inline bool etm_ll_is_channel_enabled(soc_etm_dev_t *hw, uint32_t chan)
9797
*/
9898
static inline void etm_ll_channel_set_event(soc_etm_dev_t *hw, uint32_t chan, uint32_t event)
9999
{
100-
hw->channel[chan].evt_id.evt_id = event;
100+
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->channel[chan].eid, evt_id, event);
101101
}
102102

103103
/**
@@ -109,7 +109,7 @@ static inline void etm_ll_channel_set_event(soc_etm_dev_t *hw, uint32_t chan, ui
109109
*/
110110
static inline void etm_ll_channel_set_task(soc_etm_dev_t *hw, uint32_t chan, uint32_t task)
111111
{
112-
hw->channel[chan].task_id.task_id = task;
112+
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->channel[chan].tid, task_id, task);
113113
}
114114

115115
#ifdef __cplusplus

components/hal/esp32h2/include/hal/parlio_ll.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -326,7 +326,7 @@ static inline void parlio_ll_rx_treat_data_line_as_en(parl_io_dev_t *dev, uint32
326326
}
327327

328328
/**
329-
* @brief Wether to enable the RX clock gating
329+
* @brief Whether to enable the RX clock gating
330330
*
331331
* @param dev Parallel IO register base address
332332
* @param en True to enable, False to disable
@@ -457,7 +457,7 @@ static inline void parlio_ll_tx_set_trans_bit_len(parl_io_dev_t *dev, uint32_t b
457457
}
458458

459459
/**
460-
* @brief Wether to enable the TX clock gating
460+
* @brief Whether to enable the TX clock gating
461461
*
462462
* @note The MSB of TXD will be taken as the gating enable signal
463463
*
@@ -571,7 +571,7 @@ static inline void parlio_ll_tx_reset_fifo(parl_io_dev_t *dev)
571571
__attribute__((always_inline))
572572
static inline void parlio_ll_tx_set_idle_data_value(parl_io_dev_t *dev, uint32_t value)
573573
{
574-
dev->tx_genrl_cfg.tx_idle_value = value;
574+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->tx_genrl_cfg, tx_idle_value, value);
575575
}
576576

577577
/**

components/hal/esp32p4/include/hal/dw_gdma_ll.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ __attribute__((always_inline))
11121112
static inline void dw_gdma_ll_lli_set_src_burst_len(dw_gdma_link_list_item_t *lli, uint8_t len)
11131113
{
11141114
lli->ctrl_hi.arlen_en = len > 0;
1115-
lli->ctrl_hi.arlen = len;
1115+
HAL_FORCE_MODIFY_U32_REG_FIELD(lli->ctrl_hi, arlen, len);
11161116
}
11171117

11181118
/**
@@ -1125,7 +1125,7 @@ __attribute__((always_inline))
11251125
static inline void dw_gdma_ll_lli_set_dst_burst_len(dw_gdma_link_list_item_t *lli, uint8_t len)
11261126
{
11271127
lli->ctrl_hi.awlen_en = len > 0;
1128-
lli->ctrl_hi.awlen = len;
1128+
HAL_FORCE_MODIFY_U32_REG_FIELD(lli->ctrl_hi, awlen, len);
11291129
}
11301130

11311131
/**

components/hal/esp32p4/include/hal/emac_ll.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,11 @@ static inline void emac_ll_clock_enable_mii(void *ext_regs)
628628

629629
HP_SYS_CLKRST.peri_clk_ctrl00.reg_emac_rx_clk_en = 1;
630630
HP_SYS_CLKRST.peri_clk_ctrl00.reg_emac_rx_clk_src_sel = 1; // 0-pad_emac_txrx_clk, 1-pad_emac_rx_clk
631-
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_rx_clk_div_num = 0; // 25MHz
631+
HAL_FORCE_MODIFY_U32_REG_FIELD(HP_SYS_CLKRST.peri_clk_ctrl01, reg_emac_rx_clk_div_num, 0); // 25MHz
632632

633633
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_tx_clk_en = 1;
634634
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_tx_clk_src_sel = 1; // 0-pad_emac_txrx_clk, 1-pad_emac_tx_clk
635-
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_tx_clk_div_num = 0; // 25MHz
635+
HAL_FORCE_MODIFY_U32_REG_FIELD(HP_SYS_CLKRST.peri_clk_ctrl01, reg_emac_tx_clk_div_num, 0); // 25MHz
636636

637637
LP_AON_CLKRST.hp_clk_ctrl.hp_pad_emac_tx_clk_en = 1;
638638
LP_AON_CLKRST.hp_clk_ctrl.hp_pad_emac_rx_clk_en = 1;
@@ -653,11 +653,11 @@ static inline void emac_ll_clock_enable_rmii_input(void *ext_regs)
653653

654654
HP_SYS_CLKRST.peri_clk_ctrl00.reg_emac_rx_clk_en = 1;
655655
HP_SYS_CLKRST.peri_clk_ctrl00.reg_emac_rx_clk_src_sel = 0; // 0-pad_emac_txrx_clk, 1-pad_emac_rx_clk
656-
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_rx_clk_div_num = 1; // set default divider
656+
HAL_FORCE_MODIFY_U32_REG_FIELD(HP_SYS_CLKRST.peri_clk_ctrl01, reg_emac_rx_clk_div_num, 1); // set default divider
657657

658658
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_tx_clk_en = 1;
659659
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_tx_clk_src_sel = 0; // 0-pad_emac_txrx_clk, 1-pad_emac_tx_clk
660-
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_tx_clk_div_num = 1; // set default divider
660+
HAL_FORCE_MODIFY_U32_REG_FIELD(HP_SYS_CLKRST.peri_clk_ctrl01, reg_emac_tx_clk_div_num, 1); // set default divider
661661

662662
LP_AON_CLKRST.hp_clk_ctrl.hp_pad_emac_tx_clk_en = 0;
663663
LP_AON_CLKRST.hp_clk_ctrl.hp_pad_emac_rx_clk_en = 0;
@@ -670,8 +670,8 @@ static inline void emac_ll_clock_enable_rmii_input(void *ext_regs)
670670

671671
static inline void emac_ll_clock_rmii_rx_tx_div(void *ext_regs, int div)
672672
{
673-
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_rx_clk_div_num = div;
674-
HP_SYS_CLKRST.peri_clk_ctrl01.reg_emac_tx_clk_div_num = div;
673+
HAL_FORCE_MODIFY_U32_REG_FIELD(HP_SYS_CLKRST.peri_clk_ctrl01, reg_emac_rx_clk_div_num, div);
674+
HAL_FORCE_MODIFY_U32_REG_FIELD(HP_SYS_CLKRST.peri_clk_ctrl01, reg_emac_tx_clk_div_num, div);
675675
}
676676

677677
/// use a macro to wrap the function, force the caller to use it in a critical section

components/hal/esp32p4/include/hal/etm_ll.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static inline bool etm_ll_is_channel_enabled(soc_etm_dev_t *hw, uint32_t chan)
106106
*/
107107
static inline void etm_ll_channel_set_event(soc_etm_dev_t *hw, uint32_t chan, uint32_t event)
108108
{
109-
hw->channel[chan].evt_id.evt_id = event;
109+
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->channel[chan].eid, evt_id, event);
110110
}
111111

112112
/**
@@ -118,7 +118,7 @@ static inline void etm_ll_channel_set_event(soc_etm_dev_t *hw, uint32_t chan, ui
118118
*/
119119
static inline void etm_ll_channel_set_task(soc_etm_dev_t *hw, uint32_t chan, uint32_t task)
120120
{
121-
hw->channel[chan].task_id.task_id = task;
121+
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->channel[chan].tid, task_id, task);
122122
}
123123

124124
/**

components/hal/esp32p4/include/hal/parlio_ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ static inline void parlio_ll_tx_reset_fifo(parl_io_dev_t *dev)
636636
__attribute__((always_inline))
637637
static inline void parlio_ll_tx_set_idle_data_value(parl_io_dev_t *dev, uint32_t value)
638638
{
639-
dev->tx_genrl_cfg.tx_idle_value = value;
639+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->tx_genrl_cfg, tx_idle_value, value);
640640
}
641641

642642
/**

components/hal/esp32p4/include/hal/ppa_ll.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,9 @@ static inline void ppa_ll_blend_configure_filling_block(ppa_dev_t *dev, color_pi
660660
*/
661661
static inline void ppa_ll_blend_set_rx_fg_fix_rgb(ppa_dev_t *dev, color_pixel_rgb888_data_t *rgb)
662662
{
663-
dev->blend_rgb.blend1_rx_b = rgb->b;
664-
dev->blend_rgb.blend1_rx_g = rgb->g;
665-
dev->blend_rgb.blend1_rx_r = rgb->r;
663+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->blend_rgb, blend1_rx_b, rgb->b);
664+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->blend_rgb, blend1_rx_g, rgb->g);
665+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->blend_rgb, blend1_rx_r, rgb->r);
666666
}
667667

668668
/*
@@ -682,13 +682,13 @@ static inline void ppa_ll_blend_set_rx_fg_fix_rgb(ppa_dev_t *dev, color_pixel_rg
682682
*/
683683
static inline void ppa_ll_blend_configure_rx_bg_ck_range(ppa_dev_t *dev, color_pixel_rgb888_data_t *rgb_thres_low, color_pixel_rgb888_data_t *rgb_thres_high)
684684
{
685-
dev->ck_bg_low.colorkey_bg_b_low = rgb_thres_low->b;
686-
dev->ck_bg_low.colorkey_bg_g_low = rgb_thres_low->g;
687-
dev->ck_bg_low.colorkey_bg_r_low = rgb_thres_low->r;
685+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_bg_low, colorkey_bg_b_low, rgb_thres_low->b);
686+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_bg_low, colorkey_bg_g_low, rgb_thres_low->g);
687+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_bg_low, colorkey_bg_r_low, rgb_thres_low->r);
688688

689-
dev->ck_bg_high.colorkey_bg_b_high = rgb_thres_high->b;
690-
dev->ck_bg_high.colorkey_bg_g_high = rgb_thres_high->g;
691-
dev->ck_bg_high.colorkey_bg_r_high = rgb_thres_high->r;
689+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_bg_high, colorkey_bg_b_high, rgb_thres_high->b);
690+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_bg_high, colorkey_bg_g_high, rgb_thres_high->g);
691+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_bg_high, colorkey_bg_r_high, rgb_thres_high->r);
692692
}
693693

694694
/**
@@ -700,13 +700,13 @@ static inline void ppa_ll_blend_configure_rx_bg_ck_range(ppa_dev_t *dev, color_p
700700
*/
701701
static inline void ppa_ll_blend_configure_rx_fg_ck_range(ppa_dev_t *dev, color_pixel_rgb888_data_t *rgb_thres_low, color_pixel_rgb888_data_t *rgb_thres_high)
702702
{
703-
dev->ck_fg_low.colorkey_fg_b_low = rgb_thres_low->b;
704-
dev->ck_fg_low.colorkey_fg_g_low = rgb_thres_low->g;
705-
dev->ck_fg_low.colorkey_fg_r_low = rgb_thres_low->r;
703+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_fg_low, colorkey_fg_b_low, rgb_thres_low->b);
704+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_fg_low, colorkey_fg_g_low, rgb_thres_low->g);
705+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_fg_low, colorkey_fg_r_low, rgb_thres_low->r);
706706

707-
dev->ck_fg_high.colorkey_fg_b_high = rgb_thres_high->b;
708-
dev->ck_fg_high.colorkey_fg_g_high = rgb_thres_high->g;
709-
dev->ck_fg_high.colorkey_fg_r_high = rgb_thres_high->r;
707+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_fg_high, colorkey_fg_b_high, rgb_thres_high->b);
708+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_fg_high, colorkey_fg_g_high, rgb_thres_high->g);
709+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_fg_high, colorkey_fg_r_high, rgb_thres_high->r);
710710
}
711711

712712
/**
@@ -717,9 +717,9 @@ static inline void ppa_ll_blend_configure_rx_fg_ck_range(ppa_dev_t *dev, color_p
717717
*/
718718
static inline void ppa_ll_blend_set_ck_default_rgb(ppa_dev_t *dev, color_pixel_rgb888_data_t *rgb)
719719
{
720-
dev->ck_default.colorkey_default_b = rgb->b;
721-
dev->ck_default.colorkey_default_g = rgb->g;
722-
dev->ck_default.colorkey_default_r = rgb->r;
720+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_default, colorkey_default_b, rgb->b);
721+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_default, colorkey_default_g, rgb->g);
722+
HAL_FORCE_MODIFY_U32_REG_FIELD(dev->ck_default, colorkey_default_r, rgb->r);
723723
}
724724

725725
/**

0 commit comments

Comments
 (0)