mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] at91sam9m10g45ek: add board revision support
@ 2011-01-15  2:25 Jean-Christophe PLAGNIOL-VILLARD
  2011-01-15 15:25 ` Sascha Hauer
  2011-01-22 15:45 ` [PATCH v2] " Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-01-15  2:25 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

we use the board revision to specify to the linux kernel the type of lcd
we use. So we can have only one machine for those 3 boards:
 - sam9m10-ekes (LG)
 - sam9g45-ekes (LG)
 - sam9m10g45-ek (Truly)

today we support 2 lcds model:
 - LG philips LB043WQ1
 - Truly TFT1N4633-E

by default we select the Truly as the sam9m10g45-ek is the most common board

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
 arch/arm/boards/at91sam9m10g45ek/init.c |   21 +++++++++++++++++++++
 arch/arm/mach-at91/Kconfig              |   15 ++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c
index bb8b7ba..77d51b7 100644
--- a/arch/arm/boards/at91sam9m10g45ek/init.c
+++ b/arch/arm/boards/at91sam9m10g45ek/init.c
@@ -40,6 +40,26 @@
 #include <mach/at91sam9_smc.h>
 #include <mach/sam9_smc.h>
 
+/*
+ * board revision encoding
+ * bit 0-3: lcd type
+ *	0 => truly TFT1N4633-E (sam9m10g45-ek)
+ *	1 => LG philips LB043WQ1 (sam9m10-ekes and sam9g45-ekes)
+ */
+#define HAVE_LCD_TRULY_TFT1N4633E	(0 << 0)
+#define HAVE_LCD_LG_LB043WQ1		(1 << 0)
+static void ek_set_board_revision(void)
+{
+	u32 rev;
+
+#ifdef CONFIG_LCD_LG_LB043WQ1
+		rev = HAVE_LCD_LG_LB043WQ1;
+#else
+		rev = HAVE_LCD_TRULY_TFT1N4633E;
+#endif
+		armlinux_set_revision(rev);
+}
+
 static struct atmel_nand_data nand_pdata = {
 	.ale		= 21,
 	.cle		= 22,
@@ -103,6 +123,7 @@ static int at91sam9m10g45ek_devices_init(void)
 
 	armlinux_set_bootparams((void *)(AT91_CHIPSELECT_6 + 0x100));
 	armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK);
+	ek_set_board_revision();
 
 	return 0;
 }
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index e5bd45e..4d35ebe 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -174,7 +174,8 @@ config MACH_AT91SAM9M10G45EK
 	bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
 	help
-	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
+	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit
+	  or AT91SAM9G45-EKES or AT91SAM9M10-EKES (for those 2 select the LG LCD)
 	  <http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>
 
 config MACH_PM9G45
@@ -205,4 +206,16 @@ config AT91_HAVE_2MMC
 	  with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
 	  onwards.
 
+choice
+	prompt "LCD type"
+	depends on MACH_AT91SAM9M10G45EK
+
+config LCD_TRULY_TFT1N4633E
+	bool "truly TFT1N4633-E"
+
+config LCD_LG_LB043WQ1
+	bool "LG philips LB043WQ1"
+
+endchoice
+
 endif
-- 
1.7.2.3


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

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

* Re: [PATCH] at91sam9m10g45ek: add board revision support
  2011-01-15  2:25 [PATCH] at91sam9m10g45ek: add board revision support Jean-Christophe PLAGNIOL-VILLARD
@ 2011-01-15 15:25 ` Sascha Hauer
  2011-01-15 15:50   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-01-22 15:45 ` [PATCH v2] " Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2011-01-15 15:25 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On Sat, Jan 15, 2011 at 03:25:54AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> we use the board revision to specify to the linux kernel the type of lcd
> we use. So we can have only one machine for those 3 boards:
>  - sam9m10-ekes (LG)
>  - sam9g45-ekes (LG)
>  - sam9m10g45-ek (Truly)
> 
> today we support 2 lcds model:
>  - LG philips LB043WQ1
>  - Truly TFT1N4633-E
> 
> by default we select the Truly as the sam9m10g45-ek is the most common board
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
> ---
>  arch/arm/boards/at91sam9m10g45ek/init.c |   21 +++++++++++++++++++++
>  arch/arm/mach-at91/Kconfig              |   15 ++++++++++++++-
>  2 files changed, 35 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c
> index bb8b7ba..77d51b7 100644
> --- a/arch/arm/boards/at91sam9m10g45ek/init.c
> +++ b/arch/arm/boards/at91sam9m10g45ek/init.c
> @@ -40,6 +40,26 @@
>  #include <mach/at91sam9_smc.h>
>  #include <mach/sam9_smc.h>
>  
> +/*
> + * board revision encoding
> + * bit 0-3: lcd type
> + *	0 => truly TFT1N4633-E (sam9m10g45-ek)
> + *	1 => LG philips LB043WQ1 (sam9m10-ekes and sam9g45-ekes)
> + */
> +#define HAVE_LCD_TRULY_TFT1N4633E	(0 << 0)
> +#define HAVE_LCD_LG_LB043WQ1		(1 << 0)
> +static void ek_set_board_revision(void)
> +{
> +	u32 rev;
> +
> +#ifdef CONFIG_LCD_LG_LB043WQ1
> +		rev = HAVE_LCD_LG_LB043WQ1;
> +#else
> +		rev = HAVE_LCD_TRULY_TFT1N4633E;
> +#endif
> +		armlinux_set_revision(rev);
> +}
> +
>  static struct atmel_nand_data nand_pdata = {
>  	.ale		= 21,
>  	.cle		= 22,
> @@ -103,6 +123,7 @@ static int at91sam9m10g45ek_devices_init(void)
>  
>  	armlinux_set_bootparams((void *)(AT91_CHIPSELECT_6 + 0x100));
>  	armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK);
> +	ek_set_board_revision();
>  
>  	return 0;
>  }
> diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> index e5bd45e..4d35ebe 100644
> --- a/arch/arm/mach-at91/Kconfig
> +++ b/arch/arm/mach-at91/Kconfig
> @@ -174,7 +174,8 @@ config MACH_AT91SAM9M10G45EK
>  	bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
>  	select HAVE_NAND_ATMEL_BUSWIDTH_16
>  	help
> -	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
> +	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit
> +	  or AT91SAM9G45-EKES or AT91SAM9M10-EKES (for those 2 select the LG LCD)
>  	  <http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>

Isn't it better to let the user choose the exact board type here and
select the display type automatically depending on the choice?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

* Re: [PATCH] at91sam9m10g45ek: add board revision support
  2011-01-15 15:25 ` Sascha Hauer
@ 2011-01-15 15:50   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-01-15 16:21     ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-01-15 15:50 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

> > diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> > index e5bd45e..4d35ebe 100644
> > --- a/arch/arm/mach-at91/Kconfig
> > +++ b/arch/arm/mach-at91/Kconfig
> > @@ -174,7 +174,8 @@ config MACH_AT91SAM9M10G45EK
> >  	bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
> >  	select HAVE_NAND_ATMEL_BUSWIDTH_16
> >  	help
> > -	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
> > +	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit
> > +	  or AT91SAM9G45-EKES or AT91SAM9M10-EKES (for those 2 select the LG LCD)
> >  	  <http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>
> 
> Isn't it better to let the user choose the exact board type here and
> select the display type automatically depending on the choice?
They are nearly the same board and the idea is to allow to specify the lcd as
we can change it and it's the only difference between the 3 boards,

Best Regards,
J.

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

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

* Re: [PATCH] at91sam9m10g45ek: add board revision support
  2011-01-15 15:50   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-01-15 16:21     ` Sascha Hauer
  0 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2011-01-15 16:21 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox, Patrice Vilchez, Nicolas Ferre

On Sat, Jan 15, 2011 at 04:50:35PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
> > > index e5bd45e..4d35ebe 100644
> > > --- a/arch/arm/mach-at91/Kconfig
> > > +++ b/arch/arm/mach-at91/Kconfig
> > > @@ -174,7 +174,8 @@ config MACH_AT91SAM9M10G45EK
> > >  	bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
> > >  	select HAVE_NAND_ATMEL_BUSWIDTH_16
> > >  	help
> > > -	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
> > > +	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit
> > > +	  or AT91SAM9G45-EKES or AT91SAM9M10-EKES (for those 2 select the LG LCD)
> > >  	  <http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>
> > 
> > Isn't it better to let the user choose the exact board type here and
> > select the display type automatically depending on the choice?
> They are nearly the same board and the idea is to allow to specify the lcd as
> we can change it and it's the only difference between the 3 boards,

Ok, fine. Note I didn't want to suggest a complete new board support,
only the Kconfig option. The user likely knows better which board he has
than what exact display is connected to it.
Can you then add a help text to the display choice? Something like:

+choice
+       prompt "LCD type"
+       depends on MACH_AT91SAM9M10G45EK
+
+config LCD_TRULY_TFT1N4633E
+       bool "truly TFT1N4633E"
+	help
+	  Found on AT91SAM9M10G45-EK
+
+config LCD_LG_LB043WQ1
+       bool "LG philips LB043WQ1"
+	help
+	  Found on AT91SAM9G45-EKES and AT91SAM9M10-EKES
+
+endchoice

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

* [PATCH v2] at91sam9m10g45ek: add board revision support
  2011-01-15  2:25 [PATCH] at91sam9m10g45ek: add board revision support Jean-Christophe PLAGNIOL-VILLARD
  2011-01-15 15:25 ` Sascha Hauer
@ 2011-01-22 15:45 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-01-22 15:45 UTC (permalink / raw)
  To: barebox; +Cc: Patrice Vilchez, Nicolas Ferre

we use the board revision to specify to the linux kernel the type of lcd
we use. So we can have only one machine for those 3 boards:
 - sam9m10-ekes (LG)
 - sam9g45-ekes (LG)
 - sam9m10g45-ek (Truly)

today we support 2 lcds model:
 - LG philips LB043WQ1
 - Truly TFT1N4633-E

by default we select the Truly as the sam9m10g45-ek is the most common board

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
---
update Kconfig as sugest by Sascha
 arch/arm/boards/at91sam9m10g45ek/init.c |   21 +++++++++++++++++++++
 arch/arm/mach-at91/Kconfig              |   19 ++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c
index bb8b7ba..77d51b7 100644
--- a/arch/arm/boards/at91sam9m10g45ek/init.c
+++ b/arch/arm/boards/at91sam9m10g45ek/init.c
@@ -40,6 +40,26 @@
 #include <mach/at91sam9_smc.h>
 #include <mach/sam9_smc.h>
 
+/*
+ * board revision encoding
+ * bit 0-3: lcd type
+ *	0 => truly TFT1N4633-E (sam9m10g45-ek)
+ *	1 => LG philips LB043WQ1 (sam9m10-ekes and sam9g45-ekes)
+ */
+#define HAVE_LCD_TRULY_TFT1N4633E	(0 << 0)
+#define HAVE_LCD_LG_LB043WQ1		(1 << 0)
+static void ek_set_board_revision(void)
+{
+	u32 rev;
+
+#ifdef CONFIG_LCD_LG_LB043WQ1
+		rev = HAVE_LCD_LG_LB043WQ1;
+#else
+		rev = HAVE_LCD_TRULY_TFT1N4633E;
+#endif
+		armlinux_set_revision(rev);
+}
+
 static struct atmel_nand_data nand_pdata = {
 	.ale		= 21,
 	.cle		= 22,
@@ -103,6 +123,7 @@ static int at91sam9m10g45ek_devices_init(void)
 
 	armlinux_set_bootparams((void *)(AT91_CHIPSELECT_6 + 0x100));
 	armlinux_set_architecture(MACH_TYPE_AT91SAM9M10G45EK);
+	ek_set_board_revision();
 
 	return 0;
 }
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index e5bd45e..52c5d4b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -174,7 +174,8 @@ config MACH_AT91SAM9M10G45EK
 	bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
 	select HAVE_NAND_ATMEL_BUSWIDTH_16
 	help
-	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
+	  Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit
+	  or AT91SAM9G45-EKES or AT91SAM9M10-EKES (for those 2 select the LG LCD)
 	  <http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>
 
 config MACH_PM9G45
@@ -205,4 +206,20 @@ config AT91_HAVE_2MMC
 	  with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
 	  onwards.
 
+choice
+	prompt "LCD type"
+	depends on MACH_AT91SAM9M10G45EK
+
+config LCD_TRULY_TFT1N4633E
+	bool "truly TFT1N4633-E"
+	help
+	  Found on AT91SAM9M10G45-EK
+
+config LCD_LG_LB043WQ1
+	bool "LG philips LB043WQ1"
+	help
+	  Found on AT91SAM9G45-EKES and AT91SAM9M10-EKES
+
+endchoice
+
 endif
-- 
1.7.2.3


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

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

end of thread, other threads:[~2011-01-22 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-15  2:25 [PATCH] at91sam9m10g45ek: add board revision support Jean-Christophe PLAGNIOL-VILLARD
2011-01-15 15:25 ` Sascha Hauer
2011-01-15 15:50   ` Jean-Christophe PLAGNIOL-VILLARD
2011-01-15 16:21     ` Sascha Hauer
2011-01-22 15:45 ` [PATCH v2] " Jean-Christophe PLAGNIOL-VILLARD

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