Commit e51b59f6 authored by Russell King's avatar Russell King

Update Shark machine type.

parent 4ce465d6
This diff is collapsed.
......@@ -74,85 +74,7 @@ static struct pci_ops via82c505_ops = {
via82c505_write_config_dword,
};
#ifdef CONFIG_ARCH_SHARK
static char size_wanted;
static int
dummy_read_config_byte(struct pci_dev *dev, int where, u8 *value)
{
*value=0;
return PCIBIOS_SUCCESSFUL;
}
static int
dummy_read_config_word(struct pci_dev *dev, int where, u16 *value)
{
*value=0;
return PCIBIOS_SUCCESSFUL;
}
static int
dummy_read_config_dword(struct pci_dev *dev, int where, u32 *value)
{
if (dev->devfn != 0) *value = 0;
else
switch(where) {
case PCI_VENDOR_ID:
*value = PCI_VENDOR_ID_INTERG | PCI_DEVICE_ID_INTERG_2010 << 16;
break;
case PCI_CLASS_REVISION:
*value = PCI_CLASS_DISPLAY_VGA << 16;
break;
case PCI_BASE_ADDRESS_0:
if (size_wanted) {
/* 0x00900000 bytes long (0xff700000) */
*value = 0xff000000;
size_wanted = 0;
} else {
*value = FB_START;
}
break;
case PCI_INTERRUPT_LINE:
*value = 6;
break;
default:
*value = 0;
}
return PCIBIOS_SUCCESSFUL;
}
static int
dummy_write_config_byte(struct pci_dev *dev, int where, u8 value)
{
return PCIBIOS_SUCCESSFUL;
}
static int
dummy_write_config_word(struct pci_dev *dev, int where, u16 value)
{
return PCIBIOS_SUCCESSFUL;
}
static int
dummy_write_config_dword(struct pci_dev *dev, int where, u32 value)
{
if ((dev->devfn == 0) && (where == PCI_BASE_ADDRESS_0) && (value == 0xffffffff))
size_wanted = 1;
return PCIBIOS_SUCCESSFUL;
}
static struct pci_ops dummy_ops = {
dummy_read_config_byte,
dummy_read_config_word,
dummy_read_config_dword,
dummy_write_config_byte,
dummy_write_config_word,
dummy_write_config_dword,
};
#endif
void __init via82c505_init(void *sysdata)
void __init via82c505_preinit(void *sysdata)
{
struct pci_bus *bus;
......@@ -166,13 +88,17 @@ void __init via82c505_init(void *sysdata)
outb(0x93,0xA8);
outb(0xd0,0xA9);
pci_scan_bus(0, &via82c505_ops, sysdata);
}
int __init via82c505_setup(int nr, struct pci_sys_data *sys)
{
return (nr == 0);
}
struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata)
{
if (nr == 0)
return pci_scan_bus(0, &via82c505_ops, sysdata);
#ifdef CONFIG_ARCH_SHARK
/*
* Initialize a fake pci-bus number 1 for the CyberPro
* on the vlbus
*/
bus = pci_scan_bus(1, &dummy_ops, sysdata);
#endif
return NULL;
}
......@@ -17,11 +17,14 @@ static int __init shark_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
if (dev->bus->number == 0)
if (dev->devfn == 0) return 255;
else return 11;
else return 6;
else return 255;
}
struct hw_pci shark_pci __initdata = {
init: via82c505_init,
swizzle: no_swizzle,
map_irq: shark_map_irq
setup: via82c505_setup,
swizzle: pci_std_swizzle,
map_irq: shark_map_irq,
nr_controllers: 1,
scan: via82c505_scan_bus,
preinit: via82c505_preinit
};
......@@ -39,6 +39,7 @@
/* defines for the Framebuffer */
#define FB_START 0x06000000
#define FB_SIZE 0x01000000
#define UNCACHEABLE_ADDR 0xdf010000
......
......@@ -29,7 +29,6 @@ extern unsigned char pckbd_sysrq_xlate[128];
static inline void kbd_init_hw(void)
{
if (have_isa_bridge) {
k_setkeycode = pckbd_setkeycode;
k_getkeycode = pckbd_getkeycode;
k_translate = pckbd_translate;
......@@ -40,7 +39,6 @@ static inline void kbd_init_hw(void)
k_sysrq_xlate = pckbd_sysrq_xlate;
#endif
pckbd_init_hw();
}
}
/*
......
......@@ -4,9 +4,5 @@
* by Alexander Schulz
*/
/* This must be a power of 2 because the RTC
* can't use anything else.
*/
#define HZ 64
#define HZ 100
#define hz_to_std(a) ((a * HZ)/100)
......@@ -3,44 +3,21 @@
*
* by Alexander Schulz
*
* Uses the real time clock because you can't run
* the timer with level triggered interrupts and
* you can't run the shark with edge triggered
* inetrrupts (loses ints and hangs).
*
* derived from linux/drivers/char/rtc.c and:
* linux/include/asm-arm/arch-ebsa110/time.h
* derived from include/asm-arm/arch-ebsa110/time.h
* Copyright (c) 1996,1997,1998 Russell King.
*/
#include <asm/leds.h>
#include <linux/mc146818rtc.h>
#define IRQ_TIMER 8
#include <asm/param.h>
extern void get_rtc_time(struct rtc_time *rtc_tm);
extern void set_rtc_irq_bit(unsigned char bit);
extern unsigned long epoch;
#define IRQ_TIMER 0
#define HZ_TIME ((1193180 + HZ/2) / HZ)
static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
CMOS_READ(RTC_INTR_FLAGS);
do_leds();
{
#ifdef DIVISOR
static unsigned int divisor;
if (divisor-- == 0) {
divisor = DIVISOR - 1;
#else
{
#endif
do_timer(regs);
}
}
do_profile(regs);
}
/*
......@@ -48,38 +25,15 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
*/
void __init time_init(void)
{
struct rtc_time r_time;
unsigned long flags;
int tmp = 0;
unsigned char val;
/*
* Set the clock to 128 Hz, we already have a valid
* vector now:
*/
while (HZ > (1<<tmp))
tmp++;
/*
* Check that the input was really a power of 2.
*/
if (HZ != (1<<tmp))
panic("Please set HZ to a power of 2!");
save_flags(flags);
cli();
val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0;
val |= (16 - tmp);
CMOS_WRITE(val, RTC_FREQ_SELECT);
restore_flags(flags);
set_rtc_irq_bit(RTC_PIE);
outb(0x34, 0x43); /* binary, mode 0, LSB/MSB, Ch 0 */
outb(HZ_TIME & 0xff, 0x40); /* LSB of count */
outb(HZ_TIME >> 8, 0x40);
get_rtc_time(&r_time);
xtime.tv_sec = mktime(r_time.tm_year+epoch, r_time.tm_mon+1, r_time.tm_mday,
r_time.tm_hour, r_time.tm_min, r_time.tm_sec);
xtime.tv_sec = 0;
timer_irq.handler = timer_interrupt;
timer_irq.flags = SA_INTERRUPT; /* FIXME: really? */
setup_arm_irq(IRQ_TIMER, &timer_irq);
setup_irq(IRQ_TIMER, &timer_irq);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment