Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / arm / mach-bcm / kona_l2_cache.c
blob457c66e1d7aefadb4aeedc15e520003601ec9090
1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright (C) 2012-2014 Broadcom Corporation
5 #include <linux/init.h>
6 #include <linux/printk.h>
7 #include <asm/hardware/cache-l2x0.h>
9 #include "bcm_kona_smc.h"
10 #include "kona_l2_cache.h"
12 void __init kona_l2_cache_init(void)
14 unsigned int result;
15 int ret;
17 ret = bcm_kona_smc_init();
18 if (ret) {
19 pr_info("Secure API not available (%d). Skipping L2 init.\n",
20 ret);
21 return;
24 result = bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0);
25 if (result != SEC_ROM_RET_OK) {
26 pr_err("Secure Monitor call failed (%u)! Skipping L2 init.\n",
27 result);
28 return;
32 * The aux_val and aux_mask have no effect since L2 cache is already
33 * enabled. Pass 0s for aux_val and 1s for aux_mask for default value.
35 ret = l2x0_of_init(0, ~0);
36 if (ret)
37 pr_err("Couldn't enable L2 cache: %d\n", ret);