mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [FIXES Master] tny-a926x fixes
@ 2012-04-24 10:09 Jean-Christophe PLAGNIOL-VILLARD
  2012-04-24 10:15 ` [PATCH 1/2] at91: at91_register_uart use number instead of IDs Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-04-24 10:09 UTC (permalink / raw)
  To: barebox

HI,

	the following patch series fix the Calao tny-a926x

	this is for the master branch

The following changes since commit 1d79f322f7a3bff9b6b9bde4ce7f391f0316063a:

  mtd: docg3 fixes backport from Linux kernel (2012-04-17 22:02:54 +0200)

are available in the git repository at:

  git://git.jcrosoft.org/barebox.git master-fixes

for you to fetch changes up to 60e03c64b0c7e6f3aedcf2c9328aa105de3ba11d:

  tny-a926x: fix MOB-TNY-MD2 Motherboard support (2012-04-24 18:27:32 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (2):
      at91: at91_register_uart use number instead of IDs
      tny-a926x: fix MOB-TNY-MD2 Motherboard support

 arch/arm/boards/tny-a926x/init.c         |   38 +++--------------------------
 arch/arm/configs/tny_a9260_defconfig     |    2 +-
 arch/arm/configs/tny_a9263_defconfig     |    2 +-
 arch/arm/configs/tny_a9g20_defconfig     |    2 +-
 arch/arm/mach-at91/Kconfig               |   10 ++++++++
 arch/arm/mach-at91/at91rm9200_devices.c  |   13 +++-------
 arch/arm/mach-at91/at91sam9260_devices.c |   19 ++++----------
 arch/arm/mach-at91/at91sam9261_devices.c |   10 ++-----
 arch/arm/mach-at91/at91sam9263_devices.c |   10 ++-----
 arch/arm/mach-at91/at91sam9g45_devices.c |   13 +++-------
 10 files changed, 37 insertions(+), 82 deletions(-)

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

* [PATCH 1/2] at91: at91_register_uart use number instead of IDs
  2012-04-24 10:09 [FIXES Master] tny-a926x fixes Jean-Christophe PLAGNIOL-VILLARD
@ 2012-04-24 10:15 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-04-24 10:15 ` [PATCH 2/2] tny-a926x: fix MOB-TNY-MD2 Motherboard support Jean-Christophe PLAGNIOL-VILLARD
  2012-04-24 13:20 ` [FIXES Master] tny-a926x fixes Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-04-24 10:15 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/mach-at91/at91rm9200_devices.c  |   13 ++++---------
 arch/arm/mach-at91/at91sam9260_devices.c |   19 ++++++-------------
 arch/arm/mach-at91/at91sam9261_devices.c |   10 +++-------
 arch/arm/mach-at91/at91sam9263_devices.c |   10 +++-------
 arch/arm/mach-at91/at91sam9g45_devices.c |   13 ++++---------
 5 files changed, 20 insertions(+), 45 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index c380c7d..7e721e5 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -273,27 +273,22 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91RM9200_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91RM9200_BASE_US0;
-			id = 1;
 			break;
-		case AT91RM9200_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91RM9200_BASE_US1;
-			id = 2;
 			break;
-		case AT91RM9200_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91RM9200_BASE_US2;
-			id = 3;
 			break;
-		case AT91RM9200_ID_US3:
+		case 4:
 			configure_usart3_pins(pins);
 			start = AT91RM9200_BASE_US3;
-			id = 4;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 23da8c1..17dbd1a 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -290,37 +290,30 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9260_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9260_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9260_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9260_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9260_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9260_BASE_US2;
-			id = 3;
 			break;
-		case AT91SAM9260_ID_US3:
+		case 4:
 			configure_usart3_pins(pins);
 			start = AT91SAM9260_BASE_US3;
-			id = 4;
 			break;
-		case AT91SAM9260_ID_US4:
+		case 5:
 			configure_usart4_pins();
 			start = AT91SAM9260_BASE_US4;
-			id = 5;
 			break;
-		case AT91SAM9260_ID_US5:
+		case 6:
 			configure_usart5_pins();
 			start = AT91SAM9260_BASE_US5;
-			id = 6;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index d4f7b5e..8a63d2a 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -211,22 +211,18 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9261_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9261_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9261_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9261_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9261_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9261_BASE_US2;
-			id = 3;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 12d6a24..b28e9e2 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -261,22 +261,18 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9263_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9263_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9263_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9263_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9263_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9263_BASE_US2;
-			id = 3;
 			break;
 		default:
 			return NULL;
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 25a8d80..ca96f58 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -190,27 +190,22 @@ struct device_d * __init at91_register_uart(unsigned id, unsigned pins)
 		case 0:		/* DBGU */
 			configure_dbgu_pins();
 			start = AT91_BASE_SYS + AT91_DBGU;
-			id = 0;
 			break;
-		case AT91SAM9G45_ID_US0:
+		case 1:
 			configure_usart0_pins(pins);
 			start = AT91SAM9G45_BASE_US0;
-			id = 1;
 			break;
-		case AT91SAM9G45_ID_US1:
+		case 2:
 			configure_usart1_pins(pins);
 			start = AT91SAM9G45_BASE_US1;
-			id = 2;
 			break;
-		case AT91SAM9G45_ID_US2:
+		case 3:
 			configure_usart2_pins(pins);
 			start = AT91SAM9G45_BASE_US2;
-			id = 3;
 			break;
-		case AT91SAM9G45_ID_US3:
+		case 4:
 			configure_usart3_pins(pins);
 			start = AT91SAM9G45_BASE_US3;
-			id = 4;
 			break;
 		default:
 			return NULL;
-- 
1.7.9.1


_______________________________________________
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] tny-a926x: fix MOB-TNY-MD2 Motherboard support
  2012-04-24 10:09 [FIXES Master] tny-a926x fixes Jean-Christophe PLAGNIOL-VILLARD
  2012-04-24 10:15 ` [PATCH 1/2] at91: at91_register_uart use number instead of IDs Jean-Christophe PLAGNIOL-VILLARD
@ 2012-04-24 10:15 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-04-24 13:20 ` [FIXES Master] tny-a926x fixes Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-04-24 10:15 UTC (permalink / raw)
  To: barebox

The MD2 add:
 - uart 2
 - ethernet
 - usb
 - spi
 - i2c

so fix just add uart and ethernet

update defconfig
always enable the motherboard and drop the SHA256 support (to fix in the
256KiB).

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/tny-a926x/init.c     |   38 +++------------------------------
 arch/arm/configs/tny_a9260_defconfig |    2 +-
 arch/arm/configs/tny_a9263_defconfig |    2 +-
 arch/arm/configs/tny_a9g20_defconfig |    2 +-
 arch/arm/mach-at91/Kconfig           |   10 +++++++++
 5 files changed, 17 insertions(+), 37 deletions(-)

diff --git a/arch/arm/boards/tny-a926x/init.c b/arch/arm/boards/tny-a926x/init.c
index 2065eae..eeaca76 100644
--- a/arch/arm/boards/tny-a926x/init.c
+++ b/arch/arm/boards/tny-a926x/init.c
@@ -121,42 +121,10 @@ static struct at91_ether_platform_data macb_pdata = {
 	.phy_addr	= 0,
 };
 
-static void tny_a9260_phy_reset(void)
-{
-	unsigned long rstc;
-	struct clk *clk = clk_get(NULL, "macb_clk");
-
-	clk_enable(clk);
-
-	at91_set_gpio_input(AT91_PIN_PA14, 0);
-	at91_set_gpio_input(AT91_PIN_PA15, 0);
-	at91_set_gpio_input(AT91_PIN_PA17, 0);
-	at91_set_gpio_input(AT91_PIN_PA25, 0);
-	at91_set_gpio_input(AT91_PIN_PA26, 0);
-	at91_set_gpio_input(AT91_PIN_PA28, 0);
-
-	rstc = at91_sys_read(AT91_RSTC_MR) & AT91_RSTC_ERSTL;
-
-	/* Need to reset PHY -> 500ms reset */
-	at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
-				     (AT91_RSTC_ERSTL & (0x0d << 8)) |
-				     AT91_RSTC_URSTEN);
-
-	at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST);
-
-	/* Wait for end hardware reset */
-	while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL));
-
-	/* Restore NRST value */
-	at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
-				     (rstc) |
-				     AT91_RSTC_URSTEN);
-}
-
 static void __init ek_add_device_macb(void)
 {
-	tny_a9260_phy_reset();
-	at91_add_device_eth(0, &macb_pdata);
+	if (IS_ENABLED(CONFIG_CALAO_MOB_TNY_MD2))
+		at91_add_device_eth(0, &macb_pdata);
 }
 #else
 static void __init ek_add_device_macb(void) {}
@@ -240,6 +208,8 @@ device_initcall(tny_a9260_devices_init);
 static int tny_a9260_console_init(void)
 {
 	at91_register_uart(0, 0);
+	if (IS_ENABLED(CONFIG_CALAO_MOB_TNY_MD2))
+		at91_register_uart(2, ATMEL_UART_CTS | ATMEL_UART_RTS);
 	return 0;
 }
 console_initcall(tny_a9260_console_init);
diff --git a/arch/arm/configs/tny_a9260_defconfig b/arch/arm/configs/tny_a9260_defconfig
index 52bd7e4..2388305 100644
--- a/arch/arm/configs/tny_a9260_defconfig
+++ b/arch/arm/configs/tny_a9260_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARCH_AT91SAM9260=y
 CONFIG_MACH_TNY_A9260=y
+CONFIG_CALAO_MOB_TNY_MD2=y
 CONFIG_AEABI=y
 # CONFIG_CMD_ARM_CPUINFO is not set
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -33,7 +34,6 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA256SUM=y
 CONFIG_CMD_MTEST=y
 CONFIG_CMD_MTEST_ALTERNATIVE=y
 CONFIG_CMD_FLASH=y
diff --git a/arch/arm/configs/tny_a9263_defconfig b/arch/arm/configs/tny_a9263_defconfig
index 1c316c8..d1bc418 100644
--- a/arch/arm/configs/tny_a9263_defconfig
+++ b/arch/arm/configs/tny_a9263_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARCH_AT91SAM9263=y
 CONFIG_MACH_TNY_A9263=y
+CONFIG_CALAO_MOB_TNY_MD2=y
 CONFIG_AEABI=y
 # CONFIG_CMD_ARM_CPUINFO is not set
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -33,7 +34,6 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA256SUM=y
 CONFIG_CMD_MTEST=y
 CONFIG_CMD_MTEST_ALTERNATIVE=y
 CONFIG_CMD_FLASH=y
diff --git a/arch/arm/configs/tny_a9g20_defconfig b/arch/arm/configs/tny_a9g20_defconfig
index f842382..983c68a 100644
--- a/arch/arm/configs/tny_a9g20_defconfig
+++ b/arch/arm/configs/tny_a9g20_defconfig
@@ -1,5 +1,6 @@
 CONFIG_ARCH_AT91SAM9G20=y
 CONFIG_MACH_TNY_A9G20=y
+CONFIG_CALAO_MOB_TNY_MD2=y
 CONFIG_AEABI=y
 # CONFIG_CMD_ARM_CPUINFO is not set
 CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
@@ -33,7 +34,6 @@ CONFIG_CMD_LOADB=y
 CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_MD5SUM=y
 CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_SHA256SUM=y
 CONFIG_CMD_MTEST=y
 CONFIG_CMD_MTEST_ALTERNATIVE=y
 CONFIG_CMD_FLASH=y
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 989d3d8..1bec3e5 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -104,6 +104,9 @@ config ARCH_BAREBOX_MAX_BARE_INIT_SIZE
 config SUPPORT_CALAO_DAB_MMX
 	bool
 
+config SUPPORT_CALAO_MOB_TNY_MD2
+	bool
+
 # ----------------------------------------------------------
 
 if ARCH_AT91RM9200
@@ -138,6 +141,7 @@ config MACH_AT91SAM9260EK
 
 config MACH_TNY_A9260
 	bool "CALAO TNY-A9260"
+	select SUPPORT_CALAO_MOB_TNY_MD2
 	help
 	  Select this if you are using a Calao Systems TNY-A9260.
 	  <http://www.calao-systems.com>
@@ -214,6 +218,7 @@ config MACH_AT91SAM9G20EK
 	  that embeds only one SD/MMC slot.
 
 config MACH_TNY_A9G20
+	select SUPPORT_CALAO_MOB_TNY_MD2
 	bool "CALAO TNY-A9G20"
 	help
 	  Select this if you are using a Calao Systems TNY-A9G20.
@@ -264,6 +269,7 @@ config MACH_PM9263
 
 config MACH_TNY_A9263
 	bool "CALAO TNY-A9263"
+	select SUPPORT_CALAO_MOB_TNY_MD2
 	help
 	  Select this if you are using a Calao Systems TNY-A9263.
 	  <http://www.calao-systems.com>
@@ -362,4 +368,8 @@ config CALAO_DAB_MMX
 	bool "DAB MMX Daughter Board support"
 	depends on SUPPORT_CALAO_DAB_MMX
 
+config CALAO_MOB_TNY_MD2
+	bool "MOB TNY MD2 Motherboard Daughter Board support"
+	depends on SUPPORT_CALAO_MOB_TNY_MD2
+
 endif
-- 
1.7.9.1


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

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

* Re: [FIXES Master] tny-a926x fixes
  2012-04-24 10:09 [FIXES Master] tny-a926x fixes Jean-Christophe PLAGNIOL-VILLARD
  2012-04-24 10:15 ` [PATCH 1/2] at91: at91_register_uart use number instead of IDs Jean-Christophe PLAGNIOL-VILLARD
  2012-04-24 10:15 ` [PATCH 2/2] tny-a926x: fix MOB-TNY-MD2 Motherboard support Jean-Christophe PLAGNIOL-VILLARD
@ 2012-04-24 13:20 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2012-04-24 13:20 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Apr 24, 2012 at 12:09:16PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> HI,
> 
> 	the following patch series fix the Calao tny-a926x
> 
> 	this is for the master branch
> 
> The following changes since commit 1d79f322f7a3bff9b6b9bde4ce7f391f0316063a:
> 
>   mtd: docg3 fixes backport from Linux kernel (2012-04-17 22:02:54 +0200)
> 
> are available in the git repository at:
> 
>   git://git.jcrosoft.org/barebox.git master-fixes
> 
> for you to fetch changes up to 60e03c64b0c7e6f3aedcf2c9328aa105de3ba11d:

pulled, thanks

Sascha

> 
>   tny-a926x: fix MOB-TNY-MD2 Motherboard support (2012-04-24 18:27:32 +0800)
> 
> ----------------------------------------------------------------
> Jean-Christophe PLAGNIOL-VILLARD (2):
>       at91: at91_register_uart use number instead of IDs
>       tny-a926x: fix MOB-TNY-MD2 Motherboard support
> 
>  arch/arm/boards/tny-a926x/init.c         |   38 +++--------------------------
>  arch/arm/configs/tny_a9260_defconfig     |    2 +-
>  arch/arm/configs/tny_a9263_defconfig     |    2 +-
>  arch/arm/configs/tny_a9g20_defconfig     |    2 +-
>  arch/arm/mach-at91/Kconfig               |   10 ++++++++
>  arch/arm/mach-at91/at91rm9200_devices.c  |   13 +++-------
>  arch/arm/mach-at91/at91sam9260_devices.c |   19 ++++----------
>  arch/arm/mach-at91/at91sam9261_devices.c |   10 ++-----
>  arch/arm/mach-at91/at91sam9263_devices.c |   10 ++-----
>  arch/arm/mach-at91/at91sam9g45_devices.c |   13 +++-------
>  10 files changed, 37 insertions(+), 82 deletions(-)
> 
> Best Regards,
> J.
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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] 4+ messages in thread

end of thread, other threads:[~2012-04-24 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-24 10:09 [FIXES Master] tny-a926x fixes Jean-Christophe PLAGNIOL-VILLARD
2012-04-24 10:15 ` [PATCH 1/2] at91: at91_register_uart use number instead of IDs Jean-Christophe PLAGNIOL-VILLARD
2012-04-24 10:15 ` [PATCH 2/2] tny-a926x: fix MOB-TNY-MD2 Motherboard support Jean-Christophe PLAGNIOL-VILLARD
2012-04-24 13:20 ` [FIXES Master] tny-a926x fixes Sascha Hauer

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