From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2] ARM: parse separate DT properties for different commandlines Date: Mon, 3 Jun 2013 15:22:42 +0100 Message-ID: <51ACA6B2.7070102@citrix.com> References: <1370267034-21467-1-git-send-email-andre.przywara@calxeda.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1370267034-21467-1-git-send-email-andre.przywara@calxeda.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andre Przywara Cc: julien.grall@linaro.org, xen-devel@lists.xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 06/03/2013 02:43 PM, Andre Przywara wrote: > Currently we use the chosen/bootargs property as the Xen commandline > and rely on xen,dom0-bootargs for Dom0. However this brings issues > with bootloaders, which usually build bootargs by bootscripts for a > Linux kernel - and not for the entirely different Xen hypervisor. > Introduce a new possible device tree property "xen,xen-bootargs" > explicitly for the Xen hypervisor and make the selection of which to > use more fine grained: > - If xen,xen-bootargs is present, it will be used for Xen. > - If xen,dom0-bootargs is present, it will be used for Dom0. > - If xen,xen-bootargs is _not_ present, but xen,dom0-bootargs is, > bootargs will be used for Xen. Like the current situation. > - If no Xen specific properties are present, bootargs is for Dom0. > - If xen,xen-bootargs is present, but xen,dom0-bootargs is missing, > bootargs will be used for Dom0. Could you add this logic in misc/arm/device-tree/booting.txt? > The aim is to allow common bootscripts to boot both Xen and native > Linux with the same device tree blob. If needed, one could hard-code > the Xen commandline into the DTB, leaving bootargs for Dom0 to be set > by the (non Xen-aware) bootloader. > I also have a simple patch for u-boot to transfer the content of the > "xen_bootargs" environment variable into the xen,xen-bootargs dtb > property. > I will post the u-boot patch to their ML later. > > Changes from v1: > - fix whitespace issues > > Signed-off-by: Andre Przywara > --- > xen/arch/arm/domain_build.c | 13 ++++++++++--- > xen/common/device_tree.c | 7 ++++++- > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index b92c64b..5809489 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -139,6 +139,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, > u32 address_cells, u32 size_cells) > { > const char *bootargs = NULL; > + int had_dom0_bootargs = 0; > int prop; > > if ( early_info.modules.nr_mods >= 1 && > @@ -169,11 +170,17 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo, > */ > if ( device_tree_node_matches(fdt, node, "chosen") ) > { > - if ( strcmp(prop_name, "bootargs") == 0 ) > + if ( strcmp(prop_name, "xen,xen-bootargs") == 0 ) > + continue; Could you complete the above comment to specify we are removing xen,xen-bootargs? Thanks, Julien