Attached_mmio with platform_drv

Stefan Kalkowski stefan.kalkowski at genode-labs.com
Thu Sep 3 15:20:30 CEST 2020


Hello Pirmin,

On Thu, Sep 03, 2020 at 12:25:35PM +0200, Duss Pirmin wrote:
> Hello Stefan
> 
> On 02.09.20 17:00, Stefan Kalkowski wrote:
> > You encounter a synchronous, external data-abort. I don't know which I2C
> > bus you try to access, and what clocks you configured for it in the
> > device configuration of the platform driver. However, can you try to
> > access the same I2C bus within base-hw bootstrap, before the MMU is
> > enabled using physical addresses directly? Maybe, the problem is related to
> > the fact that you access the MMIO region from the userland?
> > I've encountered a similar problem when accessing the GPC (general
> > power controller).
> 
> I try to use the I2C bus no 2 (0x30a30000 ... 0x30a30010).
> 
> I have added a `{ 0x30a30008, 0x0}` to `iomux_values` in
> ./base-hw/src/bootstrap/spec/imx8q_evk/platform.cc.
> 
> When I boot a kernel with this change, teh following error occurs:
> 
> "Error" handler, esr 0xbf000002
> elr: 0000000040029001 lr : 0000000040028f65 (reloc)
> elr: 0000000040029000 lr : 0000000040028f64
> x0 : 00000000400177a0 x1 : 0000000030388000
> x2 : 0000000000001000 x3 : 0000000030200000
> x4 : 0000000030200004 x5 : 0000000030200018
> x6 : 0000000000002328 x7 : 00000000ffffffff
> x8 : 0000000030200014 x9 : 0000000030200010
> x10: 000000003020000c x11: 0000000000000000
> x12: 0000000000000001 x13: 00000000000000a0
> x14: 00000000000000ff x15: 0000000000000003
> x16: 0000000000000000 x17: 0000000038800000
> x18: 00000000000004f8 x19: 0000000040039548
> x20: 00000000400398a8 x21: 0000000000000400
> x22: 0000000000000000 x23: 00000000ff92bf78
> x24: 00000000ff92bf78 x25: 0000000000000400
> x26: 00000000fffc3c70 x27: 0000000000000000
> x28: 0000000040039868 x29: 0000000040017770
> 
> Regards
> Pirmin
> 

The reason for the fault you've observed is that you access a 16-bit
register of the device with a 4-byte access. Please, assure that you
enter those 16-bit registers with 2-byte accesses.
When accessing the second I2C controller in bootstrap accordingly, the
cpu halts indeed because the clocks for the controller are off.
When using the imx8mq_platform_drv with the following device
configuration:

  <device name="i2c2">
    <io_mem address="0x30a30000" size="0x10000"/>
    <irq    number="68"/>
    <clock  name="i2c2_clk_root"/>
    <clock  name="i2c2_gate"/>
  </device>

I could successfully read the second I2C controller registers from a
userland component that acquired this device from the platform driver.

Regards
Stefan

> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users


-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org



More information about the users mailing list