[coreboot] flashrom: Probe for up to 3 flash chips. [was: Fix ambiguity, if a board is equipped with more than one chip]
Carl-Daniel Hailfinger
c-d.hailfinger.devel.2006 at gmx.net
Mon May 5 19:10:07 CEST 2008
On 05.05.2008 18:29, Peter Stuge wrote:
> On Mon, May 05, 2008 at 06:00:13PM +0200, Carl-Daniel Hailfinger wrote:
>
>
>>> printf("Flash part is %s (%d KB).\n", flash->name, flash->total_size);
>>>
>> Move that statement into the loop above, please.
>>
>
> No need since the probe() function always prints the name of the
> found flash chip.
>
Either the statement is redundant and we remove it completely, or we
move it inside the loop. IMO requiring the user to look up flash chip
size from a model number is not the way to go.
>> Otherwise, this is
>> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>>
>
> Thanks, but I'm still waiting for Claus to test that it works on his
> hardware.
>
>
> On Mon, May 05, 2008 at 06:06:53PM +0200, Carl-Daniel Hailfinger wrote:
>
>>>> + for (i = 0; i < ARRAY_SIZE(flashes); i++) {
>>>> + flashes[i] = probe_flash(i ? flashes[i - 1] + 1 : flashchips);
>>>> + if (!flashes[i])
>>>>
>>>>
>> Missing break. This loop runs ARRAY_SIZE(flashchips) times even if the
>> first probe failed.
>>
>>
>>>> + for (i++; i < ARRAY_SIZE(flashes); i++)
>>>> + flashes[i] = NULL;
>>>>
>
> The same counter is used to clear remaining entries so that the outer
> loop also is finished after the first failed probe.
>
I see.
Regards,
Carl-Daniel
More information about the coreboot
mailing list