[U-Boot] [PATCH 09/11] Support passing a Marvell-specific ATAG

rogan at dawes.za.net rogan at dawes.za.net
Fri Mar 18 09:04:58 CET 2011


From: Rogan Dawes <rogan at dawes.za.net>

---
 arch/arm/include/asm/setup.h |   18 ++++++++++++++++++
 arch/arm/lib/bootm.c         |   30 ++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 89df4dc..bd6229a 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -198,6 +198,19 @@ struct tag_acorn {
 	u8 adfsdrives;
 };
 
+/* Marvell specific information
+ * requred for compatability with vendor kernels
+ */
+#define ATAG_MV_UBOOT   0x41000403
+ 
+struct tag_mv_uboot {
+	u32 uboot_version;
+	u32 tclk;
+	u32 sysclk;
+	u32 isUsbHost;
+	u32 overEthAddr;
+};
+
 /* footbridge memory clock, see arch/arm/mach-footbridge/arch.c */
 #define ATAG_MEMCLK	0x41000402
 
@@ -227,6 +240,11 @@ struct tag {
 		 * DC21285 specific
 		 */
 		struct tag_memclk	memclk;
+
+		/*
+		 * Marvell specific
+		 */
+		struct tag_mv_uboot	mv_uboot;
 	} u;
 };
 
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 3101321..f3acd6c 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -45,6 +45,11 @@ static void setup_commandline_tag (bd_t *bd, char *commandline);
 static void setup_initrd_tag (bd_t *bd, ulong initrd_start,
 			      ulong initrd_end);
 # endif
+
+#ifdef CONFIG_MARVELL_TAG
+static void setup_marvell_tag(void);
+#endif
+
 static void setup_end_tag (bd_t *bd);
 
 static struct tag *params;
@@ -80,6 +85,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
 #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
     defined (CONFIG_CMDLINE_TAG) || \
     defined (CONFIG_INITRD_TAG) || \
+    defined (CONFIG_MARVELL_TAG) || \
     defined (CONFIG_SERIAL_TAG) || \
     defined (CONFIG_REVISION_TAG)
 	setup_start_tag (bd);
@@ -99,6 +105,9 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
 	if (images->rd_start && images->rd_end)
 		setup_initrd_tag (bd, images->rd_start, images->rd_end);
 #endif
+#ifdef CONFIG_MARVELL_TAG
+	setup_marvell_tag();
+#endif
 	setup_end_tag (bd);
 #endif
 
@@ -232,6 +241,27 @@ void setup_revision_tag(struct tag **in_params)
 }
 #endif  /* CONFIG_REVISION_TAG */
 
+#ifdef CONFIG_MARVELL_TAG
+#define ATAG_MARVELL	0x41000403
+#define VER_NUM 	0x01070300
+
+void setup_marvell_tag(void) {
+	debug("Setting up Marvell tag\n");
+	params->hdr.tag = ATAG_MARVELL;
+	params->hdr.size = tag_size (tag_mv_uboot);
+
+	params->u.mv_uboot.uboot_version = VER_NUM;
+	params->u.mv_uboot.uboot_version |= 0xB; // RD_88F5182_2XSATA
+	params->u.mv_uboot.tclk = 166000000;
+	params->u.mv_uboot.sysclk = 166000000;
+	params->u.mv_uboot.isUsbHost = 1;
+	params->u.mv_uboot.isUsbHost |= 2;
+
+	params->u.mv_uboot.overEthAddr = 0;
+
+	params = tag_next (params);
+}
+#endif
 
 static void setup_end_tag (bd_t *bd)
 {
-- 
1.7.1



More information about the U-Boot mailing list