Introduce a minimal cpuinfo structure to hold cache related info. The instruction/data cache size and cache line size are initialized early in the boot to default Kconfig values. They will be overwritten with data from PVR/dtb if the microblaze UCLASS_CPU driver is enabled. The cpuinfo struct was placed in global_data to allow the microblaze UCLASS_CPU driver to also run before relocation (initialized global data should be read-only before relocation). gd_cpuinfo() helper macro was added to avoid volatile "-Wdiscarded-qualifiers" warnings when using the pointer directly. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com> Link: https://lore.kernel.org/r/20220531181435.3473549-10-ovpanait@gmail.com Signed-off-by: Michal Simek <michal.simek@amd.com> (s/bralid/brlid/)
21 lines
471 B
C
21 lines
471 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2022, Ovidiu Panait <ovpanait@gmail.com>
|
|
*/
|
|
#include <common.h>
|
|
#include <asm/cpuinfo.h>
|
|
#include <asm/global_data.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
void microblaze_early_cpuinfo_init(void)
|
|
{
|
|
struct microblaze_cpuinfo *ci = gd_cpuinfo();
|
|
|
|
ci->icache_size = CONFIG_XILINX_MICROBLAZE0_ICACHE_SIZE;
|
|
ci->icache_line_length = 4;
|
|
|
|
ci->dcache_size = CONFIG_XILINX_MICROBLAZE0_DCACHE_SIZE;
|
|
ci->dcache_line_length = 4;
|
|
}
|