Skip to contentSkip to conversation

Regmap and register ranges

DISCUSSION Dmitry Torokhov 2 participants 2 messages May 17, 2013 – May 18, 2013 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 8 lines · Mark Brown
Quoted 5 lines · Dmitry Torokhov

I am looking at regmap and I wonder if I am missing something with the way it checks if a window crosses another range boundary or if a selector is in some other window as it seem to be always tripping on itself. Should we skip the current range as we iterate through them and do sanity checks?

Quoted 8 lines
Quoted 2 lines

The setup: a device with 0x0000 - 0xffff potential register range, paged in chunks of 256 registers with page selector register repeated at 0xff.

The general idea is that the pages should be mapped in to virtual addresses rather than real ones so in your example you might add a prefix so all the registers are numbered 0x10000 to 0x1ffff. The physical registers and the ones inside the paged range aren't supposed to overlap.

The issue I have with doing an arbitrary offset is that then data exposed in debugfs does not match the data from device's specification.

Quoted 4 lines

We should probably either do sanity checks for this at init time or come up with a sensible way to support this in case someone does decide to do it, though this is the first time anyone noticed.

Does this mean you'll be open to patches allowing this scenario?

Thanks.

Signature · 1 line
Dmitry
#3 lore raw
Quoted 10 lines · Dmitry Torokhov
Quoted 5 lines · Mark Brown

The general idea is that the pages should be mapped in to virtual addresses rather than real ones so in your example you might add a prefix so all the registers are numbered 0x10000 to 0x1ffff. The physical registers and the ones inside the paged range aren't supposed to overlap.

The issue I have with doing an arbitrary offset is that then data exposed in debugfs does not match the data from device's specification.

Adding a random prefix on the front does mean you can just ignore the prefix. But this seems a fairly odd way for the device to do things to be honest... paging every single register is a bit random.

Quoted 5 lines
Quoted 3 lines

We should probably either do sanity checks for this at init time or come up with a sensible way to support this in case someone does decide to do it, though this is the first time anyone noticed.

Does this mean you'll be open to patches allowing this scenario?

Obviously I'm always open to patches that aren't crazy, though I do reserve the right to define what's crazy :)