From: Alison Wang <b18965@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 06/16] ls102xa: esdhc: Add esdhc support for LS102xA
Date: Tue, 19 Aug 2014 10:54:55 +0800 [thread overview]
Message-ID: <1408416905-19771-7-git-send-email-b18965@freescale.com> (raw)
In-Reply-To: <1408416905-19771-1-git-send-email-b18965@freescale.com>
For LS102xA, the platform is little endian, while esdhc IP is
big endian. So two macros are added, CONFIG_SYS_FSL_ESDHC_LE
and CONFIG_SYS_FSL_ESDHC_BE, to determine the registers'
reading/writing in big or little endian format.
Signed-off-by: Alison Wang <alison.wang@freescale.com>
---
Change log:
v5: No change.
v4: No change.
v3: Add commit messages.
v2: No change.
drivers/mmc/fsl_esdhc.c | 4 ++--
include/fsl_esdhc.h | 14 +++++++++++++-
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 5541613..aec459f 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -96,7 +96,7 @@ static uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data)
else if (cmd->resp_type & MMC_RSP_PRESENT)
xfertyp |= XFERTYP_RSPTYP_48;
-#if defined(CONFIG_MX53) || defined(CONFIG_PPC_T4240)
+#if defined(CONFIG_MX53) || defined(CONFIG_PPC_T4240) || defined(CONFIG_LS102xA)
if (cmd->cmdidx == MMC_CMD_STOP_TRANSMISSION)
xfertyp |= XFERTYP_CMDTYP_ABORT;
#endif
@@ -561,7 +561,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
memset(&cfg->cfg, 0, sizeof(cfg->cfg));
voltage_caps = 0;
- caps = regs->hostcapblt;
+ caps = esdhc_read32(®s->hostcapblt);
#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135
caps = caps & ~(ESDHC_HOSTCAPBLT_SRS |
diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h
index 9814964..c1b6648 100644
--- a/include/fsl_esdhc.h
+++ b/include/fsl_esdhc.h
@@ -162,7 +162,19 @@ struct fsl_esdhc_cfg {
};
/* Select the correct accessors depending on endianess */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if defined CONFIG_SYS_FSL_ESDHC_LE
+#define esdhc_read32 in_le32
+#define esdhc_write32 out_le32
+#define esdhc_clrsetbits32 clrsetbits_le32
+#define esdhc_clrbits32 clrbits_le32
+#define esdhc_setbits32 setbits_le32
+#elif defined(CONFIG_SYS_FSL_ESDHC_BE)
+#define esdhc_read32 in_be32
+#define esdhc_write32 out_be32
+#define esdhc_clrsetbits32 clrsetbits_be32
+#define esdhc_clrbits32 clrbits_be32
+#define esdhc_setbits32 setbits_be32
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
#define esdhc_read32 in_le32
#define esdhc_write32 out_le32
#define esdhc_clrsetbits32 clrsetbits_le32
--
1.8.0
next prev parent reply other threads:[~2014-08-19 2:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 2:54 [U-Boot] [PATCH v5 0/16] arm: ls102xa: Add Freescale LS102xA SoC and LS1021AQDS/TWR board support Alison Wang
2014-08-19 2:54 ` [U-Boot] [PATCH v5 01/16] arm: ls102xa: Add Freescale LS102xA SoC support Alison Wang
2014-08-19 11:19 ` Mark Rutland
2014-08-20 2:39 ` AlisonWang
2014-08-20 9:38 ` Mark Rutland
2014-08-19 2:54 ` [U-Boot] [PATCH v5 02/16] ls102xa: i2c: Add i2c support for LS102xA Alison Wang
2014-08-19 2:54 ` [U-Boot] [PATCH v5 03/16] net: Merge asm/fsl_enet.h into fsl_mdio.h Alison Wang
2014-08-19 2:54 ` [U-Boot] [PATCH v5 04/16] net: mdio: Use mb() to be compatible for both ARM and PowerPC Alison Wang
2014-08-19 2:54 ` [U-Boot] [PATCH v5 05/16] ls102xa: etsec: Add etsec support for LS102xA Alison Wang
2014-08-19 2:54 ` Alison Wang [this message]
2014-08-19 2:54 ` [U-Boot] [PATCH v5 07/16] driver/ddr/freescale: Add support of accumulate ECC Alison Wang
2014-08-19 2:54 ` [U-Boot] [PATCH v5 08/16] driver/ddr/freescale: Fix DDR3 driver for ARM Alison Wang
2014-08-19 2:54 ` [U-Boot] [PATCH v5 09/16] driver/ddr/fsl: Add support of overriding chip select write leveling Alison Wang
2014-08-19 2:54 ` [U-Boot] [PATCH v5 10/16] arm: ls102xa: Add basic support for LS1021AQDS board Alison Wang
2014-08-19 2:55 ` [U-Boot] [PATCH v5 11/16] arm: ls102xa: Add basic support for LS1021ATWR board Alison Wang
2014-08-19 2:55 ` [U-Boot] [PATCH v5 12/16] net: tsec: Remove tx snooping support from LS1 Alison Wang
2014-08-19 2:55 ` [U-Boot] [PATCH v5 13/16] serial: lpuart: add 32-bit registers lpuart support Alison Wang
2014-08-20 17:23 ` York Sun
2014-08-19 2:55 ` [U-Boot] [PATCH v5 14/16] video: dcu: Add DCU driver support Alison Wang
2014-08-19 2:55 ` [U-Boot] [PATCH v5 15/16] ls102xa: dcu: Add platform support for DCU on LS1021ATWR board Alison Wang
2014-08-20 17:26 ` York Sun
2014-08-19 2:55 ` [U-Boot] [PATCH v5 16/16] video: dcu: Add Sii9022A HDMI Transmitter support Alison 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=1408416905-19771-7-git-send-email-b18965@freescale.com \
--to=b18965@freescale.com \
--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.