~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/rb532/time.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/mips/rb532/time.c (Version linux-6.11.5) and /arch/mips/rb532/time.c (Version linux-4.16.18)


  1 // SPDX-License-Identifier: GPL-2.0-only       << 
  2 /*                                                  1 /*
  3  * Carsten Langgaard, carstenl@mips.com             2  * Carsten Langgaard, carstenl@mips.com
  4  * Copyright (C) 1999,2000 MIPS Technologies,       3  * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
                                                   >>   4  *
                                                   >>   5  *  This program is free software; you can distribute it and/or modify it
                                                   >>   6  *  under the terms of the GNU General Public License (Version 2) as
                                                   >>   7  *  published by the Free Software Foundation.
                                                   >>   8  *
                                                   >>   9  *  This program is distributed in the hope it will be useful, but WITHOUT
                                                   >>  10  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
                                                   >>  11  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
                                                   >>  12  *  for more details.
                                                   >>  13  *
                                                   >>  14  *  You should have received a copy of the GNU General Public License along
                                                   >>  15  *  with this program; if not, write to the Free Software Foundation, Inc.,
                                                   >>  16  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  5  *                                                 17  *
  6  *  Setting up the clock on the MIPS boards.       18  *  Setting up the clock on the MIPS boards.
  7  */                                                19  */
  8                                                    20 
  9 #include <linux/init.h>                            21 #include <linux/init.h>
 10 #include <linux/kernel_stat.h>                     22 #include <linux/kernel_stat.h>
 11 #include <linux/ptrace.h>                          23 #include <linux/ptrace.h>
 12 #include <linux/sched.h>                           24 #include <linux/sched.h>
 13 #include <linux/spinlock.h>                        25 #include <linux/spinlock.h>
 14 #include <linux/mc146818rtc.h>                     26 #include <linux/mc146818rtc.h>
 15 #include <linux/irq.h>                             27 #include <linux/irq.h>
 16 #include <linux/timex.h>                           28 #include <linux/timex.h>
 17                                                    29 
 18 #include <asm/mipsregs.h>                          30 #include <asm/mipsregs.h>
 19 #include <asm/time.h>                              31 #include <asm/time.h>
 20 #include <asm/mach-rc32434/rc32434.h>              32 #include <asm/mach-rc32434/rc32434.h>
 21                                                    33 
 22 extern unsigned int idt_cpu_freq;                  34 extern unsigned int idt_cpu_freq;
 23                                                    35 
 24 /*                                                 36 /*
 25  * Figure out the r4k offset, the amount to in     37  * Figure out the r4k offset, the amount to increment the compare
 26  * register for each time tick. There is no RT     38  * register for each time tick. There is no RTC available.
 27  *                                                 39  *
 28  * The RC32434 counts at half the CPU *core* s     40  * The RC32434 counts at half the CPU *core* speed.
 29  */                                                41  */
 30 static unsigned long __init cal_r4koff(void)       42 static unsigned long __init cal_r4koff(void)
 31 {                                                  43 {
 32         mips_hpt_frequency = idt_cpu_freq * ID     44         mips_hpt_frequency = idt_cpu_freq * IDT_CLOCK_MULT / 2;
 33                                                    45 
 34         return mips_hpt_frequency / HZ;            46         return mips_hpt_frequency / HZ;
 35 }                                                  47 }
 36                                                    48 
 37 void __init plat_time_init(void)                   49 void __init plat_time_init(void)
 38 {                                                  50 {
 39         unsigned int est_freq;                     51         unsigned int est_freq;
 40         unsigned long flags, r4k_offset;           52         unsigned long flags, r4k_offset;
 41                                                    53 
 42         local_irq_save(flags);                     54         local_irq_save(flags);
 43                                                    55 
 44         printk(KERN_INFO "calculating r4koff..     56         printk(KERN_INFO "calculating r4koff... ");
 45         r4k_offset = cal_r4koff();                 57         r4k_offset = cal_r4koff();
 46         printk("%08lx(%d)\n", r4k_offset, (int     58         printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);
 47                                                    59 
 48         est_freq = 2 * r4k_offset * HZ;            60         est_freq = 2 * r4k_offset * HZ;
 49         est_freq += 5000;       /* round */        61         est_freq += 5000;       /* round */
 50         est_freq -= est_freq % 10000;              62         est_freq -= est_freq % 10000;
 51         printk(KERN_INFO "CPU frequency %d.%02     63         printk(KERN_INFO "CPU frequency %d.%02d MHz\n", est_freq / 1000000,
 52                (est_freq % 1000000) * 100 / 10     64                (est_freq % 1000000) * 100 / 1000000);
 53         local_irq_restore(flags);                  65         local_irq_restore(flags);
 54 }                                                  66 }
 55                                                    67 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php