]>
Commit | Line | Data |
---|---|---|
1a59d1b8 | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
c53c9cf6 AV |
2 | /* |
3 | * arch/arm/mach-ks8695/cpu.c | |
4 | * | |
5 | * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk> | |
6 | * Copyright (C) 2006 Simtec Electronics | |
7 | * | |
8 | * KS8695 CPU support | |
c53c9cf6 AV |
9 | */ |
10 | ||
11 | #include <linux/kernel.h> | |
12 | #include <linux/module.h> | |
13 | #include <linux/init.h> | |
fced80c7 | 14 | #include <linux/io.h> |
c53c9cf6 | 15 | |
a09e64fb | 16 | #include <mach/hardware.h> |
c53c9cf6 AV |
17 | #include <asm/mach/arch.h> |
18 | #include <asm/mach/map.h> | |
19 | ||
d8b2823e | 20 | #include "regs-sys.h" |
a09e64fb | 21 | #include <mach/regs-misc.h> |
c53c9cf6 AV |
22 | |
23 | ||
6ad7313b | 24 | static struct map_desc ks8695_io_desc[] __initdata = { |
c53c9cf6 | 25 | { |
c72ecbec | 26 | .virtual = (unsigned long)KS8695_IO_VA, |
c53c9cf6 AV |
27 | .pfn = __phys_to_pfn(KS8695_IO_PA), |
28 | .length = KS8695_IO_SIZE, | |
29 | .type = MT_DEVICE, | |
30 | } | |
31 | }; | |
32 | ||
33 | static void __init ks8695_processor_info(void) | |
34 | { | |
35 | unsigned long id, rev; | |
36 | ||
37 | id = __raw_readl(KS8695_MISC_VA + KS8695_DID); | |
38 | rev = __raw_readl(KS8695_MISC_VA + KS8695_RID); | |
39 | ||
40 | printk("KS8695 ID=%04lx SubID=%02lx Revision=%02lx\n", (id & DID_ID), (rev & RID_SUBID), (rev & RID_REVISION)); | |
41 | } | |
42 | ||
43 | static unsigned int sysclk[8] = { 125000000, 100000000, 62500000, 50000000, 41700000, 33300000, 31300000, 25000000 }; | |
44 | static unsigned int cpuclk[8] = { 166000000, 166000000, 83000000, 83000000, 55300000, 55300000, 41500000, 41500000 }; | |
45 | ||
46 | static void __init ks8695_clock_info(void) | |
47 | { | |
48 | unsigned int scdc = __raw_readl(KS8695_SYS_VA + KS8695_CLKCON) & CLKCON_SCDC; | |
49 | ||
50 | printk("Clocks: System %u MHz, CPU %u MHz\n", | |
51 | sysclk[scdc] / 1000000, cpuclk[scdc] / 1000000); | |
52 | } | |
53 | ||
54 | void __init ks8695_map_io(void) | |
55 | { | |
56 | iotable_init(ks8695_io_desc, ARRAY_SIZE(ks8695_io_desc)); | |
57 | ||
58 | ks8695_processor_info(); | |
59 | ks8695_clock_info(); | |
60 | } |