Commit 64a539c5 authored by Sergei Poselenov's avatar Sergei Poselenov

RT #96360: K70: align NAND writes to the block boundary. Updated "update" macro.

parent 822cf89e
......@@ -144,6 +144,9 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size
#if defined(CONFIG_CMD_MTDPARTS)
out:
#endif
/* Round up to the block boundary */
*size = (*size + nand->writesize - 1) & ~(nand->writesize - 1);
printf("device %d ", idx);
if (*size == nand->size)
puts("whole chip\n");
......
......@@ -455,13 +455,9 @@
"flashaddr=00100000\0" \
"flashboot=nboot ${loadaddr} 0 ${flashaddr};" \
"run addip;bootm\0" \
/* We hardcode the maximum size of the kernel image, */ \
/* because the `nand write` command only accepts a */ \
/* write length when it is page aligned, so we */ \
/* cannot just pass ${filesize} to this command. */ \
"update=tftp ${image};" \
"nand erase ${flashaddr} 1f00000;" \
"nand write ${loadaddr} ${flashaddr} 1f00000\0"
"nand erase ${flashaddr} ${filesize};" \
"nand write ${loadaddr} ${flashaddr} ${filesize}\0"
/*
* Linux kernel boot parameters configuration
......
......@@ -368,13 +368,9 @@
"flashaddr=00100000\0" \
"flashboot=nboot ${loadaddr} 0 ${flashaddr};" \
"run addip;bootm\0" \
/* We hardcode the maximum size of the kernel image, */ \
/* because the `nand write` command only accepts a */ \
/* write length when it is page aligned, so we */ \
/* cannot just pass ${filesize} to this command. */ \
"update=tftp ${image};" \
"nand erase ${flashaddr} 1f00000;" \
"nand write ${loadaddr} ${flashaddr} 1f00000\0"
"nand erase ${flashaddr} ${filesize};" \
"nand write ${loadaddr} ${flashaddr} ${filesize}\0"
/*
* Linux kernel boot parameters configuration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment