Skip to contentSkip to conversation

mxc: i2c register mapped twice?

DISCUSSION Richard Zhao 3 participants 3 messages Jan 6, 2011 – Jan 7, 2011

lore
Share & tools
lore
#0 lore raw

Hi Sascha,

I just realized i2c registers are mapped twice. It's first static mapped at mx5x_io_desc and second mapped in driver.
Drivers always feel happy to receive physical address in resource, and ioremap it itself. We might static map too many register regions in machine level? I'm sure it's not just i2c.

Thanks
Richard

#1 lore raw
Quoted 7 lines · Richard Zhao

Hi Sascha,

I just realized i2c registers are mapped twice. It's first static mapped at mx5x_io_desc and second mapped in driver.
Drivers always feel happy to receive physical address in resource, and ioremap it itself. We might static map too many register regions in machine level? I'm sure it's not just i2c.

There are some devices which use the static mappings, like watchdog (for reset), irq controller, gpt. Otherwise you are right. Feel free to cleanup here if you think there are unnecessary mappings.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#2 lore raw
In reply to Richard Zhao
Quoted 7 lines · Richard Zhao

Hi Sascha,

I just realized i2c registers are mapped twice. It's first static mapped at mx5x_io_desc and second mapped in driver.
Drivers always feel happy to receive physical address in resource, and ioremap it itself. We might static map too many register regions in machine level? I'm sure it's not just i2c.

either cleanup the mapping, or add a custom ioremap() to return this region for the drivers.