From mboxrd@z Thu Jan 1 00:00:00 1970 From: kostap at marvell.com Date: Tue, 28 Mar 2017 18:16:56 +0300 Subject: [U-Boot] [PATCH 3/5] arm64: mvebu: Fix the bubt comamnd NAND device support In-Reply-To: <1490714218-24012-1-git-send-email-kostap@marvell.com> References: <1490714218-24012-1-git-send-email-kostap@marvell.com> Message-ID: <1490714218-24012-4-git-send-email-kostap@marvell.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Konstantin Porotchkin Fix the NAND structures in bubt command according to latest changes in MTD API. Signed-off-by: Konstantin Porotchkin Cc: Stefan Roese Cc: Igal Liberman Cc: Nadav Haklai --- cmd/mvebu/bubt.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index b752927..1e1f0af 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -309,16 +309,17 @@ static int is_spi_active(void) #ifdef CONFIG_CMD_NAND static int nand_burn_image(size_t image_size) { - int ret, block_size; - nand_info_t *nand; + int ret; + uint32_t block_size; + struct mtd_info *nand; int dev = nand_curr_device; if ((dev < 0) || (dev >= CONFIG_SYS_MAX_NAND_DEVICE) || - (!nand_info[dev].name)) { + (!nand_info[dev]->name)) { puts("\nno devices available\n"); return -ENOMEDIUM; } - nand = &nand_info[dev]; + nand = nand_info[dev]; block_size = nand->erasesize; /* Align U-Boot size to currently used blocksize */ @@ -334,8 +335,8 @@ static int nand_burn_image(size_t image_size) printf("Done!\n"); /* Write the image to flash */ - printf("Writing image:..."); - printf("&image_size = 0x%p\n", (void *)&image_size); + printf("Writing %d bytes from 0x%lx to offset 0 ... ", + (int)image_size, get_load_addr()); ret = nand_write(nand, 0, &image_size, (void *)get_load_addr()); if (ret) printf("Error!\n"); -- 2.7.4