From: James S. <jsi...@us...> - 2002-04-16 19:32:02
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv13887/linux/arch/ppc64/kernel Modified Files: chrp_setup.c iSeries_setup.c ioctl32.c setup.c Log Message: Synced to 2.5.8. Index: chrp_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/chrp_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- chrp_setup.c 15 Mar 2002 18:28:12 -0000 1.1 +++ chrp_setup.c 16 Apr 2002 17:41:49 -0000 1.2 @@ -319,12 +319,15 @@ extern void setup_default_decr(void); +extern unsigned long ppc_proc_freq; +extern unsigned long ppc_tb_freq; + void __init pSeries_calibrate_decr(void) { struct device_node *cpu; struct div_result divres; int *fp; - unsigned long freq; + unsigned long freq, processor_freq; /* * The cpu node should have a timebase-frequency property @@ -337,8 +340,19 @@ if (fp != 0) freq = *fp; } + ppc_tb_freq = freq; + processor_freq = freq; + if (cpu != 0) { + fp = (int *) get_property(cpu, "clock-frequency", NULL); + if (fp != 0) + processor_freq = *fp; + } + ppc_proc_freq = processor_freq; + printk("time_init: decrementer frequency = %lu.%.6lu MHz\n", freq/1000000, freq%1000000 ); + printk("time_init: processor frequency = %lu.%.6lu MHz\n", + processor_freq/1000000, processor_freq%1000000 ); tb_ticks_per_jiffy = freq / HZ; tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; Index: iSeries_setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/iSeries_setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- iSeries_setup.c 15 Mar 2002 18:28:12 -0000 1.1 +++ iSeries_setup.c 16 Apr 2002 17:41:49 -0000 1.2 @@ -26,6 +26,7 @@ #include <linux/string.h> #include <linux/bootmem.h> #include <linux/blk.h> +#include <linux/seq_file.h> #include <asm/processor.h> #include <asm/machdep.h> @@ -576,6 +577,7 @@ lmb_init(); lmb_add( 0, naca->physicalMemorySize ); + lmb_analyze(); /* ?? */ lmb_reserve( 0, __pa(klimit)); /* @@ -592,8 +594,10 @@ static void __init setup_iSeries_cache_sizes(void) { unsigned i,n; - naca->iCacheL1LineSize = xIoHriProcessorVpd[0].xInstCacheOperandSize; - naca->dCacheL1LineSize = xIoHriProcessorVpd[0].xDataCacheOperandSize; + unsigned procIx = get_paca()->xLpPaca.xDynHvPhysicalProcIndex; + + naca->iCacheL1LineSize = xIoHriProcessorVpd[procIx].xInstCacheOperandSize; + naca->dCacheL1LineSize = xIoHriProcessorVpd[procIx].xDataCacheOperandSize; naca->iCacheL1LinesPerPage = PAGE_SIZE / naca->iCacheL1LineSize; naca->dCacheL1LinesPerPage = PAGE_SIZE / naca->dCacheL1LineSize; i = naca->iCacheL1LineSize; @@ -641,6 +645,9 @@ } #endif /* CONFIG_PPC_ISERIES */ +extern unsigned long ppc_proc_freq; +extern unsigned long ppc_tb_freq; + /* * Document me. */ @@ -648,7 +655,8 @@ iSeries_setup_arch(void) { void * eventStack; - + unsigned procIx = get_paca()->xLpPaca.xDynHvPhysicalProcIndex; + /* Setup the Lp Event Queue */ /* Allocate a page for the Event Stack @@ -674,15 +682,19 @@ xItLpQueue.xIndex = 0; /* Compute processor frequency */ - procFreqHz = (((1UL<<34) * 1000000) / xIoHriProcessorVpd[0].xProcFreq ); + procFreqHz = (((1UL<<34) * 1000000) / xIoHriProcessorVpd[procIx].xProcFreq ); procFreqMhz = procFreqHz / 1000000; procFreqMhzHundreths = (procFreqHz/10000) - (procFreqMhz*100); + ppc_proc_freq = procFreqHz; + /* Compute time base frequency */ - tbFreqHz = (((1UL<<32) * 1000000) / xIoHriProcessorVpd[0].xTimeBaseFreq ); + tbFreqHz = (((1UL<<32) * 1000000) / xIoHriProcessorVpd[procIx].xTimeBaseFreq ); tbFreqMhz = tbFreqHz / 1000000; tbFreqMhzHundreths = (tbFreqHz/10000) - (tbFreqMhz*100); + ppc_tb_freq = tbFreqHz; + printk("Max logical processors = %d\n", itVpdAreas.xSlicMaxLogicalProcs ); printk("Max physical processors = %d\n", @@ -694,12 +706,12 @@ tbFreqMhz, tbFreqMhzHundreths ); printk("Processor version = %x\n", - xIoHriProcessorVpd[0].xPVR ); + xIoHriProcessorVpd[procIx].xPVR ); } /* - * int iSeries_setup_residual() + * int as400_setup_residual() * * Description: * This routine pretty-prints CPU information gathered from the VPD @@ -715,20 +727,25 @@ * The number of bytes copied into 'buffer' if OK, otherwise zero or less * on error. */ -void -iSeries_setup_residual(struct seq_file *m, unsigned long cpu_id) +void iSeries_setup_residual(struct seq_file *m) { - seq_printf(m, "clock\t\t: %lu.%02luMhz\n", procFreqMhz, - procFreqMhzHundreths); - seq_printf(m, "time base\t: %lu.%02luMHz\n", tbFreqMhz, - tbFreqMhzHundreths); - seq_printf(m, "i-cache\t\t: %d\n", naca->iCacheL1LineSize); - seq_printf(m, "d-cache\t\t: %d\n", naca->dCacheL1LineSize); + + seq_printf(m,"clock\t\t: %lu.%02luMhz\n", + procFreqMhz, procFreqMhzHundreths ); + seq_printf(m,"time base\t: %lu.%02luMHz\n", + tbFreqMhz, tbFreqMhzHundreths ); + seq_printf(m,"i-cache\t\t: %d\n", + naca->iCacheL1LineSize); + seq_printf(m,"d-cache\t\t: %d\n", + naca->dCacheL1LineSize); + } void iSeries_get_cpuinfo(struct seq_file *m) { - seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n"); + + seq_printf(m,"machine\t\t: 64-bit iSeries Logical Partition\n"); + } /* @@ -794,29 +811,29 @@ void __init iSeries_calibrate_decr(void) { - unsigned long freq; unsigned long cyclesPerUsec; - unsigned long tbf; struct div_result divres; /* Compute decrementer (and TB) frequency * in cycles/sec */ - - tbf = xIoHriProcessorVpd[0].xTimeBaseFreq; - - freq = 0x0100000000; - freq *= 1000000; /* 2^32 * 10^6 */ - freq = freq / tbf; /* cycles / sec */ - cyclesPerUsec = freq / 1000000; /* cycles / usec */ + + cyclesPerUsec = ppc_tb_freq / 1000000; /* cycles / usec */ /* Set the amount to refresh the decrementer by. This * is the number of decrementer ticks it takes for * 1/HZ seconds. */ - tb_ticks_per_jiffy = freq / HZ; + tb_ticks_per_jiffy = ppc_tb_freq / HZ; + +#if 0 + /* TEST CODE FOR ADJTIME */ + tb_ticks_per_jiffy += tb_ticks_per_jiffy / 5000; + /* END OF TEST CODE */ +#endif + /* * tb_ticks_per_sec = freq; would give better accuracy * but tb_ticks_per_sec = tb_ticks_per_jiffy*HZ; assures @@ -825,7 +842,7 @@ */ tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; tb_ticks_per_usec = cyclesPerUsec; - tb_to_us = mulhwu_scale_factor(freq, 1000000); + tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres ); tb_to_xs = divres.result_low; setup_default_decr(); Index: ioctl32.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/ioctl32.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ioctl32.c 22 Mar 2002 20:13:58 -0000 1.2 +++ ioctl32.c 16 Apr 2002 17:41:49 -0000 1.3 @@ -3744,8 +3744,6 @@ COMPATIBLE_IOCTL(BLKROGET), COMPATIBLE_IOCTL(BLKRRPART), COMPATIBLE_IOCTL(BLKFLSBUF), -COMPATIBLE_IOCTL(BLKRASET), -COMPATIBLE_IOCTL(BLKFRASET), COMPATIBLE_IOCTL(BLKSECTSET), COMPATIBLE_IOCTL(BLKSSZGET), COMPATIBLE_IOCTL(BLKBSZGET), @@ -4318,10 +4316,8 @@ HANDLE_IOCTL(SIOCRTMSG, ret_einval), HANDLE_IOCTL(SIOCGSTAMP, do_siocgstamp), HANDLE_IOCTL(HDIO_GETGEO, hdio_getgeo), -HANDLE_IOCTL(BLKRAGET, w_long), HANDLE_IOCTL(BLKGETSIZE, w_long), HANDLE_IOCTL(0x1260, broken_blkgetsize), -HANDLE_IOCTL(BLKFRAGET, w_long), HANDLE_IOCTL(BLKSECTGET, w_long), HANDLE_IOCTL(BLKPG, blkpg_ioctl_trans), HANDLE_IOCTL(HDIO_GET_KEEPSETTINGS, hdio_ioctl_trans), Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel/setup.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- setup.c 15 Mar 2002 18:59:28 -0000 1.1 +++ setup.c 16 Apr 2002 17:41:49 -0000 1.2 @@ -276,6 +276,9 @@ ppc_md.halt(); } +unsigned long ppc_proc_freq; +unsigned long ppc_tb_freq; + static int show_cpuinfo(struct seq_file *m, void *v) { unsigned long cpu_id = (unsigned long)v - 1; @@ -285,10 +288,6 @@ #ifdef CONFIG_SMP if (cpu_id == NR_CPUS) { - unsigned long bogosum = smp_num_cpus * loops_per_jiffy; - seq_printf(m, "total bogomips\t: %lu.%02lu\n", - bogosum/(500000/HZ), - bogosum/(5000/HZ) % 100); if (ppc_md.get_cpuinfo != NULL) ppc_md.get_cpuinfo(m); @@ -356,10 +355,6 @@ seq_printf(m, "revision\t: %hd.%hd\n", maj, min); - seq_printf(m, "bogomips\t: %lu.%02lu\n\n", - loops_per_jiffy/(500000/HZ), - loops_per_jiffy/(5000/HZ) % 100); - return 0; } |