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

[Feature Request] Add support for flash Winbond W25N01GV #314

Closed
et-ness opened this issue Jan 20, 2024 · 1 comment
Closed

[Feature Request] Add support for flash Winbond W25N01GV #314

et-ness opened this issue Jan 20, 2024 · 1 comment

Comments

@et-ness
Copy link

et-ness commented Jan 20, 2024

I'd like to try this flash but I saw that there is no flashrom support, is it possible to add it?
At the moment I don't physically have a flash, I should have one soon so I can try.
In the meantime I developed this patch for flashrom is it ok?

Patch
diff --git a/flashchips.c b/flashchips.c
index 663b01b2..7abb95b4 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -20317,6 +20317,50 @@ const struct flashchip flashchips[] = {
                .decode_range   = DECODE_RANGE_SPI25,
        },
 
+       {
+               .vendor         = "Winbond",
+               .name           = "W25N01GV",
+               .bustype        = BUS_SPI,
+               .manufacture_id = WINBOND_NEX_ID,
+               .model_id       = WINBOND_NEX_W25N01GV,
+               .total_size     = 131072,
+               .page_size      = 256,
+               .feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP,
+               .tested         = TEST_UNTESTED,
+               .probe          = PROBE_SPI_RDID,
+               .probe_timing   = TIMING_ZERO,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {4 * 1024, 32768} },
+                               .block_erase = SPI_BLOCK_ERASE_21,
+                       }, {
+                               .eraseblocks = { {4 * 1024, 32768} },
+                               .block_erase = SPI_BLOCK_ERASE_20,
+                       }, {
+                               .eraseblocks = { {32 * 1024, 4096} },
+                               .block_erase = SPI_BLOCK_ERASE_5C,
+                       }, {
+                               .eraseblocks = { {32 * 1024, 4096} },
+                               .block_erase = SPI_BLOCK_ERASE_52,
+                       }, {
+                               .eraseblocks = { {64 * 1024, 2048} },
+                               .block_erase = SPI_BLOCK_ERASE_DC,
+                       }, {
+                               .eraseblocks = { {64 * 1024, 2048} },
+                               .block_erase = SPI_BLOCK_ERASE_D8,
+                       }, {
+                               .eraseblocks = { {65536 * 1024, 2} },
+                               .block_erase = SPI_BLOCK_ERASE_C4,
+                       }
+               },
+               .printlock      = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN,
+               .unlock         = SPI_DISABLE_BLOCKPROTECT,
+               .write          = SPI_CHIP_WRITE256, /* Multi I/O supported */
+               .read           = SPI_CHIP_READ,
+               .voltage        = {2700, 3600},
+       },
+
        /* W29EE011, W29EE012, W29C010M, W29C011A do not support probe_jedec according to the datasheet, but it works for newer(?) steppings. */
        {
                .vendor         = "Winbond",
diff --git a/include/flashchips.h b/include/flashchips.h
index d676cda4..fb7abae6 100644
--- a/include/flashchips.h
+++ b/include/flashchips.h
@@ -1007,6 +1007,7 @@
 #define WINBOND_NEX_W25Q128_DTR        0x8018  /* W25Q128JW_DTR */
 #define WINBOND_NEX_W25Q256_DTR        0x8019  /* W25Q256JW_DTR aka W25Q256256JW-IM */
 #define WINBOND_NEX_W25Q512NW_IM       0x8020 /* W25Q512NW-IM */
+#define WINBOND_NEX_W25N01GV   0xAA21  /* W25N01GV */
 
 #define WINBOND_ID             0xDA    /* Winbond */
 #define WINBOND_W19B160BB      0x49

I didn't understand if the FEATURE_WRSR_WREN feature bit can be enabled for these flashes.
Do I need to set the reg_bits?
I don't want to be unprepared when I get to try this flash.

Copy link

Thank you for your contribution. The flashrom project does not handle GitHub issues or pull requests, since this repository on GitHub is just a mirror of our actual repository. Thus, we would like to encourage you to have a look at on our development guide and submit your patch to review.coreboot.org. Issues are handled over our ticket system. If you have questions, feel free to reach out to us. There are multiple ways to contact us.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant