mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/3] at91sam9260/9g20ek: some cleanup
@ 2013-01-31 10:42 Fabio Porcedda
  2013-01-31 10:42 ` [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style Fabio Porcedda
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fabio Porcedda @ 2013-01-31 10:42 UTC (permalink / raw)
  To: barebox

I used some cleanup already done for the evk-pro3 board.

Tested on atsam9260ek.

Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Fabio Porcedda (3):
  at91sam9260/9g20ek: cleanup coding style
  at91sam9260/9g20ek: move sam9_smc_config modification inside
    definition
  at91sam9260/9g20ek: enable clock via clock framework

 arch/arm/boards/at91sam9260ek/init.c | 67 ++++++++++++++++--------------------
 1 file changed, 30 insertions(+), 37 deletions(-)

-- 
1.8.1.1


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

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

* [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style
  2013-01-31 10:42 [PATCH 0/3] at91sam9260/9g20ek: some cleanup Fabio Porcedda
@ 2013-01-31 10:42 ` Fabio Porcedda
  2013-01-31 11:42   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-01-31 10:42 ` [PATCH 2/3] at91sam9260/9g20ek: move sam9_smc_config modification inside definition Fabio Porcedda
  2013-01-31 10:42 ` [PATCH 3/3] at91sam9260/9g20ek: enable clock via clock framework Fabio Porcedda
  2 siblings, 1 reply; 7+ messages in thread
From: Fabio Porcedda @ 2013-01-31 10:42 UTC (permalink / raw)
  To: barebox

- fix some error and warnings pointed out by checkpatch.
- join some short lines.
- remove some empty lines.
- remove unnecessary headers.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9260ek/init.c | 37 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
index 2d52f5a..f0d8adf 100644
--- a/arch/arm/boards/at91sam9260ek/init.c
+++ b/arch/arm/boards/at91sam9260ek/init.c
@@ -10,25 +10,15 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- *
  */
 
 #include <common.h>
-#include <net.h>
 #include <init.h>
 #include <environment.h>
-#include <fec.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
-#include <partition.h>
-#include <fs.h>
-#include <fcntl.h>
-#include <io.h>
-#include <asm/hardware.h>
 #include <nand.h>
 #include <sizes.h>
-#include <linux/mtd/nand.h>
 #include <mach/board.h>
 #include <mach/at91sam9_smc.h>
 #include <gpio.h>
@@ -83,7 +73,8 @@ static struct sam9_smc_config ek_9260_nand_smc_config = {
 	.read_cycle		= 5,
 	.write_cycle		= 5,
 
-	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
+	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
+				  AT91_SMC_EXNWMODE_DISABLE,
 	.tdf_cycles		= 2,
 };
 
@@ -101,7 +92,8 @@ static struct sam9_smc_config ek_9g20_nand_smc_config = {
 	.read_cycle		= 7,
 	.write_cycle		= 7,
 
-	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
+	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
+				  AT91_SMC_EXNWMODE_DISABLE,
 	.tdf_cycles		= 3,
 };
 
@@ -153,12 +145,11 @@ static void at91sam9260ek_phy_reset(void)
 	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));
+	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);
+	at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY | (rstc) | AT91_RSTC_URSTEN);
 }
 
 /*
@@ -260,18 +251,21 @@ static int at91sam9260ek_devices_init(void)
 	armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100));
 	ek_set_board_type();
 
-	devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw");
+	devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED,
+			    "at91bootstrap_raw");
 	dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap");
-	devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw");
+	devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED,
+			    "self_raw");
 	dev_add_bb_dev("self_raw", "self0");
-	devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw");
+	devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K,
+			    DEVFS_PARTITION_FIXED, "env_raw");
 	dev_add_bb_dev("env_raw", "env0");
-	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
+	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED,
+			    "env_raw1");
 	dev_add_bb_dev("env_raw1", "env1");
 
 	return 0;
 }
-
 device_initcall(at91sam9260ek_devices_init);
 
 static int at91sam9260ek_console_init(void)
@@ -279,5 +273,4 @@ static int at91sam9260ek_console_init(void)
 	at91_register_uart(0, 0);
 	return 0;
 }
-
 console_initcall(at91sam9260ek_console_init);
-- 
1.8.1.1


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

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

* [PATCH 2/3] at91sam9260/9g20ek: move sam9_smc_config modification inside definition
  2013-01-31 10:42 [PATCH 0/3] at91sam9260/9g20ek: some cleanup Fabio Porcedda
  2013-01-31 10:42 ` [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style Fabio Porcedda
@ 2013-01-31 10:42 ` Fabio Porcedda
  2013-01-31 11:38   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-01-31 10:42 ` [PATCH 3/3] at91sam9260/9g20ek: enable clock via clock framework Fabio Porcedda
  2 siblings, 1 reply; 7+ messages in thread
From: Fabio Porcedda @ 2013-01-31 10:42 UTC (permalink / raw)
  To: barebox

This is a optimization.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9260ek/init.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
index f0d8adf..5080f2a 100644
--- a/arch/arm/boards/at91sam9260ek/init.c
+++ b/arch/arm/boards/at91sam9260ek/init.c
@@ -74,7 +74,11 @@ static struct sam9_smc_config ek_9260_nand_smc_config = {
 	.write_cycle		= 5,
 
 	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-				  AT91_SMC_EXNWMODE_DISABLE,
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
+				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_16,
+#else
+				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
+#endif
 	.tdf_cycles		= 2,
 };
 
@@ -93,27 +97,21 @@ static struct sam9_smc_config ek_9g20_nand_smc_config = {
 	.write_cycle		= 7,
 
 	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
-				  AT91_SMC_EXNWMODE_DISABLE,
+#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
+				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_16,
+#else
+				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
+#endif
 	.tdf_cycles		= 3,
 };
 
 static void ek_add_device_nand(void)
 {
-	struct sam9_smc_config *smc;
-
+	/* configure chip-select 3 (NAND) */
 	if (machine_is_at91sam9g20ek())
-		smc = &ek_9g20_nand_smc_config;
-	else
-		smc = &ek_9260_nand_smc_config;
-
-	/* setup bus-width (8 or 16) */
-	if (nand_pdata.bus_width_16)
-		smc->mode |= AT91_SMC_DBW_16;
+		sam9_smc_configure(0, 3, &ek_9g20_nand_smc_config);
 	else
-		smc->mode |= AT91_SMC_DBW_8;
-
-	/* configure chip-select 3 (NAND) */
-	sam9_smc_configure(0, 3, smc);
+		sam9_smc_configure(0, 3, &ek_9260_nand_smc_config);
 
 	at91_add_device_nand(&nand_pdata);
 }
-- 
1.8.1.1


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

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

* [PATCH 3/3] at91sam9260/9g20ek: enable clock via clock framework
  2013-01-31 10:42 [PATCH 0/3] at91sam9260/9g20ek: some cleanup Fabio Porcedda
  2013-01-31 10:42 ` [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style Fabio Porcedda
  2013-01-31 10:42 ` [PATCH 2/3] at91sam9260/9g20ek: move sam9_smc_config modification inside definition Fabio Porcedda
@ 2013-01-31 10:42 ` Fabio Porcedda
  2 siblings, 0 replies; 7+ messages in thread
From: Fabio Porcedda @ 2013-01-31 10:42 UTC (permalink / raw)
  To: barebox

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9260ek/init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
index 5080f2a..7d4f9be 100644
--- a/arch/arm/boards/at91sam9260ek/init.c
+++ b/arch/arm/boards/at91sam9260ek/init.c
@@ -23,8 +23,8 @@
 #include <mach/at91sam9_smc.h>
 #include <gpio.h>
 #include <mach/io.h>
-#include <mach/at91_pmc.h>
 #include <mach/at91_rstc.h>
+#include <linux/clk.h>
 
 /*
  * board revision encoding
@@ -124,7 +124,9 @@ static struct at91_ether_platform_data macb_pdata = {
 static void at91sam9260ek_phy_reset(void)
 {
 	unsigned long rstc;
-	at91_pmc_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_EMAC);
+	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);
-- 
1.8.1.1


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

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

* Re: [PATCH 2/3] at91sam9260/9g20ek: move sam9_smc_config modification inside definition
  2013-01-31 10:42 ` [PATCH 2/3] at91sam9260/9g20ek: move sam9_smc_config modification inside definition Fabio Porcedda
@ 2013-01-31 11:38   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-31 11:38 UTC (permalink / raw)
  To: Fabio Porcedda; +Cc: barebox

On 11:42 Thu 31 Jan     , Fabio Porcedda wrote:
> This is a optimization.

Nack

I do not what to ifdef

this make the code not easy to check via the compiler

Best Regards,
J.
> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/boards/at91sam9260ek/init.c | 28 +++++++++++++---------------
>  1 file changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
> index f0d8adf..5080f2a 100644
> --- a/arch/arm/boards/at91sam9260ek/init.c
> +++ b/arch/arm/boards/at91sam9260ek/init.c
> @@ -74,7 +74,11 @@ static struct sam9_smc_config ek_9260_nand_smc_config = {
>  	.write_cycle		= 5,
>  
>  	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
> -				  AT91_SMC_EXNWMODE_DISABLE,
> +#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
> +				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_16,
> +#else
> +				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
> +#endif
>  	.tdf_cycles		= 2,
>  };
>  
> @@ -93,27 +97,21 @@ static struct sam9_smc_config ek_9g20_nand_smc_config = {
>  	.write_cycle		= 7,
>  
>  	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
> -				  AT91_SMC_EXNWMODE_DISABLE,
> +#if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
> +				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_16,
> +#else
> +				  AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8,
> +#endif
>  	.tdf_cycles		= 3,
>  };
>  
>  static void ek_add_device_nand(void)
>  {
> -	struct sam9_smc_config *smc;
> -
> +	/* configure chip-select 3 (NAND) */
>  	if (machine_is_at91sam9g20ek())
> -		smc = &ek_9g20_nand_smc_config;
> -	else
> -		smc = &ek_9260_nand_smc_config;
> -
> -	/* setup bus-width (8 or 16) */
> -	if (nand_pdata.bus_width_16)
> -		smc->mode |= AT91_SMC_DBW_16;
> +		sam9_smc_configure(0, 3, &ek_9g20_nand_smc_config);
>  	else
> -		smc->mode |= AT91_SMC_DBW_8;
> -
> -	/* configure chip-select 3 (NAND) */
> -	sam9_smc_configure(0, 3, smc);
> +		sam9_smc_configure(0, 3, &ek_9260_nand_smc_config);
>  
>  	at91_add_device_nand(&nand_pdata);
>  }
> -- 
> 1.8.1.1
> 

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

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

* Re: [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style
  2013-01-31 10:42 ` [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style Fabio Porcedda
@ 2013-01-31 11:42   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-02-04 20:49     ` Fabio Porcedda
  0 siblings, 1 reply; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-31 11:42 UTC (permalink / raw)
  To: Fabio Porcedda; +Cc: barebox

On 11:42 Thu 31 Jan     , Fabio Porcedda wrote:
> - fix some error and warnings pointed out by checkpatch.
> - join some short lines.
> - remove some empty lines.
> - remove unnecessary headers.
> 
> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/boards/at91sam9260ek/init.c | 37 +++++++++++++++---------------------
>  1 file changed, 15 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
> index 2d52f5a..f0d8adf 100644
> --- a/arch/arm/boards/at91sam9260ek/init.c
> +++ b/arch/arm/boards/at91sam9260ek/init.c
> @@ -10,25 +10,15 @@
>   * but WITHOUT ANY WARRANTY; without even the implied warranty of
>   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>   * GNU General Public License for more details.
> - *
> - *
>   */
>  
>  #include <common.h>
> -#include <net.h>
>  #include <init.h>
>  #include <environment.h>
> -#include <fec.h>
>  #include <asm/armlinux.h>
>  #include <generated/mach-types.h>
> -#include <partition.h>
> -#include <fs.h>
> -#include <fcntl.h>
> -#include <io.h>
> -#include <asm/hardware.h>
>  #include <nand.h>
>  #include <sizes.h>
> -#include <linux/mtd/nand.h>
>  #include <mach/board.h>
>  #include <mach/at91sam9_smc.h>
>  #include <gpio.h>
> @@ -83,7 +73,8 @@ static struct sam9_smc_config ek_9260_nand_smc_config = {
>  	.read_cycle		= 5,
>  	.write_cycle		= 5,
>  
> -	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
> +	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
> +				  AT91_SMC_EXNWMODE_DISABLE,
>  	.tdf_cycles		= 2,
>  };
>  
> @@ -101,7 +92,8 @@ static struct sam9_smc_config ek_9g20_nand_smc_config = {
>  	.read_cycle		= 7,
>  	.write_cycle		= 7,
>  
> -	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
> +	.mode			= AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
> +				  AT91_SMC_EXNWMODE_DISABLE,
>  	.tdf_cycles		= 3,
>  };
>  
> @@ -153,12 +145,11 @@ static void at91sam9260ek_phy_reset(void)
>  	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));
> +	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);
> +	at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY | (rstc) | AT91_RSTC_URSTEN);
>  }
>  
>  /*
> @@ -260,18 +251,21 @@ static int at91sam9260ek_devices_init(void)
>  	armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100));
>  	ek_set_board_type();
>  
> -	devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw");
> +	devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED,
> +			    "at91bootstrap_raw");
>  	dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap");
> -	devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw");
> +	devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED,
> +			    "self_raw");
>  	dev_add_bb_dev("self_raw", "self0");
> -	devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw");
> +	devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K,
> +			    DEVFS_PARTITION_FIXED, "env_raw");
>  	dev_add_bb_dev("env_raw", "env0");
> -	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
> +	devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED,
> +			    "env_raw1");

no I do want to be able to grep via part name

Best Regards,
J.
>  	dev_add_bb_dev("env_raw1", "env1");
>  
>  	return 0;
>  }
> -
>  device_initcall(at91sam9260ek_devices_init);
>  
>  static int at91sam9260ek_console_init(void)
> @@ -279,5 +273,4 @@ static int at91sam9260ek_console_init(void)
>  	at91_register_uart(0, 0);
>  	return 0;
>  }
> -
>  console_initcall(at91sam9260ek_console_init);
> -- 
> 1.8.1.1
> 

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

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

* Re: [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style
  2013-01-31 11:42   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-04 20:49     ` Fabio Porcedda
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Porcedda @ 2013-02-04 20:49 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Thu, Jan 31, 2013 at 12:42 PM, Jean-Christophe PLAGNIOL-VILLARD
<plagnioj@jcrosoft.com> wrote:
> On 11:42 Thu 31 Jan     , Fabio Porcedda wrote:
>> - fix some error and warnings pointed out by checkpatch.
>> - join some short lines.
>> - remove some empty lines.
>> - remove unnecessary headers.
>>
>> Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
>> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> ---
>>  arch/arm/boards/at91sam9260ek/init.c | 37 +++++++++++++++---------------------
>>  1 file changed, 15 insertions(+), 22 deletions(-)
>>
>> diff --git a/arch/arm/boards/at91sam9260ek/init.c b/arch/arm/boards/at91sam9260ek/init.c
>> index 2d52f5a..f0d8adf 100644
>> --- a/arch/arm/boards/at91sam9260ek/init.c
>> +++ b/arch/arm/boards/at91sam9260ek/init.c
>> @@ -10,25 +10,15 @@
>>   * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>   * GNU General Public License for more details.
>> - *
>> - *
>>   */
>>
>>  #include <common.h>
>> -#include <net.h>
>>  #include <init.h>
>>  #include <environment.h>
>> -#include <fec.h>
>>  #include <asm/armlinux.h>
>>  #include <generated/mach-types.h>
>> -#include <partition.h>
>> -#include <fs.h>
>> -#include <fcntl.h>
>> -#include <io.h>
>> -#include <asm/hardware.h>
>>  #include <nand.h>
>>  #include <sizes.h>
>> -#include <linux/mtd/nand.h>
>>  #include <mach/board.h>
>>  #include <mach/at91sam9_smc.h>
>>  #include <gpio.h>
>> @@ -83,7 +73,8 @@ static struct sam9_smc_config ek_9260_nand_smc_config = {
>>       .read_cycle             = 5,
>>       .write_cycle            = 5,
>>
>> -     .mode                   = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
>> +     .mode                   = AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
>> +                               AT91_SMC_EXNWMODE_DISABLE,
>>       .tdf_cycles             = 2,
>>  };
>>
>> @@ -101,7 +92,8 @@ static struct sam9_smc_config ek_9g20_nand_smc_config = {
>>       .read_cycle             = 7,
>>       .write_cycle            = 7,
>>
>> -     .mode                   = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
>> +     .mode                   = AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
>> +                               AT91_SMC_EXNWMODE_DISABLE,
>>       .tdf_cycles             = 3,
>>  };
>>
>> @@ -153,12 +145,11 @@ static void at91sam9260ek_phy_reset(void)
>>       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));
>> +     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);
>> +     at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY | (rstc) | AT91_RSTC_URSTEN);
>>  }
>>
>>  /*
>> @@ -260,18 +251,21 @@ static int at91sam9260ek_devices_init(void)
>>       armlinux_set_bootparams((void *)(AT91_CHIPSELECT_1 + 0x100));
>>       ek_set_board_type();
>>
>> -     devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw");
>> +     devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED,
>> +                         "at91bootstrap_raw");
>>       dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap");
>> -     devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw");
>> +     devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED,
>> +                         "self_raw");
>>       dev_add_bb_dev("self_raw", "self0");
>> -     devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw");
>> +     devfs_add_partition("nand0", SZ_256K + SZ_128K, SZ_128K,
>> +                         DEVFS_PARTITION_FIXED, "env_raw");
>>       dev_add_bb_dev("env_raw", "env0");
>> -     devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED, "env_raw1");
>> +     devfs_add_partition("nand0", SZ_512K, SZ_128K, DEVFS_PARTITION_FIXED,
>> +                         "env_raw1");
>
> no I do want to be able to grep via part name

Ok, I will send a updated patch.

Best regards.
Fabio Porcedda

> Best Regards,
> J.
>>       dev_add_bb_dev("env_raw1", "env1");
>>
>>       return 0;
>>  }
>> -
>>  device_initcall(at91sam9260ek_devices_init);
>>
>>  static int at91sam9260ek_console_init(void)
>> @@ -279,5 +273,4 @@ static int at91sam9260ek_console_init(void)
>>       at91_register_uart(0, 0);
>>       return 0;
>>  }
>> -
>>  console_initcall(at91sam9260ek_console_init);
>> --
>> 1.8.1.1
>>



--
Fabio Porcedda

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

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

end of thread, other threads:[~2013-02-04 20:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 10:42 [PATCH 0/3] at91sam9260/9g20ek: some cleanup Fabio Porcedda
2013-01-31 10:42 ` [PATCH 1/3] at91sam9260/9g20ek: cleanup coding style Fabio Porcedda
2013-01-31 11:42   ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-04 20:49     ` Fabio Porcedda
2013-01-31 10:42 ` [PATCH 2/3] at91sam9260/9g20ek: move sam9_smc_config modification inside definition Fabio Porcedda
2013-01-31 11:38   ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-31 10:42 ` [PATCH 3/3] at91sam9260/9g20ek: enable clock via clock framework Fabio Porcedda

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