arm: Add Kconfig entry for MACH_TYPE
As part of migrating support for ATAGs to Kconfig, add an option for
setting and passing MACH_TYPE.
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index dbf5ceb..21f17c2 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1937,6 +1937,20 @@
bool "Pass system serial number via ATAG"
depends on SUPPORT_PASSING_ATAGS
+config STATIC_MACH_TYPE
+ bool "Statically define the Machine ID number"
+ help
+ When booting via ATAGs, enable this option if we know the correct
+ machine ID number to use at compile time. Some systems will be
+ passed the number dynamically by whatever loads U-Boot.
+
+config MACH_TYPE
+ int "Machine ID number"
+ depends on STATIC_MACH_TYPE
+ help
+ When booting via ATAGs, the machine type must be passed as a number.
+ For the full list see https://www.arm.linux.org.uk/developer/machines
+
config ARCH_SUPPORT_TFABOOT
bool
diff --git a/configs/ds109_defconfig b/configs/ds109_defconfig
index e06b7fd..d7e8651 100644
--- a/configs/ds109_defconfig
+++ b/configs/ds109_defconfig
@@ -6,6 +6,8 @@
CONFIG_SUPPORT_PASSING_ATAGS=y
CONFIG_CMDLINE_TAG=y
CONFIG_INITRD_TAG=y
+CONFIG_STATIC_MACH_TYPE=y
+CONFIG_MACH_TYPE=527
CONFIG_SYS_TEXT_BASE=0x600000
CONFIG_NR_DRAM_BANKS=2
CONFIG_TARGET_DS109=y
diff --git a/configs/ds414_defconfig b/configs/ds414_defconfig
index de5d85c..6402e25 100644
--- a/configs/ds414_defconfig
+++ b/configs/ds414_defconfig
@@ -4,6 +4,8 @@
CONFIG_SUPPORT_PASSING_ATAGS=y
CONFIG_CMDLINE_TAG=y
CONFIG_INITRD_TAG=y
+CONFIG_STATIC_MACH_TYPE=y
+CONFIG_MACH_TYPE=3036
CONFIG_SYS_TEXT_BASE=0x00800000
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
diff --git a/configs/icnova-a20-swac_defconfig b/configs/icnova-a20-swac_defconfig
index c759d7e..de766b2 100644
--- a/configs/icnova-a20-swac_defconfig
+++ b/configs/icnova-a20-swac_defconfig
@@ -4,6 +4,8 @@
CONFIG_CMDLINE_TAG=y
CONFIG_INITRD_TAG=y
CONFIG_SERIAL_TAG=y
+CONFIG_STATIC_MACH_TYPE=y
+CONFIG_MACH_TYPE=4283
CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-icnova-swac"
CONFIG_SPL=y
CONFIG_MACH_SUN7I=y
diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig
index e6e8f2a..69784d9 100644
--- a/configs/nokia_rx51_defconfig
+++ b/configs/nokia_rx51_defconfig
@@ -6,6 +6,8 @@
CONFIG_CMDLINE_TAG=y
CONFIG_INITRD_TAG=y
CONFIG_REVISION_TAG=y
+CONFIG_STATIC_MACH_TYPE=y
+CONFIG_MACH_TYPE=1955
CONFIG_SYS_TEXT_BASE=0x80008000
CONFIG_NR_DRAM_BANKS=2
CONFIG_SYS_MALLOC_LEN=0xc0000
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 972df00..b37e054 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -23,8 +23,6 @@
*/
#define CONFIG_SYS_L2CACHE_OFF /* pretend there is no L2 CACHE */
-#define CONFIG_MACH_TYPE MACH_TYPE_NOKIA_RX51
-
#include <asm/arch/cpu.h> /* get chip and board defs */
#include <asm/arch/omap.h>
#include <asm/arch/mem.h>