summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-08-15 20:05:13 +0200
committerHans de Goede <hdegoede@redhat.com>2015-08-31 08:43:42 +0200
commit0a247554c2dec96e693c1b02761cf0b5d5189fc0 (patch)
treeb93611d978497895435370f499378f4864d3f3d7 /drivers
parent022a99d8b2f84e6bda44e6dcfd1748219b665143 (diff)
downloadtalos-obmc-uboot-0a247554c2dec96e693c1b02761cf0b5d5189fc0.tar.gz
talos-obmc-uboot-0a247554c2dec96e693c1b02761cf0b5d5189fc0.zip
sunxi_nand_spl: Properly config page-size in the nand ctl register
Properly config page-size in the nand ctl register, it seems that things work fine without doing this, but still lets play it safe and properly set the page-size. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/sunxi_nand_spl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/nand/sunxi_nand_spl.c b/drivers/mtd/nand/sunxi_nand_spl.c
index 61eb393446..872cedfd5e 100644
--- a/drivers/mtd/nand/sunxi_nand_spl.c
+++ b/drivers/mtd/nand/sunxi_nand_spl.c
@@ -42,6 +42,8 @@
#define NFC_CTL_EN (1 << 0)
#define NFC_CTL_RESET (1 << 1)
#define NFC_CTL_RAM_METHOD (1 << 14)
+#define NFC_CTL_PAGE_SIZE_MASK (0xf << 8)
+#define NFC_CTL_PAGE_SIZE(a) ((fls(a) - 11) << 8)
#define NFC_ECC_EN (1 << 0)
@@ -294,6 +296,9 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *dest)
void *current_dest;
uint32_t ecc_errors = 0;
+ clrsetbits_le32(SUNXI_NFC_BASE + NFC_CTL, NFC_CTL_PAGE_SIZE_MASK,
+ NFC_CTL_PAGE_SIZE(CONFIG_NAND_SUNXI_SPL_PAGE_SIZE));
+
for (current_dest = dest;
current_dest < (dest + size);
current_dest += CONFIG_NAND_SUNXI_SPL_ECC_PAGE_SIZE) {
OpenPOWER on IntegriCloud