-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
drivers: flash: spi_nor: Set 4-byte addr mode via Bank Addr Reg #77845
base: main
Are you sure you want to change the base?
Conversation
0f60859
to
eeea4ea
Compare
drivers/flash/spi_nor.h
Outdated
@@ -35,6 +35,7 @@ | |||
#define SPI_NOR_CMD_PP_1_1_4 0x32 /* Quad Page program (1-1-4) */ | |||
#define SPI_NOR_CMD_PP_1_4_4 0x38 /* Quad Page program (1-4-4) */ | |||
#define SPI_NOR_CMD_RDCR 0x15 /* Read control register */ | |||
#define SPI_NOR_CMD_BRWR 0x17 /* Bank address register write */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't name the command. This is Infineon specific name for the command that itself has no name in JEDEC specification, that is not SPI_NOR_CMD name, that is Infineon SPI_NOR_CMD name.
I know that we have been naming things here and there, but I think we start to have a problem here where we can start collision of naming things with identifiers provided by vendors doc.
The JEDEC spec does not name the command only gives info that 0x16 is read and 0x17 is write, and that lower 7 bits of register translate, under condition, to as 128Mbit "segment". The definition here states "Bank", which is something Infineon doc defines, not JEDEC, and may additionally collide with defs from other vendors for the same command, in naming.
return -ENOTSUP; | ||
} | ||
|
||
acquire_device(dev); | ||
|
||
if ((enter_4byte_addr & 0x08) != 0) { | ||
uint8_t sr = BIT(7); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment here on JEDEC 216F description of Enter 4-Byte Addressing and just use hardcoded 0x17 with explanation in comment.
Some flash devices enable entering the 4-byte address mode by setting BIT(7) in a special register via a write instruction 0x17. The support for this method is indicated in BIT(3) of Enter 4-Byte Addressing byte in 16th DWORD of the JEDEC Basic Flash Parameter Table. Infineon's S25FL512S is an example flash device with this feature. Signed-off-by: Andriy Gelman <[email protected]>
eeea4ea
to
fb9233e
Compare
@de-nordic, I updated the comments and removed the changes in the spi_nor.h. Let me know if the updated version is ok. |
Some flash devices enable entering the 4-byte address mode by setting BIT(7) in the Bank Address register (0x17). The support for this method is indicated in BIT(3) of Enter 4-Byte Addressing byte in 16th DWORD of the JEDEC Basic Flash Parameter Table.
Infineon's S25FL512S is an example flash device with this feature.