mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* patches
@ 2011-10-13 14:58 Sascha Hauer
  2011-10-13 14:58 ` [PATCH 1/2] ARM: use arm_system_rev from environment Sascha Hauer
  2011-10-13 14:58 ` [PATCH 2/2] nand: export some useful information about flashes to device variables Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Sascha Hauer @ 2011-10-13 14:58 UTC (permalink / raw)
  To: barebox

Two small patches.

Sascha Hauer (2):
      ARM: use arm_system_rev from environment
      nand: export some useful information about flashes to device variables

 arch/arm/lib/armlinux.c |   11 +++++++++++
 drivers/mtd/nand/nand.c |    6 ++++++
 2 files changed, 17 insertions(+), 0 deletions(-)


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ARM: use arm_system_rev from environment
  2011-10-13 14:58 patches Sascha Hauer
@ 2011-10-13 14:58 ` Sascha Hauer
  2011-10-14  2:24   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-10-13 14:58 ` [PATCH 2/2] nand: export some useful information about flashes to device variables Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2011-10-13 14:58 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/lib/armlinux.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index e3a74f4..f636f12 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -198,7 +198,14 @@ void armlinux_set_architecture(int architecture)
 
 void armlinux_set_revision(unsigned int rev)
 {
+	char *revstr = asprintf("%d", rev);
+
 	system_rev = rev;
+
+	setenv("arm_system_rev", revstr);
+	export("arm_system_rev");
+
+	kfree(revstr);
 }
 
 void armlinux_set_serial(u64 serial)
@@ -209,6 +216,10 @@ void armlinux_set_serial(u64 serial)
 void start_linux(void *adr, int swap, struct image_data *data)
 {
 	void (*kernel)(int zero, int arch, void *params) = adr;
+	const char *revstr = getenv("arm_system_rev");
+
+	if (revstr)
+		system_rev = simple_strtoul(revstr, NULL, 0);
 
 	setup_tags(data, swap);
 
-- 
1.7.7


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] nand: export some useful information about flashes to device variables
  2011-10-13 14:58 patches Sascha Hauer
  2011-10-13 14:58 ` [PATCH 1/2] ARM: use arm_system_rev from environment Sascha Hauer
@ 2011-10-13 14:58 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2011-10-13 14:58 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/nand/nand.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index 9423ac8..6db21d6 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -265,6 +265,12 @@ int add_mtd_device(struct mtd_info *mtd)
 
 	sprintf(str, "%u", mtd->size);
 	dev_add_param_fixed(&mtd->class_dev, "size", str);
+	sprintf(str, "%u", mtd->erasesize);
+	dev_add_param_fixed(&mtd->class_dev, "erasesize", str);
+	sprintf(str, "%u", mtd->writesize);
+	dev_add_param_fixed(&mtd->class_dev, "writesize", str);
+	sprintf(str, "%u", mtd->oobsize);
+	dev_add_param_fixed(&mtd->class_dev, "oobsize", str);
 
 	devfs_create(&mtd->cdev);
 
-- 
1.7.7


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ARM: use arm_system_rev from environment
  2011-10-13 14:58 ` [PATCH 1/2] ARM: use arm_system_rev from environment Sascha Hauer
@ 2011-10-14  2:24   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-14  2:24 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 16:58 Thu 13 Oct     , Sascha Hauer wrote:
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/lib/armlinux.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
> index e3a74f4..f636f12 100644
> --- a/arch/arm/lib/armlinux.c
> +++ b/arch/arm/lib/armlinux.c
> @@ -198,7 +198,14 @@ void armlinux_set_architecture(int architecture)
>  
>  void armlinux_set_revision(unsigned int rev)
>  {
> +	char *revstr = asprintf("%d", rev);
> +
>  	system_rev = rev;
> +
> +	setenv("arm_system_rev", revstr);
> +	export("arm_system_rev");
> +
> +	kfree(revstr);
>  }
>  
>  void armlinux_set_serial(u64 serial)
> @@ -209,6 +216,10 @@ void armlinux_set_serial(u64 serial)
>  void start_linux(void *adr, int swap, struct image_data *data)
>  {
>  	void (*kernel)(int zero, int arch, void *params) = adr;
> +	const char *revstr = getenv("arm_system_rev");
> +
> +	if (revstr)
> +		system_rev = simple_strtoul(revstr, NULL, 0);
we need to use boot getopt  as done on bootm

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-14  2:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-13 14:58 patches Sascha Hauer
2011-10-13 14:58 ` [PATCH 1/2] ARM: use arm_system_rev from environment Sascha Hauer
2011-10-14  2:24   ` Jean-Christophe PLAGNIOL-VILLARD
2011-10-13 14:58 ` [PATCH 2/2] nand: export some useful information about flashes to device variables Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox