meta-freescale.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
       [not found] <16B199CF92574165.11657@lists.yoctoproject.org>
@ 2021-10-26 14:10 ` Brian Hutchinson
  2021-10-27 12:18   ` Fabio Estevam
  0 siblings, 1 reply; 10+ messages in thread
From: Brian Hutchinson @ 2021-10-26 14:10 UTC (permalink / raw)
  To: b.hutchman; +Cc: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 1686 bytes --]

On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via lists.yoctoproject.org
<b.hutchman=gmail.com@lists.yoctoproject.org> wrote:

> Hi,
>
> First, forgive me for posting a link in an post with no context ... I hit
> a wrong button and accidentally sent before ready.
>
> Bottom line up front.  How can I get a 5.10 kernel with multi-lane support
> for IMX8MM?
>
> We use linux-fsl 5.4 on a IMXMM based board and have recently stepped up
> to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for
> "multi-lane" anymore which breaks our code.
>
> I figure this is simply a case where things in linux-imx are new and just
> not picked up in linux-fslc yet but wondering if it's possible to get
> multi-lane support in a 5.10 kernel for the IMX8MM.
>
> I still don't quite fully understand how all the releases work, the
> linux-imx releases appear to be for newer boards and don't necessarily
> support the older boards from what I'm seeing.
>
> Thanks for any advice/guidance.
>
> Regards,
>
> Brian
>

And that link I accidentally posted by itself
https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y

... is the reference I mentioned where I see multi-lane support in
linux-imx 5.10.

Regards,

Brian


>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#24765):
> https://lists.yoctoproject.org/g/meta-freescale/message/24765
> Mute This Topic: https://lists.yoctoproject.org/mt/86603399/3619744
> Group Owner: meta-freescale+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-freescale/unsub [
> b.hutchman@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 3266 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-26 14:10 ` [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c Brian Hutchinson
@ 2021-10-27 12:18   ` Fabio Estevam
  2021-10-27 12:45     ` Brian Hutchinson
  0 siblings, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2021-10-27 12:18 UTC (permalink / raw)
  To: Brian Hutchinson; +Cc: meta-freescale

Hi Brian,

On Tue, Oct 26, 2021 at 11:10 AM Brian Hutchinson <b.hutchman@gmail.com> wrote:
>
>
>
> On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via lists.yoctoproject.org <b.hutchman=gmail.com@lists.yoctoproject.org> wrote:
>>
>> Hi,
>>
>> First, forgive me for posting a link in an post with no context ... I hit a wrong button and accidentally sent before ready.
>>
>> Bottom line up front.  How can I get a 5.10 kernel with multi-lane support for IMX8MM?
>>
>> We use linux-fsl 5.4 on a IMXMM based board and have recently stepped up to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for "multi-lane" anymore which breaks our code.
>>
>> I figure this is simply a case where things in linux-imx are new and just not picked up in linux-fslc yet but wondering if it's possible to get multi-lane support in a 5.10 kernel for the IMX8MM.
>>
>> I still don't quite fully understand how all the releases work, the linux-imx releases appear to be for newer boards and don't necessarily support the older boards from what I'm seeing.
>>
>> Thanks for any advice/guidance.
>>
>> Regards,
>>
>> Brian
>
>
> And that link I accidentally posted by itself https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y
>
> ... is the reference I mentioned where I see multi-lane support in linux-imx 5.10.

With the mainline SAI driver, it is possible to use several channels.
Not sure what you mean by "multi-lane" in your use-case.

Please check:
https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-27 12:18   ` Fabio Estevam
@ 2021-10-27 12:45     ` Brian Hutchinson
  2021-10-27 13:01       ` Andrey Zhizhikin
  2021-10-27 14:32       ` Fabio Estevam
  0 siblings, 2 replies; 10+ messages in thread
From: Brian Hutchinson @ 2021-10-27 12:45 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 3764 bytes --]

On Wed, Oct 27, 2021 at 8:18 AM Fabio Estevam <festevam@gmail.com> wrote:

> Hi Brian,
>
> On Tue, Oct 26, 2021 at 11:10 AM Brian Hutchinson <b.hutchman@gmail.com>
> wrote:
> >
> >
> >
> > On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via
> lists.yoctoproject.org <b.hutchman=gmail.com@lists.yoctoproject.org>
> wrote:
> >>
> >> Hi,
> >>
> >> First, forgive me for posting a link in an post with no context ... I
> hit a wrong button and accidentally sent before ready.
> >>
> >> Bottom line up front.  How can I get a 5.10 kernel with multi-lane
> support for IMX8MM?
> >>
> >> We use linux-fsl 5.4 on a IMXMM based board and have recently stepped
> up to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for
> "multi-lane" anymore which breaks our code.
> >>
> >> I figure this is simply a case where things in linux-imx are new and
> just not picked up in linux-fslc yet but wondering if it's possible to get
> multi-lane support in a 5.10 kernel for the IMX8MM.
> >>
> >> I still don't quite fully understand how all the releases work, the
> linux-imx releases appear to be for newer boards and don't necessarily
> support the older boards from what I'm seeing.
> >>
> >> Thanks for any advice/guidance.
> >>
> >> Regards,
> >>
> >> Brian
> >
> >
> > And that link I accidentally posted by itself
> https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y
> >
> > ... is the reference I mentioned where I see multi-lane support in
> linux-imx 5.10.
>
> With the mainline SAI driver, it is possible to use several channels.
> Not sure what you mean by "multi-lane" in your use-case.
>
> Please check:
> https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/


I hoped folks would know what I was talking about without getting too far
into the weeds.  But I guess I need to explain more.

The older 5.4 kernels (and even 4 series kernels) had a imx8mm-evk.dts sai
section that looked like this:

&sai1 {
       pinctrl-names = "default";
       pinctrl-0 = <&pinctrl_sai1>;
       assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
       assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
       assigned-clock-rates = <24576000>;
       clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
               <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
               <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
               <&clk IMX8MM_AUDIO_PLL2_OUT>;
       clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k",
"pll11k";
       fsl,sai-multi-lane;
       fsl,dataline,dsd = <0 0xff 0xff 2 0xff 0x11>;
       fsl,sai-synchronous-rx;
       dmas = <&sdma2 0 25 0>, <&sdma2 1 25 0>;
       #sound-dai-cells = <0>;
       status = "okay";
};

... which has fsl,sai-multi-lane support.

The current linux-fslc 5.10 kernel does not have fsl,sai-multi-lane support.

If you look at the linux-imx 5.10 link I posted before ... they do have the
multi-lane support I'm looking for (in sounds/soc/fsl/fsl_sai.c) but kinda
don't want to switch back to linux-imx.  So my ask is how can I get
linux-fslc 5.10 with multi-lane support?

Apparently the yocto build has changed again.  It used to be linux-imx was
built by default, now it looks like linux-fslc is built by default even
when I check out NXP's latest harpoon release which was supposed to have
5.10 ... and it does have recipes for 5.10 but 5.4 linux-fslc builds by
default so I got some catching up to do to figure out how to select between
the various kernels but I'm getting into side issues.

My main need is getting fsl,sai-multi-lane back in linux-fslc 5.10 since we
moved away from linux-imx over a year ago.

Hopefully that better explains where I'm coming from and what my issue is.

Regards,

Brian

[-- Attachment #2: Type: text/html, Size: 6475 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-27 12:45     ` Brian Hutchinson
@ 2021-10-27 13:01       ` Andrey Zhizhikin
  2021-10-27 13:23         ` Brian Hutchinson
  2021-10-27 14:32       ` Fabio Estevam
  1 sibling, 1 reply; 10+ messages in thread
From: Andrey Zhizhikin @ 2021-10-27 13:01 UTC (permalink / raw)
  To: Brian Hutchinson; +Cc: Fabio Estevam, meta-freescale

Hello Brian,

On Wed, Oct 27, 2021 at 2:45 PM Brian Hutchinson <b.hutchman@gmail.com> wrote:
>
>
>
> On Wed, Oct 27, 2021 at 8:18 AM Fabio Estevam <festevam@gmail.com> wrote:
>>
>> Hi Brian,
>>
>> On Tue, Oct 26, 2021 at 11:10 AM Brian Hutchinson <b.hutchman@gmail.com> wrote:
>> >
>> >
>> >
>> > On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via lists.yoctoproject.org <b.hutchman=gmail.com@lists.yoctoproject.org> wrote:
>> >>
>> >> Hi,
>> >>
>> >> First, forgive me for posting a link in an post with no context ... I hit a wrong button and accidentally sent before ready.
>> >>
>> >> Bottom line up front.  How can I get a 5.10 kernel with multi-lane support for IMX8MM?
>> >>
>> >> We use linux-fsl 5.4 on a IMXMM based board and have recently stepped up to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for "multi-lane" anymore which breaks our code.
>> >>
>> >> I figure this is simply a case where things in linux-imx are new and just not picked up in linux-fslc yet but wondering if it's possible to get multi-lane support in a 5.10 kernel for the IMX8MM.
>> >>
>> >> I still don't quite fully understand how all the releases work, the linux-imx releases appear to be for newer boards and don't necessarily support the older boards from what I'm seeing.
>> >>
>> >> Thanks for any advice/guidance.
>> >>
>> >> Regards,
>> >>
>> >> Brian
>> >
>> >
>> > And that link I accidentally posted by itself https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y
>> >
>> > ... is the reference I mentioned where I see multi-lane support in linux-imx 5.10.
>>
>> With the mainline SAI driver, it is possible to use several channels.
>> Not sure what you mean by "multi-lane" in your use-case.
>>
>> Please check:
>> https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/
>
>
> I hoped folks would know what I was talking about without getting too far into the weeds.  But I guess I need to explain more.
>
> The older 5.4 kernels (and even 4 series kernels) had a imx8mm-evk.dts sai section that looked like this:
>
> &sai1 {
>        pinctrl-names = "default";
>        pinctrl-0 = <&pinctrl_sai1>;
>        assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
>        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
>        assigned-clock-rates = <24576000>;
>        clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
>                <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
>                <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
>                <&clk IMX8MM_AUDIO_PLL2_OUT>;
>        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
>        fsl,sai-multi-lane;
>        fsl,dataline,dsd = <0 0xff 0xff 2 0xff 0x11>;
>        fsl,sai-synchronous-rx;
>        dmas = <&sdma2 0 25 0>, <&sdma2 1 25 0>;
>        #sound-dai-cells = <0>;
>        status = "okay";
> };
>
> ... which has fsl,sai-multi-lane support.
>
> The current linux-fslc 5.10 kernel does not have fsl,sai-multi-lane support.

linux-fslc-imx kernel recipe on the [master] branch on meta-freescale
provides a kernel, which has linux-imx as a base and latest LTS
applied on top.

Assuming you're building now off the [master] branch and do not set
the IMX_DEFAULT_BSP to any value anywhere in your conf files - you
will be building a Mainline BSP (see [1]), which does select
linux-fslc as a preferred provider for your kernel, see [2].

You can try to either switch your BSP to NXP one by setting
IMX_DEFAULT_BSP = "nxp", or switch your kernel provider to
"linux-fslc-imx" one.

As a quick GIT grep in the linux-fslc repo on [5.10-2.1.x-imx] branch:
git grep sai-multi-lane
arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts:    fsl,sai-multi-lane;
arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi:  fsl,sai-multi-lane;
arch/arm64/boot/dts/freescale/imx8mp-ab2.dts:   fsl,sai-multi-lane;
arch/arm64/boot/dts/freescale/imx8mq-evk-ak4497.dts:    fsl,sai-multi-lane;
arch/arm64/boot/dts/freescale/imx8mq-evk.dts:   fsl,sai-multi-lane;
sound/soc/fsl/fsl_sai.c:        if (of_find_property(np,
"fsl,sai-multi-lane", NULL))

Guess this is what you're looking for, right?

>
> If you look at the linux-imx 5.10 link I posted before ... they do have the multi-lane support I'm looking for (in sounds/soc/fsl/fsl_sai.c) but kinda don't want to switch back to linux-imx.  So my ask is how can I get linux-fslc 5.10 with multi-lane support?
>
> Apparently the yocto build has changed again.  It used to be linux-imx was built by default, now it looks like linux-fslc is built by default even when I check out NXP's latest harpoon release which was supposed to have 5.10 ... and it does have recipes for 5.10 but 5.4 linux-fslc builds by default so I got some catching up to do to figure out how to select between the various kernels but I'm getting into side issues.
>
> My main need is getting fsl,sai-multi-lane back in linux-fslc 5.10 since we moved away from linux-imx over a year ago.
>
> Hopefully that better explains where I'm coming from and what my issue is.
>
> Regards,
>
> Brian
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#24768): https://lists.yoctoproject.org/g/meta-freescale/message/24768
> Mute This Topic: https://lists.yoctoproject.org/mt/86603399/3617192
> Group Owner: meta-freescale+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-freescale/unsub [andrey.z@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>

Link: [1]: https://github.com/Freescale/meta-freescale/blob/348d3a23be97e0d8827d7a4938c85cb6e62f79d5/conf/machine/include/imx-base.inc#L13
Link: [2]: https://github.com/Freescale/meta-freescale/blob/348d3a23be97e0d8827d7a4938c85cb6e62f79d5/conf/machine/include/imx-base.inc#L399
-- 
Regards,
Andrey.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-27 13:01       ` Andrey Zhizhikin
@ 2021-10-27 13:23         ` Brian Hutchinson
  2021-10-27 14:37           ` Andrey Zhizhikin
  0 siblings, 1 reply; 10+ messages in thread
From: Brian Hutchinson @ 2021-10-27 13:23 UTC (permalink / raw)
  To: Andrey Zhizhikin; +Cc: Fabio Estevam, meta-freescale

[-- Attachment #1: Type: text/plain, Size: 5796 bytes --]

Hi Andrey,


On Wed, Oct 27, 2021 at 9:01 AM Andrey Zhizhikin <andrey.z@gmail.com> wrote:

> Hello Brian,
>
> On Wed, Oct 27, 2021 at 2:45 PM Brian Hutchinson <b.hutchman@gmail.com>
> wrote:
> >
> >
> >
> > On Wed, Oct 27, 2021 at 8:18 AM Fabio Estevam <festevam@gmail.com>
> wrote:
> >>
> >> Hi Brian,
> >>
> >> On Tue, Oct 26, 2021 at 11:10 AM Brian Hutchinson <b.hutchman@gmail.com>
> wrote:
> >> >
> >> >
> >> >
> >> > On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via
> lists.yoctoproject.org <b.hutchman=gmail.com@lists.yoctoproject.org>
> wrote:
> >> >>
> >> >> Hi,
> >> >>
> >> >> First, forgive me for posting a link in an post with no context ...
> I hit a wrong button and accidentally sent before ready.
> >> >>
> >> >> Bottom line up front.  How can I get a 5.10 kernel with multi-lane
> support for IMX8MM?
> >> >>
> >> >> We use linux-fsl 5.4 on a IMXMM based board and have recently
> stepped up to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for
> "multi-lane" anymore which breaks our code.
> >> >>
> >> >> I figure this is simply a case where things in linux-imx are new and
> just not picked up in linux-fslc yet but wondering if it's possible to get
> multi-lane support in a 5.10 kernel for the IMX8MM.
> >> >>
> >> >> I still don't quite fully understand how all the releases work, the
> linux-imx releases appear to be for newer boards and don't necessarily
> support the older boards from what I'm seeing.
> >> >>
> >> >> Thanks for any advice/guidance.
> >> >>
> >> >> Regards,
> >> >>
> >> >> Brian
> >> >
> >> >
> >> > And that link I accidentally posted by itself
> https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y
> >> >
> >> > ... is the reference I mentioned where I see multi-lane support in
> linux-imx 5.10.
> >>
> >> With the mainline SAI driver, it is possible to use several channels.
> >> Not sure what you mean by "multi-lane" in your use-case.
> >>
> >> Please check:
> >> https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/
> >
> >
> > I hoped folks would know what I was talking about without getting too
> far into the weeds.  But I guess I need to explain more.
> >
> > The older 5.4 kernels (and even 4 series kernels) had a imx8mm-evk.dts
> sai section that looked like this:
> >
> > &sai1 {
> >        pinctrl-names = "default";
> >        pinctrl-0 = <&pinctrl_sai1>;
> >        assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
> >        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
> >        assigned-clock-rates = <24576000>;
> >        clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
> >                <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
> >                <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
> >                <&clk IMX8MM_AUDIO_PLL2_OUT>;
> >        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k",
> "pll11k";
> >        fsl,sai-multi-lane;
> >        fsl,dataline,dsd = <0 0xff 0xff 2 0xff 0x11>;
> >        fsl,sai-synchronous-rx;
> >        dmas = <&sdma2 0 25 0>, <&sdma2 1 25 0>;
> >        #sound-dai-cells = <0>;
> >        status = "okay";
> > };
> >
> > ... which has fsl,sai-multi-lane support.
> >
> > The current linux-fslc 5.10 kernel does not have fsl,sai-multi-lane
> support.
>
> linux-fslc-imx kernel recipe on the [master] branch on meta-freescale
> provides a kernel, which has linux-imx as a base and latest LTS
> applied on top.
>
> Assuming you're building now off the [master] branch and do not set
> the IMX_DEFAULT_BSP to any value anywhere in your conf files - you
> will be building a Mainline BSP (see [1]), which does select
> linux-fslc as a preferred provider for your kernel, see [2].
>
> You can try to either switch your BSP to NXP one by setting
> IMX_DEFAULT_BSP = "nxp", or switch your kernel provider to
> "linux-fslc-imx" one.
>

I really would like to stick with linux-fslc since that's what we've been
using for more than a year now.  Kind of scared to switch back to
linux-fslc-imx (I'll try to do better with my terminology) but if you guys
think that's best then I'll try it.  Worried that our custom apps might be
impacted by the switch.


> As a quick GIT grep in the linux-fslc repo on [5.10-2.1.x-imx] branch:
> git grep sai-multi-lane
> arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts:    fsl,sai-multi-lane;
> arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi:  fsl,sai-multi-lane;
> arch/arm64/boot/dts/freescale/imx8mp-ab2.dts:   fsl,sai-multi-lane;
> arch/arm64/boot/dts/freescale/imx8mq-evk-ak4497.dts:    fsl,sai-multi-lane;
> arch/arm64/boot/dts/freescale/imx8mq-evk.dts:   fsl,sai-multi-lane;
> sound/soc/fsl/fsl_sai.c:        if (of_find_property(np,
> "fsl,sai-multi-lane", NULL))
>
> Guess this is what you're looking for, right?
>

I'd be ok with doing a build of just the kernel on master branch as long as
it supports imx8mm-evk (what our board is based on) but the rest of our
rootfs is based on Dunfell release.

So if I'm following you correctly, you're saying the linux-fslc repo has
imx 5.10 with multi-lane in it.

How come linux-fslc 5.10 doesn't have it?  Is it a case where imx released
it later and hasn't worked it's way into linux-fslc yet?

I'd be willing to "try" 5.10.2.1.x-imx just to see if it solves our problem
but still would prefer to stick with linux-fslc ... but if that's the only
way to get this feature back I guess I'll have to do what I need to do.

I still get confused by linux-fslc, linux-imx linux-fslc-imx some.  Which
one would be the safest (aka most stable) for imx8mm ... and have
multi-lane support?

Thanks again for putting up with my dumb questions and weird issues.
Everything was ok until we had to step up to 5.4 in order to pick up some
DSA PTP (1588) patches.

Regards,

Brian

[-- Attachment #2: Type: text/html, Size: 8263 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-27 12:45     ` Brian Hutchinson
  2021-10-27 13:01       ` Andrey Zhizhikin
@ 2021-10-27 14:32       ` Fabio Estevam
  2021-10-27 15:19         ` Brian Hutchinson
  1 sibling, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2021-10-27 14:32 UTC (permalink / raw)
  To: Brian Hutchinson; +Cc: meta-freescale

On Wed, Oct 27, 2021 at 9:45 AM Brian Hutchinson <b.hutchman@gmail.com> wrote:

> I hoped folks would know what I was talking about without getting too far into the weeds.  But I guess I need to explain more.
>
> The older 5.4 kernels (and even 4 series kernels) had a imx8mm-evk.dts sai section that looked like this:
>
> &sai1 {
>        pinctrl-names = "default";
>        pinctrl-0 = <&pinctrl_sai1>;
>        assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
>        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
>        assigned-clock-rates = <24576000>;
>        clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
>                <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
>                <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
>                <&clk IMX8MM_AUDIO_PLL2_OUT>;
>        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
>        fsl,sai-multi-lane;

This property is only found on the NXP vendor kernel, not in the
mainline kernel.

If your kernel has such property, then you are using an NXP-based kernel.

In this case, you could probably use Andrey's suggestion and switch to
the NXP 5.10 kernel.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-27 13:23         ` Brian Hutchinson
@ 2021-10-27 14:37           ` Andrey Zhizhikin
  2021-10-27 16:01             ` Brian Hutchinson
       [not found]             ` <16B1EE984B85DFDA.19566@lists.yoctoproject.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Andrey Zhizhikin @ 2021-10-27 14:37 UTC (permalink / raw)
  To: Brian Hutchinson; +Cc: Fabio Estevam, meta-freescale

Hello Brian,

On Wed, Oct 27, 2021 at 3:24 PM Brian Hutchinson <b.hutchman@gmail.com> wrote:
>
> Hi Andrey,
>
>
> On Wed, Oct 27, 2021 at 9:01 AM Andrey Zhizhikin <andrey.z@gmail.com> wrote:
>>
>> Hello Brian,
>>
>> On Wed, Oct 27, 2021 at 2:45 PM Brian Hutchinson <b.hutchman@gmail.com> wrote:
>> >
>> >
>> >
>> > On Wed, Oct 27, 2021 at 8:18 AM Fabio Estevam <festevam@gmail.com> wrote:
>> >>
>> >> Hi Brian,
>> >>
>> >> On Tue, Oct 26, 2021 at 11:10 AM Brian Hutchinson <b.hutchman@gmail.com> wrote:
>> >> >
>> >> >
>> >> >
>> >> > On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via lists.yoctoproject.org <b.hutchman=gmail.com@lists.yoctoproject.org> wrote:
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> First, forgive me for posting a link in an post with no context ... I hit a wrong button and accidentally sent before ready.
>> >> >>
>> >> >> Bottom line up front.  How can I get a 5.10 kernel with multi-lane support for IMX8MM?
>> >> >>
>> >> >> We use linux-fsl 5.4 on a IMXMM based board and have recently stepped up to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for "multi-lane" anymore which breaks our code.
>> >> >>
>> >> >> I figure this is simply a case where things in linux-imx are new and just not picked up in linux-fslc yet but wondering if it's possible to get multi-lane support in a 5.10 kernel for the IMX8MM.
>> >> >>
>> >> >> I still don't quite fully understand how all the releases work, the linux-imx releases appear to be for newer boards and don't necessarily support the older boards from what I'm seeing.
>> >> >>
>> >> >> Thanks for any advice/guidance.
>> >> >>
>> >> >> Regards,
>> >> >>
>> >> >> Brian
>> >> >
>> >> >
>> >> > And that link I accidentally posted by itself https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y
>> >> >
>> >> > ... is the reference I mentioned where I see multi-lane support in linux-imx 5.10.
>> >>
>> >> With the mainline SAI driver, it is possible to use several channels.
>> >> Not sure what you mean by "multi-lane" in your use-case.
>> >>
>> >> Please check:
>> >> https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/
>> >
>> >
>> > I hoped folks would know what I was talking about without getting too far into the weeds.  But I guess I need to explain more.
>> >
>> > The older 5.4 kernels (and even 4 series kernels) had a imx8mm-evk.dts sai section that looked like this:
>> >
>> > &sai1 {
>> >        pinctrl-names = "default";
>> >        pinctrl-0 = <&pinctrl_sai1>;
>> >        assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
>> >        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
>> >        assigned-clock-rates = <24576000>;
>> >        clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
>> >                <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
>> >                <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
>> >                <&clk IMX8MM_AUDIO_PLL2_OUT>;
>> >        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
>> >        fsl,sai-multi-lane;
>> >        fsl,dataline,dsd = <0 0xff 0xff 2 0xff 0x11>;
>> >        fsl,sai-synchronous-rx;
>> >        dmas = <&sdma2 0 25 0>, <&sdma2 1 25 0>;
>> >        #sound-dai-cells = <0>;
>> >        status = "okay";
>> > };
>> >
>> > ... which has fsl,sai-multi-lane support.
>> >
>> > The current linux-fslc 5.10 kernel does not have fsl,sai-multi-lane support.
>>
>> linux-fslc-imx kernel recipe on the [master] branch on meta-freescale
>> provides a kernel, which has linux-imx as a base and latest LTS
>> applied on top.
>>
>> Assuming you're building now off the [master] branch and do not set
>> the IMX_DEFAULT_BSP to any value anywhere in your conf files - you
>> will be building a Mainline BSP (see [1]), which does select
>> linux-fslc as a preferred provider for your kernel, see [2].
>>
>> You can try to either switch your BSP to NXP one by setting
>> IMX_DEFAULT_BSP = "nxp", or switch your kernel provider to
>> "linux-fslc-imx" one.
>
>
> I really would like to stick with linux-fslc since that's what we've been using for more than a year now.  Kind of scared to switch back to linux-fslc-imx (I'll try to do better with my terminology) but if you guys think that's best then I'll try it.  Worried that our custom apps might be impacted by the switch.
>
>>
>> As a quick GIT grep in the linux-fslc repo on [5.10-2.1.x-imx] branch:
>> git grep sai-multi-lane
>> arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts:    fsl,sai-multi-lane;
>> arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi:  fsl,sai-multi-lane;
>> arch/arm64/boot/dts/freescale/imx8mp-ab2.dts:   fsl,sai-multi-lane;
>> arch/arm64/boot/dts/freescale/imx8mq-evk-ak4497.dts:    fsl,sai-multi-lane;
>> arch/arm64/boot/dts/freescale/imx8mq-evk.dts:   fsl,sai-multi-lane;
>> sound/soc/fsl/fsl_sai.c:        if (of_find_property(np,
>> "fsl,sai-multi-lane", NULL))
>>
>> Guess this is what you're looking for, right?
>
>
> I'd be ok with doing a build of just the kernel on master branch as long as it supports imx8mm-evk (what our board is based on) but the rest of our rootfs is based on Dunfell release.
>
> So if I'm following you correctly, you're saying the linux-fslc repo has imx 5.10 with multi-lane in it.

There are 2 kernel repositories here at play, namely:
- linux-fslc from Freescale GitHub
- linux-imx from CodeAurora

They both stem from stable korg, but using different strategy to evolve.

linux-imx is an NXP kernel fork, which they use to commit their
internal patches on top of some stable release. In case of 5.10 - it
is v5.10.54 from stable korg, which resides on [lf-5.10.y] branch.

linux-fslc is combination of various branches, and if we look at the
5.10 - there is a corresponding branch [5.10.x+fslc], and it is
practically a vanilla 5.10.y kernel from stable korg, with only
handful of patches on top.

If I to examine this like that:
$ git log --oneline --no-merges  stable/linux-5.10.y..5.10.x+fslc | wc -l
9

As one can see, it has only 9 patches on top of stable korg.

What comes in addition inside linux-fslc repository, is the branch
[5.10-2.1.x-imx], which is a combination of [lf-5.10.y] branch from
linux-imx repo and latest stable patch applied on top of it (with
merge conflict resolution, of course).

When examined, it brings the following:
$ git log --oneline  --no-merges stable/linux-5.10.y..5.10-2.1.x-imx  | wc -l
5456

Here we see, that there is a substantial difference in terms of number
of patches applied. It might be a new functionality (like your desired
multi-lane support), but can also contain a code in question, which
might not work for all scenarios you're applying your kernel to.

Hope that clears it a bit, and would help you to drive your decision
further on which kernel to use.

>
> How come linux-fslc 5.10 doesn't have it?  Is it a case where imx released it later and hasn't worked it's way into linux-fslc yet?

That is the trick: you most probably used the NXP-based up-merged
branch in your BSP, but now when switched to new Yocto release - you
received a vanilla kernel, which does not have those NXP patches
applied.

>
> I'd be willing to "try" 5.10.2.1.x-imx just to see if it solves our problem but still would prefer to stick with linux-fslc ... but if that's the only way to get this feature back I guess I'll have to do what I need to do.
>
> I still get confused by linux-fslc, linux-imx linux-fslc-imx some.  Which one would be the safest (aka most stable) for imx8mm ... and have multi-lane support?
>
> Thanks again for putting up with my dumb questions and weird issues.  Everything was ok until we had to step up to 5.4 in order to pick up some DSA PTP (1588) patches.
>
> Regards,
>
> Brian
>


-- 
Regards,
Andrey.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-27 14:32       ` Fabio Estevam
@ 2021-10-27 15:19         ` Brian Hutchinson
  0 siblings, 0 replies; 10+ messages in thread
From: Brian Hutchinson @ 2021-10-27 15:19 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]

Hey Fabio,


On Wed, Oct 27, 2021 at 10:33 AM Fabio Estevam <festevam@gmail.com> wrote:

> On Wed, Oct 27, 2021 at 9:45 AM Brian Hutchinson <b.hutchman@gmail.com>
> wrote:
>
> > I hoped folks would know what I was talking about without getting too
> far into the weeds.  But I guess I need to explain more.
> >
> > The older 5.4 kernels (and even 4 series kernels) had a imx8mm-evk.dts
> sai section that looked like this:
> >
> > &sai1 {
> >        pinctrl-names = "default";
> >        pinctrl-0 = <&pinctrl_sai1>;
> >        assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
> >        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
> >        assigned-clock-rates = <24576000>;
> >        clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
> >                <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
> >                <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
> >                <&clk IMX8MM_AUDIO_PLL2_OUT>;
> >        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k",
> "pll11k";
> >        fsl,sai-multi-lane;
>
> This property is only found on the NXP vendor kernel, not in the
> mainline kernel.
>
> If your kernel has such property, then you are using an NXP-based kernel.
>
> In this case, you could probably use Andrey's suggestion and switch to
> the NXP 5.10 kernel.
>

I went back and looked at my 5.4 kernel that has the multi-lane support.

My local.conf has REFERRED_PROVIDER_virtual/kernel = "linux-fslc-imx"

Regards,

Brian

[-- Attachment #2: Type: text/html, Size: 2941 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
  2021-10-27 14:37           ` Andrey Zhizhikin
@ 2021-10-27 16:01             ` Brian Hutchinson
       [not found]             ` <16B1EE984B85DFDA.19566@lists.yoctoproject.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Brian Hutchinson @ 2021-10-27 16:01 UTC (permalink / raw)
  To: Andrey Zhizhikin; +Cc: Fabio Estevam, meta-freescale

[-- Attachment #1: Type: text/plain, Size: 9160 bytes --]

Hey Andrey,

On Wed, Oct 27, 2021 at 10:37 AM Andrey Zhizhikin <andrey.z@gmail.com>
wrote:

> Hello Brian,
>
> On Wed, Oct 27, 2021 at 3:24 PM Brian Hutchinson <b.hutchman@gmail.com>
> wrote:
> >
> > Hi Andrey,
> >
> >
> > On Wed, Oct 27, 2021 at 9:01 AM Andrey Zhizhikin <andrey.z@gmail.com>
> wrote:
> >>
> >> Hello Brian,
> >>
> >> On Wed, Oct 27, 2021 at 2:45 PM Brian Hutchinson <b.hutchman@gmail.com>
> wrote:
> >> >
> >> >
> >> >
> >> > On Wed, Oct 27, 2021 at 8:18 AM Fabio Estevam <festevam@gmail.com>
> wrote:
> >> >>
> >> >> Hi Brian,
> >> >>
> >> >> On Tue, Oct 26, 2021 at 11:10 AM Brian Hutchinson <
> b.hutchman@gmail.com> wrote:
> >> >> >
> >> >> >
> >> >> >
> >> >> > On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via
> lists.yoctoproject.org <b.hutchman=gmail.com@lists.yoctoproject.org>
> wrote:
> >> >> >>
> >> >> >> Hi,
> >> >> >>
> >> >> >> First, forgive me for posting a link in an post with no context
> ... I hit a wrong button and accidentally sent before ready.
> >> >> >>
> >> >> >> Bottom line up front.  How can I get a 5.10 kernel with
> multi-lane support for IMX8MM?
> >> >> >>
> >> >> >> We use linux-fsl 5.4 on a IMXMM based board and have recently
> stepped up to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for
> "multi-lane" anymore which breaks our code.
> >> >> >>
> >> >> >> I figure this is simply a case where things in linux-imx are new
> and just not picked up in linux-fslc yet but wondering if it's possible to
> get multi-lane support in a 5.10 kernel for the IMX8MM.
> >> >> >>
> >> >> >> I still don't quite fully understand how all the releases work,
> the linux-imx releases appear to be for newer boards and don't necessarily
> support the older boards from what I'm seeing.
> >> >> >>
> >> >> >> Thanks for any advice/guidance.
> >> >> >>
> >> >> >> Regards,
> >> >> >>
> >> >> >> Brian
> >> >> >
> >> >> >
> >> >> > And that link I accidentally posted by itself
> https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y
> >> >> >
> >> >> > ... is the reference I mentioned where I see multi-lane support in
> linux-imx 5.10.
> >> >>
> >> >> With the mainline SAI driver, it is possible to use several channels.
> >> >> Not sure what you mean by "multi-lane" in your use-case.
> >> >>
> >> >> Please check:
> >> >> https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/
> >> >
> >> >
> >> > I hoped folks would know what I was talking about without getting too
> far into the weeds.  But I guess I need to explain more.
> >> >
> >> > The older 5.4 kernels (and even 4 series kernels) had a
> imx8mm-evk.dts sai section that looked like this:
> >> >
> >> > &sai1 {
> >> >        pinctrl-names = "default";
> >> >        pinctrl-0 = <&pinctrl_sai1>;
> >> >        assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
> >> >        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
> >> >        assigned-clock-rates = <24576000>;
> >> >        clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
> >> >                <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
> >> >                <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
> >> >                <&clk IMX8MM_AUDIO_PLL2_OUT>;
> >> >        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3",
> "pll8k", "pll11k";
> >> >        fsl,sai-multi-lane;
> >> >        fsl,dataline,dsd = <0 0xff 0xff 2 0xff 0x11>;
> >> >        fsl,sai-synchronous-rx;
> >> >        dmas = <&sdma2 0 25 0>, <&sdma2 1 25 0>;
> >> >        #sound-dai-cells = <0>;
> >> >        status = "okay";
> >> > };
> >> >
> >> > ... which has fsl,sai-multi-lane support.
> >> >
> >> > The current linux-fslc 5.10 kernel does not have fsl,sai-multi-lane
> support.
> >>
> >> linux-fslc-imx kernel recipe on the [master] branch on meta-freescale
> >> provides a kernel, which has linux-imx as a base and latest LTS
> >> applied on top.
> >>
> >> Assuming you're building now off the [master] branch and do not set
> >> the IMX_DEFAULT_BSP to any value anywhere in your conf files - you
> >> will be building a Mainline BSP (see [1]), which does select
> >> linux-fslc as a preferred provider for your kernel, see [2].
> >>
> >> You can try to either switch your BSP to NXP one by setting
> >> IMX_DEFAULT_BSP = "nxp", or switch your kernel provider to
> >> "linux-fslc-imx" one.
> >
> >
> > I really would like to stick with linux-fslc since that's what we've
> been using for more than a year now.  Kind of scared to switch back to
> linux-fslc-imx (I'll try to do better with my terminology) but if you guys
> think that's best then I'll try it.  Worried that our custom apps might be
> impacted by the switch.
> >
> >>
> >> As a quick GIT grep in the linux-fslc repo on [5.10-2.1.x-imx] branch:
> >> git grep sai-multi-lane
> >> arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts:
> fsl,sai-multi-lane;
> >> arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi:  fsl,sai-multi-lane;
> >> arch/arm64/boot/dts/freescale/imx8mp-ab2.dts:   fsl,sai-multi-lane;
> >> arch/arm64/boot/dts/freescale/imx8mq-evk-ak4497.dts:
> fsl,sai-multi-lane;
> >> arch/arm64/boot/dts/freescale/imx8mq-evk.dts:   fsl,sai-multi-lane;
> >> sound/soc/fsl/fsl_sai.c:        if (of_find_property(np,
> >> "fsl,sai-multi-lane", NULL))
> >>
> >> Guess this is what you're looking for, right?
> >
> >
> > I'd be ok with doing a build of just the kernel on master branch as long
> as it supports imx8mm-evk (what our board is based on) but the rest of our
> rootfs is based on Dunfell release.
> >
> > So if I'm following you correctly, you're saying the linux-fslc repo has
> imx 5.10 with multi-lane in it.
>
> There are 2 kernel repositories here at play, namely:
> - linux-fslc from Freescale GitHub
> - linux-imx from CodeAurora
>
> They both stem from stable korg, but using different strategy to evolve.
>
> linux-imx is an NXP kernel fork, which they use to commit their
> internal patches on top of some stable release. In case of 5.10 - it
> is v5.10.54 from stable korg, which resides on [lf-5.10.y] branch.
>
> linux-fslc is combination of various branches, and if we look at the
> 5.10 - there is a corresponding branch [5.10.x+fslc], and it is
> practically a vanilla 5.10.y kernel from stable korg, with only
> handful of patches on top.
>
> If I to examine this like that:
> $ git log --oneline --no-merges  stable/linux-5.10.y..5.10.x+fslc | wc -l
> 9
>
> As one can see, it has only 9 patches on top of stable korg.
>
> What comes in addition inside linux-fslc repository, is the branch
> [5.10-2.1.x-imx], which is a combination of [lf-5.10.y] branch from
> linux-imx repo and latest stable patch applied on top of it (with
> merge conflict resolution, of course).
>
> When examined, it brings the following:
> $ git log --oneline  --no-merges stable/linux-5.10.y..5.10-2.1.x-imx  | wc
> -l
> 5456
>
> Here we see, that there is a substantial difference in terms of number
> of patches applied. It might be a new functionality (like your desired
> multi-lane support), but can also contain a code in question, which
> might not work for all scenarios you're applying your kernel to.
>
> Hope that clears it a bit, and would help you to drive your decision
> further on which kernel to use.
>
> >
> > How come linux-fslc 5.10 doesn't have it?  Is it a case where imx
> released it later and hasn't worked it's way into linux-fslc yet?
>
> That is the trick: you most probably used the NXP-based up-merged
> branch in your BSP, but now when switched to new Yocto release - you
> received a vanilla kernel, which does not have those NXP patches
> applied.
>

So I was in error.  I looked back at the local.conf where our 5.4 kernel
came from that we are happy with (and has multi-lane) and it was
linux-fslc-imx so I guess it's linux-fslc with some imx releases merged in.

When I switched to 5.10 in hardknott it looks like it pulled in linux-fslc
by default which looks pretty vanilla as you mentioned.

So I'll try what you said about "You can try to either switch your BSP to
NXP one by setting
IMX_DEFAULT_BSP = "nxp", or switch your kernel provider to
"linux-fslc-imx" one."

To try and get a linux-fslc-imx 5.10 build and see if it's got multi-lane
in it.  I was using hardknott when I originally got 5.10 so don't know if I
need to do a repo sync to get newer stuff or checkout master but would only
be interested in getting kernel and keeping our Dunfell based rootfs.

I'll go try some stuff.  Thanks for the input and advice.

Regards,

Brian



> >
> > I'd be willing to "try" 5.10.2.1.x-imx just to see if it solves our
> problem but still would prefer to stick with linux-fslc ... but if that's
> the only way to get this feature back I guess I'll have to do what I need
> to do.
> >
> > I still get confused by linux-fslc, linux-imx linux-fslc-imx some.
> Which one would be the safest (aka most stable) for imx8mm ... and have
> multi-lane support?
> >
> > Thanks again for putting up with my dumb questions and weird issues.
> Everything was ok until we had to step up to 5.4 in order to pick up some
> DSA PTP (1588) patches.
> >
> > Regards,
> >
> > Brian
> >
>
>
> --
> Regards,
> Andrey.
>

[-- Attachment #2: Type: text/html, Size: 12676 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c
       [not found]             ` <16B1EE984B85DFDA.19566@lists.yoctoproject.org>
@ 2021-10-27 18:24               ` Brian Hutchinson
  0 siblings, 0 replies; 10+ messages in thread
From: Brian Hutchinson @ 2021-10-27 18:24 UTC (permalink / raw)
  To: b.hutchman; +Cc: Andrey Zhizhikin, Fabio Estevam, meta-freescale

[-- Attachment #1: Type: text/plain, Size: 9504 bytes --]

REFERRED_PROVIDER_virtual/kernel = "linux-fslc-imx"Hi Andrey,

On Wed, Oct 27, 2021 at 12:01 PM Brian Hutchinson via lists.yoctoproject.org
<b.hutchman=gmail.com@lists.yoctoproject.org> wrote:

> Hey Andrey,
>
> On Wed, Oct 27, 2021 at 10:37 AM Andrey Zhizhikin <andrey.z@gmail.com>
> wrote:
>
>> Hello Brian,
>>
>> On Wed, Oct 27, 2021 at 3:24 PM Brian Hutchinson <b.hutchman@gmail.com>
>> wrote:
>> >
>> > Hi Andrey,
>> >
>> >
>> > On Wed, Oct 27, 2021 at 9:01 AM Andrey Zhizhikin <andrey.z@gmail.com>
>> wrote:
>> >>
>> >> Hello Brian,
>> >>
>> >> On Wed, Oct 27, 2021 at 2:45 PM Brian Hutchinson <b.hutchman@gmail.com>
>> wrote:
>> >> >
>> >> >
>> >> >
>> >> > On Wed, Oct 27, 2021 at 8:18 AM Fabio Estevam <festevam@gmail.com>
>> wrote:
>> >> >>
>> >> >> Hi Brian,
>> >> >>
>> >> >> On Tue, Oct 26, 2021 at 11:10 AM Brian Hutchinson <
>> b.hutchman@gmail.com> wrote:
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > On Tue, Oct 26, 2021 at 10:07 AM Brian Hutchinson via
>> lists.yoctoproject.org <b.hutchman=gmail.com@lists.yoctoproject.org>
>> wrote:
>> >> >> >>
>> >> >> >> Hi,
>> >> >> >>
>> >> >> >> First, forgive me for posting a link in an post with no context
>> ... I hit a wrong button and accidentally sent before ready.
>> >> >> >>
>> >> >> >> Bottom line up front.  How can I get a 5.10 kernel with
>> multi-lane support for IMX8MM?
>> >> >> >>
>> >> >> >> We use linux-fsl 5.4 on a IMXMM based board and have recently
>> stepped up to linux-fsl 5.10 and the sound/fsl/fsl_sai.c has no support for
>> "multi-lane" anymore which breaks our code.
>> >> >> >>
>> >> >> >> I figure this is simply a case where things in linux-imx are new
>> and just not picked up in linux-fslc yet but wondering if it's possible to
>> get multi-lane support in a 5.10 kernel for the IMX8MM.
>> >> >> >>
>> >> >> >> I still don't quite fully understand how all the releases work,
>> the linux-imx releases appear to be for newer boards and don't necessarily
>> support the older boards from what I'm seeing.
>> >> >> >>
>> >> >> >> Thanks for any advice/guidance.
>> >> >> >>
>> >> >> >> Regards,
>> >> >> >>
>> >> >> >> Brian
>> >> >> >
>> >> >> >
>> >> >> > And that link I accidentally posted by itself
>> https://source.codeaurora.org/external/imx/linux-imx/tree/sound/soc/fsl/fsl_sai.c?h=lf-5.10.y
>> >> >> >
>> >> >> > ... is the reference I mentioned where I see multi-lane support
>> in linux-imx 5.10.
>> >> >>
>> >> >> With the mainline SAI driver, it is possible to use several
>> channels.
>> >> >> Not sure what you mean by "multi-lane" in your use-case.
>> >> >>
>> >> >> Please check:
>> >> >>
>> https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/
>> >> >
>> >> >
>> >> > I hoped folks would know what I was talking about without getting
>> too far into the weeds.  But I guess I need to explain more.
>> >> >
>> >> > The older 5.4 kernels (and even 4 series kernels) had a
>> imx8mm-evk.dts sai section that looked like this:
>> >> >
>> >> > &sai1 {
>> >> >        pinctrl-names = "default";
>> >> >        pinctrl-0 = <&pinctrl_sai1>;
>> >> >        assigned-clocks = <&clk IMX8MM_CLK_SAI1>;
>> >> >        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
>> >> >        assigned-clock-rates = <24576000>;
>> >> >        clocks = <&clk IMX8MM_CLK_SAI1_IPG>, <&clk IMX8MM_CLK_DUMMY>,
>> >> >                <&clk IMX8MM_CLK_SAI1_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
>> >> >                <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
>> >> >                <&clk IMX8MM_AUDIO_PLL2_OUT>;
>> >> >        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3",
>> "pll8k", "pll11k";
>> >> >        fsl,sai-multi-lane;
>> >> >        fsl,dataline,dsd = <0 0xff 0xff 2 0xff 0x11>;
>> >> >        fsl,sai-synchronous-rx;
>> >> >        dmas = <&sdma2 0 25 0>, <&sdma2 1 25 0>;
>> >> >        #sound-dai-cells = <0>;
>> >> >        status = "okay";
>> >> > };
>> >> >
>> >> > ... which has fsl,sai-multi-lane support.
>> >> >
>> >> > The current linux-fslc 5.10 kernel does not have fsl,sai-multi-lane
>> support.
>> >>
>> >> linux-fslc-imx kernel recipe on the [master] branch on meta-freescale
>> >> provides a kernel, which has linux-imx as a base and latest LTS
>> >> applied on top.
>> >>
>> >> Assuming you're building now off the [master] branch and do not set
>> >> the IMX_DEFAULT_BSP to any value anywhere in your conf files - you
>> >> will be building a Mainline BSP (see [1]), which does select
>> >> linux-fslc as a preferred provider for your kernel, see [2].
>> >>
>> >> You can try to either switch your BSP to NXP one by setting
>> >> IMX_DEFAULT_BSP = "nxp", or switch your kernel provider to
>> >> "linux-fslc-imx" one.
>> >
>> >
>> > I really would like to stick with linux-fslc since that's what we've
>> been using for more than a year now.  Kind of scared to switch back to
>> linux-fslc-imx (I'll try to do better with my terminology) but if you guys
>> think that's best then I'll try it.  Worried that our custom apps might be
>> impacted by the switch.
>> >
>> >>
>> >> As a quick GIT grep in the linux-fslc repo on [5.10-2.1.x-imx] branch:
>> >> git grep sai-multi-lane
>> >> arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts:
>> fsl,sai-multi-lane;
>> >> arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi:  fsl,sai-multi-lane;
>> >> arch/arm64/boot/dts/freescale/imx8mp-ab2.dts:   fsl,sai-multi-lane;
>> >> arch/arm64/boot/dts/freescale/imx8mq-evk-ak4497.dts:
>> fsl,sai-multi-lane;
>> >> arch/arm64/boot/dts/freescale/imx8mq-evk.dts:   fsl,sai-multi-lane;
>> >> sound/soc/fsl/fsl_sai.c:        if (of_find_property(np,
>> >> "fsl,sai-multi-lane", NULL))
>> >>
>> >> Guess this is what you're looking for, right?
>> >
>> >
>> > I'd be ok with doing a build of just the kernel on master branch as
>> long as it supports imx8mm-evk (what our board is based on) but the rest of
>> our rootfs is based on Dunfell release.
>> >
>> > So if I'm following you correctly, you're saying the linux-fslc repo
>> has imx 5.10 with multi-lane in it.
>>
>> There are 2 kernel repositories here at play, namely:
>> - linux-fslc from Freescale GitHub
>> - linux-imx from CodeAurora
>>
>> They both stem from stable korg, but using different strategy to evolve.
>>
>> linux-imx is an NXP kernel fork, which they use to commit their
>> internal patches on top of some stable release. In case of 5.10 - it
>> is v5.10.54 from stable korg, which resides on [lf-5.10.y] branch.
>>
>> linux-fslc is combination of various branches, and if we look at the
>> 5.10 - there is a corresponding branch [5.10.x+fslc], and it is
>> practically a vanilla 5.10.y kernel from stable korg, with only
>> handful of patches on top.
>>
>> If I to examine this like that:
>> $ git log --oneline --no-merges  stable/linux-5.10.y..5.10.x+fslc | wc -l
>> 9
>>
>> As one can see, it has only 9 patches on top of stable korg.
>>
>> What comes in addition inside linux-fslc repository, is the branch
>> [5.10-2.1.x-imx], which is a combination of [lf-5.10.y] branch from
>> linux-imx repo and latest stable patch applied on top of it (with
>> merge conflict resolution, of course).
>>
>> When examined, it brings the following:
>> $ git log --oneline  --no-merges stable/linux-5.10.y..5.10-2.1.x-imx  |
>> wc -l
>> 5456
>>
>> Here we see, that there is a substantial difference in terms of number
>> of patches applied. It might be a new functionality (like your desired
>> multi-lane support), but can also contain a code in question, which
>> might not work for all scenarios you're applying your kernel to.
>>
>> Hope that clears it a bit, and would help you to drive your decision
>> further on which kernel to use.
>>
>> >
>> > How come linux-fslc 5.10 doesn't have it?  Is it a case where imx
>> released it later and hasn't worked it's way into linux-fslc yet?
>>
>> That is the trick: you most probably used the NXP-based up-merged
>> branch in your BSP, but now when switched to new Yocto release - you
>> received a vanilla kernel, which does not have those NXP patches
>> applied.
>>
>
> So I was in error.  I looked back at the local.conf where our 5.4 kernel
> came from that we are happy with (and has multi-lane) and it was
> linux-fslc-imx so I guess it's linux-fslc with some imx releases merged in.
>
> When I switched to 5.10 in hardknott it looks like it pulled in linux-fslc
> by default which looks pretty vanilla as you mentioned.
>
> So I'll try what you said about "You can try to either switch your BSP to
> NXP one by setting
> IMX_DEFAULT_BSP = "nxp", or switch your kernel provider to
> "linux-fslc-imx" one."
>
> To try and get a linux-fslc-imx 5.10 build and see if it's got multi-lane
> in it.  I was using hardknott when I originally got 5.10 so don't know if I
> need to do a repo sync to get newer stuff or checkout master but would only
> be interested in getting kernel and keeping our Dunfell based rootfs.
>
> I'll go try some stuff.  Thanks for the input and advice.
>

So I did a repo sync in my hardknott checkout.  Then changed to
IMX_DEFAULT_BSP = "nxp" in imx8mm-evk.inc and added
PREFERRED_PROVIDER_virtual/kernel
= "linux-fslc-imx" in local.conf and kicked off a virtual/kernel build.
Looks like it's pulling down linux-fslc-imx-5.10.69.  So hopefully that's
ok, if not I guess I'll have to look at master but I don't want to be too
bleeding edge if you know what I mean.

... and it just finished building as I was typing this and it looks like it
does have multi-lane support in fsl_sai.c

Again, thanks for the info/ideas.

Regards,

Brian

[-- Attachment #2: Type: text/html, Size: 14175 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-10-27 18:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <16B199CF92574165.11657@lists.yoctoproject.org>
2021-10-26 14:10 ` [meta-freescale] linux-fsl 5.10 kernels don't appear to have multi-lane in sound/soc/fsl/fsl_sai.c Brian Hutchinson
2021-10-27 12:18   ` Fabio Estevam
2021-10-27 12:45     ` Brian Hutchinson
2021-10-27 13:01       ` Andrey Zhizhikin
2021-10-27 13:23         ` Brian Hutchinson
2021-10-27 14:37           ` Andrey Zhizhikin
2021-10-27 16:01             ` Brian Hutchinson
     [not found]             ` <16B1EE984B85DFDA.19566@lists.yoctoproject.org>
2021-10-27 18:24               ` Brian Hutchinson
2021-10-27 14:32       ` Fabio Estevam
2021-10-27 15:19         ` Brian Hutchinson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).