mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
ARM: rockchip: rk3288 set system serial when efuse init
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/rockchip/cpu.h>
|
||||
#include <linux/rockchip/iomap.h>
|
||||
#include <asm/system_info.h>
|
||||
#include "efuse.h"
|
||||
|
||||
#define efuse_readl(offset) readl_relaxed(RK_EFUSE_VIRT + offset)
|
||||
@@ -73,6 +75,20 @@ static int rk3288_get_leakage(int ch)
|
||||
return efuse_buf[23+ch];
|
||||
}
|
||||
|
||||
static void __init rk3288_set_system_serial(void)
|
||||
{
|
||||
int i;
|
||||
u8 buf[16];
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
buf[i] = efuse_buf[8 + (i << 1)];
|
||||
buf[i + 8] = efuse_buf[7 + (i << 1)];
|
||||
}
|
||||
|
||||
system_serial_low = crc32(0, buf, 8);
|
||||
system_serial_high = crc32(system_serial_low, buf + 8, 8);
|
||||
}
|
||||
|
||||
int rockchip_efuse_version(void)
|
||||
{
|
||||
return efuse.efuse_version;
|
||||
@@ -95,6 +111,7 @@ void __init rockchip_efuse_init(void)
|
||||
efuse.get_leakage = rk3288_get_leakage;
|
||||
efuse.efuse_version = rk3288_get_efuse_version();
|
||||
rockchip_set_cpu_version((efuse_buf[6] >> 4) & 3);
|
||||
rk3288_set_system_serial();
|
||||
} else {
|
||||
pr_err("failed to read eFuse, return %d\n", ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user