Opened 5 years ago

Closed 5 years ago

#12090 closed defect (fixed)

XO-4 camera not working in Linux

Reported by: dsd Owned by: dsd
Priority: normal Milestone: 13.1.0
Component: ofw - open firmware Version: not specified
Keywords: Cc: cjb
Blocked By: Blocking:
Deployments affected: Action Needed: add to build
Verified: no


XO-4 camera works under OpenFirmware but not in Linux.

The issue is that no image data is captured. No interrupts arrive.

Mitch's debugging suggestions:

I would use cforth or sdkit to inspect the CCIC IRQ mask and status registers - 20a02c io@ .  and 20a030 io@ .
then I would look at the interrupt routing for irq42 - 2820a8 io@ . - should have the 0x20 bit set
then at the int42 status register - 2821cc io@ .
and the int42 mask register - 2821b4
and the irq1 status register - 28213c - should have the 0x400 bit set (bit 10, 42 - 32 = 10)

Change History (6)

comment:1 Changed 5 years ago by dsd

To map/dump CCIC registers in sdkit:

d420a000 800 mmap constant mmpcam-reg
mmpcam-reg 2c + l@ .
mmpcam-reg 30 + l@ .

Shows that IRQ mask = 0x3f (expected, confirmed that the driver set this value) and IRQ stat = 0x3f (i.e. interrupts pending).

For irq42 routing:

d4282000 1000 mmap irq-reg
irq-reg a8 + l@ .
irq-reg 1cc + l@ .
irq-reg 13c + l@ .

Routing reg (a8) returns 0x20 - so the expected bit is set

IRQ42 Status reg (1cc) returns 0

IRQ1 status reg (13c) returns 0

comment:2 Changed 5 years ago by wmb@…

There was a problem in the device tree specification for the CCIC interrupt mux and the interrupt number for CCIC1 within that mux. Fixed by svn 3289. Will be deployed in Q7A13. Test build is q7a12mb.

comment:3 Changed 5 years ago by dsd

  • Action Needed changed from diagnose to package
  • Component changed from kernel to ofw - open firmware

To check if the IRQ is masked:

irq-reg 1b4 + l@ .

(it was)

Mitch found 2 errors in the firmware. First of all the firmware was pointing to mask register 1bf for IRQ42, but it should be 1b4. That fixed the unmasking of bit 0 in that register, but image capture was still broken.

Then we unmasked all the IRQs in that space:

0 irq-reg 1b4 + l!

and an interrupt arrived on IRQ42. That was the 2nd error, confusingly CCIC2 is at bit 0, but CCIC1 (where the camera is) is at bit 1.

With the firmware fixed, Linux now correctly unmasks the IRQ and things start working.

comment:4 Changed 5 years ago by dsd

arm-3.5 commit ea0e1436cc1c3bdd66ab133653c189411533f0eb solves a camera-related hang that was often occuring during boot. Things are now in good shape with ov7670.

comment:5 Changed 5 years ago by Quozl

  • Action Needed changed from package to add to build

Q7A13 includes the fix for this.

comment:6 Changed 5 years ago by dsd

  • Resolution set to fixed
  • Status changed from new to closed

And this is shipped in recent XO4 bringup builds.

Note: See TracTickets for help on using tickets.