You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(135) |
Nov
(123) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(244) |
Feb
(72) |
Mar
(221) |
Apr
(91) |
May
(104) |
Jun
(93) |
Jul
(78) |
Aug
(1) |
Sep
(1) |
Oct
(29) |
Nov
(98) |
Dec
(20) |
2003 |
Jan
|
Feb
(21) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(18) |
Sep
(18) |
Oct
(23) |
Nov
(12) |
Dec
(6) |
2004 |
Jan
(2) |
Feb
(32) |
Mar
|
Apr
(12) |
May
(11) |
Jun
(11) |
Jul
|
Aug
(9) |
Sep
|
Oct
(15) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(2) |
Mar
(11) |
Apr
(6) |
May
(1) |
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
(25) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
(2) |
Dec
(2) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(10) |
May
(1) |
Jun
(6) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
From: James S. <jsi...@us...> - 2002-03-16 17:55:24
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv21654 Removed Files: dummycon.c Log Message: No longer needed. --- dummycon.c DELETED --- |
From: James S. <jsi...@us...> - 2002-03-16 17:46:15
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv19395 Removed Files: fbgen2.c Log Message: Removal old outdated stuff. --- fbgen2.c DELETED --- |
From: James S. <jsi...@us...> - 2002-03-16 16:36:13
|
Update of /cvsroot/linuxconsole/ruby/utils In directory usw-pr-cvs1:/tmp/cvs-serv25823/utils Modified Files: remove-obsolete-files Log Message: m68k cleanups. Index: remove-obsolete-files =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/remove-obsolete-files,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- remove-obsolete-files 15 Mar 2002 18:28:12 -0000 1.30 +++ remove-obsolete-files 16 Mar 2002 16:36:10 -0000 1.31 @@ -76,8 +76,11 @@ rm -fv include/asm-m68k/adb_mouse.h rm -fv include/asm-m68k/atari_joystick.h rm -fv include/asm-m68k/mac_mouse.h +rm -fv include/asm-m68k/atarikb.h +rm -fv include/asm-m68k/keyboard.h +rm -fv include/asm-m68k/q40_keyboard.h rm -fv include/asm-ppc/keyboard.h -rm -fv include/asm/keyboard.h +rm -fv include/asm-i386/keyboard.h rm -fv include/linux/adb_mouse.h rm -fv include/linux/kbd_ll.h rm -fv include/linux/logibusmouse.h |
From: James S. <jsi...@us...> - 2002-03-16 16:36:13
|
Update of /cvsroot/linuxconsole/ruby/linux/include/asm-m68k In directory usw-pr-cvs1:/tmp/cvs-serv25823/linux/include/asm-m68k Added Files: machdep.h Log Message: m68k cleanups. --- NEW FILE: machdep.h --- #ifndef _M68K_MACHDEP_H #define _M68K_MACHDEP_H #include <linux/seq_file.h> struct pt_regs; struct mktime; struct hwclk_time; struct buffer_head; extern void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)); /* machine dependent irq functions */ extern void (*mach_init_IRQ) (void); extern void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); extern void (*mach_free_irq) (unsigned int irq, void *dev_id); extern void (*mach_get_model) (char *model); extern int (*mach_get_hardware_list) (char *buffer); extern int (*mach_get_irq_list) (struct seq_file *p, void *v); extern void (*mach_process_int) (int irq, struct pt_regs *fp); /* machine dependent timer functions */ extern unsigned long (*mach_gettimeoffset)(void); extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour, int *min, int *sec); extern int (*mach_hwclk)(int, struct hwclk_time*); extern int (*mach_set_clock_mmss)(unsigned long); extern void (*mach_reset)( void ); extern void (*mach_halt)( void ); extern void (*mach_power_off)( void ); extern unsigned long (*mach_hd_init) (unsigned long, unsigned long); extern void (*mach_hd_setup)(char *, int *); extern long mach_max_dma_address; extern void (*mach_floppy_setup)(char *, int *); extern void (*mach_heartbeat) (int); extern void (*mach_l2_flush) (int); #endif /* _M68K_MACHDEP_H */ |
From: James S. <jsi...@us...> - 2002-03-15 19:02:36
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv16208 Added Files: setup.c Log Message: Completely removed aux_device_present flag. --- NEW FILE: setup.c --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1995 Linus Torvalds * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Ralf Baechle * Copyright (C) 1996 Stoned Elipot * Copyright (C) 2000 Maciej W. Rozycki */ #include <linux/config.h> #include <linux/errno.h> #include <linux/hdreg.h> #include <linux/init.h> #include <linux/ioport.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/stddef.h> #include <linux/string.h> #include <linux/unistd.h> #include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> #include <linux/utsname.h> #include <linux/a.out.h> #include <linux/tty.h> #include <linux/bootmem.h> #include <linux/blk.h> #include <linux/ide.h> #include <linux/timex.h> #include <asm/asm.h> #include <asm/bootinfo.h> #include <asm/cachectl.h> #include <asm/cpu.h> #include <asm/io.h> #include <asm/stackframe.h> #include <asm/system.h> #ifdef CONFIG_SGI_IP22 #include <asm/sgialib.h> #endif struct mips_cpuinfo boot_cpu_data = { 0, NULL, NULL, 0 }; /* * Not all of the MIPS CPUs have the "wait" instruction available. Moreover, * the implementation of the "wait" feature differs between CPU families. This * points to the function that implements CPU specific wait. * The wait instruction stops the pipeline and reduces the power consumption of * the CPU very much. */ void (*cpu_wait)(void) = NULL; /* * There are several bus types available for MIPS machines. "RISC PC" * type machines have ISA, EISA, VLB or PCI available, DECstations * have Turbochannel or Q-Bus, SGI has GIO, there are lots of VME * boxes ... * This flag is set if a EISA slots are available. */ int EISA_bus = 0; struct screen_info screen_info; extern struct fd_ops no_fd_ops; struct fd_ops *fd_ops; #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) extern struct ide_ops no_ide_ops; struct ide_ops *ide_ops; #endif extern void * __rd_start, * __rd_end; extern struct rtc_ops no_rtc_ops; struct rtc_ops *rtc_ops; #ifdef CONFIG_PC_KEYB extern struct kbd_ops no_kbd_ops; struct kbd_ops *kbd_ops; #endif /* * Setup information * * These are initialized so they are in the .data section */ unsigned long mips_machtype = MACH_UNKNOWN; unsigned long mips_machgroup = MACH_GROUP_UNKNOWN; struct boot_mem_map boot_mem_map; extern char _ftext, _etext, _fdata, _edata, _end; static char command_line[COMMAND_LINE_SIZE]; char saved_command_line[COMMAND_LINE_SIZE]; extern char arcs_cmdline[COMMAND_LINE_SIZE]; /* * mips_io_port_base is the begin of the address space to which x86 style * I/O ports are mapped. */ unsigned long mips_io_port_base; /* * isa_slot_offset is the address where E(ISA) busaddress 0 is is mapped * for the processor. */ unsigned long isa_slot_offset; extern void sgi_sysinit(void); extern void SetUpBootInfo(void); extern void loadmmu(void); extern asmlinkage void start_kernel(void); extern void prom_init(int, char **, char **, int *); static struct resource code_resource = { "Kernel code" }; static struct resource data_resource = { "Kernel data" }; /* * Probe whether cpu has config register by trying to play with * alternate cache bit and see whether it matters. * It's used by cpu_probe to distinguish between R3000A and R3081. */ static inline int cpu_has_confreg(void) { #ifdef CONFIG_CPU_R3000 extern unsigned long r3k_cache_size(unsigned long); unsigned long size1, size2; unsigned long cfg = read_32bit_cp0_register(CP0_CONF); size1 = r3k_cache_size(ST0_ISC); write_32bit_cp0_register(CP0_CONF, cfg^CONF_AC); size2 = r3k_cache_size(ST0_ISC); write_32bit_cp0_register(CP0_CONF, cfg); return size1 != size2; #else return 0; #endif } /* declaration of the global struct */ struct mips_cpu mips_cpu = {PRID_IMP_UNKNOWN, CPU_UNKNOWN, 0, 0, 0, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}}; /* Shortcut for assembler access to mips_cpu.options */ int *cpuoptions = &mips_cpu.options; #define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4KTLB \ | MIPS_CPU_COUNTER | MIPS_CPU_CACHE_CDEX) static inline void cpu_probe(void) { #ifdef CONFIG_CPU_MIPS32 unsigned long config1; #endif mips_cpu.processor_id = read_32bit_cp0_register(CP0_PRID); switch (mips_cpu.processor_id & 0xff0000) { case PRID_COMP_LEGACY: switch (mips_cpu.processor_id & 0xff00) { case PRID_IMP_R2000: mips_cpu.cputype = CPU_R2000; mips_cpu.isa_level = MIPS_CPU_ISA_I; mips_cpu.options = MIPS_CPU_TLB; mips_cpu.tlbsize = 64; break; case PRID_IMP_R3000: if ((mips_cpu.processor_id & 0xff) == PRID_REV_R3000A) if (cpu_has_confreg()) mips_cpu.cputype = CPU_R3081E; else mips_cpu.cputype = CPU_R3000A; else mips_cpu.cputype = CPU_R3000; mips_cpu.isa_level = MIPS_CPU_ISA_I; mips_cpu.options = MIPS_CPU_TLB; mips_cpu.tlbsize = 64; break; case PRID_IMP_R4000: if ((mips_cpu.processor_id & 0xff) == PRID_REV_R4400) mips_cpu.cputype = CPU_R4400SC; else mips_cpu.cputype = CPU_R4000SC; mips_cpu.isa_level = MIPS_CPU_ISA_III; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | MIPS_CPU_WATCH | MIPS_CPU_VCE; mips_cpu.tlbsize = 48; break; case PRID_IMP_VR41XX: mips_cpu.cputype = CPU_VR41XX; mips_cpu.isa_level = MIPS_CPU_ISA_III; mips_cpu.options = R4K_OPTS; mips_cpu.tlbsize = 32; break; case PRID_IMP_R4600: mips_cpu.cputype = CPU_R4600; mips_cpu.isa_level = MIPS_CPU_ISA_III; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU; mips_cpu.tlbsize = 48; break; /* * This processor doesn't have an MMU, so it's not "real easy" to * run Linux on it. It is left purely for documentation. * case PRID_IMP_R4650: mips_cpu.cputype = CPU_R4650; mips_cpu.isa_level = MIPS_CPU_ISA_III; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU; mips_cpu.tlbsize = 48; break; */ case PRID_IMP_TX39: mips_cpu.isa_level = MIPS_CPU_ISA_I; mips_cpu.options = MIPS_CPU_TLB; switch (mips_cpu.processor_id & 0xff) { case PRID_REV_TX3912: mips_cpu.cputype = CPU_TX3912; mips_cpu.tlbsize = 32; break; case PRID_REV_TX3922: mips_cpu.cputype = CPU_TX3922; mips_cpu.tlbsize = 64; break; case PRID_REV_TX3927: mips_cpu.cputype = CPU_TX3927; mips_cpu.tlbsize = 64; break; default: mips_cpu.cputype = CPU_UNKNOWN; break; } break; case PRID_IMP_R4700: mips_cpu.cputype = CPU_R4700; mips_cpu.isa_level = MIPS_CPU_ISA_III; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR; mips_cpu.tlbsize = 48; break; case PRID_IMP_R5000: mips_cpu.cputype = CPU_R5000; mips_cpu.isa_level = MIPS_CPU_ISA_IV; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR; mips_cpu.tlbsize = 48; break; case PRID_IMP_R5432: mips_cpu.cputype = CPU_R5432; mips_cpu.isa_level = MIPS_CPU_ISA_IV; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR; mips_cpu.tlbsize = 48; break; case PRID_IMP_NEVADA: mips_cpu.cputype = CPU_NEVADA; mips_cpu.isa_level = MIPS_CPU_ISA_IV; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | MIPS_CPU_DIVEC; mips_cpu.tlbsize = 48; mips_cpu.icache.ways = 2; mips_cpu.dcache.ways = 2; break; case PRID_IMP_R6000: mips_cpu.cputype = CPU_R6000; mips_cpu.isa_level = MIPS_CPU_ISA_II; mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_FPU; mips_cpu.tlbsize = 32; break; case PRID_IMP_R6000A: mips_cpu.cputype = CPU_R6000A; mips_cpu.isa_level = MIPS_CPU_ISA_II; mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_FPU; mips_cpu.tlbsize = 32; break; case PRID_IMP_RM7000: mips_cpu.cputype = CPU_RM7000; mips_cpu.isa_level = MIPS_CPU_ISA_IV; mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR; break; case PRID_IMP_R8000: mips_cpu.cputype = CPU_R8000; mips_cpu.isa_level = MIPS_CPU_ISA_IV; mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_FPU | MIPS_CPU_32FPR; mips_cpu.tlbsize = 384; /* has wierd TLB: 3-way x 128 */ break; case PRID_IMP_R10000: mips_cpu.cputype = CPU_R10000; mips_cpu.isa_level = MIPS_CPU_ISA_IV; mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_FPU | MIPS_CPU_32FPR | MIPS_CPU_COUNTER | MIPS_CPU_WATCH; mips_cpu.tlbsize = 64; break; default: mips_cpu.cputype = CPU_UNKNOWN; break; } break; #ifdef CONFIG_CPU_MIPS32 case PRID_COMP_MIPS: switch (mips_cpu.processor_id & 0xff00) { case PRID_IMP_4KC: mips_cpu.cputype = CPU_4KC; goto cpu_4kc; case PRID_IMP_4KEC: mips_cpu.cputype = CPU_4KEC; goto cpu_4kc; case PRID_IMP_4KSC: mips_cpu.cputype = CPU_4KSC; cpu_4kc: /* Why do we set all these options by default, THEN query them?? */ mips_cpu.cputype = MIPS_CPU_ISA_M32; mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | MIPS_CPU_WATCH; config1 = read_mips32_cp0_config1(); if (config1 & (1 << 3)) mips_cpu.options |= MIPS_CPU_WATCH; if (config1 & (1 << 2)) mips_cpu.options |= MIPS_CPU_MIPS16; if (config1 & 1) mips_cpu.options |= MIPS_CPU_FPU; mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT; break; case PRID_IMP_5KC: mips_cpu.cputype = CPU_5KC; mips_cpu.cputype = MIPS_CPU_ISA_M64; /* See comment above about querying options */ mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | MIPS_CPU_WATCH; config1 = read_mips32_cp0_config1(); if (config1 & (1 << 3)) mips_cpu.options |= MIPS_CPU_WATCH; if (config1 & (1 << 2)) mips_cpu.options |= MIPS_CPU_MIPS16; if (config1 & 1) mips_cpu.options |= MIPS_CPU_FPU; break; mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT; default: mips_cpu.cputype = CPU_UNKNOWN; break; } break; #endif case PRID_COMP_ALCHEMY: switch (mips_cpu.processor_id & 0xff00) { #ifdef CONFIG_CPU_MIPS32 case PRID_IMP_AU1000: mips_cpu.cputype = CPU_AU1000; mips_cpu.isa_level = MIPS_CPU_ISA_M32; mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | MIPS_CPU_WATCH; config1 = read_mips32_cp0_config1(); if (config1 & (1 << 3)) mips_cpu.options |= MIPS_CPU_WATCH; if (config1 & (1 << 2)) mips_cpu.options |= MIPS_CPU_MIPS16; if (config1 & 1) mips_cpu.options |= MIPS_CPU_FPU; mips_cpu.scache.flags = MIPS_CACHE_NOT_PRESENT; break; #endif default: mips_cpu.cputype = CPU_UNKNOWN; break; } break; case PRID_COMP_SIBYTE: switch (mips_cpu.processor_id & 0xff00) { case PRID_IMP_SB1: mips_cpu.cputype = CPU_SB1; mips_cpu.options = MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | MIPS_CPU_FPU | MIPS_CPU_VCE; break; default: mips_cpu.cputype = CPU_UNKNOWN; break; } break; default: mips_cpu.cputype = CPU_UNKNOWN; } } asmlinkage void __init init_arch(int argc, char **argv, char **envp, int *prom_vec) { unsigned int s; /* Determine which MIPS variant we are running on. */ cpu_probe(); prom_init(argc, argv, envp, prom_vec); #ifdef CONFIG_SGI_IP22 sgi_sysinit(); #endif /* * Determine the mmu/cache attached to this machine, * then flush the tlb and caches. On the r4xx0 * variants this also sets CP0_WIRED to zero. */ loadmmu(); /* Disable coprocessors and set FPU for 16 FPRs */ s = read_32bit_cp0_register(CP0_STATUS); s &= ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR); s |= ST0_CU0; write_32bit_cp0_register(CP0_STATUS, s); start_kernel(); } void __init add_memory_region(unsigned long start, unsigned long size, long type) { int x = boot_mem_map.nr_map; if (x == BOOT_MEM_MAP_MAX) { printk("Ooops! Too many entries in the memory map!\n"); return; } boot_mem_map.map[x].addr = start; boot_mem_map.map[x].size = size; boot_mem_map.map[x].type = type; boot_mem_map.nr_map++; } static void __init print_memory_map(void) { int i; for (i = 0; i < boot_mem_map.nr_map; i++) { printk(" memory: %08lx @ %08lx ", boot_mem_map.map[i].size, boot_mem_map.map[i].addr); switch (boot_mem_map.map[i].type) { case BOOT_MEM_RAM: printk("(usable)\n"); break; case BOOT_MEM_ROM_DATA: printk("(ROM data)\n"); break; case BOOT_MEM_RESERVED: printk("(reserved)\n"); break; default: printk("type %lu\n", boot_mem_map.map[i].type); break; } } } static inline void parse_mem_cmdline(void) { char c = ' ', *to = command_line, *from = saved_command_line; unsigned long start_at, mem_size; int len = 0; int usermem = 0; printk("Determined physical RAM map:\n"); print_memory_map(); for (;;) { /* * "mem=XXX[kKmM]" defines a memory region from * 0 to <XXX>, overriding the determined size. * "mem=XXX[KkmM]@YYY[KkmM]" defines a memory region from * <YYY> to <YYY>+<XXX>, overriding the determined size. */ if (c == ' ' && !memcmp(from, "mem=", 4)) { if (to != command_line) to--; /* * If a user specifies memory size, we * blow away any automatically generated * size. */ if (usermem == 0) { boot_mem_map.nr_map = 0; usermem = 1; } mem_size = memparse(from + 4, &from); if (*from == '@') start_at = memparse(from + 1, &from); else start_at = 0; add_memory_region(start_at, mem_size, BOOT_MEM_RAM); } c = *(from++); if (!c) break; if (COMMAND_LINE_SIZE <= ++len) break; *(to++) = c; } *to = '\0'; if (usermem) { printk("User-defined physical RAM map:\n"); print_memory_map(); } } void __init setup_arch(char **cmdline_p) { void atlas_setup(void); void baget_setup(void); void ddb_setup(void); void decstation_setup(void); void deskstation_setup(void); void jazz_setup(void); void sni_rm200_pci_setup(void); void sgi_setup(void); void ev96100_setup(void); void malta_setup(void); void momenco_ocelot_setup(void); void nino_setup(void); unsigned long bootmap_size; unsigned long start_pfn, max_pfn, first_usable_pfn; int i; #ifdef CONFIG_BLK_DEV_FD fd_ops = &no_fd_ops; #endif #ifdef CONFIG_BLK_DEV_IDE ide_ops = &no_ide_ops; #endif #ifdef CONFIG_PC_KEYB kbd_ops = &no_kbd_ops; #endif rtc_ops = &no_rtc_ops; switch(mips_machgroup) { #ifdef CONFIG_BAGET_MIPS case MACH_GROUP_BAGET: baget_setup(); break; #endif #ifdef CONFIG_DECSTATION case MACH_GROUP_DEC: decstation_setup(); break; #endif #ifdef CONFIG_MIPS_ATLAS case MACH_GROUP_UNKNOWN: atlas_setup(); break; #endif #ifdef CONFIG_MIPS_JAZZ case MACH_GROUP_JAZZ: jazz_setup(); break; #endif #ifdef CONFIG_MIPS_MALTA case MACH_GROUP_UNKNOWN: malta_setup(); break; #endif #ifdef CONFIG_MOMENCO_OCELOT case MACH_GROUP_MOMENCO: momenco_ocelot_setup(); break; #endif #ifdef CONFIG_SGI_IP22 /* As of now this is only IP22. */ case MACH_GROUP_SGI: sgi_setup(); break; #endif #ifdef CONFIG_SNI_RM200_PCI case MACH_GROUP_SNI_RM: sni_rm200_pci_setup(); break; #endif #ifdef CONFIG_DDB5074 case MACH_GROUP_NEC_DDB: ddb_setup(); break; #endif #ifdef CONFIG_DDB5476 case MACH_GROUP_NEC_DDB: ddb_setup(); break; #endif #ifdef CONFIG_DDB5477 case MACH_GROUP_NEC_DDB: ddb_setup(); break; #endif #ifdef CONFIG_MIPS_EV96100 case MACH_GROUP_GALILEO: ev96100_setup(); break; #endif #ifdef CONFIG_MIPS_EV64120 case MACH_GROUP_GALILEO: ev64120_setup(); break; #endif #if defined(CONFIG_MIPS_IVR) || defined(CONFIG_MIPS_ITE8172) case MACH_GROUP_ITE: case MACH_GROUP_GLOBESPAN: it8172_setup(); break; #endif #ifdef CONFIG_NINO case MACH_GROUP_PHILIPS: nino_setup(); break; #endif #ifdef CONFIG_MIPS_PB1000 case MACH_GROUP_ALCHEMY: au1000_setup(); break; #endif default: panic("Unsupported architecture"); } strncpy(command_line, arcs_cmdline, sizeof command_line); command_line[sizeof command_line - 1] = 0; strcpy(saved_command_line, command_line); *cmdline_p = command_line; parse_mem_cmdline(); #define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT) #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) #define PFN_PHYS(x) ((x) << PAGE_SHIFT) /* * Partially used pages are not usable - thus * we are rounding upwards. */ start_pfn = PFN_UP(__pa(&_end)); /* Find the highest page frame number we have available. */ max_pfn = 0; first_usable_pfn = -1UL; for (i = 0; i < boot_mem_map.nr_map; i++) { unsigned long start, end; if (boot_mem_map.map[i].type != BOOT_MEM_RAM) continue; start = PFN_UP(boot_mem_map.map[i].addr); end = PFN_DOWN(boot_mem_map.map[i].addr + boot_mem_map.map[i].size); if (start >= end) continue; if (end > max_pfn) max_pfn = end; if (start < first_usable_pfn) { if (start > start_pfn) { first_usable_pfn = start; } else if (end > start_pfn) { first_usable_pfn = start_pfn; } } } /* Initialize the boot-time allocator. */ bootmap_size = init_bootmem(first_usable_pfn, max_pfn); /* * Register fully available low RAM pages with the bootmem allocator. */ for (i = 0; i < boot_mem_map.nr_map; i++) { unsigned long curr_pfn, last_pfn, size; /* * Reserve usable memory. */ if (boot_mem_map.map[i].type != BOOT_MEM_RAM) continue; /* * We are rounding up the start address of usable memory: */ curr_pfn = PFN_UP(boot_mem_map.map[i].addr); if (curr_pfn >= max_pfn) continue; if (curr_pfn < start_pfn) curr_pfn = start_pfn; /* * ... and at the end of the usable range downwards: */ last_pfn = PFN_DOWN(boot_mem_map.map[i].addr + boot_mem_map.map[i].size); if (last_pfn > max_pfn) last_pfn = max_pfn; /* * ... finally, did all the rounding and playing * around just make the area go away? */ if (last_pfn <= curr_pfn) continue; size = last_pfn - curr_pfn; free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(size)); } /* Reserve the bootmap memory. */ reserve_bootmem(PFN_PHYS(first_usable_pfn), bootmap_size); #ifdef CONFIG_BLK_DEV_INITRD /* Board specific code should have set up initrd_start and initrd_end */ ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); if( __rd_start != __rd_end ) { initrd_start = (unsigned long)&__rd_start; initrd_end = (unsigned long)&__rd_end; } initrd_below_start_ok = 1; if (initrd_start) { unsigned long initrd_size = ((unsigned char *)initrd_end) - ((unsigned char *)initrd_start); printk("Initial ramdisk at: 0x%p (%lu bytes)\n", (void *)initrd_start, initrd_size); if ((void *)initrd_end > phys_to_virt(PFN_PHYS(max_low_pfn))) { printk("initrd extends beyond end of memory " "(0x%lx > 0x%p)\ndisabling initrd\n", initrd_end, phys_to_virt(PFN_PHYS(max_low_pfn))); initrd_start = initrd_end = 0; } } #endif /* CONFIG_BLK_DEV_INITRD */ paging_init(); code_resource.start = virt_to_bus(&_ftext); code_resource.end = virt_to_bus(&_etext) - 1; data_resource.start = virt_to_bus(&_fdata); data_resource.end = virt_to_bus(&_edata) - 1; /* * Request address space for all standard RAM. */ for (i = 0; i < boot_mem_map.nr_map; i++) { struct resource *res; res = alloc_bootmem(sizeof(struct resource)); switch (boot_mem_map.map[i].type) { case BOOT_MEM_RAM: case BOOT_MEM_ROM_DATA: res->name = "System RAM"; break; case BOOT_MEM_RESERVED: default: res->name = "reserved"; } res->start = boot_mem_map.map[i].addr; res->end = res->start + boot_mem_map.map[i].size - 1; res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; request_resource(&iomem_resource, res); /* * We dont't know which RAM region contains kernel data, * so we try it repeatedly and let the resource manager * test it. */ request_resource(res, &code_resource); request_resource(res, &data_resource); } } void r3081_wait(void) { unsigned long cfg = read_32bit_cp0_register(CP0_CONF); write_32bit_cp0_register(CP0_CONF, cfg|CONF_HALT); } void r4k_wait(void) { __asm__(".set\tmips3\n\t" "wait\n\t" ".set\tmips0"); } |
From: James S. <jsi...@us...> - 2002-03-15 19:01:42
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15944/kernel Log Message: Directory /cvsroot/linuxconsole/ruby/linux/arch/mips/kernel added to the repository |
From: James S. <jsi...@us...> - 2002-03-15 19:01:13
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/x86_64/mm In directory usw-pr-cvs1:/tmp/cvs-serv15726/arch/x86_64/mm Added Files: fault.c Log Message: Some missed files. --- NEW FILE: fault.c --- /* * linux/arch/x86-64/mm/fault.c * * Copyright (C) 1995 Linus Torvalds */ #include <linux/signal.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/string.h> #include <linux/types.h> #include <linux/ptrace.h> #include <linux/mman.h> #include <linux/mm.h> #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/interrupt.h> #include <linux/init.h> #include <linux/tty.h> #include <asm/system.h> #include <asm/uaccess.h> #include <asm/pgalloc.h> #include <asm/hardirq.h> extern void die(const char *,struct pt_regs *,long); asmlinkage void do_invalid_op(struct pt_regs *, unsigned long); extern unsigned long idt; extern spinlock_t console_lock, timerlist_lock; void bust_spinlocks(int yes) { spin_lock_init(&timerlist_lock); if (yes) { oops_in_progress = 1; #ifdef CONFIG_SMP global_irq_lock = 0; /* Many serial drivers do __global_cli() */ #endif } else { int loglevel_save = console_loglevel; oops_in_progress = 0; /* * OK, the message is on the console. Now we call printk() * without oops_in_progress set so that printk will give klogd * a poke. Hold onto your hats... */ console_loglevel = 15; /* NMI oopser may have shut the console up */ printk(" "); console_loglevel = loglevel_save; } } void do_BUG(const char *file, int line) { bust_spinlocks(1); printk("kernel BUG at %s:%d!\n", file, line); } void dump_pagetable(unsigned long address) { static char *name[] = { "PML4", "PGD", "PDE", "PTE" }; int i, shift; unsigned long page; asm("movq %%cr3,%0":"=r" (page)); shift = 9+9+9+12; address &= ~0xFFFF000000000000UL; for (i = 0; i < 4; i++) { page = ((unsigned long *) __va(page))[(address >> shift) & 0x1FFU]; printk("%s: %016lx ", name[i], page); if ((page & (1 | (1<<7))) != 1) /* Not present or 2MB page */ break; page &= ~0xFFFUL; shift -= 9; } printk("\n"); } /* * This routine handles page faults. It determines the address, * and the problem, and then passes it off to one of the appropriate * routines. * * error_code: * bit 0 == 0 means no page found, 1 means protection fault * bit 1 == 0 means read, 1 means write * bit 2 == 0 means kernel, 1 means user-mode */ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) { struct task_struct *tsk; struct mm_struct *mm; struct vm_area_struct * vma; unsigned long address; unsigned long fixup; int write; siginfo_t info; /* get the address */ __asm__("movq %%cr2,%0":"=r" (address)); tsk = current; mm = tsk->mm; info.si_code = SEGV_MAPERR; if (address >= TASK_SIZE) goto vmalloc_fault; /* * If we're in an interrupt or have no user * context, we must not take the fault.. */ if (in_interrupt() || !mm) goto no_context; down_read(&mm->mmap_sem); vma = find_vma(mm, address); #if 0 printk("fault at %lx rip:%lx rsp:%lx err:%lx thr:%x ", address,regs->rip,regs->rsp,error_code,tsk->thread.flags); if (vma) printk("vma %lx-%lx prot:%lx flags:%lx",vma->vm_start,vma->vm_end, vma->vm_page_prot,vma->vm_flags); printk("\n"); #endif if (!vma) goto bad_area; if (vma->vm_start <= address) goto good_area; if (!(vma->vm_flags & VM_GROWSDOWN)) goto bad_area; if (error_code & 4) { // XXX: align red zone size with ABI if (address + 128 < regs->rsp) goto bad_area; } if (expand_stack(vma, address)) goto bad_area; /* * Ok, we have a good vm_area for this memory access, so * we can handle it.. */ good_area: info.si_code = SEGV_ACCERR; write = 0; switch (error_code & 3) { default: /* 3: write, present */ /* fall through */ case 2: /* write, not present */ if (!(vma->vm_flags & VM_WRITE)) goto bad_area; write++; break; case 1: /* read, present */ goto bad_area; case 0: /* read, not present */ if (!(vma->vm_flags & (VM_READ | VM_EXEC))) goto bad_area; } survive: /* * If for any reason at all we couldn't handle the fault, * make sure we exit gracefully rather than endlessly redo * the fault. */ switch (handle_mm_fault(mm, vma, address, write)) { case 1: tsk->min_flt++; break; case 2: tsk->maj_flt++; break; case 0: goto do_sigbus; default: goto out_of_memory; } up_read(&mm->mmap_sem); return; /* * Something tried to access memory that isn't in our memory map.. * Fix it, but check if it's kernel or user first.. */ bad_area: up_read(&mm->mmap_sem); bad_area_nosemaphore: /* User mode accesses just cause a SIGSEGV */ if (error_code & 4) { printk(KERN_ERR "%.20s[%d] segfaulted rip:%lx rsp:%lx adr:%lx err:%lx\n", tsk->comm, tsk->pid, regs->rip, regs->rsp, address, error_code); tsk->thread.cr2 = address; tsk->thread.error_code = error_code; tsk->thread.trap_no = 14; info.si_signo = SIGSEGV; info.si_errno = 0; /* info.si_code has been set above */ info.si_addr = (void *)address; force_sig_info(SIGSEGV, &info, tsk); return; } no_context: /* Are we prepared to handle this kernel fault? */ if ((fixup = search_exception_table(regs->rip)) != 0) { regs->rip = fixup; return; } /* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ bust_spinlocks(1); if (address < PAGE_SIZE) printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); else printk(KERN_ALERT "Unable to handle kernel paging request"); printk(" at virtual address %016lx\n",address); printk(" printing rip:\n"); printk("%016lx\n", regs->rip); dump_pagetable(address); die("Oops", regs, error_code); bust_spinlocks(0); do_exit(SIGKILL); /* * We ran out of memory, or some other thing happened to us that made * us unable to handle the page fault gracefully. */ out_of_memory: up_read(&mm->mmap_sem); if (current->pid == 1) { yield(); down_read(&mm->mmap_sem); goto survive; } printk("VM: killing process %s\n", tsk->comm); if (error_code & 4) do_exit(SIGKILL); goto no_context; do_sigbus: up_read(&mm->mmap_sem); /* * Send a sigbus, regardless of whether we were in kernel * or user mode. */ tsk->thread.cr2 = address; tsk->thread.error_code = error_code; tsk->thread.trap_no = 14; info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = BUS_ADRERR; info.si_addr = (void *)address; force_sig_info(SIGBUS, &info, tsk); /* Kernel mode? Handle exceptions or die */ if (!(error_code & 4)) goto no_context; vmalloc_fault: { /* * Synchronize the kernel space top level page-table * with the 'reference' page table. * Currently it only works for first and last 512 GB of * kernel memory FIXME * */ level4_t *l4pd = level4_offset_k(address); int offset = __pgd_offset(address); pgd_t *pgd, *pgd_k; pmd_t *pmd, *pmd_k; if (! level4_val(*l4pd)) { printk(KERN_ERR "fatal - no entry in level4_page for %lx\n", address); goto bad_area_nosemaphore; } pgd = level3_offset_k(l4pd, address); pgd_k = init_mm.pgd + offset; if (!pgd_present(*pgd)) { if (!pgd_present(*pgd_k)) goto bad_area_nosemaphore; set_pgd(pgd, *pgd_k); return; } pmd = pmd_offset(pgd, address); pmd_k = pmd_offset(pgd_k, address); if (pmd_present(*pmd) || !pmd_present(*pmd_k)) goto bad_area_nosemaphore; set_pmd(pmd, *pmd_k); return; } } |
From: James S. <jsi...@us...> - 2002-03-15 19:01:13
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/keyboard In directory usw-pr-cvs1:/tmp/cvs-serv15726/drivers/input/keyboard Added Files: lk201.c lk201.h Log Message: Some missed files. --- NEW FILE: lk201.c --- /* * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * */ #include <linux/errno.h> #include <linux/tty.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/kbd_ll.h> #include <asm/wbflush.h> #include <asm/dec/tc.h> #include <asm/dec/machtype.h> #include "zs.h" #include "lk201.h" /* Simple translation table for the SysRq keys */ #ifdef CONFIG_MAGIC_SYSRQ /* * Actually no translation at all, at least until we figure out * how to define SysRq for LK201 and friends. --macro */ unsigned char lk201_sysrq_xlate[128]; unsigned char *kbd_sysrq_xlate = lk201_sysrq_xlate; #endif #define KEYB_LINE 3 static int __init lk201_init(struct dec_serial *); static void __init lk201_info(struct dec_serial *); static void lk201_kbd_rx_char(unsigned char, unsigned char); struct zs_hook lk201_kbdhook = { init_channel: lk201_init, init_info: lk201_info, rx_char: NULL, poll_rx_char: NULL, poll_tx_char: NULL, cflags: B4800 | CS8 | CSTOPB | CLOCAL }; /* * This is used during keyboard initialisation */ static unsigned char lk201_reset_string[] = { LK_CMD_LEDS_ON, LK_PARAM_LED_MASK(0xf), /* show we are resetting */ LK_CMD_SET_DEFAULTS, LK_CMD_MODE(LK_MODE_RPT_DOWN, 1), LK_CMD_MODE(LK_MODE_RPT_DOWN, 2), LK_CMD_MODE(LK_MODE_RPT_DOWN, 3), LK_CMD_MODE(LK_MODE_RPT_DOWN, 4), LK_CMD_MODE(LK_MODE_DOWN_UP, 5), LK_CMD_MODE(LK_MODE_DOWN_UP, 6), LK_CMD_MODE(LK_MODE_RPT_DOWN, 7), LK_CMD_MODE(LK_MODE_RPT_DOWN, 8), LK_CMD_MODE(LK_MODE_RPT_DOWN, 9), LK_CMD_MODE(LK_MODE_RPT_DOWN, 10), LK_CMD_MODE(LK_MODE_RPT_DOWN, 11), LK_CMD_MODE(LK_MODE_RPT_DOWN, 12), LK_CMD_MODE(LK_MODE_DOWN, 13), LK_CMD_MODE(LK_MODE_RPT_DOWN, 14), LK_CMD_ENB_RPT, LK_CMD_DIS_KEYCLK, LK_CMD_RESUME, LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4), LK_CMD_LEDS_OFF, LK_PARAM_LED_MASK(0xf) }; static int __init lk201_reset(struct dec_serial *info) { int i; for (i = 0; i < sizeof(lk201_reset_string); i++) if (info->hook->poll_tx_char(info, lk201_reset_string[i])) { printk(__FUNCTION__" transmit timeout\n"); return -EIO; } return 0; } void kbd_leds(unsigned char leds) { return; } int kbd_setkeycode(unsigned int scancode, unsigned int keycode) { return -EINVAL; } int kbd_getkeycode(unsigned int scancode) { return -EINVAL; } int kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode) { *keycode = scancode; return 1; } char kbd_unexpected_up(unsigned char keycode) { return 0x80; } static void lk201_kbd_rx_char(unsigned char ch, unsigned char stat) { static int shift_state = 0; static int prev_scancode; unsigned char c = scancodeRemap[ch]; if (!stat || stat == 4) { switch (ch) { case LK_KEY_ACK: break; case LK_KEY_LOCK: shift_state ^= LK_LOCK; handle_scancode(c, shift_state && LK_LOCK ? 1 : 0); break; case LK_KEY_SHIFT: shift_state ^= LK_SHIFT; handle_scancode(c, shift_state && LK_SHIFT ? 1 : 0); break; case LK_KEY_CTRL: shift_state ^= LK_CTRL; handle_scancode(c, shift_state && LK_CTRL ? 1 : 0); break; case LK_KEY_COMP: shift_state ^= LK_COMP; handle_scancode(c, shift_state && LK_COMP ? 1 : 0); break; case LK_KEY_RELEASE: if (shift_state & LK_SHIFT) handle_scancode(scancodeRemap[LK_KEY_SHIFT], 0); if (shift_state & LK_CTRL) handle_scancode(scancodeRemap[LK_KEY_CTRL], 0); if (shift_state & LK_COMP) handle_scancode(scancodeRemap[LK_KEY_COMP], 0); if (shift_state & LK_LOCK) handle_scancode(scancodeRemap[LK_KEY_LOCK], 0); shift_state = 0; break; case LK_KEY_REPEAT: handle_scancode(prev_scancode, 1); break; default: prev_scancode = c; handle_scancode(c, 1); break; } } else printk("Error reading LKx01 keyboard: 0x%02x\n", stat); } static void __init lk201_info(struct dec_serial *info) { } static int __init lk201_init(struct dec_serial *info) { unsigned int ch, id = 0; int result; printk("DECstation LK keyboard driver v0.04... "); result = lk201_reset(info); if (result) return result; mdelay(10); /* * Detect whether there is an LK201 or an LK401 * The LK401 has ALT keys... */ info->hook->poll_tx_char(info, LK_CMD_REQ_ID); while ((ch = info->hook->poll_rx_char(info)) > 0) id = ch; switch (id) { case 1: printk("LK201 detected\n"); break; case 2: printk("LK401 detected\n"); break; default: printk("unknown keyboard, ID %d,\n", id); printk("... please report to <lin...@os...>\n"); } /* * now we're ready */ info->hook->rx_char = lk201_kbd_rx_char; return 0; } void __init kbd_init_hw(void) { extern int register_zs_hook(unsigned int, struct zs_hook *); extern int unregister_zs_hook(unsigned int); if (TURBOCHANNEL) { if (mips_machtype != MACH_DS5000_XX) { /* * This is not a MAXINE, so: * * kbd_init_hw() is being called before * rs_init() so just register the kbd hook * and let zs_init do the rest :-) */ if (mips_machtype == MACH_DS5000_200) printk("LK201 Support for DS5000/200 not yet ready ...\n"); else if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook)) unregister_zs_hook(KEYB_LINE); } } else { /* * TODO: modify dz.c to allow similar hooks * for LK201 handling on DS2100, DS3100, and DS5000/200 */ printk("LK201 Support for DS3100 not yet ready ...\n"); } } --- NEW FILE: lk201.h --- /* * Commands to the keyboard processor */ #define LK_PARAM 0x80 /* start/end parameter list */ #define LK_CMD_RESUME 0x8b #define LK_CMD_INHIBIT 0xb9 #define LK_CMD_LEDS_ON 0x13 /* 1 param: led bitmask */ #define LK_CMD_LEDS_OFF 0x11 /* 1 param: led bitmask */ #define LK_CMD_DIS_KEYCLK 0x99 #define LK_CMD_ENB_KEYCLK 0x1b /* 1 param: volume */ #define LK_CMD_DIS_CTLCLK 0xb9 #define LK_CMD_ENB_CTLCLK 0xbb #define LK_CMD_SOUND_CLK 0x9f #define LK_CMD_DIS_BELL 0xa1 #define LK_CMD_ENB_BELL 0x23 /* 1 param: volume */ #define LK_CMD_BELL 0xa7 #define LK_CMD_TMP_NORPT 0xc1 #define LK_CMD_ENB_RPT 0xe3 #define LK_CMD_DIS_RPT 0xe1 #define LK_CMD_RPT_TO_DOWN 0xd9 #define LK_CMD_REQ_ID 0xab #define LK_CMD_POWER_UP 0xfd #define LK_CMD_TEST_MODE 0xcb #define LK_CMD_SET_DEFAULTS 0xd3 /* there are 4 leds, represent them in the low 4 bits of a byte */ #define LK_PARAM_LED_MASK(ledbmap) (LK_PARAM|(ledbmap)) /* max volume is 0, lowest is 0x7 */ #define LK_PARAM_VOLUME(v) (LK_PARAM|((v)&0x7)) /* mode set command(s) details */ #define LK_MODE_DOWN 0x0 #define LK_MODE_RPT_DOWN 0x2 #define LK_MODE_DOWN_UP 0x6 #define LK_CMD_MODE(m,div) (LK_PARAM|(div<<3)|m) #define LK_SHIFT 1<<0 #define LK_CTRL 1<<1 #define LK_LOCK 1<<2 #define LK_COMP 1<<3 #define LK_KEY_SHIFT 174 #define LK_KEY_CTRL 175 #define LK_KEY_LOCK 176 #define LK_KEY_COMP 177 #define LK_KEY_RELEASE 179 #define LK_KEY_REPEAT 180 #define LK_KEY_ACK 186 extern unsigned char scancodeRemap[256]; |
From: James S. <jsi...@us...> - 2002-03-15 19:01:13
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/mips/jazz In directory usw-pr-cvs1:/tmp/cvs-serv15726/arch/mips/jazz Added Files: setup.c Log Message: Some missed files. --- NEW FILE: setup.c --- /* * Setup pointers to hardware-dependent routines. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle * Copyright (C) 2001 MIPS Technologies, Inc. */ #include <linux/config.h> #include <linux/hdreg.h> #include <linux/init.h> #include <linux/ioport.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/mm.h> #include <linux/console.h> #include <linux/fb.h> #include <linux/mc146818rtc.h> #include <linux/ide.h> #include <asm/bootinfo.h> #include <asm/irq.h> #include <asm/jazz.h> #include <asm/jazzdma.h> #include <asm/ptrace.h> #include <asm/reboot.h> #include <asm/io.h> #include <asm/pgtable.h> /* * Initial irq handlers. */ static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { } /* * IRQ2 is cascade interrupt to second interrupt controller */ static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL}; extern asmlinkage void jazz_handle_int(void); extern void jazz_machine_restart(char *command); extern void jazz_machine_halt(void); extern void jazz_machine_power_off(void); extern struct ide_ops std_ide_ops; extern struct rtc_ops jazz_rtc_ops; extern struct fd_ops *fd_ops; extern struct fd_ops jazz_fd_ops; void (*board_time_init)(struct irqaction *irq); static void __init jazz_time_init(struct irqaction *irq) { /* set the clock to 100 Hz */ r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9); i8259_setup_irq(JAZZ_TIMER_IRQ, irq); } static void __init jazz_irq_setup(void) { set_except_vector(0, jazz_handle_int); r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, JAZZ_IE_ETHERNET | JAZZ_IE_SCSI | JAZZ_IE_SERIAL1 | JAZZ_IE_SERIAL2 | JAZZ_IE_PARALLEL | JAZZ_IE_FLOPPY); r4030_read_reg16(JAZZ_IO_IRQ_SOURCE); /* clear pending IRQs */ r4030_read_reg32(JAZZ_R4030_INVAL_ADDR); /* clear error bits */ change_cp0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1); /* set the clock to 100 Hz */ r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9); request_region(0x20, 0x20, "pic1"); request_region(0xa0, 0x20, "pic2"); i8259_setup_irq(2, &irq2); } void __init jazz_setup(void) { add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K); add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M); add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M); irq_setup = jazz_irq_setup; mips_io_port_base = JAZZ_PORT_BASE; if (mips_machtype == MACH_MIPS_MAGNUM_4000) EISA_bus = 1; isa_slot_offset = 0xe3000000; request_region(0x00,0x20,"dma1"); request_region(0x40,0x20,"timer"); request_region(0x80,0x10,"dma page reg"); request_region(0xc0,0x20,"dma2"); board_time_init = jazz_time_init; /* The RTC is outside the port address space */ _machine_restart = jazz_machine_restart; _machine_halt = jazz_machine_halt; _machine_power_off = jazz_machine_power_off; #ifdef CONFIG_BLK_DEV_IDE ide_ops = &std_ide_ops; #endif #ifdef CONFIG_BLK_DEV_FD fd_ops = &jazz_fd_ops; #endif #warning "Somebody should check if screen_info is ok for Jazz." screen_info = (struct screen_info) { 0, 0, /* orig-x, orig-y */ 0, /* unused */ 0, /* orig_video_page */ 0, /* orig_video_mode */ 160, /* orig_video_cols */ 0, 0, 0, /* unused, ega_bx, unused */ 64, /* orig_video_lines */ 0, /* orig_video_isVGA */ 16 /* orig_video_points */ }; rtc_ops = &jazz_rtc_ops; vdma_init(); } |
From: James S. <jsi...@us...> - 2002-03-15 19:01:11
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/m68k/mac In directory usw-pr-cvs1:/tmp/cvs-serv15726/arch/m68k/mac Added Files: config.c Log Message: Some missed files. --- NEW FILE: config.c --- /* * linux/arch/m68k/mac/config.c * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details. */ /* * Miscellaneous linux stuff */ #include <linux/config.h> #include <linux/types.h> #include <linux/mm.h> #include <linux/tty.h> #include <linux/interrupt.h> /* keyb */ #include <linux/random.h> #include <linux/delay.h> /* keyb */ #include <linux/init.h> #define BOOTINFO_COMPAT_1_0 #include <asm/setup.h> #include <asm/bootinfo.h> #include <asm/system.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/pgtable.h> #include <asm/rtc.h> #include <asm/machdep.h> #include <asm/macintosh.h> #include <asm/macints.h> #include <asm/machw.h> #include <asm/mac_iop.h> #include <asm/mac_via.h> #include <asm/mac_oss.h> #include <asm/mac_psc.h> /* Mac bootinfo struct */ struct mac_booter_data mac_bi_data = {0,}; int mac_bisize = sizeof mac_bi_data; /* New m68k bootinfo stuff and videobase */ extern int m68k_num_memory; extern struct mem_info m68k_memory[NUM_MEMINFO]; extern struct mem_info m68k_ramdisk; extern char m68k_command_line[CL_SIZE]; void *mac_env; /* Loaded by the boot asm */ /* The phys. video addr. - might be bogus on some machines */ unsigned long mac_orig_videoaddr; /* Mac specific timer functions */ extern void mac_gettod (int *, int *, int *, int *, int *, int *); extern unsigned long mac_gettimeoffset (void); extern int mac_hwclk (int, struct hwclk_time *); extern int mac_set_clock_mmss (unsigned long); extern int show_mac_interrupts(struct seq_file *, void *); extern void iop_preinit(void); extern void iop_init(void); extern void via_init(void); extern void via_init_clock(void (*func)(int, void *, struct pt_regs *)); extern void via_flush_cache(void); extern void oss_init(void); extern void psc_init(void); extern void baboon_init(void); extern void (*kd_mksound)(unsigned int, unsigned int); extern void mac_mksound(unsigned int, unsigned int); extern void nubus_sweep_video(void); /* Mac specific debug functions (in debug.c) */ extern void mac_debug_init(void); extern void mac_debugging_long(int, long); extern void (*kd_mksound)(unsigned int, unsigned int); extern int mackbd_init_hw(void); extern void mackbd_leds(unsigned int leds); extern int mackbd_translate(unsigned char keycode, unsigned char *keycodep, char raw_mode); extern void mac_hid_init_hw(void); extern int mac_hid_kbd_translate(unsigned char scancode, unsigned char *keycode, char raw_mode); #ifdef CONFIG_MAGIC_SYSRQ extern unsigned char mac_hid_kbd_sysrq_xlate[128]; extern unsigned char pckbd_sysrq_xlate[128]; extern unsigned char mackbd_sysrq_xlate[128]; #endif /* CONFIG_MAGIC_SYSRQ */ static void mac_get_model(char *str); void mac_bang(int irq, void *vector, struct pt_regs *p) { printk("Resetting ...\n"); mac_reset(); } static void mac_sched_init(void (*vector)(int, void *, struct pt_regs *)) { via_init_clock(vector); } #if 0 void mac_waitbut (void) { ; } #endif extern void mac_default_handler(int, void *, struct pt_regs *); void (*mac_handlers[8])(int, void *, struct pt_regs *)= { mac_default_handler, mac_default_handler, mac_default_handler, mac_default_handler, mac_default_handler, mac_default_handler, mac_default_handler, mac_default_handler }; /* * Parse a Macintosh-specific record in the bootinfo */ int __init mac_parse_bootinfo(const struct bi_record *record) { int unknown = 0; const u_long *data = record->data; switch (record->tag) { case BI_MAC_MODEL: mac_bi_data.id = *data; break; case BI_MAC_VADDR: mac_bi_data.videoaddr = *data; break; case BI_MAC_VDEPTH: mac_bi_data.videodepth = *data; break; case BI_MAC_VROW: mac_bi_data.videorow = *data; break; case BI_MAC_VDIM: mac_bi_data.dimensions = *data; break; case BI_MAC_VLOGICAL: mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); mac_orig_videoaddr = *data; break; case BI_MAC_SCCBASE: mac_bi_data.sccbase = *data; break; case BI_MAC_BTIME: mac_bi_data.boottime = *data; break; case BI_MAC_GMTBIAS: mac_bi_data.gmtbias = *data; break; case BI_MAC_MEMSIZE: mac_bi_data.memsize = *data; break; case BI_MAC_CPUID: mac_bi_data.cpuid = *data; break; case BI_MAC_ROMBASE: mac_bi_data.rombase = *data; break; default: unknown = 1; } return(unknown); } /* * Flip into 24bit mode for an instant - flushes the L2 cache card. We * have to disable interrupts for this. Our IRQ handlers will crap * themselves if they take an IRQ in 24bit mode! */ static void mac_cache_card_flush(int writeback) { unsigned long cpu_flags; save_flags(cpu_flags); cli(); via_flush_cache(); restore_flags(cpu_flags); } void __init config_mac(void) { if (!MACH_IS_MAC) { printk("ERROR: no Mac, but config_mac() called!! \n"); } mach_sched_init = mac_sched_init; mach_init_IRQ = mac_init_IRQ; mach_request_irq = mac_request_irq; mach_free_irq = mac_free_irq; enable_irq = mac_enable_irq; disable_irq = mac_disable_irq; mach_get_model = mac_get_model; mach_default_handler = &mac_handlers; mach_get_irq_list = show_mac_interrupts; mach_gettimeoffset = mac_gettimeoffset; mach_gettod = mac_gettod; mach_hwclk = mac_hwclk; mach_set_clock_mmss = mac_set_clock_mmss; mach_reset = mac_reset; mach_halt = mac_poweroff; mach_power_off = mac_poweroff; conswitchp = &dummy_con; mach_max_dma_address = 0xffffffff; #if 0 mach_debug_init = mac_debug_init; #endif #ifdef CONFIG_HEARTBEAT #if 0 mach_heartbeat = mac_heartbeat; mach_heartbeat_irq = IRQ_MAC_TIMER; #endif #endif /* * Determine hardware present */ mac_identify(); mac_report_hardware(); /* AFAIK only the IIci takes a cache card. The IIfx has onboard cache ... someone needs to figure out how to tell if it's on or not. */ if (macintosh_config->ident == MAC_MODEL_IICI || macintosh_config->ident == MAC_MODEL_IIFX) { mach_l2_flush = mac_cache_card_flush; } #ifdef MAC_DEBUG_SOUND /* goes on forever if timers broken */ mac_mksound(1000,10); #endif /* * Check for machine specific fixups. */ #ifdef OLD_NUBUS_CODE nubus_sweep_video(); #endif } /* * Macintosh Table: hardcoded model configuration data. * * Much of this was defined by Alan, based on who knows what docs. * I've added a lot more, and some of that was pure guesswork based * on hardware pages present on the Mac web site. Possibly wildly * inaccurate, so look here if a new Mac model won't run. Example: if * a Mac crashes immediately after the VIA1 registers have been dumped * to the screen, it probably died attempting to read DirB on a RBV. * Meaning it should have MAC_VIA_IIci here :-) */ struct mac_model *macintosh_config; static struct mac_model mac_data_table[]= { /* * We'll pretend to be a Macintosh II, that's pretty safe. */ { MAC_MODEL_II, "Unknown", MAC_ADB_II, MAC_VIA_II, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, /* * Original MacII hardware * */ { MAC_MODEL_II, "II", MAC_ADB_II, MAC_VIA_II, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_IIX, "IIx", MAC_ADB_II, MAC_VIA_II, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_IICX, "IIcx", MAC_ADB_II, MAC_VIA_II, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_SE30, "SE/30", MAC_ADB_II, MAC_VIA_II, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, /* * Weirdified MacII hardware - all subtley different. Gee thanks * Apple. All these boxes seem to have VIA2 in a different place to * the MacII (+1A000 rather than +4000) * CSA: see http://developer.apple.com/technotes/hw/hw_09.html */ { MAC_MODEL_IICI, "IIci", MAC_ADB_II, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_IIFX, "IIfx", MAC_ADB_IOP, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_IOP, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_IISI, "IIsi", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_IIVI, "IIvi", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_IIVX, "IIvx", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, /* * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...) */ { MAC_MODEL_CLII, "Classic II", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_CCL, "Color Classic", MAC_ADB_CUDA, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, /* * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi */ { MAC_MODEL_LC, "LC", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_LCII, "LC II", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_LCIII,"LC III", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, /* * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently * as some of the stuff connected to VIA2 seems different. Better SCSI chip and * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an * AMD 79C940 (MACE). * The 700, 900 and 950 have some I/O chips in the wrong place to * confuse us. The 840AV has a SCSI location of its own (same as * the 660AV). */ { MAC_MODEL_Q605, "Quadra 605", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_Q610, "Quadra 610", MAC_ADB_II, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_Q630, "Quadra 630", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_QUADRA, MAC_SCC_QUADRA, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_Q650, "Quadra 650", MAC_ADB_II, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_SONIC, MAC_NUBUS}, /* The Q700 does have a NS Sonic */ { MAC_MODEL_Q700, "Quadra 700", MAC_ADB_II, MAC_VIA_QUADRA, MAC_SCSI_QUADRA2, MAC_IDE_NONE, MAC_SCC_QUADRA2, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_Q800, "Quadra 800", MAC_ADB_II, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_Q840, "Quadra 840AV", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA3, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_MACE, MAC_NUBUS}, { MAC_MODEL_Q900, "Quadra 900", MAC_ADB_IOP, MAC_VIA_QUADRA, MAC_SCSI_QUADRA2, MAC_IDE_NONE, MAC_SCC_IOP, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_Q950, "Quadra 950", MAC_ADB_IOP, MAC_VIA_QUADRA, MAC_SCSI_QUADRA2, MAC_IDE_NONE, MAC_SCC_IOP, MAC_ETHER_SONIC, MAC_NUBUS}, /* * Performa - more LC type machines */ { MAC_MODEL_P460, "Performa 460", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_P475, "Performa 475", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_P475F, "Performa 475", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_P520, "Performa 520", MAC_ADB_CUDA, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_P550, "Performa 550", MAC_ADB_CUDA, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_P575, "Performa 575", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, /* These have the comm slot, and therefore the possibility of SONIC ethernet */ { MAC_MODEL_P588, "Performa 588", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_QUADRA, MAC_SCC_II, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_TV, "TV", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_P600, "Performa 600", MAC_ADB_IISI, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_II, MAC_ETHER_NONE, MAC_NUBUS}, /* * Centris - just guessing again; maybe like Quadra */ /* The C610 may or may not have SONIC. We probe to make sure */ { MAC_MODEL_C610, "Centris 610", MAC_ADB_II, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_C650, "Centris 650", MAC_ADB_II, MAC_VIA_QUADRA, MAC_SCSI_QUADRA, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_SONIC, MAC_NUBUS}, { MAC_MODEL_C660, "Centris 660AV", MAC_ADB_CUDA, MAC_VIA_QUADRA, MAC_SCSI_QUADRA3, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_MACE, MAC_NUBUS}, /* * The PowerBooks all the same "Combo" custom IC for SCSI and SCC * and a PMU (in two variations?) for ADB. Most of them use the * Quadra-style VIAs. A few models also have IDE from hell. */ { MAC_MODEL_PB140, "PowerBook 140", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB145, "PowerBook 145", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB150, "PowerBook 150", MAC_ADB_PB1, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_PB, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB160, "PowerBook 160", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB165, "PowerBook 165", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB165C, "PowerBook 165c", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB170, "PowerBook 170", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB180, "PowerBook 180", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB180C, "PowerBook 180c", MAC_ADB_PB1, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB190, "PowerBook 190", MAC_ADB_PB2, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_BABOON, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB520, "PowerBook 520", MAC_ADB_PB2, MAC_VIA_QUADRA, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_SONIC, MAC_NUBUS}, /* * PowerBook Duos are pretty much like normal PowerBooks * All of these probably have onboard SONIC in the Dock which * means we'll have to probe for it eventually. * * Are these reallly MAC_VIA_IIci? The developer notes for the * Duos show pretty much the same custom parts as in most of * the other PowerBooks which would imply MAC_VIA_QUADRA. */ { MAC_MODEL_PB210, "PowerBook Duo 210", MAC_ADB_PB2, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB230, "PowerBook Duo 230", MAC_ADB_PB2, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB250, "PowerBook Duo 250", MAC_ADB_PB2, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB270C, "PowerBook Duo 270c", MAC_ADB_PB2, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB280, "PowerBook Duo 280", MAC_ADB_PB2, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, { MAC_MODEL_PB280C, "PowerBook Duo 280c", MAC_ADB_PB2, MAC_VIA_IIci, MAC_SCSI_OLD, MAC_IDE_NONE, MAC_SCC_QUADRA, MAC_ETHER_NONE, MAC_NUBUS}, /* * Other stuff ?? */ { -1, NULL, 0,0,0,} }; void mac_identify(void) { struct mac_model *m; /* Penguin data useful? */ int model = mac_bi_data.id; if (!model) { /* no bootinfo model id -> NetBSD booter was used! */ /* XXX FIXME: breaks for model > 31 */ model=(mac_bi_data.cpuid>>2)&63; printk ("No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); } macintosh_config = mac_data_table; for (m = macintosh_config ; m->ident != -1 ; m++) { if (m->ident == model) { macintosh_config = m; break; } } /* We need to pre-init the IOPs, if any. Otherwise */ /* the serial console won't work if the user had */ /* the serial ports set to "Faster" mode in MacOS. */ iop_preinit(); mac_debug_init(); printk ("Detected Macintosh model: %d \n", model); /* * Report booter data: */ printk (" Penguin bootinfo data:\n"); printk (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", mac_bi_data.videoaddr, mac_bi_data.videorow, mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, mac_bi_data.dimensions >> 16); printk (" Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n", mac_bi_data.videological, mac_orig_videoaddr, mac_bi_data.sccbase); printk (" Boottime: 0x%lx GMTBias: 0x%lx \n", mac_bi_data.boottime, mac_bi_data.gmtbias); printk (" Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); #if 0 printk ("Ramdisk: addr 0x%lx size 0x%lx\n", m68k_ramdisk.addr, m68k_ramdisk.size); #endif /* * TODO: set the various fields in macintosh_config->hw_present here! */ switch (macintosh_config->scsi_type) { case MAC_SCSI_OLD: MACHW_SET(MAC_SCSI_80); break; case MAC_SCSI_QUADRA: case MAC_SCSI_QUADRA2: case MAC_SCSI_QUADRA3: MACHW_SET(MAC_SCSI_96); if ((macintosh_config->ident == MAC_MODEL_Q900) || (macintosh_config->ident == MAC_MODEL_Q950)) MACHW_SET(MAC_SCSI_96_2); break; default: printk("config.c: wtf: unknown scsi, using 53c80\n"); MACHW_SET(MAC_SCSI_80); break; } iop_init(); via_init(); oss_init(); psc_init(); baboon_init(); } void mac_report_hardware(void) { printk("Apple Macintosh %s\n", macintosh_config->name); } static void mac_get_model(char *str) { strcpy(str,"Macintosh "); strcat(str, macintosh_config->name); } |
From: James S. <jsi...@us...> - 2002-03-15 18:59:33
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15002/arch/ppc64/kernel Added Files: setup.c Log Message: Completely removed aux_device_present flag. --- NEW FILE: setup.c --- /* * * Common boot and setup code. * * Copyright (C) 2001 PPC64 Team, IBM Corp * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/sched.h> #include <linux/init.h> #include <linux/reboot.h> #include <linux/delay.h> #include <linux/blk.h> #include <linux/ide.h> #include <linux/seq_file.h> #include <linux/ioport.h> #include <linux/tty.h> #include <asm/init.h> #include <asm/io.h> #include <asm/prom.h> #include <asm/processor.h> #include <asm/pgtable.h> #include <asm/bootinfo.h> #include <asm/smp.h> #include <asm/elf.h> #include <asm/machdep.h> #include <asm/iSeries/LparData.h> #include <asm/Naca.h> #include <asm/Paca.h> #include <asm/ppcdebug.h> #include <asm/time.h> extern unsigned long klimit; /* extern void *stab; */ extern HTAB htab_data; extern unsigned long loops_per_jiffy; extern unsigned long embedded_sysmap_start; extern unsigned long embedded_sysmap_end; int have_of = 1; extern void chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); extern void chrp_init_map_io_space( void ); extern void iSeries_init( void ); extern void iSeries_init_early( void ); extern void pSeries_init_early( void ); extern void pSeriesLP_init_early(void); extern void mm_init_ppc64( void ); unsigned long decr_overclock = 1; unsigned long decr_overclock_proc0 = 1; unsigned long decr_overclock_set = 0; unsigned long decr_overclock_proc0_set = 0; #ifdef CONFIG_XMON extern void xmon_map_scc(void); #endif char saved_command_line[256]; void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); int parse_bootinfo(void); int _machine = _MACH_unknown; #ifdef CONFIG_MAGIC_SYSRQ unsigned long SYSRQ_KEY; #endif /* CONFIG_MAGIC_SYSRQ */ struct machdep_calls ppc_md; struct Naca *naca; /* * Perhaps we can put the pmac screen_info[] here * on pmac as well so we don't need the ifdef's. * Until we get multiple-console support in here * that is. -- Cort * Maybe tie it to serial consoles, since this is really what * these processors use on existing boards. -- Dan */ struct screen_info screen_info = { 0, 25, /* orig-x, orig-y */ 0, /* unused */ 0, /* orig-video-page */ 0, /* orig-video-mode */ 80, /* orig-video-cols */ 0,0,0, /* ega_ax, ega_bx, ega_cx */ 25, /* orig-video-lines */ 1, /* orig-video-isVGA */ 16 /* orig-video-points */ }; /* * These are used in binfmt_elf.c to put aux entries on the stack * for each elf executable being started. */ int dcache_bsize; int icache_bsize; int ucache_bsize; /* * Initialize the PPCDBG state. Called before relocation has been enabled. */ void ppcdbg_initialize(void) { unsigned long offset = reloc_offset(); struct Naca *_naca = RELOC(naca); _naca->debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */; } /* * Initialize a set of PACA's, one for each processor. * * At this point, relocation is on, but we have not done any other * setup of the mm subsystem. */ void paca_init(void) { #if 0 int processorCount = naca->processorCount, i; struct Paca *paca[]; /* Put the array of paca's on a page boundary & allocate 1/2 page of */ /* storage for each. */ klimit += (PAGE_SIZE-1) & PAGE_MASK; naca->xPaca = paca[0] = klimit; klimit += ((PAGE_SIZE>>1) * processorCount); for(i=0; i<processorCount; i++) { paca[0]->xPacaIndex = i; } #endif } /* * Do some initial setup of the system. The paramters are those which * were passed in from the bootloader. */ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { /* This should be fixed properly in kernel/resource.c */ iomem_resource.end = MEM_SPACE_LIMIT; /* pSeries systems are identified in prom.c via OF. */ if ( itLpNaca.xLparInstalled == 1 ) _machine = _MACH_iSeries; switch (_machine) { case _MACH_iSeries: iSeries_init_early(); break; #ifdef CONFIG_PPC_PSERIES case _MACH_pSeries: pSeries_init_early(); #ifdef CONFIG_BLK_DEV_INITRD initrd_start = initrd_end = 0; #endif parse_bootinfo(); break; case _MACH_pSeriesLP: pSeriesLP_init_early(); #ifdef CONFIG_BLK_DEV_INITRD initrd_start = initrd_end = 0; #endif parse_bootinfo(); break; #endif } udbg_puts("\n-----------------------------------------------------\n"); udbg_puts("Naca Info...\n\n"); udbg_puts("naca = 0x"); udbg_puthex((unsigned long)naca); udbg_putc('\n'); udbg_puts("naca->processorCount = 0x"); udbg_puthex(naca->processorCount); udbg_putc('\n'); udbg_puts("naca->physicalMemorySize = 0x"); udbg_puthex(naca->physicalMemorySize); udbg_putc('\n'); udbg_puts("naca->dCacheL1LineSize = 0x"); udbg_puthex(naca->dCacheL1LineSize); udbg_putc('\n'); udbg_puts("naca->dCacheL1LogLineSize = 0x"); udbg_puthex(naca->dCacheL1LogLineSize); udbg_putc('\n'); udbg_puts("naca->dCacheL1LinesPerPage = 0x"); udbg_puthex(naca->dCacheL1LinesPerPage); udbg_putc('\n'); udbg_puts("naca->iCacheL1LineSize = 0x"); udbg_puthex(naca->iCacheL1LineSize); udbg_putc('\n'); udbg_puts("naca->iCacheL1LogLineSize = 0x"); udbg_puthex(naca->iCacheL1LogLineSize); udbg_putc('\n'); udbg_puts("naca->iCacheL1LinesPerPage = 0x"); udbg_puthex(naca->iCacheL1LinesPerPage); udbg_putc('\n'); udbg_puts("naca->pftSize = 0x"); udbg_puthex(naca->pftSize); udbg_putc('\n'); udbg_puts("naca->serialPortAddr = 0x"); udbg_puthex(naca->serialPortAddr); udbg_putc('\n'); udbg_puts("naca->interrupt_controller = 0x"); udbg_puthex(naca->interrupt_controller); udbg_putc('\n'); udbg_printf("\nHTAB Info ...\n\n"); udbg_puts("htab_data.htab = 0x"); udbg_puthex((unsigned long)htab_data.htab); udbg_putc('\n'); udbg_puts("htab_data.num_ptegs = 0x"); udbg_puthex(htab_data.htab_num_ptegs); udbg_putc('\n'); udbg_puts("\n-----------------------------------------------------\n"); if ( _machine & _MACH_pSeries ) { finish_device_tree(); chrp_init(r3, r4, r5, r6, r7); } mm_init_ppc64(); switch (_machine) { case _MACH_iSeries: iSeries_init(); break; default: /* The following relies on the device tree being */ /* fully configured. */ parse_cmd_line(r3, r4, r5, r6, r7); } } void machine_restart(char *cmd) { ppc_md.restart(cmd); } void machine_power_off(void) { ppc_md.power_off(); } void machine_halt(void) { ppc_md.halt(); } static int show_cpuinfo(struct seq_file *m, void *v) { unsigned long cpu_id = (unsigned long)v - 1; unsigned int pvr; unsigned short maj; unsigned short min; #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); return 0; } if (!(cpu_online_map & (1<<cpu_id))) return 0; #endif pvr = xPaca[cpu_id].pvr; maj = (pvr >> 8) & 0xFF; min = pvr & 0xFF; seq_printf(m, "processor\t: %lu\n", cpu_id); seq_printf(m, "cpu\t\t: "); pvr = xPaca[cpu_id].pvr; switch (PVR_VER(pvr)) { case PV_PULSAR: seq_printf(m, "RS64-III (pulsar)\n"); break; case PV_POWER4: seq_printf(m, "POWER4 (gp)\n"); break; case PV_ICESTAR: seq_printf(m, "RS64-III (icestar)\n"); break; case PV_SSTAR: seq_printf(m, "RS64-IV (sstar)\n"); break; case PV_630: seq_printf(m, "POWER3 (630)\n"); break; case PV_630p: seq_printf(m, "POWER3 (630+)\n"); break; default: seq_printf(m, "Unknown (%08x)\n", pvr); break; } /* * Assume here that all clock rates are the same in a * smp system. -- Cort */ if (_machine != _MACH_iSeries) { struct device_node *cpu_node; int *fp; cpu_node = find_type_devices("cpu"); if (cpu_node) { fp = (int *) get_property(cpu_node, "clock-frequency", NULL); if (fp) seq_printf(m, "clock\t\t: %dMHz\n", *fp / 1000000); } } if (ppc_md.setup_residual != NULL) ppc_md.setup_residual(m, cpu_id); 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; } static void *c_start(struct seq_file *m, loff_t *pos) { return *pos <= NR_CPUS ? (void *)((*pos)+1) : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) { ++*pos; return c_start(m, pos); } static void c_stop(struct seq_file *m, void *v) { } struct seq_operations cpuinfo_op = { start: c_start, next: c_next, stop: c_stop, show: show_cpuinfo, }; /* * Fetch the cmd_line from open firmware. */ void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { struct device_node *chosen; char *p; #ifdef CONFIG_BLK_DEV_INITRD if ((initrd_start == 0) && r3 && r4 && r4 != 0xdeadbeef) { initrd_start = (r3 >= KERNELBASE) ? r3 : (unsigned long)__va(r3); initrd_end = initrd_start + r4; ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); initrd_below_start_ok = 1; } #endif cmd_line[0] = 0; chosen = find_devices("chosen"); if (chosen != NULL) { p = get_property(chosen, "bootargs", NULL); if (p != NULL) strncpy(cmd_line, p, sizeof(cmd_line)); } cmd_line[sizeof(cmd_line) - 1] = 0; /* Look for mem= option on command line */ if (strstr(cmd_line, "mem=")) { char *p, *q; unsigned long maxmem = 0; extern unsigned long __max_memory; for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) { q = p + 4; if (p > cmd_line && p[-1] != ' ') continue; maxmem = simple_strtoul(q, &q, 0); if (*q == 'k' || *q == 'K') { maxmem <<= 10; ++q; } else if (*q == 'm' || *q == 'M') { maxmem <<= 20; ++q; } } __max_memory = maxmem; } ppc_md.progress("id mach: done", 0x200); } char *bi_tag2str(unsigned long tag) { switch (tag) { case BI_FIRST: return "BI_FIRST"; case BI_LAST: return "BI_LAST"; case BI_CMD_LINE: return "BI_CMD_LINE"; case BI_BOOTLOADER_ID: return "BI_BOOTLOADER_ID"; case BI_INITRD: return "BI_INITRD"; case BI_SYSMAP: return "BI_SYSMAP"; case BI_MACHTYPE: return "BI_MACHTYPE"; default: return "BI_UNKNOWN"; } } int parse_bootinfo(void) { struct bi_record *rec; extern char *sysmap; extern unsigned long sysmap_size; rec = prom.bi_recs; if ( rec == NULL || rec->tag != BI_FIRST ) return -1; for ( ; rec->tag != BI_LAST ; rec = bi_rec_next(rec) ) { switch (rec->tag) { case BI_CMD_LINE: memcpy(cmd_line, (void *)rec->data, rec->size); break; case BI_SYSMAP: sysmap = (char *)((rec->data[0] >= (KERNELBASE)) ? rec->data[0] : (unsigned long)__va(rec->data[0])); sysmap_size = rec->data[1]; break; #ifdef CONFIG_BLK_DEV_INITRD case BI_INITRD: initrd_start = (unsigned long)__va(rec->data[0]); initrd_end = initrd_start + rec->data[1]; ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); initrd_below_start_ok = 1; break; #endif /* CONFIG_BLK_DEV_INITRD */ } } return 0; } int __init ppc_init(void) { /* clear the progress line */ ppc_md.progress(" ", 0xffff); if (ppc_md.init != NULL) { ppc_md.init(); } return 0; } arch_initcall(ppc_init); void __init ppc64_calibrate_delay(void) { loops_per_jiffy = tb_ticks_per_jiffy; printk("Calibrating delay loop... %lu.%02lu BogoMips\n", loops_per_jiffy/(500000/HZ), loops_per_jiffy/(5000/HZ) % 100); } extern void (*calibrate_delay)(void); /* * Called into from start_kernel, after lock_kernel has been called. * Initializes bootmem, which is unsed to manage page allocation until * mem_init is called. */ void __init setup_arch(char **cmdline_p) { extern int panic_timeout; extern char _etext[], _edata[]; extern void do_init_bootmem(void); calibrate_delay = ppc64_calibrate_delay; #ifdef CONFIG_XMON xmon_map_scc(); if (strstr(cmd_line, "xmon")) xmon(0); #endif /* CONFIG_XMON */ ppc_md.progress("setup_arch:enter", 0x3eab); #if defined(CONFIG_KGDB) kgdb_map_scc(); set_debug_traps(); breakpoint(); #endif /* * Set cache line size based on type of cpu as a default. * Systems with OF can look in the properties on the cpu node(s) * for a possibly more accurate value. */ dcache_bsize = naca->dCacheL1LineSize; icache_bsize = naca->iCacheL1LineSize; /* reboot on panic */ panic_timeout = 180; init_mm.start_code = PAGE_OFFSET; init_mm.end_code = (unsigned long) _etext; init_mm.end_data = (unsigned long) _edata; init_mm.brk = (unsigned long) klimit; /* Save unparsed command line copy for /proc/cmdline */ strcpy(saved_command_line, cmd_line); *cmdline_p = cmd_line; /* set up the bootmem stuff with available memory */ do_init_bootmem(); ppc_md.progress("setup_arch:bootmem", 0x3eab); ppc_md.setup_arch(); paging_init(); ppc_md.progress("setup_arch: exit", 0x3eab); } #ifdef CONFIG_IDE /* Convert the shorts/longs in hd_driveid from little to big endian; * chars are endian independant, of course, but strings need to be flipped. * (Despite what it says in drivers/block/ide.h, they come up as little * endian...) * * Changes to linux/hdreg.h may require changes here. */ void ppc64_ide_fix_driveid(struct hd_driveid *id) { int i; unsigned short *stringcast; id->config = __le16_to_cpu(id->config); id->cyls = __le16_to_cpu(id->cyls); id->reserved2 = __le16_to_cpu(id->reserved2); id->heads = __le16_to_cpu(id->heads); id->track_bytes = __le16_to_cpu(id->track_bytes); id->sector_bytes = __le16_to_cpu(id->sector_bytes); id->sectors = __le16_to_cpu(id->sectors); id->vendor0 = __le16_to_cpu(id->vendor0); id->vendor1 = __le16_to_cpu(id->vendor1); id->vendor2 = __le16_to_cpu(id->vendor2); stringcast = (unsigned short *)&id->serial_no[0]; for (i = 0; i < (20/2); i++) stringcast[i] = __le16_to_cpu(stringcast[i]); id->buf_type = __le16_to_cpu(id->buf_type); id->buf_size = __le16_to_cpu(id->buf_size); id->ecc_bytes = __le16_to_cpu(id->ecc_bytes); stringcast = (unsigned short *)&id->fw_rev[0]; for (i = 0; i < (8/2); i++) stringcast[i] = __le16_to_cpu(stringcast[i]); stringcast = (unsigned short *)&id->model[0]; for (i = 0; i < (40/2); i++) stringcast[i] = __le16_to_cpu(stringcast[i]); id->dword_io = __le16_to_cpu(id->dword_io); id->reserved50 = __le16_to_cpu(id->reserved50); id->field_valid = __le16_to_cpu(id->field_valid); id->cur_cyls = __le16_to_cpu(id->cur_cyls); id->cur_heads = __le16_to_cpu(id->cur_heads); id->cur_sectors = __le16_to_cpu(id->cur_sectors); id->cur_capacity0 = __le16_to_cpu(id->cur_capacity0); id->cur_capacity1 = __le16_to_cpu(id->cur_capacity1); id->lba_capacity = __le32_to_cpu(id->lba_capacity); id->dma_1word = __le16_to_cpu(id->dma_1word); id->dma_mword = __le16_to_cpu(id->dma_mword); id->eide_pio_modes = __le16_to_cpu(id->eide_pio_modes); id->eide_dma_min = __le16_to_cpu(id->eide_dma_min); id->eide_dma_time = __le16_to_cpu(id->eide_dma_time); id->eide_pio = __le16_to_cpu(id->eide_pio); id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy); for (i = 0; i < 2; i++) id->words69_70[i] = __le16_to_cpu(id->words69_70[i]); for (i = 0; i < 4; i++) id->words71_74[i] = __le16_to_cpu(id->words71_74[i]); id->queue_depth = __le16_to_cpu(id->queue_depth); for (i = 0; i < 4; i++) id->words76_79[i] = __le16_to_cpu(id->words76_79[i]); id->major_rev_num = __le16_to_cpu(id->major_rev_num); id->minor_rev_num = __le16_to_cpu(id->minor_rev_num); id->command_set_1 = __le16_to_cpu(id->command_set_1); id->command_set_2 = __le16_to_cpu(id->command_set_2); id->cfsse = __le16_to_cpu(id->cfsse); id->cfs_enable_1 = __le16_to_cpu(id->cfs_enable_1); id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2); id->csf_default = __le16_to_cpu(id->csf_default); id->dma_ultra = __le16_to_cpu(id->dma_ultra); id->word89 = __le16_to_cpu(id->word89); id->word90 = __le16_to_cpu(id->word90); id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues); id->word92 = __le16_to_cpu(id->word92); id->hw_config = __le16_to_cpu(id->hw_config); for (i = 0; i < 32; i++) id->words94_125[i] = __le16_to_cpu(id->words94_125[i]); id->last_lun = __le16_to_cpu(id->last_lun); id->word127 = __le16_to_cpu(id->word127); id->dlf = __le16_to_cpu(id->dlf); id->csfo = __le16_to_cpu(id->csfo); for (i = 0; i < 26; i++) id->words130_155[i] = __le16_to_cpu(id->words130_155[i]); id->word156 = __le16_to_cpu(id->word156); for (i = 0; i < 3; i++) id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); for (i = 0; i < 96; i++) id->words160_255[i] = __le16_to_cpu(id->words160_255[i]); } #endif void exception_trace(unsigned long trap) { unsigned long x, srr0, srr1, reg20, reg1, reg21; asm("mflr %0" : "=r" (x) :); asm("mfspr %0,0x1a" : "=r" (srr0) :); asm("mfspr %0,0x1b" : "=r" (srr1) :); asm("mr %0,1" : "=r" (reg1) :); asm("mr %0,20" : "=r" (reg20) :); asm("mr %0,21" : "=r" (reg21) :); udbg_puts("\n"); udbg_puts("Took an exception : "); udbg_puthex(x); udbg_puts("\n"); udbg_puts(" "); udbg_puthex(reg1); udbg_puts("\n"); udbg_puts(" "); udbg_puthex(reg20); udbg_puts("\n"); udbg_puts(" "); udbg_puthex(reg21); udbg_puts("\n"); udbg_puts(" "); udbg_puthex(srr0); udbg_puts("\n"); udbg_puts(" "); udbg_puthex(srr1); udbg_puts("\n"); } int set_spread_lpevents( char * str ) { /* The parameter is the number of processors to share in processing lp events */ unsigned long i; unsigned long val = simple_strtoul( str, NULL, 0 ); if ( ( val > 0 ) && ( val <= maxPacas ) ) { for ( i=1; i<val; ++i ) xPaca[i].lpQueuePtr = xPaca[0].lpQueuePtr; printk("lpevent processing spread over %ld processors\n", val); } else printk("invalid spreaqd_lpevents %ld\n", val); return 1; } /* This should only be called on processor 0 during calibrate decr */ void setup_default_decr(void) { struct Paca * paca = (struct Paca *)mfspr(SPRG3); if ( decr_overclock_set && !decr_overclock_proc0_set ) decr_overclock_proc0 = decr_overclock; paca->default_decr = tb_ticks_per_jiffy / decr_overclock_proc0; paca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy; } int set_decr_overclock_proc0( char * str ) { unsigned long val = simple_strtoul( str, NULL, 0 ); if ( ( val >= 1 ) && ( val <= 48 ) ) { decr_overclock_proc0_set = 1; decr_overclock_proc0 = val; printk("proc 0 decrementer overclock factor of %ld\n", val); } else printk("invalid proc 0 decrementer overclock factor of %ld\n", val); return 1; } int set_decr_overclock( char * str ) { unsigned long val = simple_strtoul( str, NULL, 0 ); if ( ( val >= 1 ) && ( val <= 48 ) ) { decr_overclock_set = 1; decr_overclock = val; printk("decrementer overclock factor of %ld\n", val); } else printk("invalid decrementer overclock factor of %ld\n", val); return 1; } __setup("spread_lpevents=", set_spread_lpevents ); __setup("decr_overclock_proc0=", set_decr_overclock_proc0 ); __setup("decr_overclock=", set_decr_overclock ); |
From: James S. <jsi...@us...> - 2002-03-15 18:59:33
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/mips/sni In directory usw-pr-cvs1:/tmp/cvs-serv15002/arch/mips/sni Modified Files: setup.c Log Message: Completely removed aux_device_present flag. Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/mips/sni/setup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- setup.c 6 Oct 2001 16:11:12 -0000 1.5 +++ setup.c 15 Mar 2002 18:59:28 -0000 1.6 @@ -47,7 +47,6 @@ setup_irq(0, irq); } -unsigned char aux_device_present; extern unsigned char sni_map_isa_cache; /* @@ -97,8 +96,6 @@ _machine_restart = sni_machine_restart; _machine_halt = sni_machine_halt; _machine_power_off = sni_machine_power_off; - - aux_device_present = 0xaa; /* * Some cluefull person has placed the PCI config data directly in |
From: James S. <jsi...@us...> - 2002-03-15 18:59:33
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/mips64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15002/arch/mips64/kernel Modified Files: setup.c Log Message: Completely removed aux_device_present flag. Index: setup.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/mips64/kernel/setup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- setup.c 6 Oct 2001 16:11:12 -0000 1.3 +++ setup.c 15 Mar 2002 18:59:28 -0000 1.4 @@ -84,8 +84,6 @@ struct boot_mem_map boot_mem_map; -unsigned char aux_device_present; - extern void load_mmu(void); static char command_line[CL_SIZE] = { 0, }; |
From: James S. <jsi...@us...> - 2002-03-15 18:59:33
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15002/arch/ppc/kernel Added Files: setup.c Log Message: Completely removed aux_device_present flag. --- NEW FILE: setup.c --- /* * BK Id: %F% %I% %G% %U% %#% */ /* * Common prep/pmac/chrp boot and setup code. */ #include <linux/config.h> #include <linux/module.h> #include <linux/string.h> #include <linux/sched.h> #include <linux/init.h> #include <linux/reboot.h> #include <linux/delay.h> #include <linux/blk.h> #include <linux/ide.h> #include <linux/tty.h> #include <linux/bootmem.h> #include <linux/seq_file.h> #include <asm/residual.h> #include <asm/io.h> #include <asm/prom.h> #include <asm/processor.h> #include <asm/pgtable.h> #include <asm/bootinfo.h> #include <asm/setup.h> #include <asm/amigappc.h> #include <asm/smp.h> #include <asm/elf.h> #include <asm/cputable.h> #include <asm/bootx.h> #include <asm/btext.h> #include <asm/machdep.h> #include <asm/uaccess.h> #include <asm/system.h> #include <asm/pmac_feature.h> #if defined CONFIG_KGDB #include <asm/kgdb.h> #endif extern void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); extern void bootx_init(unsigned long r4, unsigned long phys); extern void identify_cpu(unsigned long offset, unsigned long cpu); extern void do_cpu_ftr_fixups(unsigned long offset); extern void reloc_got2(unsigned long offset); #ifdef CONFIG_XMON extern void xmon_map_scc(void); #endif #ifdef CONFIG_KGDB extern void kgdb_map_scc(void); #endif extern boot_infos_t *boot_infos; char saved_command_line[256]; struct ide_machdep_calls ppc_ide_md; char *sysmap; unsigned long sysmap_size; /* Used with the BI_MEMSIZE bootinfo parameter to store the memory size value reported by the boot loader. */ unsigned int boot_mem_size; unsigned long ISA_DMA_THRESHOLD; unsigned long DMA_MODE_READ, DMA_MODE_WRITE; #ifdef CONFIG_ALL_PPC int _machine = 0; extern void prep_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); extern void pmac_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); extern void chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7); #endif /* CONFIG_ALL_PPC */ #ifdef CONFIG_MAGIC_SYSRQ unsigned long SYSRQ_KEY; #endif /* CONFIG_MAGIC_SYSRQ */ #ifdef CONFIG_VGA_CONSOLE unsigned long vgacon_remap_base; #endif struct machdep_calls ppc_md; /* * These are used in binfmt_elf.c to put aux entries on the stack * for each elf executable being started. */ int dcache_bsize; int icache_bsize; int ucache_bsize; #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_FB_VGA16) || \ defined(CONFIG_FB_VGA16_MODULE) || defined(CONFIG_FB_VESA) struct screen_info screen_info = { 0, 25, /* orig-x, orig-y */ 0, /* unused */ 0, /* orig-video-page */ 0, /* orig-video-mode */ 80, /* orig-video-cols */ 0,0,0, /* ega_ax, ega_bx, ega_cx */ 25, /* orig-video-lines */ 1, /* orig-video-isVGA */ 16 /* orig-video-points */ }; #endif /* CONFIG_VGA_CONSOLE || CONFIG_FB_VGA16 || CONFIG_FB_VESA */ void machine_restart(char *cmd) { ppc_md.restart(cmd); } void machine_power_off(void) { ppc_md.power_off(); } void machine_halt(void) { ppc_md.halt(); } #ifdef CONFIG_TAU extern u32 cpu_temp(unsigned long cpu); extern u32 cpu_temp_both(unsigned long cpu); #endif /* CONFIG_TAU */ int show_cpuinfo(struct seq_file *m, void *v) { int i = (int) v - 1; int err = 0; unsigned int pvr; unsigned short maj, min; unsigned long lpj; if (i >= NR_CPUS) { /* Show summary information */ #ifdef CONFIG_SMP unsigned long bogosum = 0; for (i = 0; i < smp_num_cpus; ++i) if (cpu_online_map & (1 << i)) bogosum += cpu_data[i].loops_per_jiffy; seq_printf(m, "total bogomips\t: %lu.%02lu\n", bogosum/(500000/HZ), bogosum/(5000/HZ) % 100); #endif /* CONFIG_SMP */ if (ppc_md.show_cpuinfo != NULL) err = ppc_md.show_cpuinfo(m); return err; } #ifdef CONFIG_SMP if (!(cpu_online_map & (1 << i))) return 0; pvr = cpu_data[i].pvr; lpj = cpu_data[i].loops_per_jiffy; seq_printf(m, "processor\t: %d\n", i); #else pvr = mfspr(PVR); lpj = loops_per_jiffy; #endif seq_printf(m, "cpu\t\t: "); if (cur_cpu_spec[i]->pvr_mask) seq_printf(m, "%s", cur_cpu_spec[i]->cpu_name); else seq_printf(m, "unknown (%08x)", pvr); #ifdef CONFIG_ALTIVEC if (cur_cpu_spec[i]->cpu_features & CPU_FTR_ALTIVEC) seq_printf(m, ", altivec supported"); #endif seq_printf(m, "\n"); #ifdef CONFIG_TAU if (cur_cpu_spec[i]->cpu_features & CPU_FTR_TAU) { #ifdef CONFIG_TAU_AVERAGE /* more straightforward, but potentially misleading */ seq_printf(m, "temperature \t: %u C (uncalibrated)\n", cpu_temp(i)); #else /* show the actual temp sensor range */ u32 temp; temp = cpu_temp_both(i); seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n", temp & 0xff, temp >> 16); #endif } #endif /* CONFIG_TAU */ if (ppc_md.show_percpuinfo != NULL) { err = ppc_md.show_percpuinfo(m, i); if (err) return err; } switch (PVR_VER(pvr)) { case 0x0020: /* 403 family */ maj = PVR_MAJ(pvr) + 1; min = PVR_MIN(pvr); break; case 0x1008: /* 740P/750P ?? */ maj = ((pvr >> 8) & 0xFF) - 1; min = pvr & 0xFF; break; default: maj = (pvr >> 8) & 0xFF; min = pvr & 0xFF; break; } seq_printf(m, "revision\t: %hd.%hd (pvr %04x %04x)\n", maj, min, PVR_VER(pvr), PVR_REV(pvr)); seq_printf(m, "bogomips\t: %lu.%02lu\n", lpj / (500000/HZ), (lpj / (5000/HZ)) % 100); #ifdef CONFIG_SMP seq_printf(m, "\n"); #endif return 0; } static void *c_start(struct seq_file *m, loff_t *pos) { int i = *pos; return i <= NR_CPUS? (void *) (i + 1): NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) { ++*pos; return c_start(m, pos); } static void c_stop(struct seq_file *m, void *v) { } struct seq_operations cpuinfo_op = { start: c_start, next: c_next, stop: c_stop, show: show_cpuinfo, }; /* * We're called here very early in the boot. We determine the machine * type and call the appropriate low-level setup functions. * -- Cort <co...@fs...> * * Note that the kernel may be running at an address which is different * from the address that it was linked at, so we must use RELOC/PTRRELOC * to access static data (including strings). -- paulus */ __init unsigned long early_init(int r3, int r4, int r5) { extern char __bss_start, _end; unsigned long phys; unsigned long offset = reloc_offset(); /* Default */ phys = offset + KERNELBASE; /* First zero the BSS -- use memset, some arches don't have * caches on yet */ memset_io(PTRRELOC(&__bss_start), 0, &_end - &__bss_start); /* * Identify the CPU type and fix up code sections * that depend on which cpu we have. */ identify_cpu(offset, 0); do_cpu_ftr_fixups(offset); #if defined(CONFIG_ALL_PPC) reloc_got2(offset); /* If we came here from BootX, clear the screen, * set up some pointers and return. */ if ((r3 == 0x426f6f58) && (r5 == 0)) bootx_init(r4, phys); /* * don't do anything on prep * for now, don't use bootinfo because it breaks yaboot 0.5 * and assume that if we didn't find a magic number, we have OF */ else if (*(unsigned long *)(0) != 0xdeadc0de) phys = prom_init(r3, r4, (prom_entry)r5); reloc_got2(-offset); #endif return phys; } #ifdef CONFIG_ALL_PPC void __init intuit_machine_type(void) { char *model; struct device_node *root; /* ask the OF info if we're a chrp or pmac */ root = find_path_device("/"); if (root != 0) { /* assume pmac unless proven to be chrp -- Cort */ _machine = _MACH_Pmac; model = get_property(root, "device_type", NULL); if (model && !strncmp("chrp", model, 4)) _machine = _MACH_chrp; else { model = get_property(root, "model", NULL); if (model && !strncmp(model, "IBM", 3)) _machine = _MACH_chrp; } } } /* * The ALL_PPC version of platform_init... */ void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { #ifdef CONFIG_BOOTX_TEXT if (boot_text_mapped) { btext_clearscreen(); btext_welcome(); } #endif parse_bootinfo(find_bootinfo()); /* if we didn't get any bootinfo telling us what we are... */ if (_machine == 0) { /* prep boot loader tells us if we're prep or not */ if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) ) _machine = _MACH_prep; } /* not much more to do here, if prep */ if (_machine == _MACH_prep) { prep_init(r3, r4, r5, r6, r7); return; } /* prom_init has already been called from __start */ if (boot_infos) relocate_nodes(); /* If we aren't PReP, we can find out if we're Pmac * or CHRP with this. */ if (_machine == 0) intuit_machine_type(); /* finish_device_tree may need _machine defined. */ finish_device_tree(); /* * If we were booted via quik, r3 points to the physical * address of the command-line parameters. * If we were booted from an xcoff image (i.e. netbooted or * booted from floppy), we get the command line from the * bootargs property of the /chosen node. * If an initial ramdisk is present, r3 and r4 * are used for initrd_start and initrd_size, * otherwise they contain 0xdeadbeef. */ if (r3 >= 0x4000 && r3 < 0x800000 && r4 == 0) { cmd_line[0] = 0; strncpy(cmd_line, (char *)r3 + KERNELBASE, sizeof(cmd_line)); } else if (boot_infos != 0) { /* booted by BootX - check for ramdisk */ if (boot_infos->kernelParamsOffset != 0) strncpy(cmd_line, (char *) boot_infos + boot_infos->kernelParamsOffset, sizeof(cmd_line)); #ifdef CONFIG_BLK_DEV_INITRD if (boot_infos->ramDisk) { initrd_start = (unsigned long) boot_infos + boot_infos->ramDisk; initrd_end = initrd_start + boot_infos->ramDiskSize; initrd_below_start_ok = 1; } #endif } else { struct device_node *chosen; char *p; #ifdef CONFIG_BLK_DEV_INITRD if (r3 && r4 && r4 != 0xdeadbeef) { if (r3 < KERNELBASE) r3 += KERNELBASE; initrd_start = r3; initrd_end = r3 + r4; ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); initrd_below_start_ok = 1; } #endif chosen = find_devices("chosen"); if (chosen != NULL) { p = get_property(chosen, "bootargs", NULL); if (p && *p) { cmd_line[0] = 0; strncpy(cmd_line, p, sizeof(cmd_line)); } } } cmd_line[sizeof(cmd_line) - 1] = 0; #ifdef CONFIG_ADB if (strstr(cmd_line, "adb_sync")) { extern int __adb_probe_sync; __adb_probe_sync = 1; } #endif /* CONFIG_ADB */ switch (_machine) { case _MACH_Pmac: pmac_init(r3, r4, r5, r6, r7); break; case _MACH_chrp: chrp_init(r3, r4, r5, r6, r7); break; } } #endif /* CONFIG_ALL_PPC */ struct bi_record *find_bootinfo(void) { struct bi_record *rec; extern char __bss_start[]; rec = (struct bi_record *)_ALIGN((ulong)__bss_start+(1<<20)-1,(1<<20)); if ( rec->tag != BI_FIRST ) { /* * This 0x10000 offset is a terrible hack but it will go away when * we have the bootloader handle all the relocation and * prom calls -- Cort */ rec = (struct bi_record *)_ALIGN((ulong)__bss_start+0x10000+(1<<20)-1,(1<<20)); if ( rec->tag != BI_FIRST ) return NULL; } return rec; } void parse_bootinfo(struct bi_record *rec) { if (rec == NULL || rec->tag != BI_FIRST) return; while (rec->tag != BI_LAST) { ulong *data = rec->data; switch (rec->tag) { case BI_CMD_LINE: memcpy(cmd_line, (void *)data, rec->size); break; case BI_SYSMAP: sysmap = (char *)((data[0] >= (KERNELBASE)) ? data[0] : (data[0]+KERNELBASE)); sysmap_size = data[1]; break; #ifdef CONFIG_BLK_DEV_INITRD case BI_INITRD: initrd_start = data[0] + KERNELBASE; initrd_end = data[0] + data[1] + KERNELBASE; break; #endif /* CONFIG_BLK_DEV_INITRD */ #ifdef CONFIG_ALL_PPC case BI_MACHTYPE: _machine = data[0]; break; #endif /* CONFIG_ALL_PPC */ case BI_MEMSIZE: boot_mem_size = data[0]; break; } rec = (struct bi_record *)((ulong)rec + rec->size); } } /* * Find out what kind of machine we're on and save any data we need * from the early boot process (devtree is copied on pmac by prom_init()). * This is called very early on the boot process, after a minimal * MMU environment has been set up but before MMU_init is called. */ void __init machine_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { #ifdef CONFIG_CMDLINE strcpy(cmd_line, CONFIG_CMDLINE); #endif /* CONFIG_CMDLINE */ platform_init(r3, r4, r5, r6, r7); if (ppc_md.progress) ppc_md.progress("id mach(): done", 0x200); } /* Checks "l2cr=xxxx" command-line option */ int __init ppc_setup_l2cr(char *str) { if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) { unsigned long val = simple_strtoul(str, NULL, 0); printk(KERN_INFO "l2cr set to %lx\n", val); _set_L2CR(0); /* force invalidate by disable cache */ _set_L2CR(val); /* and enable it */ } return 1; } __setup("l2cr=", ppc_setup_l2cr); int __init ppc_init(void) { /* clear the progress line */ if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff); if (ppc_md.init != NULL) { ppc_md.init(); } return 0; } arch_initcall(ppc_init); /* Warning, IO base is not yet inited */ void __init setup_arch(char **cmdline_p) { extern int panic_timeout; extern char _etext[], _edata[]; extern char *klimit; extern void do_init_bootmem(void); /* so udelay does something sensible, assume <= 1000 bogomips */ loops_per_jiffy = 500000000 / HZ; #ifdef CONFIG_ALL_PPC /* This could be called "early setup arch", it must be done * now because xmon need it */ if (_machine == _MACH_Pmac) pmac_feature_init(); /* New cool way */ #endif /* CONFIG_ALL_PPC */ #ifdef CONFIG_XMON xmon_map_scc(); if (strstr(cmd_line, "xmon")) xmon(0); #endif /* CONFIG_XMON */ if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab); #if defined(CONFIG_KGDB) kgdb_map_scc(); set_debug_traps(); if (strstr(cmd_line, "nokgdb")) printk("kgdb default breakpoint deactivated on command line\n"); else { printk("kgdb default breakpoint activated\n"); breakpoint(); } #endif /* * Set cache line size based on type of cpu as a default. * Systems with OF can look in the properties on the cpu node(s) * for a possibly more accurate value. */ if (cur_cpu_spec[0]->cpu_features & CPU_FTR_SPLIT_ID_CACHE) { dcache_bsize = cur_cpu_spec[0]->dcache_bsize; icache_bsize = cur_cpu_spec[0]->icache_bsize; ucache_bsize = 0; } else ucache_bsize = dcache_bsize = icache_bsize = cur_cpu_spec[0]->dcache_bsize; /* reboot on panic */ panic_timeout = 180; init_mm.start_code = PAGE_OFFSET; init_mm.end_code = (unsigned long) _etext; init_mm.end_data = (unsigned long) _edata; init_mm.brk = (unsigned long) klimit; /* Save unparsed command line copy for /proc/cmdline */ strcpy(saved_command_line, cmd_line); *cmdline_p = cmd_line; /* set up the bootmem stuff with available memory */ do_init_bootmem(); if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab); ppc_md.setup_arch(); if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); paging_init(); sort_exception_table(); /* this is for modules since _machine can be a define -- Cort */ ppc_md.ppc_machine = _machine; } #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) /* Convert the shorts/longs in hd_driveid from little to big endian; * chars are endian independant, of course, but strings need to be flipped. * (Despite what it says in drivers/block/ide.h, they come up as little * endian...) * * Changes to linux/hdreg.h may require changes here. */ void ppc_generic_ide_fix_driveid(struct hd_driveid *id) { int i; unsigned short *stringcast; id->config = __le16_to_cpu(id->config); id->cyls = __le16_to_cpu(id->cyls); id->reserved2 = __le16_to_cpu(id->reserved2); id->heads = __le16_to_cpu(id->heads); id->track_bytes = __le16_to_cpu(id->track_bytes); id->sector_bytes = __le16_to_cpu(id->sector_bytes); id->sectors = __le16_to_cpu(id->sectors); id->vendor0 = __le16_to_cpu(id->vendor0); id->vendor1 = __le16_to_cpu(id->vendor1); id->vendor2 = __le16_to_cpu(id->vendor2); stringcast = (unsigned short *)&id->serial_no[0]; for (i = 0; i < (20/2); i++) stringcast[i] = __le16_to_cpu(stringcast[i]); id->buf_type = __le16_to_cpu(id->buf_type); id->buf_size = __le16_to_cpu(id->buf_size); id->ecc_bytes = __le16_to_cpu(id->ecc_bytes); stringcast = (unsigned short *)&id->fw_rev[0]; for (i = 0; i < (8/2); i++) stringcast[i] = __le16_to_cpu(stringcast[i]); stringcast = (unsigned short *)&id->model[0]; for (i = 0; i < (40/2); i++) stringcast[i] = __le16_to_cpu(stringcast[i]); id->dword_io = __le16_to_cpu(id->dword_io); id->reserved50 = __le16_to_cpu(id->reserved50); id->field_valid = __le16_to_cpu(id->field_valid); id->cur_cyls = __le16_to_cpu(id->cur_cyls); id->cur_heads = __le16_to_cpu(id->cur_heads); id->cur_sectors = __le16_to_cpu(id->cur_sectors); id->cur_capacity0 = __le16_to_cpu(id->cur_capacity0); id->cur_capacity1 = __le16_to_cpu(id->cur_capacity1); id->lba_capacity = __le32_to_cpu(id->lba_capacity); id->dma_1word = __le16_to_cpu(id->dma_1word); id->dma_mword = __le16_to_cpu(id->dma_mword); id->eide_pio_modes = __le16_to_cpu(id->eide_pio_modes); id->eide_dma_min = __le16_to_cpu(id->eide_dma_min); id->eide_dma_time = __le16_to_cpu(id->eide_dma_time); id->eide_pio = __le16_to_cpu(id->eide_pio); id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy); for (i = 0; i < 2; i++) id->words69_70[i] = __le16_to_cpu(id->words69_70[i]); for (i = 0; i < 4; i++) id->words71_74[i] = __le16_to_cpu(id->words71_74[i]); id->queue_depth = __le16_to_cpu(id->queue_depth); for (i = 0; i < 4; i++) id->words76_79[i] = __le16_to_cpu(id->words76_79[i]); id->major_rev_num = __le16_to_cpu(id->major_rev_num); id->minor_rev_num = __le16_to_cpu(id->minor_rev_num); id->command_set_1 = __le16_to_cpu(id->command_set_1); id->command_set_2 = __le16_to_cpu(id->command_set_2); id->cfsse = __le16_to_cpu(id->cfsse); id->cfs_enable_1 = __le16_to_cpu(id->cfs_enable_1); id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2); id->csf_default = __le16_to_cpu(id->csf_default); id->dma_ultra = __le16_to_cpu(id->dma_ultra); id->word89 = __le16_to_cpu(id->word89); id->word90 = __le16_to_cpu(id->word90); id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues); id->word92 = __le16_to_cpu(id->word92); id->hw_config = __le16_to_cpu(id->hw_config); id->acoustic = __le16_to_cpu(id->acoustic); for (i = 0; i < 5; i++) id->words95_99[i] = __le16_to_cpu(id->words95_99[i]); id->lba_capacity_2 = __le64_to_cpu(id->lba_capacity_2); for (i = 0; i < 22; i++) id->words104_125[i] = __le16_to_cpu(id->words104_125[i]); id->last_lun = __le16_to_cpu(id->last_lun); id->word127 = __le16_to_cpu(id->word127); id->dlf = __le16_to_cpu(id->dlf); id->csfo = __le16_to_cpu(id->csfo); for (i = 0; i < 26; i++) id->words130_155[i] = __le16_to_cpu(id->words130_155[i]); id->word156 = __le16_to_cpu(id->word156); for (i = 0; i < 3; i++) id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); id->cfa_power = __le16_to_cpu(id->cfa_power); for (i = 0; i < 14; i++) id->words161_175[i] = __le16_to_cpu(id->words161_175[i]); for (i = 0; i < 31; i++) id->words176_205[i] = __le16_to_cpu(id->words176_205[i]); for (i = 0; i < 48; i++) id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); id->integrity_word = __le16_to_cpu(id->integrity_word); } #endif |
From: James S. <jsi...@us...> - 2002-03-15 18:59:33
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ia64/dig In directory usw-pr-cvs1:/tmp/cvs-serv15002/arch/ia64/dig Added Files: setup.c Log Message: Completely removed aux_device_present flag. --- NEW FILE: setup.c --- /* * Platform dependent support for DIG64 platforms. * * Copyright (C) 1999 Intel Corp. * Copyright (C) 1999, 2001 Hewlett-Packard Co * Copyright (C) 1999, 2001 David Mosberger-Tang <da...@hp...> * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond <dru...@va...> * Copyright (C) 1999 Vijay Chander <vi...@en...> */ #include <linux/config.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/kernel.h> #include <linux/kdev_t.h> #include <linux/string.h> #include <linux/tty.h> #include <linux/console.h> #include <linux/timex.h> #include <linux/sched.h> #include <asm/io.h> #include <asm/machvec.h> #include <asm/system.h> /* * This is here so we can use the CMOS detection in ide-probe.c to * determine what drives are present. In theory, we don't need this * as the auto-detection could be done via ide-probe.c:do_probe() but * in practice that would be much slower, which is painful when * running in the simulator. Note that passing zeroes in DRIVE_INFO * is sufficient (the IDE driver will autodetect the drive geometry). */ char drive_info[4*16]; void __init dig_setup (char **cmdline_p) { unsigned int orig_x, orig_y, num_cols, num_rows, font_height; /* * Default to /dev/sda2. This assumes that the EFI partition * is physical disk 1 partition 1 and the Linux root disk is * physical disk 1 partition 2. */ ROOT_DEV = to_kdev_t(0x0802); /* default to second partition on first drive */ #ifdef CONFIG_SMP init_smp_config(); #endif memset(&screen_info, 0, sizeof(screen_info)); if (!ia64_boot_param->console_info.num_rows || !ia64_boot_param->console_info.num_cols) { printk("dig_setup: warning: invalid screen-info, guessing 80x25\n"); orig_x = 0; orig_y = 0; num_cols = 80; num_rows = 25; font_height = 16; } else { orig_x = ia64_boot_param->console_info.orig_x; orig_y = ia64_boot_param->console_info.orig_y; num_cols = ia64_boot_param->console_info.num_cols; num_rows = ia64_boot_param->console_info.num_rows; font_height = 400 / num_rows; } screen_info.orig_x = orig_x; screen_info.orig_y = orig_y; screen_info.orig_video_cols = num_cols; screen_info.orig_video_lines = num_rows; screen_info.orig_video_points = font_height; screen_info.orig_video_mode = 3; /* XXX fake */ screen_info.orig_video_isVGA = 1; /* XXX fake */ screen_info.orig_video_ega_bx = 3; /* XXX fake */ } void dig_irq_init (void) { /* * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support * enabled. */ outb(0xff, 0xA1); outb(0xff, 0x21); } |
From: James S. <jsi...@us...> - 2002-03-15 18:59:33
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/cris/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15002/arch/cris/kernel Added Files: setup.c Log Message: Completely removed aux_device_present flag. --- NEW FILE: setup.c --- /* $Id: setup.c,v 1.1 2002/03/15 18:59:28 jsimmons Exp $ * * linux/arch/cris/kernel/setup.c * * Copyright (C) 1995 Linus Torvalds * Copyright (c) 2001 Axis Communications AB */ /* * This file handles the architecture-dependent parts of initialization */ #include <linux/errno.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/stddef.h> #include <linux/unistd.h> #include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> #include <linux/a.out.h> #include <linux/tty.h> #include <linux/ioport.h> #include <linux/delay.h> #include <linux/config.h> #include <linux/init.h> #include <linux/bootmem.h> #include <linux/seq_file.h> #include <asm/segment.h> #include <asm/system.h> #include <asm/smp.h> #include <asm/pgtable.h> #include <asm/types.h> #include <asm/svinto.h> /* * Setup options */ struct drive_info_struct { char dummy[32]; } drive_info; struct screen_info screen_info; extern int root_mountflags; extern char _etext, _edata, _end; #define COMMAND_LINE_SIZE 256 static char command_line[COMMAND_LINE_SIZE] = { 0, }; char saved_command_line[COMMAND_LINE_SIZE]; extern const unsigned long text_start, edata; /* set by the linker script */ extern unsigned long romfs_start, romfs_length, romfs_in_flash; /* from head.S */ /* This mainly sets up the memory area, and can be really confusing. * * The physical DRAM is virtually mapped into dram_start to dram_end * (usually c0000000 to c0000000 + DRAM size). The physical address is * given by the macro __pa(). * * In this DRAM, the kernel code and data is loaded, in the beginning. * It really starts at c0004000 to make room for some special pages - * the start address is text_start. The kernel data ends at _end. After * this the ROM filesystem is appended (if there is any). * * Between this address and dram_end, we have RAM pages usable to the * boot code and the system. * */ void __init setup_arch(char **cmdline_p) { extern void init_etrax_debug(void); unsigned long bootmap_size; unsigned long start_pfn, max_pfn; unsigned long memory_start; /* register an initial console printing routine for printk's */ init_etrax_debug(); /* we should really poll for DRAM size! */ high_memory = &dram_end; if(romfs_in_flash || !romfs_length) { /* if we have the romfs in flash, or if there is no rom filesystem, * our free area starts directly after the BSS */ memory_start = (unsigned long) &_end; } else { /* otherwise the free area starts after the ROM filesystem */ printk("ROM fs in RAM, size %lu bytes\n", romfs_length); memory_start = romfs_start + romfs_length; } /* process 1's initial memory region is the kernel code/data */ init_mm.start_code = (unsigned long) &text_start; init_mm.end_code = (unsigned long) &_etext; init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) #define PFN_PHYS(x) ((x) << PAGE_SHIFT) /* min_low_pfn points to the start of DRAM, start_pfn points * to the first DRAM pages after the kernel, and max_low_pfn * to the end of DRAM. */ /* * partially used pages are not usable - thus * we are rounding upwards: */ start_pfn = PFN_UP(memory_start); /* usually c0000000 + kernel + romfs */ max_pfn = PFN_DOWN((unsigned long)high_memory); /* usually c0000000 + dram size */ /* * Initialize the boot-time allocator (start, end) * * We give it access to all our DRAM, but we could as well just have * given it a small slice. No point in doing that though, unless we * have non-contiguous memory and want the boot-stuff to be in, say, * the smallest area. * * It will put a bitmap of the allocated pages in the beginning * of the range we give it, but it won't mark the bitmaps pages * as reserved. We have to do that ourselves below. * * We need to use init_bootmem_node instead of init_bootmem * because our map starts at a quite high address (min_low_pfn). */ max_low_pfn = max_pfn; min_low_pfn = PAGE_OFFSET >> PAGE_SHIFT; bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, min_low_pfn, max_low_pfn); /* And free all memory not belonging to the kernel (addr, size) */ free_bootmem(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn - start_pfn)); /* * Reserve the bootmem bitmap itself as well. We do this in two * steps (first step was init_bootmem()) because this catches * the (very unlikely) case of us accidentally initializing the * bootmem allocator with an invalid RAM area. * * Arguments are start, size */ reserve_bootmem(PFN_PHYS(start_pfn), bootmap_size); /* paging_init() sets up the MMU and marks all pages as reserved */ paging_init(); /* We dont use a command line yet, so just re-initialize it without saving anything that might be there. */ *cmdline_p = command_line; if (romfs_in_flash) { strncpy(command_line, "root=", COMMAND_LINE_SIZE); strncpy(command_line+5, CONFIG_ETRAX_ROOT_DEVICE, COMMAND_LINE_SIZE-5); /* Save command line copy for /proc/cmdline */ memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; } /* give credit for the CRIS port */ printk("Linux/CRIS port on ETRAX 100LX (c) 2001 Axis Communications AB\n"); } #ifdef CONFIG_PROC_FS #define HAS_FPU 0x0001 #define HAS_MMU 0x0002 #define HAS_ETHERNET100 0x0004 #define HAS_TOKENRING 0x0008 #define HAS_SCSI 0x0010 #define HAS_ATA 0x0020 #define HAS_USB 0x0040 #define HAS_IRQ_BUG 0x0080 #define HAS_MMU_BUG 0x0100 static struct cpu_info { char *model; unsigned short cache; unsigned short flags; } cpu_info[] = { /* The first four models will never ever run this code and are only here for display. */ { "ETRAX 1", 0, 0 }, { "ETRAX 2", 0, 0 }, { "ETRAX 3", 0, HAS_TOKENRING }, { "ETRAX 4", 0, HAS_TOKENRING | HAS_SCSI }, { "Unknown", 0, 0 }, { "Unknown", 0, 0 }, { "Unknown", 0, 0 }, { "Simulator", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA }, { "ETRAX 100", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_IRQ_BUG }, { "ETRAX 100", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA }, { "ETRAX 100LX", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB | HAS_MMU | HAS_MMU_BUG }, { "ETRAX 100LX v2", 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB | HAS_MMU }, { "Unknown", 0, 0 } /* This entry MUST be the last */ }; static int show_cpuinfo(struct seq_file *m, void *v) { unsigned long revision; struct cpu_info *info; /* read the version register in the CPU and print some stuff */ revision = rdvr(); if (revision >= sizeof cpu_info/sizeof *cpu_info) info = &cpu_info[sizeof cpu_info/sizeof *cpu_info - 1]; else info = &cpu_info[revision]; return seq_printf(m, "cpu\t\t: CRIS\n" "cpu revision\t: %lu\n" "cpu model\t: %s\n" "cache size\t: %d kB\n" "fpu\t\t: %s\n" "mmu\t\t: %s\n" "mmu DMA bug\t: %s\n" "ethernet\t: %s Mbps\n" "token ring\t: %s\n" "scsi\t\t: %s\n" "ata\t\t: %s\n" "usb\t\t: %s\n" "bogomips\t: %lu.%02lu\n", revision, info->model, info->cache, info->flags & HAS_FPU ? "yes" : "no", info->flags & HAS_MMU ? "yes" : "no", info->flags & HAS_MMU_BUG ? "yes" : "no", info->flags & HAS_ETHERNET100 ? "10/100" : "10", info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no", info->flags & HAS_SCSI ? "yes" : "no", info->flags & HAS_ATA ? "yes" : "no", info->flags & HAS_USB ? "yes" : "no", (loops_per_jiffy * HZ + 500) / 500000, ((loops_per_jiffy * HZ + 500) / 5000) % 100); } static void *c_start(struct seq_file *m, loff_t *pos) { /* We only got one CPU... */ return *pos < 1 ? (void *)1 : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) { ++*pos; return NULL; } static void c_stop(struct seq_file *m, void *v) { } struct seq_operations cpuinfo_op = { start: c_start, next: c_next, stop: c_stop, show: show_cpuinfo, }; #endif /* CONFIG_PROC_FS */ |
From: James S. <jsi...@us...> - 2002-03-15 18:59:32
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/alpha In directory usw-pr-cvs1:/tmp/cvs-serv15002/arch/alpha Modified Files: config.in Log Message: Completely removed aux_device_present flag. Index: config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/alpha/config.in,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- config.in 14 Mar 2002 22:32:20 -0000 1.25 +++ config.in 15 Mar 2002 18:59:28 -0000 1.26 @@ -316,7 +316,6 @@ fi endmenu -source drivers/usb/Config.in source drivers/input/Config.in source drivers/char/Config.in @@ -333,6 +332,7 @@ fi endmenu +source drivers/usb/Config.in source drivers/media/Config.in source drivers/video/Config.in |
From: James S. <jsi...@us...> - 2002-03-15 18:56:51
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ia64/dig In directory usw-pr-cvs1:/tmp/cvs-serv14330/dig Log Message: Directory /cvsroot/linuxconsole/ruby/linux/arch/ia64/dig added to the repository |
From: James S. <jsi...@us...> - 2002-03-15 18:56:07
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/cris/kernel In directory usw-pr-cvs1:/tmp/cvs-serv14156/kernel Log Message: Directory /cvsroot/linuxconsole/ruby/linux/arch/cris/kernel added to the repository |
From: James S. <jsi...@us...> - 2002-03-15 18:34:28
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/sbus/char In directory usw-pr-cvs1:/tmp/cvs-serv8195 Added Files: sunserial.c sunserial.h Log Message: Removed input device junk. --- NEW FILE: sunserial.c --- /* $Id: sunserial.c,v 1.1 2002/03/15 18:34:25 jsimmons Exp $ * serial.c: Serial port driver infrastructure for the Sparc. * * Copyright (C) 1997 Eddie C. Dost (ec...@sk...) */ #include <linux/config.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/tty.h> #include <linux/serial.h> #include <linux/serialP.h> #include <linux/string.h> #include <linux/version.h> #include <linux/init.h> #include <linux/bootmem.h> #include <asm/oplib.h> #include "sunserial.h" int serial_console; int stop_a_enabled = 1; int __init con_is_present(void) { return serial_console ? 0 : 1; } static void __init nop_rs_kgdb_hook(int channel) { printk("Oops: %s called\n", __FUNCTION__); } static void nop_rs_change_mouse_baud(int baud) { printk("Oops: %s called\n", __FUNCTION__); } static int nop_rs_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { printk("Oops: %s called\n", __FUNCTION__); return 0; } struct sunserial_operations rs_ops = { 0, nop_rs_kgdb_hook, nop_rs_change_mouse_baud, nop_rs_read_proc }; void rs_init(void) { static int invoked = 0; if (!invoked) { struct initfunc *init; invoked = 1; init = rs_ops.rs_init; while (init) { (void) init->init(); init = init->next; } } } void __init rs_kgdb_hook(int channel) { rs_ops.rs_kgdb_hook(channel); } void __init serial_console_init(void) { return; } void rs_change_mouse_baud(int baud) { rs_ops.rs_change_mouse_baud(baud); } int rs_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { return rs_ops.rs_read_proc(page, start, off, count, eof, data); } int register_serial(struct serial_struct *req) { return -1; } void unregister_serial(int line) { } void * __init sunserial_alloc_bootmem(unsigned long size) { void *ret; ret = __alloc_bootmem(size, SMP_CACHE_BYTES, 0UL); if (ret != NULL) memset(ret, 0, size); return ret; } void sunserial_setinitfunc(int (*init) (void)) { struct initfunc *rs_init; rs_init = sunserial_alloc_bootmem(sizeof(struct initfunc)); if (rs_init == NULL) { prom_printf("sunserial_setinitfunc: Cannot alloc initfunc.\n"); prom_halt(); } rs_init->init = init; rs_init->next = rs_ops.rs_init; rs_ops.rs_init = rs_init; } void sunserial_console_termios(struct console *con) { char mode[16], buf[16], *s; char *mode_prop = "ttyX-mode"; char *cd_prop = "ttyX-ignore-cd"; char *dtr_prop = "ttyX-rts-dtr-off"; int baud, bits, stop, cflag; char parity; int carrier = 0; int rtsdtr = 1; int topnd, nd; if (!serial_console) return; if (serial_console == 1) { mode_prop[3] = 'a'; cd_prop[3] = 'a'; dtr_prop[3] = 'a'; } else { mode_prop[3] = 'b'; cd_prop[3] = 'b'; dtr_prop[3] = 'b'; } topnd = prom_getchild(prom_root_node); nd = prom_searchsiblings(topnd, "options"); if (!nd) { strcpy(mode, "9600,8,n,1,-"); goto no_options; } if (!prom_node_has_property(nd, mode_prop)) { strcpy(mode, "9600,8,n,1,-"); goto no_options; } memset(mode, 0, sizeof(mode)); prom_getstring(nd, mode_prop, mode, sizeof(mode)); if (prom_node_has_property(nd, cd_prop)) { memset(buf, 0, sizeof(buf)); prom_getstring(nd, cd_prop, buf, sizeof(buf)); if (!strcmp(buf, "false")) carrier = 1; /* XXX: this is unused below. */ } if (prom_node_has_property(nd, cd_prop)) { memset(buf, 0, sizeof(buf)); prom_getstring(nd, cd_prop, buf, sizeof(buf)); if (!strcmp(buf, "false")) rtsdtr = 0; /* XXX: this is unused below. */ } no_options: cflag = CREAD | HUPCL | CLOCAL; s = mode; baud = simple_strtoul(s, 0, 0); s = strchr(s, ','); bits = simple_strtoul(++s, 0, 0); s = strchr(s, ','); parity = *(++s); s = strchr(s, ','); stop = simple_strtoul(++s, 0, 0); s = strchr(s, ','); /* XXX handshake is not handled here. */ switch (baud) { case 150: cflag |= B150; break; case 300: cflag |= B300; break; case 600: cflag |= B600; break; case 1200: cflag |= B1200; break; case 2400: cflag |= B2400; break; case 4800: cflag |= B4800; break; case 9600: cflag |= B9600; break; case 19200: cflag |= B19200; break; case 38400: cflag |= B38400; break; default: baud = 9600; cflag |= B9600; break; } switch (bits) { case 5: cflag |= CS5; break; case 6: cflag |= CS6; break; case 7: cflag |= CS7; break; case 8: cflag |= CS8; break; default: cflag |= CS8; break; } switch (parity) { case 'o': cflag |= (PARENB | PARODD); break; case 'e': cflag |= PARENB; break; case 'n': default: break; } switch (stop) { case 2: cflag |= CSTOPB; break; case 1: default: break; } con->cflag = cflag; } extern int su_probe(void); extern int zs_probe(void); #ifdef CONFIG_SAB82532 extern int sab82532_probe(void); #endif void __init sun_serial_setup(void) { int ret = 1; #if defined(CONFIG_PCI) && !defined(__sparc_v9__) /* * Probing sequence on sparc differs from sparc64. * Keyboard is probed ahead of su because we want su function * when keyboard is active. su is probed ahead of zs in order to * get console on MrCoffee with fine but disconnected zs. */ if (su_probe() == 0) return; #endif if (zs_probe() == 0) return; #ifdef CONFIG_SAB82532 ret = sab82532_probe(); #endif #if defined(CONFIG_PCI) && defined(__sparc_v9__) /* * Keyboard serial devices. * * Well done, Sun, prom_devopen("/pci@1f,4000/ebus@1/su@14,3083f8") * hangs the machine if no keyboard is connected to the device... * All PCI PROMs seem to do this, I have seen this on the Ultra 450 * with version 3.5 PROM, and on the Ultra/AX with 3.1.5 PROM. * * So be very careful not to probe for keyboards if we are on a * serial console. */ if (su_probe() == 0) return; #endif if (!ret) return; #ifdef __sparc_v9__ { extern int this_is_starfire; /* Hello, Starfire. Pleased to meet you :) */ if(this_is_starfire != 0) return; } #endif prom_printf("No serial devices found, bailing out.\n"); prom_halt(); } --- NEW FILE: sunserial.h --- /* $Id: sunserial.h,v 1.1 2002/03/15 18:34:25 jsimmons Exp $ * sunserial.h: SUN serial driver infrastructure (including keyboards). * * Copyright (C) 1997 Eddie C. Dost (ec...@sk...) */ #ifndef _SPARC_SUNSERIAL_H #define _SPARC_SUNSERIAL_H 1 #include <linux/config.h> #include <linux/tty.h> #include <linux/kd.h> #include <linux/kbd_kern.h> #include <linux/console.h> struct initfunc { int (*init) (void); struct initfunc *next; }; struct sunserial_operations { struct initfunc *rs_init; void (*rs_kgdb_hook) (int); void (*rs_change_mouse_baud) (int); int (*rs_read_proc) (char *, char **, off_t, int, int *, void *); }; extern struct sunserial_operations rs_ops; extern void sunserial_setinitfunc(int (*) (void)); extern int serial_console; extern int stop_a_enabled; extern void sunserial_console_termios(struct console *); #endif /* !(_SPARC_SUNSERIAL_H) */ |
From: James S. <jsi...@us...> - 2002-03-15 18:28:17
|
Update of /cvsroot/linuxconsole/ruby/utils In directory usw-pr-cvs1:/tmp/cvs-serv4512/utils Modified Files: remove-obsolete-files Log Message: Alots of fixes across many platforms. Index: remove-obsolete-files =================================================================== RCS file: /cvsroot/linuxconsole/ruby/utils/remove-obsolete-files,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- remove-obsolete-files 14 Mar 2002 22:35:55 -0000 1.29 +++ remove-obsolete-files 15 Mar 2002 18:28:12 -0000 1.30 @@ -1,6 +1,7 @@ #!/bin/sh rm -fv Documentation/usb/hid.txt +rm -fv arch/arm/lib/kbd.o rm -fv arch/m68k/atari/atakeyb.c rm -fv arch/m68k/atari/joystick.c rm -fv arch/m68k/hp300/hil.c @@ -30,9 +31,13 @@ rm -fv drivers/char/pc110pad.c rm -fv drivers/char/pc110pad.h rm -fv drivers/char/pc_keyb.c +rm -fv drivers/char/ec3104_keyb.c rm -fv drivers/char/q40_keyb.c rm -fv drivers/char/qpmouse.c rm -fv drivers/macintosh/mac_keyb.c +rm -fv drivers/tc/lk201.c +rm -fv drivers/tc/lk201-remap.c +rm -rf drivers/tc/lk201-map.map rm -fv drivers/sbus/char/pcikbd.c rm -fv drivers/sbus/char/pcikbd.h rm -fv drivers/sbus/char/sunkbd.c |
From: James S. <jsi...@us...> - 2002-03-15 18:28:16
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/tc In directory usw-pr-cvs1:/tmp/cvs-serv4512/linux/drivers/tc Added Files: Makefile Log Message: Alots of fixes across many platforms. --- NEW FILE: Makefile --- # # Makefile for the linux kernel. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # # Note 2! The CFLAGS definitions are now in the main makefile... # All of the (potential) objects that export symbols. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. export-objs := tc.o # Object file lists. obj-y := obj-m := obj-n := obj- := obj-$(CONFIG_TC) += tc.o obj-$(CONFIG_ZS) += zs.o # Files that are both resident and modular: remove from modular. obj-m := $(filter-out $(obj-y), $(obj-m)) # Translate to Rules.make lists. L_TARGET := tc.a L_OBJS := $(sort $(filter-out $(export-objs), $(obj-y))) LX_OBJS := $(sort $(filter $(export-objs), $(obj-y))) M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) include $(TOPDIR)/Rules.make |
From: James S. <jsi...@us...> - 2002-03-15 18:28:16
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/ppc64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv4512/linux/arch/ppc64/kernel Added Files: chrp_setup.c iSeries_setup.c ioctl32.c open_pic.c Log Message: Alots of fixes across many platforms. --- NEW FILE: chrp_setup.c --- /* * linux/arch/ppc/kernel/setup.c * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (co...@cs...) * Modified by PPC64 Team, IBM Corp * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ /* * bootup setup stuff.. */ #include <linux/config.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/stddef.h> #include <linux/unistd.h> #include <linux/ptrace.h> #include <linux/slab.h> #include <linux/user.h> #include <linux/a.out.h> #include <linux/tty.h> #include <linux/major.h> #include <linux/interrupt.h> #include <linux/reboot.h> #include <linux/init.h> #include <linux/blk.h> #include <linux/ioport.h> #include <linux/pci.h> #include <linux/version.h> #include <linux/adb.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/irq.h> #include <linux/seq_file.h> #include <asm/mmu.h> #include <asm/processor.h> #include <asm/io.h> #include <asm/pgtable.h> #include <asm/prom.h> #include <asm/rtas.h> #include <asm/pci-bridge.h> #include <asm/pci_dma.h> #include <asm/dma.h> #include <asm/machdep.h> #include <asm/irq.h> #include <asm/keyboard.h> #include <asm/init.h> #include <asm/Naca.h> #include <asm/time.h> #include "local_irq.h" #include "i8259.h" #include "open_pic.h" #include "xics.h" #include <asm/ppcdebug.h> extern volatile unsigned char *chrp_int_ack_special; extern struct Naca *naca; void chrp_setup_pci_ptrs(void); void chrp_progress(char *, unsigned short); void chrp_request_regions(void); extern void openpic_init_IRQ(void); extern void init_ras_IRQ(void); extern void find_and_init_phbs(void); extern void pSeries_pcibios_fixup(void); extern void iSeries_pcibios_fixup(void); extern void pSeries_get_rtc_time(struct rtc_time *rtc_time); extern int pSeries_set_rtc_time(struct rtc_time *rtc_time); void pSeries_calibrate_decr(void); kdev_t boot_dev; unsigned long virtPython0Facilities = 0; // python0 facility area (memory mapped io) (64-bit format) VIRTUAL address. extern HPTE *Hash, *Hash_end; extern unsigned long Hash_size, Hash_mask; extern int probingmem; extern unsigned long loops_per_jiffy; #ifdef CONFIG_BLK_DEV_RAM extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */ extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */ extern int rd_image_start; /* starting block # of image */ #endif void chrp_get_cpuinfo(struct seq_file *m) { struct device_node *root; const char *model = ""; root = find_path_device("/"); if (root) model = get_property(root, "model", NULL); seq_printf(m, "machine\t\t: CHRP %s\n", model); } void __init chrp_request_regions(void) { request_region(0x20,0x20,"pic1"); request_region(0xa0,0x20,"pic2"); request_region(0x00,0x20,"dma1"); request_region(0x40,0x20,"timer"); request_region(0x80,0x10,"dma page reg"); request_region(0xc0,0x20,"dma2"); } void __init chrp_setup_arch(void) { extern char cmd_line[]; struct device_node *root; unsigned int *opprop; /* openpic global configuration register (64-bit format). */ /* openpic Interrupt Source Unit pointer (64-bit format). */ /* python0 facility area (mmio) (64-bit format) REAL address. */ /* init to some ~sane value until calibrate_delay() runs */ loops_per_jiffy = 50000000; #ifdef CONFIG_BLK_DEV_INITRD /* this is fine for chrp */ initrd_below_start_ok = 1; if (initrd_start) ROOT_DEV = mk_kdev(RAMDISK_MAJOR, 0); else #endif ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the kernel) */ printk("Boot arguments: %s\n", cmd_line); /* Find and initialize PCI host bridges */ /* iSeries needs to be done much later. */ #ifndef CONFIG_PPC_ISERIES find_and_init_phbs(); #endif /* Find the Open PIC if present */ root = find_path_device("/"); opprop = (unsigned int *) get_property(root, "platform-open-pic", NULL); if (opprop != 0) { int n = prom_n_addr_cells(root); unsigned long openpic; for (openpic = 0; n > 0; --n) openpic = (openpic << 32) + *opprop++; printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic); udbg_printf("OpenPIC addr: %lx\n", openpic); OpenPIC_Addr = __ioremap(openpic, 0x40000, _PAGE_NO_CACHE); } #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif } void __init chrp_init2(void) { /* * It is sensitive, when this is called (not too earlu) * -- tibit */ chrp_request_regions(); ppc_md.progress(UTS_RELEASE, 0x7777); } /* Early initialization. Relocation is on but do not reference unbolted pages */ void __init pSeries_init_early(void) { #ifdef CONFIG_PPC_PSERIES /* This ifdef should go away */ void *comport; hpte_init_pSeries(); tce_init_pSeries(); pSeries_pcibios_init_early(); #ifdef CONFIG_SMP smp_init_pSeries(); #endif /* Map the uart for udbg. */ comport = (void *)__ioremap(naca->serialPortAddr, 16, _PAGE_NO_CACHE); udbg_init_uart(comport); ppc_md.udbg_putc = udbg_putc; ppc_md.udbg_getc = udbg_getc; ppc_md.udbg_getc_poll = udbg_getc_poll; #endif } void __init chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { #if 0 /* PPPBBB remove this later... -Peter */ #ifdef CONFIG_BLK_DEV_INITRD /* take care of initrd if we have one */ if ( r6 ) { initrd_start = __va(r6); initrd_end = __va(r6 + r7); } #endif /* CONFIG_BLK_DEV_INITRD */ #endif ppc_md.ppc_machine = _machine; ppc_md.setup_arch = chrp_setup_arch; ppc_md.setup_residual = NULL; ppc_md.get_cpuinfo = chrp_get_cpuinfo; if(naca->interrupt_controller == IC_OPEN_PIC) { ppc_md.init_IRQ = openpic_init_IRQ; ppc_md.get_irq = openpic_get_irq; ppc_md.post_irq = NULL; } else { ppc_md.init_IRQ = xics_init_IRQ; ppc_md.get_irq = xics_get_irq; ppc_md.post_irq = NULL; } ppc_md.init_ras_IRQ = init_ras_IRQ; #ifndef CONFIG_PPC_ISERIES ppc_md.pcibios_fixup = pSeries_pcibios_fixup; #else ppc_md.pcibios_fixup = NULL; // ppc_md.pcibios_fixup = iSeries_pcibios_fixup; #endif ppc_md.init = chrp_init2; ppc_md.restart = rtas_restart; ppc_md.power_off = rtas_power_off; ppc_md.halt = rtas_halt; ppc_md.time_init = NULL; ppc_md.get_boot_time = pSeries_get_rtc_time; ppc_md.get_rtc_time = pSeries_get_rtc_time; ppc_md.set_rtc_time = pSeries_set_rtc_time; ppc_md.calibrate_decr = pSeries_calibrate_decr; ppc_md.progress = chrp_progress; ppc_md.progress("Linux ppc64\n", 0x0); } void __chrp chrp_progress(char *s, unsigned short hex) { struct device_node *root; int width, *p; char *os; static int display_character, set_indicator; static int max_width; if (hex) udbg_printf("<chrp_progress> %s\n", s); if (!rtas.base || (_machine != _MACH_pSeries)) return; if (max_width == 0) { if ( (root = find_path_device("/rtas")) && (p = (unsigned int *)get_property(root, "ibm,display-line-length", NULL)) ) max_width = *p; else max_width = 0x10; display_character = rtas_token("display-character"); set_indicator = rtas_token("set-indicator"); } if (display_character == RTAS_UNKNOWN_SERVICE) { /* use hex display */ if (set_indicator == RTAS_UNKNOWN_SERVICE) return; rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex); return; } rtas_call(display_character, 1, 1, NULL, '\r'); width = max_width; os = s; while ( *os ) { if ( (*os == '\n') || (*os == '\r') ) width = max_width; else width--; rtas_call(display_character, 1, 1, NULL, *os++ ); /* if we overwrite the screen length */ if ( width == 0 ) while ( (*os != 0) && (*os != '\n') && (*os != '\r') ) os++; } /* Blank to end of line. */ while ( width-- > 0 ) rtas_call(display_character, 1, 1, NULL, ' ' ); } extern void setup_default_decr(void); void __init pSeries_calibrate_decr(void) { struct device_node *cpu; struct div_result divres; int *fp; unsigned long freq; /* * The cpu node should have a timebase-frequency property * to tell us the rate at which the decrementer counts. */ freq = 16666000; /* hardcoded default */ cpu = find_type_devices("cpu"); if (cpu != 0) { fp = (int *) get_property(cpu, "timebase-frequency", NULL); if (fp != 0) freq = *fp; } printk("time_init: decrementer frequency = %lu.%.6lu MHz\n", freq/1000000, freq%1000000 ); tb_ticks_per_jiffy = freq / HZ; tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; tb_ticks_per_usec = freq / 1000000; tb_to_us = mulhwu_scale_factor(freq, 1000000); div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres ); tb_to_xs = divres.result_low; setup_default_decr(); } --- NEW FILE: iSeries_setup.c --- /* * * * Copyright (c) 2000 Mike Corrigan <mi...@us...> * Copyright (c) 1999-2000 Grant Erickson <gr...@lc...> * * Module name: iSeries_setup.c * * Description: * Architecture- / platform-specific boot-time initialization code for * the IBM iSeries LPAR. Adapted from original code by Grant Erickson and * code by Gary Thomas, Cort Dougan <co...@fs...>, and Dan Malek * <da...@ne...>. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <linux/config.h> #include <linux/init.h> #include <linux/threads.h> #include <linux/smp.h> #include <linux/param.h> #include <linux/string.h> #include <linux/bootmem.h> #include <linux/blk.h> #include <asm/processor.h> #include <asm/machdep.h> #include <asm/page.h> #include <asm/mmu.h> #include <asm/pgtable.h> #include <asm/mmu_context.h> #include <asm/time.h> #include "iSeries_setup.h" #include <asm/Naca.h> #include <asm/Paca.h> #include <asm/iSeries/LparData.h> #include <asm/iSeries/HvCallHpt.h> #include <asm/iSeries/HvLpConfig.h> #include <asm/iSeries/HvCallEvent.h> #include <asm/iSeries/HvCallSm.h> #include <asm/iSeries/HvCallXm.h> #include <asm/iSeries/ItLpQueue.h> #include <asm/iSeries/IoHriMainStore.h> #include <asm/iSeries/iSeries_proc.h> #include <asm/proc_pmc.h> #include <asm/iSeries/mf.h> /* Function Prototypes */ extern void abort(void); #ifdef CONFIG_PPC_ISERIES static void build_iSeries_Memory_Map( void ); static void setup_iSeries_cache_sizes( void ); static void iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr); #endif void build_valid_hpte( unsigned long vsid, unsigned long ea, unsigned long pa, pte_t * ptep, unsigned hpteflags, unsigned bolted ); extern void ppcdbg_initialize(void); extern void iSeries_pcibios_init(void); extern void iSeries_pcibios_fixup(void); extern void iSeries_pcibios_fixup_bus(int); static void iSeries_setup_dprofile(void); /* Global Variables */ static unsigned long procFreqHz = 0; static unsigned long procFreqMhz = 0; static unsigned long procFreqMhzHundreths = 0; static unsigned long tbFreqHz = 0; static unsigned long tbFreqMhz = 0; static unsigned long tbFreqMhzHundreths = 0; unsigned long dprof_shift = 0; unsigned long dprof_len = 0; unsigned int * dprof_buffer = NULL; int piranha_simulator = 0; extern char _end[]; extern struct Naca *naca; extern int rd_size; /* Defined in drivers/block/rd.c */ extern unsigned long klimit; extern unsigned long embedded_sysmap_start; extern unsigned long embedded_sysmap_end; extern unsigned long iSeries_recal_tb; extern unsigned long iSeries_recal_titan; extern char _stext; extern char _etext; static int mf_initialized = 0; struct MemoryBlock { unsigned long absStart; unsigned long absEnd; unsigned long logicalStart; unsigned long logicalEnd; }; /* * Process the main store vpd to determine where the holes in memory are * and return the number of physical blocks and fill in the array of * block data. */ unsigned long iSeries_process_Condor_mainstore_vpd( struct MemoryBlock *mb_array, unsigned long max_entries ) { /* Determine if absolute memory has any * holes so that we can interpret the * access map we get back from the hypervisor * correctly. */ unsigned long holeFirstChunk, holeSizeChunks; unsigned long numMemoryBlocks = 1; struct IoHriMainStoreSegment4 * msVpd = (struct IoHriMainStoreSegment4 *)xMsVpd; unsigned long holeStart = msVpd->nonInterleavedBlocksStartAdr; unsigned long holeEnd = msVpd->nonInterleavedBlocksEndAdr; unsigned long holeSize = holeEnd - holeStart; printk("Mainstore_VPD: Condor\n"); mb_array[0].logicalStart = 0; mb_array[0].logicalEnd = 0x100000000; mb_array[0].absStart = 0; mb_array[0].absEnd = 0x100000000; if ( holeSize ) { numMemoryBlocks = 2; holeStart = holeStart & 0x000fffffffffffff; holeStart = addr_to_chunk(holeStart); holeFirstChunk = holeStart; holeSize = addr_to_chunk(holeSize); holeSizeChunks = holeSize; printk( "Main store hole: start chunk = %0lx, size = %0lx chunks\n", holeFirstChunk, holeSizeChunks ); mb_array[0].logicalEnd = holeFirstChunk; mb_array[0].absEnd = holeFirstChunk; mb_array[1].logicalStart = holeFirstChunk; mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks; mb_array[1].absStart = holeFirstChunk + holeSizeChunks; mb_array[1].absEnd = 0x100000000; } return numMemoryBlocks; } #define MaxSegmentAreas 32 #define MaxSegmentAdrRangeBlocks 128 #define MaxAreaRangeBlocks 4 unsigned long iSeries_process_Regatta_mainstore_vpd( struct MemoryBlock *mb_array, unsigned long max_entries ) { struct IoHriMainStoreSegment5 * msVpdP = (struct IoHriMainStoreSegment5 *)xMsVpd; unsigned long numSegmentBlocks = 0; u32 existsBits = msVpdP->msAreaExists; unsigned long area_num; printk("Mainstore_VPD: Regatta\n"); for ( area_num = 0; area_num < MaxSegmentAreas; ++area_num ) { unsigned long numAreaBlocks; struct IoHriMainStoreArea4 * currentArea; if ( existsBits & 0x80000000 ) { unsigned long block_num; currentArea = &msVpdP->msAreaArray[area_num]; numAreaBlocks = currentArea->numAdrRangeBlocks; printk("ms_vpd: processing area %2ld blocks=%ld", area_num, numAreaBlocks); for ( block_num = 0; block_num < numAreaBlocks; ++block_num ) { /* Process an address range block */ struct MemoryBlock tempBlock; unsigned long i; tempBlock.absStart = (unsigned long)currentArea->xAdrRangeBlock[block_num].blockStart; tempBlock.absEnd = (unsigned long)currentArea->xAdrRangeBlock[block_num].blockEnd; tempBlock.logicalStart = 0; tempBlock.logicalEnd = 0; printk("\n block %ld absStart=%016lx absEnd=%016lx", block_num, tempBlock.absStart, tempBlock.absEnd); for ( i=0; i<numSegmentBlocks; ++i ) { if ( mb_array[i].absStart == tempBlock.absStart ) break; } if ( i == numSegmentBlocks ) { if ( numSegmentBlocks == max_entries ) { panic("iSeries_process_mainstore_vpd: too many memory blocks"); } mb_array[numSegmentBlocks] = tempBlock; ++numSegmentBlocks; } else { printk(" (duplicate)"); } } printk("\n"); } existsBits <<= 1; } /* Now sort the blocks found into ascending sequence */ if ( numSegmentBlocks > 1 ) { unsigned long m, n; for ( m=0; m<numSegmentBlocks-1; ++m ) { for ( n=numSegmentBlocks-1; m<n; --n ) { if ( mb_array[n].absStart < mb_array[n-1].absStart ) { struct MemoryBlock tempBlock; tempBlock = mb_array[n]; mb_array[n] = mb_array[n-1]; mb_array[n-1] = tempBlock; } } } } /* Assign "logical" addresses to each block. These * addresses correspond to the hypervisor "bitmap" space. * Convert all addresses into units of 256K chunks. */ { unsigned long i, nextBitmapAddress; printk("ms_vpd: %ld sorted memory blocks\n", numSegmentBlocks); nextBitmapAddress = 0; for ( i=0; i<numSegmentBlocks; ++i ) { unsigned long length = mb_array[i].absEnd - mb_array[i].absStart; mb_array[i].logicalStart = nextBitmapAddress; mb_array[i].logicalEnd = nextBitmapAddress + length; nextBitmapAddress += length; printk(" Bitmap range: %016lx - %016lx\n" " Absolute range: %016lx - %016lx\n", mb_array[i].logicalStart, mb_array[i].logicalEnd, mb_array[i].absStart, mb_array[i].absEnd); mb_array[i].absStart = addr_to_chunk( mb_array[i].absStart & 0x000fffffffffffff ); mb_array[i].absEnd = addr_to_chunk( mb_array[i].absEnd & 0x000fffffffffffff ); mb_array[i].logicalStart = addr_to_chunk( mb_array[i].logicalStart ); mb_array[i].logicalEnd = addr_to_chunk( mb_array[i].logicalEnd ); } } return numSegmentBlocks; } unsigned long iSeries_process_mainstore_vpd( struct MemoryBlock *mb_array, unsigned long max_entries ) { unsigned long i; unsigned long mem_blocks = 0; if ( __is_processor( PV_POWER4 ) ) mem_blocks = iSeries_process_Regatta_mainstore_vpd( mb_array, max_entries ); else mem_blocks = iSeries_process_Condor_mainstore_vpd( mb_array, max_entries ); printk("Mainstore_VPD: numMemoryBlocks = %ld \n", mem_blocks); for ( i=0; i<mem_blocks; ++i ) { printk("Mainstore_VPD: block %3ld logical chunks %016lx - %016lx\n" " abs chunks %016lx - %016lx\n", i, mb_array[i].logicalStart, mb_array[i].logicalEnd, mb_array[i].absStart, mb_array[i].absEnd); } return mem_blocks; } /* * void __init iSeries_init_early() */ void __init iSeries_init_early(void) { #ifdef CONFIG_PPC_ISERIES ppcdbg_initialize(); #if defined(CONFIG_BLK_DEV_INITRD) /* * If the init RAM disk has been configured and there is * a non-zero starting address for it, set it up */ if ( naca->xRamDisk ) { initrd_start = (unsigned long)__va(naca->xRamDisk); initrd_end = initrd_start + naca->xRamDiskSize * PAGE_SIZE; initrd_below_start_ok = 1; // ramdisk in kernel space ROOT_DEV = MKDEV( RAMDISK_MAJOR, 0 ); if ( ((rd_size*1024)/PAGE_SIZE) < naca->xRamDiskSize ) rd_size = (naca->xRamDiskSize*PAGE_SIZE)/1024; } else #endif /* CONFIG_BLK_DEV_INITRD */ { /* ROOT_DEV = MKDEV( VIODASD_MAJOR, 1 ); */ } iSeries_recal_tb = get_tb(); iSeries_recal_titan = HvCallXm_loadTod(); ppc_md.setup_arch = iSeries_setup_arch; ppc_md.setup_residual = iSeries_setup_residual; ppc_md.get_cpuinfo = iSeries_get_cpuinfo; ppc_md.irq_cannonicalize = NULL; ppc_md.init_IRQ = iSeries_init_IRQ; ppc_md.init_ras_IRQ = NULL; ppc_md.get_irq = iSeries_get_irq; ppc_md.init = NULL; ppc_md.pcibios_fixup = iSeries_pcibios_fixup; ppc_md.pcibios_fixup_bus = iSeries_pcibios_fixup_bus; ppc_md.restart = iSeries_restart; ppc_md.power_off = iSeries_power_off; ppc_md.halt = iSeries_halt; ppc_md.time_init = NULL; ppc_md.get_boot_time = iSeries_get_boot_time; ppc_md.set_rtc_time = iSeries_set_rtc_time; ppc_md.get_rtc_time = iSeries_get_rtc_time; ppc_md.calibrate_decr = iSeries_calibrate_decr; ppc_md.progress = iSeries_progress; hpte_init_iSeries(); tce_init_iSeries(); /* Initialize the table which translate Linux physical addresses to * AS/400 absolute addresses */ build_iSeries_Memory_Map(); setup_iSeries_cache_sizes(); /* Initialize machine-dependency vectors */ #ifdef CONFIG_SMP smp_init_iSeries(); #endif if ( itLpNaca.xPirEnvironMode == 0 ) piranha_simulator = 1; #endif } /* * void __init iSeries_init() */ void __init iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { /* Associate Lp Event Queue 0 with processor 0 */ HvCallEvent_setLpEventQueueInterruptProc( 0, 0 ); { /* copy the command line parameter from the primary VSP */ char *p, *q; HvCallEvent_dmaToSp( cmd_line, 2*64*1024, 256, HvLpDma_Direction_RemoteToLocal ); p = q = cmd_line + 255; while( p > cmd_line ) { if ((*p == 0) || (*p == ' ') || (*p == '\n')) --p; else break; } if ( p < q ) *(p+1) = 0; } if (strstr(cmd_line, "dprofile=")) { char *p, *q; for (q = cmd_line; (p = strstr(q, "dprofile=")) != 0; ) { unsigned long size, new_klimit; q = p + 9; if (p > cmd_line && p[-1] != ' ') continue; dprof_shift = simple_strtoul(q, &q, 0); dprof_len = (unsigned long)&_etext - (unsigned long)&_stext; dprof_len >>= dprof_shift; size = ((dprof_len * sizeof(unsigned int)) + (PAGE_SIZE-1)) & PAGE_MASK; dprof_buffer = (unsigned int *)((klimit + (PAGE_SIZE-1)) & PAGE_MASK); new_klimit = ((unsigned long)dprof_buffer) + size; lmb_reserve( __pa(klimit), (new_klimit-klimit)); klimit = new_klimit; memset( dprof_buffer, 0, size ); } } iSeries_setup_dprofile(); iSeries_proc_early_init(); mf_init(); mf_initialized = 1; mb(); iSeries_proc_callback( &pmc_proc_init ); } #ifdef CONFIG_PPC_ISERIES /* * The iSeries may have very large memories ( > 128 GB ) and a partition * may get memory in "chunks" that may be anywhere in the 2**52 real * address space. The chunks are 256K in size. To map this to the * memory model Linux expects, the AS/400 specific code builds a * translation table to translate what Linux thinks are "physical" * addresses to the actual real addresses. This allows us to make * it appear to Linux that we have contiguous memory starting at * physical address zero while in fact this could be far from the truth. * To avoid confusion, I'll let the words physical and/or real address * apply to the Linux addresses while I'll use "absolute address" to * refer to the actual hardware real address. * * build_iSeries_Memory_Map gets information from the Hypervisor and * looks at the Main Store VPD to determine the absolute addresses * of the memory that has been assigned to our partition and builds * a table used to translate Linux's physical addresses to these * absolute addresses. Absolute addresses are needed when * communicating with the hypervisor (e.g. to build HPT entries) */ static void __init build_iSeries_Memory_Map(void) { u32 loadAreaFirstChunk, loadAreaLastChunk, loadAreaSize; u32 nextPhysChunk; u32 hptFirstChunk, hptLastChunk, hptSizeChunks, hptSizePages; u32 num_ptegs; u32 totalChunks,moreChunks; u32 currChunk, thisChunk, absChunk; u32 currDword; u32 chunkBit; u64 map; struct MemoryBlock mb[32]; unsigned long numMemoryBlocks, curBlock; /* Chunk size on iSeries is 256K bytes */ totalChunks = (u32)HvLpConfig_getMsChunks(); klimit = msChunks_alloc(klimit, totalChunks, 1UL<<18); /* Get absolute address of our load area * and map it to physical address 0 * This guarantees that the loadarea ends up at physical 0 * otherwise, it might not be returned by PLIC as the first * chunks */ loadAreaFirstChunk = (u32)addr_to_chunk(itLpNaca.xLoadAreaAddr); loadAreaSize = itLpNaca.xLoadAreaChunks; /* Only add the pages already mapped here. * Otherwise we might add the hpt pages * The rest of the pages of the load area * aren't in the HPT yet and can still * be assigned an arbitrary physical address */ if ( (loadAreaSize * 64) > HvPagesToMap ) loadAreaSize = HvPagesToMap / 64; loadAreaLastChunk = loadAreaFirstChunk + loadAreaSize - 1; /* TODO Do we need to do something if the HPT is in the 64MB load area? * This would be required if the itLpNaca.xLoadAreaChunks includes * the HPT size */ printk( "Mapping load area - physical addr = 0000000000000000\n" " absolute addr = %016lx\n", chunk_to_addr(loadAreaFirstChunk) ); printk( "Load area size %dK\n", loadAreaSize*256 ); for ( nextPhysChunk = 0; nextPhysChunk < loadAreaSize; ++nextPhysChunk ) { msChunks.abs[nextPhysChunk] = loadAreaFirstChunk+nextPhysChunk; } /* Get absolute address of our HPT and remember it so * we won't map it to any physical address */ hptFirstChunk = (u32)addr_to_chunk(HvCallHpt_getHptAddress()); hptSizePages = (u32)(HvCallHpt_getHptPages()); hptSizeChunks = hptSizePages >> (msChunks.chunk_shift-PAGE_SHIFT); hptLastChunk = hptFirstChunk + hptSizeChunks - 1; printk( "HPT absolute addr = %016lx, size = %dK\n", chunk_to_addr(hptFirstChunk), hptSizeChunks*256 ); /* Fill in the htab_data structure */ /* Fill in size of hashed page table */ num_ptegs = hptSizePages * (PAGE_SIZE/(sizeof(HPTE)*HPTES_PER_GROUP)); htab_data.htab_num_ptegs = num_ptegs; htab_data.htab_hash_mask = num_ptegs - 1; /* The actual hashed page table is in the hypervisor, we have no direct access */ htab_data.htab = NULL; /* Determine if absolute memory has any * holes so that we can interpret the * access map we get back from the hypervisor * correctly. */ numMemoryBlocks = iSeries_process_mainstore_vpd( mb, 32 ); /* Process the main store access map from the hypervisor * to build up our physical -> absolute translation table */ curBlock = 0; currChunk = 0; currDword = 0; moreChunks = totalChunks; while ( moreChunks ) { map = HvCallSm_get64BitsOfAccessMap( itLpNaca.xLpIndex, currDword ); thisChunk = currChunk; while ( map ) { chunkBit = map >> 63; map <<= 1; if ( chunkBit ) { --moreChunks; while ( thisChunk >= mb[curBlock].logicalEnd ) { ++curBlock; if ( curBlock >= numMemoryBlocks ) panic("out of memory blocks"); } if ( thisChunk < mb[curBlock].logicalStart ) panic("memory block error"); absChunk = mb[curBlock].absStart + ( thisChunk - mb[curBlock].logicalStart ); if ( ( ( absChunk < hptFirstChunk ) || ( absChunk > hptLastChunk ) ) && ( ( absChunk < loadAreaFirstChunk ) || ( absChunk > loadAreaLastChunk ) ) ) { msChunks.abs[nextPhysChunk] = absChunk; ++nextPhysChunk; } } ++thisChunk; } ++currDword; currChunk += 64; } /* main store size (in chunks) is * totalChunks - hptSizeChunks * which should be equal to * nextPhysChunk */ naca->physicalMemorySize = chunk_to_addr(nextPhysChunk); /* Bolt kernel mappings for all of memory */ iSeries_bolt_kernel( 0, naca->physicalMemorySize ); lmb_init(); lmb_add( 0, naca->physicalMemorySize ); lmb_reserve( 0, __pa(klimit)); /* * Hardcode to GP size. I am not sure where to get this info. DRENG */ naca->slb_size = 64; } /* * Set up the variables that describe the cache line sizes * for this machine. */ static void __init setup_iSeries_cache_sizes(void) { unsigned i,n; naca->iCacheL1LineSize = xIoHriProcessorVpd[0].xInstCacheOperandSize; naca->dCacheL1LineSize = xIoHriProcessorVpd[0].xDataCacheOperandSize; naca->iCacheL1LinesPerPage = PAGE_SIZE / naca->iCacheL1LineSize; naca->dCacheL1LinesPerPage = PAGE_SIZE / naca->dCacheL1LineSize; i = naca->iCacheL1LineSize; n = 0; while ((i=(i/2))) ++n; naca->iCacheL1LogLineSize = n; i = naca->dCacheL1LineSize; n = 0; while ((i=(i/2))) ++n; naca->dCacheL1LogLineSize = n; printk( "D-cache line size = %d (log = %d)\n", (unsigned)naca->dCacheL1LineSize, (unsigned)naca->dCacheL1LogLineSize ); printk( "I-cache line size = %d (log = %d)\n", (unsigned)naca->iCacheL1LineSize, (unsigned)naca->iCacheL1LogLineSize ); } /* * Bolt the kernel addr space into the HPT */ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr) { unsigned long pa; unsigned long mode_rw = _PAGE_ACCESSED | _PAGE_COHERENT | PP_RWXX; HPTE hpte; for (pa=saddr; pa < eaddr ;pa+=PAGE_SIZE) { unsigned long ea = (unsigned long)__va(pa); unsigned long vsid = get_kernel_vsid( ea ); unsigned long va = ( vsid << 28 ) | ( pa & 0xfffffff ); unsigned long vpn = va >> PAGE_SHIFT; unsigned long slot = HvCallHpt_findValid( &hpte, vpn ); if ( hpte.dw0.dw0.v ) { /* HPTE exists, so just bolt it */ HvCallHpt_setSwBits( slot, 0x10, 0 ); } else { /* No HPTE exists, so create a new bolted one */ build_valid_hpte(vsid, ea, pa, NULL, mode_rw, 1); } } } #endif /* CONFIG_PPC_ISERIES */ /* * Document me. */ void __init iSeries_setup_arch(void) { void * eventStack; /* Setup the Lp Event Queue */ /* Allocate a page for the Event Stack * The hypervisor wants the absolute real address, so * we subtract out the KERNELBASE and add in the * absolute real address of the kernel load area */ eventStack = alloc_bootmem_pages( LpEventStackSize ); memset( eventStack, 0, LpEventStackSize ); /* Invoke the hypervisor to initialize the event stack */ HvCallEvent_setLpEventStack( 0, eventStack, LpEventStackSize ); /* Initialize fields in our Lp Event Queue */ xItLpQueue.xSlicEventStackPtr = (char *)eventStack; xItLpQueue.xSlicCurEventPtr = (char *)eventStack; xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack + (LpEventStackSize - LpEventMaxSize); xItLpQueue.xIndex = 0; /* Compute processor frequency */ procFreqHz = (((1UL<<34) * 1000000) / xIoHriProcessorVpd[0].xProcFreq ); procFreqMhz = procFreqHz / 1000000; procFreqMhzHundreths = (procFreqHz/10000) - (procFreqMhz*100); /* Compute time base frequency */ tbFreqHz = (((1UL<<32) * 1000000) / xIoHriProcessorVpd[0].xTimeBaseFreq ); tbFreqMhz = tbFreqHz / 1000000; tbFreqMhzHundreths = (tbFreqHz/10000) - (tbFreqMhz*100); printk("Max logical processors = %d\n", itVpdAreas.xSlicMaxLogicalProcs ); printk("Max physical processors = %d\n", itVpdAreas.xSlicMaxPhysicalProcs ); printk("Processor frequency = %lu.%02lu\n", procFreqMhz, procFreqMhzHundreths ); printk("Time base frequency = %lu.%02lu\n", tbFreqMhz, tbFreqMhzHundreths ); printk("Processor version = %x\n", xIoHriProcessorVpd[0].xPVR ); } /* * int iSeries_setup_residual() * * Description: * This routine pretty-prints CPU information gathered from the VPD * for use in /proc/cpuinfo * * Input(s): * *buffer - Buffer into which CPU data is to be printed. * * Output(s): * *buffer - Buffer with CPU data. * * Returns: * 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) { 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"); } /* * Document me. * and Implement me. */ int iSeries_get_irq(struct pt_regs *regs) { /* -2 means ignore this interrupt */ return -2; } /* * Document me. */ void iSeries_restart(char *cmd) { mf_reboot(); } /* * Document me. */ void iSeries_power_off(void) { mf_powerOff(); } /* * Document me. */ void iSeries_halt(void) { mf_powerOff(); } /* * Nothing to do here. */ void __init iSeries_time_init(void) { /* Nothing to do */ } /* JDH Hack */ unsigned long jdh_time = 0; extern void setup_default_decr(void); /* * void __init iSeries_calibrate_decr() * * Description: * This routine retrieves the internal processor frequency from the VPD, * and sets up the kernel timer decrementer based on that value. * */ 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 */ /* 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_sec = freq; would give better accuracy * but tb_ticks_per_sec = tb_ticks_per_jiffy*HZ; assures * that jiffies (and xtime) will match the time returned * by do_gettimeofday. */ tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; tb_ticks_per_usec = cyclesPerUsec; tb_to_us = mulhwu_scale_factor(freq, 1000000); div128_by_32( 1024*1024, 0, tb_ticks_per_sec, &divres ); tb_to_xs = divres.result_low; setup_default_decr(); } void __init iSeries_progress( char * st, unsigned short code ) { printk( "Progress: [%04x] - %s\n", (unsigned)code, st ); if ( !piranha_simulator && mf_initialized ) { if (code != 0xffff) mf_displayProgress( code ); else mf_clearSrc(); } } void iSeries_fixup_klimit(void) { /* Change klimit to take into account any ram disk that may be included */ if (naca->xRamDisk) klimit = KERNELBASE + (u64)naca->xRamDisk + (naca->xRamDiskSize * PAGE_SIZE); else { /* No ram disk was included - check and see if there was an embedded system map */ /* Change klimit to take into account any embedded system map */ if (embedded_sysmap_end) klimit = KERNELBASE + ((embedded_sysmap_end+4095) & 0xfffffffffffff000); } } static void iSeries_setup_dprofile(void) { if ( dprof_buffer ) { unsigned i; for (i=0; i<maxPacas; ++i) { xPaca[i].prof_shift = dprof_shift; xPaca[i].prof_len = dprof_len-1; xPaca[i].prof_buffer = dprof_buffer; xPaca[i].prof_stext = (unsigned *)&_stext; mb(); xPaca[i].prof_enabled = 1; } } } --- NEW FILE: ioctl32.c --- /* * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Based on sparc64 ioctl32.c by: * * Copyright (C) 1997-2000 Jakub Jelinek (ja...@re...) * Copyright (C) 1998 Eddie C. Dost (ec...@sk...) * * ppc64 changes: * * Copyright (C) 2000 Ken Aaker (kd...@rc...) * Copyright (C) 2001 Anton Blanchard (an...@au...) * * These routines maintain argument size conversion between 32bit and 64bit * ioctls. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version [...4532 lines suppressed...] while (t && t->cmd != cmd) t = (struct ioctl_trans *)t->next; if (t) { handler = (void *)t->handler; error = handler(fd, cmd, arg, filp); } else { static int count = 0; if (++count <= 20) printk("sys32_ioctl(%s:%d): Unknown cmd fd(%d) " "cmd(%08x) arg(%08x)\n", current->comm, current->pid, (int)fd, (unsigned int)cmd, (unsigned int)arg); error = -EINVAL; } out: fput(filp); out2: return error; } --- NEW FILE: open_pic.c --- /* * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling * * Copyright (C) 1997 Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details. */ #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/init.h> #include <linux/irq.h> #include <asm/ptrace.h> #include <asm/signal.h> #include <asm/io.h> #include <asm/pgtable.h> #include <asm/irq.h> #include <asm/prom.h> #include <asm/machdep.h> #include "local_irq.h" #include "open_pic.h" #include "open_pic_defs.h" #include "i8259.h" #include <asm/ppcdebug.h> void* OpenPIC_Addr; static volatile struct OpenPIC *OpenPIC = NULL; u_int OpenPIC_NumInitSenses __initdata = 0; u_char *OpenPIC_InitSenses __initdata = NULL; extern int use_of_interrupt_tree; void find_ISUs(void); static u_int NumProcessors; static u_int NumSources; static int NumISUs; static int open_pic_irq_offset; static volatile unsigned char* chrp_int_ack_special; static int broken_ipi_registers; OpenPIC_SourcePtr ISU[OPENPIC_MAX_ISU]; static void openpic_end_irq(unsigned int irq_nr); static void openpic_ack_irq(unsigned int irq_nr); static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask); struct hw_interrupt_type open_pic = { " OpenPIC ", NULL, NULL, openpic_enable_irq, openpic_disable_irq, openpic_ack_irq, openpic_end_irq, openpic_set_affinity }; #ifdef CONFIG_SMP static void openpic_end_ipi(unsigned int irq_nr); static void openpic_ack_ipi(unsigned int irq_nr); static void openpic_enable_ipi(unsigned int irq_nr); static void openpic_disable_ipi(unsigned int irq_nr); struct hw_interrupt_type open_pic_ipi = { " OpenPIC ", NULL, NULL, openpic_enable_ipi, openpic_disable_ipi, openpic_ack_ipi, openpic_end_ipi, 0 }; #endif /* CONFIG_SMP */ unsigned int openpic_vec_ipi; unsigned int openpic_vec_timer; unsigned int openpic_vec_spurious; /* * Accesses to the current processor's openpic registers */ #ifdef CONFIG_SMP #define THIS_CPU Processor[cpu] #define DECL_THIS_CPU int cpu = hard_smp_processor_id() #define CHECK_THIS_CPU check_arg_cpu(cpu) #else #define THIS_CPU Processor[hard_smp_processor_id()] #define DECL_THIS_CPU #define CHECK_THIS_CPU #endif /* CONFIG_SMP */ #if 0 #define check_arg_ipi(ipi) \ if (ipi < 0 || ipi >= OPENPIC_NUM_IPI) \ printk(KERN_ERR "open_pic.c:%d: illegal ipi %d\n", __LINE__, ipi); #define check_arg_timer(timer) \ if (timer < 0 || timer >= OPENPIC_NUM_TIMERS) \ printk(KERN_ERR "open_pic.c:%d: illegal timer %d\n", __LINE__, timer); #define check_arg_vec(vec) \ if (vec < 0 || vec >= OPENPIC_NUM_VECTORS) \ printk(KERN_ERR "open_pic.c:%d: illegal vector %d\n", __LINE__, vec); #define check_arg_pri(pri) \ if (pri < 0 || pri >= OPENPIC_NUM_PRI) \ printk(KERN_ERR "open_pic.c:%d: illegal priority %d\n", __LINE__, pri); /* * Print out a backtrace if it's out of range, since if it's larger than NR_IRQ's * data has probably been corrupted and we're going to panic or deadlock later * anyway --Troy */ extern unsigned long* _get_SP(void); #define check_arg_irq(irq) \ if (irq < open_pic_irq_offset || irq >= (NumSources+open_pic_irq_offset)){ \ printk(KERN_ERR "open_pic.c:%d: illegal irq %d\n", __LINE__, irq); \ print_backtrace(_get_SP()); } #define check_arg_cpu(cpu) \ if (cpu < 0 || cpu >= OPENPIC_MAX_PROCESSORS){ \ printk(KERN_ERR "open_pic.c:%d: illegal cpu %d\n", __LINE__, cpu); \ print_backtrace(_get_SP()); } #else #define check_arg_ipi(ipi) do {} while (0) #define check_arg_timer(timer) do {} while (0) #define check_arg_vec(vec) do {} while (0) #define check_arg_pri(pri) do {} while (0) #define check_arg_irq(irq) do {} while (0) #define check_arg_cpu(cpu) do {} while (0) #endif #define GET_ISU(source) ISU[(source) >> 4][(source) & 0xf] void __init openpic_init_IRQ(void) { struct device_node *np; int i; unsigned int *addrp; unsigned char* chrp_int_ack_special = 0; unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS]; int nmi_irq = -1; if (!(np = find_devices("pci")) || !(addrp = (unsigned int *) get_property(np, "8259-interrupt-acknowledge", NULL))) printk(KERN_ERR "Cannot find pci to get ack address\n"); else chrp_int_ack_special = (unsigned char *) __ioremap(addrp[prom_n_addr_cells(np)-1], 1, _PAGE_NO_CACHE); /* hydra still sets OpenPIC_InitSenses to a static set of values */ if (OpenPIC_InitSenses == NULL) { prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS); OpenPIC_InitSenses = init_senses; OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS; } openpic_init(1, NUM_8259_INTERRUPTS, chrp_int_ack_special, nmi_irq); for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ ) irq_desc[i].handler = &i8259_pic; i8259_init(); } static inline u_int openpic_read(volatile u_int *addr) { u_int val; val = in_le32(addr); return val; } static inline void openpic_write(volatile u_int *addr, u_int val) { out_le32(addr, val); } static inline u_int openpic_readfield(volatile u_int *addr, u_int mask) { u_int val = openpic_read(addr); return val & mask; } static inline void openpic_writefield(volatile u_int *addr, u_int mask, u_int field) { u_int val = openpic_read(addr); openpic_write(addr, (val & ~mask) | (field & mask)); } static inline void openpic_clearfield(volatile u_int *addr, u_int mask) { openpic_writefield(addr, mask, 0); } static inline void openpic_setfield(volatile u_int *addr, u_int mask) { openpic_writefield(addr, mask, mask); } static void openpic_safe_writefield(volatile u_int *addr, u_int mask, u_int field) { unsigned int loops = 100000; openpic_setfield(addr, OPENPIC_MASK); while (openpic_read(addr) & OPENPIC_ACTIVITY) { if (!loops--) { printk(KERN_ERR "openpic_safe_writefield timeout\n"); break; } } openpic_writefield(addr, mask | OPENPIC_MASK, field | OPENPIC_MASK); } #ifdef CONFIG_SMP static u_int openpic_read_IPI(volatile u_int* addr) { u_int val = 0; if (broken_ipi_registers) /* yes this is right ... bug, feature, you decide! -- tgall */ val = in_be32(addr); else val = in_le32(addr); return val; } static void openpic_test_broken_IPI(void) { u_int t; openpic_write(&OpenPIC->Global.IPI_Vector_Priority(0), OPENPIC_MASK); t = openpic_read(&OpenPIC->Global.IPI_Vector_Priority(0)); if (t == le32_to_cpu(OPENPIC_MASK)) { printk(KERN_INFO "OpenPIC reversed IPI registers detected\n"); broken_ipi_registers = 1; } } /* because of the power3 be / le above, this is needed */ static inline void openpic_writefield_IPI(volatile u_int* addr, u_int mask, u_int field) { u_int val = openpic_read_IPI(addr); openpic_write(addr, (val & ~mask) | (field & mask)); } static inline void openpic_clearfield_IPI(volatile u_int *addr, u_int mask) { openpic_writefield_IPI(addr, mask, 0); } static inline void openpic_setfield_IPI(volatile u_int *addr, u_int mask) { openpic_writefield_IPI(addr, mask, mask); } static void openpic_safe_writefield_IPI(volatile u_int *addr, u_int mask, u_int field) { unsigned int loops = 100000; openpic_setfield_IPI(addr, OPENPIC_MASK); /* wait until it's not in use */ /* BenH: Is this code really enough ? I would rather check the result * and eventually retry ... */ while(openpic_read_IPI(addr) & OPENPIC_ACTIVITY) { if (!loops--) { printk(KERN_ERR "openpic_safe_writefield timeout\n"); break; } } openpic_writefield_IPI(addr, mask, field | OPENPIC_MASK); } #endif /* CONFIG_SMP */ void __init openpic_init(int main_pic, int offset, unsigned char* chrp_ack, int programmer_switch_irq) { u_int t, i; u_int timerfreq; const char *version; if (!OpenPIC_Addr) { printk(KERN_INFO "No OpenPIC found !\n"); return; } OpenPIC = (volatile struct OpenPIC *)OpenPIC_Addr; ppc_md.progress("openpic enter",0x122); t = openpic_read(&OpenPIC->Global.Feature_Reporting0); switch (t & OPENPIC_FEATURE_VERSION_MASK) { case 1: version = "1.0"; break; case 2: version = "1.2"; break; case 3: version = "1.3"; break; default: version = "?"; break; } NumProcessors = ((t & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >> OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT) + 1; NumSources = ((t & OPENPIC_FEATURE_LAST_SOURCE_MASK) >> OPENPIC_FEATURE_LAST_SOURCE_SHIFT) + 1; printk(KERN_INFO "OpenPIC Version %s (%d CPUs and %d IRQ sources) at %p\n", version, NumProcessors, NumSources, OpenPIC); timerfreq = openpic_read(&OpenPIC->Global.Timer_Frequency); if (timerfreq) printk(KERN_INFO "OpenPIC timer frequency is %d.%06d MHz\n", timerfreq / 1000000, timerfreq % 1000000); if (!main_pic) return; open_pic_irq_offset = offset; chrp_int_ack_special = (volatile unsigned char*)chrp_ack; find_ISUs(); /* Initialize timer interrupts */ ppc_md.progress("openpic timer",0x3ba); for (i = 0; i < OPENPIC_NUM_TIMERS; i++) { /* Disabled, Priority 0 */ openpic_inittimer(i, 0, openpic_vec_timer+i); /* No processor */ openpic_maptimer(i, 0); } #ifdef CONFIG_SMP /* Initialize IPI interrupts */ ppc_md.progress("openpic ipi",0x3bb); openpic_test_broken_IPI(); for (i = 0; i < OPENPIC_NUM_IPI; i++) { /* Disabled, Priority 10..13 */ openpic_initipi(i, 10+i, openpic_vec_ipi+i); /* IPIs are per-CPU */ irq_desc[openpic_vec_ipi+i].status |= IRQ_PER_CPU; irq_desc[openpic_vec_ipi+i].handler = &open_pic_ipi; } #endif /* Initialize external interrupts */ ppc_md.progress("openpic ext",0x3bc); openpic_set_priority(0xf); /* SIOint (8259 cascade) is special */ if (offset) { openpic_initirq(0, 8, offset, 1, 1); openpic_mapirq(0, 1<<get_hard_smp_processor_id(0)); } /* Init all external sources */ for (i = 1; i < NumSources; i++) { int pri, sense; /* the bootloader may have left it enabled (bad !) */ openpic_disable_irq(i+offset); pri = (i == programmer_switch_irq)? 9: 8; sense = (i < OpenPIC_NumInitSenses)? OpenPIC_InitSenses[i]: 1; if (sense) irq_desc[i+offset].status = IRQ_LEVEL; /* Enabled, Priority 8 or 9 */ openpic_initirq(i, pri, i+offset, !sense, sense); /* Processor 0 */ openpic_mapirq(i, 1<<get_hard_smp_processor_id(0)); } /* Init descriptors */ for (i = offset; i < NumSources + offset; i++) irq_desc[i].handler = &open_pic; /* Initialize the spurious interrupt */ ppc_md.progress("openpic spurious",0x3bd); openpic_set_spurious(openpic_vec_spurious); /* Initialize the cascade */ if (offset) { if (request_irq(offset, no_action, SA_INTERRUPT, "82c59 cascade", NULL)) printk(KERN_ERR "Unable to get OpenPIC IRQ 0 for cascade\n"); } openpic_set_priority(0); openpic_disable_8259_pass_through(); ppc_md.progress("openpic exit",0x222); } void openpic_setup_ISU(int isu_num, unsigned long addr) { if (isu_num >= OPENPIC_MAX_ISU) return; ISU[isu_num] = (OpenPIC_SourcePtr) __ioremap(addr, 0x400, _PAGE_NO_CACHE); if (isu_num >= NumISUs) NumISUs = isu_num + 1; } void find_ISUs(void) { /* Use /interrupt-controller/reg and * /interrupt-controller/interrupt-ranges from OF device tree * the ISU array is setup in chrp_pci.c in ibm_add_bridges * as a result * -- tgall */ /* basically each ISU is a bus, and this assumes that * open_pic_isu_count interrupts per bus are possible * ISU == Interrupt Source */ NumSources = NumISUs * 0x10; openpic_vec_ipi = NumSources + open_pic_irq_offset; openpic_vec_timer = openpic_vec_ipi + OPENPIC_NUM_IPI; openpic_vec_spurious = openpic_vec_timer + OPENPIC_NUM_TIMERS; } static inline void openpic_reset(void) { openpic_setfield(&OpenPIC->Global.Global_Configuration0, OPENPIC_CONFIG_RESET); } static inline void openpic_enable_8259_pass_through(void) { openpic_clearfield(&OpenPIC->Global.Global_Configuration0, OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE); } static void openpic_disable_8259_pass_through(void) { openpic_setfield(&OpenPIC->Global.Global_Configuration0, OPENPIC_CONFIG_8259_PASSTHROUGH_DISABLE); } /* * Find out the current interrupt */ static u_int openpic_irq(void) { u_int vec; DECL_THIS_CPU; CHECK_THIS_CPU; vec = openpic_readfield(&OpenPIC->THIS_CPU.Interrupt_Acknowledge, OPENPIC_VECTOR_MASK); return vec; } static void openpic_eoi(void) { DECL_THIS_CPU; CHECK_THIS_CPU; openpic_write(&OpenPIC->THIS_CPU.EOI, 0); /* Handle PCI write posting */ (void)openpic_read(&OpenPIC->THIS_CPU.EOI); } static inline u_int openpic_get_priority(void) { DECL_THIS_CPU; CHECK_THIS_CPU; return openpic_readfield(&OpenPIC->THIS_CPU.Current_Task_Priority, OPENPIC_CURRENT_TASK_PRIORITY_MASK); } static void openpic_set_priority(u_int pri) { DECL_THIS_CPU; CHECK_THIS_CPU; check_arg_pri(pri); openpic_writefield(&OpenPIC->THIS_CPU.Current_Task_Priority, OPENPIC_CURRENT_TASK_PRIORITY_MASK, pri); } /* * Get/set the spurious vector */ static inline u_int openpic_get_spurious(void) { return openpic_readfield(&OpenPIC->Global.Spurious_Vector, OPENPIC_VECTOR_MASK); } static void openpic_set_spurious(u_int vec) { check_arg_vec(vec); openpic_writefield(&OpenPIC->Global.Spurious_Vector, OPENPIC_VECTOR_MASK, vec); } /* * Convert a cpu mask from logical to physical cpu numbers. */ static inline u32 physmask(u32 cpumask) { int i; u32 mask = 0; for (i = 0; i < smp_num_cpus; ++i, cpumask >>= 1) mask |= (cpumask & 1) << get_hard_smp_processor_id(i); return mask; } void openpic_init_processor(u_int cpumask) { openpic_write(&OpenPIC->Global.Processor_Initialization, physmask(cpumask)); } #ifdef CONFIG_SMP /* * Initialize an interprocessor interrupt (and disable it) * * ipi: OpenPIC interprocessor interrupt number * pri: interrupt source priority * vec: the vector it will produce */ static void __init openpic_initipi(u_int ipi, u_int pri, u_int vec) { check_arg_ipi(ipi); check_arg_pri(pri); check_arg_vec(vec); openpic_safe_writefield_IPI(&OpenPIC->Global.IPI_Vector_Priority(ipi), OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK, (pri << OPENPIC_PRIORITY_SHIFT) | vec); } /* * Send an IPI to one or more CPUs * * Externally called, however, it takes an IPI number (0...OPENPIC_NUM_IPI) * and not a system-wide interrupt number */ void openpic_cause_IPI(u_int ipi, u_int cpumask) { DECL_THIS_CPU; CHECK_THIS_CPU; check_arg_ipi(ipi); openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi), physmask(cpumask)); } void openpic_request_IPIs(void) { int i; /* * Make sure this matches what is defined in smp.c for * smp_message_{pass|recv}() or what shows up in * /proc/interrupts will be wrong!!! --Troy */ if (OpenPIC == NULL) return; request_irq(openpic_vec_ipi, openpic_ipi_action, 0, "IPI0 (call function)", 0); request_irq(openpic_vec_ipi+1, openpic_ipi_action, 0, "IPI1 (reschedule)", 0); request_irq(openpic_vec_ipi+2, openpic_ipi_action, 0, "IPI2 (invalidate tlb)", 0); request_irq(openpic_vec_ipi+3, openpic_ipi_action, 0, "IPI3 (xmon break)", 0); for ( i = 0; i < OPENPIC_NUM_IPI ; i++ ) openpic_enable_ipi(openpic_vec_ipi+i); } /* * Do per-cpu setup for SMP systems. * * Get IPI's working and start taking interrupts. * -- Cort */ static spinlock_t openpic_setup_lock __initdata = SPIN_LOCK_UNLOCKED; void __init do_openpic_setup_cpu(void) { #ifdef CONFIG_IRQ_ALL_CPUS int i; u32 msk = 1 << hard_smp_processor_id(); #endif spin_lock(&openpic_setup_lock); #ifdef CONFIG_IRQ_ALL_CPUS /* let the openpic know we want intrs. default affinity * is 0xffffffff until changed via /proc * That's how it's done on x86. If we want it differently, then * we should make sure we also change the default values of irq_affinity * in irq.c. */ for (i = 0; i < NumSources ; i++) openpic_mapirq(i, openpic_read(&GET_ISU(i).Destination) | msk); #endif /* CONFIG_IRQ_ALL_CPUS */ openpic_set_priority(0); spin_unlock(&openpic_setup_lock); } #endif /* CONFIG_SMP */ /* * Initialize a timer interrupt (and disable it) * * timer: OpenPIC timer number * pri: interrupt source priority * vec: the vector it will produce */ static void __init openpic_inittimer(u_int timer, u_int pri, u_int vec) { check_arg_timer(timer); check_arg_pri(pri); check_arg_vec(vec); openpic_safe_writefield(&OpenPIC->Global.Timer[timer].Vector_Priority, OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK, (pri << OPENPIC_PRIORITY_SHIFT) | vec); } /* * Map a timer interrupt to one or more CPUs */ static void __init openpic_maptimer(u_int timer, u_int cpumask) { check_arg_timer(timer); openpic_write(&OpenPIC->Global.Timer[timer].Destination, physmask(cpumask)); } /* * * All functions below take an offset'ed irq argument * */ /* * Enable/disable an external interrupt source * * Externally called, irq is an offseted system-wide interrupt number */ static void openpic_enable_irq(u_int irq) { unsigned int loops = 100000; check_arg_irq(irq); openpic_clearfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, OPENPIC_MASK); /* make sure mask gets to controller before we return to user */ do { if (!loops--) { printk(KERN_ERR "openpic_enable_irq timeout\n"); break; } mb(); /* sync is probably useless here */ } while(openpic_readfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, OPENPIC_MASK)); } static void openpic_disable_irq(u_int irq) { u32 vp; unsigned int loops = 100000; check_arg_irq(irq); openpic_setfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, OPENPIC_MASK); /* make sure mask gets to controller before we return to user */ do { if (!loops--) { printk(KERN_ERR "openpic_disable_irq timeout\n"); break; } mb(); /* sync is probably useless here */ vp = openpic_readfield(&GET_ISU(irq - open_pic_irq_offset).Vector_Priority, OPENPIC_MASK | OPENPIC_ACTIVITY); } while((vp & OPENPIC_ACTIVITY) && !(vp & OPENPIC_MASK)); } #ifdef CONFIG_SMP /* * Enable/disable an IPI interrupt source * * Externally called, irq is an offseted system-wide interrupt number */ void openpic_enable_ipi(u_int irq) { irq -= openpic_vec_ipi; check_arg_ipi(irq); openpic_clearfield_IPI(&OpenPIC->Global.IPI_Vector_Priority(irq), OPENPIC_MASK); } void openpic_disable_ipi(u_int irq) { /* NEVER disable an IPI... that's just plain wrong! */ } #endif /* * Initialize an interrupt source (and disable it!) * * irq: OpenPIC interrupt number * pri: interrupt source priority * vec: the vector it will produce * pol: polarity (1 for positive, 0 for negative) * sense: 1 for level, 0 for edge */ static void openpic_initirq(u_int irq, u_int pri, u_int vec, int pol, int sense) { openpic_safe_writefield(&GET_ISU(irq).Vector_Priority, OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK | OPENPIC_SENSE_MASK | OPENPIC_POLARITY_MASK, (pri << OPENPIC_PRIORITY_SHIFT) | vec | (pol ? OPENPIC_POLARITY_POSITIVE : OPENPIC_POLARITY_NEGATIVE) | (sense ? OPENPIC_SENSE_LEVEL : OPENPIC_SENSE_EDGE)); } /* * Map an interrupt source to one or more CPUs */ static void openpic_mapirq(u_int irq, u_int physmask) { openpic_write(&GET_ISU(irq).Destination, physmask); } /* * Set the sense for an interrupt source (and disable it!) * * sense: 1 for level, 0 for edge */ static inline void openpic_set_sense(u_int irq, int sense) { openpic_safe_writefield(&GET_ISU(irq).Vector_Priority, OPENPIC_SENSE_LEVEL, (sense ? OPENPIC_SENSE_LEVEL : 0)); } /* No spinlocks, should not be necessary with the OpenPIC * (1 register = 1 interrupt and we have the desc lock). */ static void openpic_ack_irq(unsigned int irq_nr) { } static void openpic_end_irq(unsigned int irq_nr) { if ((irq_desc[irq_nr].status & IRQ_LEVEL) != 0) openpic_eoi(); } static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask) { openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpumask)); } #ifdef CONFIG_SMP static void openpic_ack_ipi(unsigned int irq_nr) { } static void openpic_end_ipi(unsigned int irq_nr) { /* IPIs are marked IRQ_PER_CPU. This has the side effect of * preventing the IRQ_PENDING/IRQ_INPROGRESS logic from * applying to them. We EOI them late to avoid re-entering. * however, I'm wondering if we could simply let them have the * SA_INTERRUPT flag and let them execute with all interrupts OFF. * This would have the side effect of either running cross-CPU * functions with interrupts off, or we can re-enable them explicitely * with a __sti() in smp_call_function_interrupt(), since * smp_call_function() is protected by a spinlock. * Or maybe we shouldn't set the IRQ_PER_CPU flag on cross-CPU * function calls IPI at all but that would make a special case. */ openpic_eoi(); } static void openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *regs) { smp_message_recv(cpl-openpic_vec_ipi, regs); } #endif /* CONFIG_SMP */ int openpic_get_irq(struct pt_regs *regs) { extern int i8259_irq(int cpu); int irq = openpic_irq(); /* Management of the cascade should be moved out of here */ if (open_pic_irq_offset && irq == open_pic_irq_offset) { /* * This magic address generates a PCI IACK cycle. */ if ( chrp_int_ack_special ) irq = *chrp_int_ack_special; else irq = i8259_irq( smp_processor_id() ); openpic_eoi(); } if (irq == openpic_vec_spurious) irq = -1; return irq; } |
From: James S. <jsi...@us...> - 2002-03-15 18:28:16
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/sparc64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv4512/linux/arch/sparc64/kernel Added Files: ioctl32.c Log Message: Alots of fixes across many platforms. --- NEW FILE: ioctl32.c --- /* $Id: ioctl32.c,v 1.1 2002/03/15 18:28:12 jsimmons Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997-2000 Jakub Jelinek (ja...@re...) * Copyright (C) 1998 Eddie C. Dost (ec...@sk...) * * These routines maintain argument size conversion between 32bit and 64bit * ioctls. */ #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/ioctl.h> #include <linux/if.h> #include <linux/slab.h> [...4851 lines suppressed...] while (t && t->cmd != cmd) t = (struct ioctl_trans *)(long)t->next; if (t) { handler = (void *)(long)t->handler; error = handler(fd, cmd, arg, filp); } else { static int count = 0; if (++count <= 20) printk("sys32_ioctl(%s:%d): Unknown cmd fd(%d) " "cmd(%08x) arg(%08x)\n", current->comm, current->pid, (int)fd, (unsigned int)cmd, (unsigned int)arg); error = -EINVAL; } out: fput(filp); out2: return error; } |
From: James S. <jsi...@us...> - 2002-03-15 18:28:16
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/x86_64/ia32 In directory usw-pr-cvs1:/tmp/cvs-serv4512/linux/arch/x86_64/ia32 Added Files: ia32_ioctl.c Log Message: Alots of fixes across many platforms. --- NEW FILE: ia32_ioctl.c --- /* $Id: ia32_ioctl.c,v 1.1 2002/03/15 18:28:12 jsimmons Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997-2000 Jakub Jelinek (ja...@re...) * Copyright (C) 1998 Eddie C. Dost (ec...@sk...) * Copyright (C) 2001 Andi Kleen, SuSE Labs * * These routines maintain argument size conversion between 32bit and 64bit * ioctls. */ #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/ioctl.h> #include <linux/if.h> [...3810 lines suppressed...] while (t && t->cmd != cmd) t = (struct ioctl_trans *)(long)t->next; if (t) { handler = (void *)(long)t->handler; error = handler(fd, cmd, arg, filp); } else { static int count = 0; if (++count <= 50) printk("sys32_ioctl(%s:%d): Unknown cmd fd(%d) " "cmd(%08x) arg(%08x)\n", current->comm, current->pid, (int)fd, (unsigned int)cmd, (unsigned int)arg); error = -EINVAL; } out: fput(filp); out2: return error; } |