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

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

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/csky/kernel/setup.c (Version linux-6.12-rc7) and /arch/m68k/kernel/setup.c (Version linux-2.6.0)


  1 // SPDX-License-Identifier: GPL-2.0            !!   1 /*
  2 // Copyright (C) 2018 Hangzhou C-SKY Microsyst !!   2  *  linux/arch/m68k/kernel/setup.c
  3                                                !!   3  *
                                                   >>   4  *  Copyright (C) 1995  Hamish Macdonald
                                                   >>   5  */
                                                   >>   6 
                                                   >>   7 /*
                                                   >>   8  * This file handles the architecture-dependent parts of system setup
                                                   >>   9  */
                                                   >>  10 
                                                   >>  11 #include <linux/config.h>
                                                   >>  12 #include <linux/kernel.h>
                                                   >>  13 #include <linux/mm.h>
                                                   >>  14 #include <linux/sched.h>
                                                   >>  15 #include <linux/delay.h>
                                                   >>  16 #include <linux/interrupt.h>
                                                   >>  17 #include <linux/fs.h>
  4 #include <linux/console.h>                         18 #include <linux/console.h>
  5 #include <linux/memblock.h>                    !!  19 #include <linux/genhd.h>
                                                   >>  20 #include <linux/errno.h>
                                                   >>  21 #include <linux/string.h>
                                                   >>  22 #include <linux/init.h>
                                                   >>  23 #include <linux/bootmem.h>
                                                   >>  24 #include <linux/seq_file.h>
                                                   >>  25 #include <linux/module.h>
  6 #include <linux/initrd.h>                          26 #include <linux/initrd.h>
  7 #include <linux/of.h>                          << 
  8 #include <linux/of_fdt.h>                      << 
  9 #include <linux/start_kernel.h>                << 
 10 #include <linux/dma-map-ops.h>                 << 
 11 #include <asm/sections.h>                      << 
 12 #include <asm/mmu_context.h>                   << 
 13 #include <asm/pgalloc.h>                       << 
 14                                                << 
 15 static void __init csky_memblock_init(void)    << 
 16 {                                              << 
 17         unsigned long lowmem_size = PFN_DOWN(L << 
 18         unsigned long sseg_size = PFN_DOWN(SSE << 
 19         unsigned long max_zone_pfn[MAX_NR_ZONE << 
 20         signed long size;                      << 
 21                                                    27 
 22         memblock_reserve(__pa(_start), _end -  !!  28 #include <asm/bootinfo.h>
 23                                                !!  29 #include <asm/setup.h>
 24         early_init_fdt_reserve_self();         !!  30 #include <asm/irq.h>
 25         early_init_fdt_scan_reserved_mem();    !!  31 #include <asm/io.h>
                                                   >>  32 #include <asm/machdep.h>
                                                   >>  33 #ifdef CONFIG_AMIGA
                                                   >>  34 #include <asm/amigahw.h>
                                                   >>  35 #endif
                                                   >>  36 #ifdef CONFIG_ATARI
                                                   >>  37 #include <asm/atarihw.h>
                                                   >>  38 #include <asm/atari_stram.h>
                                                   >>  39 #endif
                                                   >>  40 #ifdef CONFIG_SUN3X
                                                   >>  41 #include <asm/dvma.h>
                                                   >>  42 extern void sun_serial_setup(void);
                                                   >>  43 #endif
 26                                                    44 
 27         memblock_dump_all();                   !!  45 unsigned long m68k_machtype;
                                                   >>  46 unsigned long m68k_cputype;
                                                   >>  47 unsigned long m68k_fputype;
                                                   >>  48 unsigned long m68k_mmutype;
                                                   >>  49 #ifdef CONFIG_VME
                                                   >>  50 unsigned long vme_brdtype;
                                                   >>  51 #endif
 28                                                    52 
 29         min_low_pfn = PFN_UP(memblock_start_of !!  53 int m68k_is040or060 = 0;
 30         max_low_pfn = max_pfn = PFN_DOWN(membl << 
 31                                                    54 
 32         size = max_pfn - min_low_pfn;          !!  55 extern int end;
                                                   >>  56 extern unsigned long availmem;
 33                                                    57 
 34         if (size >= lowmem_size) {             !!  58 int m68k_num_memory = 0;
 35                 max_low_pfn = min_low_pfn + lo !!  59 int m68k_realnum_memory = 0;
 36 #ifdef CONFIG_PAGE_OFFSET_80000000             !!  60 unsigned long m68k_memoffset;
 37                 write_mmu_msa1(read_mmu_msa0() !!  61 struct mem_info m68k_memory[NUM_MEMINFO];
                                                   >>  62 
                                                   >>  63 static struct mem_info m68k_ramdisk = { 0, 0 };
                                                   >>  64 
                                                   >>  65 static char m68k_command_line[CL_SIZE];
                                                   >>  66 char saved_command_line[CL_SIZE];
                                                   >>  67 
                                                   >>  68 char m68k_debug_device[6] = "";
                                                   >>  69 
                                                   >>  70 void (*mach_sched_init) (irqreturn_t (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
                                                   >>  71 /* machine dependent irq functions */
                                                   >>  72 void (*mach_init_IRQ) (void) __initdata = NULL;
                                                   >>  73 irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
                                                   >>  74 void (*mach_get_model) (char *model) = NULL;
                                                   >>  75 int (*mach_get_hardware_list) (char *buffer) = NULL;
                                                   >>  76 int (*mach_get_irq_list) (struct seq_file *, void *) = NULL;
                                                   >>  77 irqreturn_t (*mach_process_int) (int, struct pt_regs *) = NULL;
                                                   >>  78 /* machine dependent timer functions */
                                                   >>  79 unsigned long (*mach_gettimeoffset) (void);
                                                   >>  80 int (*mach_hwclk) (int, struct rtc_time*) = NULL;
                                                   >>  81 int (*mach_set_clock_mmss) (unsigned long) = NULL;
                                                   >>  82 unsigned int (*mach_get_ss)(void) = NULL;
                                                   >>  83 int (*mach_get_rtc_pll)(struct rtc_pll_info *) = NULL;
                                                   >>  84 int (*mach_set_rtc_pll)(struct rtc_pll_info *) = NULL;
                                                   >>  85 void (*mach_reset)( void );
                                                   >>  86 void (*mach_halt)( void ) = NULL;
                                                   >>  87 void (*mach_power_off)( void ) = NULL;
                                                   >>  88 long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
                                                   >>  89 #if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) 
                                                   >>  90 void (*mach_floppy_setup) (char *, int *) __initdata = NULL;
                                                   >>  91 #endif
                                                   >>  92 #ifdef CONFIG_HEARTBEAT
                                                   >>  93 void (*mach_heartbeat) (int) = NULL;
                                                   >>  94 EXPORT_SYMBOL(mach_heartbeat);
                                                   >>  95 #endif
                                                   >>  96 #ifdef CONFIG_M68K_L2_CACHE
                                                   >>  97 void (*mach_l2_flush) (int) = NULL;
                                                   >>  98 #endif
                                                   >>  99 #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
                                                   >> 100 void (*mach_beep)(unsigned int, unsigned int) = NULL;
                                                   >> 101 #endif
                                                   >> 102 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
                                                   >> 103 int isa_type;
                                                   >> 104 int isa_sex;
 38 #endif                                            105 #endif
 39         } else if (size > sseg_size) {         << 
 40                 max_low_pfn = min_low_pfn + ss << 
 41         }                                      << 
 42                                                << 
 43         max_zone_pfn[ZONE_NORMAL] = max_low_pf << 
 44                                                   106 
 45         mmu_init(min_low_pfn, max_low_pfn);    !! 107 extern int amiga_parse_bootinfo(const struct bi_record *);
                                                   >> 108 extern int atari_parse_bootinfo(const struct bi_record *);
                                                   >> 109 extern int mac_parse_bootinfo(const struct bi_record *);
                                                   >> 110 extern int q40_parse_bootinfo(const struct bi_record *);
                                                   >> 111 extern int bvme6000_parse_bootinfo(const struct bi_record *);
                                                   >> 112 extern int mvme16x_parse_bootinfo(const struct bi_record *);
                                                   >> 113 extern int mvme147_parse_bootinfo(const struct bi_record *);
                                                   >> 114 
                                                   >> 115 extern void config_amiga(void);
                                                   >> 116 extern void config_atari(void);
                                                   >> 117 extern void config_mac(void);
                                                   >> 118 extern void config_sun3(void);
                                                   >> 119 extern void config_apollo(void);
                                                   >> 120 extern void config_mvme147(void);
                                                   >> 121 extern void config_mvme16x(void);
                                                   >> 122 extern void config_bvme6000(void);
                                                   >> 123 extern void config_hp300(void);
                                                   >> 124 extern void config_q40(void);
                                                   >> 125 extern void config_sun3x(void);
 46                                                   126 
 47 #ifdef CONFIG_HIGHMEM                          !! 127 extern void mac_debugging_short (int, short);
 48         max_zone_pfn[ZONE_HIGHMEM] = max_pfn;  !! 128 extern void mac_debugging_long  (int, long);
 49                                                   129 
 50         highstart_pfn = max_low_pfn;           !! 130 #define MASK_256K 0xfffc0000
 51         highend_pfn   = max_pfn;               << 
 52 #endif                                         << 
 53         memblock_set_current_limit(PFN_PHYS(ma << 
 54                                                   131 
 55         dma_contiguous_reserve(0);             !! 132 extern void paging_init(void);
 56                                                   133 
 57         free_area_init(max_zone_pfn);          !! 134 static void __init m68k_parse_bootinfo(const struct bi_record *record)
                                                   >> 135 {
                                                   >> 136     while (record->tag != BI_LAST) {
                                                   >> 137         int unknown = 0;
                                                   >> 138         const unsigned long *data = record->data;
                                                   >> 139         switch (record->tag) {
                                                   >> 140             case BI_MACHTYPE:
                                                   >> 141             case BI_CPUTYPE:
                                                   >> 142             case BI_FPUTYPE:
                                                   >> 143             case BI_MMUTYPE:
                                                   >> 144                 /* Already set up by head.S */
                                                   >> 145                 break;
                                                   >> 146 
                                                   >> 147             case BI_MEMCHUNK:
                                                   >> 148                 if (m68k_num_memory < NUM_MEMINFO) {
                                                   >> 149                     m68k_memory[m68k_num_memory].addr = data[0];
                                                   >> 150                     m68k_memory[m68k_num_memory].size = data[1];
                                                   >> 151                     m68k_num_memory++;
                                                   >> 152                 } else
                                                   >> 153                     printk("m68k_parse_bootinfo: too many memory chunks\n");
                                                   >> 154                 break;
                                                   >> 155 
                                                   >> 156             case BI_RAMDISK:
                                                   >> 157                 m68k_ramdisk.addr = data[0];
                                                   >> 158                 m68k_ramdisk.size = data[1];
                                                   >> 159                 break;
                                                   >> 160 
                                                   >> 161             case BI_COMMAND_LINE:
                                                   >> 162                 strlcpy(m68k_command_line, (const char *)data, sizeof(m68k_command_line));
                                                   >> 163                 break;
                                                   >> 164 
                                                   >> 165             default:
                                                   >> 166                 if (MACH_IS_AMIGA)
                                                   >> 167                     unknown = amiga_parse_bootinfo(record);
                                                   >> 168                 else if (MACH_IS_ATARI)
                                                   >> 169                     unknown = atari_parse_bootinfo(record);
                                                   >> 170                 else if (MACH_IS_MAC)
                                                   >> 171                     unknown = mac_parse_bootinfo(record);
                                                   >> 172                 else if (MACH_IS_Q40)
                                                   >> 173                     unknown = q40_parse_bootinfo(record);
                                                   >> 174                 else if (MACH_IS_BVME6000)
                                                   >> 175                     unknown = bvme6000_parse_bootinfo(record);
                                                   >> 176                 else if (MACH_IS_MVME16x)
                                                   >> 177                     unknown = mvme16x_parse_bootinfo(record);
                                                   >> 178                 else if (MACH_IS_MVME147)
                                                   >> 179                     unknown = mvme147_parse_bootinfo(record);
                                                   >> 180                 else
                                                   >> 181                     unknown = 1;
                                                   >> 182         }
                                                   >> 183         if (unknown)
                                                   >> 184             printk("m68k_parse_bootinfo: unknown tag 0x%04x ignored\n",
                                                   >> 185                    record->tag);
                                                   >> 186         record = (struct bi_record *)((unsigned long)record+record->size);
                                                   >> 187     }
                                                   >> 188 
                                                   >> 189     m68k_realnum_memory = m68k_num_memory;
                                                   >> 190 #ifdef CONFIG_SINGLE_MEMORY_CHUNK
                                                   >> 191     if (m68k_num_memory > 1) {
                                                   >> 192         printk("Ignoring last %i chunks of physical memory\n",
                                                   >> 193                (m68k_num_memory - 1));
                                                   >> 194         m68k_num_memory = 1;
                                                   >> 195     }
                                                   >> 196     m68k_memoffset = m68k_memory[0].addr-PAGE_OFFSET;
                                                   >> 197 #endif
 58 }                                                 198 }
 59                                                   199 
 60 void __init setup_arch(char **cmdline_p)          200 void __init setup_arch(char **cmdline_p)
 61 {                                                 201 {
 62         *cmdline_p = boot_command_line;        !! 202         extern int _etext, _edata, _end;
                                                   >> 203 #ifndef CONFIG_SUN3
                                                   >> 204         unsigned long endmem, startmem;
                                                   >> 205 #endif
                                                   >> 206         int i;
                                                   >> 207         char *p, *q;
                                                   >> 208 
                                                   >> 209         if (!MACH_IS_HP300) {
                                                   >> 210                 /* The bootinfo is located right after the kernel bss */
                                                   >> 211                 m68k_parse_bootinfo((const struct bi_record *)&_end);
                                                   >> 212         } else {
                                                   >> 213                 /* FIXME HP300 doesn't use bootinfo yet */
                                                   >> 214                 extern unsigned long hp300_phys_ram_base;
                                                   >> 215                 unsigned long hp300_mem_size = 0xffffffff-hp300_phys_ram_base;
                                                   >> 216                 m68k_cputype = CPU_68030;
                                                   >> 217                 m68k_fputype = FPU_68882;
                                                   >> 218                 m68k_memory[0].addr = hp300_phys_ram_base;
                                                   >> 219                 /* 0.5M fudge factor */
                                                   >> 220                 m68k_memory[0].size = hp300_mem_size-512*1024;
                                                   >> 221                 m68k_num_memory++;
                                                   >> 222         }
                                                   >> 223 
                                                   >> 224         if (CPU_IS_040)
                                                   >> 225                 m68k_is040or060 = 4;
                                                   >> 226         else if (CPU_IS_060)
                                                   >> 227                 m68k_is040or060 = 6;
                                                   >> 228 
                                                   >> 229         /* FIXME: m68k_fputype is passed in by Penguin booter, which can
                                                   >> 230          * be confused by software FPU emulation. BEWARE.
                                                   >> 231          * We should really do our own FPU check at startup.
                                                   >> 232          * [what do we do with buggy 68LC040s? if we have problems
                                                   >> 233          *  with them, we should add a test to check_bugs() below] */
                                                   >> 234 #ifndef CONFIG_M68KFPU_EMU_ONLY
                                                   >> 235         /* clear the fpu if we have one */
                                                   >> 236         if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060)) {
                                                   >> 237                 volatile int zero = 0;
                                                   >> 238                 asm __volatile__ ("frestore %0" : : "m" (zero));
                                                   >> 239         }
                                                   >> 240 #endif  
                                                   >> 241 
                                                   >> 242         init_mm.start_code = PAGE_OFFSET;
                                                   >> 243         init_mm.end_code = (unsigned long) &_etext;
                                                   >> 244         init_mm.end_data = (unsigned long) &_edata;
                                                   >> 245         init_mm.brk = (unsigned long) &_end;
                                                   >> 246 
                                                   >> 247         *cmdline_p = m68k_command_line;
                                                   >> 248         memcpy(saved_command_line, *cmdline_p, CL_SIZE);
                                                   >> 249 
                                                   >> 250         /* Parse the command line for arch-specific options.
                                                   >> 251          * For the m68k, this is currently only "debug=xxx" to enable printing
                                                   >> 252          * certain kernel messages to some machine-specific device.
                                                   >> 253          */
                                                   >> 254         for( p = *cmdline_p; p && *p; ) {
                                                   >> 255             i = 0;
                                                   >> 256             if (!strncmp( p, "debug=", 6 )) {
                                                   >> 257                 strlcpy( m68k_debug_device, p+6, sizeof(m68k_debug_device) );
                                                   >> 258                 if ((q = strchr( m68k_debug_device, ' ' ))) *q = 0;
                                                   >> 259                 i = 1;
                                                   >> 260             }
                                                   >> 261 #ifdef CONFIG_ATARI
                                                   >> 262             /* This option must be parsed very early */
                                                   >> 263             if (!strncmp( p, "switches=", 9 )) {
                                                   >> 264                 extern void atari_switches_setup( const char *, int );
                                                   >> 265                 atari_switches_setup( p+9, (q = strchr( p+9, ' ' )) ?
                                                   >> 266                                            (q - (p+9)) : strlen(p+9) );
                                                   >> 267                 i = 1;
                                                   >> 268             }
                                                   >> 269 #endif
 63                                                   270 
 64         console_verbose();                     !! 271             if (i) {
                                                   >> 272                 /* option processed, delete it */
                                                   >> 273                 if ((q = strchr( p, ' ' )))
                                                   >> 274                     strcpy( p, q+1 );
                                                   >> 275                 else
                                                   >> 276                     *p = 0;
                                                   >> 277             } else {
                                                   >> 278                 if ((p = strchr( p, ' ' ))) ++p;
                                                   >> 279             }
                                                   >> 280         }
                                                   >> 281 
                                                   >> 282         switch (m68k_machtype) {
                                                   >> 283 #ifdef CONFIG_AMIGA
                                                   >> 284             case MACH_AMIGA:
                                                   >> 285                 config_amiga();
                                                   >> 286                 break;
                                                   >> 287 #endif
                                                   >> 288 #ifdef CONFIG_ATARI
                                                   >> 289             case MACH_ATARI:
                                                   >> 290                 config_atari();
                                                   >> 291                 break;
                                                   >> 292 #endif
                                                   >> 293 #ifdef CONFIG_MAC
                                                   >> 294             case MACH_MAC:
                                                   >> 295                 config_mac();
                                                   >> 296                 break;
                                                   >> 297 #endif
                                                   >> 298 #ifdef CONFIG_SUN3
                                                   >> 299             case MACH_SUN3:
                                                   >> 300                 config_sun3();
                                                   >> 301                 break;
                                                   >> 302 #endif
                                                   >> 303 #ifdef CONFIG_APOLLO
                                                   >> 304             case MACH_APOLLO:
                                                   >> 305                 config_apollo();
                                                   >> 306                 break;
                                                   >> 307 #endif
                                                   >> 308 #ifdef CONFIG_MVME147
                                                   >> 309             case MACH_MVME147:
                                                   >> 310                 config_mvme147();
                                                   >> 311                 break;
                                                   >> 312 #endif
                                                   >> 313 #ifdef CONFIG_MVME16x
                                                   >> 314             case MACH_MVME16x:
                                                   >> 315                 config_mvme16x();
                                                   >> 316                 break;
                                                   >> 317 #endif
                                                   >> 318 #ifdef CONFIG_BVME6000
                                                   >> 319             case MACH_BVME6000:
                                                   >> 320                 config_bvme6000();
                                                   >> 321                 break;
                                                   >> 322 #endif
                                                   >> 323 #ifdef CONFIG_HP300
                                                   >> 324             case MACH_HP300:
                                                   >> 325                 config_hp300();
                                                   >> 326                 break;
                                                   >> 327 #endif
                                                   >> 328 #ifdef CONFIG_Q40
                                                   >> 329             case MACH_Q40:
                                                   >> 330                 config_q40();
                                                   >> 331                 break;
                                                   >> 332 #endif
                                                   >> 333 #ifdef CONFIG_SUN3X
                                                   >> 334             case MACH_SUN3X:
                                                   >> 335                 config_sun3x();
                                                   >> 336                 break;
                                                   >> 337 #endif
                                                   >> 338             default:
                                                   >> 339                 panic ("No configuration setup");
                                                   >> 340         }
 65                                                   341 
 66         pr_info("Phys. mem: %ldMB\n",          !! 342 #ifndef CONFIG_SUN3
 67                 (unsigned long) memblock_phys_ !! 343         startmem= m68k_memory[0].addr;
                                                   >> 344         endmem = startmem + m68k_memory[0].size;
                                                   >> 345         high_memory = PAGE_OFFSET;
                                                   >> 346         for (i = 0; i < m68k_num_memory; i++) {
                                                   >> 347                 m68k_memory[i].size &= MASK_256K;
                                                   >> 348                 if (m68k_memory[i].addr < startmem)
                                                   >> 349                         startmem = m68k_memory[i].addr;
                                                   >> 350                 if (m68k_memory[i].addr+m68k_memory[i].size > endmem)
                                                   >> 351                         endmem = m68k_memory[i].addr+m68k_memory[i].size;
                                                   >> 352                 high_memory += m68k_memory[i].size;
                                                   >> 353         }
 68                                                   354 
 69         setup_initial_init_mm(_start, _etext,  !! 355         availmem += init_bootmem_node(NODE_DATA(0), availmem >> PAGE_SHIFT,
                                                   >> 356                                       startmem >> PAGE_SHIFT, endmem >> PAGE_SHIFT);
 70                                                   357 
 71         parse_early_param();                   !! 358         for (i = 0; i < m68k_num_memory; i++)
                                                   >> 359                 free_bootmem(m68k_memory[i].addr, m68k_memory[i].size);
 72                                                   360 
 73         csky_memblock_init();                  !! 361         reserve_bootmem(m68k_memory[0].addr, availmem - m68k_memory[0].addr);
 74                                                   362 
 75         unflatten_and_copy_device_tree();      !! 363 #ifdef CONFIG_BLK_DEV_INITRD
                                                   >> 364         if (m68k_ramdisk.size) {
                                                   >> 365                 reserve_bootmem(m68k_ramdisk.addr, m68k_ramdisk.size);
                                                   >> 366                 initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
                                                   >> 367                 initrd_end = initrd_start + m68k_ramdisk.size;
                                                   >> 368                 printk ("initrd: %08lx - %08lx\n", initrd_start, initrd_end);
                                                   >> 369         }
                                                   >> 370 #endif
 76                                                   371 
 77 #ifdef CONFIG_SMP                              !! 372 #ifdef CONFIG_ATARI
 78         setup_smp();                           !! 373         if (MACH_IS_ATARI)
                                                   >> 374                 atari_stram_reserve_pages((void *)availmem);
                                                   >> 375 #endif
                                                   >> 376 #ifdef CONFIG_SUN3X
                                                   >> 377         if (MACH_IS_SUN3X) {
                                                   >> 378                 dvma_init();
                                                   >> 379         }
 79 #endif                                            380 #endif
 80                                                   381 
 81         sparse_init();                         !! 382 #endif /* !CONFIG_SUN3 */
 82                                                   383 
 83         fixaddr_init();                        !! 384         paging_init();
 84                                                   385 
 85 #ifdef CONFIG_HIGHMEM                          !! 386 /* set ISA defs early as possible */
 86         kmap_init();                           !! 387 #if defined(CONFIG_ISA) && defined(MULTI_ISA)
                                                   >> 388 #if defined(CONFIG_Q40) 
                                                   >> 389         if (MACH_IS_Q40) {
                                                   >> 390             isa_type = Q40_ISA;
                                                   >> 391             isa_sex = 0;
                                                   >> 392         } 
                                                   >> 393 #elif defined(CONFIG_GG2)
                                                   >> 394         if (MACH_IS_AMIGA && AMIGAHW_PRESENT(GG2_ISA)){
                                                   >> 395             isa_type = GG2_ISA;
                                                   >> 396             isa_sex = 0;
                                                   >> 397         }
                                                   >> 398 #elif defined(CONFIG_AMIGA_PCMCIA)
                                                   >> 399         if (MACH_IS_AMIGA && AMIGAHW_PRESENT(PCMCIA)){
                                                   >> 400             isa_type = AG_ISA;
                                                   >> 401             isa_sex = 1;
                                                   >> 402         }
                                                   >> 403 #endif
 87 #endif                                            404 #endif
 88 }                                                 405 }
 89                                                   406 
 90 unsigned long va_pa_offset;                    !! 407 static int show_cpuinfo(struct seq_file *m, void *v)
 91 EXPORT_SYMBOL(va_pa_offset);                   << 
 92                                                << 
 93 static inline unsigned long read_mmu_msa(void) << 
 94 {                                                 408 {
 95 #ifdef CONFIG_PAGE_OFFSET_80000000             !! 409     const char *cpu, *mmu, *fpu;
 96         return read_mmu_msa0();                !! 410     unsigned long clockfreq, clockfactor;
 97 #endif                                         << 
 98                                                   411 
 99 #ifdef CONFIG_PAGE_OFFSET_A0000000             !! 412 #define LOOP_CYCLES_68020       (8)
100         return read_mmu_msa1();                !! 413 #define LOOP_CYCLES_68030       (8)
                                                   >> 414 #define LOOP_CYCLES_68040       (3)
                                                   >> 415 #define LOOP_CYCLES_68060       (1)
                                                   >> 416 
                                                   >> 417     if (CPU_IS_020) {
                                                   >> 418         cpu = "68020";
                                                   >> 419         clockfactor = LOOP_CYCLES_68020;
                                                   >> 420     } else if (CPU_IS_030) {
                                                   >> 421         cpu = "68030";
                                                   >> 422         clockfactor = LOOP_CYCLES_68030;
                                                   >> 423     } else if (CPU_IS_040) {
                                                   >> 424         cpu = "68040";
                                                   >> 425         clockfactor = LOOP_CYCLES_68040;
                                                   >> 426     } else if (CPU_IS_060) {
                                                   >> 427         cpu = "68060";
                                                   >> 428         clockfactor = LOOP_CYCLES_68060;
                                                   >> 429     } else {
                                                   >> 430         cpu = "680x0";
                                                   >> 431         clockfactor = 0;
                                                   >> 432     }
                                                   >> 433 
                                                   >> 434 #ifdef CONFIG_M68KFPU_EMU_ONLY
                                                   >> 435     fpu="none(soft float)";
                                                   >> 436 #else
                                                   >> 437     if (m68k_fputype & FPU_68881)
                                                   >> 438         fpu = "68881";
                                                   >> 439     else if (m68k_fputype & FPU_68882)
                                                   >> 440         fpu = "68882";
                                                   >> 441     else if (m68k_fputype & FPU_68040)
                                                   >> 442         fpu = "68040";
                                                   >> 443     else if (m68k_fputype & FPU_68060)
                                                   >> 444         fpu = "68060";
                                                   >> 445     else if (m68k_fputype & FPU_SUNFPA)
                                                   >> 446         fpu = "Sun FPA";
                                                   >> 447     else
                                                   >> 448         fpu = "none";
101 #endif                                            449 #endif
                                                   >> 450 
                                                   >> 451     if (m68k_mmutype & MMU_68851)
                                                   >> 452         mmu = "68851";
                                                   >> 453     else if (m68k_mmutype & MMU_68030)
                                                   >> 454         mmu = "68030";
                                                   >> 455     else if (m68k_mmutype & MMU_68040)
                                                   >> 456         mmu = "68040";
                                                   >> 457     else if (m68k_mmutype & MMU_68060)
                                                   >> 458         mmu = "68060";
                                                   >> 459     else if (m68k_mmutype & MMU_SUN3)
                                                   >> 460         mmu = "Sun-3";
                                                   >> 461     else if (m68k_mmutype & MMU_APOLLO)
                                                   >> 462         mmu = "Apollo";
                                                   >> 463     else
                                                   >> 464         mmu = "unknown";
                                                   >> 465 
                                                   >> 466     clockfreq = loops_per_jiffy*HZ*clockfactor;
                                                   >> 467 
                                                   >> 468     seq_printf(m, "CPU:\t\t%s\n"
                                                   >> 469                    "MMU:\t\t%s\n"
                                                   >> 470                    "FPU:\t\t%s\n"
                                                   >> 471                    "Clocking:\t%lu.%1luMHz\n"
                                                   >> 472                    "BogoMips:\t%lu.%02lu\n"
                                                   >> 473                    "Calibration:\t%lu loops\n",
                                                   >> 474                    cpu, mmu, fpu,
                                                   >> 475                    clockfreq/1000000,(clockfreq/100000)%10,
                                                   >> 476                    loops_per_jiffy/(500000/HZ),(loops_per_jiffy/(5000/HZ))%100,
                                                   >> 477                    loops_per_jiffy);
                                                   >> 478     return 0;
102 }                                                 479 }
103                                                   480 
104 asmlinkage __visible void __init csky_start(un !! 481 static void *c_start(struct seq_file *m, loff_t *pos)
105                                             vo << 
106 {                                                 482 {
107         /* Clean up bss section */             !! 483         return *pos < 1 ? (void *)1 : NULL;
108         memset(__bss_start, 0, __bss_stop - __ !! 484 }
                                                   >> 485 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
                                                   >> 486 {
                                                   >> 487         ++*pos;
                                                   >> 488         return NULL;
                                                   >> 489 }
                                                   >> 490 static void c_stop(struct seq_file *m, void *v)
                                                   >> 491 {
                                                   >> 492 }
                                                   >> 493 struct seq_operations cpuinfo_op = {
                                                   >> 494         .start =        c_start,
                                                   >> 495         .next =         c_next,
                                                   >> 496         .stop =         c_stop,
                                                   >> 497         .show =         show_cpuinfo,
                                                   >> 498 };
                                                   >> 499 
                                                   >> 500 int get_hardware_list(char *buffer)
                                                   >> 501 {
                                                   >> 502     int len = 0;
                                                   >> 503     char model[80];
                                                   >> 504     unsigned long mem;
                                                   >> 505     int i;
                                                   >> 506 
                                                   >> 507     if (mach_get_model)
                                                   >> 508         mach_get_model(model);
                                                   >> 509     else
                                                   >> 510         strcpy(model, "Unknown m68k");
                                                   >> 511 
                                                   >> 512     len += sprintf(buffer+len, "Model:\t\t%s\n", model);
                                                   >> 513     for (mem = 0, i = 0; i < m68k_num_memory; i++)
                                                   >> 514         mem += m68k_memory[i].size;
                                                   >> 515     len += sprintf(buffer+len, "System Memory:\t%ldK\n", mem>>10);
                                                   >> 516 
                                                   >> 517     if (mach_get_hardware_list)
                                                   >> 518         len += mach_get_hardware_list(buffer+len);
109                                                   519 
110         va_pa_offset = read_mmu_msa() & ~(SSEG !! 520     return(len);
                                                   >> 521 }
                                                   >> 522 
                                                   >> 523 
                                                   >> 524 #if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
                                                   >> 525 void __init floppy_setup(char *str, int *ints)
                                                   >> 526 {
                                                   >> 527         if (mach_floppy_setup)
                                                   >> 528                 mach_floppy_setup (str, ints);
                                                   >> 529 }
111                                                   530 
112         pre_trap_init();                       !! 531 #endif
113                                                   532 
114         if (dtb_start == NULL)                 !! 533 void check_bugs(void)
115                 early_init_dt_scan(__dtb_start !! 534 {
116         else                                   !! 535 #ifndef CONFIG_M68KFPU_EMU
117                 early_init_dt_scan(dtb_start); !! 536         if (m68k_fputype == 0) {
                                                   >> 537                 printk( KERN_EMERG "*** YOU DO NOT HAVE A FLOATING POINT UNIT, "
                                                   >> 538                                 "WHICH IS REQUIRED BY LINUX/M68K ***\n" );
                                                   >> 539                 printk( KERN_EMERG "Upgrade your hardware or join the FPU "
                                                   >> 540                                 "emulation project\n" );
                                                   >> 541                 printk( KERN_EMERG "(see http://no-fpu.linux-m68k.org)\n" );
                                                   >> 542                 panic( "no FPU" );
                                                   >> 543         }
118                                                   544 
119         start_kernel();                        !! 545 #endif /* CONFIG_SUN3 */
120                                                   546 
121         asm volatile("br .\n");                << 
122 }                                                 547 }
123                                                   548 

~ [ 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