Skip to content

Commit 119865e

Browse files
yihsin-hungjamess-huang
authored andcommitted
Revert "Assign the Serial and Revision vaule of CPU from efuse"
This reverts commit e2adc14. Change-Id: I1d9482e45c0eaf089d6fbd55c8d822810cb6562c Signed-off-by: yi-hsin_hung <yi-hsin_hung@asus.com> Reviewed-on: https://tp-biosrd-v02/gerrit/80048 Reviewed-by: Jamess Huang(黃以民) <Jamess_Huang@asus.com> Tested-by: Jamess Huang(黃以民) <Jamess_Huang@asus.com>
1 parent a7dff68 commit 119865e

2 files changed

Lines changed: 0 additions & 68 deletions

File tree

drivers/cpufreq/cpufreq-dt.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <linux/regulator/consumer.h>
3030
#include <linux/slab.h>
3131
#include <linux/thermal.h>
32-
#include <asm/system_info.h>
3332

3433
#define MAX_PROP_NAME_LEN 6
3534
#define VERSION_ELEMENTS 1
@@ -120,9 +119,6 @@ static int set_opp_info(struct device *dev)
120119
chip_vesion = 0;
121120
apll_safefreq = SAFE_FREQ;
122121
}
123-
124-
system_rev = (unsigned int)(package_info & 0xf0);
125-
126122
snprintf(name, MAX_PROP_NAME_LEN, "v%d", chip_vesion);
127123
ret = dev_pm_opp_set_prop_name(dev, name);
128124
if (ret) {

drivers/nvmem/rockchip-efuse.c

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#include <linux/slab.h>
2424
#include <linux/of.h>
2525
#include <linux/platform_device.h>
26-
#include <asm/system_info.h>
27-
#include <linux/crc32.h>
2826

2927
#define EFUSE_A_SHIFT 6
3028
#define EFUSE_A_MASK 0x3ff
@@ -96,64 +94,6 @@ static const struct of_device_id rockchip_efuse_match[] = {
9694
};
9795
MODULE_DEVICE_TABLE(of, rockchip_efuse_match);
9896

99-
static u8 efuse_buf[32] = {};
100-
static int rockchip_efuse_serial_number(struct rockchip_efuse_chip *efuse, u8 *efuse_buf)
101-
{
102-
u8 *buf = efuse_buf;
103-
int ret;
104-
size_t bytes = 32;
105-
unsigned int offset = 0;
106-
107-
ret = clk_prepare_enable(efuse->clk);
108-
if (ret < 0) {
109-
dev_err(efuse->dev, "failed to prepare/enable efuse clk\n");
110-
return ret;
111-
}
112-
113-
dump_stack();
114-
115-
writel(EFUSE_LOAD | EFUSE_PGENB, efuse->base + REG_EFUSE_CTRL);
116-
udelay(1);
117-
while (bytes--) {
118-
writel(readl(efuse->base + REG_EFUSE_CTRL) &
119-
(~(EFUSE_A_MASK << EFUSE_A_SHIFT)),
120-
efuse->base + REG_EFUSE_CTRL);
121-
writel(readl(efuse->base + REG_EFUSE_CTRL) |
122-
((offset++ & EFUSE_A_MASK) << EFUSE_A_SHIFT),
123-
efuse->base + REG_EFUSE_CTRL);
124-
udelay(1);
125-
writel(readl(efuse->base + REG_EFUSE_CTRL) |
126-
EFUSE_STROBE, efuse->base + REG_EFUSE_CTRL);
127-
udelay(1);
128-
*buf++ = readb(efuse->base + REG_EFUSE_DOUT);
129-
writel(readl(efuse->base + REG_EFUSE_CTRL) &
130-
(~EFUSE_STROBE), efuse->base + REG_EFUSE_CTRL);
131-
udelay(1);
132-
}
133-
134-
135-
writel(EFUSE_PGENB | EFUSE_CSB, efuse->base + REG_EFUSE_CTRL);
136-
137-
clk_disable_unprepare(efuse->clk);
138-
139-
return 0;
140-
}
141-
142-
static void __init rockchip_efuse_set_system_serial(void)
143-
{
144-
int i;
145-
u8 buf[16];
146-
147-
for (i = 0; i < 8; i++) {
148-
buf[i] = efuse_buf[8 + (i << 1)];
149-
buf[i + 8] = efuse_buf[7 + (i << 1)];
150-
}
151-
152-
system_serial_low = crc32(0, buf, 8);
153-
system_serial_high = crc32(system_serial_low, buf + 8, 8);
154-
}
155-
156-
15797
static int __init rockchip_efuse_probe(struct platform_device *pdev)
15898
{
15999
struct resource *res;
@@ -185,10 +125,6 @@ static int __init rockchip_efuse_probe(struct platform_device *pdev)
185125

186126
platform_set_drvdata(pdev, nvmem);
187127

188-
rockchip_efuse_serial_number(efuse, efuse_buf);
189-
190-
rockchip_efuse_set_system_serial();
191-
192128
return 0;
193129
}
194130

0 commit comments

Comments
 (0)