Re: Rockchip USB revisited

2023-03-21 Thread Michael Grunditz
In message 
  Stefan Kalkowski  wrote:

> Hi Michael,

> On Mon, Mar 20, 2023 at 03:29:48PM +0100, Michael Grunditz wrote:
>> Hi again,
>> 
>> How does the dts extraction work? I would like to have a local copy in
>> the repo.. In order to build the driver I needed to do brute force
>> hacks into dde_linux.. can I override files from it in my repo?

> We provide a device tree source extraction tool in `tool/dts/extract`.
> You can see how it is used, e.g., within
> `genode-imx/src/drivers/linux_mnt_reform2_drv_target.inc` at the end
> of the file.

> First you need to preprocess the Linux original device tree source,
> and then use `extract --select XXX --select YYY` to extract the nodes
> and their transitive closure you're interested in.
Ok. I tried my best to get the dts to be included but all I got was empty 
file. I actually injected it to th kernel tree that I have on my vps ( 
tarball)



> Regarding the shadowing of files within dde_linux: I would
> try to avoid that as far as possible to stay update compliant. Maybe
> you can explain in more detail where it doesn't fit your needs?
> But of course it is possible to use or not use whatever shadow file
> exists within dde_linux. In that case you might need to avoid the
> usage of `repos/dde_linux/lib/import/import-lx_emul_common.inc`, and
> define your own stripped version of it defining what file is included
> exactly.

OK. Yes I don't want to hack in dde_linux, but on the other hand, it isn't 
goood to patch the kernel in page handling. I will make a diff next week 
so you can look at it. I added a couple of things to pg_table and page. 
The thing is , I am using a newer kernel than the one you use for 
alwinner.

I can use the public kernel , since it got the required phy driver.
I just got the little task to bring up PCIe on rk3399 -:) So I will be 
occupied with that for a while.


-- 
Best regards,
Michael Grunditz

**  **

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-21 Thread Stefan Kalkowski
Hi Michael,

On Mon, Mar 20, 2023 at 03:29:48PM +0100, Michael Grunditz wrote:
> Hi again,
> 
> How does the dts extraction work? I would like to have a local copy in
> the repo.. In order to build the driver I needed to do brute force
> hacks into dde_linux.. can I override files from it in my repo?

We provide a device tree source extraction tool in `tool/dts/extract`.
You can see how it is used, e.g., within
`genode-imx/src/drivers/linux_mnt_reform2_drv_target.inc` at the end
of the file.

First you need to preprocess the Linux original device tree source,
and then use `extract --select XXX --select YYY` to extract the nodes
and their transitive closure you're interested in.

Regarding the shadowing of files within dde_linux: I would
try to avoid that as far as possible to stay update compliant. Maybe
you can explain in more detail where it doesn't fit your needs?
But of course it is possible to use or not use whatever shadow file
exists within dde_linux. In that case you might need to avoid the
usage of `repos/dde_linux/lib/import/import-lx_emul_common.inc`, and
define your own stripped version of it defining what file is included
exactly.

Regards
Stefan

> 
> Thanks,
> 
> Michael
> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-21 Thread Stefan Kalkowski
Hi Michael,

On Fri, Mar 17, 2023 at 09:35:08PM +0100, Michael Grunditz wrote:
> I got it to build with Rockchip kernel ,but the dts files are
> incomplete from the only public repo I know about. I will try BSP ,
> but I can't share that. The dts I have now , doesn't make any sense at
> all comparing the TRMs,

indeed re-using the vendor kernel and DTS makes a lot of sense. We
also went that way for MNT Reform 2, and the Pinephone. It is crucial,
following the Linux driver porting approach to be able to easily test
a downstripped variant of the Linux kernel on your target hardware to
be able to correlate runtime issues in between original driver and
ported version.

However, if it is not possible to reference the original sources, this
is quite unfortunate.

Regards
Stefan

> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-20 Thread Michael Grunditz
Hi again,

How does the dts extraction work? I would like to have a local copy in
the repo.. In order to build the driver I needed to do brute force
hacks into dde_linux.. can I override files from it in my repo?

Thanks,

Michael

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-17 Thread Michael Grunditz
I got it to build with Rockchip kernel ,but the dts files are
incomplete from the only public repo I know about. I will try BSP ,
but I can't share that. The dts I have now , doesn't make any sense at
all comparing the TRMs,

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-17 Thread Michael Grunditz
> Using the Linux kernel drivers is simply an economic decision. When
> using the latest lx_emul/lx_kit approach it tooks very few days to
> enable a new driver, and it tooks even less to update the code base,
> which is not the case with the deprecated dde_linux usb_host driver
> mentioned above. I hope you can understand this motivation.
> However, if you are strongly motivated to implement dedicated USB
> protocol stacks from scratch, I assume nobody will argue against it.


OK. I understand. It is just that I am unfamiliar with linux drivers.
I will try a bit more. The rockchip kernel fais quite early in page
table.
I think I got around that, but reverted the change.

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-17 Thread Stefan Kalkowski
Hi Michael,

On Fri, Mar 17, 2023 at 10:48:25AM +0100, Michael Grunditz wrote:
> On Fri, 17 Mar 2023 at 10:39, Stefan Kalkowski
>  wrote:
> >
> > Hi Michael,
> >
> > On Tue, Mar 14, 2023 at 03:47:48PM +0100, Michael Grunditz wrote:
> > > > Do you generate the "dep" files automatically? I gave up and added all 
> > > > headers.
> > >
> > > Oh well.. I can't get rockchip kernel to build ( it does build by
> > > itself). I have injected my dts files into a64 kernel and I plan to
> > > skip phy init , only using ehci and uboot initiated hw.
> > >
> > > However build fails with this little message:
> > > LINK a64_usb_host_drv
> > > cc1: fatal error:
> > > /home/micken/oldhome/micken/src/new/genode/depot/genodelabs/api/a64_linux/2023-03-14-z-x-x-x-x-x-x-x-x-
> > > x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x/src/linux/: No
> > > such file or directory
> >
> > I'm not quite sure what the problem is, but the very long
> > automatically generated depot package name indicates that your
> > observed problems have to do with the package build of your driver. As
> > said in the mail before, please try to develop the driver without
> > packaging to circumvent that class of problems in the first place.
> 
> 
> Thanks for replying.
> 
> I have more or less given up building from A64 driver. I need to have
> a custom kernel and that refuses to build. Having the driver in
> dde_linux works without problems, except for not building from
> "interactive". I need to do make drivers/usb_host.

As said before, please reconsider this decision in the light of the
quick disappearance of `repos/dde_linux/src/drivers/usb_host`.

> 
> How do I set the controller address for ehci?

It is set in the platform driver's devices ROM, e.g. in
`genode-imx/board/imx6q_sabrelite/devices`. Moreover, you have to
assign the devices to your driver within the platform driver's policy.
For an example, have a look at:
`genode-imx/repos/imx/recipes/raw/test_usb_host_drv-imx6q_sabrelite/drivers.config`

Regards
Stefan

> 
> /Michael
> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-17 Thread Stefan Kalkowski
Hi Michael,

On Tue, Mar 14, 2023 at 07:21:20PM +0100, Michael Grunditz wrote:
> > That directory is there , so I have no clue what it means.
> >
> > Michael
> 
> Just thinking ... the dde_linux driver is much better for me. Much
> more generic. Is it possible to drive that from my rockchip dir? I
> have tried that before without luck. If I put a driver in
> dde_linux/src/drivers/usb_host/spec/ and enable dde_linux in
> build.conf I get a working driver.

I understand that this might be frustrating, but the mentioned
usb_host driver and the underlying legacy lx_emul approach are
deprecated and will vanish soon.

Apart from the quite old Linux code base, it is not economically
senseful for us to maintain this approach any longer. Therefore, I
would strongly encourage you to better follow the first approach you
took.

> 
> To be honest , I think that having generic ohci, ehci and xhci and use
> linux kernel for phy is a better approach rather than doing the whole
> driver stack for each platform.
> 
> I would be happy to get some input on this.

I agree, it would be desireable to have generic protocols for the
different USB specifications, as well as HUB handling, device
detection, resetting etc.. However, from our team's perspective it is
too complex to stem this development (beside all other important
work to do) without significant funding or otherwise strong external
motivation.

Using the Linux kernel drivers is simply an economic decision. When
using the latest lx_emul/lx_kit approach it tooks very few days to
enable a new driver, and it tooks even less to update the code base,
which is not the case with the deprecated dde_linux usb_host driver
mentioned above. I hope you can understand this motivation.
However, if you are strongly motivated to implement dedicated USB
protocol stacks from scratch, I assume nobody will argue against it.

Regards
Stefan

> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-17 Thread Michael Grunditz
On Fri, 17 Mar 2023 at 10:39, Stefan Kalkowski
 wrote:
>
> Hi Michael,
>
> On Tue, Mar 14, 2023 at 03:47:48PM +0100, Michael Grunditz wrote:
> > > Do you generate the "dep" files automatically? I gave up and added all 
> > > headers.
> >
> > Oh well.. I can't get rockchip kernel to build ( it does build by
> > itself). I have injected my dts files into a64 kernel and I plan to
> > skip phy init , only using ehci and uboot initiated hw.
> >
> > However build fails with this little message:
> > LINK a64_usb_host_drv
> > cc1: fatal error:
> > /home/micken/oldhome/micken/src/new/genode/depot/genodelabs/api/a64_linux/2023-03-14-z-x-x-x-x-x-x-x-x-
> > x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x/src/linux/: No
> > such file or directory
>
> I'm not quite sure what the problem is, but the very long
> automatically generated depot package name indicates that your
> observed problems have to do with the package build of your driver. As
> said in the mail before, please try to develop the driver without
> packaging to circumvent that class of problems in the first place.


Thanks for replying.

I have more or less given up building from A64 driver. I need to have
a custom kernel and that refuses to build. Having the driver in
dde_linux works without problems, except for not building from
"interactive". I need to do make drivers/usb_host.

How do I set the controller address for ehci?

/Michael

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-17 Thread Stefan Kalkowski
Hi Michael,

On Tue, Mar 14, 2023 at 03:47:48PM +0100, Michael Grunditz wrote:
> > Do you generate the "dep" files automatically? I gave up and added all 
> > headers.
> 
> Oh well.. I can't get rockchip kernel to build ( it does build by
> itself). I have injected my dts files into a64 kernel and I plan to
> skip phy init , only using ehci and uboot initiated hw.
> 
> However build fails with this little message:
> LINK a64_usb_host_drv
> cc1: fatal error:
> /home/micken/oldhome/micken/src/new/genode/depot/genodelabs/api/a64_linux/2023-03-14-z-x-x-x-x-x-x-x-x-
> x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x/src/linux/: No
> such file or directory

I'm not quite sure what the problem is, but the very long
automatically generated depot package name indicates that your
observed problems have to do with the package build of your driver. As
said in the mail before, please try to develop the driver without
packaging to circumvent that class of problems in the first place.

Regards
Stefan

> 
> That directory is there , so I have no clue what it means.
> 
> Michael
> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-17 Thread Stefan Kalkowski
Hi Michael,

On Tue, Mar 14, 2023 at 11:59:06AM +0100, Michael Grunditz wrote:
> On Mon, 13 Mar 2023 at 17:59, Michael Grunditz
>  wrote:
> >
> > > To cross-check, does the creation of the binary archive
> > > bin/arm_v8a/a64_usb_host_drv using the genode-allwinner repository work
> > > as it should?
> > >
> > Thanks for help! It builds ( but no cigar!).  I managed to put a
> > comment in a list , so everything failed :-)
> 
> Seems like my linux kernel changed paging code.. quite a lot. This
> will take some time.
> Do you generate the "dep" files automatically? I gave up and added all 
> headers.

In general, we do not use the depot packing during development of a
new driver, but use something like: `build { drivers/usb_host/rkxxx }
inside the test run-script instead. Therefore, you do not have to
update the dep files again and again.

Apart from that, we have the little helper tool:
`tool/dde_linux/list_dependencies` to automatically create the dep
file.

Regards
Stefan

> 
> ___
> Genode users mailing list
> users@lists.genode.org
> https://lists.genode.org/listinfo/users

-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-14 Thread Michael Grunditz
> That directory is there , so I have no clue what it means.
>
> Michael

Just thinking ... the dde_linux driver is much better for me. Much
more generic. Is it possible to drive that from my rockchip dir? I
have tried that before without luck. If I put a driver in
dde_linux/src/drivers/usb_host/spec/ and enable dde_linux in
build.conf I get a working driver.

To be honest , I think that having generic ohci, ehci and xhci and use
linux kernel for phy is a better approach rather than doing the whole
driver stack for each platform.

I would be happy to get some input on this.

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-14 Thread Michael Grunditz
> Do you generate the "dep" files automatically? I gave up and added all 
> headers.

Oh well.. I can't get rockchip kernel to build ( it does build by
itself). I have injected my dts files into a64 kernel and I plan to
skip phy init , only using ehci and uboot initiated hw.

However build fails with this little message:
LINK a64_usb_host_drv
cc1: fatal error:
/home/micken/oldhome/micken/src/new/genode/depot/genodelabs/api/a64_linux/2023-03-14-z-x-x-x-x-x-x-x-x-
x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x/src/linux/: No
such file or directory

That directory is there , so I have no clue what it means.

Michael

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-14 Thread Michael Grunditz
On Mon, 13 Mar 2023 at 17:59, Michael Grunditz
 wrote:
>
> > To cross-check, does the creation of the binary archive
> > bin/arm_v8a/a64_usb_host_drv using the genode-allwinner repository work
> > as it should?
> >
> Thanks for help! It builds ( but no cigar!).  I managed to put a
> comment in a list , so everything failed :-)

Seems like my linux kernel changed paging code.. quite a lot. This
will take some time.
Do you generate the "dep" files automatically? I gave up and added all headers.

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-13 Thread Michael Grunditz
> To cross-check, does the creation of the binary archive
> bin/arm_v8a/a64_usb_host_drv using the genode-allwinner repository work
> as it should?
>
Thanks for help! It builds ( but no cigar!).  I managed to put a
comment in a list , so everything failed :-)

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-13 Thread Norman Feske

Hi Michael,


Yes I got that..If I do build the linux kernel it works. The problem
is that when it tries to use source tree from "depot" iit isn't
configured. I haven't refactored the sources yet (everything is named
a64)  and this is the output I get:


checking library dependencies...
  Library a64_linux
MERGEa64_linux.lib.a
  Library a64_linux_generated
MERGEa64_linux_generated.lib.a
CONFIG   Linux
  [Linux]  
/home/micken/oldhome/micken/src/new/genode/depot/genodelabs/api/a64_linux/2023-03-13/src/linux/
Makefile:621: arch/arm64/Makefile: No such file or directory
  [Linux]  make[9]: *** No rule to make target 'arch/arm64/Makefile'.  Stop.
  [Linux]  make[8]: *** [Makefile:185: __sub-make] Error 2


the content of the depot api archive is unconfigured. The configuration 
happens at build time of each driver that uses the API (so once for each 
binary archive). It may be helpful to peek into the build directory when 
building a depot binary by passing the argument KEEP_BUILD_DIR=1 to the 
tool/depot/create tool.


Since your error message complains about a missing Makefile, I suspect 
that something with the packaging of your a64_linux api archive went 
wrong. When looking at the a64_1inux api archive in my depot, I'm seeing 
a file at src/linux/arch/arm64/Makefile. Does it exist in your case? 
Have you re-used the depot recipe of for api/a64_linux [1] as is?


[1] 
https://github.com/genodelabs/genode-allwinner/blob/master/recipes/api/a64_linux/content.mk


To cross-check, does the creation of the binary archive 
bin/arm_v8a/a64_usb_host_drv using the genode-allwinner repository work 
as it should?


Cheers
Norman

--
Dr.-Ing. Norman Feske
Genode Labs

https://www.genode-labs.com · https://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth


___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-13 Thread Michael Grunditz
> In the genode-allwinner repository, the Linux kernel's config step
> happens via the 'a64_linux_generated' pseudo library [1].
>
> [1]
> https://github.com/genodelabs/genode-allwinner/blob/master/lib/mk/spec/arm_v8/a64_linux_generated.mk
>
> If a target has 'a64_lx_emul' added to the 'LIBS' variable, the
> corresponding import file implicitly adds the 'a64_linux_generated'
> library [2].

Yes I got that..If I do build the linux kernel it works. The problem
is that when it tries to use source tree from "depot" iit isn't
configured. I haven't refactored the sources yet (everything is named
a64)  and this is the output I get:


checking library dependencies...
 Library a64_linux
   MERGEa64_linux.lib.a
 Library a64_linux_generated
   MERGEa64_linux_generated.lib.a
   CONFIG   Linux
 [Linux]  
/home/micken/oldhome/micken/src/new/genode/depot/genodelabs/api/a64_linux/2023-03-13/src/linux/
Makefile:621: arch/arm64/Makefile: No such file or directory
 [Linux]  make[9]: *** No rule to make target 'arch/arm64/Makefile'.  Stop.
 [Linux]  make[8]: *** [Makefile:185: __sub-make] Error 2

___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users


Re: Rockchip USB revisited

2023-03-13 Thread Norman Feske

Hi Michael,

On 2023-03-13 15:47, Michael Grunditz wrote:

I am trying to bring up EHCI using the A64 driver. I configiured build
system to download a tar ball with linux kernel. However in the:
"CONFIG Linux" step  I get this:

Makefile:621: arch/arm64/Makefile: No such file or directory

Which is natural since the source tree in depot isn't configured.


So the first questions is; when is the tree configured?
In the genode-allwinner repository, the Linux kernel's config step 
happens via the 'a64_linux_generated' pseudo library [1].


[1] 
https://github.com/genodelabs/genode-allwinner/blob/master/lib/mk/spec/arm_v8/a64_linux_generated.mk


If a target has 'a64_lx_emul' added to the 'LIBS' variable, the 
corresponding import file implicitly adds the 'a64_linux_generated' 
library [2].


[2] 
https://github.com/genodelabs/genode-allwinner/blob/master/lib/import/import-a64_lx_emul.mk


So it should be enough to add the following line to a target.mk file:

  LIBS += base a64_lx_emul

When processed by the Genode build system, the 'a64_linux_generated' 
library leaves a readily configured Linux build directory at 
/var/libcache/a64_linux_generated/.


Cheers
Norman

--
Dr.-Ing. Norman Feske
Genode Labs

https://www.genode-labs.com · https://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth


___
Genode users mailing list
users@lists.genode.org
https://lists.genode.org/listinfo/users