All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alison Wang <b18965@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 06/17] esdhc: Add CONFIG_SYS_FSL_ESDHC_LE and CONFIG_SYS_FSL_ESDHC_BE macros
Date: Fri, 5 Sep 2014 13:52:39 +0800	[thread overview]
Message-ID: <1409896370-22207-7-git-send-email-b18965@freescale.com> (raw)
In-Reply-To: <1409896370-22207-1-git-send-email-b18965@freescale.com>

From: Wang Huan <b18965@freescale.com>

For LS102xA, the processor is in little-endian mode, while esdhc IP is
in big-endian mode. CONFIG_SYS_FSL_ESDHC_LE and CONFIG_SYS_FSL_ESDHC_BE
are added. So accessing ESDHC registers can be determined by ESDHC IP's
endian mode.

Signed-off-by: Alison Wang <alison.wang@freescale.com>
---
Change log:
 v6: New patch. Split from the v5's 06 patch.

 doc/README.fsl-esdhc |  5 +++++
 include/fsl_esdhc.h  | 14 +++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 doc/README.fsl-esdhc

diff --git a/doc/README.fsl-esdhc b/doc/README.fsl-esdhc
new file mode 100644
index 0000000..b70f271
--- /dev/null
+++ b/doc/README.fsl-esdhc
@@ -0,0 +1,5 @@
+CONFIG_SYS_FSL_ESDHC_LE means ESDHC IP is in little-endian mode.
+CONFIG_SYS_FSL_ESDHC_BE means ESDHC IP is in big-endian mode.
+
+Accessing ESDHC registers can be determined by ESDHC IP's endian
+mode or processor's endian mode.
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
-- 
2.1.0.27.g96db324

  parent reply	other threads:[~2014-09-05  5:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05  5:52 [U-Boot] [PATCH v6 0/17] arm: ls102xa: Add Freescale LS102xA SoC and LS1021AQDS/TWR board support Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 01/17] arm: ls102xa: Add Freescale LS102xA SoC support Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 02/17] ls102xa: i2c: Add i2c support for LS102xA Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 03/17] net: Merge asm/fsl_enet.h into fsl_mdio.h Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 04/17] net: mdio: Use mb() to be compatible for both ARM and PowerPC Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 05/17] ls102xa: etsec: Add etsec support for LS102xA Alison Wang
2014-09-05  5:52 ` Alison Wang [this message]
2014-09-05  5:52 ` [U-Boot] [PATCH v6 07/17] ls102xa: esdhc: Add esdhc " Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 08/17] driver/ddr/freescale: Add support of accumulate ECC Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 09/17] driver/ddr/freescale: Fix DDR3 driver for ARM Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 10/17] driver/ddr/fsl: Add support of overriding chip select write leveling Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 11/17] arm: ls102xa: Add basic support for LS1021AQDS board Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 12/17] arm: ls102xa: Add basic support for LS1021ATWR board Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 13/17] net: tsec: Remove tx snooping support from LS1 Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 14/17] serial: lpuart: add 32-bit registers lpuart support Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 15/17] video: dcu: Add DCU driver support Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 16/17] video: dcu: Add Sii9022A HDMI Transmitter support Alison Wang
2014-09-05  5:52 ` [U-Boot] [PATCH v6 17/17] ls102xa: dcu: Add platform support for DCU on LS1021ATWR board Alison Wang
  -- strict thread matches above, loose matches on Subject: below --
2014-09-05  5:43 [U-Boot] [PATCH v6 0/17] arm: ls102xa: Add Freescale LS102xA SoC and LS1021AQDS/TWR board support Alison Wang
2014-09-05  5:44 ` [U-Boot] [PATCH v6 06/17] esdhc: Add CONFIG_SYS_FSL_ESDHC_LE and CONFIG_SYS_FSL_ESDHC_BE macros 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=1409896370-22207-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.