aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm646x.c
diff options
context:
space:
mode:
authorMark A. Greer <mgreer@mvista.com>2009-04-15 15:38:58 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 11:14:04 -0400
commit79c3c0b729647a6246c120408f36e6804dab244e (patch)
tree5662bf481043b99b13951aaafd44d45a7903fa8b /arch/arm/mach-davinci/dm646x.c
parentac7b75b5bbbfd60b752869a22daa3be99b5b4f99 (diff)
davinci: Encapsulate SoC-specific data in a structure
Create a structure to encapsulate SoC-specific information. This will assist in generalizing code so it can be used by different SoCs that have similar hardware but with minor differences such as having a different base address. The idea is that the code for each SoC fills out a structure with the correct information. The board-specific code then calls the SoC init routine which in turn will call a common init routine that makes a copy of the structure, maps in I/O regions, etc. After initialization, code can get a pointer to the structure by calling davinci_get_soc_info(). Eventually, the common init routine will make a copy of all of the data pointed to by the structure so the original data can be made __init_data. That way the data for SoC's that aren't being used won't consume memory for the entire life of the kernel. The structure will be extended in subsequent patches but initially, it holds the map_desc structure for any I/O regions the SoC/board wants statically mapped. Signed-off-by: Mark A. Greer <mgreer@mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/dm646x.c')
-rw-r--r--arch/arm/mach-davinci/dm646x.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 975ed062ce24..8547ec02c9e1 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -13,6 +13,8 @@
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15 15
16#include <asm/mach/map.h>
17
16#include <mach/dm646x.h> 18#include <mach/dm646x.h>
17#include <mach/clock.h> 19#include <mach/clock.h>
18#include <mach/cputype.h> 20#include <mach/cputype.h>
@@ -20,6 +22,7 @@
20#include <mach/irqs.h> 22#include <mach/irqs.h>
21#include <mach/psc.h> 23#include <mach/psc.h>
22#include <mach/mux.h> 24#include <mach/mux.h>
25#include <mach/common.h>
23 26
24#include "clock.h" 27#include "clock.h"
25#include "mux.h" 28#include "mux.h"
@@ -442,8 +445,23 @@ void dm646x_init_emac(struct emac_platform_data *unused) {}
442 445
443#endif 446#endif
444 447
448static struct map_desc dm646x_io_desc[] = {
449 {
450 .virtual = IO_VIRT,
451 .pfn = __phys_to_pfn(IO_PHYS),
452 .length = IO_SIZE,
453 .type = MT_DEVICE
454 },
455};
456
457static struct davinci_soc_info davinci_soc_info_dm646x = {
458 .io_desc = dm646x_io_desc,
459 .io_desc_num = ARRAY_SIZE(dm646x_io_desc),
460};
461
445void __init dm646x_init(void) 462void __init dm646x_init(void)
446{ 463{
464 davinci_common_init(&davinci_soc_info_dm646x);
447 davinci_clk_init(dm646x_clks); 465 davinci_clk_init(dm646x_clks);
448 davinci_mux_register(dm646x_pins, ARRAY_SIZE(dm646x_pins)); 466 davinci_mux_register(dm646x_pins, ARRAY_SIZE(dm646x_pins));
449} 467}