This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 1f75825  hw/drivers/flash/spiflash: add JEDEC_MFC_XTX and XT25F32B chip
1f75825 is described below

commit 1f7582504bbceba180d27df432260523f343d05f
Author: Ildar Mulyukov <il...@altlinux.ru>
AuthorDate: Sun Mar 14 19:08:25 2021 +0600

    hw/drivers/flash/spiflash: add JEDEC_MFC_XTX and XT25F32B chip
    
    for PineTime smart watch
---
 hw/drivers/flash/spiflash/chips/syscfg.yml            | 3 +++
 hw/drivers/flash/spiflash/include/spiflash/spiflash.h | 1 +
 hw/drivers/flash/spiflash/src/spiflash.c              | 5 +++++
 3 files changed, 9 insertions(+)

diff --git a/hw/drivers/flash/spiflash/chips/syscfg.yml 
b/hw/drivers/flash/spiflash/chips/syscfg.yml
index ac576e5..a07cd8c 100644
--- a/hw/drivers/flash/spiflash/chips/syscfg.yml
+++ b/hw/drivers/flash/spiflash/chips/syscfg.yml
@@ -500,3 +500,6 @@ syscfg.defs:
     SPIFLASH_EON2580B:
         description: Add support for EON2580B
         value: 0
+    SPIFLASH_XT25F32B:
+        description: Add support for XT25F32B
+        value: 0
diff --git a/hw/drivers/flash/spiflash/include/spiflash/spiflash.h 
b/hw/drivers/flash/spiflash/include/spiflash/spiflash.h
index da9e070..0e139af 100644
--- a/hw/drivers/flash/spiflash/include/spiflash/spiflash.h
+++ b/hw/drivers/flash/spiflash/include/spiflash/spiflash.h
@@ -126,6 +126,7 @@ struct spiflash_chip {
 #define JEDEC_MFC_MICROCHIP         0xBF
 #define JEDEC_MFC_ADESTO            0x1F
 #define JEDEC_MFC_EON               0x1C
+#define JEDEC_MFC_XTX               0x0B
 
 #define FLASH_CAPACITY_256KBIT      0x09
 #define FLASH_CAPACITY_512KBIT      0x10
diff --git a/hw/drivers/flash/spiflash/src/spiflash.c 
b/hw/drivers/flash/spiflash/src/spiflash.c
index 1c2dbea..266c439 100644
--- a/hw/drivers/flash/spiflash/src/spiflash.c
+++ b/hw/drivers/flash/spiflash/src/spiflash.c
@@ -84,6 +84,8 @@ static void spiflash_release_power_down_generic(struct 
spiflash_dev *dev) __attr
     STD_FLASH_CHIP(name, JEDEC_MFC_ADESTO, typ, cap, 
spiflash_release_power_down_generic)
 #define EON_CHIP(name, typ, cap) \
     STD_FLASH_CHIP(name, JEDEC_MFC_EON, typ, cap, 
spiflash_release_power_down_generic)
+#define XTX_CHIP(name, typ, cap) \
+    STD_FLASH_CHIP(name, JEDEC_MFC_XTX, typ, cap, 
spiflash_release_power_down_generic)
 
 static struct spiflash_chip supported_chips[] = {
 #if MYNEWT_VAL(SPIFLASH_MANUFACTURER) && MYNEWT_VAL(SPIFLASH_MEMORY_TYPE) && 
MYNEWT_VAL(SPIFLASH_MEMORY_CAPACITY)
@@ -574,6 +576,9 @@ static struct spiflash_chip supported_chips[] = {
 #if MYNEWT_VAL(SPIFLASH_EON2580B)
     EON_CHIP(EN80B, 0x30, FLASH_CAPACITY_8MBIT),
 #endif
+#if MYNEWT_VAL(SPIFLASH_XT25F32B)
+    XTX_CHIP(XT25F32B, 0x40, FLASH_CAPACITY_32MBIT),
+#endif
 
     { {0} },
 };

Reply via email to