You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/09/17 18:28:40 UTC

[GitHub] ccollins476ad closed pull request #1404: Fill in missing `hf_erased_val` for some MCUs

ccollins476ad closed pull request #1404: Fill in missing `hf_erased_val` for some MCUs
URL: https://github.com/apache/mynewt-core/pull/1404
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/hw/drivers/flash/at45db/src/at45db.c b/hw/drivers/flash/at45db/src/at45db.c
index baa4dd0688..14e1d73e33 100644
--- a/hw/drivers/flash/at45db/src/at45db.c
+++ b/hw/drivers/flash/at45db/src/at45db.c
@@ -83,6 +83,7 @@ static struct at45db_dev at45db_default_dev = {
         .hf_size       = 8192 * 512,  /* FIXME: depends on page size */
         .hf_sector_cnt = 8192,
         .hf_align      = 0,
+        .hf_erased_val = 0xff,
     },
 
     /* SPI settings + updates baudrate on _init */
diff --git a/hw/drivers/flash/spiflash/src/spiflash.c b/hw/drivers/flash/spiflash/src/spiflash.c
index c8d5f94ca8..17486c4edd 100644
--- a/hw/drivers/flash/spiflash/src/spiflash.c
+++ b/hw/drivers/flash/spiflash/src/spiflash.c
@@ -86,6 +86,7 @@ struct spiflash_dev spiflash_dev = {
                          MYNEWT_VAL(SPIFLASH_SECTOR_SIZE),
         .hf_sector_cnt = MYNEWT_VAL(SPIFLASH_SECTOR_COUNT),
         .hf_align      = 1,
+        .hf_erased_val = 0xff,
     },
 
     /* SPI settings */
diff --git a/hw/mcu/nordic/nrf52xxx-compat/src/hal_flash.c b/hw/mcu/nordic/nrf52xxx-compat/src/hal_flash.c
index 50edd54d14..f7110831ae 100644
--- a/hw/mcu/nordic/nrf52xxx-compat/src/hal_flash.c
+++ b/hw/mcu/nordic/nrf52xxx-compat/src/hal_flash.c
@@ -49,7 +49,8 @@ const struct hal_flash nrf52k_flash_dev = {
     .hf_base_addr = 0x00000000,
     .hf_size = 1024 * 1024,	/* XXX read from factory info? */
     .hf_sector_cnt = 256,	/* XXX read from factory info? */
-    .hf_align = 1
+    .hf_align = 1,
+    .hf_erased_val = 0xff,
 };
 #elif defined(NRF52810_XXAA)
 const struct hal_flash nrf52k_flash_dev = {
@@ -57,7 +58,8 @@ const struct hal_flash nrf52k_flash_dev = {
     .hf_base_addr = 0x00000000,
     .hf_size = 192 * 1024,  /* XXX read from factory info? */
     .hf_sector_cnt = 48,   /* XXX read from factory info? */
-    .hf_align = 1
+    .hf_align = 1,
+    .hf_erased_val = 0xff,
 };
 #elif defined(NRF52832_XXAA)
 const struct hal_flash nrf52k_flash_dev = {
@@ -65,7 +67,8 @@ const struct hal_flash nrf52k_flash_dev = {
     .hf_base_addr = 0x00000000,
     .hf_size = 512 * 1024,	/* XXX read from factory info? */
     .hf_sector_cnt = 128,	/* XXX read from factory info? */
-    .hf_align = 1
+    .hf_align = 1,
+    .hf_erased_val = 0xff,
 };
 #else
 #error "Must define hal_flash struct for NRF52 type"
diff --git a/hw/mcu/nordic/nrf52xxx-compat/src/hal_qspi.c b/hw/mcu/nordic/nrf52xxx-compat/src/hal_qspi.c
index c779383255..2f50cf2442 100644
--- a/hw/mcu/nordic/nrf52xxx-compat/src/hal_qspi.c
+++ b/hw/mcu/nordic/nrf52xxx-compat/src/hal_qspi.c
@@ -92,7 +92,8 @@ const struct hal_flash nrf52k_qspi_dev = {
     .hf_base_addr = 0x00000000,
     .hf_size = MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT) * MYNEWT_VAL(QSPI_FLASH_SECTOR_SIZE),
     .hf_sector_cnt = MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT),
-    .hf_align = 1
+    .hf_align = 1,
+    .hf_erased_val = 0xff,
 };
 
 static int
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_flash.c b/hw/mcu/nordic/nrf52xxx/src/hal_flash.c
index e42a54028d..f7110831ae 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_flash.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_flash.c
@@ -58,7 +58,8 @@ const struct hal_flash nrf52k_flash_dev = {
     .hf_base_addr = 0x00000000,
     .hf_size = 192 * 1024,  /* XXX read from factory info? */
     .hf_sector_cnt = 48,   /* XXX read from factory info? */
-    .hf_align = 1
+    .hf_align = 1,
+    .hf_erased_val = 0xff,
 };
 #elif defined(NRF52832_XXAA)
 const struct hal_flash nrf52k_flash_dev = {
@@ -66,7 +67,8 @@ const struct hal_flash nrf52k_flash_dev = {
     .hf_base_addr = 0x00000000,
     .hf_size = 512 * 1024,	/* XXX read from factory info? */
     .hf_sector_cnt = 128,	/* XXX read from factory info? */
-    .hf_align = 1
+    .hf_align = 1,
+    .hf_erased_val = 0xff,
 };
 #else
 #error "Must define hal_flash struct for NRF52 type"
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_qspi.c b/hw/mcu/nordic/nrf52xxx/src/hal_qspi.c
index 7aa31ab1e4..2abb778e64 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_qspi.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_qspi.c
@@ -92,7 +92,8 @@ const struct hal_flash nrf52k_qspi_dev = {
     .hf_base_addr = 0x00000000,
     .hf_size = MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT) * MYNEWT_VAL(QSPI_FLASH_SECTOR_SIZE),
     .hf_sector_cnt = MYNEWT_VAL(QSPI_FLASH_SECTOR_COUNT),
-    .hf_align = 1
+    .hf_align = 1,
+    .hf_erased_val = 0xff,
 };
 
 static int


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services