From: Pavel Machek <pavel@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/2] arm: socfpga: mmc: Enable calibration for drvsel and smpsel
Date: Tue, 25 Aug 2015 23:01:43 +0200 [thread overview]
Message-ID: <20150825210143.GA4501@amd> (raw)
In-Reply-To: <1440055109-2252-1-git-send-email-clsee@altera.com>
On Thu 2015-08-20 02:18:29, Chin Liang See wrote:
> Enable SDMMC calibration to determine the best setting for
> drvsel and smpsel. It will be triggered whenever there is
> a change of card frequency and bus width. This is to ensure
> reliable transmission between the controller and the card.
>
> Signed-off-by: Chin Liang See <clsee@altera.com>
> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> Cc: Pavel Machek <pavel@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Stefan Roese <sr@denx.de>
> + /* Determine if the rectangle fits here */
> + for (add_col = 0; (add_col < rect_width) && ok;
> + add_col++) {
> + for (add_row = 0; add_row < rect_height;
> + add_row++) {
> + if (!cal_results[start_row + add_row]
> + [start_col + add_col]) {
> + ok = 0;
> + break;
> + }
> + }
> + }
> + /*
> + * Return 'middle' of rectangle in case of
> + * success
> + */
> + if (ok) {
> + if (rect_width > 1)
> + rect_width--;
> +
> + if (rect_height > 1)
> + rect_height--;
> +
> + *cal_row = start_row + (rect_height / 2);
> + *cal_col = start_col + (rect_width / 2);
> +
> + return 0;
> + }
This should go into separate function.
The "&& ok" is not neccessary, since you break.
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2015-08-25 21:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 7:18 [U-Boot] [PATCH v2 1/2] arm: socfpga: mmc: Enable calibration for drvsel and smpsel Chin Liang See
2015-08-21 0:54 ` Chin Liang See
2015-08-21 1:07 ` Marek Vasut
2015-08-21 1:25 ` Chin Liang See
2015-08-21 3:03 ` Marek Vasut
2015-08-21 5:00 ` Chin Liang See
2015-08-21 5:21 ` Marek Vasut
2015-08-25 21:01 ` Pavel Machek [this message]
2015-08-26 5:43 ` Chin Liang See
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=20150825210143.GA4501@amd \
--to=pavel@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