From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 21 Jan 2014 18:48:25 +0100 Subject: [U-Boot] [PATCH 2/6] sf: Optimize flash features code In-Reply-To: References: <1390075593-11226-1-git-send-email-jaganna@xilinx.com> Message-ID: <201401211848.25210.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, January 21, 2014 at 08:45:52 AM, Jagan Teki wrote: [...] > Current design: > > cmd_sf.c This is just the one of the users of the SPI flash API, but not the only one. > ------------ > spi_flash.h > -------------- > sf (_probe, _ops), sf.c > ------------------------------------------- > drivers/spi/ti_qspi.c (inform flash properties through "mode_bits" > spi_slave {} > -------------------------------------------------------------------------- > ----- > > Proposed one (may be): > > Suppose If we have one more qspi controller(zynq) which is connected > to serial nor > > cmd_sf.c > ----------- > spi_flash.h > --------------- > SF-NOR > --------------------------------------------------------------------------- > --------------------- drivers/spi/ti_qspi.c > drivers/mtd/sf_nor/zynq_qspi.c > (inform flash properties > (inform flash properties > through "mode_bits" of > through "mode_bits" of > spi_slave {}) > sf_nor_device {} Did the formating here go awry ? But anyway, your sf_probe.c/sf_ops.c/sf.c will only need to somehow discern whether to call the regular SPI API or SPI-NOR API functions. Best regards, Marek Vasut