
Dear Jagan, Simon,
-----Original Message----- From: U-Boot [mailto:u-boot-bounces@lists.denx.de] On Behalf Of Jagan Teki Sent: Thursday, December 07, 2017 11:19 AM To: Goldschmidt Simon sgoldschmidt@de.pepperl-fuchs.com Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH] sf: ensure flash device is in 3-byte address mode
On Tue, Dec 5, 2017 at 11:50 AM, Goldschmidt Simon sgoldschmidt@de.pepperl-fuchs.com wrote:
- Lukasz (as a reviewer of my patch[1])
On Mon, Dec 4, 2017 at 8:20, Jagan Teki wrote:
This is the patch[1] for 4-byte addressing, but I would wonder how can
proceed
operations with 4-byte if we disable during probe.
[1]
https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit.denx .de%2F%3Fp%3Du-boot- &data=02%7C01%7Cprabhakar.kushwaha%40nxp.com%7Ca37e67c0f5fd431396 5f08d53d3649b8%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6364 82225771650679&sdata=CBQkKDXTE1g1mvEbYuyiBApW2NTxQFCirGeJV9uzX8E %3D&reserved=0
spi.git;a=commitdiff;h=fd0c22a90772379c4c11ba09347d36cc8ee17dca
OK, so your patch does something different than what I did.
I was trying to keep the change to U-Boot as small as possible, only fixing this issue I was seeing:
After a soft-reboot where the SPI chip was not reset, it is left in 4-byte addressing mode (linux uses this mode, obviously). Remember that 4-byte mode is not a permanent setting, so we can enter and leave it any time we like by issuing a command.
U-Boot uses the Bank Address Register (BAR) for spi flash chips with more than 16 MByte, so it impclitly assumes that the chip is in 3-byte address mode. As I see it, your patch is worth a discussion named "should we use 4-byte addressing mode on spi flash chips?". I do think this is a better alternative than writing BAR! But this change probably needs discussion and testing.
OK, will review your patch.
Other solution to this problem could have been "adding support of 4byte addressing".
There will always be a requirement of supporting >16MB flash.
--pk