spi_nor_parse_bfpt(9)
๐ spi_nor_parse_bfpt(9) โ like, the Kernel API Manual page, bestie โจ
okay so this is a page from the Kernel API Manual and it's about spi_nor_parse_bfpt โ which literally reads and parses the Basic Flash Parameter Table. yes that's a mouthful, we'll get there ๐
โจ NAME โจ
spi_nor_parse_bfpt โ read and parse the Basic Flash Parameter Table ๐
๐ธ SYNOPSIS ๐ธ
int spi_nor_parse_bfpt (struct spi_nor *nor , const struct
sfdp_parameter_header *bfpt_header );
like, it takes two things and returns an int, that's the whole vibe ๐ฆ
๐ ARGUMENTS ๐
norโ pointer to a'struct spi_nor'๐ซbfpt_headerโ pointer to the'struct sfdp_parameter_header'that's describing the Basic Flash Parameter Table's length and version ๐
๐ฅ DESCRIPTION ๐ฅ
okay so picture this: the Basic Flash Parameter Table is the main and only mandatory table as defined by the SFDP (JESD216) specification. like, it's the main character, there is no skipping it ๐
what it gives us:
- the total size (memory density) of the data array ๐
- the number of address bytes for Fast Read, Page Program and Sector Erase commands ๐งฎ
and for Fast READ commands, it also hands us the number of mode clock cycles and wait states โ all regrouped into the number of dummy clock cycles โ for each supported instruction op code โฑ๏ธโจ
for Page Program, the page size is now available since JESD216 rev A ๐ but the supported instruction op codes are still not provided, which is giving unfinished business ngl ๐
for Sector Erase commands, this table stores the supported instruction op codes and the associated sector sizes ๐๏ธ
and finally (yes there's more, she's thorough ๐ ): the Quad Enable Requirements (QER) are also available since JESD216 rev A. The QER bits encode the manufacturer dependent procedure that you have to execute to set the Quad Enable (QE) bit in some internal register of the Quad SPI memory ๐ง
fr fr โ the QE bit, when it exists, must be set before sending any Quad SPI command to the memory. no skipping ahead bestie ๐ญ
so what's actually happening when you set it? setting the QE bit tells the memory to reassign its WP# and HOLD#/RESET# pins to functions IO2 and IO3 โ hence enabling 4 (Quad) I/O lines ๐ slay.
โญ RETURN โญ
0 on success, -errno otherwise. that's it, that's the return ๐
๐ฆ SEE ALSO ๐ฆ
kernel file ./drivers/mtd/spi-nor/sfdp.c ๐ plus the whole friend group:
spi_nor_read_raw(9)spi_nor_read_sfdp(9)spi_nor_read_sfdp_dma_unsafe(9)spi_nor_set_erase_settings_from_bfpt(9)spi_nor_map_cmp_erase_type(9)spi_nor_sort_erase_mask(9)spi_nor_regions_sort_erase_types(9)spi_nor_smpt_addr_nbytes(9)spi_nor_smpt_read_dummy(9)spi_nor_get_map_in_use(9)spi_nor_region_check_overlay(9)spi_nor_init_non_uniform_erase_map(9)spi_nor_parse_smpt(9)spi_nor_parse_4bait(9)spi_nor_parse_profile1(9)spi_nor_parse_sccr(9)spi_nor_parse_sccr_mc(9)spi_nor_post_sfdp_fixups(9)spi_nor_check_sfdp_signature(9)spi_nor_parse_sfdp(9)
okay and before you go โ cute lil sign-off ๐ this page lives in ./drivers/mtd/spi-nor and it's dated October 2026. go read the source, ily, bye ๐ซถโจ
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms