コード例 #1
0
ファイル: tc.c プロジェクト: BackupTheBerlios/tew632-brp-svn
/*
 * the main entry
 */
static int __init tc_init(void)
{
	int tc_clock;
	int i;
	unsigned long slot0addr;
	unsigned long slot_size;

	if (!TURBOCHANNEL)
		return 0;

	for (i = 0; i < MAX_SLOT; i++) {
		tc_bus[i].base_addr = 0;
		tc_bus[i].name[0] = 0;
		tc_bus[i].vendor[0] = 0;
		tc_bus[i].firmware[0] = 0;
		tc_bus[i].interrupt = -1;
		tc_bus[i].flags = FREE;
	}

	info = rex_gettcinfo();
	slot0addr = CPHYSADDR((long)rex_slot_address(0));

	switch (mips_machtype) {
	case MACH_DS5000_200:
		num_tcslots = 7;
		break;
	case MACH_DS5000_1XX:
	case MACH_DS5000_2X0:
	case MACH_DS5900:
		num_tcslots = 3;
		break;
	case MACH_DS5000_XX:
	default:
		num_tcslots = 2;
		break;
	}

	tc_clock = 10000 / info->clk_period;

	if (info->slot_size && slot0addr) {
		pr_info("TURBOchannel rev. %d at %d.%d MHz (with%s parity)\n",
			info->revision, tc_clock / 10, tc_clock % 10,
			info->parity ? "" : "out");

		slot_size = info->slot_size << 20;

		tc_probe(slot0addr, slot_size, num_tcslots);

		for (i = 0; i < num_tcslots; i++) {
			if (!tc_bus[i].base_addr)
				continue;
			pr_info("    slot %d: %s %s %s\n", i, tc_bus[i].vendor,
				tc_bus[i].name, tc_bus[i].firmware);
		}
	}

	return 0;
}
コード例 #2
0
ファイル: fb_hdw.c プロジェクト: rohsaini/mkunity
fb_probe( /* reg, ui */)
{
	static probed_once = 0;

	/*
	 * Probing was really done sweeping the TC long ago
	 */
	if (tc_probe("fb") == 0)
		return 0;
	if (probed_once++ > 1)
		printf("[mappable] ");
	return 1;
}
コード例 #3
0
ファイル: sfb_hdw.c プロジェクト: Prajna/mach
sfb_probe(
	vm_offset_t	addr,
	struct bus_device *device)
{
	static probed_once = 0;

	/*
	 * Probing was really done sweeping the TC long ago
	 */
	if (tc_probe("sfb") == 0)
		return 0;
	if (probed_once++ > 1) {
		printf("[mappable] ");
		device->address = addr;
	}
	return 1;
}
コード例 #4
0
ファイル: tc.c プロジェクト: JBTech/ralink_rt5350
/*
 * the main entry
 */
void __init tc_init(void)
{
	int tc_clock;
	int i;
	unsigned long slot0addr;
	unsigned long slot_size;

	if (!TURBOCHANNEL)
		return;

	for (i = 0; i < MAX_SLOT; i++) {
		tc_bus[i].base_addr = 0;
		tc_bus[i].name[0] = 0;
		tc_bus[i].vendor[0] = 0;
		tc_bus[i].firmware[0] = 0;
		tc_bus[i].interrupt = -1;
		tc_bus[i].flags = FREE;
	}

	info = (tcinfo *) rex_gettcinfo();
	slot0addr = (unsigned long)KSEG1ADDR(rex_slot_address(0));

	switch (mips_machtype) {
	case MACH_DS5000_200:
		num_tcslots = 7;
		break;
	case MACH_DS5000_1XX:
	case MACH_DS5000_2X0:
	case MACH_DS5900:
		num_tcslots = 3;
		break;
	case MACH_DS5000_XX:
	default:
		num_tcslots = 2;
		break;
	}

	tc_clock = 10000 / info->clk_period;

	if (TURBOCHANNEL && info->slot_size && slot0addr) {
		printk("TURBOchannel rev. %1d at %2d.%1d MHz ", info->revision,
			tc_clock / 10, tc_clock % 10);
		printk("(with%s parity)\n", info->parity ? "" : "out");

		slot_size = info->slot_size << 20;

		tc_probe(slot0addr, slot_size, num_tcslots);

  		/*
  		 * All TURBOchannel DECstations have the onboard devices
 		 * where the (num_tcslots + 0 or 1 on DS5k/xx) Option Module
 		 * would be.
 		 */
 		if(mips_machtype == MACH_DS5000_XX)
 			i = 1;
		else
 			i = 0;

 	        system_base = slot0addr + slot_size * (num_tcslots + i);

#ifdef TC_DEBUG
		for (i = 0; i < num_tcslots; i++)
			if (tc_bus[i].base_addr) {
				printk("    slot %d: ", i);
				printk("%s %s %s\n", tc_bus[i].vendor,
					tc_bus[i].name, tc_bus[i].firmware);
			}
#endif
		ioport_resource.end = KSEG2 - 1;
	}
}
コード例 #5
0
ファイル: sfb_hdw.c プロジェクト: Prajna/mach
sfb_cold_init(
	int		unit,
	user_info_t	*up)
{
	sfb_softc_t	*sfb;
	screen_softc_t	sc = screen(unit);
	vm_offset_t	base = tc_probe("sfb");
	int		hor_p, ver_p;
	boolean_t	makes_sense;

	bcopy(&sfb_sw, &sc->sw, sizeof(sc->sw));
	sc->flags |= COLOR_SCREEN;

	/*
	 * I am confused here by the documentation.  One document
	 * sez there are three boards:
	 *	"PMAGB-BA" can do 1280x1024 @66Hz or @72Hz
	 *	"PMAGB-BC" can do 1024x864  @60Hz or 1280x1024 @72Hz
	 *	"PMAGB-BE" can do 1024x768  @72Hz or 1280x1024 @72Hz
	 * Another document sez things differently:
	 *	"PMAGB-BB" can do 1024x768  @72Hz
	 *	"PMAGB-BD" can do 1024x864  @60Hz or 1280x1024 @72Hz
	 *
	 * I would be inclined to believe the first one, which came
	 * with an actual piece of hardware attached (a PMAGB-BA).
	 * But I could swear I got a first board (which blew up
	 * instantly) and it was calling itself PMAGB-BB...
	 *
	 * Since I have not seen any other hardware I will make
	 * this code as hypothetical as I can.  Should work :-))
	 */

	makes_sense = FALSE;

	{
		sfb_regs	*regs;

		regs = (sfb_regs *) ((char *)base + SFB_OFFSET_REGS);
		hor_p = (regs->vhor_setup & 0x1ff) * 4;
		ver_p = regs->vvert_setup & 0x7ff;

		if (((hor_p == 1280) && (ver_p == 1024)) ||
		    ((hor_p == 1024) && (ver_p == 864)) ||
		    ((hor_p == 1024) && (ver_p == 768)))
			makes_sense = TRUE;
	}	

	if (makes_sense) {
		sc->frame_scanline_width = hor_p;
		sc->frame_height = ver_p;
		sc->frame_visible_width = hor_p;
		sc->frame_visible_height = ver_p;
	} else {
		sc->frame_scanline_width = 1280;
		sc->frame_height = 1024;
		sc->frame_visible_width = 1280;
		sc->frame_visible_height = 1024;
	}

	pm_init_screen_params(sc,up);
	(void) screen_up(unit, up);

	sfb = pm_alloc( unit, sparsify(base + SFB_OFFSET_BT459),
			base + SFB_OFFSET_VRAM, -1);

	screen_default_colors(up);

	sfb_soft_reset(sc);

	/*
	 * Clearing the screen at boot saves from scrolling
	 * much, and speeds up booting quite a bit.
	 */
	screen_blitc( unit, 'C'-'@');/* clear screen */
}