From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Patrik Gfeller <patrik.gfeller@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: atomisp kernel driver(s)
Date: Fri, 1 May 2020 11:38:12 +0200 [thread overview]
Message-ID: <20200501113812.7f16b7ca@coco.lan> (raw)
In-Reply-To: <1a17ffad-9792-a4ff-519e-a4306e7bf3e1@gmail.com>
Em Fri, 1 May 2020 10:54:18 +0200
Patrik Gfeller <patrik.gfeller@gmail.com> escreveu:
> On 01.05.20 00:25, Mauro Carvalho Chehab wrote:
> > Em Thu, 30 Apr 2020 17:09:48 +0200
> > Patrik Gfeller <patrik.gfeller@gmail.com> escreveu:
> >
> >> Am 4/30/2020 um 12:55 PM schrieb Mauro Carvalho Chehab:
> >>> Em Thu, 30 Apr 2020 09:56:53 +0200
> >>> Patrik Gfeller<patrik.gfeller@gmail.com> escreveu:
> >>>
> >>>> For my first test tried to re-compile to module, without the whole
> >>>> kernel. That was a mistake, as I mixed something up, probably it loaded
> >>>> an old version of the module ... to be on the save side the steps I used
> >>>> this time (in case we see something unexpected and for my later reference):
> >>>>
> >>>> $ git log --oneline
> >>>> 4c922df10252 (HEAD -> atomisp, origin/atomisp) media: atomisp2: get rid
> >>>> of ia_css_sc_param.h version dependency
> >>>> ...
> >>>>
> >>>> $ make -j4 clean
> >>>> $ make -j4
> >>>> $ sudo make modules_install INSTALL_MOD_STRIP=1
> >>>> $ sudo make install
> >>> Please try to build from this branch:
> >>>
> >>> https://git.linuxtv.org/mchehab/experimental.git/log/?h=atomisp_v2
> >>>
> >>> You'll need to setup a new config var there. So, please run this before
> >>> make clean. So, for building it, you will do:
> >>>
> >>> $ ./scripts/config -e CONFIG_VIDEO_ATOMISP_ISP2401 && make -j modules_prepare
> >>> $ make -j4 clean && make -j4
> >>> $ sudo make modules_install INSTALL_MOD_STRIP=1 && sudo make install
> >>>
> >>> This won't change the regulator detection, but it should hopefully use
> >>> the ISP2401-specific code, with seems to be needed for your device.
> >> I've updated to the latest source (git checkout atomisp_v2 && git pull)
> >> and compiled using the instructions above. Compilation worked well, but
> >> the linker had some problems (full log attached):
> >>
> >> ...
> >> ld:
> >> drivers/staging/media/atomisp/pci/css_2401_system/hive_isp_css_2401_system_generated/ia_css_isp_states.o:(.data+0x0):
> >> multiple definition of `ia_css_kernel_init_state';
> >> drivers/staging/media/atomisp/pci/css_2401_csi2p_system/hive_isp_css_2401_system_csi2p_generated/ia_css_isp_states.o:(.data+0x0):
> >> first defined here
> >> ...
> > Ok. That's because there are two "hive" variants. the building system
> > should use either one of them (but not both at the same time).
> >
> > I didn't get the error before because I was just building a module
> > (that speeds up the development). Such errors only happen on a full
> > build.
> >
> > Fixed.
> >
> > As I did a git rebase (in order to have something that we could
> > upstream later), you'll need to use this procedure to update:
> >
> > $ git remote update
> > $ git reset --hard origin/atomisp_v2
> >
> > There's no need to clean your last build. Just run:
> >
> > $ make -j4
> >
> > And it should build fine this time.
>
> Compiled and linked :-). We get some more output this time:
Good!
>
> [ 9.120066] kernel: videodev: Linux video capture interface: v2.00
>
> [ 9.141554] kernel: atomisp_ov2680: module is from the staging
> directory, the quality is unknown, you have been warned.
Hmm.. your e-mailer is breaking long lines again :-(
> [ 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".
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
That's because it didn't load the firmware.
Thanks,
Mauro
next prev parent reply other threads:[~2020-05-01 9:38 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-18 14:39 atomisp kernel driver(s) Patrik Gfeller
2020-04-18 15:25 ` Mauro Carvalho Chehab
2020-04-18 15:26 ` Mauro Carvalho Chehab
2020-04-18 15:37 ` Patrik Gfeller
2020-04-19 23:31 ` Mauro Carvalho Chehab
2020-04-20 17:48 ` Patrik Gfeller
2020-04-20 18:27 ` Patrik Gfeller
2020-04-20 20:47 ` Mauro Carvalho Chehab
2020-04-22 17:56 ` Patrik Gfeller
2020-04-22 19:13 ` Mauro Carvalho Chehab
2020-04-24 8:52 ` Patrik Gfeller
2020-04-24 9:10 ` Patrik Gfeller
2020-04-24 10:07 ` Patrik Gfeller
2020-04-24 13:58 ` Patrik Gfeller
2020-04-25 11:22 ` Mauro Carvalho Chehab
2020-04-26 11:38 ` Patrik Gfeller
2020-04-26 16:50 ` Mauro Carvalho Chehab
2020-04-27 18:31 ` Patrik Gfeller
2020-04-27 21:50 ` Mauro Carvalho Chehab
2020-04-28 17:59 ` Patrik Gfeller
2020-04-28 23:13 ` Mauro Carvalho Chehab
2020-04-29 17:56 ` Patrik Gfeller
2020-04-29 18:17 ` Mauro Carvalho Chehab
2020-04-30 7:56 ` Patrik Gfeller
2020-04-30 10:55 ` Mauro Carvalho Chehab
2020-04-30 15:09 ` Patrik Gfeller
2020-04-30 22:25 ` Mauro Carvalho Chehab
2020-05-01 8:54 ` Patrik Gfeller
2020-05-01 9:38 ` Mauro Carvalho Chehab [this message]
2020-05-01 17:31 ` Patrik Gfeller
2020-05-01 19:30 ` Mauro Carvalho Chehab
2020-05-02 8:15 ` Patrik Gfeller
2020-05-02 9:20 ` Patrik Gfeller
2020-05-02 10:00 ` Mauro Carvalho Chehab
2020-05-02 9:34 ` Mauro Carvalho Chehab
2020-05-02 14:29 ` Patrik Gfeller
2020-05-02 16:28 ` Mauro Carvalho Chehab
2020-05-02 18:23 ` Patrik Gfeller
2020-05-02 14:50 ` Patrik Gfeller
2020-04-18 15:29 ` Patrik Gfeller
2020-04-25 2:39 ` Laurent Pinchart
2020-04-25 10:36 ` Patrik Gfeller
2020-04-25 12:19 ` Mauro Carvalho Chehab
2020-04-26 19:07 ` Laurent Pinchart
2020-04-26 20:51 ` Mauro Carvalho Chehab
2020-04-26 19:33 ` Laurent Pinchart
2020-04-28 18:13 ` Patrik Gfeller
2020-04-26 7:44 ` Patrik Gfeller
2020-04-26 19:17 ` Laurent Pinchart
2020-04-29 17:59 ` Patrik Gfeller
2020-04-29 18:19 ` Laurent Pinchart
2020-04-30 15:28 ` Patrik Gfeller
2020-05-02 16:08 ` Andy Shevchenko
2020-05-02 17:04 ` Mauro Carvalho Chehab
2020-05-02 17:33 ` Andy Shevchenko
2020-05-03 10:18 ` Mauro Carvalho Chehab
2020-05-12 10:20 ` Mauro Carvalho Chehab
2020-05-12 11:12 ` Andy Shevchenko
2020-05-12 11:21 ` Andy Shevchenko
2020-05-12 14:56 ` Mauro Carvalho Chehab
2020-05-12 16:01 ` Andy Shevchenko
2020-05-13 18:36 ` Patrik Gfeller
2020-05-20 8:04 ` Mauro Carvalho Chehab
2020-05-13 9:56 ` Mauro Carvalho Chehab
2020-05-03 8:46 ` Patrik Gfeller
2020-05-03 10:23 ` Mauro Carvalho Chehab
2020-05-03 12:31 ` Patrik Gfeller
2020-05-03 13:36 ` Patrik Gfeller
2020-05-03 14:43 ` Mauro Carvalho Chehab
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=20200501113812.7f16b7ca@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=patrik.gfeller@gmail.com \
/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.