From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mxs: i2c: Implement algorithm to set up arbitrary i2c speed
Date: Fri, 30 Nov 2012 16:07:54 +0100 [thread overview]
Message-ID: <20121130150754.3313D201015@gemini.denx.de> (raw)
In-Reply-To: <1354280910-17539-1-git-send-email-marex@denx.de>
Dear Marek Vasut,
In message <1354280910-17539-1-git-send-email-marex@denx.de> you wrote:
> This algorithm computes the values of TIMING{0,1,2} registers for the
> MX28 I2C block. This algorithm was derived by using a scope, but the
> result seems correct.
Thanks! I like that!
...
> + uint32_t base = ((24000000 / speed) - 38) / 2;
...
> + return 24000000 / ((((timing0 >> 16) - 3) * 2) + 38);
But we should get rid of this magic constant. On other i.MX systems
that would probably be MXC_HCLK ?
For iMX28, we have CONFIG_PL011_CLOCK in the board config files
instead.
Hm... grepping the source tree for 24000000 I get the feeling that
this really needs some cleanup....
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
Vulcans worship peace above all.
-- McCoy, "Return to Tomorrow", stardate 4768.3
next prev parent reply other threads:[~2012-11-30 15:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 13:08 [U-Boot] [PATCH] mxs: i2c: Implement algorithm to set up arbitrary i2c speed Marek Vasut
2012-11-30 15:07 ` Wolfgang Denk [this message]
2012-11-30 15:21 ` Marek Vasut
2012-11-30 15:28 ` [U-Boot] [PATCH v2] " Marek Vasut
2012-12-01 1:35 ` Heiko Schocher
2012-12-01 4:10 ` Marek Vasut
2012-12-01 4:17 ` [U-Boot] [PATCH 1/2] mxs: i2c: Restore speed setting after block reset Marek Vasut
2012-12-01 4:17 ` [U-Boot] [PATCH 2/2 V3] mxs: i2c: Implement algorithm to set up arbitrary i2c speed Marek Vasut
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=20121130150754.3313D201015@gemini.denx.de \
--to=wd@denx.de \
--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