From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Fri, 18 Oct 2019 08:13:52 -0600 Subject: [U-Boot] [PATCH v2 14/38] spi: Add support for memory-mapped flash In-Reply-To: <91c3a4d7-98b4-d519-ceff-5812a9a9849a@ti.com> References: <20190925141147.191166-1-sjg@chromium.org> <20190925141147.191166-15-sjg@chromium.org> <91c3a4d7-98b4-d519-ceff-5812a9a9849a@ti.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Vignesh, On Fri, 18 Oct 2019 at 02:50, Vignesh Raghavendra wrote: > [..] > >>>> As it stands we don't actually use that uclass with this SPI flash > >>>> driver - it implements the SPI_FLASH interface directly. > >>>> > >>>> But given that I'm going to try to use the same ich.c driver this > >>>> should be easy enough. > >>>> > >>>> I've just found the weird mem_ops argument within struct dm_spi_ops...oh dear. > >>>> > >>> > >>> The mem_ops was added by Vignesh. I believe that was derived from the > >>> Linux kernel. > > > > spi_mem_ops in U-Boot was added by Miquel while introducing SPI NAND > support in U-Boot, but I extended its usage to SPI NOR devices as well. > > > The problem is that it is ops within ops so doesn't follow driver model. > > Hmm, why is that so? > ops within ops is not unheard of and is common in kernel as well. This > actually allows to grouping of similar operations into simple structs > and thus improves readability. It is not used elsewhere in driver model though. Also there are no tests. How can we get some tests in there? Regards, Simon