All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: linux-media@vger.kernel.org
Subject: Ressurect the atomisp staging driver - current progress
Date: Fri, 15 May 2020 11:37:36 +0200	[thread overview]
Message-ID: <20200515113736.6af67e0a@coco.lan> (raw)
In-Reply-To: <20200504154420.5dcf505f@ASUS>

Hi,

I've been trying to ressurrect the driver for the Atom camera hardware,
for systems based on ISP2401, e. g. the ones with this ISP:

	00:03.0 Multimedia controller: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series Imaging Unit (rev ff) (prog-if ff)
		!!! Unknown header type 7f
		Kernel modules: atomisp_css2401a0_v21

	00:0a.0 Non-VGA unclassified device: Intel Corporation Device 22d8 (rev 36)
		Subsystem: ASUSTeK Computer Inc. Device 13a0
		Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
		Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
		Latency: 0, Cache Line Size: 64 bytes
		Interrupt: pin A routed to IRQ 20
		Region 0: Memory at 91a3a000 (32-bit, non-prefetchable) [size=4K]
		Capabilities: <access denied>
		Kernel driver in use: intel_ish_ipc
		Kernel modules: intel_ish_ipc

Right now, the patches are on this branch:

	https://git.linuxtv.org/mchehab/experimental.git/log/?h=atomisp_v2.1

This is based on a previous attempt of upstreaming it to staging,
started by Alan Cox. This was removed back in 2018. I fixed it
to work with Kernel 5.7 and solved several issues that were preventing
it from powering the cameras. This version should support earlier
versions (ISP2400-based), by selecting an option compile-time.

The initial goal is to have a working version. One of the problems with
this device is that firmware and drivers are very closely linked. 
As I was unable to find the versions used on Alan's port, I also 
made an alternate version, using a driver from the Yocto Aero tree
ported to Kernel 5.7-rc2, re-using the work we've done so far at the
original port for it to work with the current Kernel kAPI.

For such second version, I used the Kernel sources found on this
repository:

	https://download.01.org/aero/deb/pool/main/l/linux-4.4.76-aero-1.3/

Such port is at the atomisp_yocto_v1:

	https://git.linuxtv.org/mchehab/experimental.git/log/?h=atomisp_yocto_v1

(there's a variant of it at https://git.linuxtv.org/mchehab/experimental.git/log/?h=atomisp-with-yocto-patchset,
 with would preserve the history of atomisp changes from Yocto's tree)

The firmware used on such version is at:
	https://download.01.org/aero/deb/pool/main/f/firmware-atomisp/firmware-atomisp_0.1.orig.tar.xz

If the ISP revision is equal or bigger than rev 02, this file should be
renamed to:

	shisp_2401b0_v21.bin

The goal of the alternate fork is just to use a driver code base that
it is known to work in the past and has a firmware that it is still
available. It should be noticed that the alternate version is for
ISP2401 only (PCI ID 8086:22d8). It would probe on other versions, but
it probably won't work.

As I don't have the Intel Aero controller card (nor the camera, with 
comes with the drone hardware), I'm doing my tests on an Asus T101HA.

Before getting excited, both versions failed at the tests I've been
doing so far.

The camera sensor detection is working fine and it is able to power
the camera off/on (when driver loads, it makes the camera usage led
indicator to quickly flash):

	ov2680 i2c-OVTI2680:00: ov2680_probe: ACPI detected it on bus ID=CAM1, HID=OVTI2680
	ov2680 i2c-OVTI2680:00: gmin: power management provided via Dollar Cove TI PMIC (i2c addr 0x5e)
	ov2680 i2c-OVTI2680:00: Found DMI entry for 'OVTI2680:00_CamClk'
	ov2680 i2c-OVTI2680:00: Found DMI entry for 'OVTI2680:00_ClkSrc'
	ov2680 i2c-OVTI2680:00: Found DMI entry for 'OVTI2680:00_CsiPort'
	ov2680 i2c-OVTI2680:00: Found DMI entry for 'OVTI2680:00_CsiLanes'
	ov2680 i2c-OVTI2680:00: Found DMI entry for 'gmin_V1P8GPIO'
	ov2680 i2c-OVTI2680:00: Found DMI entry for 'gmin_V2P8GPIO'
	ov2680 i2c-OVTI2680:00: camera pdata: port: 1 lanes: 1 order: 00000002
	ov2680 i2c-OVTI2680:00: sensor_revision id = 0x2680, rev= 0
	ov2680 i2c-OVTI2680:00: register atomisp i2c module type 1

However, the ISP code still have issues that seem to be firmware-related.

At the first version, testing with either the original firmware from 
Windows or the version from Intel Aero causes a warning when the
devnode is opened:

	atomisp-isp2 0000:00:03.0: open device ATOMISP ISP VIEWFINDER output
	sh_css_hrt_system_is_idle() 44: warning: SP not idle
	sh_css_hrt_system_is_idle() 49: warning: ISP not idle
	atomisp-isp2 0000:00:03.0: open device ATOMISP ISP VIDEO output
	sh_css_hrt_system_is_idle() 56: warning: FIFO channel 12 is not empty
	sh_css_hrt_system_is_idle() 56: warning: FIFO channel 26 is not empty
	atomisp-isp2 0000:00:03.0: css init failed --- bad firmware?
	atomisp-isp2 0000:00:03.0: atomisp_mrfld_pre_power_down: error in iunit interrupt. status reg=0xffffffff

It sounds that the firmware was properly loaded there, but somehow,
it is not answering as expected.

The second version produces this error:

	atomisp: Loaded firmware version 'irci_stable_candrpv_0415_20150521_0458'.
	atomisp-isp2 0000:00:03.0: css load fw failed.
	atomisp-isp2 0000:00:03.0: Failed to init css.

I didn't try to check why it is failing yet - maybe it is just
something related to the port itself.

If someone has access to the Intel Aero board, I'd appreciate if you
could test it and send the results. If it fails too, it would be
nice to have the dmesg output of this version and the dmesg from
a version which works.

It would also be good to have a second pair of eyes on it.

Thanks,
Mauro

  parent reply	other threads:[~2020-05-15  9:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 19:57 [GIT PULL] Ressurect the atomisp staging driver Mauro Carvalho Chehab
2020-05-02  6:03 ` Greg KH
2020-05-20  7:48   ` Mauro Carvalho Chehab
2020-05-03  9:19 ` Francescodario Cuzzocrea
2020-05-03 10:07   ` Mauro Carvalho Chehab
2020-05-03 15:32   ` Mauro Carvalho Chehab
     [not found]     ` <CADnVkj96W0QfthukTKQ0a-i2fH1buooH3BEgfy22J9H9=_PcKA@mail.gmail.com>
2020-05-03 16:07       ` Patrik Gfeller
2020-05-04  8:16         ` Patrik Gfeller
2020-05-04  8:49           ` Mauro Carvalho Chehab
2020-05-04 10:45             ` Patrik Gfeller
2020-05-04 12:08               ` Mauro Carvalho Chehab
2020-05-04 13:44                 ` Patrik Gfeller
2020-05-15  8:32                   ` Mauro Carvalho Chehab
2020-05-15  9:10                     ` Hans de Goede
2020-05-15  9:42                       ` Mauro Carvalho Chehab
2020-05-19  7:39                         ` Mauro Carvalho Chehab
2020-05-19 17:36                           ` Mauro Carvalho Chehab
2020-05-22 10:46                             ` Hans de Goede
2020-05-22 11:42                               ` Mauro Carvalho Chehab
2020-05-23  8:00                                 ` Mauro Carvalho Chehab
2020-05-27 16:23                                   ` Hans de Goede
2020-05-27 17:36                                     ` Mauro Carvalho Chehab
2020-05-15  9:37                   ` Mauro Carvalho Chehab [this message]
2020-05-06 15:10                 ` Mauro Carvalho Chehab
2020-05-03  9:23 ` bosconovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200515113736.6af67e0a@coco.lan \
    --to=mchehab@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.