Skip to contentSkip to conversation

socfpga: Relocate arch common functions away from board

PATCH Superseded Chin Liang See 3 participants 5 messages Jun 10, 2014 – Jul 5, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 socfpga: Relocate arch common functions away from board

To move the arch common function away from board folder to arch/arm/cpu/armv7/socfpga folder. Its to avoid code duplication for other non Altera dev kit which is using socfpga device.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Dinh Nguyen <[email protected]>

---
Changes for v2
- Added the purpose of the patch to commit message

---
 arch/arm/cpu/armv7/socfpga/misc.c       |   24 ++++++++++++++++++++++++
 board/altera/socfpga/socfpga_cyclone5.c |   23 -----------------------
 2 files changed, 24 insertions(+), 23 deletions(-)
arch/arm/cpu/armv7/socfpga/misc.c +24 -0
index 2f1c716..5268f2c 100644
@@ -14,3 +14,27 @@ int dram_init(void)
 	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
 	return 0;
 }
+
+#if defined(CONFIG_DISPLAY_CPUINFO)
+/*
+ * Print CPU information
+ */
+int print_cpuinfo(void)
+{
+	puts("CPU   : Altera SOCFPGA Platform\n");
+	return 0;
+}
+#endif
+
+#if defined(CONFIG_SYS_CONSOLE_IS_IN_ENV) && \
+defined(CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE)
+int overwrite_console(void)
+{
+	return 0;
+}
+#endif
+
+int misc_init_r(void)
+{
+	return 0;
+}
board/altera/socfpga/socfpga_cyclone5.c +0 -23
index a960eb6..f366565 100644
@@ -12,17 +12,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_DISPLAY_CPUINFO)
-/*
- * Print CPU information
- */
-int print_cpuinfo(void)
-{
-	puts("CPU   : Altera SOCFPGA Platform\n");
-	return 0;
-}
-#endif
-
 /*
  * Print Board information
  */
@@ -49,18 +38,6 @@ int board_init(void)
 	return 0;
 }
 
-int misc_init_r(void)
-{
-	return 0;
-}
-
-#if defined(CONFIG_SYS_CONSOLE_IS_IN_ENV) && defined(CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE)
-int overwrite_console(void)
-{
-	return 0;
-}
-#endif
-
 /*
  * DesignWare Ethernet initialization
  */
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 socfpga: Relocate arch common functions away from board

Hi Chin,

Quoted 3 lines

To move the arch common function away from board folder to arch/arm/cpu/armv7/socfpga folder. Its to avoid code duplication for other non Altera dev kit which is using socfpga device.

This looks like a good first step. I'm sure that followup patches are neccessary to clean up the division between generic and board specific patches, but we'll see this once other boards (like socrates) are added.

Pavel, can you rebase your intended change on this? Thanks!

Signature · 6 lines
A change in language can transform our appreciation of the cosmos
                       -- Benjamin Lee Whorf
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#2 lore raw

PATCH v2 1/1 socfpga: Relocate arch common functions away from board

Quoted 6 lines · Detlev Zundel

Hi Chin,

Quoted 3 lines

To move the arch common function away from board folder to arch/arm/cpu/armv7/socfpga folder. Its to avoid code duplication for other non Altera dev kit which is using socfpga device.

Quoted 8 lines

This looks like a good first step. I'm sure that followup patches are neccessary to clean up the division between generic and board specific patches, but we'll see this once other boards (like socrates) are added.

Pavel, can you rebase your intended change on this? Thanks!

Thanks Detlev.

Hi Albert,

Can you help to apply this patch?
Thanks

Chin Liang

#3 lore raw

PATCH v2 1/1 socfpga: Relocate arch common functions away from board

Hi Chin,

Quoted 16 lines · Chin Liang See
Quoted 6 lines · Detlev Zundel

Hi Chin,

Quoted 3 lines

To move the arch common function away from board folder to arch/arm/cpu/armv7/socfpga folder. Its to avoid code duplication for other non Altera dev kit which is using socfpga device.

Quoted 8 lines

This looks like a good first step. I'm sure that followup patches are neccessary to clean up the division between generic and board specific patches, but we'll see this once other boards (like socrates) are added.

Pavel, can you rebase your intended change on this? Thanks!

Quoted 7 lines

Thanks Detlev.

Hi Albert,

Can you help to apply this patch?
Thanks

Scheduled for application once 2014-07 is out.

Quoted 1 line

Chin Liang

Amicalement,

Signature · 1 line
Albert.
#4 lore raw

PATCH v2 1/1 socfpga: Relocate arch common functions away from board

In reply to Chin Liang See

Hi Chin,

Quoted 80 lines · Chin Liang See

To move the arch common function away from board folder to arch/arm/cpu/armv7/socfpga folder. Its to avoid code duplication for other non Altera dev kit which is using socfpga device.

Cc Wolfgang Denk <[email protected]>
Cc Detlev Zundel <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Dinh Nguyen <[email protected]>

---
Changes for v2
- Added the purpose of the patch to commit message

---
 arch/arm/cpu/armv7/socfpga/misc.c       |   24 ++++++++++++++++++++++++
 board/altera/socfpga/socfpga_cyclone5.c |   23 -----------------------
 2 files changed, 24 insertions(+), 23 deletions(-)
arch/arm/cpu/armv7/socfpga/misc.c +24 -0
index 2f1c716..5268f2c 100644
@@ -14,3 +14,27 @@ int dram_init(void)
 	gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
 	return 0;
 }
+
+#if defined(CONFIG_DISPLAY_CPUINFO)
+/*
+ * Print CPU information
+ */
+int print_cpuinfo(void)
+{
+	puts("CPU   : Altera SOCFPGA Platform\n");
+	return 0;
+}
+#endif
+
+#if defined(CONFIG_SYS_CONSOLE_IS_IN_ENV) && \
+defined(CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE)
+int overwrite_console(void)
+{
+	return 0;
+}
+#endif
+
+int misc_init_r(void)
+{
+	return 0;
+}
board/altera/socfpga/socfpga_cyclone5.c +0 -16
index a960eb6..f366565 100644
@@ -12,17 +12,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_DISPLAY_CPUINFO)
-/*
- * Print CPU information
- */
-int print_cpuinfo(void)
-{
-	puts("CPU   : Altera SOCFPGA Platform\n");
-	return 0;
-}
-#endif
-
 /*
  * Print Board information
  */
@@ -49,18 +38,6 @@ int board_init(void)
 	return 0;
 }
 
-int misc_init_r(void)
-{
-	return 0;
-}
-

board/altera/socfpga/socfpga_cyclone5.c int board_init(void) · line 43

Quoted 10 lines
board/altera/socfpga/socfpga_cyclone5.c +0 -7
-#if defined(CONFIG_SYS_CONSOLE_IS_IN_ENV) && defined(CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE)
-int overwrite_console(void)
-{
-	return 0;
-}
-#endif
-
 /*
  * DesignWare Ethernet initialization
  */

Applied to u-boot-arm/master, thanks!

Amicalement,

Signature · 1 line
Albert.