[PATCH 3/3] mtd/nand : workaround for Freescale FCM to support large-page Nand chip
Scott Wood
scottwood at freescale.com
Tue Nov 29 04:20:34 EST 2011
On 11/24/2011 01:37 AM, Li Yang-R58472 wrote:
>> +static void io_to_buffer(struct mtd_info *mtd, int subpage, int oob)
>> +{
>> + struct nand_chip *chip = mtd->priv;
>> + struct fsl_elbc_mtd *priv = chip->priv;
>> + struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = priv->ctrl->nand;
>> + void *src, *dst;
>> + int len = (oob ? 64 : 2048);
>> +
>> + if (oob)
>> + dst = elbc_fcm_ctrl->buffer + mtd->writesize + subpage * 64;
>> + else
>> + dst = elbc_fcm_ctrl->buffer + subpage * 2048;
>> +
>> + src = elbc_fcm_ctrl->addr + (oob ? 2048 : 0);
>> + memcpy_fromio(dst, src, len);
>
> Might be safer to use _memcpy_fromio()
How so?
memcpy_fromio() is the public interface that will end up calling
_memcpy_fromio() on powerpc.
-Scott
More information about the Linuxppc-dev
mailing list