Skip to contentSkip to conversation

davinci: dm644x: move EMAC definitions from dm644x.h to dm644x.c

PATCH New Manjunath Hadli 2 participants 2 messages May 20, 2011

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

PATCH 1/4 davinci: dm644x: move EMAC definitions from dm644x.h to dm644x.c

move the register base addresses and offsets used only by dm644x platform file from platform header dm644x.h to dm644x.c as they are used only in the c file.

---
 arch/arm/mach-davinci/dm644x.c              |   16 +++++++++++-----
 arch/arm/mach-davinci/include/mach/dm644x.h |    7 -------
 2 files changed, 11 insertions(+), 12 deletions(-)
arch/arm/mach-davinci/dm644x.c +11 -5
index 9a2376b..4fbb250 100644
@@ -30,11 +30,6 @@
 #include "clock.h"
 #include "mux.h"
 
-/*
- * Device specific clocks
- */
-#define DM644X_REF_FREQ		27000000
-
 static struct pll_data pll1_data = {
 	.num       = 1,
 	.phys_base = DAVINCI_PLL1_BASE,
@@ -45,6 +40,8 @@ static struct pll_data pll2_data = {
 	.phys_base = DAVINCI_PLL2_BASE,
 };
 
+#define DM644X_REF_FREQ		27000000
+
 static struct clk ref_clk = {
 	.name = "ref_clk",
 	.rate = DM644X_REF_FREQ,
@@ -318,6 +315,11 @@ static struct clk_lookup dm644x_clks[] = {
 	CLK(NULL, NULL, NULL),
 };
 
+#define DM644X_EMAC_CNTRL_OFFSET	0x0000
+#define DM644X_EMAC_CNTRL_MOD_OFFSET	0x1000
+#define DM644X_EMAC_CNTRL_RAM_OFFSET	0x2000
+#define DM644X_EMAC_CNTRL_RAM_SIZE	0x2000
+
 static struct emac_platform_data dm644x_emac_pdata = {
 	.ctrl_reg_offset	= DM644X_EMAC_CNTRL_OFFSET,
 	.ctrl_mod_reg_offset	= DM644X_EMAC_CNTRL_MOD_OFFSET,
@@ -326,6 +328,8 @@ static struct emac_platform_data dm644x_emac_pdata = {
 	.version		= EMAC_VERSION_1,
 };
 
+#define DM644X_EMAC_BASE	0x01C80000
+
 static struct resource dm644x_emac_resources[] = {
 	{
 		.start	= DM644X_EMAC_BASE,
@@ -349,6 +353,8 @@ static struct platform_device dm644x_emac_device = {
        .resource	= dm644x_emac_resources,
 };
 
+#define DM644X_EMAC_MDIO_BASE	(DM644X_EMAC_BASE + 0x4000)
+
 static struct resource dm644x_mdio_resources[] = {
 	{
 		.start	= DM644X_EMAC_MDIO_BASE,
arch/arm/mach-davinci/include/mach/dm644x.h +0 -7
index 5a1b26d..724377f 100644
@@ -27,13 +27,6 @@
 #include <mach/asp.h>
 #include <media/davinci/vpfe_capture.h>
 
-#define DM644X_EMAC_BASE		(0x01C80000)
-#define DM644X_EMAC_MDIO_BASE		(DM644X_EMAC_BASE + 0x4000)
-#define DM644X_EMAC_CNTRL_OFFSET	(0x0000)
-#define DM644X_EMAC_CNTRL_MOD_OFFSET	(0x1000)
-#define DM644X_EMAC_CNTRL_RAM_OFFSET	(0x2000)
-#define DM644X_EMAC_CNTRL_RAM_SIZE	(0x2000)
-
 #define DM644X_ASYNC_EMIF_CONTROL_BASE	0x01E00000
 #define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
 #define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
Signature · 1 line
1.6.2.4
#1 lore raw

PATCH 1/4 davinci: dm644x: move EMAC definitions from dm644x.h to dm644x.c

Hello.

Quoted 27 lines · Manjunath Hadli

move the register base addresses and offsets used only by dm644x platform file from platform header dm644x.h to dm644x.c as they are used only in the c file.

---
 arch/arm/mach-davinci/dm644x.c              |   16 +++++++++++-----
 arch/arm/mach-davinci/include/mach/dm644x.h |    7 -------
 2 files changed, 11 insertions(+), 12 deletions(-)
arch/arm/mach-davinci/dm644x.c +0 -5
index 9a2376b..4fbb250 100644
@@ -30,11 +30,6 @@
 #include "clock.h"
 #include "mux.h"
 
-/*
- * Device specific clocks
- */
-#define DM644X_REF_FREQ		27000000
-
 static struct pll_data pll1_data = {
 	.num       = 1,
 	.phys_base = DAVINCI_PLL1_BASE,

arch/arm/mach-davinci/dm644x.c static struct pll_data pll2_data = { · line 43

Quoted 4 lines
arch/arm/mach-davinci/dm644x.c +1 -0
@@ -45,6 +40,8 @@ static struct pll_data pll2_data = {
 	.phys_base = DAVINCI_PLL2_BASE,
 };
 
+#define DM644X_REF_FREQ		27000000

Why move it (and remove the comment)?

Quoted 25 lines
arch/arm/mach-davinci/dm644x.c +7 -0
 static struct clk ref_clk = {
 	.name = "ref_clk",
 	.rate = DM644X_REF_FREQ,
@@ -318,6 +315,11 @@ static struct clk_lookup dm644x_clks[] = {
 	CLK(NULL, NULL, NULL),
 };
 
+#define DM644X_EMAC_CNTRL_OFFSET	0x0000
+#define DM644X_EMAC_CNTRL_MOD_OFFSET	0x1000
+#define DM644X_EMAC_CNTRL_RAM_OFFSET	0x2000
+#define DM644X_EMAC_CNTRL_RAM_SIZE	0x2000
+
 static struct emac_platform_data dm644x_emac_pdata = {
 	.ctrl_reg_offset	= DM644X_EMAC_CNTRL_OFFSET,
 	.ctrl_mod_reg_offset	= DM644X_EMAC_CNTRL_MOD_OFFSET,
@@ -326,6 +328,8 @@ static struct emac_platform_data dm644x_emac_pdata = {
 	.version		= EMAC_VERSION_1,
 };
 
+#define DM644X_EMAC_BASE	0x01C80000
+
 static struct resource dm644x_emac_resources[] = {
 	{
 		.start	= DM644X_EMAC_BASE,

arch/arm/mach-davinci/dm644x.c static struct platform_device dm644x_emac_device = { · line 356

Quoted 4 lines
arch/arm/mach-davinci/dm644x.c +1 -0
@@ -349,6 +353,8 @@ static struct platform_device dm644x_emac_device = {
        .resource	= dm644x_emac_resources,
 };
 
+#define DM644X_EMAC_MDIO_BASE	(DM644X_EMAC_BASE + 0x4000)

I'd prefer that these macros would still be grouped together at the start of
file...

WBR, Sergei