xref: /linux/arch/parisc/kernel/processor.c (revision f8b9e594)
11da177e4SLinus Torvalds /*    $Id: processor.c,v 1.1 2002/07/20 16:27:06 rhirst Exp $
21da177e4SLinus Torvalds  *
31da177e4SLinus Torvalds  *    Initial setup-routines for HP 9000 based hardware.
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  *    Copyright (C) 1991, 1992, 1995  Linus Torvalds
61da177e4SLinus Torvalds  *    Modifications for PA-RISC (C) 1999 Helge Deller <deller@gmx.de>
71da177e4SLinus Torvalds  *    Modifications copyright 1999 SuSE GmbH (Philipp Rumpf)
81da177e4SLinus Torvalds  *    Modifications copyright 2000 Martin K. Petersen <mkp@mkp.net>
91da177e4SLinus Torvalds  *    Modifications copyright 2000 Philipp Rumpf <prumpf@tux.org>
101da177e4SLinus Torvalds  *    Modifications copyright 2001 Ryan Bradetich <rbradetich@uswest.net>
111da177e4SLinus Torvalds  *
121da177e4SLinus Torvalds  *    Initial PA-RISC Version: 04-23-1999 by Helge Deller
131da177e4SLinus Torvalds  *
141da177e4SLinus Torvalds  *    This program is free software; you can redistribute it and/or modify
151da177e4SLinus Torvalds  *    it under the terms of the GNU General Public License as published by
161da177e4SLinus Torvalds  *    the Free Software Foundation; either version 2, or (at your option)
171da177e4SLinus Torvalds  *    any later version.
181da177e4SLinus Torvalds  *
191da177e4SLinus Torvalds  *    This program is distributed in the hope that it will be useful,
201da177e4SLinus Torvalds  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
211da177e4SLinus Torvalds  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
221da177e4SLinus Torvalds  *    GNU General Public License for more details.
231da177e4SLinus Torvalds  *
241da177e4SLinus Torvalds  *    You should have received a copy of the GNU General Public License
251da177e4SLinus Torvalds  *    along with this program; if not, write to the Free Software
261da177e4SLinus Torvalds  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
271da177e4SLinus Torvalds  *
281da177e4SLinus Torvalds  */
291da177e4SLinus Torvalds #include <linux/delay.h>
301da177e4SLinus Torvalds #include <linux/init.h>
311da177e4SLinus Torvalds #include <linux/mm.h>
321da177e4SLinus Torvalds #include <linux/module.h>
331da177e4SLinus Torvalds #include <linux/seq_file.h>
341da177e4SLinus Torvalds #include <linux/slab.h>
351da177e4SLinus Torvalds #include <linux/cpu.h>
36e8edc6e0SAlexey Dobriyan #include <asm/param.h>
371da177e4SLinus Torvalds #include <asm/cache.h>
381da177e4SLinus Torvalds #include <asm/hardware.h>	/* for register_parisc_driver() stuff */
391da177e4SLinus Torvalds #include <asm/processor.h>
401da177e4SLinus Torvalds #include <asm/page.h>
411da177e4SLinus Torvalds #include <asm/pdc.h>
421da177e4SLinus Torvalds #include <asm/pdcpat.h>
431da177e4SLinus Torvalds #include <asm/irq.h>		/* for struct irq_region */
441da177e4SLinus Torvalds #include <asm/parisc-device.h>
451da177e4SLinus Torvalds 
468039de10SHelge Deller struct system_cpuinfo_parisc boot_cpu_data __read_mostly;
471da177e4SLinus Torvalds EXPORT_SYMBOL(boot_cpu_data);
481da177e4SLinus Torvalds 
498039de10SHelge Deller struct cpuinfo_parisc cpu_data[NR_CPUS] __read_mostly;
501da177e4SLinus Torvalds 
5101363220SKyle McMartin extern int update_cr16_clocksource(void);	/* from time.c */
5201363220SKyle McMartin 
531da177e4SLinus Torvalds /*
541da177e4SLinus Torvalds **  	PARISC CPU driver - claim "device" and initialize CPU data structures.
551da177e4SLinus Torvalds **
561da177e4SLinus Torvalds ** Consolidate per CPU initialization into (mostly) one module.
571da177e4SLinus Torvalds ** Monarch CPU will initialize boot_cpu_data which shouldn't
581da177e4SLinus Torvalds ** change once the system has booted.
591da177e4SLinus Torvalds **
601da177e4SLinus Torvalds ** The callback *should* do per-instance initialization of
611da177e4SLinus Torvalds ** everything including the monarch. "Per CPU" init code in
621da177e4SLinus Torvalds ** setup.c:start_parisc() has migrated here and start_parisc()
631da177e4SLinus Torvalds ** will call register_parisc_driver(&cpu_driver) before calling do_inventory().
641da177e4SLinus Torvalds **
651da177e4SLinus Torvalds ** The goal of consolidating CPU initialization into one place is
667022672eSSimon Arlott ** to make sure all CPUs get initialized the same way.
671da177e4SLinus Torvalds ** The code path not shared is how PDC hands control of the CPU to the OS.
681da177e4SLinus Torvalds ** The initialization of OS data structures is the same (done below).
691da177e4SLinus Torvalds */
701da177e4SLinus Torvalds 
711da177e4SLinus Torvalds /**
721da177e4SLinus Torvalds  * processor_probe - Determine if processor driver should claim this device.
731da177e4SLinus Torvalds  * @dev: The device which has been found.
741da177e4SLinus Torvalds  *
751da177e4SLinus Torvalds  * Determine if processor driver should claim this chip (return 0) or not
761da177e4SLinus Torvalds  * (return 1).  If so, initialize the chip and tell other partners in crime
771da177e4SLinus Torvalds  * they have work to do.
781da177e4SLinus Torvalds  */
79e9541d0cSHelge Deller static int __cpuinit processor_probe(struct parisc_device *dev)
801da177e4SLinus Torvalds {
811da177e4SLinus Torvalds 	unsigned long txn_addr;
821da177e4SLinus Torvalds 	unsigned long cpuid;
831da177e4SLinus Torvalds 	struct cpuinfo_parisc *p;
841da177e4SLinus Torvalds 
85*f8b9e594SKyle McMartin #ifdef CONFIG_SMP
86*f8b9e594SKyle McMartin 	if (num_online_cpus() >= NR_CPUS) {
87*f8b9e594SKyle McMartin 		printk(KERN_INFO "num_online_cpus() >= NR_CPUS\n");
88*f8b9e594SKyle McMartin 		return 1;
89*f8b9e594SKyle McMartin 	}
90*f8b9e594SKyle McMartin #else
911da177e4SLinus Torvalds 	if (boot_cpu_data.cpu_count > 0) {
921da177e4SLinus Torvalds 		printk(KERN_INFO "CONFIG_SMP=n  ignoring additional CPUs\n");
931da177e4SLinus Torvalds 		return 1;
941da177e4SLinus Torvalds 	}
951da177e4SLinus Torvalds #endif
961da177e4SLinus Torvalds 
971da177e4SLinus Torvalds 	/* logical CPU ID and update global counter
981da177e4SLinus Torvalds 	 * May get overwritten by PAT code.
991da177e4SLinus Torvalds 	 */
1001da177e4SLinus Torvalds 	cpuid = boot_cpu_data.cpu_count;
10153f01bbaSMatthew Wilcox 	txn_addr = dev->hpa.start;	/* for legacy PDC */
1021da177e4SLinus Torvalds 
103a8f44e38SHelge Deller #ifdef CONFIG_64BIT
1041da177e4SLinus Torvalds 	if (is_pdc_pat()) {
1051da177e4SLinus Torvalds 		ulong status;
1061da177e4SLinus Torvalds 		unsigned long bytecnt;
1071da177e4SLinus Torvalds 	        pdc_pat_cell_mod_maddr_block_t pa_pdc_cell;
1081da177e4SLinus Torvalds #undef USE_PAT_CPUID
1091da177e4SLinus Torvalds #ifdef USE_PAT_CPUID
1101da177e4SLinus Torvalds 		struct pdc_pat_cpu_num cpu_info;
1111da177e4SLinus Torvalds #endif
1121da177e4SLinus Torvalds 
1131da177e4SLinus Torvalds 		status = pdc_pat_cell_module(&bytecnt, dev->pcell_loc,
1141da177e4SLinus Torvalds 			dev->mod_index, PA_VIEW, &pa_pdc_cell);
1151da177e4SLinus Torvalds 
1161da177e4SLinus Torvalds 		BUG_ON(PDC_OK != status);
1171da177e4SLinus Torvalds 
1181da177e4SLinus Torvalds 		/* verify it's the same as what do_pat_inventory() found */
1191da177e4SLinus Torvalds 		BUG_ON(dev->mod_info != pa_pdc_cell.mod_info);
1201da177e4SLinus Torvalds 		BUG_ON(dev->pmod_loc != pa_pdc_cell.mod_location);
1211da177e4SLinus Torvalds 
1221da177e4SLinus Torvalds 		txn_addr = pa_pdc_cell.mod[0];   /* id_eid for IO sapic */
1231da177e4SLinus Torvalds 
1241da177e4SLinus Torvalds #ifdef USE_PAT_CPUID
1251da177e4SLinus Torvalds /* We need contiguous numbers for cpuid. Firmware's notion
1261da177e4SLinus Torvalds  * of cpuid is for physical CPUs and we just don't care yet.
1271da177e4SLinus Torvalds  * We'll care when we need to query PAT PDC about a CPU *after*
1281da177e4SLinus Torvalds  * boot time (ie shutdown a CPU from an OS perspective).
1291da177e4SLinus Torvalds  */
1301da177e4SLinus Torvalds 		/* get the cpu number */
13153f01bbaSMatthew Wilcox 		status = pdc_pat_cpu_get_number(&cpu_info, dev->hpa.start);
1321da177e4SLinus Torvalds 
1331da177e4SLinus Torvalds 		BUG_ON(PDC_OK != status);
1341da177e4SLinus Torvalds 
1351da177e4SLinus Torvalds 		if (cpu_info.cpu_num >= NR_CPUS) {
1361da177e4SLinus Torvalds 			printk(KERN_WARNING "IGNORING CPU at 0x%x,"
1371da177e4SLinus Torvalds 				" cpu_slot_id > NR_CPUS"
1381da177e4SLinus Torvalds 				" (%ld > %d)\n",
13953f01bbaSMatthew Wilcox 				dev->hpa.start, cpu_info.cpu_num, NR_CPUS);
1401da177e4SLinus Torvalds 			/* Ignore CPU since it will only crash */
1411da177e4SLinus Torvalds 			boot_cpu_data.cpu_count--;
1421da177e4SLinus Torvalds 			return 1;
1431da177e4SLinus Torvalds 		} else {
1441da177e4SLinus Torvalds 			cpuid = cpu_info.cpu_num;
1451da177e4SLinus Torvalds 		}
1461da177e4SLinus Torvalds #endif
1471da177e4SLinus Torvalds 	}
1481da177e4SLinus Torvalds #endif
1491da177e4SLinus Torvalds 
1501da177e4SLinus Torvalds 	p = &cpu_data[cpuid];
1511da177e4SLinus Torvalds 	boot_cpu_data.cpu_count++;
1521da177e4SLinus Torvalds 
1537908a0c7SGrant Grundler 	/* initialize counters - CPU 0 gets it_value set in time_init() */
1547908a0c7SGrant Grundler 	if (cpuid)
1551da177e4SLinus Torvalds 		memset(p, 0, sizeof(struct cpuinfo_parisc));
1561da177e4SLinus Torvalds 
1571da177e4SLinus Torvalds 	p->loops_per_jiffy = loops_per_jiffy;
1581da177e4SLinus Torvalds 	p->dev = dev;		/* Save IODC data in case we need it */
15953f01bbaSMatthew Wilcox 	p->hpa = dev->hpa.start;	/* save CPU hpa */
1601da177e4SLinus Torvalds 	p->cpuid = cpuid;	/* save CPU id */
1611da177e4SLinus Torvalds 	p->txn_addr = txn_addr;	/* save CPU IRQ address */
1621da177e4SLinus Torvalds #ifdef CONFIG_SMP
1631da177e4SLinus Torvalds 	/*
1641da177e4SLinus Torvalds 	** FIXME: review if any other initialization is clobbered
1651da177e4SLinus Torvalds 	**	for boot_cpu by the above memset().
1661da177e4SLinus Torvalds 	*/
1671da177e4SLinus Torvalds 
1681da177e4SLinus Torvalds 	/* stolen from init_percpu_prof() */
1691da177e4SLinus Torvalds 	cpu_data[cpuid].prof_counter = 1;
1701da177e4SLinus Torvalds 	cpu_data[cpuid].prof_multiplier = 1;
1711da177e4SLinus Torvalds #endif
1721da177e4SLinus Torvalds 
1731da177e4SLinus Torvalds 	/*
1747022672eSSimon Arlott 	** CONFIG_SMP: init_smp_config() will attempt to get CPUs into
1751da177e4SLinus Torvalds 	** OS control. RENDEZVOUS is the default state - see mem_set above.
1761da177e4SLinus Torvalds 	**	p->state = STATE_RENDEZVOUS;
1771da177e4SLinus Torvalds 	*/
1781da177e4SLinus Torvalds 
1791da177e4SLinus Torvalds #if 0
1801da177e4SLinus Torvalds 	/* CPU 0 IRQ table is statically allocated/initialized */
1811da177e4SLinus Torvalds 	if (cpuid) {
1821da177e4SLinus Torvalds 		struct irqaction actions[];
1831da177e4SLinus Torvalds 
1841da177e4SLinus Torvalds 		/*
1851da177e4SLinus Torvalds 		** itimer and ipi IRQ handlers are statically initialized in
1861da177e4SLinus Torvalds 		** arch/parisc/kernel/irq.c. ie Don't need to register them.
1871da177e4SLinus Torvalds 		*/
1881da177e4SLinus Torvalds 		actions = kmalloc(sizeof(struct irqaction)*MAX_CPU_IRQ, GFP_ATOMIC);
1891da177e4SLinus Torvalds 		if (!actions) {
1901da177e4SLinus Torvalds 			/* not getting it's own table, share with monarch */
1911da177e4SLinus Torvalds 			actions = cpu_irq_actions[0];
1921da177e4SLinus Torvalds 		}
1931da177e4SLinus Torvalds 
1941da177e4SLinus Torvalds 		cpu_irq_actions[cpuid] = actions;
1951da177e4SLinus Torvalds 	}
1961da177e4SLinus Torvalds #endif
1971da177e4SLinus Torvalds 
1981da177e4SLinus Torvalds 	/*
1991da177e4SLinus Torvalds 	 * Bring this CPU up now! (ignore bootstrap cpuid == 0)
2001da177e4SLinus Torvalds 	 */
2011da177e4SLinus Torvalds #ifdef CONFIG_SMP
2021da177e4SLinus Torvalds 	if (cpuid) {
2031da177e4SLinus Torvalds 		cpu_set(cpuid, cpu_present_map);
2041da177e4SLinus Torvalds 		cpu_up(cpuid);
2051da177e4SLinus Torvalds 	}
2061da177e4SLinus Torvalds #endif
2071da177e4SLinus Torvalds 
20801363220SKyle McMartin 	/* If we've registered more than one cpu,
20901363220SKyle McMartin 	 * we'll use the jiffies clocksource since cr16
21001363220SKyle McMartin 	 * is not synchronized between CPUs.
21101363220SKyle McMartin 	 */
21201363220SKyle McMartin 	update_cr16_clocksource();
21301363220SKyle McMartin 
2141da177e4SLinus Torvalds 	return 0;
2151da177e4SLinus Torvalds }
2161da177e4SLinus Torvalds 
2171da177e4SLinus Torvalds /**
2181da177e4SLinus Torvalds  * collect_boot_cpu_data - Fill the boot_cpu_data structure.
2191da177e4SLinus Torvalds  *
2201da177e4SLinus Torvalds  * This function collects and stores the generic processor information
2211da177e4SLinus Torvalds  * in the boot_cpu_data structure.
2221da177e4SLinus Torvalds  */
2231da177e4SLinus Torvalds void __init collect_boot_cpu_data(void)
2241da177e4SLinus Torvalds {
2251da177e4SLinus Torvalds 	memset(&boot_cpu_data, 0, sizeof(boot_cpu_data));
2261da177e4SLinus Torvalds 
2271da177e4SLinus Torvalds 	boot_cpu_data.cpu_hz = 100 * PAGE0->mem_10msec; /* Hz of this PARISC */
2281da177e4SLinus Torvalds 
2291da177e4SLinus Torvalds 	/* get CPU-Model Information... */
2301da177e4SLinus Torvalds #define p ((unsigned long *)&boot_cpu_data.pdc.model)
2311da177e4SLinus Torvalds 	if (pdc_model_info(&boot_cpu_data.pdc.model) == PDC_OK)
2321da177e4SLinus Torvalds 		printk(KERN_INFO
2331da177e4SLinus Torvalds 			"model %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
2341da177e4SLinus Torvalds 			p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]);
2351da177e4SLinus Torvalds #undef p
2361da177e4SLinus Torvalds 
2371da177e4SLinus Torvalds 	if (pdc_model_versions(&boot_cpu_data.pdc.versions, 0) == PDC_OK)
2381da177e4SLinus Torvalds 		printk(KERN_INFO "vers  %08lx\n",
2391da177e4SLinus Torvalds 			boot_cpu_data.pdc.versions);
2401da177e4SLinus Torvalds 
2411da177e4SLinus Torvalds 	if (pdc_model_cpuid(&boot_cpu_data.pdc.cpuid) == PDC_OK)
2421da177e4SLinus Torvalds 		printk(KERN_INFO "CPUID vers %ld rev %ld (0x%08lx)\n",
2431da177e4SLinus Torvalds 			(boot_cpu_data.pdc.cpuid >> 5) & 127,
2441da177e4SLinus Torvalds 			boot_cpu_data.pdc.cpuid & 31,
2451da177e4SLinus Torvalds 			boot_cpu_data.pdc.cpuid);
2461da177e4SLinus Torvalds 
2471da177e4SLinus Torvalds 	if (pdc_model_capabilities(&boot_cpu_data.pdc.capabilities) == PDC_OK)
2481da177e4SLinus Torvalds 		printk(KERN_INFO "capabilities 0x%lx\n",
2491da177e4SLinus Torvalds 			boot_cpu_data.pdc.capabilities);
2501da177e4SLinus Torvalds 
2511da177e4SLinus Torvalds 	if (pdc_model_sysmodel(boot_cpu_data.pdc.sys_model_name) == PDC_OK)
2521da177e4SLinus Torvalds 		printk(KERN_INFO "model %s\n",
2531da177e4SLinus Torvalds 			boot_cpu_data.pdc.sys_model_name);
2541da177e4SLinus Torvalds 
2551da177e4SLinus Torvalds 	boot_cpu_data.hversion =  boot_cpu_data.pdc.model.hversion;
2561da177e4SLinus Torvalds 	boot_cpu_data.sversion =  boot_cpu_data.pdc.model.sversion;
2571da177e4SLinus Torvalds 
2581da177e4SLinus Torvalds 	boot_cpu_data.cpu_type = parisc_get_cpu_type(boot_cpu_data.hversion);
2591da177e4SLinus Torvalds 	boot_cpu_data.cpu_name = cpu_name_version[boot_cpu_data.cpu_type][0];
2601da177e4SLinus Torvalds 	boot_cpu_data.family_name = cpu_name_version[boot_cpu_data.cpu_type][1];
2611da177e4SLinus Torvalds }
2621da177e4SLinus Torvalds 
2631da177e4SLinus Torvalds 
2641da177e4SLinus Torvalds /**
2651da177e4SLinus Torvalds  * init_cpu_profiler - enable/setup per cpu profiling hooks.
2661da177e4SLinus Torvalds  * @cpunum: The processor instance.
2671da177e4SLinus Torvalds  *
2681da177e4SLinus Torvalds  * FIXME: doesn't do much yet...
2691da177e4SLinus Torvalds  */
2701da177e4SLinus Torvalds static inline void __init
2711da177e4SLinus Torvalds init_percpu_prof(int cpunum)
2721da177e4SLinus Torvalds {
2731da177e4SLinus Torvalds 	cpu_data[cpunum].prof_counter = 1;
2741da177e4SLinus Torvalds 	cpu_data[cpunum].prof_multiplier = 1;
2751da177e4SLinus Torvalds }
2761da177e4SLinus Torvalds 
2771da177e4SLinus Torvalds 
2781da177e4SLinus Torvalds /**
2791da177e4SLinus Torvalds  * init_per_cpu - Handle individual processor initializations.
2801da177e4SLinus Torvalds  * @cpunum: logical processor number.
2811da177e4SLinus Torvalds  *
2821da177e4SLinus Torvalds  * This function handles initialization for *every* CPU
2831da177e4SLinus Torvalds  * in the system:
2841da177e4SLinus Torvalds  *
2851da177e4SLinus Torvalds  * o Set "default" CPU width for trap handlers
2861da177e4SLinus Torvalds  *
2871da177e4SLinus Torvalds  * o Enable FP coprocessor
2881da177e4SLinus Torvalds  *   REVISIT: this could be done in the "code 22" trap handler.
2891da177e4SLinus Torvalds  *	(frowands idea - that way we know which processes need FP
2901da177e4SLinus Torvalds  *	registers saved on the interrupt stack.)
2911da177e4SLinus Torvalds  *   NEWS FLASH: wide kernels need FP coprocessor enabled to handle
2921da177e4SLinus Torvalds  *	formatted printing of %lx for example (double divides I think)
2931da177e4SLinus Torvalds  *
2941da177e4SLinus Torvalds  * o Enable CPU profiling hooks.
2951da177e4SLinus Torvalds  */
2961da177e4SLinus Torvalds int __init init_per_cpu(int cpunum)
2971da177e4SLinus Torvalds {
2981da177e4SLinus Torvalds 	int ret;
2991da177e4SLinus Torvalds 	struct pdc_coproc_cfg coproc_cfg;
3001da177e4SLinus Torvalds 
3011da177e4SLinus Torvalds 	set_firmware_width();
3021da177e4SLinus Torvalds 	ret = pdc_coproc_cfg(&coproc_cfg);
3031da177e4SLinus Torvalds 
3041da177e4SLinus Torvalds 	if(ret >= 0 && coproc_cfg.ccr_functional) {
3051da177e4SLinus Torvalds 		mtctl(coproc_cfg.ccr_functional, 10);  /* 10 == Coprocessor Control Reg */
3061da177e4SLinus Torvalds 
3071da177e4SLinus Torvalds 		/* FWIW, FP rev/model is a more accurate way to determine
3081da177e4SLinus Torvalds 		** CPU type. CPU rev/model has some ambiguous cases.
3091da177e4SLinus Torvalds 		*/
3101da177e4SLinus Torvalds 		cpu_data[cpunum].fp_rev = coproc_cfg.revision;
3111da177e4SLinus Torvalds 		cpu_data[cpunum].fp_model = coproc_cfg.model;
3121da177e4SLinus Torvalds 
3131da177e4SLinus Torvalds 		printk(KERN_INFO  "FP[%d] enabled: Rev %ld Model %ld\n",
3141da177e4SLinus Torvalds 			cpunum, coproc_cfg.revision, coproc_cfg.model);
3151da177e4SLinus Torvalds 
3161da177e4SLinus Torvalds 		/*
3171da177e4SLinus Torvalds 		** store status register to stack (hopefully aligned)
3181da177e4SLinus Torvalds 		** and clear the T-bit.
3191da177e4SLinus Torvalds 		*/
3201da177e4SLinus Torvalds 		asm volatile ("fstd    %fr0,8(%sp)");
3211da177e4SLinus Torvalds 
3221da177e4SLinus Torvalds 	} else {
3231da177e4SLinus Torvalds 		printk(KERN_WARNING  "WARNING: No FP CoProcessor?!"
3241da177e4SLinus Torvalds 			" (coproc_cfg.ccr_functional == 0x%lx, expected 0xc0)\n"
325a8f44e38SHelge Deller #ifdef CONFIG_64BIT
3261da177e4SLinus Torvalds 			"Halting Machine - FP required\n"
3271da177e4SLinus Torvalds #endif
3281da177e4SLinus Torvalds 			, coproc_cfg.ccr_functional);
329a8f44e38SHelge Deller #ifdef CONFIG_64BIT
3301da177e4SLinus Torvalds 		mdelay(100);	/* previous chars get pushed to console */
3311da177e4SLinus Torvalds 		panic("FP CoProc not reported");
3321da177e4SLinus Torvalds #endif
3331da177e4SLinus Torvalds 	}
3341da177e4SLinus Torvalds 
3351da177e4SLinus Torvalds 	/* FUTURE: Enable Performance Monitor : ccr bit 0x20 */
3361da177e4SLinus Torvalds 	init_percpu_prof(cpunum);
3371da177e4SLinus Torvalds 
3381da177e4SLinus Torvalds 	return ret;
3391da177e4SLinus Torvalds }
3401da177e4SLinus Torvalds 
3411da177e4SLinus Torvalds /*
3427022672eSSimon Arlott  * Display CPU info for all CPUs.
3431da177e4SLinus Torvalds  */
3441da177e4SLinus Torvalds int
3451da177e4SLinus Torvalds show_cpuinfo (struct seq_file *m, void *v)
3461da177e4SLinus Torvalds {
3471da177e4SLinus Torvalds 	int	n;
3481da177e4SLinus Torvalds 
3491da177e4SLinus Torvalds 	for(n=0; n<boot_cpu_data.cpu_count; n++) {
3501da177e4SLinus Torvalds #ifdef CONFIG_SMP
3511da177e4SLinus Torvalds 		if (0 == cpu_data[n].hpa)
3521da177e4SLinus Torvalds 			continue;
3531da177e4SLinus Torvalds #endif
3541da177e4SLinus Torvalds 		seq_printf(m, "processor\t: %d\n"
3551da177e4SLinus Torvalds 				"cpu family\t: PA-RISC %s\n",
3561da177e4SLinus Torvalds 				 n, boot_cpu_data.family_name);
3571da177e4SLinus Torvalds 
3581da177e4SLinus Torvalds 		seq_printf(m, "cpu\t\t: %s\n",  boot_cpu_data.cpu_name );
3591da177e4SLinus Torvalds 
3601da177e4SLinus Torvalds 		/* cpu MHz */
3611da177e4SLinus Torvalds 		seq_printf(m, "cpu MHz\t\t: %d.%06d\n",
3621da177e4SLinus Torvalds 				 boot_cpu_data.cpu_hz / 1000000,
3631da177e4SLinus Torvalds 				 boot_cpu_data.cpu_hz % 1000000  );
3641da177e4SLinus Torvalds 
3651da177e4SLinus Torvalds 		seq_printf(m, "model\t\t: %s\n"
3661da177e4SLinus Torvalds 				"model name\t: %s\n",
3671da177e4SLinus Torvalds 				 boot_cpu_data.pdc.sys_model_name,
3681da177e4SLinus Torvalds 				 cpu_data[n].dev ?
3691da177e4SLinus Torvalds 				 cpu_data[n].dev->name : "Unknown" );
3701da177e4SLinus Torvalds 
3711da177e4SLinus Torvalds 		seq_printf(m, "hversion\t: 0x%08x\n"
3721da177e4SLinus Torvalds 			        "sversion\t: 0x%08x\n",
3731da177e4SLinus Torvalds 				 boot_cpu_data.hversion,
3741da177e4SLinus Torvalds 				 boot_cpu_data.sversion );
3751da177e4SLinus Torvalds 
3761da177e4SLinus Torvalds 		/* print cachesize info */
3771da177e4SLinus Torvalds 		show_cache_info(m);
3781da177e4SLinus Torvalds 
3791da177e4SLinus Torvalds 		seq_printf(m, "bogomips\t: %lu.%02lu\n",
3801da177e4SLinus Torvalds 			     cpu_data[n].loops_per_jiffy / (500000 / HZ),
3811da177e4SLinus Torvalds 			     (cpu_data[n].loops_per_jiffy / (5000 / HZ)) % 100);
3821da177e4SLinus Torvalds 
3831da177e4SLinus Torvalds 		seq_printf(m, "software id\t: %ld\n\n",
3841da177e4SLinus Torvalds 				boot_cpu_data.pdc.model.sw_id);
3851da177e4SLinus Torvalds 	}
3861da177e4SLinus Torvalds 	return 0;
3871da177e4SLinus Torvalds }
3881da177e4SLinus Torvalds 
389e9541d0cSHelge Deller static const struct parisc_device_id processor_tbl[] = {
3901da177e4SLinus Torvalds 	{ HPHW_NPROC, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, SVERSION_ANY_ID },
3911da177e4SLinus Torvalds 	{ 0, }
3921da177e4SLinus Torvalds };
3931da177e4SLinus Torvalds 
394e9541d0cSHelge Deller static struct parisc_driver cpu_driver = {
3951da177e4SLinus Torvalds 	.name		= "CPU",
3961da177e4SLinus Torvalds 	.id_table	= processor_tbl,
3971da177e4SLinus Torvalds 	.probe		= processor_probe
3981da177e4SLinus Torvalds };
3991da177e4SLinus Torvalds 
4001da177e4SLinus Torvalds /**
4017022672eSSimon Arlott  * processor_init - Processor initialization procedure.
4021da177e4SLinus Torvalds  *
4031da177e4SLinus Torvalds  * Register this driver.
4041da177e4SLinus Torvalds  */
4051da177e4SLinus Torvalds void __init processor_init(void)
4061da177e4SLinus Torvalds {
4071da177e4SLinus Torvalds 	register_parisc_driver(&cpu_driver);
4081da177e4SLinus Torvalds }
409