Re: atomisp kernel driver(s)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 1 May 2020 11:38:12 +0200
Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> wrote:

> Em Fri, 1 May 2020 10:54:18 +0200
> Patrik Gfeller <patrik.gfeller@xxxxxxxxx> escreveu:
> 
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
>  [...]  
> > 
> > Compiled and linked :-). We get some more output this time:  
> 
> Good!
> 
>  [...]  
> 
> Hmm.. your e-mailer is breaking long lines again  :-(

Ok - then the configuration option I used is not reliable. I've now switched to Claws Mail; I hope this resolves the problem.

> 
> > [    9.175421] kernel: ov2680 i2c-OVTI2680:00: gmin: initializing atomisp module subdev data.PMIC ID 1
> > [    9.178755] kernel: ov2680 i2c-OVTI2680:00: supply V1P2A not
> > found, using dummy regulator [    9.189966] kernel: proc_thermal
> > 0000:00:0b.0: enabling device (0000 -> 0002)    
> > [    9.212704] kernel: ov2680 i2c-OVTI2680:00: supply VPROG4B not
> > found, using dummy regulator
> > [    9.235024] kernel: ov2680 i2c-OVTI2680:00: supply Regulator1p8v
> > not found, using dummy regulator  
> 
> I'll check this.
> 
> > [    9.235057] kernel: proc_thermal 0000:00:0b.0: Creating sysfs
> > group for PROC_THERMAL_PCI
> > [    9.238185] kernel: ov2680 i2c-OVTI2680:00: supply Regulator2p8v
> > not found, using dummy regulator
> > [    9.337925] kernel: atomisp: module is from the staging
> > directory, the quality is unknown, you have been warned.
> > [    9.404666] kernel: atomisp-isp2 0000:00:03.0: enabling device
> > (0000 -> 0002)    
> > [    9.408680] kernel: atomisp-isp2 0000:00:03.0: ISP HPLL
> > frequency base = 1600 MHz
> > [    9.412197] kernel: atomisp-isp2 0000:00:03.0: Unsupported 
> > hw_revision 0x2010  
> 
> This is related to firmware load stuff. The code use those macros:
> 
> 	#define ATOMISP_HW_REVISION_MASK	0x0000ff00
> 	#define ATOMISP_HW_REVISION_SHIFT	8
> 	#define ATOMISP_HW_REVISION_ISP2300	0x00
> 	#define ATOMISP_HW_REVISION_ISP2400	0x10
> 	#define ATOMISP_HW_REVISION_ISP2401_LEGACY 0x11
> 	#define ATOMISP_HW_REVISION_ISP2401	0x20
> 
> 	#define ATOMISP_HW_STEPPING_MASK	0x000000ff
> 	#define ATOMISP_HW_STEPPING_A0		0x00
> 	#define ATOMISP_HW_STEPPING_B0		0x10
> 
> According with the above, 0x2010 would mean ISP2401-B0.
> 
> The code itself check those macros in order to load the right
> firmware:
> 
>         if (isp->media_dev.hw_revision ==
>             ((ATOMISP_HW_REVISION_ISP2401 <<
> ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_A0))
>                 fw_path = "shisp_2401a0_v21.bin";
> 
>         if (isp->media_dev.hw_revision ==
>             ((ATOMISP_HW_REVISION_ISP2401_LEGACY <<
> ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_A0))
>                 fw_path = "shisp_2401a0_legacy_v21.bin";
> 
>         if (isp->media_dev.hw_revision ==
>             ((ATOMISP_HW_REVISION_ISP2400 <<
> ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_B0))
>                 fw_path = "shisp_2400b0_v21.bin";
> 
>         if (!fw_path) {
>                 dev_err(isp->dev, "Unsupported hw_revision 0x%x\n",
>                         isp->media_dev.hw_revision);
>                 return NULL;
>         }
> 
> It sounds that we need to add:
> 
>         if (isp->media_dev.hw_revision ==
>             ((ATOMISP_HW_REVISION_ISP2401 <<
> ATOMISP_HW_REVISION_SHIFT) | ATOMISP_HW_STEPPING_B0))
>                 fw_path = "shisp_2401b0_v21.bin";
> 
> Eventually, other changes may be needed, depending on how different is
> this B0 revision from A0.
> 
> Patch for it pushed. Please notice that it will seek for a firmware
> named "shisp_2401b0_v21.bin".

Unfortunately I was not able to find "shisp_2401b0_v21.bin"; so I changed the values in the code and tried with "shisp_2401a0_v21.bin, irci_master_20140707_0622". I contacted Intel to see if they are willing to provide the newer firmware. Alan Cox mentioned in a commit message, that the drivers can be extracted from an "upgrade kit":

   "... The firmware files will usually be found in /etc/firmware on an Android
   device but can also be extracted from the upgrade kit if you've managed
   to lose them somehow. ..."

But I did not yet figure out what this kit is.

There is also an open support request with Intel to get some hardware/firmware documentation. But this will be difficult (as expected by you and Laurent) - their process only supports requests from companies that sign an NDA. But I opened a ticket as well to see if there's a way to get access to their developer network someway, or if it is possible that they send only the documents required. 

I also sent an Mail to the original authors of the drivers at Intel. Two of them no longer work there (mail was rejected), but one went trough. Let's see...

> 
> This driver will also check if the firmware version is:
> 
> 	"irci_ecr - master_20150911_0724"
> 
> As far as I know, the firmware is linked to the driver's code. 
> So, supporting a different firmware version will likely require
> changes at the driver.
> 
> > [    9.416174] kernel: atomisp-isp2: probe of 0000:00:03.0 failed
> > with error -2  

With the older firmware it does not look good (full dmesg output attached):
[    9.416329] ov2680 i2c-OVTI2680:00: supply Regulator1p8v not found, using dummy regulator
[    9.425878] ov2680 i2c-OVTI2680:00: supply Regulator2p8v not found, using dummy regulator
[    9.471140] atomisp-isp2 0000:00:03.0: enabling device (0000 -> 0002)
[    9.476362] proc_thermal 0000:00:0b.0: enabling device (0000 -> 0002)
[    9.478540] ov2680 i2c-OVTI2680:00: unable to set PMC rate 1
[    9.493784] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    9.495675] atomisp-isp2 0000:00:03.0: ISP HPLL frequency base = 1600 MHz
[    9.501274] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    9.510963] ov2680 i2c-OVTI2680:00: camera pdata: port: 1 lanes: 1 order: 00000002
[    9.515507] ov2680 i2c-OVTI2680:00: sensor_revision id = 0x2680, rev= 0
[    9.519100] ov2680 i2c-OVTI2680:00: register atomisp i2c module type 1
[    9.530607] proc_thermal 0000:00:0b.0: Creating sysfs group for PROC_THERMAL_PCI
[    9.585233] input: Intel HDMI/DP LPE Audio HDMI/DP,pcm=0 as /devices/pci0000:00/0000:00:02.0/hdmi-lpe-audio/sound/card0/input17
[    9.591623] input: Intel HDMI/DP LPE Audio HDMI/DP,pcm=1 as /devices/pci0000:00/0000:00:02.0/hdmi-lpe-audio/sound/card0/input18
[    9.603063] input: Intel HDMI/DP LPE Audio HDMI/DP,pcm=2 as /devices/pci0000:00/0000:00:02.0/hdmi-lpe-audio/sound/card0/input19
[    9.688254] ------------[ cut here ]------------
[    9.691775] cpu_latency_qos_update_request called for unknown object
[    9.695279] WARNING: CPU: 3 PID: 523 at kernel/power/qos.c:296 cpu_latency_qos_update_request+0x3a/0xb0
[    9.698826] Modules linked in: snd_soc_acpi_intel_match snd_rawmidi snd_soc_acpi snd_soc_rl6231 snd_soc_core ath mac80211 snd_compress snd_hdmi_lpe_audio ac97_bus hid_sensor_accel_3d snd_pcm_dmaengine hid_sensor_gyro_3d hid_sensor_trigger industrialio_triggered_buffer kfifo_buf hid_sensor_iio_common processor_thermal_device industrialio cfg80211 snd_pcm snd_seq intel_rapl_common atomisp(C+) libarc4 intel_soc_dts_iosf cros_ec_ishtp intel_xhci_usb_role_switch mei_txe cros_ec videobuf_vmalloc mei roles atomisp_ov2680(C) videobuf_core snd_seq_device snd_timer spi_pxa2xx_platform videodev snd mc dw_dmac intel_hid dw_dmac_core 8250_dw soundcore int3406_thermal int3400_thermal intel_int0002_vgpio acpi_pad acpi_thermal_rel soc_button_array int3403_thermal int340x_thermal_zone mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_sensor_custom hid_sensor_hub intel_ishtp_loader intel_ishtp_hid crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 mmc_block i2c_algo_bit
[    9.698885]  aesni_intel crypto_simd drm_kms_helper cryptd syscopyarea sysfillrect glue_helper sysimgblt fb_sys_fops cec intel_ish_ipc drm lpc_ich intel_ishtp hid_asus intel_soc_pmic_chtdc_ti asus_wmi i2c_hid sparse_keymap sdhci_acpi wmi video sdhci hid_generic usbhid hid
[    9.736699] CPU: 3 PID: 523 Comm: systemd-udevd Tainted: G         C        5.7.0-rc1+ #2
[    9.741309] Hardware name: ASUSTeK COMPUTER INC. T101HA/T101HA, BIOS T101HA.305 01/24/2018
[    9.745962] RIP: 0010:cpu_latency_qos_update_request+0x3a/0xb0
[    9.750615] Code: 89 e5 41 55 41 54 41 89 f4 53 48 89 fb 48 81 7f 28 e0 7f c6 9e 74 1c 48 c7 c6 60 f3 65 9e 48 c7 c7 e8 a9 99 9e e8 b2 a6 f9 ff <0f> 0b 5b 41 5c 41 5d 5d c3 0f 1f 44 00 00 44 3b 23 74 ef 44 89 e2
[    9.760065] RSP: 0018:ffffa865404f39c0 EFLAGS: 00010282
[    9.764734] RAX: 0000000000000000 RBX: ffff9d2aefc84350 RCX: 0000000000000000
[    9.769435] RDX: ffff9d2afbfa97c0 RSI: ffff9d2afbf99808 RDI: ffff9d2afbf99808
[    9.774125] RBP: ffffa865404f39d8 R08: 0000000000000304 R09: 0000000000aaaaaa
[    9.778804] R10: 0000000000000000 R11: 0000000000000001 R12: 00000000ffffffff
[    9.783491] R13: ffff9d2afb4640b0 R14: ffffffffc07ecf20 R15: 0000000091000000
[    9.788187] FS:  00007efe67ff8880(0000) GS:ffff9d2afbf80000(0000) knlGS:0000000000000000
[    9.792864] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    9.797482] CR2: 00007ffc6424bdc8 CR3: 0000000178998000 CR4: 00000000001006e0
[    9.802126] Call Trace:
[    9.806775]  atomisp_pci_probe.cold.19+0x15f/0x116f [atomisp]
[    9.811441]  local_pci_probe+0x47/0x80
[    9.816085]  pci_device_probe+0xff/0x1b0
[    9.820706]  really_probe+0x1c8/0x3e0
[    9.825247]  driver_probe_device+0xd9/0x120
[    9.829769]  device_driver_attach+0x58/0x60
[    9.834294]  __driver_attach+0x8f/0x150
[    9.838782]  ? device_driver_attach+0x60/0x60
[    9.843205]  ? device_driver_attach+0x60/0x60
[    9.847634]  bus_for_each_dev+0x79/0xc0
[    9.852033]  ? kmem_cache_alloc_trace+0x167/0x230
[    9.856462]  driver_attach+0x1e/0x20

Well - It did more things than before. But my fear is that we really depend on the rev b firmware, which is very difficult to get hold of :-(.

> 
> That's because it didn't load the firmware.
> 
> Thanks,
> Mauro

with kind regards,
Patrik

Attachment: dmesg.01.05.2020-atomisp.txt.tar.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux