From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] imx-bbu-nand-fcb: fix build on MX28 only
Date: Fri, 15 Sep 2017 11:07:08 +0200 [thread overview]
Message-ID: <20170915090708.29889-2-l.stach@pengutronix.de> (raw)
In-Reply-To: <20170915090708.29889-1-l.stach@pengutronix.de>
This code may be compiled without ARCH_IMX6 present, so it must not
depend on any functions provided by the architecture support.
Fixes: a2618c215bff (imx-bbu-nand-fcb: add support for imx6ul)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
common/imx-bbu-nand-fcb.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 7218c5e1ccda..bd539bafa7f7 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -38,9 +38,12 @@
#include <io.h>
#include <crc.h>
#include <mach/generic.h>
-#include <mach/imx6.h>
#include <mtd/mtd-peb.h>
+#ifdef CONFIG_ARCH_IMX6
+#include <mach/imx6.h>
+#endif
+
struct dbbt_block {
uint32_t Checksum;
uint32_t FingerPrint;
@@ -141,7 +144,8 @@ static uint8_t reverse_bit(uint8_t b)
return b;
}
-static void encode_bch_ecc(void *buf, struct fcb_block *fcb, int eccbits)
+static void __maybe_unused encode_bch_ecc(void *buf, struct fcb_block *fcb,
+ int eccbits)
{
int i, j, m = 13;
int blocksize = 128;
@@ -441,9 +445,11 @@ static int read_fcb(struct mtd_info *mtd, int num, struct fcb_block **retfcb)
goto err;
}
+#if IS_ENABLED(CONFIG_ARCH_IMX6)
if (cpu_is_mx6ul() || cpu_is_mx6ull())
fcb = read_fcb_bch(rawpage, 40);
else
+#endif
fcb = read_fcb_hamming_13_8(rawpage);
if (IS_ERR(fcb)) {
@@ -899,10 +905,13 @@ static int imx_bbu_write_fcbs_dbbts(struct mtd_info *mtd, struct fcb_block *fcb)
fcb_raw_page = xzalloc(mtd->writesize + mtd->oobsize);
+#if IS_ENABLED(CONFIG_ARCH_IMX6)
if (cpu_is_mx6ul() || cpu_is_mx6ull()) {
/* 40 bit BCH, for i.MX6UL(L) */
encode_bch_ecc(fcb_raw_page + 32, fcb, 40);
- } else {
+ } else
+#endif
+ {
memcpy(fcb_raw_page + 12, fcb, sizeof(struct fcb_block));
encode_hamming_13_8(fcb_raw_page + 12,
fcb_raw_page + 12 + 512, 512);
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-09-15 9:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-15 9:07 [PATCH 1/2] ARM: imx: santaro: select i2c Lucas Stach
2017-09-15 9:07 ` Lucas Stach [this message]
2017-09-16 13:48 ` [PATCH 2/2] imx-bbu-nand-fcb: fix build on MX28 only Sam Ravnborg
2017-09-20 6:50 ` Sascha Hauer
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=20170915090708.29889-2-l.stach@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox