From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 22 Sep 2015 06:13:46 +0200 Subject: [U-Boot] [PATCH] spi : convert altera_spi to driver model In-Reply-To: <5600D09A.2040107@wytron.com.tw> References: <1442840311-12689-1-git-send-email-thomas@wytron.com.tw> <201509220210.26908.marex@denx.de> <5600D09A.2040107@wytron.com.tw> Message-ID: <201509220613.46875.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday, September 22, 2015 at 05:52:58 AM, Thomas Chou wrote: > Hi Marek, Hi, > On 09/22/2015 08:10 AM, Marek Vasut wrote: > > I suspect you might want to tweak the core code to check if those > > .set_speed and .set_mode are assigned in dm_spi_ops structure and > > if not, don't call them. > > I wonder if this worths, as altera_spi is the only one that cannot set > speed and mode. I'm expecting that EPCQ Wundercontroller to have the same problem (see [1] section 42, Altera GQSPI). Altera tried to push this into mainline Linux even [2], without much success, in particular because they duplicated half of the spi-nor stack to do it. I suspect this driver is coming to U-Boot sooner or later. But maybe we should do this change to the SPI NOR stuff once this driver hits the U-Boot ML instead of preemptively adding such checks. What do you think ? [1] https://www.altera.com/content/dam/altera- www/global/en_US/pdfs/literature/ug/ug_embedded_ip.pdf [2] https://lwn.net/Articles/636882/ > >> + plat->regs = ioremap(dev_get_addr(bus), > >> + sizeof(struct altera_spi_regs)); > > > > I guess the same thing about ioremap() and ranges applies here? > > Same thing about ioremap(), as almost every other arch does not include > it in u-boot. You see that I just added it to nios2 lately. > > Sometimes the address returned by dev_get_addr() may be used as memory, > and does not need ioremap. Gotcha. Best regards, Marek Vasut