@@ -719,9 +719,19 @@ static void __init cdce_clk_init(void)
}
}
+#define DM646X_EVM_REF_FREQ 27000000
+#define DM6467T_EVM_REF_FREQ 33000000
+
static void __init davinci_map_io(void)
{
- dm646x_init();
+ struct davinci_board_info info;
+
+ if (machine_is_davinci_dm6467tevm())
+ info.ref_clk_rate = DM6467T_EVM_REF_FREQ;
+ else
+ info.ref_clk_rate = DM646X_EVM_REF_FREQ;
+
+ dm646x_init(&info);
cdce_clk_init();
}
@@ -785,17 +795,6 @@ static __init void evm_init(void)
soc_info->emac_pdata->phy_id = DM646X_EVM_PHY_ID;
}
-#define DM646X_EVM_REF_FREQ 27000000
-#define DM6467T_EVM_REF_FREQ 33000000
-
-void __init dm646x_board_setup_refclk(struct clk *clk)
-{
- if (machine_is_davinci_dm6467tevm())
- clk->rate = DM6467T_EVM_REF_FREQ;
- else
- clk->rate = DM646X_EVM_REF_FREQ;
-}
-
MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
.boot_params = (0x80000100),
.map_io = davinci_map_io,
@@ -899,9 +899,11 @@ int __init dm646x_init_edma(struct edma_rsv_info *rsv)
return platform_device_register(&dm646x_edma_device);
}
-void __init dm646x_init(void)
+void __init dm646x_init(struct davinci_board_info *board)
{
- dm646x_board_setup_refclk(&ref_clk);
+ if (board && board->ref_clk_rate)
+ ref_clk.rate = board->ref_clk_rate;
+
davinci_common_init(&davinci_soc_info_dm646x);
}
@@ -83,6 +83,16 @@ struct davinci_soc_info {
extern struct davinci_soc_info davinci_soc_info;
+/*
+ * DaVinci board info.
+ *
+ * This structure is used to pass board information to
+ * early SoC specific initialization code.
+ */
+struct davinci_board_info {
+ unsigned long ref_clk_rate;
+};
+
extern void davinci_common_init(struct davinci_soc_info *soc_info);
extern void davinci_init_ide(void);
@@ -16,6 +16,7 @@
#include <linux/clk.h>
#include <linux/davinci_emac.h>
+#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/asp.h>
@@ -29,10 +30,9 @@
#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
-void __init dm646x_init(void);
+void __init dm646x_init(struct davinci_board_info *board);
void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);
void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);
-void __init dm646x_board_setup_refclk(struct clk *clk);
int __init dm646x_init_edma(struct edma_rsv_info *rsv);
void dm646x_video_init(void);