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

login
register
mail settings
Submitter Rogan Dawes
Date March 18, 2011, 8:04 a.m.
Message ID <1300435500-4909-10-git-send-email-rogan@dawes.za.net>
Download mbox | patch
Permalink /patch/87498/
State Not Applicable
Headers show

Comments

Rogan Dawes - March 18, 2011, 8:04 a.m.
From: Rogan Dawes <rogan@dawes.za.net>

---
 arch/arm/include/asm/setup.h |   18 ++++++++++++++++++
 arch/arm/lib/bootm.c         |   30 ++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)
Wolfgang Denk - April 25, 2011, 9:43 p.m.
Dear rogan@dawes.za.net,

In message <1300435500-4909-10-git-send-email-rogan@dawes.za.net> you wrote:
> From: Rogan Dawes <rogan@dawes.za.net>
> 
> ---
>  arch/arm/include/asm/setup.h |   18 ++++++++++++++++++
>  arch/arm/lib/bootm.c         |   30 ++++++++++++++++++++++++++++++
>  2 files changed, 48 insertions(+), 0 deletions(-)
...
> +/* Marvell specific information
> + * requred for compatability with vendor kernels
> + */

Incorrect multiline comment style.

> +#define ATAG_MV_UBOOT   0x41000403
> + 
> +struct tag_mv_uboot {
> +	u32 uboot_version;
> +	u32 tclk;
> +	u32 sysclk;
> +	u32 isUsbHost;
> +	u32 overEthAddr;
> +};

NAK for now.  Please resubmit after this ATAG has been accepted to the
mainline Linux kernel tree.

Best regards,

Wolfgang Denk

Patch

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)
 {