Shanks0224 opened a new pull request, #22608:
URL: https://github.com/apache/nuttx/pull/22608

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   Depends on #INCLUDES_PR: only the last commit belongs to this PR (it
   touches the same lines of `esp32_spiflash.c`).
   
   ## Summary
   
   The SPI flash code of ESP32 and ESP32-S3 keeps the cache state, the
   "scheduler suspended" flag and the semaphore that parks the other CPU in
   arrays indexed by the CPU number.  Define them with
   `DEFINE_PER_CPU_BSS_SMP()` and access them with `per_cpu_var_smp()`
   instead (`include/nuttx/percpu.h`), so that they follow the PERCPU
   configuration like the other per-CPU data.  With the default PERCPU_ARRAY
   the generated code does not change.
   
   The existing nxstyle errors (missing blank lines after declarations) in
   `esp32s3_spiflash.c` are fixed too.
   
   ## Impact
   
   ESP32 and ESP32-S3 SPI flash code.  No change in the generated code with
   the default per-CPU implementation.
   
   ## Testing
   
   xtensa-esp-elf 14.2.0, esp32s3-devkit:psram_octal +
   `CONFIG_ESP32S3_SPIFLASH=y`, single core and with
   `CONFIG_SMP=y CONFIG_SMP_NCPUS=2`, and esp32s3-devkit:psram_usrheap +
   `CONFIG_ESP32S3_SPIFLASH=y CONFIG_SMP=y`: builds without warnings, and the
   disassembly of `esp32s3_spiflash.o` and `esp32s3_spiflash_mtd.o` is
   identical without and with this commit (898 lines single core, 1074 lines
   SMP for `esp32s3_spiflash.o`).
   
   esp32-devkitc:nsh, esp32-devkitc:smp, esp32s2-saola-1:nsh,
   esp32s3-devkit:nsh and esp32s3-devkit:smp build without warnings.
   
   The ESP32 files could not be built: `esp32_spiflash.c` needs
   `CONFIG_ESP32_PARTITION_TABLE` together with `CONFIG_ESP32_SPIFLASH`,
   which fails `make olddefconfig` on master too (`CONFIG_ESP32_SPIFLASH`
   selects `CONFIG_ESPRESSIF_SPIFLASH`, which depends on
   `!ESP32_PARTITION_TABLE`), and `esp32_spicache.c` is not in any
   Make.defs or CMakeLists.txt.
   
   Not tested on real hardware.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to