mbox series

[0/2] Devicetree support for UML

Message ID 20211208151123.29313-1-vincent.whitchurch@axis.com
Headers show
Series Devicetree support for UML | expand

Message

Vincent Whitchurch Dec. 8, 2021, 3:11 p.m. UTC
This series add support for passing a devicetree blob to UML.  It can be used
for testing device drivers.

Vincent Whitchurch (2):
  um: Extract load file helper from initrd.c
  um: Add devicetree support

 arch/um/Kconfig            |  1 +
 arch/um/kernel/Makefile    |  2 ++
 arch/um/kernel/dtb.c       | 41 +++++++++++++++++++++++++
 arch/um/kernel/initrd.c    | 48 ++++--------------------------
 arch/um/kernel/load_file.c | 61 ++++++++++++++++++++++++++++++++++++++
 arch/um/kernel/um_arch.c   |  3 ++
 arch/um/kernel/um_arch.h   | 14 +++++++++
 7 files changed, 127 insertions(+), 43 deletions(-)
 create mode 100644 arch/um/kernel/dtb.c
 create mode 100644 arch/um/kernel/load_file.c
 create mode 100644 arch/um/kernel/um_arch.h

Comments

Richard Weinberger Dec. 21, 2021, 8:55 p.m. UTC | #1
Vincent,

----- Ursprüngliche Mail -----
> Von: "Vincent Whitchurch" <vincent.whitchurch@axis.com>
> An: "Jeff Dike" <jdike@addtoit.com>, "richard" <richard@nod.at>, "anton ivanov" <anton.ivanov@cambridgegreys.com>
> CC: kernel@axis.com, "linux-kernel" <linux-kernel@vger.kernel.org>, "linux-um" <linux-um@lists.infradead.org>,
> "devicetree" <devicetree@vger.kernel.org>, "Vincent Whitchurch" <vincent.whitchurch@axis.com>
> Gesendet: Mittwoch, 8. Dezember 2021 16:11:21
> Betreff: [PATCH 0/2] Devicetree support for UML

> This series add support for passing a devicetree blob to UML.  It can be used
> for testing device drivers.

Nice feature.
Code looks good so far. But while building I'm facing this warning:

WARNING: unmet direct dependencies detected for OF_EARLY_FLATTREE
  Depends on [n]: OF [=n]
  Selected by [y]:
  - UML [=y]


Please note that my UML config has CONFIG_OF=n.

Thanks,
//richard
Johannes Berg Dec. 21, 2021, 8:56 p.m. UTC | #2
On Tue, 2021-12-21 at 21:55 +0100, Richard Weinberger wrote:
> Vincent,
> 
> ----- Ursprüngliche Mail -----
> > Von: "Vincent Whitchurch" <vincent.whitchurch@axis.com>
> > An: "Jeff Dike" <jdike@addtoit.com>, "richard" <richard@nod.at>, "anton ivanov" <anton.ivanov@cambridgegreys.com>
> > CC: kernel@axis.com, "linux-kernel" <linux-kernel@vger.kernel.org>, "linux-um" <linux-um@lists.infradead.org>,
> > "devicetree" <devicetree@vger.kernel.org>, "Vincent Whitchurch" <vincent.whitchurch@axis.com>
> > Gesendet: Mittwoch, 8. Dezember 2021 16:11:21
> > Betreff: [PATCH 0/2] Devicetree support for UML
> 
> > This series add support for passing a devicetree blob to UML.  It can be used
> > for testing device drivers.
> 
> Nice feature.
> Code looks good so far. But while building I'm facing this warning:
> 
> WARNING: unmet direct dependencies detected for OF_EARLY_FLATTREE
>   Depends on [n]: OF [=n]
>   Selected by [y]:
>   - UML [=y]
> 
> 
> Please note that my UML config has CONFIG_OF=n.
> 

Hm. So maybe that needs to be

	select OF_EARLY_FLATTREE if OF

or so?

johannes
Richard Weinberger Dec. 21, 2021, 9:13 p.m. UTC | #3
----- Ursprüngliche Mail -----
> Von: "Johannes Berg" <johannes@sipsolutions.net>
> An: "richard" <richard@nod.at>, "Vincent Whitchurch" <vincent.whitchurch@axis.com>
> CC: "Jeff Dike" <jdike@addtoit.com>, "anton ivanov" <anton.ivanov@cambridgegreys.com>, "kernel" <kernel@axis.com>,
> "linux-kernel" <linux-kernel@vger.kernel.org>, "linux-um" <linux-um@lists.infradead.org>, "devicetree"
> <devicetree@vger.kernel.org>
> Gesendet: Dienstag, 21. Dezember 2021 21:56:50
> Betreff: Re: [PATCH 0/2] Devicetree support for UML

> On Tue, 2021-12-21 at 21:55 +0100, Richard Weinberger wrote:
>> Vincent,
>> 
>> ----- Ursprüngliche Mail -----
>> > Von: "Vincent Whitchurch" <vincent.whitchurch@axis.com>
>> > An: "Jeff Dike" <jdike@addtoit.com>, "richard" <richard@nod.at>, "anton ivanov"
>> > <anton.ivanov@cambridgegreys.com>
>> > CC: kernel@axis.com, "linux-kernel" <linux-kernel@vger.kernel.org>, "linux-um"
>> > <linux-um@lists.infradead.org>,
>> > "devicetree" <devicetree@vger.kernel.org>, "Vincent Whitchurch"
>> > <vincent.whitchurch@axis.com>
>> > Gesendet: Mittwoch, 8. Dezember 2021 16:11:21
>> > Betreff: [PATCH 0/2] Devicetree support for UML
>> 
>> > This series add support for passing a devicetree blob to UML.  It can be used
>> > for testing device drivers.
>> 
>> Nice feature.
>> Code looks good so far. But while building I'm facing this warning:
>> 
>> WARNING: unmet direct dependencies detected for OF_EARLY_FLATTREE
>>   Depends on [n]: OF [=n]
>>   Selected by [y]:
>>   - UML [=y]
>> 
>> 
>> Please note that my UML config has CONFIG_OF=n.
>> 
> 
> Hm. So maybe that needs to be
> 
>	select OF_EARLY_FLATTREE if OF

Yeah, IIRC arm and mips use such a pattern too.
Vincent, what do you think?

Thanks,
//richard
Vincent Whitchurch Dec. 22, 2021, 10:23 a.m. UTC | #4
On Tue, Dec 21, 2021 at 10:13:03PM +0100, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
> > Von: "Johannes Berg" <johannes@sipsolutions.net>
> > Gesendet: Dienstag, 21. Dezember 2021 21:56:50
> > On Tue, 2021-12-21 at 21:55 +0100, Richard Weinberger wrote:
> >> WARNING: unmet direct dependencies detected for OF_EARLY_FLATTREE
> >>   Depends on [n]: OF [=n]
> >>   Selected by [y]:
> >>   - UML [=y]
> >> 
> >> Please note that my UML config has CONFIG_OF=n.
> >> 
> > Hm. So maybe that needs to be
> > 
> >	select OF_EARLY_FLATTREE if OF
> 
> Yeah, IIRC arm and mips use such a pattern too.  Vincent, what do you
> think?

Yes, that looks like the correct fix.  I've tested it and it works.  Do
you prefer to fix it up locally or should I repost?
Richard Weinberger Dec. 22, 2021, 7:31 p.m. UTC | #5
Vincent,

----- Ursprüngliche Mail -----
> Von: "Vincent Whitchurch" <vincent.whitchurch@axis.com>
> An: "richard" <richard@nod.at>
> CC: "Johannes Berg" <johannes@sipsolutions.net>, "Jeff Dike" <jdike@addtoit.com>, "anton ivanov"
> <anton.ivanov@cambridgegreys.com>, "kernel" <kernel@axis.com>, "linux-kernel" <linux-kernel@vger.kernel.org>,
> "linux-um" <linux-um@lists.infradead.org>, "devicetree" <devicetree@vger.kernel.org>
> Gesendet: Mittwoch, 22. Dezember 2021 11:23:57
> Betreff: Re: [PATCH 0/2] Devicetree support for UML

> On Tue, Dec 21, 2021 at 10:13:03PM +0100, Richard Weinberger wrote:
>> ----- Ursprüngliche Mail -----
>> > Von: "Johannes Berg" <johannes@sipsolutions.net>
>> > Gesendet: Dienstag, 21. Dezember 2021 21:56:50
>> > On Tue, 2021-12-21 at 21:55 +0100, Richard Weinberger wrote:
>> >> WARNING: unmet direct dependencies detected for OF_EARLY_FLATTREE
>> >>   Depends on [n]: OF [=n]
>> >>   Selected by [y]:
>> >>   - UML [=y]
>> >> 
>> >> Please note that my UML config has CONFIG_OF=n.
>> >> 
>> > Hm. So maybe that needs to be
>> > 
>> >	select OF_EARLY_FLATTREE if OF
>> 
>> Yeah, IIRC arm and mips use such a pattern too.  Vincent, what do you
>> think?
> 
> Yes, that looks like the correct fix.  I've tested it and it works.  Do
> you prefer to fix it up locally or should I repost?

I'll fix it myself. :-)

Thanks,
//richard