mtd: spi-nor-core: Add support for s28hl512t, s28hl01gt, and s28hs01gt
cover mtd: spi-nor-core: Add support for s28hl512t, s28hl01gt, and s28hs01gt
From: Takahiro Kuwano <[email protected]>
These devices are variants of s28hs512t(1.8V 512Mb) with different density(1Gb) and power supply voltage(3V).
Tested on Zynq-7000 platform with Infineon SPI controller
Takahiro Kuwano (3):
mtd: spi-nor-core: Rename s28hs512t prefix
mtd: spi-nor-core: Rename configuration macro for S28 support
mtd: spi-nor-ids: Add s28hl512t, s28hl01gt, and s28hs01gt IDs
configs/j721s2_evm_a72_defconfig | 2 +- configs/j721s2_evm_r5_defconfig | 2 +- drivers/mtd/spi/Kconfig | 10 +++---- drivers/mtd/spi/spi-nor-core.c | 48 +++++++++++++++++--------------- drivers/mtd/spi/spi-nor-ids.c | 5 +++- 5 files changed, 36 insertions(+), 31 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/3 mtd: spi-nor-core: Rename s28hs512t prefix
From: Takahiro Kuwano <[email protected]>
Change prefix to support all other devices in SEMPER S28 family.
--- drivers/mtd/spi/spi-nor-core.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/mtd/spi/spi-nor-core.c +17 -17
@@ -3369,15 +3369,15 @@ static int spi_nor_cypress_octal_dtr_enable(struct spi_nor *nor)return 0 ; } -static int s28hs512t_erase_non_uniform (struct spi_nor *nor,loff_t addr) +static int s28hx_t_erase_non_uniform (struct spi_nor *nor,loff_t addr) {/* Factory default configuration: 32 x 4 KiB sectors at bottom. */ return spansion_erase_non_uniform (nor, addr,SPINOR_OP_S28_SE_4K ,0 ,SZ_128K ); } -static int s28hs512t_setup (struct spi_nor *nor,const struct flash_info *info, -const struct spi_nor_flash_parameter *params) +static int s28hx_t_setup (struct spi_nor *nor,const struct flash_info *info, +const struct spi_nor_flash_parameter *params) {struct spi_mem_op op;u8 buf;
@@ -3404,19 +3404,19 @@ static int s28hs512t_setup(struct spi_nor *nor, const struct flash_info *info,return ret;if (!(buf &SPINOR_REG_CYPRESS_CFR3V_UNISECT )) - nor->erase = s28hs512t_erase_non_uniform; + nor->erase = s28hx_t_erase_non_uniform;return spi_nor_default_setup (nor, info, params); } -static void s28hs512t_default_init (struct spi_nor *nor) +static void s28hx_t_default_init (struct spi_nor *nor) { nor->octal_dtr_enable = spi_nor_cypress_octal_dtr_enable; - nor->setup = s28hs512t_setup; + nor->setup = s28hx_t_setup; } -static void s28hs512t_post_sfdp_fixup (struct spi_nor *nor, -struct spi_nor_flash_parameter *params) +static void s28hx_t_post_sfdp_fixup (struct spi_nor *nor, +struct spi_nor_flash_parameter *params) {/* * On older versions of the flash the xSPI Profile 1.0 table has the
@@ -3446,10 +3446,10 @@ static void s28hs512t_post_sfdp_fixup(struct spi_nor *nor, params->rdsr_addr_nbytes =4 ; } -static int s28hs512t_post_bfpt_fixup (struct spi_nor *nor, -const struct sfdp_parameter_header *bfpt_header, -const struct sfdp_bfpt *bfpt, -struct spi_nor_flash_parameter *params) +static int s28hx_t_post_bfpt_fixup (struct spi_nor *nor, +const struct sfdp_parameter_header *bfpt_header, +const struct sfdp_bfpt *bfpt, +struct spi_nor_flash_parameter *params) {struct spi_mem_op op;u8 buf;
@@ -3486,10 +3486,10 @@ static int s28hs512t_post_bfpt_fixup(struct spi_nor *nor, return 0; } -static struct spi_nor_fixups s28hs512t_fixups = { - .default_init = s28hs512t_default_init, - .post_sfdp = s28hs512t_post_sfdp_fixup, - .post_bfpt = s28hs512t_post_bfpt_fixup, +static struct spi_nor_fixups s28hx_t_fixups = { + .default_init = s28hx_t_default_init, + .post_sfdp = s28hx_t_post_sfdp_fixup, + .post_bfpt = s28hx_t_post_bfpt_fixup, };#endif /* CONFIG_SPI_FLASH_S28HS512T */
@@ -3824,7 +3824,7 @@ void spi_nor_set_fixups(struct spi_nor *nor)#ifdef CONFIG_SPI_FLASH_S28HS512T if (!strcmp (nor->info->name,"s28hs512t" )) - nor->fixups = &s28hs512t_fixups; + nor->fixups = &s28hx_t_fixups;#endif #ifdef CONFIG_SPI_FLASH_MT35XU
Signature · 1 line
2.25.1
PATCH 2/3 mtd: spi-nor-core: Rename configuration macro for S28 support
In reply to [email protected]From: Takahiro Kuwano <[email protected]>
Change configuration macro name to support all other devices in SEMPER S28 family.
--- configs/j721s2_evm_a72_defconfig | 2 +- configs/j721s2_evm_r5_defconfig | 2 +- drivers/mtd/spi/Kconfig | 10 +++++----- drivers/mtd/spi/spi-nor-core.c | 6 +++--- drivers/mtd/spi/spi-nor-ids.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-)
configs/j721s2_evm_a72_defconfig +1 -1
@@ -150,7 +150,7 @@ CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_SOFT_RESET=y CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y CONFIG_SPI_FLASH_SPANSION=y -CONFIG_SPI_FLASH_S28HS512T=y +CONFIG_SPI_FLASH_S28HX_T=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_MT35XU=y # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
configs/j721s2_evm_r5_defconfig +1 -1
@@ -129,7 +129,7 @@ CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_SOFT_RESET=y CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y CONFIG_SPI_FLASH_SPANSION=y -CONFIG_SPI_FLASH_S28HS512T=y +CONFIG_SPI_FLASH_S28HX_T=y CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_MT35XU=y CONFIG_PINCTRL=y
drivers/mtd/spi/Kconfig +5 -5
@@ -166,13 +166,13 @@ config SPI_FLASH_SPANSION help Add support for various Spansion SPI flash chips (S25FLxxx) -config SPI_FLASH_S28HS512T - bool "Cypress S28HS512T chip support" +config SPI_FLASH_S28HX_T + bool "Cypress SEMPER Octal (S28) chip support" depends on SPI_FLASH_SPANSION help - Add support for the Cypress S28HS512T chip. This is a separate config - because the fixup hooks for this flash add extra size overhead. Boards - that don't use the flash can disable this to save space. + Add support for the Cypress S28HL-T and S28HS-T chip. This is a separate + config because the fixup hooks for this flash add extra size overhead. + Boards that don't use the flash can disable this to save space. config SPI_FLASH_STMICRO bool "STMicro SPI flash support"
drivers/mtd/spi/spi-nor-core.c +3 -3
@@ -3310,7 +3310,7 @@ static struct spi_nor_fixups s25fl256l_fixups = { };#endif -#ifdef CONFIG_SPI_FLASH_S28HS512T +#ifdef CONFIG_SPI_FLASH_S28HX_T /** * spi_nor_cypress_octal_dtr_enable() - Enable octal DTR on Cypress flashes. * @nor: pointer to a 'struct spi_nor'
@@ -3491,7 +3491,7 @@ static struct spi_nor_fixups s28hx_t_fixups = { .post_sfdp = s28hx_t_post_sfdp_fixup, .post_bfpt = s28hx_t_post_bfpt_fixup, }; -#endif /* CONFIG_SPI_FLASH_S28HS512T */ +#endif /* CONFIG_SPI_FLASH_S28HX_T */ #ifdef CONFIG_SPI_FLASH_MT35XU static int spi_nor_micron_octal_dtr_enable (struct spi_nor *nor)
@@ -3822,7 +3822,7 @@ void spi_nor_set_fixups(struct spi_nor *nor) nor->fixups = &s25fl256l_fixups;#endif -#ifdef CONFIG_SPI_FLASH_S28HS512T +#ifdef CONFIG_SPI_FLASH_S28HX_T if (!strcmp (nor->info->name,"s28hs512t" )) nor->fixups = &s28hx_t_fixups;#endif
drivers/mtd/spi/spi-nor-ids.c +1 -1
@@ -294,7 +294,7 @@ const struct flash_info spi_nor_ids[] = { USE_CLSR) }, { INFO6("s25hs02gt", 0x342b1c, 0x0f0090, 256 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, -#ifdef CONFIG_SPI_FLASH_S28HS512T +#ifdef CONFIG_SPI_FLASH_S28HX_T { INFO("s28hs512t", 0x345b1a, 0, 256 * 1024, 256, SPI_NOR_OCTAL_DTR_READ) }, #endif #endif
Signature · 1 line
2.25.1
PATCH 3/3 mtd: spi-nor-ids: Add s28hl512t, s28hl01gt, and s28hs01gt IDs
In reply to [email protected]From: Takahiro Kuwano <[email protected]>
Add flash info table entries for s28hl512gt, s28hl01gt, and s28hs01gt. These devices have the same functionality as s28hs512t.
In spi-nor-core, use device ID byte to detect S28 family instead of device name.
--- drivers/mtd/spi/spi-nor-core.c | 12 +++++++----- drivers/mtd/spi/spi-nor-ids.c | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/mtd/spi/spi-nor-core.c +7 -5
@@ -3812,6 +3812,13 @@ void spi_nor_set_fixups(struct spi_nor *nor) nor->fixups = &s25hx_t_fixups;break ; +#ifdef CONFIG_SPI_FLASH_S28HX_T +case 0x5a :/* S28HL (Octal, 3.3V) */ +case 0x5b :/* S28HS (Octal, 1.8V) */ + nor->fixups = &s28hx_t_fixups; +break ; +#endif +default :break ; }
@@ -3822,11 +3829,6 @@ void spi_nor_set_fixups(struct spi_nor *nor) nor->fixups = &s25fl256l_fixups;#endif -#ifdef CONFIG_SPI_FLASH_S28HX_T -if (!strcmp (nor->info->name,"s28hs512t" )) - nor->fixups = &s28hx_t_fixups; -#endif -#ifdef CONFIG_SPI_FLASH_MT35XU if (!strcmp (nor->info->name,"mt35xu512aba" )) nor->fixups = &mt35xu512aba_fixups;
drivers/mtd/spi/spi-nor-ids.c +3 -0
@@ -295,7 +295,10 @@ const struct flash_info spi_nor_ids[] = { { INFO6("s25hs02gt", 0x342b1c, 0x0f0090, 256 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, #ifdef CONFIG_SPI_FLASH_S28HX_T + { INFO("s28hl512t", 0x345a1a, 0, 256 * 1024, 256, SPI_NOR_OCTAL_DTR_READ) }, + { INFO("s28hl01gt", 0x345a1b, 0, 256 * 1024, 512, SPI_NOR_OCTAL_DTR_READ) }, { INFO("s28hs512t", 0x345b1a, 0, 256 * 1024, 256, SPI_NOR_OCTAL_DTR_READ) }, + { INFO("s28hs01gt", 0x345b1b, 0, 256 * 1024, 512, SPI_NOR_OCTAL_DTR_READ) }, #endif #endif #ifdef CONFIG_SPI_FLASH_SST /* SST */
Signature · 1 line
2.25.1
Quoted 9 lines · On Thu, Aug 25, 2022 at 1:19 PM <[email protected]> wrote:
From: Takahiro Kuwano <[email protected]>
These devices are variants of s28hs512t(1.8V 512Mb) with different density(1Gb) and power supply voltage(3V).
Quoted 6 lines
Tested on Zynq-7000 platform with Infineon SPI controller
Takahiro Kuwano (3):
mtd: spi-nor-core: Rename s28hs512t prefix
mtd: spi-nor-core: Rename configuration macro for S28 support
mtd: spi-nor-ids: Add s28hl512t, s28hl01gt, and s28hs01gt IDs
Applied to u-boot-spi/master