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

TOMOYO Linux Cross Reference
Linux/arch/hexagon/kernel/setup.c

Version: ~ [ linux-5.11 ] ~ [ linux-5.10.17 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.99 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.176 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.221 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.257 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.257 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*
  3  * Arch related setup for Hexagon
  4  *
  5  * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
  6  */
  7 
  8 #include <linux/init.h>
  9 #include <linux/delay.h>
 10 #include <linux/memblock.h>
 11 #include <linux/mmzone.h>
 12 #include <linux/mm.h>
 13 #include <linux/seq_file.h>
 14 #include <linux/console.h>
 15 #include <linux/of_fdt.h>
 16 #include <asm/io.h>
 17 #include <asm/sections.h>
 18 #include <asm/setup.h>
 19 #include <asm/processor.h>
 20 #include <asm/hexagon_vm.h>
 21 #include <asm/vm_mmu.h>
 22 #include <asm/time.h>
 23 
 24 char cmd_line[COMMAND_LINE_SIZE];
 25 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
 26 
 27 int on_simulator;
 28 
 29 void calibrate_delay(void)
 30 {
 31         loops_per_jiffy = thread_freq_mhz * 1000000 / HZ;
 32 }
 33 
 34 /*
 35  * setup_arch -  high level architectural setup routine
 36  * @cmdline_p: pointer to pointer to command-line arguments
 37  */
 38 
 39 void __init setup_arch(char **cmdline_p)
 40 {
 41         char *p = &external_cmdline_buffer;
 42 
 43         /*
 44          * These will eventually be pulled in via either some hypervisor
 45          * or devicetree description.  Hardwiring for now.
 46          */
 47         pcycle_freq_mhz = 600;
 48         thread_freq_mhz = 100;
 49         sleep_clk_freq = 32000;
 50 
 51         /*
 52          * Set up event bindings to handle exceptions and interrupts.
 53          */
 54         __vmsetvec(_K_VM_event_vector);
 55 
 56         printk(KERN_INFO "PHYS_OFFSET=0x%08lx\n", PHYS_OFFSET);
 57 
 58         /*
 59          * Simulator has a few differences from the hardware.
 60          * For now, check uninitialized-but-mapped memory
 61          * prior to invoking setup_arch_memory().
 62          */
 63         if (*(int *)((unsigned long)_end + 8) == 0x1f1f1f1f)
 64                 on_simulator = 1;
 65         else
 66                 on_simulator = 0;
 67 
 68         if (p[0] != '\0')
 69                 strlcpy(boot_command_line, p, COMMAND_LINE_SIZE);
 70         else
 71                 strlcpy(boot_command_line, default_command_line,
 72                         COMMAND_LINE_SIZE);
 73 
 74         /*
 75          * boot_command_line and the value set up by setup_arch
 76          * are both picked up by the init code. If no reason to
 77          * make them different, pass the same pointer back.
 78          */
 79         strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
 80         *cmdline_p = cmd_line;
 81 
 82         parse_early_param();
 83 
 84         setup_arch_memory();
 85 
 86 #ifdef CONFIG_SMP
 87         smp_start_cpus();
 88 #endif
 89 }
 90 
 91 /*
 92  * Functions for dumping CPU info via /proc
 93  * Probably should move to kernel/proc.c or something.
 94  */
 95 static void *c_start(struct seq_file *m, loff_t *pos)
 96 {
 97         return *pos < nr_cpu_ids ? (void *)((unsigned long) *pos + 1) : NULL;
 98 }
 99 
100 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
101 {
102         ++*pos;
103         return c_start(m, pos);
104 }
105 
106 static void c_stop(struct seq_file *m, void *v)
107 {
108 }
109 
110 /*
111  * Eventually this will dump information about
112  * CPU properties like ISA level, TLB size, etc.
113  */
114 static int show_cpuinfo(struct seq_file *m, void *v)
115 {
116         int cpu = (unsigned long) v - 1;
117 
118 #ifdef CONFIG_SMP
119         if (!cpu_online(cpu))
120                 return 0;
121 #endif
122 
123         seq_printf(m, "processor\t: %d\n", cpu);
124         seq_printf(m, "model name\t: Hexagon Virtual Machine\n");
125         seq_printf(m, "BogoMips\t: %lu.%02lu\n",
126                 (loops_per_jiffy * HZ) / 500000,
127                 ((loops_per_jiffy * HZ) / 5000) % 100);
128         seq_printf(m, "\n");
129         return 0;
130 }
131 
132 const struct seq_operations cpuinfo_op = {
133         .start  = &c_start,
134         .next   = &c_next,
135         .stop   = &c_stop,
136         .show   = &show_cpuinfo,
137 };
138 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp