[U-Boot] [PATCH 6/7] omap-common: Common function to display die id, replacing omap3-specific version

Paul Kocialkowski contact at paulk.fr
Thu Aug 27 19:37:13 CEST 2015


This introduces omap_die_id_display to display the full die id.
There is no need to store it in an environment variable, that no boot script
is using anyway.

Signed-off-by: Paul Kocialkowski <contact at paulk.fr>
---
 arch/arm/cpu/armv7/omap-common/utils.c      | 10 ++++++++++
 arch/arm/cpu/armv7/omap3/board.c            |  2 +-
 arch/arm/cpu/armv7/omap3/sys_info.c         | 22 ----------------------
 arch/arm/include/asm/arch-omap3/sys_proto.h |  1 -
 arch/arm/include/asm/omap_common.h          |  1 +
 board/comelit/dig297/dig297.c               |  2 +-
 board/compulab/cm_t35/cm_t35.c              |  2 +-
 board/compulab/cm_t3517/cm_t3517.c          |  2 +-
 board/corscience/tricorder/tricorder.c      |  2 +-
 board/isee/igep00x0/igep00x0.c              |  2 +-
 board/logicpd/am3517evm/am3517evm.c         |  2 +-
 board/logicpd/zoom1/zoom1.c                 |  2 +-
 board/matrix_vision/mvblx/mvblx.c           |  2 +-
 board/nokia/rx51/rx51.c                     |  2 +-
 board/overo/overo.c                         |  2 +-
 board/pandora/pandora.c                     |  2 +-
 board/technexion/tao3530/tao3530.c          |  2 +-
 board/technexion/twister/twister.c          |  2 +-
 board/teejet/mt_ventoux/mt_ventoux.c        |  2 +-
 board/ti/am3517crane/am3517crane.c          |  2 +-
 board/ti/beagle/beagle.c                    |  2 +-
 board/ti/evm/evm.c                          |  2 +-
 board/timll/devkit8000/devkit8000.c         |  2 +-
 23 files changed, 30 insertions(+), 42 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/utils.c b/arch/arm/cpu/armv7/omap-common/utils.c
index 28d0f86..dc5a169 100644
--- a/arch/arm/cpu/armv7/omap-common/utils.c
+++ b/arch/arm/cpu/armv7/omap-common/utils.c
@@ -83,3 +83,13 @@ void omap_die_id_usbethaddr(void)
 		eth_setenv_enetaddr("usbethaddr", mac);
 	}
 }
+
+void omap_die_id_display(void)
+{
+	unsigned int die_id[4] = { 0 };
+
+	omap_die_id(die_id);
+
+	printf("OMAP die ID: %08x%08x%08x%08x", die_id[0], die_id[1], die_id[2],
+		die_id[3]);
+}
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 8252b32..0c44ea5 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -214,7 +214,7 @@ void board_init_f(ulong dummy)
  */
 int __weak misc_init_r(void)
 {
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/arch/arm/cpu/armv7/omap3/sys_info.c b/arch/arm/cpu/armv7/omap3/sys_info.c
index 497dc13..6818fab 100644
--- a/arch/arm/cpu/armv7/omap3/sys_info.c
+++ b/arch/arm/cpu/armv7/omap3/sys_info.c
@@ -52,28 +52,6 @@ void omap_die_id(unsigned int *die_id)
 	die_id[3] = readl(&id_base->die_id_3);
 }
 
-/*****************************************************************
- * dieid_num_r(void) - read and set die ID
- *****************************************************************/
-void dieid_num_r(void)
-{
-	char *uid_s, die_id[34];
-	u32 id[4];
-
-	memset(die_id, 0, sizeof(die_id));
-
-	uid_s = getenv("dieid#");
-
-	if (uid_s == NULL) {
-		omap_die_id(id);
-		sprintf(die_id, "%08x%08x%08x%08x", id[0], id[1], id[2], id[3]);
-		setenv("dieid#", die_id);
-		uid_s = die_id;
-	}
-
-	printf("Die ID #%s\n", uid_s);
-}
-
 /******************************************
  * get_cpu_type(void) - extract cpu info
  ******************************************/
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h
index a0809fc..24563c0 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -69,7 +69,6 @@ void sdelay(unsigned long);
 void make_cs1_contiguous(void);
 void omap_nand_switch_ecc(uint32_t, uint32_t);
 void power_init_r(void);
-void dieid_num_r(void);
 void do_omap3_emu_romcode_call(u32 service_id, u32 parameters);
 void omap3_set_aux_cr_secure(u32 acr);
 u32 warm_reset(void);
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 725b2da..0f5758d 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -598,6 +598,7 @@ s8 abb_setup_ldovbb(u32 fuse, u32 ldovbb);
 
 void omap_die_id_serial(void);
 void omap_die_id_usbethaddr(void);
+void omap_die_id_display(void);
 
 void recalibrate_iodelay(void);
 
diff --git a/board/comelit/dig297/dig297.c b/board/comelit/dig297/dig297.c
index 9d4c41b..47a3ea8 100644
--- a/board/comelit/dig297/dig297.c
+++ b/board/comelit/dig297/dig297.c
@@ -112,7 +112,7 @@ int misc_init_r(void)
 	setup_net_chip();
 #endif
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index 374edbc..2278a50 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -110,7 +110,7 @@ u32 get_board_rev(void)
 int misc_init_r(void)
 {
 	cl_print_pcb_info();
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c
index b33522e..d1c74db 100644
--- a/board/compulab/cm_t3517/cm_t3517.c
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -101,7 +101,7 @@ int board_init(void)
 int misc_init_r(void)
 {
 	cl_print_pcb_info();
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/corscience/tricorder/tricorder.c b/board/corscience/tricorder/tricorder.c
index 0fddf45..0009452 100644
--- a/board/corscience/tricorder/tricorder.c
+++ b/board/corscience/tricorder/tricorder.c
@@ -124,7 +124,7 @@ int misc_init_r(void)
 	status_led_set(1, STATUS_LED_ON);
 	status_led_set(2, STATUS_LED_ON);
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index 693fce7..3be8157 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -171,7 +171,7 @@ int misc_init_r(void)
 
 	setup_net_chip();
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	set_fdt();
 
diff --git a/board/logicpd/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c
index 24ff9c3..1f1e5ae 100644
--- a/board/logicpd/am3517evm/am3517evm.c
+++ b/board/logicpd/am3517evm/am3517evm.c
@@ -109,7 +109,7 @@ int misc_init_r(void)
 	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	am3517_evm_musb_init();
 
diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c
index d39203a..0a3b55b 100644
--- a/board/logicpd/zoom1/zoom1.c
+++ b/board/logicpd/zoom1/zoom1.c
@@ -80,7 +80,7 @@ int misc_init_r(void)
 {
 	twl4030_power_init();
 	twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
-	dieid_num_r();
+	omap_die_id_display();
 
 	/*
 	 * Board Reset
diff --git a/board/matrix_vision/mvblx/mvblx.c b/board/matrix_vision/mvblx/mvblx.c
index c9d615b..223da63 100644
--- a/board/matrix_vision/mvblx/mvblx.c
+++ b/board/matrix_vision/mvblx/mvblx.c
@@ -71,7 +71,7 @@ int misc_init_r(void)
 
 	mac_read_from_eeprom();
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/nokia/rx51/rx51.c b/board/nokia/rx51/rx51.c
index 3d019b0..6a4427a 100644
--- a/board/nokia/rx51/rx51.c
+++ b/board/nokia/rx51/rx51.c
@@ -421,7 +421,7 @@ int misc_init_r(void)
 	/* reuse atags from previous bootloader */
 	reuse_atags();
 
-	dieid_num_r();
+	omap_die_id_display();
 	print_cpuinfo();
 
 	/*
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 34bf265..20cbec2 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -285,7 +285,7 @@ int misc_init_r(void)
 	if (expansion_config.content == 1)
 		setenv(expansion_config.env_var, expansion_config.env_setting);
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	if (get_cpu_family() == CPU_OMAP34XX)
 		setenv("boardname", "overo");
diff --git a/board/pandora/pandora.c b/board/pandora/pandora.c
index 59b5a7e..b371a40 100644
--- a/board/pandora/pandora.c
+++ b/board/pandora/pandora.c
@@ -102,7 +102,7 @@ int misc_init_r(void)
 		TWL4030_BB_CFG_BBCHEN | TWL4030_BB_CFG_BBSEL_3200MV |
 		TWL4030_BB_CFG_BBISEL_500UA);
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/technexion/tao3530/tao3530.c b/board/technexion/tao3530/tao3530.c
index 744ff44..d51b5d9 100644
--- a/board/technexion/tao3530/tao3530.c
+++ b/board/technexion/tao3530/tao3530.c
@@ -160,7 +160,7 @@ int misc_init_r(void)
 		puts("Unknown board revision\n");
 	}
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c
index a4aed3b..48d207f 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -92,7 +92,7 @@ int misc_init_r(void)
 	struct tam3517_module_info info;
 	int ret;
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	eth_addr = getenv("ethaddr");
 	if (eth_addr)
diff --git a/board/teejet/mt_ventoux/mt_ventoux.c b/board/teejet/mt_ventoux/mt_ventoux.c
index b4a0a72..c2de1fe 100644
--- a/board/teejet/mt_ventoux/mt_ventoux.c
+++ b/board/teejet/mt_ventoux/mt_ventoux.c
@@ -257,7 +257,7 @@ int misc_init_r(void)
 	int ret;
 
 	TAM3517_READ_EEPROM(&info, ret);
-	dieid_num_r();
+	omap_die_id_display();
 
 	if (ret)
 		return 0;
diff --git a/board/ti/am3517crane/am3517crane.c b/board/ti/am3517crane/am3517crane.c
index a649697..8d1c390 100644
--- a/board/ti/am3517crane/am3517crane.c
+++ b/board/ti/am3517crane/am3517crane.c
@@ -47,7 +47,7 @@ int misc_init_r(void)
 	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
 #endif
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 149b5db..56e3cfe 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -494,7 +494,7 @@ int misc_init_r(void)
 	writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
 		GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
 
-	dieid_num_r();
+	omap_die_id_display();
 
 #ifdef CONFIG_VIDEO_OMAP3
 	beagle_dvi_pup();
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 3f93d9c..ff3971d 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -159,7 +159,7 @@ int misc_init_r(void)
 #if defined(CONFIG_CMD_NET)
 	reset_net_chip();
 #endif
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c
index 4d07313..a61cc14 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -114,7 +114,7 @@ int misc_init_r(void)
 	}
 #endif
 
-	dieid_num_r();
+	omap_die_id_display();
 
 	return 0;
 }
-- 
1.9.1



More information about the U-Boot mailing list