Skip to contentSkip to conversation

at91sam9260/9g20ek: some cleanup

PATCH Applied Fabio Porcedda 3 participants 5 messages Feb 7, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover at91sam9260/9g20ek: some cleanup

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

Tested on atsam9260ek.

Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>

v2:
- removed some parts in patch 1/3 as asked by Jean-Christophe
- removed patch 2/3 as asked by Jean-Christophe

Fabio Porcedda (2):
at91sam9260/9g20ek: cleanup coding style at91sam9260/9g20ek: enable clock via clock framework

 arch/arm/boards/at91sam9260ek/init.c | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)
Signature · 7 lines
1.8.1.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH v2 1/2 at91sam9260/9g20ek: cleanup coding style

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

Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
---
 arch/arm/boards/at91sam9260ek/init.c | 25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)
arch/arm/boards/at91sam9260ek/init.c +7 -18
index 2d52f5a..e0c03ee 100644
@@ -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);
 }
 
 /*
@@ -271,7 +262,6 @@ static int at91sam9260ek_devices_init(void)
 
 	return 0;
 }
-
 device_initcall(at91sam9260ek_devices_init);
 
 static int at91sam9260ek_console_init(void)
@@ -279,5 +269,4 @@ static int at91sam9260ek_console_init(void)
 	at91_register_uart(0, 0);
 	return 0;
 }
-
 console_initcall(at91sam9260ek_console_init);
Signature · 7 lines
1.8.1.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH v2 2/2 at91sam9260/9g20ek: enable clock via clock framework

In reply to Fabio Porcedda
Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
---
 arch/arm/boards/at91sam9260ek/init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/boards/at91sam9260ek/init.c +4 -2
index e0c03ee..06a53f2 100644
@@ -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
@@ -126,7 +126,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);
Signature · 7 lines
1.8.1.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Acked-by on the v2 series
#3 lore raw
In reply to Fabio Porcedda
Quoted 9 lines · Fabio Porcedda

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

Tested on atsam9260ek.

Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>

v2:
- removed some parts in patch 1/3 as asked by Jean-Christophe
- removed patch 2/3 as asked by Jean-Christophe

on all

Best Regards,
J.

Quoted 12 lines

Fabio Porcedda (2):
at91sam9260/9g20ek: cleanup coding style at91sam9260/9g20ek: enable clock via clock framework

 arch/arm/boards/at91sam9260ek/init.c | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)
Signature · 1 line
1.8.1.1

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Applied
#4 lore raw
In reply to Fabio Porcedda
Quoted 9 lines · Fabio Porcedda

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

Tested on atsam9260ek.

Cc Jean-Christophe PLAGNIOL-VILLARD <[email protected]>

v2:
- removed some parts in patch 1/3 as asked by Jean-Christophe
- removed patch 2/3 as asked by Jean-Christophe

Applied, thanks

Sascha

Quoted 18 lines

Fabio Porcedda (2):
at91sam9260/9g20ek: cleanup coding style at91sam9260/9g20ek: enable clock via clock framework

 arch/arm/boards/at91sam9260ek/init.c | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)
Signature · 7 lines
1.8.1.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox