00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <agnix/init.h>
00015 #include <agnix/adi/adi.h>
00016 #include <agnix/irq.h>
00017 #include <agnix/console.h>
00018
00019 #define MOD_NAME "CHIPS: "
00020
00021 const char *chip_class_names[] = {
00022 "CPU", "PIC", "PIT", "RTC", "DMA"
00023 };
00024
00025 int adi_register_chip(struct chip_s *chip)
00026 {
00027 int ret = 0;
00028
00029 if (chip->chip_name)
00030 printk(MOD_NAME "Registering %s chip\t (class %s)\n", chip->chip_name, chip_class_names[chip->chip_class]);
00031 else
00032 printk(MOD_NAME "Registering unknown-name chip\n", chip->chip_name);
00033
00034 spin_lock_init(&chip->chip_lock);
00035
00036
00037
00038 chip->chip_state = CHIP_STATE_INITIALIZING;
00039
00040 if ((chip->chip_ops) && (chip->chip_ops->init)) {
00041
00042 ret = chip->chip_ops->init(chip);
00043 if (ret)
00044 return -1;
00045 else
00046 chip->chip_state = CHIP_STATE_WORKING;
00047 }
00048
00049 return 0;
00050 }
00051
00052 void __init adi_chips_init(void)
00053 {
00054 printk(MOD_NAME "Initializing chip drivers\n");
00055
00056 i8259a_init();
00057 i8254_init();
00058 rtc_init();
00059 dma_init();
00060 intel_init(0);
00061 }