aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-npcm/npcm7xx/cpu.c
blob: dd74bb9e08719812262a7d036db375f12d95c4aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (c) 2021 Nuvoton Technology Corp.
 */

#include <common.h>
#include <cpu_func.h>
#include <asm/armv7.h>
#include <asm/io.h>
#include <asm/arch/gcr.h>

int print_cpuinfo(void)
{
	struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA;
	unsigned int id, mdlr;

	mdlr = readl(&gcr->mdlr);

	printf("CPU: ");

	switch (mdlr) {
	case POLEG_NPCM750:
		printf("NPCM750 ");
		break;
	case POLEG_NPCM730:
		printf("NPCM730 ");
		break;
	case POLEG_NPCM710:
		printf("NPCM710 ");
		break;
	default:
		printf("NPCM7XX ");
		break;
	}

	id = readl(&gcr->pdid);
	switch (id) {
	case POLEG_Z1:
		printf("Z1 is no supported! @ ");
		break;
	case POLEG_A1:
		printf("A1 @ ");
		break;
	default:
		printf("Unknown\n");
		break;
	}

	return 0;
}

void s_init(void)
{
	/* Invalidate L2 cache in lowlevel_init */
	v7_outer_cache_inval_all();
}

void enable_caches(void)
{
	dcache_enable();
}

void disable_caches(void)
{
	dcache_disable();
}