2 * arch/arm/mach-ks8695/cpu.c
4 * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
5 * Copyright (C) 2006 Simtec Electronics
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/kernel.h>
25 #include <linux/module.h>
26 #include <linux/init.h>
28 #include <asm/hardware.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
33 #include <asm/arch/regs-sys.h>
34 #include <asm/arch/regs-misc.h>
37 static struct __initdata map_desc ks8695_io_desc
[] = {
39 .virtual = KS8695_IO_VA
,
40 .pfn
= __phys_to_pfn(KS8695_IO_PA
),
41 .length
= KS8695_IO_SIZE
,
46 static void __init
ks8695_processor_info(void)
48 unsigned long id
, rev
;
50 id
= __raw_readl(KS8695_MISC_VA
+ KS8695_DID
);
51 rev
= __raw_readl(KS8695_MISC_VA
+ KS8695_RID
);
53 printk("KS8695 ID=%04lx SubID=%02lx Revision=%02lx\n", (id
& DID_ID
), (rev
& RID_SUBID
), (rev
& RID_REVISION
));
56 static unsigned int sysclk
[8] = { 125000000, 100000000, 62500000, 50000000, 41700000, 33300000, 31300000, 25000000 };
57 static unsigned int cpuclk
[8] = { 166000000, 166000000, 83000000, 83000000, 55300000, 55300000, 41500000, 41500000 };
59 static void __init
ks8695_clock_info(void)
61 unsigned int scdc
= __raw_readl(KS8695_SYS_VA
+ KS8695_CLKCON
) & CLKCON_SCDC
;
63 printk("Clocks: System %u MHz, CPU %u MHz\n",
64 sysclk
[scdc
] / 1000000, cpuclk
[scdc
] / 1000000);
67 void __init
ks8695_map_io(void)
69 iotable_init(ks8695_io_desc
, ARRAY_SIZE(ks8695_io_desc
));
71 ks8695_processor_info();