[LinuxBIOS] Flashrom and superiotool on non-x86 platforms?

Uwe Hermann uwe at hermann-uwe.de
Wed Oct 24 00:23:01 CEST 2007


On Mon, Oct 22, 2007 at 05:59:29PM +0200, Carl-Daniel Hailfinger wrote:
> On 22.10.2007 17:44, Stefan Reinauer wrote:
> > * ron minnich <rminnich at gmail.com> [071022 17:37]:
> >   
> >> On 10/21/07, Peter Lemenkov <lemenkov at gmail.com> wrote:
> >>     
> >>> Hello All!
> >>> Does anybody tried to use linuxbios and LB-tools on non-x86 platforms?
> >>> There are some issues we need to fir even for compilation (not for
> >>> successful usage).
> >>>
> >>> One thing I found so far is excessive usage of non-portable inb/outb
> >>> macros. For instance - inb may be emulated as folliwing:
> >>>
> >>> +unsigned char inb (unsigned short int port)
> >>> +{
> >>> +       static unsigned char in = 0;
> >>> +       FILE* f = fopen ("/dev/port", "a");
> >>> +       if (f !=NULL){
> >>> +               if (fseek (f, port, SEEK_SET) == port){
> >>> +                       fread (&in, sizeof (unsigned char), 1, f);
> >>> +                       fclose (f);
> >>> +                       return in;
> >>> +               }
> >>> +       }
> >>> +       return ERROR;
> >>>       
> >  
> > Ok, which platforms does this actually fix? Has this been tested?
> >
> > I know it _breaks_ just about every x86 platform except Linux.
> >
> > So, we should deliberate before going this route.
> >   
> 
> Sorry, I don't see any reason to do this now. Maybe later when there is
> any platform besides x86 which we intend to support.

It would be nice to do for those platforms which don't have inb/oub but
_do_ provide a /dev/port. I have no idea if such platforms exist
though, or which those are.

I'm pretty sure we can make superiotool compile everywhere where
flashrom compiles (this includes some non-Linux and non-x86 boxes).

Whether it'll also _work_ on such boxes depends and should be tested.


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20071024/c0af181e/attachment.sig>


More information about the coreboot mailing list