From: Reinhard Meyer Date: Tue, 28 Oct 2014 11:07:20 +0100 Subject: [U-Boot] [PATCH] Disable FLASH_AMLV256U support for TOP860 target In-Reply-To: <20141028094822.14406382FEC@gemini.denx.de> References: <1402929691-3972-1-git-send-email-vvv444@gmail.com> <20141028093348.43664382FEC@gemini.denx.de> <20141028094822.14406382FEC@gemini.denx.de> Message-ID: <544F6AD8.2070605@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 28.10.2014 10:48, schrieb Wolfgang Denk: > Dear Reinhard, > > In message Vasili Galka wrote: >> You're right, that would probably be a better solution. Although I'm not a >> user of TOP860 board so I'm not really the right person to ask... >> I just found this bug theoretically from looking on compiler warnings and >> suggested a possible solution. >> >> Best, >> Vasili >> >> On Tue, Oct 28, 2014 at 11:33 AM, Wolfgang Denk wrote: >> >>> Dear Vasili, >>> >>> In message >> hZtM1FVgpd8p-eEW19bQ at mail.gmail.com> you wrote: >>>>> TOP860 configuration assumes at most 128 flash sectors. Thus, the >>>>> AMLV256U flash can't be supported. The existing code could result in >>>>> memory corruption when writing to the flash_info->start[] array. >>>>> >>>>> Signed-off-by: Vasili Galka >>>>> Cc: Wolfgang Denk >>>>> --- >>>>> board/emk/common/flash.c | 4 +++- >>>>> 1 files changed, 3 insertions(+), 1 deletions(-) >>>>> >>>>> diff --git a/board/emk/common/flash.c b/board/emk/common/flash.c >>>>> index ae5777c..4119b3b 100644 >>>>> --- a/board/emk/common/flash.c >>>>> +++ b/board/emk/common/flash.c >>>>> @@ -324,6 +324,7 @@ ulong flash_get_size (FPWV *addr, flash_info_t >>> *info) >>>>> } >>>>> break; >>>>> } >>>>> +#ifndef CONFIG_TOP860 >>>>> if ((FPW)addr[FLASH_ID3] == (FPW)AMD_ID_LV256U_2 && >>>>> (FPW)addr[FLASH_ID4] == (FPW)AMD_ID_LV256U_3) >>>>> { >>>>> @@ -337,7 +338,8 @@ ulong flash_get_size (FPWV *addr, flash_info_t >>> *info) >>>>> } >>>>> break; >>>>> } >>>>> - >>>>> +#endif >>>>> + >>>>> /* fall thru to here ! */ >>>>> default: >>>>> printf ("unknown AMD device=%x %x %x", >>>>> -- >>>>> 1.7.9 >>>>> >>>>> >>>> Any review? >>>> This was inspired by a a compiler warning. I'm still getting this warning >>>> on the latest master. >>> Sorry, I missed that one. >>> >>> Would it not be more appropriate to adjust the CONFIG_SYS_MAX_FLASH_SECT >>> setting in "include/configs/TOP860.h"? Or are you 100% sure that >>> there were never be any AMLV256U flash chips fit on a TOP860 board? > > Maybe you can comment? > > Or is the TOP860 board so obsolete that we can remove it alltogether? > > What about the other boards in board/emk ? I don't see any real > changes there during the last 5 years or so? Are these still > actively maintained? > > Best regards, > > Wolfgang Denk > Dear Wolfgang, top860 can be removed (We already had that discussion a while ago.) top5200 is still active in several older projects, but there was no need to make changes to u-boot or to integrate new features of u-boot. Therefore I am not testing whether any changes to u-boot break the function of top5200. top9000 is dead. Thanks atmel :( However it might be left in u-boot as an example. Best regards, Reinhard