From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuo-Jung Su Date: Mon, 22 Apr 2013 09:51:08 +0800 Subject: [U-Boot] [PATCH v2 08/12] mtd: spi: add FTSPI020 SPI Flash controller support In-Reply-To: <20130418110818.9B88B20019A@gemini.denx.de> References: <1366277139-29728-1-git-send-email-dantesu@gmail.com> <1364540788-13943-2-git-send-email-dantesu@gmail.com> <1366277139-29728-9-git-send-email-dantesu@gmail.com> <20130418110818.9B88B20019A@gemini.denx.de> 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 2013/4/18 Wolfgang Denk : > Dear Kuo-Jung Su, > > In message <1366277139-29728-9-git-send-email-dantesu@gmail.com> you wrote: > ... >> +/* Register access macros */ >> +#define SPI_READ(r) le32_to_cpu(readl(r)) >> +#define SPI_WRITE(v, r) writel(cpu_to_le32(v), r) >> +#define SPI_SETBITS(m, r) setbits_le32(r, m) >> +#define SPI_CLRBITS(m, r) clrbits_le32(r, m) > > see before... > Got it, thanks >> + struct spi_flash_info *fl = (struct spi_flash_info *)flash; >> + return fl->chip; > > Please always insert a blank line between declarations and code. > Got it, thanks >> +static const struct spi_flash_param sf_list[] = { >> + >> + /* Atmel -- some are (confusingly) marketed as "DataFlash" */ >> + { "at25fs010", 0x1f6601, 0, 32 * 1024, 4 }, >> + { "at25fs040", 0x1f6604, 0, 64 * 1024, 8 }, >> + >> + { "at25df041a", 0x1f4401, 0, 64 * 1024, 8 }, >> + { "at25df321a", 0x1f4701, 0, 64 * 1024, 64 }, >> + { "at25df641", 0x1f4800, 0, 64 * 1024, 128 }, > ... > > should we not rather move this into a separate, global header file? > Sure, I'll make it a separate file or a global header file if possible. >> + for (i = 0; i < ARRAY_SIZE(id32); ++i) { >> + /* wait until rx ready */ >> + while (!(SPI_READ(®s->sr) & SR_RFR)) >> + ; > > See previous note about timeouts. Please fix globally. > >> + /* wait until command finish */ >> + while (!(SPI_READ(®s->isr) & ISR_CMD)) >> + ; > > Ditto. etc. etc. > Got it, thanks > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de > "Ja, mach' nur einen Plan, sei nur ein grosses Licht > und mach' dann noch 'nen zweiten Plan, geh'n tun sie beide nicht." > -- Bert Brecht, Dreigroschenoper -- Best wishes, Kuo-Jung Su