From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: socfpga: fix up a questionable macro for SDMMC
Date: Wed, 2 Dec 2015 01:20:28 +0100 [thread overview]
Message-ID: <201512020120.28850.marex@denx.de> (raw)
In-Reply-To: <565E2E2E.6050407@opensource.altera.com>
On Wednesday, December 02, 2015 at 12:33:02 AM, Dinh Nguyen wrote:
> On 12/01/2015 05:30 PM, Marek Vasut wrote:
> > On Wednesday, December 02, 2015 at 12:20:47 AM,
> > dinguyen at opensource.altera.com
> >
> > wrote:
> >> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> >>
> >> Not sure what made this macro questionable, but edit the macro to be
> >> similar to what is used in Linux.
> >
> > It should most likely be dissolved and moved into socfpga_dw_mmc.c ,
> > since it's used only once in there. What do you think ?
>
> Hmm...if you move this to socfpga_dw_mmc.c then the #if defined(A10)
> would have to follow as the bit for smplsel is at shift 4 instead of 3.
>
> So if you had this for in system_manager.h, then socfpga_dw_mmc.c
> doesn't have to change.
>
> --- a/arch/arm/mach-socfpga/include/mach/system_manager.h
> +++ b/arch/arm/mach-socfpga/include/mach/system_manager.h
> @@ -201,8 +201,13 @@ struct socfpga_system_manager {
> #define SYSMGR_FPGAINTF_NAND (1 << 4)
> #define SYSMGR_FPGAINTF_SDMMC (1 << 5)
>
> +#if defined(SOCFPGA_GEN5)
> #define SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel) \
> ((((smplsel) & 0x7) << 3) | (((drvsel) & 0x7) << 0))
> +#else /* Arria10 */
> +#define SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel) \
> + ((((smplsel) & 0x7) << 4) | (((drvsel) & 0x7) << 0))
> +#endif
Then define the offsets in system_manager.h and then just do
writel((smplsel << OFFSET1) | (drvsel << offset2), ...);
in the MMC driver. That would work without ifdeffery, right ?
Best regards,
Marek Vasut
next prev parent reply other threads:[~2015-12-02 0:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-01 23:20 [U-Boot] [PATCH] arm: socfpga: fix up a questionable macro for SDMMC dinguyen at opensource.altera.com
2015-12-01 23:30 ` Marek Vasut
2015-12-01 23:33 ` Dinh Nguyen
2015-12-02 0:20 ` Marek Vasut [this message]
2015-12-03 18:42 ` Pavel Machek
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=201512020120.28850.marex@denx.de \
--to=marex@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.