From 04825384999f81c08e820fe380e95b6325352a6d Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Mon, 12 Aug 2019 17:04:34 +0200 Subject: rockchip: rk3399: derive ethaddr from cpuid Generate a MAC address based on the cpuid available in the efuse block: Use the first 6 byte of the cpuid's SHA256 hash and set the locally administered bits. Also ensure that the multicast bit is cleared. The MAC address is only generated and set if there is no ethaddr present in the saved environment. This is based off of Klaus Goger's work in 8adc9d Signed-off-by: Rohan Garg Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/misc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/misc.h (limited to 'arch/arm/include/asm/arch-rockchip/misc.h') diff --git a/arch/arm/include/asm/arch-rockchip/misc.h b/arch/arm/include/asm/arch-rockchip/misc.h new file mode 100644 index 0000000000..b6b03c934e --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/misc.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * RK3399: Architecture common definitions + * + * Copyright (C) 2019 Collabora Inc - https://www.collabora.com/ + * Rohan Garg + */ + +int rockchip_cpuid_from_efuse(const u32 cpuid_offset, + const u32 cpuid_length, + u8 *cpuid); +int rockchip_cpuid_set(const u8 *cpuid, const u32 cpuid_length); +int rockchip_setup_macaddr(void); -- cgit