u-boot/arch/arm/mach-snapdragon
Stephan Gerhold 15dd941202 arm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr()
The logic in msm_generate_mac_addr() was originally taken from the LK
bootloader where the serial number is a string and must be parsed first.
However, in U-Boot msm_board_serial() returns an u32 and
msm_generate_mac_addr() has quite complicated code that will first
print it as a hex string and then immediately parse it again.

What this function actually does at the end is to put the serial number
encoded as big endian (the order used for the hex string) into the u8 *mac.
Use put_unaligned_be32() to do that with bit shifts instead of going
through the string format.

This should be slightly more efficient and cleaner but does not result
in any functional difference.

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-09-02 09:48:20 -04:00
..
include/mach board: dragonboard410c: Load U-Boot directly without LK 2021-07-23 18:53:45 -04:00
clock-apq8016.c mach-snapdragon: Fix UART clock flow 2018-05-26 18:19:11 -04:00
clock-apq8096.c arm: mach-snapdragon: db820c: Actually init PLL for serial 2019-01-25 12:12:55 -05:00
clock-snapdragon.c arm: snapdragon: Fix typo in clk_bcr_update() 2021-07-06 14:12:15 -04:00
clock-snapdragon.h mach-snapdragon: Fix UART clock flow 2018-05-26 18:19:11 -04:00
dram.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
Kconfig board: dragonboard410c: Load U-Boot directly without LK 2021-07-23 18:53:45 -04:00
Makefile arm: mach-snapdragon: add pinctrl driver for db820c 2019-01-25 12:12:55 -05:00
misc.c arm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr() 2021-09-02 09:48:20 -04:00
pinctrl-apq8016.c arm: mach-snapdragon: pinctrl: Place pin_name in .data section 2021-07-14 16:48:01 -04:00
pinctrl-apq8096.c arm: mach-snapdragon: pinctrl: Place pin_name in .data section 2021-07-14 16:48:01 -04:00
pinctrl-snapdragon.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
pinctrl-snapdragon.h common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sysmap-apq8016.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sysmap-apq8096.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00