From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guochun Mao Date: Thu, 11 Oct 2018 14:03:17 +0800 Subject: [U-Boot] [PATCH 18/20] spi: mtk_qspi: add qspi driver for MT7629 SoC In-Reply-To: References: <8fb2d6da7f5a599cc8fcb89b979efbc9e7e9c243.1538460580.git.ryder.lee@mediatek.com> Message-ID: <1539237797.13207.21.camel@mhfsdcap03> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Jagan, On Thu, 2018-10-04 at 21:31 +0530, Jagan Teki wrote: > On Tue, Oct 2, 2018 at 4:38 PM Ryder Lee wrote: > > > > From: Guochun Mao > > > > This patch adds MT7629 qspi driver for accessing SPI NOR flash. > > > > Cc: Jagan Teki > > Signed-off-by: Guochun Mao > > --- > > drivers/spi/Kconfig | 7 + > > drivers/spi/Makefile | 1 + > > drivers/spi/mtk_qspi.c | 406 +++++++++++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 414 insertions(+) > > create mode 100644 drivers/spi/mtk_qspi.c > > > > + > > +/* NOR flash commands */ > > +#define MTK_QSPI_OP_WREN 0x6 > > +#define MTK_QSPI_OP_READ_QUAD 0x6B > > +#define MTK_QSPI_OP_READ_DUAL 0x3B > > +#define MTK_QSPI_OP_FAST_READ 0xB > > +#define MTK_QSPI_OP_READ 0x3 > > +#define MTK_QSPI_OP_PP 0x2 > > NAK, we don't allow flash commands in spi. Better handle via spi-mem > or flash side. I saw fsl_qspi.c also use flash commands to distinguish operations for different setting. Due to controller IP's design, Flash register access is different from data access for our controller IP, it has to set specific controller's registers for specific operation. It seems that spi-mem will not handle this issue, it's specific controller's business. About read flash register and read data, Could you give some suggestions about how to distinguish these two kinds of ops? so that we can do properly setting for controller. Could we implement this driver without considering 0x65/0x71 flash command those that will have address parameters? And it seems that, Uboot will not use quad read or dual read? BR, Guochun