On Thu, 31 Mar 2011 13:03:54 +0200
Stefan Tauner <[email protected]> wrote:

> On Thu, 31 Mar 2011 08:45:39 +0200
> Carl-Daniel Hailfinger <[email protected]> wrote:
> 
> > Could you patch physmap instead to round down the requested address
> > and round up the end of the range? Then we could just request the
> > amount we need without having to care in each programmer driver
> > about page size. I think somewhere in flashrom we even have
> > rounding code for physmap, it just needs to be moved from a driver
> > to the generic physmap.
> 
> oh. steep learning curve there. :)
> not because the rounding is complicated, but because i am not sure i
> am aware of all side effects.
> i guess the existing rounding code you was referring to is that in
> sb600spi.c?
> 
> what i can do/propose for now:
> change physmap_common as follows:
> instead of the two check including getpagesize():
> - round down the physical address requested later from phys_to_virt to
>   the nearest getpagesize()-aligned address
> - round up the length requested later accordingly i.e. request a
>   physical window that is aligned to pages and includes at least the
>   memory described by phys_addr + len
> - return virt_addr after adding the offset from rounding down the
>   physical address
> - change nicintel_spi.c accordingly

we also need something similar for physunmap(...).
would the same rounding be sufficient?
how should we implement that? a function void getWindow(*addr, *len)
that sets the addr and len and will be called by physmap and physunmap?
or is that too complicated?
-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner

_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to