2012-01-22 22:38:19 +00:00
|
|
|
--- a/arch/mips/ath79/prom.c
|
|
|
|
+++ b/arch/mips/ath79/prom.c
|
|
|
|
@@ -70,6 +70,35 @@ static const char * __init ath79_prom_fi
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef CONFIG_IMAGE_CMDLINE_HACK
|
|
|
|
+extern char __image_cmdline[];
|
|
|
|
+
|
|
|
|
+static int __init ath79_use_image_cmdline(void)
|
|
|
|
+{
|
|
|
|
+ char *p = __image_cmdline;
|
|
|
|
+ int replace = 0;
|
|
|
|
+
|
|
|
|
+ if (*p == '-') {
|
|
|
|
+ replace = 1;
|
|
|
|
+ p++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (*p == '\0')
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ if (replace) {
|
|
|
|
+ strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline));
|
|
|
|
+ } else {
|
|
|
|
+ strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
|
|
|
|
+ strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+#else
|
|
|
|
+static inline int ath79_use_image_cmdline(void) { return 0; }
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
static int __init ath79_prom_init_myloader(void)
|
|
|
|
{
|
|
|
|
struct myloader_info *mylo;
|
2012-03-12 16:27:56 +00:00
|
|
|
@@ -98,6 +127,8 @@ static int __init ath79_prom_init_myload
|
2012-01-22 22:38:19 +00:00
|
|
|
|
|
|
|
ath79_prom_append_cmdline("ethaddr", mac_buf);
|
|
|
|
|
|
|
|
+ ath79_use_image_cmdline();
|
|
|
|
+
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-03-12 16:27:56 +00:00
|
|
|
@@ -105,6 +136,9 @@ static __init void ath79_prom_init_cmdli
|
2012-01-22 22:38:19 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
+ if (ath79_use_image_cmdline())
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
if (!is_valid_ram_addr(argv))
|
|
|
|
return;
|
|
|
|
|