Commit Graph

221 Commits

Author SHA1 Message Date
Gustavo Henrique Nihei
459ebff4ff esp_hw_support: Fix check for SOC_MODEM_CLOCK_IS_INDEPENDENT definition
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-16 01:50:22 +08:00
Jiang Jiang Jian
abc43d8e94 Merge branch 'bugfix/some_small_fix_for_sleep' into 'master'
esp_hw_support/sleep: update soc caps for chips that support power down modem

Closes WIFI-4424

See merge request espressif/esp-idf!20198
2023-03-13 10:47:26 +08:00
jingli
cb0f517fe3 soc/soc_caps: update soc caps for chips that support power-down of modem hardware
Closes WIFI-4424
2023-03-10 14:15:27 +08:00
Nachiket Kukade
4c76af3f68 esp_wifi: Add support for NAN Discovery and Datapath
Update wifi lib with below -
1. Create NAN Discovery SM for beaconing & cluster formation
2. Create NAN interface for Tx/Rx of beacons & action frames
3. Add commands & events for NAN Services Publish/Subscribe/Followup
4. Add NAN Datapath definitions, Events, Peer structures
5. Support for forming and parsing of Datapath related attributes
6. Modules for NDP Req, Resp, Confirm, Term, Peer management
7. NAN Interface related additions in Datapath, Data Tx Q's

In addition include below changes -
1. Add netif and driver support for NAN Interface
2. Add simple examples for Publisher-Subscriber usecases
3. Add an advanced console example that supports commands
   for NAN Discovery, Services & Datapath
4. Add wifi_apps for providing better NAN API's and Peer management

Co-authored-by: Shyamal Khachane <shyamal.khachane@espressif.com>
2023-03-10 11:18:23 +05:30
Li Shuai
1a10eabe41 Power Management: refactor the configuration of each module in sleep mode 2023-03-04 00:17:40 +08:00
Li Shuai
200f69e6eb auto beacon: support esp32c6 autobeacon (advanced DTIM sleep feature)
modem retention: Support esp32c6 wifi MAC and baseband sleep retention

sleep_modem: wifi MAC modem wakeup protect in modem state before PMU trigger sleep enable request

sleep modem: provide a interface to get whether the Modem power domain is allowed to power off during sleep

add i2c_ana master header file to project

auto beacon: release PMU's lock on root clock source (it is locked in the PLL)

wifi receiving beacon frame in PMU modem state strongly depends on the BBPLL
clock, PMU will forcibly lock the root clock source as PLL, when the root
clock source of the software system is selected as PLL, we need to release
the root clock source locking.

When it is judged that the PLL is locked by PMU after wakeing up from the PMU
modem state, switch the root clock source to the PLL in the sleep process (a
critical section).

auto beacon: fix the failure to receive broadcast/multicast frames in modem state

When the multicast field in the beacon frame received in the PMU modem state is
True, the PMU switches to the PMU active state (the PMU waits for the HP LDO to
stabilize and then restores the MAC context) and starts to receive
broadcast/multicast frames (Broadcast/Multicast frames will be sent after a
minimum delay of 48 us after the beacon frame), because the PMU waits for the HP
LDO to stabilize too long (~154 us), which will cause broadcast/multicast frame
reception to be missed.

auto beacon: select the PLL clock source as the REGDMA backup clock source when the PMU switches to ACTIVE from MODEM state

update Digital Peripheral (M2A switch) REGDMA restore time parameter

auto beacon: fix the issue that only channel 1 can connect to AP in modem state
2023-03-04 00:17:40 +08:00
Li Shuai
93c02fed3b light sleep: add modem power domain and power down the modem power domain during sleep 2023-03-04 00:17:40 +08:00
Li Shuai
3a5fe2ab63 light sleep: rename sleep mac bb to modem, it includes MAC and baseband of wifi, bt and ieee802.15.4 modules 2023-03-04 00:17:40 +08:00
wuzhenghui
186da9af93 codeclean: rename sleep_periph to sleep_sys_periph 2023-03-04 00:17:40 +08:00
wuzhenghui
7ee64bd8e8 refactor: always jump to wake stub wrapper after wakeup 2023-03-02 18:10:06 +08:00
wuzhenghui
9eae151f7c esp32c6: bringup deepsleep examples 2023-03-02 15:06:05 +08:00
wuzhenghui
d3ec7880fe bugfix: support GPIO current leakage workaround for esp32c6/esp32h2 2023-03-02 15:06:05 +08:00
wuzhenghui
709adaaa37 soc_caps: since esp32c6 only support one ext wakeup src, split SOC_PM_SUPPORT_EXT_WAKEUP
Close IDF-5924
2023-03-02 15:06:05 +08:00
Song Ruo Jing
1a66459b44 usb_serial_jtag: Improve the code for the issue of usb cdc device unable to work during sleep
1. Remove RTC_CLOCK_BBPLL_POWER_ON_WITH_USB Kconfig option
   During sleep, BBPLL clock always gets disabled
   esp_restart does not disable BBPLL clock, so that first stage bootloader log can be printed
2. Add a new Kconfig option PM_NO_AUTO_LS_ON_USJ_CONNECTED
   When this option is selected, IDF will constantly monitor USB CDC port connection status.
   As long as it gets connected to a HOST, automatic light-sleep will not happen.

Closes https://github.com/espressif/esp-idf/issues/8507
2023-02-27 12:10:49 +08:00
Armando
b96c370ab8 esp_hw_support: move driver/intr_types.h to esp_hw_support to make it available to all g1+ components 2023-02-15 19:52:06 +08:00
wuzhenghui
248aa6109d codeclean: add sleep_mode args to esp_sleep_start() 2023-02-15 11:46:40 +08:00
Li Shuai
aec3f6db1d light sleep: supported SoC TOP domain powered down 2023-02-15 11:46:40 +08:00
Li Shuai
6e307c04a3 clock retention: supported soc and modem system power and clock sleep retention 2023-02-15 11:46:40 +08:00
fuzhibo@espressif.com
e252748d92 periph retention: runtime critical digital peripherals sleep retention support 2023-02-15 11:46:40 +08:00
Li Shuai
d097bbe40b sleep retention: wraps the regdma link and hardware driver to provide system sleep retention (WiFi, BLE, 15.4 and digital peripheral) support 2023-02-15 11:46:40 +08:00
Li Shuai
8c18393d23 regdma: add regdma link operation api support 2023-02-15 11:46:36 +08:00
Li Shuai
d3e0e3e3b6 pau: implement the pau regdma driver for esp32c6 2023-02-15 10:45:44 +08:00
jingli
557a1ed1a5 soc_caps: remove SOC_GPIO_SUPPORT_SLP_SWITCH
all esp chips support this feature
2023-02-11 01:06:18 +00:00
Wu Zheng Hui
33ae2e1073 Merge branch 'feature/bringup_esp32c6_light_sleep_pd_cpu' into 'master'
esp32c6: support light_sleep (Stage 1: support CPU power down)

See merge request espressif/esp-idf!21985
2023-02-01 14:11:15 +08:00
Li Shuai
9b99fc9033 cpu retention: software cpu retention support for esp32c6
cpu retention: add riscv core sleep critical and non-critical register layout structure definition

cpu retention: add assembly subroutine for cpu critical register backup and restore

cpu retention: add cpu core critical register context backup and restore support

cpu retention: add cpu core non-critical register context backup and restore support

cpu retention: add interrupt priority register context backup and restore support

cpu retention: add cache config register context backup and restore support

cpu retention: add plic interrupt register context backup and restore support

cpu retention: add clint interrupt register context backup and restore support

cpu retention: wait icache state idle before pmu enter sleep
2023-01-31 22:12:54 +08:00
Li Shuai
1c39d64f95 cpu retention: refactor cpu retention and add cpu retention versions option in soc caps 2023-01-31 22:12:50 +08:00
Li Shuai
2b5618606b pmu: clean modem clock pmu related code 2023-01-31 22:12:27 +08:00
Li Shuai
59cf87fe7d pmu: sleep initialization and sleep start support for esp32c6
Initialize the pmu sleep machine constant when pmu is initialized, and calculate
the pmu sleep time adjustment value and hardware configuration value according
to the machine constant during system sleep.

Calibrate fast OSC before each sleep and use the calibration value to calculate
PMU hardware wait cycles when use the fast OSC as the work clock.
2023-01-31 22:12:27 +08:00
morris
dbca74f1ef gdma: prevent mutli-channels connect to the same peripheral
1. add check in the gdma driver, to prevent multiple channels connecting
   to the same peripheral
2. memory copy DMA ID will occupy the peripheral's DMA ID on some ESP
   targets (e.g. esp32c3/s3). We should search for a free one when
install async memcpy driver.

Closes https://github.com/espressif/esp-idf/issues/10575
2023-01-31 15:18:19 +08:00
Mahavir Jain
8203d40fc3
esp32h2: add support for SHA peripheral
Closes IDF-6275
2023-01-30 10:08:58 +05:30
Guillaume Souchere
a5d6f62e7e heap: Prevent alloc from IRAM to call dram_alloc_to_iram() on esp32c6 target
Since DRAM and IRAM are superposed on esp32c6 it is not necessary to convert a freshly allocated
DRAM addr to its IRAM equivalent when MALLOC_CAP_EXEC is passed to heap_caps_malloc(). Instead,
proceed with a default allocation since the address returned by multi_heap_malloc() already belongs
to the IRAM region.

Applies for esp32c6 and every boards with superposed DRAM and IRAM addresses.
2023-01-23 07:42:20 +01:00
Song Ruo Jing
2c9aa4559c clk_tree: Add a general API to get the frequency of different clocks
Add basic clk_tree driver and hal implementation.
2023-01-17 11:30:24 +08:00
Armando (Dou Yiwen)
d1b8da74d8 Merge branch 'refactor/improve_adc_power_maintanance' into 'master'
adc: improve adc power maintanance

Closes IDF-6114 and IDF-6318

See merge request espressif/esp-idf!21151
2023-01-12 20:30:36 +08:00
morris
f7c3d791a2 Merge branch 'feature/systimer_support_esp32h2' into 'master'
systimer: assign counter and alarm in esp_hw_support

Closes IDF-6484, IDF-5323, and IDF-6230

See merge request espressif/esp-idf!21984
2023-01-12 11:01:17 +08:00
morris
1f3507eac0 Merge branch 'feature/gdma_support_h2' into 'master'
gdma: support esp32h2

Closes IDF-6222 and IDF-6238

See merge request espressif/esp-idf!21932
2023-01-11 14:04:14 +08:00
morris
6c1d98d556 systimer: assign counter and alarm in esp_hw_support 2023-01-10 17:05:49 +08:00
jiangguangming
51ec91c637 add example deep sleep wake stub 2023-01-10 17:03:50 +08:00
morris
d0b7f3214a gdma: correct the dma trigger of uart
GDMA trigger actually is not assigned to UART controller, but for UHCI
controller
2023-01-10 16:37:01 +08:00
Armando
5be3c21cfc adc: improve power logic 2023-01-09 17:10:04 +08:00
Armando
b46cfd15a2 mspi: move timing tuning to esp_hw_support 2023-01-06 14:41:20 +08:00
morris
cb7e957cc4 Merge branch 'feature/io_mux_use_pll80_c6' into 'master'
io_mux: support change clock source to PLL_F80M

Closes IDF-6342 and IDF-6345

See merge request espressif/esp-idf!21613
2022-12-29 22:06:52 +08:00
morris
672ac58ad5 io_mux: can set different clock source 2022-12-29 14:46:16 +08:00
Cao Sen Miao
4713a9a7f2 ESP32H2: Introduce new chip target esp32h2, hello_world example supported 2022-12-29 12:29:14 +08:00
Li Shuai
63af1e9631 modem clock(driver): implemented the modem clock driver for esp32c6 2022-12-27 21:31:59 +08:00
wuzhenghui
aa20825659 soc_caps: rename ESP_PD_DOMAIN_RTC8M to ESP_PD_DOMAIN_FOSC 2022-12-27 21:31:21 +08:00
Li Shuai
17f9285524 esp32c6: add SOC_MODEM_CLOCK_IS_INDEPENDENT soc_cap and more pd_caps 2022-12-27 21:31:21 +08:00
Mahavir Jain
078835e358 Merge branch 'contrib/github_pr_10391' into 'master'
[Docs] specify Digital Signature byte order, and esp_ds_sign() clarification (GitHub PR)

Closes IDFGH-8978

See merge request espressif/esp-idf!21712
2022-12-21 13:59:00 +08:00
Chip Weinberger
d43dd9246f [Docs] specify Digital Signature byte order, and esp_ds_sign() clarification 2022-12-19 21:30:03 -08:00
morris
7064b668c6 Merge branch 'feature/etm_api_update' into 'master'
etm: introduce config structure for event/task new functions

See merge request espressif/esp-idf!21483
2022-12-12 13:12:09 +08:00
Jakob Hasse
b36c0e823f Merge branch 'feature/linux_esp_hw_support' into 'master'
linux target: add support for building esp_hw_support, soc and hal components for linux target

See merge request espressif/esp-idf!21502
2022-12-12 09:59:31 +08:00