All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] endian dependency fix
@ 2014-02-16  9:22 Yoshinori Sato
  2014-02-18 10:19 ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Yoshinori Sato @ 2014-02-16  9:22 UTC (permalink / raw)
  To: u-boot

mmc_spi have dependency of little-endian environment.
So doesn't work big-endian environment.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 drivers/mmc/mmc_spi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index fe6a5a1..17fdac7 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -11,7 +11,7 @@
 #include <spi.h>
 #include <crc.h>
 #include <linux/crc7.h>
-#include <linux/byteorder/swab.h>
+#include <asm/byteorder.h>
 
 /* MMC/SD in SPI mode reports R1 status always */
 #define R1_SPI_IDLE		(1 << 0)
@@ -91,7 +91,7 @@ static uint mmc_spi_readdata(struct mmc *mmc, void *xbuf,
 			spi_xfer(spi, bsize * 8, NULL, buf, 0);
 			spi_xfer(spi, 2 * 8, NULL, &crc, 0);
 #ifdef CONFIG_MMC_SPI_CRC_ON
-			if (swab16(cyg_crc16(buf, bsize)) != crc) {
+			if (cpu_to_be16(cyg_crc16(buf, bsize)) != crc) {
 				debug("%s: CRC error\n", mmc->name);
 				r1 = R1_SPI_COM_CRC;
 				break;
@@ -120,7 +120,7 @@ static uint mmc_spi_writedata(struct mmc *mmc, const void *xbuf,
 	tok[1] = multi ? SPI_TOKEN_MULTI_WRITE : SPI_TOKEN_SINGLE;
 	while (bcnt--) {
 #ifdef CONFIG_MMC_SPI_CRC_ON
-		crc = swab16(cyg_crc16((u8 *)buf, bsize));
+		crc = cpu_to_be16(cyg_crc16((u8 *)buf, bsize));
 #endif
 		spi_xfer(spi, 2 * 8, tok, NULL, 0);
 		spi_xfer(spi, bsize * 8, buf, NULL, 0);
@@ -193,7 +193,7 @@ static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd,
 	} else if (cmd->resp_type == MMC_RSP_R2) {
 		r1 = mmc_spi_readdata(mmc, cmd->response, 1, 16);
 		for (i = 0; i < 4; i++)
-			cmd->response[i] = swab32(cmd->response[i]);
+			cmd->response[i] = be32_to_cpu(cmd->response[i]);
 		debug("r128 %x %x %x %x\n", cmd->response[0], cmd->response[1],
 		      cmd->response[2], cmd->response[3]);
 	} else if (!data) {
@@ -205,7 +205,7 @@ static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd,
 		case SD_CMD_SEND_IF_COND:
 		case MMC_CMD_SPI_READ_OCR:
 			spi_xfer(spi, 4 * 8, NULL, cmd->response, 0);
-			cmd->response[0] = swab32(cmd->response[0]);
+			cmd->response[0] = be32_to_cpu(cmd->response[0]);
 			debug("r32 %x\n", cmd->response[0]);
 			break;
 		case MMC_CMD_SEND_STATUS:
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] endian dependency fix
  2014-02-16  9:22 [U-Boot] [PATCH] endian dependency fix Yoshinori Sato
@ 2014-02-18 10:19 ` Masahiro Yamada
  2014-02-19  1:45   ` Nobuhiro Iwamatsu
  0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2014-02-18 10:19 UTC (permalink / raw)
  To: u-boot

Hi Yoshinori,

You should read the patch submission rules
(http://www.denx.de/wiki/U-Boot/Patches)
before posting patches.

 - Use the imperative tense in your summary line

  I mean, "fix blah blah" rather than "blah blah fix"


 - If applicable, prefix the summary line with a word describing what
    area of code is being affected followed by a colon.

  In this case,  "mmc: ..."

  Ditto in your MS7206SE series.


Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] endian dependency fix
  2014-02-18 10:19 ` Masahiro Yamada
@ 2014-02-19  1:45   ` Nobuhiro Iwamatsu
  2014-02-20 17:21     ` Yoshinori Sato
  0 siblings, 1 reply; 4+ messages in thread
From: Nobuhiro Iwamatsu @ 2014-02-19  1:45 UTC (permalink / raw)
  To: u-boot

Hi, all.

Masahiro, thank you for the explanation.

Yoshinori, please resend patches after read patch submission rules.

Best regards,
  Nobuhiro

2014-02-18 19:19 GMT+09:00 Masahiro Yamada <yamada.m@jp.panasonic.com>:
> Hi Yoshinori,
>
> You should read the patch submission rules
> (http://www.denx.de/wiki/U-Boot/Patches)
> before posting patches.
>
>  - Use the imperative tense in your summary line
>
>   I mean, "fix blah blah" rather than "blah blah fix"
>
>
>  - If applicable, prefix the summary line with a word describing what
>     area of code is being affected followed by a colon.
>
>   In this case,  "mmc: ..."
>
>   Ditto in your MS7206SE series.
>
>
> Best Regards
> Masahiro Yamada
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] endian dependency fix
  2014-02-19  1:45   ` Nobuhiro Iwamatsu
@ 2014-02-20 17:21     ` Yoshinori Sato
  0 siblings, 0 replies; 4+ messages in thread
From: Yoshinori Sato @ 2014-02-20 17:21 UTC (permalink / raw)
  To: u-boot

At Wed, 19 Feb 2014 10:45:33 +0900,
Nobuhiro Iwamatsu wrote:
> 
> Hi, all.
> 
> Masahiro, thank you for the explanation.
> 
> Yoshinori, please resend patches after read patch submission rules.
>

OK.
I'll resend after reading wiki.

Thanks.
 
> Best regards,
>   Nobuhiro
> 
> 2014-02-18 19:19 GMT+09:00 Masahiro Yamada <yamada.m@jp.panasonic.com>:
> > Hi Yoshinori,
> >
> > You should read the patch submission rules
> > (http://www.denx.de/wiki/U-Boot/Patches)
> > before posting patches.
> >
> >  - Use the imperative tense in your summary line
> >
> >   I mean, "fix blah blah" rather than "blah blah fix"
> >
> >
> >  - If applicable, prefix the summary line with a word describing what
> >     area of code is being affected followed by a colon.
> >
> >   In this case,  "mmc: ..."
> >
> >   Ditto in your MS7206SE series.
> >
> >
> > Best Regards
> > Masahiro Yamada
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> 
> 
> 
> -- 
> Nobuhiro Iwamatsu
>    iwamatsu at {nigauri.org / debian.org}
>    GPG ID: 40AD1FA6

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-20 17:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16  9:22 [U-Boot] [PATCH] endian dependency fix Yoshinori Sato
2014-02-18 10:19 ` Masahiro Yamada
2014-02-19  1:45   ` Nobuhiro Iwamatsu
2014-02-20 17:21     ` Yoshinori Sato

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.