Hello.
Mark A. Greer wrote:
From: "Mark A. Greer" <[email protected]>
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 global 'davinci_soc_info' will point to that structure.
The idea is that the code for each SoC fills out the structure
with the correct information. The board-specific code can
then modify anything in that structure before calling a
common init routine that sets 'davinci_soc_info', maps in
I/O regions, etc.
This 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 <[email protected]>
[...]
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 5f31649..f454e24 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -16,6 +16,8 @@
#include <linux/spi/spi.h>
+#include <asm/mach/map.h>
+
#include <mach/dm355.h>
#include <mach/clock.h>
#include <mach/cpu.h>
@@ -23,6 +25,7 @@
#include <mach/psc.h>
#include <mach/mux.h>
#include <mach/irqs.h>
+#include <mach/common.h>
#include "clock.h"
#include "mux.h"
@@ -522,6 +525,25 @@ static struct platform_device dm355_edma_device = {
/*----------------------------------------------------------------------*/
+static struct map_desc dm355_io_desc[] = {
+ {
+ .virtual = IO_VIRT,
+ .pfn = __phys_to_pfn(IO_PHYS),
+ .length = IO_SIZE,
+ .type = MT_DEVICE
+ },
+};
+
+static struct davinci_soc_info davinci_soc_info_dm355 = {
+ .io_desc = dm355_io_desc,
+ .io_desc_num = ARRAY_SIZE(dm355_io_desc),
+};
+
+struct davinci_soc_info *dm355_get_soc_info(void)
+{
+ return &davinci_soc_info_dm355;
+}
+
Why not just declare davinci_soc_info_dm* 'extern' instead of this
simplisitic function that seem to serve no real purpose?
WBR, Sergei
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source