Ticket #12090 (closed defect: fixed)

Opened 2 years ago

Last modified 23 months ago

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
Action Needed: add to build Verified: no
Deployments affected: Blocked By:
Blocking:

Description

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

Changed 2 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

Changed 2 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.

Changed 2 years ago by dsd

  • next_action 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.

Changed 2 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.

Changed 23 months ago by Quozl

  • next_action changed from package to add to build

Q7A13 includes the fix for this.

Changed 23 months ago by dsd

  • status changed from new to closed
  • resolution set to fixed

And this is shipped in recent XO4 bringup builds.

Note: See TracTickets for help on using tickets.