* Re: [PATCH 1/5] arm: devtree: Set system_rev from DT "/revision" [not found] ` <20151224190237.GA17343@pali> @ 2015-12-28 21:01 ` Frank Rowand [not found] ` <5681A322.2090204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Frank Rowand @ 2015-12-28 21:01 UTC (permalink / raw) To: Pali Rohár Cc: Russell King, Laura Abbott, Grant Likely, Rob Herring, Will Deacon, Ivaylo Dimitrov, Sebastian Reichel, Pavel Machek, Tony Lindgren, Andreas Färber, linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Devicetree Spec List Adding devicetree-spec, and commenting below. On 12/24/2015 11:02 AM, Pali Rohár wrote: > On Monday 06 July 2015 22:26:09 Pali Rohár wrote: >> With this patch "/revision" DT entry is used to set global system_rev >> variable. DT "/revision" is expected to be u32 numeric value. >> >> TODO: add documentation >> >> Signed-off-by: Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> --- >> arch/arm/kernel/devtree.c | 12 ++++++++++-- >> 1 file changed, 10 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c >> index 11c54de..7d82749 100644 >> --- a/arch/arm/kernel/devtree.c >> +++ b/arch/arm/kernel/devtree.c >> @@ -19,6 +19,7 @@ >> #include <linux/of_irq.h> >> #include <linux/of_platform.h> >> #include <linux/smp.h> >> +#include <linux/libfdt_env.h> >> >> #include <asm/cputype.h> >> #include <asm/setup.h> >> @@ -26,6 +27,7 @@ >> #include <asm/smp_plat.h> >> #include <asm/mach/arch.h> >> #include <asm/mach-types.h> >> +#include <asm/system_info.h> >> >> >> #ifdef CONFIG_SMP >> @@ -204,6 +206,8 @@ static const void * __init arch_get_next_mach(const char *const **match) >> const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) >> { >> const struct machine_desc *mdesc, *mdesc_best = NULL; >> + unsigned long dt_root; >> + const u32 *rev; >> >> #ifdef CONFIG_ARCH_MULTIPLATFORM >> DT_MACHINE_START(GENERIC_DT, "Generic DT based system") >> @@ -215,17 +219,16 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) >> if (!dt_phys || !early_init_dt_verify(phys_to_virt(dt_phys))) >> return NULL; >> >> + dt_root = of_get_flat_dt_root(); >> mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach); >> >> if (!mdesc) { >> const char *prop; >> int size; >> - unsigned long dt_root; >> >> early_print("\nError: unrecognized/unsupported " >> "device tree compatible list:\n[ "); >> >> - dt_root = of_get_flat_dt_root(); >> prop = of_get_flat_dt_prop(dt_root, "compatible", &size); >> while (size > 0) { >> early_print("'%s' ", prop); >> @@ -246,5 +249,10 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) >> /* Change machine number to match the mdesc we're using */ >> __machine_arch_type = mdesc->nr; >> >> + /* Set system revision from DT */ >> + rev = of_get_flat_dt_prop(dt_root, "revision", NULL); >> + if (rev) >> + system_rev = fdt32_to_cpu(*rev); >> + >> return mdesc; >> } > > This patch and second one (with subject "[PATCH 2/5] arm: boot: convert > ATAG_REVISION to DT "/revision" entry") are still needed. > > Are there any objections for them? If not, I will add missing DT > documentation and will resend them. Patch 2/5 copies the value from ATAG_REVISION into the fdt "/revision" property. If the use of /revision is limited to being a location to hold an ATAG value to pass to the global variable system_rev, then it would make sense to just copy directly from the ATAG value into system_rev in the same board file where you are copying the ATAGs. -Frank ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <5681A322.2090204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 1/5] arm: devtree: Set system_rev from DT "/revision" [not found] ` <5681A322.2090204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2015-12-28 22:27 ` Arnd Bergmann 2016-01-05 11:37 ` Pali Rohár 0 siblings, 1 reply; 4+ messages in thread From: Arnd Bergmann @ 2015-12-28 22:27 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, frowand.list-Re5JQEeQqe8AvxtiuMwx3w Cc: Pali Rohár, Ivaylo Dimitrov, Laura Abbott, Tony Lindgren, Sebastian Reichel, Will Deacon, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Devicetree Spec List, Rob Herring, Pavel Machek, Grant Likely, Russell King, linux-omap-u79uwXL29TY76Z2rM5mHXA, Andreas Färber On Monday 28 December 2015 13:01:22 Frank Rowand wrote: > > Patch 2/5 copies the value from ATAG_REVISION into the fdt "/revision" > property. > > If the use of /revision is limited to being a location to hold an ATAG > value to pass to the global variable system_rev, then it would make > sense to just copy directly from the ATAG value into system_rev in the > same board file where you are copying the ATAGs. Agreed. That would be simpler, and avoid a situation where someone relies on the /revision property in DT to be set from the atags compat code (preventing an upgrade to a newer bootloader), or on the system_rev variable to be the same across multiple boot loaders, in the absence of other kernel code setting it. Arnd ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/5] arm: devtree: Set system_rev from DT "/revision" 2015-12-28 22:27 ` Arnd Bergmann @ 2016-01-05 11:37 ` Pali Rohár 2016-01-05 11:45 ` Arnd Bergmann 0 siblings, 1 reply; 4+ messages in thread From: Pali Rohár @ 2016-01-05 11:37 UTC (permalink / raw) To: Arnd Bergmann Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, frowand.list-Re5JQEeQqe8AvxtiuMwx3w, Ivaylo Dimitrov, Laura Abbott, Tony Lindgren, Sebastian Reichel, Will Deacon, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Devicetree Spec List, Rob Herring, Pavel Machek, Grant Likely, Russell King, linux-omap-u79uwXL29TY76Z2rM5mHXA, Andreas Färber On Monday 28 December 2015 23:27:17 Arnd Bergmann wrote: > On Monday 28 December 2015 13:01:22 Frank Rowand wrote: > > > > Patch 2/5 copies the value from ATAG_REVISION into the fdt "/revision" > > property. > > > > If the use of /revision is limited to being a location to hold an ATAG > > value to pass to the global variable system_rev, then it would make > > sense to just copy directly from the ATAG value into system_rev in the > > same board file where you are copying the ATAGs. > > Agreed. That would be simpler, and avoid a situation where someone relies > on the /revision property in DT to be set from the atags compat code > (preventing an upgrade to a newer bootloader), or on the system_rev variable > to be the same across multiple boot loaders, in the absence of other > kernel code setting it. So, set system_rev only for Nokia N900? At same place where is called save_atags()? -- Pali Roh√°r pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/5] arm: devtree: Set system_rev from DT "/revision" 2016-01-05 11:37 ` Pali Rohár @ 2016-01-05 11:45 ` Arnd Bergmann 0 siblings, 0 replies; 4+ messages in thread From: Arnd Bergmann @ 2016-01-05 11:45 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: Pali Rohár, Ivaylo Dimitrov, Laura Abbott, Tony Lindgren, Sebastian Reichel, Will Deacon, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Devicetree Spec List, Rob Herring, Pavel Machek, Grant Likely, Russell King, linux-omap-u79uwXL29TY76Z2rM5mHXA, frowand.list-Re5JQEeQqe8AvxtiuMwx3w, Andreas Färber On Tuesday 05 January 2016 12:37:50 Pali Rohár wrote: > On Monday 28 December 2015 23:27:17 Arnd Bergmann wrote: > > On Monday 28 December 2015 13:01:22 Frank Rowand wrote: > > > > > > Patch 2/5 copies the value from ATAG_REVISION into the fdt "/revision" > > > property. > > > > > > If the use of /revision is limited to being a location to hold an ATAG > > > value to pass to the global variable system_rev, then it would make > > > sense to just copy directly from the ATAG value into system_rev in the > > > same board file where you are copying the ATAGs. > > > > Agreed. That would be simpler, and avoid a situation where someone relies > > on the /revision property in DT to be set from the atags compat code > > (preventing an upgrade to a newer bootloader), or on the system_rev variable > > to be the same across multiple boot loaders, in the absence of other > > kernel code setting it. > > So, set system_rev only for Nokia N900? At same place where is called > save_atags()? > > Yes. Arnd ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-05 11:45 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1436214373-12969-1-git-send-email-pali.rohar@gmail.com> [not found] ` <1436214373-12969-2-git-send-email-pali.rohar@gmail.com> [not found] ` <20151224190237.GA17343@pali> 2015-12-28 21:01 ` [PATCH 1/5] arm: devtree: Set system_rev from DT "/revision" Frank Rowand [not found] ` <5681A322.2090204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2015-12-28 22:27 ` Arnd Bergmann 2016-01-05 11:37 ` Pali Rohár 2016-01-05 11:45 ` Arnd Bergmann
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).