static const int ecc_bytes[] = {32, 46, 54, 60, 74, 88, 102, 110, 116};
+static void nand_readlcpy(u32 *dest, u32 * __iomem src, size_t len)
+{
+ /* NB: len should be multiple of 4 (32bits access) */
+ len >>= 2;
+
+ while (len--)
+ *dest++ = readl(src++);
+}
+
static int nand_read_page(const struct nfc_config *conf, u32 offs,
void *dest, int len)
{
return 1;
/* Retrieve the data from SRAM */
- memcpy_fromio(data, SUNXI_NFC_BASE + NFC_RAM0_BASE,
+ nand_readlcpy((u32 *)data,
+ (void *)(uintptr_t)SUNXI_NFC_BASE + NFC_RAM0_BASE,
conf->ecc_size);
/* Stop the ECC engine */