Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E404X] Determine flash part at runtime #2456

Merged
merged 22 commits into from
Jun 16, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4bd610d
Detect different MXIC and GIGA device flash types at runtime
scott-brust May 24, 2022
5e2674d
Read/write all 3kb of GD25 OTP registers. Add hal func for OTP size
scott-brust May 26, 2022
ff24081
Add GD25 chip ID
scott-brust May 31, 2022
58939b2
hal: fixes qspi re-initializing issue
Jun 2, 2022
30d7e8b
hal: fixes the issue that write/read special register would fail occa…
Jun 2, 2022
d493b5d
add delays on OTP special operations
tstellanova Jun 3, 2022
6c84773
hal: use cpp file for the external flash driver
Jun 7, 2022
5d64278
hal: fixes errors from c to cpp conversion
Jun 7, 2022
3ade2c5
hal: rework exflash driver
Jun 8, 2022
3be0104
hal: use raw api to get flash id
Jun 8, 2022
6e6497f
hal: exflash minor fixes
Jun 8, 2022
881b3a7
hal: format: move static functions to anonymous namespace
Jun 8, 2022
61ab1fa
hal: minor: fixes mx25 memory type
Jun 9, 2022
31c88c4
hal: exflash fix OTP read/write across register boundaries
scott-brust Jun 10, 2022
81542c9
hal: exflash Use GD25 wake command if read_id fails during init
scott-brust Jun 11, 2022
801d00b
hal: handle the special states of flash
Jun 13, 2022
a0b0814
hal: format: reverse GD25_OTP_SECTOR_SIZE and GD25_SECURITY_REGISTER_…
Jun 13, 2022
2f81e4c
hal: fixes style, check and other minor fixes
Jun 13, 2022
242b0ee
hal: add default flash type to support at least standard flash commands
Jun 13, 2022
7572e9d
hal: remove API hal_exflash_otp_size()
Jun 13, 2022
283a15a
hal: refactor: get otp size. Use read/write opcodes instead of NRF va…
scott-brust Jun 13, 2022
5dcae49
hal: review feedback
scott-brust Jun 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bootloader/src/nRF52840/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ CPPSRC += $(call target_files,$(BOOTLOADER_SRC_PATH)/,*.cpp)

CSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,flash_hal.c)
CPPSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/shared/,flash_common.cpp)
CSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,exflash_hal.c)
CPPSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,exflash_hal.cpp)
CPPSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,exflash_hal_lock.cpp)
CPPSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,exflash_hal_params.cpp)
CSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,rgbled_hal.c)
CSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,watchdog_hal.c)
CSRC += $(call target_files,$(BOOTLOADER_MODULE_PATH)/../hal/src/nRF52840/,pinmap_hal.c)
Expand Down
4 changes: 3 additions & 1 deletion hal/inc/exflash_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ typedef enum hal_exflash_command_t {
HAL_EXFLASH_COMMAND_SLEEP = 2,
HAL_EXFLASH_COMMAND_WAKEUP = 3,
HAL_EXFLASH_COMMAND_SUSPEND_PGMERS = 4,
HAL_EXFLASH_COMMAND_RESET = 5
HAL_EXFLASH_COMMAND_RESET = 5,
HAL_EXFLASH_COMMAND_READID = 6,
} hal_exflash_command_t;

typedef enum hal_exflash_state_t {
Expand All @@ -55,6 +56,7 @@ int hal_exflash_read(uintptr_t addr, uint8_t* data_buf, size_t data_size);
int hal_exflash_copy_sector(uintptr_t src_addr, size_t dest_addr, size_t data_size);
int hal_exflash_lock(void);
int hal_exflash_unlock(void);
int hal_exflash_otp_size(void);
scott-brust marked this conversation as resolved.
Show resolved Hide resolved

int hal_exflash_read_special(hal_exflash_special_sector_t sp, uintptr_t addr, uint8_t* data_buf, size_t data_size);
int hal_exflash_write_special(hal_exflash_special_sector_t sp, uintptr_t addr, const uint8_t* data_buf, size_t data_size);
Expand Down
8 changes: 0 additions & 8 deletions hal/inc/hal_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,6 @@
#define HAL_PLATFORM_GEN (PLATFORM_GEN)
#endif // HAL_PLATFORM_GEN

#ifndef HAL_PLATFORM_FLASH_MX25R6435FZNIL0
#define HAL_PLATFORM_FLASH_MX25R6435FZNIL0 (0)
#endif // HAL_PLATFORM_FLASH_MX25R6435FZNIL0

#ifndef HAL_PLATFORM_FLASH_MX25L3233F
#define HAL_PLATFORM_FLASH_MX25L3233F (0)
#endif // HAL_PLATFORM_FLASH_MX25L3233F

#ifndef HAL_PLATFORM_IO_EXTENSION
#define HAL_PLATFORM_IO_EXTENSION (0)
#endif // HAL_PLATFORM_IO_EXTENSION
Expand Down
2 changes: 0 additions & 2 deletions hal/src/argon/hal_platform_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#define HAL_PLATFORM_RADIO_ANTENNA_INTERNAL (1)
#define HAL_PLATFORM_RADIO_ANTENNA_EXTERNAL (1)
#define HAL_PLATFORM_FLASH_MX25L3233F (1)

#else // PLATFORM_ID != PLATFORM_ARGON

Expand All @@ -33,6 +32,5 @@
#define HAL_PLATFORM_POWER_MANAGEMENT_OPTIONAL (1)
#define HAL_PLATFORM_PMIC_BQ24195_FAULT_COUNT_THRESHOLD (4)
#define HAL_PLATFORM_RADIO_ANTENNA_EXTERNAL (1)
#define HAL_PLATFORM_FLASH_MX25L3233F (1)

#endif // PLATFORM_ID == PLATFORM_ARGON
1 change: 0 additions & 1 deletion hal/src/b5som/hal_platform_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#define HAL_PLATFORM_POWER_MANAGEMENT_OPTIONAL (1)
#define HAL_PLATFORM_PMIC_BQ24195_FAULT_COUNT_THRESHOLD (4)
#define HAL_PLATFORM_RADIO_ANTENNA_EXTERNAL (1)
#define HAL_PLATFORM_FLASH_MX25R6435FZNIL0 (1)
#define HAL_PLATFORM_MAX_CLOUD_CONNECT_TIME (9*60*1000)

#define PRODUCT_SERIES "boron"
Loading