On Sat, 2006-12-09 at 01:00 +0100, Arnd Bergmann wrote: > On Friday 08 December 2006 23:50, Benjamin Herrenschmidt wrote: > > > > > > > > + info->io.regsize = resource0.end - resource0.start + 1; > > > + info->io.regspacing = resource1.start - resource0.start; > > > > > > Are you sure this is a reliable way to check the register spacing and > > > register size? Register size means "how big is a register (8, 16, 32 > > > bits)". Register spacing means (how many bytes are there between > > > registers. If you had two registers that were 8 bits and 4 bytes > > > apart, for instance, I don't believe the above calculations would work. > > > > How many registers do we expect here ? Might be better to have one > > resource represent the whole MMIO area, and have a separate property > > that indicates the stride between 2 registers. > > I think the current representation is perfect. AFAICS, there are always > two registers, but depending on the HW implementation, they may be > between 1 and 4 bytes wide, and can have a different spacing. > > By having two separate areas in the reg property, the driver can > easily determine both the size and the spacing. It will then do > a single ioremap that spans both anyway.
For only 2 registers, it makes sense yes. Ben. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Openipmi-developer mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openipmi-developer
