From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 30 Dec 2015 02:46:37 +0100 Subject: [U-Boot] [PATCH v5 4/5] mips: ath79: add spi driver In-Reply-To: References: <1451387833-932-1-git-send-email-wills.wang@live.com> <201512291425.27888.marex@denx.de> Message-ID: <201512300246.37479.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 Wednesday, December 30, 2015 at 02:35:01 AM, Wills Wang wrote: > On 12/29/2015 09:25 PM, Marek Vasut wrote: > > On Tuesday, December 29, 2015 at 02:00:27 PM, Thomas Chou wrote: > >> Hi Wills, > >> > >> On 2015?12?29? 19:17, Wills Wang wrote: > >>> diff --git a/arch/mips/mach-ath79/Kconfig > >>> b/arch/mips/mach-ath79/Kconfig index 1d92a5b..b5668e9 100644 > >>> --- a/arch/mips/mach-ath79/Kconfig > >>> +++ b/arch/mips/mach-ath79/Kconfig > >>> @@ -15,6 +15,7 @@ config SOC_AR933X > >>> > >>> select SYS_MIPS_CACHE_INIT_RAM_LOAD > >>> select MIPS_TUNE_24KC > >>> select AR933X_UART > >>> > >>> + select ATH79_SPI > >> > >> Both AR933X_UART and ATH79_SPI should not be selected with mach Kconfig. > >> They should go with board defconfig. > >> > >>> diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c > >>> > >>> +static inline void ath79_spi_delay(int max_hz) > >>> +{ > >>> + uint64_t tick = get_tbclk(); > >>> + > >>> + do_div(tick, max_hz); > >>> + tick = get_ticks() + tick + 1; /* get current timestamp */ > >>> + while (get_ticks() < tick) /* loop till event */ > >>> + /*NOP*/; > >>> +} > >> > >> Use udelay() instead. > > > > You mean get_timer() based delay loop, yes ? > > Does get_timer() return time in milliseconds? Yes, but there's also timer_get_us() . Best regards, Marek Vasut