Example #1
0
static int __init footbridge_isa_init(void)
{
	int err = 0;

	if (!footbridge_cfn_mode())
		return 0;

	/* Personal server doesn't have RTC */
	if (!machine_is_personal_server()) {
		isa_rtc_init();
		err = platform_device_register(&rtc_device);
		if (err)
			printk(KERN_ERR "Unable to register RTC device: %d\n", err);
	}
	err = platform_device_register(&serial_device);
	if (err)
		printk(KERN_ERR "Unable to register serial device: %d\n", err);
	return 0;
}
Example #2
0
/*
 * Set up timer interrupt.
 */
void __init footbridge_init_time(void)
{
	if (machine_is_co285() ||
	    machine_is_personal_server())
		/*
		 * Add-in 21285s shouldn't access the RTC
		 */
		rtc_base = 0;
	else
		rtc_base = 0x70;

	if (rtc_base) {
		int reg_d, reg_b;

		/*
		 * Probe for the RTC.
		 */
		reg_d = CMOS_READ(RTC_REG_D);

		/*
		 * make sure the divider is set
		 */
		CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_REG_A);

		/*
		 * Set control reg B
		 *   (24 hour mode, update enabled)
		 */
		reg_b = CMOS_READ(RTC_REG_B) & 0x7f;
		reg_b |= 2;
		CMOS_WRITE(reg_b, RTC_REG_B);

		if ((CMOS_READ(RTC_REG_A) & 0x7f) == RTC_REF_CLCK_32KHZ &&
		    CMOS_READ(RTC_REG_B) == reg_b) {
			struct timespec tv;

			/*
			 * We have a RTC.  Check the battery
			 */
			if ((reg_d & 0x80) == 0)
				printk(KERN_WARNING "RTC: *** warning: CMOS battery bad\n");

			tv.tv_nsec = 0;
			tv.tv_sec = get_isa_cmos_time();
			do_settimeofday(&tv);
			set_rtc = set_isa_cmos_time;
		} else
			rtc_base = 0;
	}

	if (machine_is_ebsa285() ||
	    machine_is_co285() ||
	    machine_is_personal_server()) {
		gettimeoffset = timer1_gettimeoffset;

		timer1_latch = (mem_fclk_21285 + 8 * HZ) / (16 * HZ);

		*CSR_TIMER1_CLR  = 0;
		*CSR_TIMER1_LOAD = timer1_latch;
		*CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;

		footbridge_timer_irq.name = "Timer1 Timer Tick";
		footbridge_timer_irq.handler = timer1_interrupt;
		
		setup_irq(IRQ_TIMER1, &footbridge_timer_irq);

	} else {
		/* enable PIT timer */
		/* set for periodic (4) and LSB/MSB write (0x30) */
		outb(0x34, 0x43);
		outb((mSEC_10_from_14/6) & 0xFF, 0x40);
		outb((mSEC_10_from_14/6) >> 8, 0x40);

		gettimeoffset = isa_gettimeoffset;

		footbridge_timer_irq.name = "ISA Timer Tick";
		footbridge_timer_irq.handler = isa_timer_interrupt;
		
		setup_irq(IRQ_ISA_TIMER, &footbridge_timer_irq);
	}
}
Example #3
0
static int __init personal_pci_init(void)
{
	if (machine_is_personal_server())
		pci_common_init(&personal_server_pci);
	return 0;
}