From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 4/5] mips: ath79: add spi driver
Date: Wed, 30 Dec 2015 12:02:03 +0800 [thread overview]
Message-ID: <5683573B.9040700@wytron.com.tw> (raw)
In-Reply-To: <201512300151.47999.marex@denx.de>
Hi Marek and Wills,
On 2015?12?30? 08:51, Marek Vasut wrote:
> Just skimming through the code, it seems like bitbanging the SPI using the
> generic soft-spi driver might be easier ;-/
>
I read the data sheet and Linux driver. Now I have clearer picture of
this device. In serial flash mode, it reads like CFI flash. But we need
to switch to bitbanging mode to write flash. In bitbanging, we have
shift in data as word read. Though the cs, clk and dout are gpio. And
the soft-spi of u-boot won't fit well.
So the current ath79_spi_delay() is fine. as we don't have ndelay() in
u-boot yet. But the set_speed() code is for serial flash mode, and does
not apply to bitbanging mode. You should save the result of do_div(tick,
max_hz) to priv data, because dividing can take some time. You may trim
the count with rrw_delay like that of Linux driver for more accurate timing.
BTW, the usage of uint8_t,uint32_t and uint64_t is deprecated. Please
change them to u8, u32 and u64. It will be helpful to run checkpatch.pl.
Thanks a lot for your work.
Best regards,
Thomas
next prev parent reply other threads:[~2015-12-30 4:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1451387833-932-1-git-send-email-wills.wang@live.com>
2015-12-29 11:17 ` [U-Boot] [PATCH v5 1/5] mips: implement to access the KSEG0/1 memory range in map_physmem Wills Wang
2015-12-29 12:49 ` Antony Pavlov
2015-12-30 1:08 ` Wills Wang
2015-12-29 18:08 ` Daniel Schwierzeck
2015-12-29 11:17 ` [U-Boot] [PATCH v5 2/5] mips: add support for QCA/Atheros ath79 SOCs Wills Wang
2015-12-29 19:09 ` Daniel Schwierzeck
2015-12-30 6:27 ` Wills Wang
2015-12-29 11:17 ` [U-Boot] [PATCH v5 3/5] mips: ath79: add serial driver for ar933x SOC Wills Wang
2015-12-29 12:26 ` Thomas Chou
2015-12-30 1:06 ` Wills Wang
2015-12-29 11:17 ` [U-Boot] [PATCH v5 4/5] mips: ath79: add spi driver Wills Wang
2015-12-29 13:00 ` Thomas Chou
2015-12-29 13:25 ` Marek Vasut
2015-12-29 23:46 ` Thomas Chou
2015-12-30 0:51 ` Marek Vasut
2015-12-30 4:02 ` Thomas Chou [this message]
2015-12-30 8:32 ` Antony Pavlov
2015-12-30 8:55 ` Marek Vasut
2015-12-30 1:35 ` Wills Wang
2015-12-30 1:46 ` Marek Vasut
2015-12-30 1:12 ` Wills Wang
2015-12-29 11:17 ` [U-Boot] [PATCH v5 5/5] mips: ath79: add AP121 reference board Wills Wang
2015-12-29 19:27 ` Daniel Schwierzeck
2015-12-30 6:31 ` Wills Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5683573B.9040700@wytron.com.tw \
--to=thomas@wytron.com.tw \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox