Release 4.14 arch/ia64/kernel/cyclone.c
// SPDX-License-Identifier: GPL-2.0
#include <linux/module.h>
#include <linux/smp.h>
#include <linux/time.h>
#include <linux/errno.h>
#include <linux/timex.h>
#include <linux/clocksource.h>
#include <linux/io.h>
/* IBM Summit (EXA) Cyclone counter code*/
#define CYCLONE_CBAR_ADDR 0xFEB00CD0
#define CYCLONE_PMCC_OFFSET 0x51A0
#define CYCLONE_MPMC_OFFSET 0x51D0
#define CYCLONE_MPCS_OFFSET 0x51A8
#define CYCLONE_TIMER_FREQ 100000000
int use_cyclone;
void __init cyclone_setup(void)
{
use_cyclone = 1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 10 | 83.33% | 1 | 50.00% |
Björn Helgaas | 2 | 16.67% | 1 | 50.00% |
Total | 12 | 100.00% | 2 | 100.00% |
static void __iomem *cyclone_mc;
static u64 read_cyclone(struct clocksource *cs)
{
return (u64)readq((void __iomem *)cyclone_mc);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Tony Luck | 19 | 76.00% | 1 | 33.33% |
Magnus Damm | 4 | 16.00% | 1 | 33.33% |
Thomas Gleixner | 2 | 8.00% | 1 | 33.33% |
Total | 25 | 100.00% | 3 | 100.00% |
static struct clocksource clocksource_cyclone = {
.name = "cyclone",
.rating = 300,
.read = read_cyclone,
.mask = (1LL << 40) - 1,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
int __init init_cyclone_clock(void)
{
u64 __iomem *reg;
u64 base; /* saved cyclone base address */
u64 offset; /* offset from pageaddr to cyclone_timer register */
int i;
u32 __iomem *cyclone_timer; /* Cyclone MPMC0 register */
if (!use_cyclone)
return 0;
printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n");
/* find base address */
offset = (CYCLONE_CBAR_ADDR);
reg = ioremap_nocache(offset, sizeof(u64));
if(!reg){
printk(KERN_ERR "Summit chipset: Could not find valid CBAR"
" register.\n");
use_cyclone = 0;
return -ENODEV;
}
base = readq(reg);
iounmap(reg);
if(!base){
printk(KERN_ERR "Summit chipset: Could not find valid CBAR"
" value.\n");
use_cyclone = 0;
return -ENODEV;
}
/* setup PMCC */
offset = (base + CYCLONE_PMCC_OFFSET);
reg = ioremap_nocache(offset, sizeof(u64));
if(!reg){
printk(KERN_ERR "Summit chipset: Could not find valid PMCC"
" register.\n");
use_cyclone = 0;
return -ENODEV;
}
writel(0x00000001,reg);
iounmap(reg);
/* setup MPCS */
offset = (base + CYCLONE_MPCS_OFFSET);
reg = ioremap_nocache(offset, sizeof(u64));
if(!reg){
printk(KERN_ERR "Summit chipset: Could not find valid MPCS"
" register.\n");
use_cyclone = 0;
return -ENODEV;
}
writel(0x00000001,reg);
iounmap(reg);
/* map in cyclone_timer */
offset = (base + CYCLONE_MPMC_OFFSET);
cyclone_timer = ioremap_nocache(offset, sizeof(u32));
if(!cyclone_timer){
printk(KERN_ERR "Summit chipset: Could not find valid MPMC"
" register.\n");
use_cyclone = 0;
return -ENODEV;
}
/*quick test to make sure its ticking*/
for(i=0; i<3; i++){
u32 old = readl(cyclone_timer);
int stall = 100;
while(stall--) barrier();
if(readl(cyclone_timer) == old){
printk(KERN_ERR "Summit chipset: Counter not counting!"
" DISABLED\n");
iounmap(cyclone_timer);
cyclone_timer = NULL;
use_cyclone = 0;
return -ENODEV;
}
}
/* initialize last tick */
cyclone_mc = cyclone_timer;
clocksource_cyclone.archdata.fsys_mmio = cyclone_timer;
clocksource_register_hz(&clocksource_cyclone, CYCLONE_TIMER_FREQ);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 332 | 90.22% | 2 | 25.00% |
Tony Luck | 19 | 5.16% | 1 | 12.50% |
Christoph Lameter | 6 | 1.63% | 1 | 12.50% |
Julia Lawall | 5 | 1.36% | 1 | 12.50% |
Al Viro | 3 | 0.82% | 1 | 12.50% |
Andrew Lutomirski | 2 | 0.54% | 1 | 12.50% |
Björn Helgaas | 1 | 0.27% | 1 | 12.50% |
Total | 368 | 100.00% | 8 | 100.00% |
__initcall(init_cyclone_clock);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Stultz | 392 | 78.40% | 2 | 12.50% |
Tony Luck | 62 | 12.40% | 1 | 6.25% |
Christoph Lameter | 17 | 3.40% | 2 | 12.50% |
Jesse Barnes | 5 | 1.00% | 1 | 6.25% |
Julia Lawall | 5 | 1.00% | 1 | 6.25% |
Magnus Damm | 4 | 0.80% | 1 | 6.25% |
Al Viro | 3 | 0.60% | 1 | 6.25% |
Björn Helgaas | 3 | 0.60% | 2 | 12.50% |
Tim Schmielau | 3 | 0.60% | 1 | 6.25% |
Andrew Lutomirski | 2 | 0.40% | 1 | 6.25% |
Thomas Gleixner | 2 | 0.40% | 1 | 6.25% |
Dan J Williams | 1 | 0.20% | 1 | 6.25% |
Greg Kroah-Hartman | 1 | 0.20% | 1 | 6.25% |
Total | 500 | 100.00% | 16 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.