Files
kernel_common_drivers/drivers/debug/debug_scrambler_ramoops.c
T
song.han 4cfbc0d9b6 debug: enable ddr scrambler key preserve [2/2]
PD#SWPL-88050

Problem:
ddr scrambler key refresh that cause lastk miss

Solution:
enable ddr scrambler key preserve when pstore init

Verify:
C3_AW419

Signed-off-by: song.han <song.han@amlogic.com>
Change-Id: I9076cae2b1533744d41eab8781f8b8a87831910e
2022-07-15 07:14:44 -07:00

40 lines
779 B
C

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
int scrambler_ramoops_init(void)
{
struct device_node *np;
struct resource res;
void __iomem *vaddr;
unsigned int val;
np = of_find_compatible_node(NULL, NULL,
"amlogic, ddr-scrambler-preserve");
if (!np)
return -ENODEV;
if (of_address_to_resource(np, 0, &res))
return -ENODEV;
vaddr = ioremap(res.start, resource_size(&res));
if (IS_ERR(vaddr))
return PTR_ERR(vaddr);
val = readl(vaddr);
val = val | 0x1;
writel(val, vaddr);
iounmap(vaddr);
pr_warn("%s preserve startup key\n", __func__);
return 0;
}