omap-common: Common omap_die_id definition
PATCH 1/7 omap-common: Common omap_die_id definition
This introduces a common definition for omap_die_id, that aims at providing a common interface for accessing omap platform's die id bits.
--- arch/arm/cpu/armv7/omap-common/utils.c | 5 +++++ arch/arm/include/asm/omap_common.h | 2 ++ 2 files changed, 7 insertions(+)
arch/arm/cpu/armv7/omap-common/utils.c +5 -0
@@ -41,6 +41,11 @@ void cancel_out(u32 *num, u32 *den, u32 den_limit) } } +__weak void omap_die_id (unsigned int *die_id) +{ + die_id[0 ] = die_id[1 ] = die_id[2 ] = die_id[3 ] =0 ; +} +void __weak usb_fake_mac_from_die_id (u32 *id) {uint8_t device_mac[6 ];
arch/arm/include/asm/omap_common.h +2 -0
@@ -605,6 +605,8 @@ void omap_smc1(u32 service, u32 val);void enable_edma3_clocks (void );void disable_edma3_clocks (void ); +void omap_die_id (unsigned int *die_id); +/* ABB */ #define OMAP_ABB_NOMINAL_OPP 0#define OMAP_ABB_FAST_OPP 1
Signature · 1 line
1.9.1
PATCH 1/7 omap-common: Common omap_die_id definition
Hi,
Le jeudi 27 ao?t 2015 ? 19:37 +0200, Paul Kocialkowski a ?crit :
Quoted 3 lines
This introduces a common definition for
omap_die_id, that aims at providing a
common interface for accessing omap platform's die id bits.
It has been a week since I sent this series for review. Any comments?
Quoted 29 lines
Signed-off-by Paul Kocialkowski <[email protected]>--- arch/arm/cpu/armv7/omap-common/utils.c | 5 +++++ arch/arm/include/asm/omap_common.h | 2 ++ 2 files changed, 7 insertions(+)arch/arm/cpu/armv7/omap-common/utils.c +5
-0@@ -41,6 +41,11 @@ void cancel_out(u32 *num, u32 *den, u32 den_limit) } } +__weak void omap_die_id (unsigned int *die_id) +{ + die_id[0 ] = die_id[1 ] = die_id[2 ] = die_id[3 ] =0 ; +} +void __weak usb_fake_mac_from_die_id (u32 *id) {uint8_t device_mac[6 ];arch/arm/include/asm/omap_common.h +0
-0
arch/arm/include/asm/omap_common.h void omap_smc1(u32 service, u32 val); · line 612
Quoted 8 lines
arch/arm/include/asm/omap_common.h +2
-0@@ -605,6 +605,8 @@ void omap_smc1(u32 service, u32 val);void enable_edma3_clocks (void );void disable_edma3_clocks (void ); +void omap_die_id (unsigned int *die_id); +/* ABB */ #define OMAP_ABB_NOMINAL_OPP 0#define OMAP_ABB_FAST_OPP 1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150903/bf91e959/attachment-0001.sig>
PATCH 2/7 omap3: omap_die_id support
In reply to Paul KocialkowskiThis replaces the previous get_dieid definition with omap_die_id, that matches the common omap_die_id definition.
--- arch/arm/cpu/armv7/omap3/sys_info.c | 15 ++++++--------- arch/arm/include/asm/arch-omap3/sys_proto.h | 1 - board/lge/sniper/sniper.c | 6 +++--- board/ti/beagle/beagle.c | 6 +++--- 4 files changed, 12 insertions(+), 16 deletions(-)
arch/arm/cpu/armv7/omap3/sys_info.c +6 -9
@@ -42,17 +42,14 @@ static char *rev_s_37xx[CPU_37XX_MAX_REV] = { "1.2"};#endif /* CONFIG_DISPLAY_CPUINFO */ -/***************************************************************** -* get_dieid(u32 *id) - read die ID -*****************************************************************/ -void get_dieid (u32 *id) +void omap_die_id (unsigned int *die_id) {struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE ; - id[3 ] =readl (&id_base->die_id_0); - id[2 ] =readl (&id_base->die_id_1); - id[1 ] =readl (&id_base->die_id_2); - id[0 ] =readl (&id_base->die_id_3); + die_id[0 ] =readl (&id_base->die_id_0); + die_id[1 ] =readl (&id_base->die_id_1); + die_id[2 ] =readl (&id_base->die_id_2); + die_id[3 ] =readl (&id_base->die_id_3); }/*****************************************************************
@@ -68,7 +65,7 @@ void dieid_num_r(void) uid_s =getenv ("dieid#" );if (uid_s ==NULL ) { -get_dieid (id); +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;
arch/arm/include/asm/arch-omap3/sys_proto.h +0 -1
@@ -70,7 +70,6 @@ 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 get_dieid (u32 *id);void do_omap3_emu_romcode_call (u32 service_id,u32 parameters);void omap3_set_aux_cr_secure (u32 acr);u32 warm_reset (void );
board/lge/sniper/sniper.c +3 -3
@@ -92,9 +92,9 @@ int board_init(void)int misc_init_r (void ) {unsigned char keypad_matrix[64 ] = {0 }; +unsigned int die_id[4 ] = {0 };char serial_string[17 ] = {0 };char reboot_mode[2 ] = {0 }; -u32 dieid[4 ] = {0 };unsigned char keys[3 ];unsigned char data =0 ;
@@ -140,11 +140,11 @@ int misc_init_r(void)/* Serial number */ -get_dieid ((u32 *)&dieid); +omap_die_id (die_id);if (!getenv ("serial#" )) {snprintf (serial_string,sizeof (serial_string), -"%08x%08x" , dieid[0 ], dieid[3 ]); +"%08x%08x" , die_id[0 ], die_id[3 ]);setenv ("serial#" , serial_string); }
board/ti/beagle/beagle.c +3 -3
@@ -507,10 +507,10 @@ int misc_init_r(void)#endif if (generate_fake_mac) { -u32 id[4 ]; +unsigned int die_id[4 ] = {0 }; -get_dieid (id); -usb_fake_mac_from_die_id (id); +omap_die_id (die_id); +usb_fake_mac_from_die_id (die_id); }return 0 ;
Signature · 1 line
1.9.1
PATCH 2/7 omap3: omap_die_id support
Quoted 4 lines · Paul Kocialkowski
This replaces the previous
get_dieiddefinition withomap_die_id, that matches the commonomap_die_iddefinition.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/e5beb0d2/attachment.sig>
PATCH 2/7 omap3: omap_die_id support
In reply to Paul KocialkowskiQuoted 5 lines · Paul Kocialkowski
This replaces the previous
get_dieiddefinition withomap_die_id, that matches the commonomap_die_iddefinition.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/1d672c6e/attachment.sig>
PATCH 3/7 omap4: omap_die_id support
In reply to Paul KocialkowskiThis introduces omap4 support for omap_die_id, which matches the common omap_die_id definition. It replaces board-specific code to grab the die id bits.
--- arch/arm/cpu/armv7/omap4/hwinit.c | 8 ++++++++ arch/arm/cpu/armv7/omap4/prcm-regs.c | 5 ++++- arch/arm/include/asm/arch-omap4/omap.h | 4 ---- board/ti/panda/panda.c | 9 +++------ 4 files changed, 15 insertions(+), 11 deletions(-)
arch/arm/cpu/armv7/omap4/hwinit.c +8 -0
@@ -156,6 +156,14 @@ void init_omap_revision(void) } } +void omap_die_id (unsigned int *die_id) +{ + die_id[0 ] =readl ((*ctrl)->control_std_fuse_die_id_0); + die_id[1 ] =readl ((*ctrl)->control_std_fuse_die_id_1); + die_id[2 ] =readl ((*ctrl)->control_std_fuse_die_id_2); + die_id[3 ] =readl ((*ctrl)->control_std_fuse_die_id_3); +} +#ifndef CONFIG_SYS_L2CACHE_OFF void v7_outer_cache_enable (void ) {
arch/arm/cpu/armv7/omap4/prcm-regs.c +4 -1
@@ -280,7 +280,10 @@ struct prcm_regs const omap4_prcm = {struct omap_sys_ctrl_regs const omap4_ctrl = { .control_status =0x4A0022C4 , - .control_id_code =0x4A002204 , + .control_std_fuse_die_id_0 =0x4A002200 , + .control_std_fuse_die_id_1 =0x4A002208 , + .control_std_fuse_die_id_2 =0x4A00220C , + .control_std_fuse_die_id_3 =0x4A002210 , .control_std_fuse_opp_bgap =0x4a002260 , .control_status =0x4a0022c4 , .control_ldosram_iva_voltage_ctrl =0x4A002320 ,
arch/arm/include/asm/arch-omap4/omap.h +0 -4
@@ -33,10 +33,6 @@/* CONTROL_ID_CODE */ #define CONTROL_ID_CODE 0x4A002204 -#define STD_FUSE_DIE_ID_0 0x4A002200 -#define STD_FUSE_DIE_ID_1 0x4A002208 -#define STD_FUSE_DIE_ID_2 0x4A00220c -#define STD_FUSE_DIE_ID_3 0x4A002210#define OMAP4_CONTROL_ID_CODE_ES1_0 0x0B85202F#define OMAP4_CONTROL_ID_CODE_ES2_0 0x1B85202F
board/ti/panda/panda.c +3 -6
@@ -209,7 +209,7 @@ int misc_init_r(void) {int phy_type;u32 auxclk, altclksrc; -u32 id[4 ]; +unsigned int die_id[4 ] = {0 };/* EHCI is not supported on ES1.0 */ if (omap_revision () ==OMAP4430_ES1_0 )
@@ -263,11 +263,8 @@ int misc_init_r(void)writel (altclksrc, &scrm->altclksrc); - id[0 ] =readl (STD_FUSE_DIE_ID_0 ); - id[1 ] =readl (STD_FUSE_DIE_ID_1 ); - id[2 ] =readl (STD_FUSE_DIE_ID_2 ); - id[3 ] =readl (STD_FUSE_DIE_ID_3 ); -usb_fake_mac_from_die_id (id); +omap_die_id (die_id); +usb_fake_mac_from_die_id (die_id);return 0 ; }
Signature · 1 line
1.9.1
PATCH 3/7 omap4: omap_die_id support
Quoted 4 lines · Paul Kocialkowski
This introduces omap4 support for
omap_die_id, which matches the commonomap_die_iddefinition. It replaces board-specific code to grab the die id bits.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/ad01c69a/attachment.sig>
PATCH 3/7 omap4: omap_die_id support
In reply to Paul KocialkowskiQuoted 5 lines · Paul Kocialkowski
This introduces omap4 support for
omap_die_id, which matches the commonomap_die_iddefinition. It replaces board-specific code to grab the die id bits.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/b1657eb9/attachment.sig>
PATCH 4/7 omap5: omap_die_id support
In reply to Paul KocialkowskiThis introduces omap5 support for omap_die_id, which matches the common omap_die_id definition. It replaces board-specific code to grab the die id bits.
--- arch/arm/cpu/armv7/omap5/hwinit.c | 8 ++++++++ arch/arm/cpu/armv7/omap5/prcm-regs.c | 4 ++++ board/ti/dra7xx/evm.c | 7 +++---- board/ti/omap5_uevm/evm.c | 12 +++--------- 4 files changed, 18 insertions(+), 13 deletions(-)
arch/arm/cpu/armv7/omap5/hwinit.c +8 -0
@@ -376,6 +376,14 @@ void init_omap_revision(void)init_cpu_configuration (); } +void omap_die_id (unsigned int *die_id) +{ + die_id[0 ] =readl ((*ctrl)->control_std_fuse_die_id_0); + die_id[1 ] =readl ((*ctrl)->control_std_fuse_die_id_1); + die_id[2 ] =readl ((*ctrl)->control_std_fuse_die_id_2); + die_id[3 ] =readl ((*ctrl)->control_std_fuse_die_id_3); +} +void reset_cpu (ulong ignored) {u32 omap_rev =omap_revision ();
arch/arm/cpu/armv7/omap5/prcm-regs.c +4 -0
@@ -297,6 +297,10 @@ struct prcm_regs const omap5_es1_prcm = {struct omap_sys_ctrl_regs const omap5_ctrl = { .control_status =0x4A002134 , .control_std_fuse_opp_vdd_mpu_2 =0x4A0021B4 , + .control_std_fuse_die_id_0 =0x4A002200 , + .control_std_fuse_die_id_1 =0x4A002208 , + .control_std_fuse_die_id_2 =0x4A00220C , + .control_std_fuse_die_id_3 =0x4A002210 , .control_phy_power_usb =0x4A002370 , .control_phy_power_sata =0x4A002374 , .control_padconf_core_base =0x4A002800 ,
board/ti/dra7xx/evm.c +3 -4
@@ -57,16 +57,15 @@ int board_init(void)int board_late_init (void ) {#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG -u32 id[4 ]; +unsigned int die_id[4 ] = {0 };if (omap_revision () ==DRA722_ES1_0 )setenv ("board_name" ,"dra72x" );else setenv ("board_name" ,"dra7xx" ); - id[0 ] =readl ((*ctrl)->control_std_fuse_die_id_0); - id[1 ] =readl ((*ctrl)->control_std_fuse_die_id_1); -usb_set_serial_num_from_die_id (id); +omap_die_id (die_id); +usb_set_serial_num_from_die_id (die_id);#endif return 0 ; }
board/ti/omap5_uevm/evm.c +3 -9
@@ -112,20 +112,14 @@ static void enable_host_clocks(void)*/ int misc_init_r (void ) { -int reg; -u32 id[4 ]; +unsigned int die_id[4 ] = {0 };#ifdef CONFIG_PALMAS_POWER palmas_init_settings ();#endif - reg =DIE_ID_REG_BASE +DIE_ID_REG_OFFSET ; - - id[0 ] =readl (reg); - id[1 ] =readl (reg +0x8 ); - id[2 ] =readl (reg +0xC ); - id[3 ] =readl (reg +0x10 ); -usb_fake_mac_from_die_id (id); +omap_die_id (die_id); +usb_fake_mac_from_die_id (die_id);return 0 ; }
Signature · 1 line
1.9.1
PATCH 4/7 omap5: omap_die_id support
Quoted 4 lines · Paul Kocialkowski
This introduces omap5 support for
omap_die_id, which matches the commonomap_die_iddefinition. It replaces board-specific code to grab the die id bits.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/3f7fc062/attachment.sig>
PATCH 4/7 omap5: omap_die_id support
In reply to Paul KocialkowskiQuoted 5 lines · Paul Kocialkowski
This introduces omap5 support for
omap_die_id, which matches the commonomap_die_iddefinition. It replaces board-specific code to grab the die id bits.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/c1a79482/attachment.sig>
PATCH 5/7 omap-common: Common serial and usbethaddr functions based on die id
In reply to Paul KocialkowskiNow that we have a common prototype to grab the omap die id, functions to figure out a serial number and usb ethernet address can use it directly. Those also get an omap_die_id prefix for better consistency.
--- arch/arm/cpu/armv7/omap-common/utils.c | 49 +++++++++++++++++++--------------- arch/arm/include/asm/omap_common.h | 5 ++-- board/lge/sniper/sniper.c | 11 +------- board/ti/beagle/beagle.c | 8 ++---- board/ti/dra7xx/evm.c | 5 +--- board/ti/omap5_uevm/evm.c | 5 +--- board/ti/panda/panda.c | 4 +-- 7 files changed, 36 insertions(+), 51 deletions(-)
arch/arm/cpu/armv7/omap-common/utils.c +27 -22
@@ -46,35 +46,40 @@ __weak void omap_die_id(unsigned int *die_id) die_id[0 ] = die_id[1 ] = die_id[2 ] = die_id[3 ] =0 ; } -void __weak usb_fake_mac_from_die_id (u32 *id) +void omap_die_id_serial (void ) { -uint8_t device_mac[6 ]; +unsigned int die_id[4 ] = {0 }; +char serial_string[17 ] = {0 }; -if (!getenv ("usbethaddr" )) { -/* -* create a fake MAC address from the processor ID code. -* first byte is 0x02 to signify locally administered. -*/ - device_mac[0 ] =0x02 ; - device_mac[1 ] = id[3 ] &0xff ; - device_mac[2 ] = id[2 ] &0xff ; - device_mac[3 ] = id[1 ] &0xff ; - device_mac[4 ] = id[0 ] &0xff ; - device_mac[5 ] = (id[0 ] >>8 ) &0xff ; +omap_die_id ((unsigned int *)&die_id); -eth_setenv_enetaddr ("usbethaddr" , device_mac); +if (!getenv ("serial#" )) { +snprintf (serial_string,sizeof (serial_string), +"%08x%08x" , die_id[0 ], die_id[3 ]); + +setenv ("serial#" , serial_string); } } -void __weak usb_set_serial_num_from_die_id (u32 *id) +void omap_die_id_usbethaddr (void ) { -char serialno[72 ]; -uint32_t serialno_lo, serialno_hi; +unsigned int die_id[4 ] = {0 }; +unsigned char mac[6 ] = {0 }; -if (!getenv ("serial#" )) { - serialno_hi = id[0 ]; - serialno_lo = id[1 ]; -sprintf (serialno,"%08x%08x" , serialno_hi, serialno_lo); -setenv ("serial#" , serialno); +omap_die_id ((unsigned int *)&die_id); + +if (!getenv ("usbethaddr" )) { +/* +* Create a fake MAC address from the processor ID code. +* First byte is 0x02 to signify locally administered. +*/ + mac[0 ] =0x02 ; + mac[1 ] = die_id[3 ] &0xff ; + mac[2 ] = die_id[2 ] &0xff ; + mac[3 ] = die_id[1 ] &0xff ; + mac[4 ] = die_id[0 ] &0xff ; + mac[5 ] = (die_id[0 ] >>8 ) &0xff ; + +eth_setenv_enetaddr ("usbethaddr" , mac); } }
arch/arm/include/asm/omap_common.h +3 -2
@@ -596,8 +596,9 @@ void abb_setup(u32 fuse, u32 ldovbb, u32 setup, u32 control, u32 txdone, u32 txdone_mask, u32 opp);s8 abb_setup_ldovbb (u32 fuse,u32 ldovbb); -void usb_fake_mac_from_die_id (u32 *id); -void usb_set_serial_num_from_die_id (u32 *id); +void omap_die_id_serial (void ); +void omap_die_id_usbethaddr (void ); +void recalibrate_iodelay (void );void omap_smc1 (u32 service,u32 val);
board/lge/sniper/sniper.c +1 -10
@@ -92,8 +92,6 @@ int board_init(void)int misc_init_r (void ) {unsigned char keypad_matrix[64 ] = {0 }; -unsigned int die_id[4 ] = {0 }; -char serial_string[17 ] = {0 };char reboot_mode[2 ] = {0 };unsigned char keys[3 ];unsigned char data =0 ;
@@ -140,14 +138,7 @@ int misc_init_r(void)/* Serial number */ -omap_die_id (die_id); - -if (!getenv ("serial#" )) { -snprintf (serial_string,sizeof (serial_string), -"%08x%08x" , die_id[0 ], die_id[3 ]); - -setenv ("serial#" , serial_string); - } +omap_die_id_serial ();/* MUSB */
board/ti/beagle/beagle.c +2 -6
@@ -506,12 +506,8 @@ int misc_init_r(void)musb_register (&musb_plat, &musb_board_data, (void *)MUSB_BASE );#endif -if (generate_fake_mac) { -unsigned int die_id[4 ] = {0 }; - -omap_die_id (die_id); -usb_fake_mac_from_die_id (die_id); - } +if (generate_fake_mac) +omap_die_id_usbethaddr ();return 0 ; }
board/ti/dra7xx/evm.c +1 -4
@@ -57,15 +57,12 @@ int board_init(void)int board_late_init (void ) {#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG -unsigned int die_id[4 ] = {0 }; -if (omap_revision () ==DRA722_ES1_0 )setenv ("board_name" ,"dra72x" );else setenv ("board_name" ,"dra7xx" ); -omap_die_id (die_id); -usb_set_serial_num_from_die_id (die_id); +omap_die_id_serial ();#endif return 0 ; }
board/ti/omap5_uevm/evm.c +1 -4
@@ -112,14 +112,11 @@ static void enable_host_clocks(void)*/ int misc_init_r (void ) { -unsigned int die_id[4 ] = {0 }; -#ifdef CONFIG_PALMAS_POWER palmas_init_settings ();#endif -omap_die_id (die_id); -usb_fake_mac_from_die_id (die_id); +omap_die_id_usbethaddr ();return 0 ; }
board/ti/panda/panda.c +1 -3
@@ -209,7 +209,6 @@ int misc_init_r(void) {int phy_type;u32 auxclk, altclksrc; -unsigned int die_id[4 ] = {0 };/* EHCI is not supported on ES1.0 */ if (omap_revision () ==OMAP4430_ES1_0 )
@@ -263,8 +262,7 @@ int misc_init_r(void)writel (altclksrc, &scrm->altclksrc); -omap_die_id (die_id); -usb_fake_mac_from_die_id (die_id); +omap_die_id_usbethaddr ();return 0 ; }
Signature · 1 line
1.9.1
PATCH 5/7 omap-common: Common serial and usbethaddr functions based on die id
Quoted 5 lines · Paul Kocialkowski
Now that we have a common prototype to grab the omap die id, functions to figure out a serial number and usb ethernet address can use it directly. Those also get an
omap_die_idprefix for better consistency.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/6d7c6bcd/attachment.sig>
PATCH 5/7 omap-common: Common serial and usbethaddr functions based on die id
In reply to Paul KocialkowskiQuoted 6 lines · Paul Kocialkowski
Now that we have a common prototype to grab the omap die id, functions to figure out a serial number and usb ethernet address can use it directly. Those also get an
omap_die_idprefix for better consistency.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/e4fe3f63/attachment.sig>
PATCH 6/7 omap-common: Common function to display die id, replacing omap3-specific version
In reply to Paul KocialkowskiThis 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.
--- 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(-)
arch/arm/cpu/armv7/omap-common/utils.c +10 -0
@@ -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 ]); +}
arch/arm/cpu/armv7/omap3/board.c +1 -1
@@ -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 ; }
arch/arm/cpu/armv7/omap3/sys_info.c +0 -22
@@ -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 ******************************************/
arch/arm/include/asm/arch-omap3/sys_proto.h +0 -1
@@ -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 );
arch/arm/include/asm/omap_common.h +1 -0
@@ -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 );
board/comelit/dig297/dig297.c +1 -1
@@ -112,7 +112,7 @@ int misc_init_r(void)setup_net_chip ();#endif -dieid_num_r (); +omap_die_id_display ();return 0 ; }
board/compulab/cm_t35/cm_t35.c +1 -1
@@ -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 ; }
board/compulab/cm_t3517/cm_t3517.c +1 -1
@@ -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 ; }
board/corscience/tricorder/tricorder.c +1 -1
@@ -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 ; }
board/isee/igep00x0/igep00x0.c +1 -1
@@ -171,7 +171,7 @@ int misc_init_r(void)setup_net_chip (); -dieid_num_r (); +omap_die_id_display ();set_fdt ();
board/logicpd/am3517evm/am3517evm.c +1 -1
@@ -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 ();
board/logicpd/zoom1/zoom1.c +1 -1
@@ -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
board/matrix_vision/mvblx/mvblx.c +1 -1
@@ -71,7 +71,7 @@ int misc_init_r(void)mac_read_from_eeprom (); -dieid_num_r (); +omap_die_id_display ();return 0 ; }
board/nokia/rx51/rx51.c +1 -1
@@ -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 ();/*
board/overo/overo.c +1 -1
@@ -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" );
board/pandora/pandora.c +1 -1
@@ -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 ; }
board/technexion/tao3530/tao3530.c +1 -1
@@ -160,7 +160,7 @@ int misc_init_r(void)puts ("Unknown board revision\n" ); } -dieid_num_r (); +omap_die_id_display ();return 0 ; }
board/technexion/twister/twister.c +1 -1
@@ -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)
board/teejet/mt_ventoux/mt_ventoux.c +1 -1
@@ -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 ;
board/ti/am3517crane/am3517crane.c +1 -1
@@ -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 ; }
board/ti/beagle/beagle.c +1 -1
@@ -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 ();
board/ti/evm/evm.c +1 -1
@@ -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 ; }
board/timll/devkit8000/devkit8000.c +1 -1
@@ -114,7 +114,7 @@ int misc_init_r(void) }#endif -dieid_num_r (); +omap_die_id_display ();return 0 ; }
Signature · 1 line
1.9.1
PATCH 6/7 omap-common: Common function to display die id, replacing omap3-specific version
Quoted 5 lines · Paul Kocialkowski
This introduces
omap_die_id_displayto 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 <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/ae6c2452/attachment.sig>
PATCH 6/7 omap-common: Common function to display die id, replacing omap3-specific version
In reply to Paul KocialkowskiQuoted 6 lines · Paul Kocialkowski
This introduces
omap_die_id_displayto 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 <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/2e5253d1/attachment.sig>
PATCH 7/7 omap-common: Common get_board_serial function to pass serial through ATAG
In reply to Paul KocialkowskiSince there is a common function to grab the serial number from the die id bits, it makes sense have one to parse that serial number and feed it to the serial ATAG.
--- arch/arm/cpu/armv7/omap-common/utils.c | 18 ++++++++++++++++++ arch/arm/include/asm/omap_common.h | 1 + board/lge/sniper/sniper.c | 15 +-------------- 3 files changed, 20 insertions(+), 14 deletions(-)
arch/arm/cpu/armv7/omap-common/utils.c +18 -0
@@ -61,6 +61,24 @@ void omap_die_id_serial(void) } } +void omap_die_id_get_board_serial (struct tag_serialnr *serialnr) +{ +char *serial_string; +unsigned long long serial; + + serial_string =getenv ("serial#" ); + +if (serial_string) { + serial =simple_strtoull (serial_string,NULL ,16 ); + + serialnr->high = (unsigned int ) (serial >>32 ); + serialnr->low = (unsigned int ) (serial &0xffffffff ); + }else { + serialnr->high =0 ; + serialnr->low =0 ; + } +} +void omap_die_id_usbethaddr (void ) {unsigned int die_id[4 ] = {0 };
arch/arm/include/asm/omap_common.h +1 -0
@@ -597,6 +597,7 @@ void abb_setup(u32 fuse, u32 ldovbb, u32 setup, u32 control,s8 abb_setup_ldovbb (u32 fuse,u32 ldovbb);void omap_die_id_serial (void ); +void omap_die_id_get_board_serial (struct tag_serialnr *serialnr);void omap_die_id_usbethaddr (void );void omap_die_id_display (void );
board/lge/sniper/sniper.c +1 -14
@@ -149,20 +149,7 @@ int misc_init_r(void)void get_board_serial (struct tag_serialnr *serialnr) { -char *serial_string; -unsigned long long serial; - - serial_string =getenv ("serial#" ); - -if (serial_string) { - serial =simple_strtoull (serial_string,NULL ,16 ); - - serialnr->high = (unsigned int ) (serial >>32 ); - serialnr->low = (unsigned int ) (serial &0xffffffff ); - }else { - serialnr->high =0 ; - serialnr->low =0 ; - } +omap_die_id_get_board_serial (serialnr); }void reset_misc (void )
Signature · 1 line
1.9.1
PATCH 7/7 omap-common: Common get_board_serial function to pass serial through ATAG
Quoted 5 lines · Paul Kocialkowski
Since there is a common function to grab the serial number from the die id bits, it makes sense have one to parse that serial number and feed it to the serial ATAG.
Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/27911ae2/attachment.sig>
PATCH 7/7 omap-common: Common get_board_serial function to pass serial through ATAG
In reply to Paul KocialkowskiQuoted 6 lines · Paul Kocialkowski
Since there is a common function to grab the serial number from the die id bits, it makes sense have one to parse that serial number and feed it to the serial ATAG.
Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/58793fa7/attachment.sig>
PATCH 1/7 omap-common: Common omap_die_id definition
In reply to Paul KocialkowskiQuoted 4 lines · Paul Kocialkowski
This introduces a common definition for
omap_die_id, that aims at providing a common interface for accessing omap platform's die id bits.Signed-off-by Paul Kocialkowski <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150904/e3bdb0f7/attachment.sig>
PATCH 1/7 omap-common: Common omap_die_id definition
Hi,
Le vendredi 04 septembre 2015 ? 14:14 -0400, Tom Rini a ?crit :
Quoted 8 lines · Paul Kocialkowski
Quoted 5 lines
This introduces a common definition for
omap_die_id, that aims at providing a common interface for accessing omap platform's die id bits.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
These patches have been laying around for some time now, would you agree to merge them?
Thanks!
Signature · 17 lines
Paul Kocialkowski, Replicant developer Replicant is a fully free Android distribution running on several devices, a free software mobile operating system putting the emphasis on freedom and privacy/security. Website: https://www.replicant.us/ Blog: https://blog.replicant.us/ Wiki/tracker/forums: https://redmine.replicant.us/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150920/f4c83b66/attachment.sig>
PATCH 1/7 omap-common: Common omap_die_id definition
Quoted 8 lines · Paul Kocialkowski
Hi,
Le vendredi 04 septembre 2015 ? 14:14 -0400, Tom Rini a ?crit :
Quoted 5 lines · Paul Kocialkowski
Quoted 4 lines
This introduces a common definition for
omap_die_id, that aims at providing a common interface for accessing omap platform's die id bits.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>These patches have been laying around for some time now, would you agree to merge them?
I think that since this falls under cleanup I'm holding it until the next release is out. I took the earlier series so that the 'sniper' board works, yes? Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150922/30f98392/attachment.sig>
PATCH 1/7 omap-common: Common omap_die_id definition
Le mardi 22 septembre 2015 ? 09:06 -0400, Tom Rini a ?crit :
Quoted 11 lines · Paul Kocialkowski
Quoted 10 lines
Hi,
Le vendredi 04 septembre 2015 ? 14:14 -0400, Tom Rini a ?crit :
Quoted 7 lines · Paul Kocialkowski
Quoted 5 lines
This introduces a common definition for
omap_die_id, that aims at providing a common interface for accessing omap platform's die id bits.Signed-off-by Paul Kocialkowski <[email protected]>
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Reviewed-by Tom Rini <[email protected]>These patches have been laying around for some time now, would you agree to merge them?
I think that since this falls under cleanup I'm holding it until the next release is out. I took the earlier series so that the 'sniper' board works, yes? Thanks!
Sure, that's fine with me, sniper support is there and it doesn't require these pathces indeed.
Thanks!
Signature · 17 lines
Paul Kocialkowski, Replicant developer Replicant is a fully free Android distribution running on several devices, a free software mobile operating system putting the emphasis on freedom and privacy/security. Website: https://www.replicant.us/ Blog: https://blog.replicant.us/ Wiki/tracker/forums: https://redmine.replicant.us/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150922/7ebdf073/attachment.sig>
PATCH 1/7 omap-common: Common omap_die_id definition
In reply to Paul KocialkowskiQuoted 5 lines · Paul Kocialkowski
This introduces a common definition for
omap_die_id, that aims at providing a common interface for accessing omap platform's die id bits.Signed-off-by Paul Kocialkowski <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151022/639aff4a/attachment.sig>