From 18e76fb12636d89d9d4c6f07baa87dfed2217a59 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Thu, 3 Mar 2016 12:44:17 +0100 Subject: [PATCH] Minor changes in common spi_flash.c --- u-boot/board/ar7240/common/spi_flash.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/u-boot/board/ar7240/common/spi_flash.c b/u-boot/board/ar7240/common/spi_flash.c index d066571..7b03625 100644 --- a/u-boot/board/ar7240/common/spi_flash.c +++ b/u-boot/board/ar7240/common/spi_flash.c @@ -1,7 +1,7 @@ /* - * Copyright (C) 2015 Piotr Dymacz + * Copyright (C) 2016 Piotr Dymacz * - * SPDX-License-Identifier:GPL-2.0 + * SPDX-License-Identifier: GPL-2.0 */ #include @@ -40,6 +40,10 @@ static u32 flash_info_find(flash_info_t *info, u32 jedec_id) return 1; } +/* + * Scan all configured FLASH banks one by one + * and try to get information about the chips + */ u32 flash_init(void) { u32 bank, i, jedec_id, sfdp_size, sfdp_ss; @@ -109,7 +113,7 @@ u32 flash_init(void) info->sector_count = info->size / info->sector_size; } - for (i = 0; i < info->sector_count; i++){ + for (i = 0; i < info->sector_count; i++) { info->start[i] = CFG_FLASH_BASE + total_size + (i * info->sector_size); } @@ -120,6 +124,12 @@ u32 flash_init(void) return total_size; } +/* + * Erase all FLASH sectors in provided range + * + * TODO: + * - use some LED for indication that we are erasing? + */ u32 flash_erase(flash_info_t *info, u32 s_first, u32 s_last) @@ -147,8 +157,6 @@ u32 flash_erase(flash_info_t *info, return 0; } - - /* * Write a buffer from memory to a FLASH: * call page program for every <= 256 bytes -- 2.25.1