Commit c82e9de400ee36038c76be67c5a6fb39c165ac1c

Authored by Wang Huan
Committed by York Sun
1 parent 52d00a812a

esdhc: Add CONFIG_SYS_FSL_ESDHC_LE and CONFIG_SYS_FSL_ESDHC_BE macros

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>

Showing 2 changed files with 18 additions and 1 deletions Side-by-side Diff

doc/README.fsl-esdhc
  1 +CONFIG_SYS_FSL_ESDHC_LE means ESDHC IP is in little-endian mode.
  2 +CONFIG_SYS_FSL_ESDHC_BE means ESDHC IP is in big-endian mode.
  3 +
  4 +Accessing ESDHC registers can be determined by ESDHC IP's endian
  5 +mode or processor's endian mode.
... ... @@ -162,7 +162,19 @@
162 162 };
163 163  
164 164 /* Select the correct accessors depending on endianess */
165   -#if __BYTE_ORDER == __LITTLE_ENDIAN
  165 +#if defined CONFIG_SYS_FSL_ESDHC_LE
  166 +#define esdhc_read32 in_le32
  167 +#define esdhc_write32 out_le32
  168 +#define esdhc_clrsetbits32 clrsetbits_le32
  169 +#define esdhc_clrbits32 clrbits_le32
  170 +#define esdhc_setbits32 setbits_le32
  171 +#elif defined(CONFIG_SYS_FSL_ESDHC_BE)
  172 +#define esdhc_read32 in_be32
  173 +#define esdhc_write32 out_be32
  174 +#define esdhc_clrsetbits32 clrsetbits_be32
  175 +#define esdhc_clrbits32 clrbits_be32
  176 +#define esdhc_setbits32 setbits_be32
  177 +#elif __BYTE_ORDER == __LITTLE_ENDIAN
166 178 #define esdhc_read32 in_le32
167 179 #define esdhc_write32 out_le32
168 180 #define esdhc_clrsetbits32 clrsetbits_le32