[coreboot] [flashrom] unusual SST39SF020 chip

Andriy Gapon avg at icyb.net.ua
Sat May 17 10:52:29 CEST 2008

on 17/05/2008 02:29 Carl-Daniel Hailfinger said the following:
> On 16.05.2008 08:03, Andriy Gapon wrote:
>> on 15/05/2008 15:48 Andriy Gapon said the following:
>>> on 15/05/2008 15:36 Carl-Daniel Hailfinger said the following:
>>>> I think we can merge the outb -> lin_outb change, though I we may want
>>>> to call it outb_wrapper or somesuch. Can you send that as a separate
>>>> patch?
>>> Maybe call it "OUTB"?
>>> Will get back a little bit later with the change.
>> Here's a new FreeBSD porting patch.
>> I put FreeBSD (re-)definitions into flash.h, so that they are visible
>> in all .c files.
>> outb is renamed to OUTB.
>> Also, on FreeBSD for access to IO ports you have to have /dev/io open,
>> this is added in flashrom.c.
>> Changes in Makefile: /usr/local/include /usr/local/lib are needed in
>> the paths for libpci.
>> I also had to drop -Werror because compilation produced some warnings
>> (in outb calls) that I couldn't fix:
>> warning: comparison is always true due to limited range of data type
>> flashrom build obviously requires libpci (from devel/libpci port or
>> package) and gmake.
> Thanks for the patch! It looks quite nice and I think we can merge it,
> but you'll have to rework the Makefile changes. I suggest to rework the
> Makefile as a separate patch.
> Please add a Signed-off-by statement to your patch, otherwise we can't
> commit. See
> http://www.coreboot.org/Development_Guidelines#Sign-off_Procedure for
> details.

I've just done that.
BTW, I've just also determined that the warning is because of the type 
used by flashrom for IO port number. It is uint16_t, and FreeBSD 
apparently supports uint32_t and has some checks for actual value.
If I change type of variables/parameters used to store the port number 
to uint32_t the the warning goes away.
Do you think it would be good to make this change in flashrom sources?
Or is it better to write more elaborate wrappers that would use 
temporary variable of uint32_t type?

Andriy Gapon

More information about the coreboot mailing list