-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the new SPI flash memory chip (BY25Q32).
PineStore notified the community that the SPI flash memory chip (XTX XT25F32B) used in the PineTime was EoL (End-Of-Life) and will be replaced by another chip (BY25Q32). Since we want to provide a new version of the firmware (bootloader + application) in a short time frame to avoid the production of the next batch of PineTime being delayed, we did our best to add support for the new chip by doing the smallest and less risky changes possible. The version of MyNewt this project is based on (1.8.0) do not support any of the memory chips out of the box. The current version defines the JEDEC IDs in the [NRF52 "BSP"](hw/bsp/nrf52/syscfg.yml). The downside of this way of specifying the IDs of the chip is that you can only define a single chip. Newer versions of MyNewt allow to ignore the ID, but this is not available in our version. These changes patches the spiflash driver of MyNewt to add support for both memory chip, and enable them so that the system checks for both IDs at startup.
- Loading branch information
Showing
3 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Subject: [PATCH] spi chip update | ||
--- | ||
Index: hw/drivers/flash/spiflash/chips/syscfg.yml | ||
IDEA additional info: | ||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | ||
<+>UTF-8 | ||
=================================================================== | ||
diff --git a/hw/drivers/flash/spiflash/chips/syscfg.yml b/hw/drivers/flash/spiflash/chips/syscfg.yml | ||
--- a/hw/drivers/flash/spiflash/chips/syscfg.yml | ||
+++ b/hw/drivers/flash/spiflash/chips/syscfg.yml | ||
@@ -491,3 +491,9 @@ | ||
SPIFLASH_EON2580B: | ||
description: Add support for EON2580B | ||
value: 0 | ||
+ SPIFLASH_XTX25F32B: | ||
+ description: Add support for XTX25F32B | ||
+ value: 1 | ||
+ SPIFLASH_BY25Q32: | ||
+ description: Add support for BY25Q32 | ||
+ value: 1 | ||
Index: hw/drivers/flash/spiflash/src/spiflash.c | ||
IDEA additional info: | ||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | ||
<+>UTF-8 | ||
=================================================================== | ||
diff --git a/hw/drivers/flash/spiflash/src/spiflash.c b/hw/drivers/flash/spiflash/src/spiflash.c | ||
--- a/hw/drivers/flash/spiflash/src/spiflash.c | ||
+++ b/hw/drivers/flash/spiflash/src/spiflash.c | ||
@@ -565,7 +565,12 @@ | ||
#if MYNEWT_VAL(SPIFLASH_EON2580B) | ||
EON_CHIP(EN80B, 0x30, FLASH_CAPACITY_8MBIT), | ||
#endif | ||
- | ||
+#if MYNEWT_VAL(SPIFLASH_XTX25F32B) | ||
+ STD_FLASH_CHIP("", 0x0b, 0x40, 0x16, spiflash_release_power_down_generic), | ||
+#endif | ||
+#if MYNEWT_VAL(SPIFLASH_BY25Q32) | ||
+ STD_FLASH_CHIP("", 0x16, 0x40, 0x16, spiflash_release_power_down_generic), | ||
+#endif | ||
{ {0} }, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters