* [PATCH v3 1/2] Documentation: devicetree: root node serial-number property documentation
@ 2015-04-18 9:58 Paul Kocialkowski
[not found] ` <1429351135-11842-1-git-send-email-contact-W9ppeneeCTY@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Paul Kocialkowski @ 2015-04-18 9:58 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Rob Herring, Russell King, Hans De Goede, Pawel Moll,
Mark Rutland, Ian Campbell, Stefan Agner, Kumar Gala,
Paul Kocialkowski
Open firmware is already using the serial-number property for passing the
device's serial number from the bootloader to the kernel. In addition, lshw
already has support for scanning this property.
The serial number is a string that somewhat represents the device's serial
number. It might come from some form of storage (e.g. an eeprom) and be
programmed at factory-time by the manufacturer or come from identification
bits available in e.g. the SoC (note that the soc_id property in the SoC bus
should hold a full account of those bits).
The serial number is taken as-is from the bootloader, so it is up to the
bootloader to define where the serial number comes from and what length it
should be. Some use cases for the serial number require it to have a maximum
length (e.g. for USB serial number) and some other cases imply more restrictions
on what the serial number should look like (e.g. in Android, the ro.serialno
property is usually a 16-bytes (plus one null byte) representation of a 64 bit
number).
Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
---
Documentation/devicetree/booting-without-of.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/booting-without-of.txt b/Documentation/devicetree/booting-without-of.txt
index 7768518..95fc385 100644
--- a/Documentation/devicetree/booting-without-of.txt
+++ b/Documentation/devicetree/booting-without-of.txt
@@ -828,6 +828,10 @@ address which can extend beyond that limit.
name may clash with standard defined ones, you prefix them with your
vendor name and a comma.
+ Additional properties for the root node:
+
+ - serial-number : a string representing the device's serial number
+
b) The /cpus node
This node is the parent of all individual CPU nodes. It doesn't
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
[not found] ` <1429351135-11842-1-git-send-email-contact-W9ppeneeCTY@public.gmane.org>
@ 2015-04-18 9:58 ` Paul Kocialkowski
[not found] ` <1429351135-11842-2-git-send-email-contact-W9ppeneeCTY@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Paul Kocialkowski @ 2015-04-18 9:58 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: Rob Herring, Russell King, Hans De Goede, Pawel Moll,
Mark Rutland, Ian Campbell, Stefan Agner, Kumar Gala,
Paul Kocialkowski
This grabs the serial number shown in cpuinfo from the serial-number devicetree
property in priority. When booting with ATAGs (and without device-tree), the
provided number is still shown instead.
Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
---
arch/arm/include/asm/system_info.h | 1 +
arch/arm/kernel/setup.c | 27 +++++++++++++++++++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
index 720ea03..3860cbd40 100644
--- a/arch/arm/include/asm/system_info.h
+++ b/arch/arm/include/asm/system_info.h
@@ -17,6 +17,7 @@
/* information about the system we're running on */
extern unsigned int system_rev;
+extern const char *system_serial;
extern unsigned int system_serial_low;
extern unsigned int system_serial_high;
extern unsigned int mem_fclk_21285;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1d60beb..349790f 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -93,6 +93,9 @@ unsigned int __atags_pointer __initdata;
unsigned int system_rev;
EXPORT_SYMBOL(system_rev);
+const char *system_serial;
+EXPORT_SYMBOL(system_serial);
+
unsigned int system_serial_low;
EXPORT_SYMBOL(system_serial_low);
@@ -821,8 +824,29 @@ arch_initcall(customize_machine);
static int __init init_machine_late(void)
{
+#ifdef CONFIG_OF
+ struct device_node *root;
+ int ret;
+#endif
+
if (machine_desc->init_late)
machine_desc->init_late();
+
+#ifdef CONFIG_OF
+ root = of_find_node_by_path("/");
+ if (root) {
+ ret = of_property_read_string(root, "serial-number",
+ &system_serial);
+ if (ret)
+ system_serial = NULL;
+ }
+#endif
+
+ if (!system_serial)
+ system_serial = kasprintf(GFP_KERNEL, "%08x%08x",
+ system_serial_high,
+ system_serial_low);
+
return 0;
}
late_initcall(init_machine_late);
@@ -1091,8 +1115,7 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "Hardware\t: %s\n", machine_name);
seq_printf(m, "Revision\t: %04x\n", system_rev);
- seq_printf(m, "Serial\t\t: %08x%08x\n",
- system_serial_high, system_serial_low);
+ seq_printf(m, "Serial\t\t: %s\n", system_serial);
return 0;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
[not found] ` <1429351135-11842-2-git-send-email-contact-W9ppeneeCTY@public.gmane.org>
@ 2015-04-27 8:27 ` Paul Kocialkowski
2015-04-27 13:48 ` Rob Herring
1 sibling, 0 replies; 11+ messages in thread
From: Paul Kocialkowski @ 2015-04-27 8:27 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Mark Rutland,
Russell King, Pawel Moll, Ian Campbell, Stefan Agner,
Hans De Goede, Rob Herring, Kumar Gala
[-- Attachment #1: Type: text/plain, Size: 2576 bytes --]
Le samedi 18 avril 2015 à 11:58 +0200, Paul Kocialkowski a écrit :
> This grabs the serial number shown in cpuinfo from the serial-number devicetree
> property in priority. When booting with ATAGs (and without device-tree), the
> provided number is still shown instead.
Any further comment on this?
> Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
> ---
> arch/arm/include/asm/system_info.h | 1 +
> arch/arm/kernel/setup.c | 27 +++++++++++++++++++++++++--
> 2 files changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
> index 720ea03..3860cbd40 100644
> --- a/arch/arm/include/asm/system_info.h
> +++ b/arch/arm/include/asm/system_info.h
> @@ -17,6 +17,7 @@
>
> /* information about the system we're running on */
> extern unsigned int system_rev;
> +extern const char *system_serial;
> extern unsigned int system_serial_low;
> extern unsigned int system_serial_high;
> extern unsigned int mem_fclk_21285;
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 1d60beb..349790f 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -93,6 +93,9 @@ unsigned int __atags_pointer __initdata;
> unsigned int system_rev;
> EXPORT_SYMBOL(system_rev);
>
> +const char *system_serial;
> +EXPORT_SYMBOL(system_serial);
> +
> unsigned int system_serial_low;
> EXPORT_SYMBOL(system_serial_low);
>
> @@ -821,8 +824,29 @@ arch_initcall(customize_machine);
>
> static int __init init_machine_late(void)
> {
> +#ifdef CONFIG_OF
> + struct device_node *root;
> + int ret;
> +#endif
> +
> if (machine_desc->init_late)
> machine_desc->init_late();
> +
> +#ifdef CONFIG_OF
> + root = of_find_node_by_path("/");
> + if (root) {
> + ret = of_property_read_string(root, "serial-number",
> + &system_serial);
> + if (ret)
> + system_serial = NULL;
> + }
> +#endif
> +
> + if (!system_serial)
> + system_serial = kasprintf(GFP_KERNEL, "%08x%08x",
> + system_serial_high,
> + system_serial_low);
> +
> return 0;
> }
> late_initcall(init_machine_late);
> @@ -1091,8 +1115,7 @@ static int c_show(struct seq_file *m, void *v)
>
> seq_printf(m, "Hardware\t: %s\n", machine_name);
> seq_printf(m, "Revision\t: %04x\n", system_rev);
> - seq_printf(m, "Serial\t\t: %08x%08x\n",
> - system_serial_high, system_serial_low);
> + seq_printf(m, "Serial\t\t: %s\n", system_serial);
>
> return 0;
> }
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
[not found] ` <1429351135-11842-2-git-send-email-contact-W9ppeneeCTY@public.gmane.org>
2015-04-27 8:27 ` Paul Kocialkowski
@ 2015-04-27 13:48 ` Rob Herring
[not found] ` <CAL_JsqKkw7n5p1ZH345BeKkyU=GKDrhaLef__0ET7t90Cm0Eog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 1 reply; 11+ messages in thread
From: Rob Herring @ 2015-04-27 13:48 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Russell King, Hans De Goede, Pawel Moll,
Mark Rutland, Ian Campbell, Stefan Agner, Kumar Gala
On Sat, Apr 18, 2015 at 4:58 AM, Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org> wrote:
> This grabs the serial number shown in cpuinfo from the serial-number devicetree
> property in priority. When booting with ATAGs (and without device-tree), the
> provided number is still shown instead.
>
> Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
One comment below, otherwise:
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> arch/arm/include/asm/system_info.h | 1 +
> arch/arm/kernel/setup.c | 27 +++++++++++++++++++++++++--
> 2 files changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
> index 720ea03..3860cbd40 100644
> --- a/arch/arm/include/asm/system_info.h
> +++ b/arch/arm/include/asm/system_info.h
> @@ -17,6 +17,7 @@
>
> /* information about the system we're running on */
> extern unsigned int system_rev;
> +extern const char *system_serial;
> extern unsigned int system_serial_low;
> extern unsigned int system_serial_high;
> extern unsigned int mem_fclk_21285;
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index 1d60beb..349790f 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -93,6 +93,9 @@ unsigned int __atags_pointer __initdata;
> unsigned int system_rev;
> EXPORT_SYMBOL(system_rev);
>
> +const char *system_serial;
> +EXPORT_SYMBOL(system_serial);
> +
> unsigned int system_serial_low;
> EXPORT_SYMBOL(system_serial_low);
>
> @@ -821,8 +824,29 @@ arch_initcall(customize_machine);
>
> static int __init init_machine_late(void)
> {
> +#ifdef CONFIG_OF
> + struct device_node *root;
> + int ret;
> +#endif
> +
> if (machine_desc->init_late)
> machine_desc->init_late();
> +
> +#ifdef CONFIG_OF
These ifdefs should not be necessary, but please double check.
Rob
> + root = of_find_node_by_path("/");
> + if (root) {
> + ret = of_property_read_string(root, "serial-number",
> + &system_serial);
> + if (ret)
> + system_serial = NULL;
> + }
> +#endif
> +
> + if (!system_serial)
> + system_serial = kasprintf(GFP_KERNEL, "%08x%08x",
> + system_serial_high,
> + system_serial_low);
> +
> return 0;
> }
> late_initcall(init_machine_late);
> @@ -1091,8 +1115,7 @@ static int c_show(struct seq_file *m, void *v)
>
> seq_printf(m, "Hardware\t: %s\n", machine_name);
> seq_printf(m, "Revision\t: %04x\n", system_rev);
> - seq_printf(m, "Serial\t\t: %08x%08x\n",
> - system_serial_high, system_serial_low);
> + seq_printf(m, "Serial\t\t: %s\n", system_serial);
>
> return 0;
> }
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
[not found] ` <CAL_JsqKkw7n5p1ZH345BeKkyU=GKDrhaLef__0ET7t90Cm0Eog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-04-27 14:42 ` Paul Kocialkowski
2015-04-27 15:20 ` Rob Herring
2015-04-28 16:09 ` Russell King - ARM Linux
0 siblings, 2 replies; 11+ messages in thread
From: Paul Kocialkowski @ 2015-04-27 14:42 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Russell King, Hans De Goede, Pawel Moll,
Mark Rutland, Ian Campbell, Stefan Agner, Kumar Gala
[-- Attachment #1: Type: text/plain, Size: 3641 bytes --]
Le lundi 27 avril 2015 à 08:48 -0500, Rob Herring a écrit :
> On Sat, Apr 18, 2015 at 4:58 AM, Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org> wrote:
> > This grabs the serial number shown in cpuinfo from the serial-number devicetree
> > property in priority. When booting with ATAGs (and without device-tree), the
> > provided number is still shown instead.
> >
> > Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
>
> One comment below, otherwise:
>
> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>
> > ---
> > arch/arm/include/asm/system_info.h | 1 +
> > arch/arm/kernel/setup.c | 27 +++++++++++++++++++++++++--
> > 2 files changed, 26 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
> > index 720ea03..3860cbd40 100644
> > --- a/arch/arm/include/asm/system_info.h
> > +++ b/arch/arm/include/asm/system_info.h
> > @@ -17,6 +17,7 @@
> >
> > /* information about the system we're running on */
> > extern unsigned int system_rev;
> > +extern const char *system_serial;
> > extern unsigned int system_serial_low;
> > extern unsigned int system_serial_high;
> > extern unsigned int mem_fclk_21285;
> > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> > index 1d60beb..349790f 100644
> > --- a/arch/arm/kernel/setup.c
> > +++ b/arch/arm/kernel/setup.c
> > @@ -93,6 +93,9 @@ unsigned int __atags_pointer __initdata;
> > unsigned int system_rev;
> > EXPORT_SYMBOL(system_rev);
> >
> > +const char *system_serial;
> > +EXPORT_SYMBOL(system_serial);
> > +
> > unsigned int system_serial_low;
> > EXPORT_SYMBOL(system_serial_low);
> >
> > @@ -821,8 +824,29 @@ arch_initcall(customize_machine);
> >
> > static int __init init_machine_late(void)
> > {
> > +#ifdef CONFIG_OF
> > + struct device_node *root;
> > + int ret;
> > +#endif
> > +
> > if (machine_desc->init_late)
> > machine_desc->init_late();
> > +
> > +#ifdef CONFIG_OF
>
> These ifdefs should not be necessary, but please double check.
Well, of_property_read_string is only defined when CONFIG_OF is set
(base.c is always built in drivers/of but the directory is only included
when CONFIG_OF is set).
Of course, on ARM, we now expect that it is the case, but it seems like
good practice to check for it, since it could theoretically be disabled.
This is also being done a few lines above in customize_machine.
> > + root = of_find_node_by_path("/");
> > + if (root) {
> > + ret = of_property_read_string(root, "serial-number",
> > + &system_serial);
> > + if (ret)
> > + system_serial = NULL;
> > + }
> > +#endif
> > +
> > + if (!system_serial)
> > + system_serial = kasprintf(GFP_KERNEL, "%08x%08x",
> > + system_serial_high,
> > + system_serial_low);
> > +
> > return 0;
> > }
> > late_initcall(init_machine_late);
> > @@ -1091,8 +1115,7 @@ static int c_show(struct seq_file *m, void *v)
> >
> > seq_printf(m, "Hardware\t: %s\n", machine_name);
> > seq_printf(m, "Revision\t: %04x\n", system_rev);
> > - seq_printf(m, "Serial\t\t: %08x%08x\n",
> > - system_serial_high, system_serial_low);
> > + seq_printf(m, "Serial\t\t: %s\n", system_serial);
> >
> > return 0;
> > }
> > --
> > 1.9.1
> >
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
2015-04-27 14:42 ` Paul Kocialkowski
@ 2015-04-27 15:20 ` Rob Herring
[not found] ` <CAL_Jsq+x5vXTmzxFW8+YSKntRgNVr7AzAS+xAkuBGx1Nmfeaaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-28 16:09 ` Russell King - ARM Linux
1 sibling, 1 reply; 11+ messages in thread
From: Rob Herring @ 2015-04-27 15:20 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Russell King, Hans De Goede, Pawel Moll,
Mark Rutland, Ian Campbell, Stefan Agner, Kumar Gala
On Mon, Apr 27, 2015 at 9:42 AM, Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org> wrote:
> Le lundi 27 avril 2015 à 08:48 -0500, Rob Herring a écrit :
>> On Sat, Apr 18, 2015 at 4:58 AM, Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org> wrote:
>> > This grabs the serial number shown in cpuinfo from the serial-number devicetree
>> > property in priority. When booting with ATAGs (and without device-tree), the
>> > provided number is still shown instead.
>> >
>> > Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
>>
>> One comment below, otherwise:
>>
>> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>
>> > ---
>> > arch/arm/include/asm/system_info.h | 1 +
>> > arch/arm/kernel/setup.c | 27 +++++++++++++++++++++++++--
>> > 2 files changed, 26 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
>> > index 720ea03..3860cbd40 100644
>> > --- a/arch/arm/include/asm/system_info.h
>> > +++ b/arch/arm/include/asm/system_info.h
>> > @@ -17,6 +17,7 @@
>> >
>> > /* information about the system we're running on */
>> > extern unsigned int system_rev;
>> > +extern const char *system_serial;
>> > extern unsigned int system_serial_low;
>> > extern unsigned int system_serial_high;
>> > extern unsigned int mem_fclk_21285;
>> > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
>> > index 1d60beb..349790f 100644
>> > --- a/arch/arm/kernel/setup.c
>> > +++ b/arch/arm/kernel/setup.c
>> > @@ -93,6 +93,9 @@ unsigned int __atags_pointer __initdata;
>> > unsigned int system_rev;
>> > EXPORT_SYMBOL(system_rev);
>> >
>> > +const char *system_serial;
>> > +EXPORT_SYMBOL(system_serial);
>> > +
>> > unsigned int system_serial_low;
>> > EXPORT_SYMBOL(system_serial_low);
>> >
>> > @@ -821,8 +824,29 @@ arch_initcall(customize_machine);
>> >
>> > static int __init init_machine_late(void)
>> > {
>> > +#ifdef CONFIG_OF
>> > + struct device_node *root;
>> > + int ret;
>> > +#endif
>> > +
>> > if (machine_desc->init_late)
>> > machine_desc->init_late();
>> > +
>> > +#ifdef CONFIG_OF
>>
>> These ifdefs should not be necessary, but please double check.
>
> Well, of_property_read_string is only defined when CONFIG_OF is set
> (base.c is always built in drivers/of but the directory is only included
> when CONFIG_OF is set).
Look at include/linux/of.h. There are an empty versions of both functions.
> Of course, on ARM, we now expect that it is the case, but it seems like
> good practice to check for it, since it could theoretically be disabled.
We still (and will continue to) have non-OF platforms.
> This is also being done a few lines above in customize_machine.
True, but that doesn't mean we want more.
Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
[not found] ` <CAL_Jsq+x5vXTmzxFW8+YSKntRgNVr7AzAS+xAkuBGx1Nmfeaaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-04-27 18:45 ` Paul Kocialkowski
0 siblings, 0 replies; 11+ messages in thread
From: Paul Kocialkowski @ 2015-04-27 18:45 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Russell King, Hans De Goede, Pawel Moll,
Mark Rutland, Ian Campbell, Stefan Agner, Kumar Gala
[-- Attachment #1: Type: text/plain, Size: 3218 bytes --]
Le lundi 27 avril 2015 à 10:20 -0500, Rob Herring a écrit :
> On Mon, Apr 27, 2015 at 9:42 AM, Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org> wrote:
> > Le lundi 27 avril 2015 à 08:48 -0500, Rob Herring a écrit :
> >> On Sat, Apr 18, 2015 at 4:58 AM, Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org> wrote:
> >> > This grabs the serial number shown in cpuinfo from the serial-number devicetree
> >> > property in priority. When booting with ATAGs (and without device-tree), the
> >> > provided number is still shown instead.
> >> >
> >> > Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
> >>
> >> One comment below, otherwise:
> >>
> >> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> >>
> >> > ---
> >> > arch/arm/include/asm/system_info.h | 1 +
> >> > arch/arm/kernel/setup.c | 27 +++++++++++++++++++++++++--
> >> > 2 files changed, 26 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/arch/arm/include/asm/system_info.h b/arch/arm/include/asm/system_info.h
> >> > index 720ea03..3860cbd40 100644
> >> > --- a/arch/arm/include/asm/system_info.h
> >> > +++ b/arch/arm/include/asm/system_info.h
> >> > @@ -17,6 +17,7 @@
> >> >
> >> > /* information about the system we're running on */
> >> > extern unsigned int system_rev;
> >> > +extern const char *system_serial;
> >> > extern unsigned int system_serial_low;
> >> > extern unsigned int system_serial_high;
> >> > extern unsigned int mem_fclk_21285;
> >> > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> >> > index 1d60beb..349790f 100644
> >> > --- a/arch/arm/kernel/setup.c
> >> > +++ b/arch/arm/kernel/setup.c
> >> > @@ -93,6 +93,9 @@ unsigned int __atags_pointer __initdata;
> >> > unsigned int system_rev;
> >> > EXPORT_SYMBOL(system_rev);
> >> >
> >> > +const char *system_serial;
> >> > +EXPORT_SYMBOL(system_serial);
> >> > +
> >> > unsigned int system_serial_low;
> >> > EXPORT_SYMBOL(system_serial_low);
> >> >
> >> > @@ -821,8 +824,29 @@ arch_initcall(customize_machine);
> >> >
> >> > static int __init init_machine_late(void)
> >> > {
> >> > +#ifdef CONFIG_OF
> >> > + struct device_node *root;
> >> > + int ret;
> >> > +#endif
> >> > +
> >> > if (machine_desc->init_late)
> >> > machine_desc->init_late();
> >> > +
> >> > +#ifdef CONFIG_OF
> >>
> >> These ifdefs should not be necessary, but please double check.
> >
> > Well, of_property_read_string is only defined when CONFIG_OF is set
> > (base.c is always built in drivers/of but the directory is only included
> > when CONFIG_OF is set).
>
> Look at include/linux/of.h. There are an empty versions of both functions.
Oh, you're right, I didn't know it was the case. I'll submit another
version with those changes then!
> > Of course, on ARM, we now expect that it is the case, but it seems like
> > good practice to check for it, since it could theoretically be disabled.
>
> We still (and will continue to) have non-OF platforms.
>
> > This is also being done a few lines above in customize_machine.
>
> True, but that doesn't mean we want more.
Ack.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
2015-04-27 14:42 ` Paul Kocialkowski
2015-04-27 15:20 ` Rob Herring
@ 2015-04-28 16:09 ` Russell King - ARM Linux
[not found] ` <20150428160910.GE12732-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
1 sibling, 1 reply; 11+ messages in thread
From: Russell King - ARM Linux @ 2015-04-28 16:09 UTC (permalink / raw)
To: Paul Kocialkowski
Cc: Rob Herring, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Hans De Goede, Pawel Moll, Mark Rutland,
Ian Campbell, Stefan Agner, Kumar Gala
On Mon, Apr 27, 2015 at 04:42:27PM +0200, Paul Kocialkowski wrote:
> Well, of_property_read_string is only defined when CONFIG_OF is set
> (base.c is always built in drivers/of but the directory is only included
> when CONFIG_OF is set).
>
> Of course, on ARM, we now expect that it is the case, but it seems like
> good practice to check for it, since it could theoretically be disabled.
That is _not_ "is the case" - there are a number of non-OF platforms...
including some which will probably never be converted.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
[not found] ` <20150428160910.GE12732-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2015-05-02 15:46 ` Paul Kocialkowski
2015-05-06 9:01 ` Russell King - ARM Linux
0 siblings, 1 reply; 11+ messages in thread
From: Paul Kocialkowski @ 2015-05-02 15:46 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Rob Herring, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Hans De Goede, Pawel Moll, Mark Rutland,
Ian Campbell, Stefan Agner, Kumar Gala
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
Le mardi 28 avril 2015 à 17:09 +0100, Russell King - ARM Linux a écrit :
> On Mon, Apr 27, 2015 at 04:42:27PM +0200, Paul Kocialkowski wrote:
> > Well, of_property_read_string is only defined when CONFIG_OF is set
> > (base.c is always built in drivers/of but the directory is only included
> > when CONFIG_OF is set).
> >
> > Of course, on ARM, we now expect that it is the case, but it seems like
> > good practice to check for it, since it could theoretically be disabled.
>
> That is _not_ "is the case" - there are a number of non-OF platforms...
> including some which will probably never be converted.
Right, so I think v4 should be fine too, given the empty functions in
case CONFIG_OF is not set.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
2015-05-02 15:46 ` Paul Kocialkowski
@ 2015-05-06 9:01 ` Russell King - ARM Linux
[not found] ` <20150506090105.GC2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
0 siblings, 1 reply; 11+ messages in thread
From: Russell King - ARM Linux @ 2015-05-06 9:01 UTC (permalink / raw)
To: Paul Kocialkowski, Rob Herring
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Hans De Goede, Pawel Moll, Mark Rutland,
Ian Campbell, Stefan Agner, Kumar Gala
On Sat, May 02, 2015 at 05:46:22PM +0200, Paul Kocialkowski wrote:
> Le mardi 28 avril 2015 à 17:09 +0100, Russell King - ARM Linux a écrit :
> > On Mon, Apr 27, 2015 at 04:42:27PM +0200, Paul Kocialkowski wrote:
> > > Well, of_property_read_string is only defined when CONFIG_OF is set
> > > (base.c is always built in drivers/of but the directory is only included
> > > when CONFIG_OF is set).
> > >
> > > Of course, on ARM, we now expect that it is the case, but it seems like
> > > good practice to check for it, since it could theoretically be disabled.
> >
> > That is _not_ "is the case" - there are a number of non-OF platforms...
> > including some which will probably never be converted.
>
> Right, so I think v4 should be fine too, given the empty functions in
> case CONFIG_OF is not set.
Yes, can you please put them in my patch system so we can get this
applied?
Rob - does your ack apply to the v4 patch?
Thanks.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo
[not found] ` <20150506090105.GC2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2015-05-06 9:37 ` Paul Kocialkowski
0 siblings, 0 replies; 11+ messages in thread
From: Paul Kocialkowski @ 2015-05-06 9:37 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Rob Herring, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Rob Herring, Hans De Goede, Pawel Moll, Mark Rutland,
Ian Campbell, Stefan Agner, Kumar Gala
[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]
Le mercredi 06 mai 2015 à 10:01 +0100, Russell King - ARM Linux a
écrit :
> On Sat, May 02, 2015 at 05:46:22PM +0200, Paul Kocialkowski wrote:
> > Le mardi 28 avril 2015 à 17:09 +0100, Russell King - ARM Linux a écrit :
> > > On Mon, Apr 27, 2015 at 04:42:27PM +0200, Paul Kocialkowski wrote:
> > > > Well, of_property_read_string is only defined when CONFIG_OF is set
> > > > (base.c is always built in drivers/of but the directory is only included
> > > > when CONFIG_OF is set).
> > > >
> > > > Of course, on ARM, we now expect that it is the case, but it seems like
> > > > good practice to check for it, since it could theoretically be disabled.
> > >
> > > That is _not_ "is the case" - there are a number of non-OF platforms...
> > > including some which will probably never be converted.
> >
> > Right, so I think v4 should be fine too, given the empty functions in
> > case CONFIG_OF is not set.
>
> Yes, can you please put them in my patch system so we can get this
> applied?
What exactly do you mean?
I sent v4 to linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org and
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org with you and Rob in the CC list, on the 28th
of April.
> Rob - does your ack apply to the v4 patch?
>
> Thanks.
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-05-06 9:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-18 9:58 [PATCH v3 1/2] Documentation: devicetree: root node serial-number property documentation Paul Kocialkowski
[not found] ` <1429351135-11842-1-git-send-email-contact-W9ppeneeCTY@public.gmane.org>
2015-04-18 9:58 ` [PATCH v3 2/2] arch: arm: Show the serial number from devicetree in cpuinfo Paul Kocialkowski
[not found] ` <1429351135-11842-2-git-send-email-contact-W9ppeneeCTY@public.gmane.org>
2015-04-27 8:27 ` Paul Kocialkowski
2015-04-27 13:48 ` Rob Herring
[not found] ` <CAL_JsqKkw7n5p1ZH345BeKkyU=GKDrhaLef__0ET7t90Cm0Eog-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-27 14:42 ` Paul Kocialkowski
2015-04-27 15:20 ` Rob Herring
[not found] ` <CAL_Jsq+x5vXTmzxFW8+YSKntRgNVr7AzAS+xAkuBGx1Nmfeaaw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-27 18:45 ` Paul Kocialkowski
2015-04-28 16:09 ` Russell King - ARM Linux
[not found] ` <20150428160910.GE12732-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-05-02 15:46 ` Paul Kocialkowski
2015-05-06 9:01 ` Russell King - ARM Linux
[not found] ` <20150506090105.GC2067-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-05-06 9:37 ` Paul Kocialkowski
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).