コード例 #1
0
void __init sh_mv_setup(void)
{
	/*
	 * Only overload the machvec if one hasn't been selected on
	 * the command line with sh_mv=
	 */
	if (!machvec_selected) {
		unsigned long machvec_size;

		machvec_size = ((unsigned long)&__machvec_end -
				(unsigned long)&__machvec_start);

		/*
		 * Sanity check for machvec section alignment. Ensure
		 * __initmv hasn't been misused.
		 */
		if (machvec_size % sizeof(struct sh_machine_vector))
			panic("machvec misaligned, invalid __initmv use?");

		/*
		 * If the machvec hasn't been preselected, use the first
		 * vector (usually the only one) from .machvec.init.
		 */
		if (machvec_size >= sizeof(struct sh_machine_vector))
			sh_mv = *(struct sh_machine_vector *)&__machvec_start;
	}

	printk(KERN_NOTICE "Booting machvec: %s\n", get_system_type());

	/*
	 * Manually walk the vec, fill in anything that the board hasn't yet
	 * by hand, wrapping to the generic implementation.
	 */
#define mv_set(elem) do { \
	if (!sh_mv.mv_##elem) \
		sh_mv.mv_##elem = generic_##elem; \
} while (0)

	mv_set(inb);	mv_set(inw);	mv_set(inl);
	mv_set(outb);	mv_set(outw);	mv_set(outl);

	mv_set(inb_p);	mv_set(inw_p);	mv_set(inl_p);
	mv_set(outb_p);	mv_set(outw_p);	mv_set(outl_p);

	mv_set(insb);	mv_set(insw);	mv_set(insl);
	mv_set(outsb);	mv_set(outsw);	mv_set(outsl);

	mv_set(ioport_map);
	mv_set(ioport_unmap);
	mv_set(irq_demux);

	if (!sh_mv.mv_nr_irqs)
		sh_mv.mv_nr_irqs = NR_IRQS;
}
コード例 #2
0
ファイル: proc.c プロジェクト: robacklin/nxc2620
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned long n = (unsigned long) v - 1;
	unsigned int version = cpu_data[n].processor_id;
	unsigned int fp_vers = cpu_data[n].fpu_id;
	char fmt [64];

#ifdef CONFIG_SMP
	if (!cpu_isset(n, cpu_online_map))
		return 0;
#endif

	/*
	 * For the first processor also print the system type
	 */
	if (n == 0)
		seq_printf(m, "system type\t\t: %s\n", get_system_type());

	seq_printf(m, "processor\t\t: %ld\n", n);
	sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
	        cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
	seq_printf(m, fmt, cpu_name[cpu_data[n].cputype <= CPU_LAST ?
	                            cpu_data[n].cputype : CPU_UNKNOWN],
	                           (version >> 4) & 0x0f, version & 0x0f,
	                           (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
	seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
	              cpu_data[n].udelay_val / (500000/HZ),
	              (cpu_data[n].udelay_val / (5000/HZ)) % 100);
	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
	seq_printf(m, "microsecond timers\t: %s\n",
	              cpu_has_counter ? "yes" : "no");
	seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
	seq_printf(m, "extra interrupt vector\t: %s\n",
	              cpu_has_divec ? "yes" : "no");
	seq_printf(m, "hardware watchpoint\t: %s\n",
	              cpu_has_watch ? "yes" : "no");
	seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
		      cpu_has_mips16 ? " mips16" : "",
		      cpu_has_mdmx ? " mdmx" : "",
		      cpu_has_mips3d ? " mips3d" : "",
		      cpu_has_smartmips ? " smartmips" : "",
		      cpu_has_dsp ? " dsp" : "",
		      cpu_has_mipsmt ? " mt" : ""
		);

	sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
	        cpu_has_vce ? "%u" : "not available");
	seq_printf(m, fmt, 'D', vced_count);
	seq_printf(m, fmt, 'I', vcei_count);
	seq_printf(m, "\n");

	return 0;
}
コード例 #3
0
ファイル: setup.c プロジェクト: acassis/emlinux-ssd1935
static void __init microdev_setup(char **cmdline_p)
{
    int * const fpgaRevisionRegister = (int*)(MICRODEV_FPGA_GP_BASE + 0x8ul);
    const int fpgaRevision = *fpgaRevisionRegister;
    int * const CacheControlRegister = (int*)CCR;

    device_initcall(microdev_devices_setup);
    device_initcall(smsc_superio_setup);

    printk("SuperH %s board (FPGA rev: 0x%0x, CCR: 0x%0x)\n",
           get_system_type(), fpgaRevision, *CacheControlRegister);
}
コード例 #4
0
static void
ide_local_device_init (IdeLocalDevice *self)
{
  IdeLocalDevicePrivate *priv = ide_local_device_get_instance_private (self);

  priv->system_type = get_system_type ();
  priv->config = g_key_file_new ();

  g_key_file_set_string (priv->config, "autoconf", "--host", priv->system_type);

  ide_device_set_display_name (IDE_DEVICE (self), g_get_host_name ());
  ide_device_set_id (IDE_DEVICE (self), "local");
}
コード例 #5
0
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned int version = mips_cpu.processor_id;
	unsigned int fp_vers = mips_cpu.fpu_id;
	unsigned long n = (unsigned long) v - 1;
	char fmt [64];

#ifdef CONFIG_SMP
	if (!CPUMASK_TSTB(cpu_online_map, n))
		return 0;
#endif

	/*
	 * For the first processor also print the system type
	 */
	if (n == 0)
		seq_printf(m, "system type\t\t: %s\n", get_system_type());

	seq_printf(m, "processor\t\t: %ld\n", n);
	sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
	        (mips_cpu.options & MIPS_CPU_FPU) ? "  FPU V%d.%d" : "");
	seq_printf(m, fmt, cpu_name[mips_cpu.cputype <= CPU_LAST ?
	                            mips_cpu.cputype : CPU_UNKNOWN],
	                           (version >> 4) & 0x0f, version & 0x0f,
	                           (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
	seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
	              loops_per_jiffy / (500000/HZ),
	              (loops_per_jiffy / (5000/HZ)) % 100);
	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
	seq_printf(m, "microsecond timers\t: %s\n",
	              (mips_cpu.options & MIPS_CPU_COUNTER) ? "yes" : "no");
	seq_printf(m, "tlb_entries\t\t: %d\n", mips_cpu.tlbsize);
	seq_printf(m, "extra interrupt vector\t: %s\n",
	              (mips_cpu.options & MIPS_CPU_DIVEC) ? "yes" : "no");
	seq_printf(m, "hardware watchpoint\t: %s\n",
	              watch_available ? "yes" : "no");

	sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
	        (mips_cpu.options & MIPS_CPU_VCE) ? "%d" : "not available");
	seq_printf(m, fmt, 'D', vced_count);
	seq_printf(m, fmt, 'I', vcei_count);

#ifndef CONFIG_CPU_HAS_LLSC
	seq_printf(m, "ll emulations\t\t: %lu\n", ll_ops);
	seq_printf(m, "sc emulations\t\t: %lu\n", sc_ops);
#endif

	return 0;
}
コード例 #6
0
ファイル: prom.c プロジェクト: vigsterkr/openwrt-beagleboard
void __init prom_init(void)
{
    	serial_init();

    	printk("%s prom init\n", get_system_type() );

    	PERF->IrqMask = 0;
	
	/* Detect the bootloader */
	detect_bootloader();

	/* Register 16MB RAM minus the ADSL SDRAM by default */
	add_memory_region(0, (0x01000000 - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM);

}
コード例 #7
0
static int show_cpuinfo(struct seq_file *m, void *v)
{
	struct sh_cpuinfo *c = v;
	unsigned int cpu = c - cpu_data;

	if (!cpu_online(cpu))
		return 0;

	if (cpu == 0)
		seq_printf(m, "machine\t\t: %s\n", get_system_type());
	else
		seq_printf(m, "\n");

	seq_printf(m, "processor\t: %d\n", cpu);
	seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine);
	seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype(c));
	if (c->cut_major == -1)
		seq_printf(m, "cut\t\t: unknown\n");
	else if (c->cut_minor == -1)
		seq_printf(m, "cut\t\t: %d.x\n", c->cut_major);
	else
		seq_printf(m, "cut\t\t: %d.%d\n", c->cut_major, c->cut_minor);

	show_cpuflags(m, c);

	seq_printf(m, "cache type\t: ");

	if (c->icache.flags & SH_CACHE_COMBINED) {
		seq_printf(m, "unified\n");
		show_cacheinfo(m, "cache", c->icache);
	} else {
		seq_printf(m, "split (harvard)\n");
		show_cacheinfo(m, "icache", c->icache);
		show_cacheinfo(m, "dcache", c->dcache);
	}

	
	if (c->flags & CPU_HAS_L2_CACHE)
		show_cacheinfo(m, "scache", c->scache);

	seq_printf(m, "address sizes\t: %u bits physical\n", c->phys_bits);

	seq_printf(m, "bogomips\t: %lu.%02lu\n",
		     c->loops_per_jiffy/(500000/HZ),
		     (c->loops_per_jiffy/(5000/HZ)) % 100);

	return 0;
}
コード例 #8
0
ファイル: proc.c プロジェクト: GodFox/magx_kernel_xpixl
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned int version = current_cpu_data.processor_id;
	unsigned int fp_vers = current_cpu_data.fpu_id;
	unsigned long n = (unsigned long) v - 1;
	char fmt [64];

#ifdef CONFIG_SMP
	if (!cpu_isset(n, cpu_online_map))
		return 0;
#endif

	/*
	 * For the first processor also print the system type
	 */
	if (n == 0)
		seq_printf(m, "system type\t\t: %s\n", get_system_type());

	seq_printf(m, "processor\t\t: %ld\n", n);
	sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
	        cpu_has_fpu ? "  FPU V%d.%d" : "");
	seq_printf(m, fmt, cpu_name[current_cpu_data.cputype <= CPU_LAST ?
	                            current_cpu_data.cputype : CPU_UNKNOWN],
	                           (version >> 4) & 0x0f, version & 0x0f,
	                           (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
	seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
	              loops_per_jiffy / (500000/HZ),
	              (loops_per_jiffy / (5000/HZ)) % 100);
	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
	seq_printf(m, "microsecond timers\t: %s\n",
	              cpu_has_counter ? "yes" : "no");
	seq_printf(m, "tlb_entries\t\t: %d\n", current_cpu_data.tlbsize);
	seq_printf(m, "extra interrupt vector\t: %s\n",
	              cpu_has_divec ? "yes" : "no");
	seq_printf(m, "hardware watchpoint\t: %s\n",
	              cpu_has_watch ? "yes" : "no");

	sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
	        cpu_has_vce ? "%u" : "not available");
	seq_printf(m, fmt, 'D', vced_count);
	seq_printf(m, fmt, 'I', vcei_count);

#if defined(CONFIG_CPU_TIMER)
	seq_printf(m, "missed timers\t\t: %d\n", missed_timer_count);
#endif

	return 0;
}
コード例 #9
0
ファイル: lowlevel.c プロジェクト: woodsts/barebox
ENTRY_FUNCTION(start_zii_vf610_dev, r0, r1, r2)
{
	void *fdt;
	const unsigned int system_type = get_system_type();

	vf610_cpu_lowlevel_init();

	if (IS_ENABLED(CONFIG_DEBUG_LL))
		setup_uart();

	switch (system_type) {
	default:
		if (IS_ENABLED(CONFIG_DEBUG_LL)) {
			relocate_to_current_adr();
			setup_c();
			puts_ll("\n*********************************\n");
			puts_ll("* Unknown system type: ");
			puthex_ll(system_type);
			puts_ll("\n* Assuming devboard revision B\n");
			puts_ll("*********************************\n");
		}
	case ZII_PLATFORM_VF610_DEV_REV_B: /* FALLTHROUGH */
		fdt = __dtb_vf610_zii_dev_rev_b_start;
		break;
	case ZII_PLATFORM_VF610_SCU4_AIB:
		fdt = __dtb_vf610_zii_scu4_aib_start;
		break;
	case ZII_PLATFORM_VF610_DEV_REV_C:
		fdt = __dtb_vf610_zii_dev_rev_c_start;
		break;
	case ZII_PLATFORM_VF610_CFU1:
		fdt = __dtb_vf610_zii_cfu1_start;
		break;
	case ZII_PLATFORM_VF610_SSMB_SPU3:
		fdt = __dtb_vf610_zii_ssmb_spu3_start;
		break;
	case ZII_PLATFORM_VF610_SPB4:
		fdt = __dtb_vf610_zii_spb4_start;
		break;
	case ZII_PLATFORM_VF610_SSMB_DTU:
		fdt = __dtb_vf610_zii_ssmb_dtu_start;
		break;
	}

	vf610_barebox_entry(fdt + get_runtime_offset());
}
コード例 #10
0
/*
 *	Get CPU information for use by the procfs.
 */
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned int cpu = smp_processor_id();

	if (!cpu && cpu_online(cpu))
		seq_printf(m, "machine\t\t: %s\n", get_system_type());

	seq_printf(m, "processor\t: %d\n", cpu);
	seq_printf(m, "cpu family\t: %s\n", system_utsname.machine);
	seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype());

	show_cpuflags(m);

	seq_printf(m, "cache type\t: ");

	/*
	 * Check for what type of cache we have, we support both the
	 * unified cache on the SH-2 and SH-3, as well as the harvard
	 * style cache on the SH-4.
	 */
	if (test_bit(SH_CACHE_COMBINED, &(boot_cpu_data.icache.flags))) {
		seq_printf(m, "unified\n");
		show_cacheinfo(m, "cache", boot_cpu_data.icache);
	} else {
		seq_printf(m, "split (harvard)\n");
		show_cacheinfo(m, "icache", boot_cpu_data.icache);
		show_cacheinfo(m, "dcache", boot_cpu_data.dcache);
	}

	seq_printf(m, "bogomips\t: %lu.%02lu\n",
		     boot_cpu_data.loops_per_jiffy/(500000/HZ),
		     (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100);

#define PRINT_CLOCK(name, value) \
	seq_printf(m, name " clock\t: %d.%02dMHz\n", \
		     ((value) / 1000000), ((value) % 1000000)/10000)
	
	PRINT_CLOCK("cpu", boot_cpu_data.cpu_clock);
	PRINT_CLOCK("bus", boot_cpu_data.bus_clock);
#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
	PRINT_CLOCK("memory", boot_cpu_data.memory_clock);
#endif
	PRINT_CLOCK("module", boot_cpu_data.module_clock);

	return 0;
}
コード例 #11
0
int __init db1000_board_setup(void)
{
	/* initialize board register space */
	bcsr_init(DB1000_BCSR_PHYS_ADDR,
		  DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);

	switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
	case BCSR_WHOAMI_DB1000:
	case BCSR_WHOAMI_DB1500:
	case BCSR_WHOAMI_DB1100:
	case BCSR_WHOAMI_PB1500:
	case BCSR_WHOAMI_PB1500R2:
	case BCSR_WHOAMI_PB1100:
		pr_info("AMD Alchemy %s Board\n", get_system_type());
		return 0;
	}
	return -ENODEV;
}
コード例 #12
0
ファイル: setup.c プロジェクト: 0-T-0/ps4-linux
/*
 * Initializes basic routines and structures pointers, memory size (as
 * given by the bios and saves the command line.
 */
void __init plat_mem_setup(void)
{
	unsigned long io_base;

	_machine_restart = ar7_machine_restart;
	_machine_halt = ar7_machine_halt;
	pm_power_off = ar7_machine_power_off;

	io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000);
	if (!io_base)
		panic("Can't remap IO base!");
	set_io_port_base(io_base);

	prom_meminit();

	printk(KERN_INFO "%s, ID: 0x%04x, Revision: 0x%02x\n",
			get_system_type(), ar7_chip_id(), ar7_chip_rev());
}
コード例 #13
0
ファイル: setup.c プロジェクト: cilynx/dd-wrt
/*
 *	Get CPU information for use by the procfs.
 */
static int show_cpuinfo(struct seq_file *m, void *v)
{
	struct sh_cpuinfo *c = v;
	unsigned int cpu = c - cpu_data;

	if (!cpu_online(cpu))
		return 0;

	if (cpu == 0)
		seq_printf(m, "machine\t\t: %s\n", get_system_type());

	seq_printf(m, "processor\t: %d\n", cpu);
	seq_printf(m, "cpu family\t: %s\n", init_utsname()->machine);
	seq_printf(m, "cpu type\t: %s\n", get_cpu_subtype(c));

	show_cpuflags(m, c);

	seq_printf(m, "cache type\t: ");

	/*
	 * Check for what type of cache we have, we support both the
	 * unified cache on the SH-2 and SH-3, as well as the harvard
	 * style cache on the SH-4.
	 */
	if (c->icache.flags & SH_CACHE_COMBINED) {
		seq_printf(m, "unified\n");
		show_cacheinfo(m, "cache", c->icache);
	} else {
		seq_printf(m, "split (harvard)\n");
		show_cacheinfo(m, "icache", c->icache);
		show_cacheinfo(m, "dcache", c->dcache);
	}

	/* Optional secondary cache */
	if (c->flags & CPU_HAS_L2_CACHE)
		show_cacheinfo(m, "scache", c->scache);

	seq_printf(m, "bogomips\t: %lu.%02lu\n",
		     c->loops_per_jiffy/(500000/HZ),
		     (c->loops_per_jiffy/(5000/HZ)) % 100);

	return 0;
}
コード例 #14
0
struct sh_machine_vector* __init get_mv_byname(const char* name)
{
	extern long __machvec_start, __machvec_end;
	struct sh_machine_vector *all_vecs =
		(struct sh_machine_vector *)&__machvec_start;

	int i, n = ((unsigned long)&__machvec_end
		    - (unsigned long)&__machvec_start)/
		sizeof(struct sh_machine_vector);

	for (i = 0; i < n; ++i) {
		struct sh_machine_vector *mv = &all_vecs[i];
		if (mv == NULL)
			continue;
		if (strcasecmp(name, get_system_type()) == 0) {
			return mv;
		}
	}
	return NULL;
}
コード例 #15
0
ファイル: proc.c プロジェクト: ClarkChen633/rtl819x-toolchain
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned long n = (unsigned long) v - 1;

	/*
	 * For the first processor also print the system type
	 */
	if (n == 0)
		seq_printf(m, "system type\t\t: %s\n", get_system_type());

	seq_printf(m, "processor\t\t: %ld\n", n);
    seq_printf(m, "cpu model\t\t: %d\n", cpu_data[n].processor_id);
    seq_printf(m, "BogoMIPS\t\t: %d.%02d\n",
               cpu_data[n].udelay_val / (500000/HZ),
               (cpu_data[n].udelay_val / (5000/HZ)) % 100);

	seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
    seq_printf(m, "mips16 implemented\t: yes\n");

	return 0;
}
コード例 #16
0
ファイル: db1200.c プロジェクト: arhaa/Ubuntu-kernel
int __init db1200_board_setup(void)
{
    unsigned short whoami;

    if (db1200_detect_board())
        return -ENODEV;

    whoami = bcsr_read(BCSR_WHOAMI);
    switch (BCSR_WHOAMI_BOARD(whoami)) {
    case BCSR_WHOAMI_PB1200_DDR1:
    case BCSR_WHOAMI_PB1200_DDR2:
    case BCSR_WHOAMI_DB1200:
        break;
    default:
        return -ENODEV;
    }

    printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d"
           "  Board-ID %d	Daughtercard ID %d\n", get_system_type(),
           (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);

    return 0;
}
コード例 #17
0
ファイル: proc.c プロジェクト: jakev/CobraDroidBeta
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned long n = (unsigned long) v - 1;
	unsigned int version = cpu_data[n].processor_id;
	unsigned int fp_vers = cpu_data[n].fpu_id;
	char fmt [64];
	int i;

#ifdef CONFIG_SMP
	if (!cpu_isset(n, cpu_online_map))
		return 0;
#endif

	/*
	 * For the first processor also print the system type
	 */
	if (n == 0)
		seq_printf(m, "system type\t\t: %s\n", get_system_type());
#ifdef CONFIG_MIPS_GOLDFISH
	/*
	 * This is needed by the Android init process to run
	 * target specific startup code
	 */
	if (n == 0) {
		seq_printf(m, "Hardware\t\t: %s\n", "goldfish");
		seq_printf(m, "Revison\t\t: %s\n", "1");
	}
#endif

	seq_printf(m, "processor\t\t: %ld\n", n);
	sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
	        cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
	seq_printf(m, fmt, __cpu_name[n],
	                           (version >> 4) & 0x0f, version & 0x0f,
	                           (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
	seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
	              cpu_data[n].udelay_val / (500000/HZ),
	              (cpu_data[n].udelay_val / (5000/HZ)) % 100);
	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
	seq_printf(m, "microsecond timers\t: %s\n",
	              cpu_has_counter ? "yes" : "no");
	seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
	seq_printf(m, "extra interrupt vector\t: %s\n",
	              cpu_has_divec ? "yes" : "no");
	seq_printf(m, "hardware watchpoint\t: %s",
		   cpu_has_watch ? "yes, " : "no\n");
	if (cpu_has_watch) {
		seq_printf(m, "count: %d, address/irw mask: [",
			   cpu_data[n].watch_reg_count);
		for (i = 0; i < cpu_data[n].watch_reg_count; i++)
			seq_printf(m, "%s0x%04x", i ? ", " : "" ,
				   cpu_data[n].watch_reg_masks[i]);
		seq_printf(m, "]\n");
	}
	seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
		      cpu_has_mips16 ? " mips16" : "",
		      cpu_has_mdmx ? " mdmx" : "",
		      cpu_has_mips3d ? " mips3d" : "",
		      cpu_has_smartmips ? " smartmips" : "",
		      cpu_has_dsp ? " dsp" : "",
		      cpu_has_mipsmt ? " mt" : ""
		);
	seq_printf(m, "shadow register sets\t: %d\n",
		       cpu_data[n].srsets);
	seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);

	sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
	        cpu_has_vce ? "%u" : "not available");
	seq_printf(m, fmt, 'D', vced_count);
	seq_printf(m, fmt, 'I', vcei_count);
	seq_printf(m, "\n");

	return 0;
}
コード例 #18
0
ファイル: db1200.c プロジェクト: arhaa/Ubuntu-kernel
int __init db1200_dev_setup(void)
{
    unsigned long pfc;
    unsigned short sw;
    int swapped, bid;
    struct clk *c;

    bid = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
    if ((bid == BCSR_WHOAMI_PB1200_DDR1) ||
            (bid == BCSR_WHOAMI_PB1200_DDR2)) {
        if (pb1200_res_fixup())
            return -ENODEV;
    }

    /* GPIO7 is low-level triggered CPLD cascade */
    irq_set_irq_type(AU1200_GPIO7_INT, IRQ_TYPE_LEVEL_LOW);
    bcsr_init_irq(DB1200_INT_BEGIN, DB1200_INT_END, AU1200_GPIO7_INT);

    /* SMBus/SPI on PSC0, Audio on PSC1 */
    pfc = alchemy_rdsys(AU1000_SYS_PINFUNC);
    pfc &= ~(SYS_PINFUNC_P0A | SYS_PINFUNC_P0B);
    pfc &= ~(SYS_PINFUNC_P1A | SYS_PINFUNC_P1B | SYS_PINFUNC_FS3);
    pfc |= SYS_PINFUNC_P1C; /* SPI is configured later */
    alchemy_wrsys(pfc, AU1000_SYS_PINFUNC);

    /* get 50MHz for I2C driver on PSC0 */
    c = clk_get(NULL, "psc0_intclk");
    if (!IS_ERR(c)) {
        pfc = clk_round_rate(c, 50000000);
        if ((pfc < 1) || (abs(50000000 - pfc) > 2500000))
            pr_warn("DB1200: cant get I2C close to 50MHz\n");
        else
            clk_set_rate(c, pfc);
        clk_put(c);
    }

    /* insert/eject pairs: one of both is always screaming.	 To avoid
     * issues they must not be automatically enabled when initially
     * requested.
     */
    irq_set_status_flags(DB1200_SD0_INSERT_INT, IRQ_NOAUTOEN);
    irq_set_status_flags(DB1200_SD0_EJECT_INT, IRQ_NOAUTOEN);
    irq_set_status_flags(DB1200_PC0_INSERT_INT, IRQ_NOAUTOEN);
    irq_set_status_flags(DB1200_PC0_EJECT_INT, IRQ_NOAUTOEN);
    irq_set_status_flags(DB1200_PC1_INSERT_INT, IRQ_NOAUTOEN);
    irq_set_status_flags(DB1200_PC1_EJECT_INT, IRQ_NOAUTOEN);

    i2c_register_board_info(0, db1200_i2c_devs,
                            ARRAY_SIZE(db1200_i2c_devs));
    spi_register_board_info(db1200_spi_devs,
                            ARRAY_SIZE(db1200_i2c_devs));

    /* SWITCHES:	S6.8 I2C/SPI selector  (OFF=I2C	 ON=SPI)
     *		S6.7 AC97/I2S selector (OFF=AC97 ON=I2S)
     *		or S12 on the PB1200.
     */

    /* NOTE: GPIO215 controls OTG VBUS supply.  In SPI mode however
     * this pin is claimed by PSC0 (unused though, but pinmux doesn't
     * allow to free it without crippling the SPI interface).
     * As a result, in SPI mode, OTG simply won't work (PSC0 uses
     * it as an input pin which is pulled high on the boards).
     */
    pfc = alchemy_rdsys(AU1000_SYS_PINFUNC) & ~SYS_PINFUNC_P0A;

    /* switch off OTG VBUS supply */
    gpio_request(215, "otg-vbus");
    gpio_direction_output(215, 1);

    printk(KERN_INFO "%s device configuration:\n", get_system_type());

    sw = bcsr_read(BCSR_SWITCHES);
    if (sw & BCSR_SWITCHES_DIP_8) {
        db1200_devs[0] = &db1200_i2c_dev;
        bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC0MUX, 0);

        pfc |= (2 << 17);	/* GPIO2 block owns GPIO215 */

        printk(KERN_INFO " S6.8 OFF: PSC0 mode I2C\n");
        printk(KERN_INFO "   OTG port VBUS supply available!\n");
    } else {
        db1200_devs[0] = &db1200_spi_dev;
        bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_PSC0MUX);

        pfc |= (1 << 17);	/* PSC0 owns GPIO215 */

        printk(KERN_INFO " S6.8 ON : PSC0 mode SPI\n");
        printk(KERN_INFO "   OTG port VBUS supply disabled\n");
    }
    alchemy_wrsys(pfc, AU1000_SYS_PINFUNC);

    /* Audio: DIP7 selects I2S(0)/AC97(1), but need I2C for I2S!
     * so: DIP7=1 || DIP8=0 => AC97, DIP7=0 && DIP8=1 => I2S
     */
    sw &= BCSR_SWITCHES_DIP_8 | BCSR_SWITCHES_DIP_7;
    if (sw == BCSR_SWITCHES_DIP_8) {
        bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_PSC1MUX);
        db1200_audio_dev.name = "au1xpsc_i2s";
        db1200_sound_dev.name = "db1200-i2s";
        printk(KERN_INFO " S6.7 ON : PSC1 mode I2S\n");
    } else {
        bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC1MUX, 0);
        db1200_audio_dev.name = "au1xpsc_ac97";
        db1200_sound_dev.name = "db1200-ac97";
        printk(KERN_INFO " S6.7 OFF: PSC1 mode AC97\n");
    }

    /* Audio PSC clock is supplied externally. (FIXME: platdata!!) */
    c = clk_get(NULL, "psc1_intclk");
    if (!IS_ERR(c)) {
        clk_prepare_enable(c);
        clk_put(c);
    }
    __raw_writel(PSC_SEL_CLK_SERCLK,
                 (void __iomem *)KSEG1ADDR(AU1550_PSC1_PHYS_ADDR) + PSC_SEL_OFFSET);
    wmb();

    db1x_register_pcmcia_socket(
        AU1000_PCMCIA_ATTR_PHYS_ADDR,
        AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
        AU1000_PCMCIA_MEM_PHYS_ADDR,
        AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
        AU1000_PCMCIA_IO_PHYS_ADDR,
        AU1000_PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
        DB1200_PC0_INT, DB1200_PC0_INSERT_INT,
        /*DB1200_PC0_STSCHG_INT*/0, DB1200_PC0_EJECT_INT, 0);

    db1x_register_pcmcia_socket(
        AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
        AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
        AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
        AU1000_PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
        AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004000000,
        AU1000_PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
        DB1200_PC1_INT, DB1200_PC1_INSERT_INT,
        /*DB1200_PC1_STSCHG_INT*/0, DB1200_PC1_EJECT_INT, 1);

    swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1200_SWAPBOOT;
    db1x_register_norflash(64 << 20, 2, swapped);

    platform_add_devices(db1200_devs, ARRAY_SIZE(db1200_devs));

    /* PB1200 is a DB1200 with a 2nd MMC and Camera connector */
    if ((bid == BCSR_WHOAMI_PB1200_DDR1) ||
            (bid == BCSR_WHOAMI_PB1200_DDR2))
        platform_add_devices(pb1200_devs, ARRAY_SIZE(pb1200_devs));

    return 0;
}
コード例 #19
0
ファイル: proc.c プロジェクト: jameshilliard/20-4-4
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned long n = (unsigned long) v - 1;
	unsigned int version = cpu_data[n].processor_id;
	unsigned int fp_vers = cpu_data[n].fpu_id;
	char fmt [64];
	int i;

#ifdef CONFIG_SMP
	if (!cpu_isset(n, cpu_online_map))
		return 0;
#endif

	/*
	 * For the first processor also print the system type
	 */
	if (n == 0)
		seq_printf(m, "system type\t\t: %s\n", get_system_type());

	seq_printf(m, "processor\t\t: %ld\n", n);
	sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
	        cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
	seq_printf(m, fmt, __cpu_name[n],
	                           (version >> 4) & 0x0f, version & 0x0f,
	                           (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
	seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
	              cpu_data[n].udelay_val / (500000/HZ),
	              (cpu_data[n].udelay_val / (5000/HZ)) % 100);
#ifdef CONFIG_BRCMSTB
	/* for Oprofile opreport */
	seq_printf(m, "cpu MHz\t\t\t: %lu.%03lu\n", brcm_adj_cpu_khz / 1000,
		brcm_adj_cpu_khz % 1000);
#endif
	seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
	seq_printf(m, "microsecond timers\t: %s\n",
	              cpu_has_counter ? "yes" : "no");
	seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
	seq_printf(m, "extra interrupt vector\t: %s\n",
	              cpu_has_divec ? "yes" : "no");
	seq_printf(m, "hardware watchpoint\t: %s",
		   cpu_has_watch ? "yes, " : "no\n");
	if (cpu_has_watch) {
		seq_printf(m, "count: %d, address/irw mask: [",
			   cpu_data[n].watch_reg_count);
		for (i = 0; i < cpu_data[n].watch_reg_count; i++)
			seq_printf(m, "%s0x%04x", i ? ", " : "" ,
				   cpu_data[n].watch_reg_masks[i]);
		seq_printf(m, "]\n");
	}
	seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
		      cpu_has_mips16 ? " mips16" : "",
		      cpu_has_mdmx ? " mdmx" : "",
		      cpu_has_mips3d ? " mips3d" : "",
		      cpu_has_smartmips ? " smartmips" : "",
		      cpu_has_dsp ? " dsp" : "",
		      cpu_has_mipsmt ? " mt" : ""
		);
	seq_printf(m, "shadow register sets\t: %d\n",
		       cpu_data[n].srsets);
	seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);

	sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
	        cpu_has_vce ? "%u" : "not available");
	seq_printf(m, fmt, 'D', vced_count);
	seq_printf(m, fmt, 'I', vcei_count);
#ifdef CONFIG_TIVO
        seq_printf(m, "cycle counter frequency\t: %lu\n",
            /* convert to cycles/sec, safe until 4ghz */
            (tivo_counts_per_256usec * 3906) + (tivo_counts_per_256usec / 4));
#endif
	seq_printf(m, "\n");

	return 0;
}
コード例 #20
0
ファイル: proc.c プロジェクト: andy-padavan/rt-n56u
static int show_cpuinfo(struct seq_file *m, void *v)
{
    struct proc_cpuinfo_notifier_args proc_cpuinfo_notifier_args;
    unsigned long n = (unsigned long) v - 1;
    unsigned int version = cpu_data[n].processor_id;
    unsigned int fp_vers = cpu_data[n].fpu_id;
    char fmt [64];
    int i;

#ifdef CONFIG_SMP
    if (!cpu_online(n))
        return 0;
#endif

    /*
     * For the first processor also print the system type
     */
    if (n == 0) {
        seq_printf(m, "system type\t\t: %s\n", get_system_type());
        if (mips_get_machine_name())
            seq_printf(m, "machine\t\t\t: %s\n",
                       mips_get_machine_name());
    }

    seq_printf(m, "processor\t\t: %ld\n", n);
    sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
            cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
    seq_printf(m, fmt, __cpu_name[n],
               (version >> 4) & 0x0f, version & 0x0f,
               (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
    seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
               cpu_data[n].udelay_val / (500000/HZ),
               (cpu_data[n].udelay_val / (5000/HZ)) % 100);
    seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
    seq_printf(m, "microsecond timers\t: %s\n",
               cpu_has_counter ? "yes" : "no");
    seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
    seq_printf(m, "extra interrupt vector\t: %s\n",
               cpu_has_divec ? "yes" : "no");
    seq_printf(m, "hardware watchpoint\t: %s",
               cpu_has_watch ? "yes, " : "no\n");
    if (cpu_has_watch) {
        seq_printf(m, "count: %d, address/irw mask: [",
                   cpu_data[n].watch_reg_count);
        for (i = 0; i < cpu_data[n].watch_reg_count; i++)
            seq_printf(m, "%s0x%04x", i ? ", " : "" ,
                       cpu_data[n].watch_reg_masks[i]);
        seq_printf(m, "]\n");
    }
    seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
               cpu_has_mips16 ? " mips16" : "",
               cpu_has_mdmx ? " mdmx" : "",
               cpu_has_mips3d ? " mips3d" : "",
               cpu_has_smartmips ? " smartmips" : "",
               cpu_has_dsp ? " dsp" : "",
               cpu_has_mipsmt ? " mt" : ""
              );
    seq_printf(m, "shadow register sets\t: %d\n",
               cpu_data[n].srsets);
    seq_printf(m, "kscratch registers\t: %d\n",
               hweight8(cpu_data[n].kscratch_mask));
    seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);

#if defined(CONFIG_MIPS_MT_SMP)
    if (cpu_has_mipsmt)
        seq_printf(m, "VPE\t\t\t: %d\n", cpu_data[n].vpe_id);
#endif

    sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
            cpu_has_vce ? "%u" : "not available");
    seq_printf(m, fmt, 'D', vced_count);
    seq_printf(m, fmt, 'I', vcei_count);

    proc_cpuinfo_notifier_args.m = m;
    proc_cpuinfo_notifier_args.n = n;

    raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
                            &proc_cpuinfo_notifier_args);

    seq_printf(m, "\n");

    return 0;
}
コード例 #21
0
ファイル: proc.c プロジェクト: xuanhoa9985/KERNEL-NPM801
static int show_cpuinfo(struct seq_file *m, void *v)
{
	unsigned long n = (unsigned long) v - 1;
	unsigned int version = cpu_data[n].processor_id;
	unsigned int fp_vers = cpu_data[n].fpu_id;
	char fmt [64];
	int i;

	struct thread_struct *mc_thread = &current->thread;

#ifdef CONFIG_SMP
	if (!cpu_isset(n, cpu_online_map))
		return 0;
#endif

/* For Magiccode */
        /* For Magiccode, when current process uses emulated ARM native code: */
        if (mc_thread->mcflags != CPU_MIPS) {
                /* mimic cpuinfo of 2012 Nexus7 with NVidia Tegra3 T30L cpu */
                seq_printf(m, "Processor\t: ARMv7 Processor rev 9 (v7l)\n");
                seq_printf(m, "processor\t: 0\n");
                seq_printf(m, "BogoMIPS\t: 1001.88\n\n");
                /* show just one processor core */
                seq_printf(m, "Features\t: swp half thumb fastmult vfp ");
                if (mc_thread->mcflags == CPU_ARM_NEON)
                        seq_printf(m, "edsp neon ");
                seq_printf(m, "vfpv3\n");
                /* no thumbee or tls feature */
                seq_printf(m, "CPU implementer\t: 0x41\n");  /* ARM */
                seq_printf(m, "CPU architecture: 7\n");
                seq_printf(m, "CPU variant\t: 0x2\n");
                seq_printf(m, "CPU part\t: 0xc09\n");  /* Cortex-A9 */
                seq_printf(m, "CPU revision\t: 9\n");
                seq_printf(m, "\n");
                return 0;
        }
	else {
		
		/*
		 * For the first processor also print the system type
		 */
		unsigned int detected = 0;
		rcu_read_lock();
		if ((strcmp(current->parent->comm, "tv.apad:vplayer") == 0) ||
			(strcmp(current->comm, "tv.apad:vplayer") == 0)) {
			detected = 1;
		}
		rcu_read_unlock();
		if (n == 0) {
			seq_printf(m, "system type\t\t: %s\n", get_system_type());
			if (mips_get_machine_name())
				seq_printf(m, "machine\t\t\t: %s\n",
					   mips_get_machine_name());
		}
		if (detected == 0) {
			seq_printf(m, "processor\t\t: %ld\n", n);
		} else {
			seq_printf(m, "processor\t\t: ARMv7 swp half thumb fastmult vfp edsp neon vfpv3 %ld\n ", n);
		}
		sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
			cpu_data[n].options & MIPS_CPU_FPU ? "  FPU V%d.%d" : "");
		seq_printf(m, fmt, __cpu_name[n],
			   (version >> 4) & 0x0f, version & 0x0f,
			   (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
		seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
			   cpu_data[n].udelay_val / (500000/HZ),
			   (cpu_data[n].udelay_val / (5000/HZ)) % 100);
		seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
		if (detected == 0) {
			seq_printf(m, "microsecond timers\t: %s\n",
						cpu_has_counter ? "yes" : "no");
		}
		seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
		seq_printf(m, "extra interrupt vector\t: %s\n",
			   cpu_has_divec ? "yes" : "no");
		seq_printf(m, "hardware watchpoint\t: %s",
			   cpu_has_watch ? "yes, " : "no\n");
		if (cpu_has_watch) {
			seq_printf(m, "count: %d, address/irw mask: [",
				   cpu_data[n].watch_reg_count);
			for (i = 0; i < cpu_data[n].watch_reg_count; i++)
				seq_printf(m, "%s0x%04x", i ? ", " : "" ,
					   cpu_data[n].watch_reg_masks[i]);
			seq_printf(m, "]\n");
		}
		seq_printf(m, "microMIPS\t\t: %s\n", cpu_has_mmips ? "yes" : "no");
		seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s%s\n",
			   cpu_has_mips16 ? " mips16" : "",
			   cpu_has_mdmx ? " mdmx" : "",
			   cpu_has_mips3d ? " mips3d" : "",
			   cpu_has_smartmips ? " smartmips" : "",
			   cpu_has_dsp ? " dsp" : "",
			   cpu_has_mipsmt ? " mt" : "",
			   cpu_has_mxu ? " mxu" : ""
			);
		seq_printf(m, "shadow register sets\t: %d\n",
			   cpu_data[n].srsets);
		seq_printf(m, "kscratch registers\t: %d\n",
			   hweight8(cpu_data[n].kscratch_mask));
		seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);
		
		sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
			cpu_has_vce ? "%u" : "not available");
		seq_printf(m, fmt, 'D', vced_count);
		seq_printf(m, fmt, 'I', vcei_count);
		
		/* Android requires 'Hardware' to setup the init.%hardware%.rc */
		seq_printf(m, "Hardware\t\t: %s\n", get_board_type());
		
		seq_printf(m, "\n");
	}
	return 0;
}