"update_uboot=if tftp ${uboot}; then " \
"if itest ${filesize} > 0; then " \
"mmc dev ${mmcdev}; mmc rescan; " \
- "setexpr blkc ${filesize} / 0x200; " \
- "setexpr blkc ${blkc} + 1; " \
+ "setexpr blkc ${filesize} + 0x1ff; " \
+ "setexpr blkc ${blkc} / 0x200; " \
"if itest ${blkc} <= ${uboot_size}; then " \
"mmc write ${loadaddr} ${uboot_start} " \
"${blkc}; " \
"if tftp ${kernel}; then " \
"if itest ${filesize} > 0; then " \
"mmc dev ${mmcdev}; mmc rescan; " \
- "setexpr blkc ${filesize} / 0x200; " \
- "setexpr blkc ${blkc} + 1; " \
+ "setexpr blkc ${filesize} + 0x1ff; " \
+ "setexpr blkc ${blkc} / 0x200; " \
"if itest ${blkc} <= ${kernel_size}; then " \
"mmc write ${loadaddr} " \
"${kernel_start} ${blkc}; " \
"update_fdt=if tftp ${fdt_file}; then " \
"if itest ${filesize} > 0; then " \
"mmc dev ${mmcdev}; mmc rescan; " \
- "setexpr blkc ${filesize} / 0x200; " \
- "setexpr blkc ${blkc} + 1; " \
+ "setexpr blkc ${filesize} + 0x1ff; " \
+ "setexpr blkc ${blkc} / 0x200; " \
"if itest ${blkc} <= ${fdt_size}; then " \
"mmc write ${loadaddr} ${fdt_start} ${blkc}; " \
"fi; " \