From cd232f93463093df0a9ebe3e6fffd6804594d707 Mon Sep 17 00:00:00 2001
From: Oskar Viljasaar <oskar.viljasaar@iopsys.eu>
Date: Tue, 19 Jan 2021 10:47:06 +0100
Subject: [PATCH] Import openwrt hack patch 301-mips_image_cmdline_hack.patch

---
 arch/mips/Kconfig       | 4 ++++
 arch/mips/kernel/head.S | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index afe90e9508..00bb7745e2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1145,6 +1145,10 @@ config SYNC_R4K
 config MIPS_MACHINE
 	def_bool n
 
+config IMAGE_CMDLINE_HACK
+	bool "OpenWrt specific image command line hack"
+	default n
+
 config NO_IOPORT_MAP
 	def_bool n
 
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index d1bb506adc..d80812124d 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -79,6 +79,12 @@ FEXPORT(__kernel_entry)
 	j	kernel_entry
 #endif
 
+#ifdef CONFIG_IMAGE_CMDLINE_HACK
+	.ascii	"CMDLINE:"
+EXPORT(__image_cmdline)
+	.fill	0x400
+#endif /* CONFIG_IMAGE_CMDLINE_HACK */
+
 	__REF
 
 NESTED(kernel_entry, 16, sp)			# kernel entry point
-- 
GitLab