mips: octeon: tools: Add update_octeon_header tool

Add a tool to update or insert an Octeon specific header into the U-Boot
image. This is needed e.g. for booting via SPI NOR, eMMC and NAND.

While working on this, move enum cvmx_board_types_enum and
cvmx_board_type_to_string() to cvmx-bootloader.h and remove the
unreferenced (unsupported) board definition.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
diff --git a/arch/mips/mach-octeon/include/mach/cvmx-bootinfo.h b/arch/mips/mach-octeon/include/mach/cvmx-bootinfo.h
index 3379871..97438ff 100644
--- a/arch/mips/mach-octeon/include/mach/cvmx-bootinfo.h
+++ b/arch/mips/mach-octeon/include/mach/cvmx-bootinfo.h
@@ -125,226 +125,4 @@
 
 #endif /*   (CVMX_BOOTINFO_MAJ_VER == 1) */
 
-/* Type defines for board and chip types */
-enum cvmx_board_types_enum {
-	CVMX_BOARD_TYPE_NULL = 0,
-	CVMX_BOARD_TYPE_SIM = 1,
-	CVMX_BOARD_TYPE_EBT3000 = 2,
-	CVMX_BOARD_TYPE_KODAMA = 3,
-	CVMX_BOARD_TYPE_NIAGARA = 4,
-	CVMX_BOARD_TYPE_NAC38 = 5,	/* formerly NAO38 */
-	CVMX_BOARD_TYPE_THUNDER = 6,
-	CVMX_BOARD_TYPE_TRANTOR = 7,
-	CVMX_BOARD_TYPE_EBH3000 = 8,
-	CVMX_BOARD_TYPE_EBH3100 = 9,
-	CVMX_BOARD_TYPE_HIKARI = 10,
-	CVMX_BOARD_TYPE_CN3010_EVB_HS5 = 11,
-	CVMX_BOARD_TYPE_CN3005_EVB_HS5 = 12,
-	CVMX_BOARD_TYPE_KBP = 13,
-	/* Deprecated, CVMX_BOARD_TYPE_CN3010_EVB_HS5 supports the CN3020 */
-	CVMX_BOARD_TYPE_CN3020_EVB_HS5 = 14,
-	CVMX_BOARD_TYPE_EBT5800 = 15,
-	CVMX_BOARD_TYPE_NICPRO2 = 16,
-	CVMX_BOARD_TYPE_EBH5600 = 17,
-	CVMX_BOARD_TYPE_EBH5601 = 18,
-	CVMX_BOARD_TYPE_EBH5200 = 19,
-	CVMX_BOARD_TYPE_BBGW_REF = 20,
-	CVMX_BOARD_TYPE_NIC_XLE_4G = 21,
-	CVMX_BOARD_TYPE_EBT5600 = 22,
-	CVMX_BOARD_TYPE_EBH5201 = 23,
-	CVMX_BOARD_TYPE_EBT5200 = 24,
-	CVMX_BOARD_TYPE_CB5600	= 25,
-	CVMX_BOARD_TYPE_CB5601	= 26,
-	CVMX_BOARD_TYPE_CB5200	= 27,
-	/* Special 'generic' board type, supports many boards */
-	CVMX_BOARD_TYPE_GENERIC = 28,
-	CVMX_BOARD_TYPE_EBH5610 = 29,
-	CVMX_BOARD_TYPE_LANAI2_A = 30,
-	CVMX_BOARD_TYPE_LANAI2_U = 31,
-	CVMX_BOARD_TYPE_EBB5600 = 32,
-	CVMX_BOARD_TYPE_EBB6300 = 33,
-	CVMX_BOARD_TYPE_NIC_XLE_10G = 34,
-	CVMX_BOARD_TYPE_LANAI2_G = 35,
-	CVMX_BOARD_TYPE_EBT5810 = 36,
-	CVMX_BOARD_TYPE_NIC10E = 37,
-	CVMX_BOARD_TYPE_EP6300C = 38,
-	CVMX_BOARD_TYPE_EBB6800 = 39,
-	CVMX_BOARD_TYPE_NIC4E = 40,
-	CVMX_BOARD_TYPE_NIC2E = 41,
-	CVMX_BOARD_TYPE_EBB6600 = 42,
-	CVMX_BOARD_TYPE_REDWING = 43,
-	CVMX_BOARD_TYPE_NIC68_4 = 44,
-	CVMX_BOARD_TYPE_NIC10E_66 = 45,
-	CVMX_BOARD_TYPE_MAX,
-
-	/*
-	 * The range from CVMX_BOARD_TYPE_MAX to
-	 * CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved for future
-	 * SDK use.
-	 */
-
-	/*
-	 * Set aside a range for customer boards.  These numbers are managed
-	 * by Cavium.
-	 */
-	CVMX_BOARD_TYPE_CUST_DEFINED_MIN = 10000,
-	CVMX_BOARD_TYPE_CUST_WSX16 = 10001,
-	CVMX_BOARD_TYPE_CUST_NS0216 = 10002,
-	CVMX_BOARD_TYPE_CUST_NB5 = 10003,
-	CVMX_BOARD_TYPE_CUST_WMR500 = 10004,
-	CVMX_BOARD_TYPE_CUST_ITB101 = 10005,
-	CVMX_BOARD_TYPE_CUST_NTE102 = 10006,
-	CVMX_BOARD_TYPE_CUST_AGS103 = 10007,
-	CVMX_BOARD_TYPE_CUST_GST104 = 10008,
-	CVMX_BOARD_TYPE_CUST_GCT105 = 10009,
-	CVMX_BOARD_TYPE_CUST_AGS106 = 10010,
-	CVMX_BOARD_TYPE_CUST_SGM107 = 10011,
-	CVMX_BOARD_TYPE_CUST_GCT108 = 10012,
-	CVMX_BOARD_TYPE_CUST_AGS109 = 10013,
-	CVMX_BOARD_TYPE_CUST_GCT110 = 10014,
-	CVMX_BOARD_TYPE_CUST_L2_AIR_SENDER = 10015,
-	CVMX_BOARD_TYPE_CUST_L2_AIR_RECEIVER = 10016,
-	CVMX_BOARD_TYPE_CUST_L2_ACCTON2_TX = 10017,
-	CVMX_BOARD_TYPE_CUST_L2_ACCTON2_RX = 10018,
-	CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_TX = 10019,
-	CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_RX = 10020,
-	CVMX_BOARD_TYPE_CUST_L2_ZINWELL = 10021,
-	CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000,
-
-	/*
-	 * Set aside a range for customer private use.	The SDK won't
-	 * use any numbers in this range.
-	 */
-	CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
-	CVMX_BOARD_TYPE_UBNT_E100 = 20002,
-	CVMX_BOARD_TYPE_CUST_DSR1000N = 20006,
-	CVMX_BOARD_TYPE_KONTRON_S1901 = 21901,
-	CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,
-
-	/* The remaining range is reserved for future use. */
-};
-
-enum cvmx_chip_types_enum {
-	CVMX_CHIP_TYPE_NULL = 0,
-	CVMX_CHIP_SIM_TYPE_DEPRECATED = 1,
-	CVMX_CHIP_TYPE_OCTEON_SAMPLE = 2,
-	CVMX_CHIP_TYPE_MAX,
-};
-
-/*
- * Compatibility alias for NAC38 name change, planned to be removed
- * from SDK 1.7
- */
-#define CVMX_BOARD_TYPE_NAO38	CVMX_BOARD_TYPE_NAC38
-
-/* Functions to return string based on type */
-#define ENUM_BRD_TYPE_CASE(x)						\
-	case x:								\
-		return(#x + 16)		/* Skip CVMX_BOARD_TYPE_ */
-
-static inline const char *cvmx_board_type_to_string(enum
-						    cvmx_board_types_enum type)
-{
-	switch (type) {
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_SIM);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT3000);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KODAMA);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIAGARA);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NAC38);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_THUNDER);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_TRANTOR);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3000);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3100);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_HIKARI);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3010_EVB_HS5);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3005_EVB_HS5);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KBP);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3020_EVB_HS5);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5800);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NICPRO2);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5600);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5601);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5200);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_BBGW_REF);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5200);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5600);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5601);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5200);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_GENERIC);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5610);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_A);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_U);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB5600);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6300);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_10G);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_LANAI2_G);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5810);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC10E);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EP6300C);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6800);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC4E);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC2E);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB6600);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_REDWING);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC68_4);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC10E_66);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX);
-
-		/* Customer boards listed here */
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MIN);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WSX16);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NS0216);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NB5);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WMR500);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_ITB101);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NTE102);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS103);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GST104);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT105);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS106);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_SGM107);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT108);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_AGS109);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_GCT110);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_AIR_SENDER);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_AIR_RECEIVER);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_ACCTON2_TX);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_ACCTON2_RX);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_TX);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_WSTRNSNIC_RX);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_ZINWELL);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX);
-
-		/* Customer private range */
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DSR1000N);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901);
-		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX);
-	}
-
-	return NULL;
-}
-
-#define ENUM_CHIP_TYPE_CASE(x)						\
-	case x:								\
-		return(#x + 15)		/* Skip CVMX_CHIP_TYPE */
-
-static inline const char *cvmx_chip_type_to_string(enum
-						   cvmx_chip_types_enum type)
-{
-	switch (type) {
-		ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_NULL);
-		ENUM_CHIP_TYPE_CASE(CVMX_CHIP_SIM_TYPE_DEPRECATED);
-		ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_OCTEON_SAMPLE);
-		ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_MAX);
-	}
-
-	return "Unsupported Chip";
-}
-
 #endif /* __CVMX_BOOTINFO_H__ */
diff --git a/arch/mips/mach-octeon/include/mach/cvmx-bootloader.h b/arch/mips/mach-octeon/include/mach/cvmx-bootloader.h
new file mode 100644
index 0000000..9abe021
--- /dev/null
+++ b/arch/mips/mach-octeon/include/mach/cvmx-bootloader.h
@@ -0,0 +1,172 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020 Marvell International Ltd.
+ */
+
+/*
+ * Bootloader definitions that are shared with other programs
+ */
+
+#ifndef __CVMX_BOOTLOADER__
+#define __CVMX_BOOTLOADER__
+
+/*
+ * The bootloader_header_t structure defines the header that is present
+ * at the start of binary u-boot images.  This header is used to locate
+ * the bootloader image in NAND, and also to allow verification of images
+ * for normal NOR booting. This structure is placed at the beginning of a
+ * bootloader binary image, and remains in the executable code.
+ */
+#define BOOTLOADER_HEADER_MAGIC		0x424f4f54	/* "BOOT" in ASCII */
+
+#define BOOTLOADER_HEADER_COMMENT_LEN	64
+#define BOOTLOADER_HEADER_VERSION_LEN	64
+/* limited by the space to the next exception handler */
+#define BOOTLOADER_HEADER_MAX_SIZE	0x200
+
+#define BOOTLOADER_HEADER_CURRENT_MAJOR_REV 1
+#define BOOTLOADER_HEADER_CURRENT_MINOR_REV 2
+/*
+ * Revision history
+ * 1.1  Initial released revision. (SDK 1.9)
+ * 1.2  TLB based relocatable image (SDK 2.0)
+ */
+
+#ifndef __ASSEMBLY__
+struct bootloader_header {
+	uint32_t jump_instr;	/*
+				 * Jump to executable code following the
+				 * header.  This allows this header to be
+				 * (and remain) part of the executable image)
+				 */
+	uint32_t nop_instr;	/* Must be 0x0 */
+	uint32_t magic;		/* Magic number to identify header */
+	uint32_t hcrc;		/* CRC of all of header excluding this field */
+
+	uint16_t hlen;		/* Length of header in bytes */
+	uint16_t maj_rev;	/* Major revision */
+	uint16_t min_rev;	/* Minor revision */
+	uint16_t board_type;	/* Board type that the image is for */
+
+	uint32_t dlen;		/* Length of data (following header) in bytes */
+	uint32_t dcrc;		/* CRC of data */
+	uint64_t address;	/* Mips virtual address */
+	uint32_t flags;
+	uint16_t image_type;	/* Defined in bootloader_image_t enum */
+	uint16_t resv0;		/* pad */
+
+	uint32_t reserved1;
+	uint32_t reserved2;
+	uint32_t reserved3;
+	uint32_t reserved4;
+
+	/* Optional, for descriptive purposes */
+	char comment_string[BOOTLOADER_HEADER_COMMENT_LEN];
+	/* Optional, for descriptive purposes */
+	char version_string[BOOTLOADER_HEADER_VERSION_LEN];
+} __packed;
+
+/* Defines for flag field */
+#define BL_HEADER_FLAG_FAILSAFE		1
+
+enum bootloader_image {
+	BL_HEADER_IMAGE_UNKNOWN = 0x0,
+	BL_HEADER_IMAGE_STAGE2,		/* Binary bootloader stage2 image */
+	BL_HEADER_IMAGE_STAGE3,		/* Binary bootloader stage3 image */
+	BL_HEADER_IMAGE_NOR,		/* Binary bootloader for NOR boot */
+	BL_HEADER_IMAGE_PCIBOOT,	/* Binary bootloader for PCI boot */
+	BL_HEADER_IMAGE_UBOOT_ENV,	/* Environment for u-boot */
+	/* Bootloader before U-Boot (stage 1/1.5) */
+	BL_HEADER_IMAGE_PRE_UBOOT,
+	BL_HEADER_IMAGE_STAGE1,		/* NOR stage 1 bootloader */
+	BL_HEADER_IMAGE_MAX,
+	/* Range for customer private use.  Will not be used by Cavium Inc. */
+	BL_HEADER_IMAGE_CUST_RESERVED_MIN = 0x1000,
+	BL_HEADER_IMAGE_CUST_RESERVED_MAX = 0x1fff
+};
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * Maximum address searched for NAND boot images and environments.
+ * This is used by stage1 and stage2.
+ */
+#define MAX_NAND_SEARCH_ADDR	0x800000
+
+/* Maximum address to look for start of normal bootloader */
+#define MAX_NOR_SEARCH_ADDR	0x400000
+
+/*
+ * Defines for RAM based environment set by the host or the previous
+ * bootloader in a chain boot configuration.
+ */
+
+#define U_BOOT_RAM_ENV_ADDR	0x1000
+#define U_BOOT_RAM_ENV_SIZE	0x1000
+#define U_BOOT_RAM_ENV_CRC_SIZE	0x4
+#define U_BOOT_RAM_ENV_ADDR_2	(U_BOOT_RAM_ENV_ADDR + U_BOOT_RAM_ENV_SIZE)
+/* Address of environment in L2 cache if booted from cache */
+#define U_BOOT_CACHE_ENV_ADDR	0x000ff000
+/* Size of environment in L2 cache */
+#define U_BOOT_CACHE_ENV_SIZE	0x1000
+
+/* Board numbers and names */
+
+/* Type defines for board and chip types */
+enum cvmx_board_types_enum {
+	CVMX_BOARD_TYPE_NULL = 0,
+	CVMX_BOARD_TYPE_SIM = 1,
+	/* Special 'generic' board type, supports many boards */
+	CVMX_BOARD_TYPE_GENERIC = 28,
+	CVMX_BOARD_TYPE_EBB7304 = 76,
+	CVMX_BOARD_TYPE_MAX,
+	/* NOTE:  256-257 are being used by a customer. */
+
+	/*
+	 * The range from CVMX_BOARD_TYPE_MAX to
+	 * CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved
+	 * for future SDK use.
+	 */
+
+	/*
+	 * Set aside a range for customer boards. These numbers are managed
+	 * by Cavium.
+	 */
+	CVMX_BOARD_TYPE_CUST_DEFINED_MIN = 10000,
+	CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000,
+
+	/*
+	 * Set aside a range for customer private use.  The SDK won't
+	 * use any numbers in this range.
+	 */
+	CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
+	CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,
+};
+
+/* Functions to return string based on type */
+/* Skip CVMX_BOARD_TYPE_ */
+#define ENUM_BRD_TYPE_CASE(x)	case x: return(#x + 16)
+
+static inline const char
+*cvmx_board_type_to_string(enum cvmx_board_types_enum type)
+{
+	switch (type) {
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL);
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_SIM);
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_GENERIC);
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBB7304);
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX);
+
+		/* Customer boards listed here */
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MIN);
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX);
+
+		/* Customer private range */
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN);
+		ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX);
+	}
+
+	return "Unsupported Board";
+}
+
+#endif /* __CVMX_BOOTLOADER__ */