From: Piotr Dymacz Date: Thu, 3 Mar 2016 11:44:17 +0000 (+0100) Subject: Minor changes in common spi_flash.c X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=18e76fb12636d89d9d4c6f07baa87dfed2217a59;p=oweals%2Fu-boot_mod.git Minor changes in common spi_flash.c --- 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