arm64: mvebu: Fix the bubt comamnd NAND device support
Fix the NAND structures in bubt command according to latest changes in MTD API. Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Cc: Stefan Roese <sr@denx.de> Cc: Igal Liberman <igall@marvell.com> Cc: Nadav Haklai <nadavh@marvell.com> Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
1d45329ada
commit
f2ca24d9d6
@ -309,16 +309,17 @@ static int is_spi_active(void)
|
|||||||
#ifdef CONFIG_CMD_NAND
|
#ifdef CONFIG_CMD_NAND
|
||||||
static int nand_burn_image(size_t image_size)
|
static int nand_burn_image(size_t image_size)
|
||||||
{
|
{
|
||||||
int ret, block_size;
|
int ret;
|
||||||
nand_info_t *nand;
|
uint32_t block_size;
|
||||||
|
struct mtd_info *nand;
|
||||||
int dev = nand_curr_device;
|
int dev = nand_curr_device;
|
||||||
|
|
||||||
if ((dev < 0) || (dev >= CONFIG_SYS_MAX_NAND_DEVICE) ||
|
if ((dev < 0) || (dev >= CONFIG_SYS_MAX_NAND_DEVICE) ||
|
||||||
(!nand_info[dev].name)) {
|
(!nand_info[dev]->name)) {
|
||||||
puts("\nno devices available\n");
|
puts("\nno devices available\n");
|
||||||
return -ENOMEDIUM;
|
return -ENOMEDIUM;
|
||||||
}
|
}
|
||||||
nand = &nand_info[dev];
|
nand = nand_info[dev];
|
||||||
block_size = nand->erasesize;
|
block_size = nand->erasesize;
|
||||||
|
|
||||||
/* Align U-Boot size to currently used blocksize */
|
/* Align U-Boot size to currently used blocksize */
|
||||||
@ -334,8 +335,8 @@ static int nand_burn_image(size_t image_size)
|
|||||||
printf("Done!\n");
|
printf("Done!\n");
|
||||||
|
|
||||||
/* Write the image to flash */
|
/* Write the image to flash */
|
||||||
printf("Writing image:...");
|
printf("Writing %d bytes from 0x%lx to offset 0 ... ",
|
||||||
printf("&image_size = 0x%p\n", (void *)&image_size);
|
(int)image_size, get_load_addr());
|
||||||
ret = nand_write(nand, 0, &image_size, (void *)get_load_addr());
|
ret = nand_write(nand, 0, &image_size, (void *)get_load_addr());
|
||||||
if (ret)
|
if (ret)
|
||||||
printf("Error!\n");
|
printf("Error!\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user