Index: branches/azimutz/Chazileon/i386/libsaio/usb.c =================================================================== --- branches/azimutz/Chazileon/i386/libsaio/usb.c (revision 317) +++ branches/azimutz/Chazileon/i386/libsaio/usb.c (revision 318) @@ -22,6 +22,7 @@ #define DBG(x...) #endif + struct pciList { pci_dt_t* pciDev; @@ -37,12 +38,14 @@ // Add usb device to the list void notify_usb_dev(pci_dt_t *pci_dev) { + struct pciList* current = usbList; if(!usbList) { usbList = (struct pciList*)malloc(sizeof(struct pciList)); usbList->next = NULL; usbList->pciDev = pci_dev; + } else { @@ -58,24 +61,22 @@ } } +// Loop through the list and call the apropriate patch function int usb_loop() { int retVal = 1; - bool fix_ehci, fix_uhci, fix_legacy, fix_usb; + bool fix_ehci, fix_uhci, fix_usb, fix_legacy; + fix_ehci = fix_uhci = fix_usb = fix_legacy = false; - fix_ehci = fix_uhci = fix_legacy = fix_usb = false; - - getBoolForKey(kUSBBusFixKey, &fix_usb, &bootInfo->bootConfig); - - if (fix_usb) + if (getBoolForKey(kUSBBusFix, &fix_usb, &bootInfo->bootConfig)) { - fix_ehci = fix_uhci = fix_legacy = true; + fix_ehci = fix_uhci = fix_legacy = fix_usb; // Disable all if none set } else { - getBoolForKey(kEHCIacquireKey, &fix_ehci, &bootInfo->bootConfig); - getBoolForKey(kUHCIresetKey, &fix_uhci, &bootInfo->bootConfig); - getBoolForKey(kLegacyOffKey, &fix_legacy, &bootInfo->bootConfig); + getBoolForKey(kEHCIacquire, &fix_ehci, &bootInfo->bootConfig); + getBoolForKey(kUHCIreset, &fix_uhci, &bootInfo->bootConfig); + getBoolForKey(kLegacyOff, &fix_legacy, &bootInfo->bootConfig); } struct pciList* current = usbList; @@ -86,20 +87,18 @@ { // EHCI case 0x20: - if (fix_ehci) - retVal &= ehci_acquire(current->pciDev); - if (fix_legacy) - retVal &= legacy_off(current->pciDev); + if(fix_ehci) retVal &= ehci_acquire(current->pciDev); + if(fix_legacy) retVal &= legacy_off(current->pciDev); break; // UHCI case 0x00: - if (fix_uhci) - retVal &= uhci_reset(current->pciDev); + if (fix_uhci) retVal &= uhci_reset(current->pciDev); break; } + current = current->next; } return retVal; @@ -201,7 +200,7 @@ int ehci_acquire (pci_dt_t *pci_dev) { - int j, k; + int j, k; uint32_t base; uint8_t eecp; uint8_t legacy[8]; @@ -209,7 +208,7 @@ bool alwaysHardBIOSReset; alwaysHardBIOSReset = false; - if (!getBoolForKey(kEHCIhardKey, &alwaysHardBIOSReset, &bootInfo->bootConfig)) { + if (!getBoolForKey(kEHCIhard, &alwaysHardBIOSReset, &bootInfo->bootConfig)) { alwaysHardBIOSReset = true; } Index: branches/azimutz/Chazileon/i386/libsaio/sys.c =================================================================== --- branches/azimutz/Chazileon/i386/libsaio/sys.c (revision 317) +++ branches/azimutz/Chazileon/i386/libsaio/sys.c (revision 318) @@ -95,7 +95,7 @@ { "hd", 0x80, kBIOSDevTypeHardDrive }, /* DEV_HD */ { "en", 0xE0, kBIOSDevTypeNetwork }, /* DEV_EN */ { "rd", 0x100, kBIOSDevTypeHardDrive }, - { "bt", 0x101, kBIOSDevTypeHardDrive }, // turbo - type for booter partition Azi: or ramdisk bt aliased! + { "bt", 0x101, kBIOSDevTypeHardDrive }, // turbo - type for booter partition Azi: or ramdisk bt aliased?? { 0, 0 } }; Index: branches/azimutz/Chazileon/i386/libsaio/platform.c =================================================================== --- branches/azimutz/Chazileon/i386/libsaio/platform.c (revision 317) +++ branches/azimutz/Chazileon/i386/libsaio/platform.c (revision 318) @@ -38,26 +38,20 @@ } /** scan mem for memory autodection purpose */ -void scan_mem() -{ +void scan_mem() { static bool done = false; + if (done) return; - if (done) - return; + bool useAutodetection = true; + getBoolForKey(kUseMemDetect, &useAutodetection, &bootInfo->bootConfig); - bool useAutodetection = true; //Azi:default - - getBoolForKey(kUseMemDetectKey, &useAutodetection, &bootInfo->bootConfig); - - if (useAutodetection) - { - if (dram_controller_dev != NULL) - { + if (useAutodetection) { + if (dram_controller_dev!=NULL) { scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ... } scan_memory(&Platform); // unfortunately still necesary for some comp where spd cant read correct speed scan_spd(&Platform); - //pause(); //Azi:--- + //getc(); } done = true; } Index: branches/azimutz/Chazileon/i386/libsaio/saio_types.h =================================================================== --- branches/azimutz/Chazileon/i386/libsaio/saio_types.h (revision 317) +++ branches/azimutz/Chazileon/i386/libsaio/saio_types.h (revision 318) @@ -215,7 +215,7 @@ kPartitionTypeHPFS = 0x07, kPartitionTypeFAT16 = 0x06, kPartitionTypeFAT32 = 0x0c, - kPartitionTypeEXT3 = 0x83 //Azi:--- + kPartitionTypeEXT3 = 0x83 }; //#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask) Index: branches/azimutz/Chazileon/i386/boot2/kernel_patcher.c =================================================================== --- branches/azimutz/Chazileon/i386/boot2/kernel_patcher.c (revision 317) +++ branches/azimutz/Chazileon/i386/boot2/kernel_patcher.c (revision 318) @@ -14,8 +14,8 @@ #define SYMBOL_PANIC 1 #define SYMBOL_PMCPUEXITHALTTOOFF 2 #define SYMBOL_LAPIC_INIT 3 -#define SYMBOL_COMMPAGE_STUFF_ROUTINE 4 // not needed to boot -legacy :) -#define NUM_SYMBOLS 5 // change according nr of simbols +#define SYMBOL_COMMPAGE_STUFF_ROUTINE 4 //Azi: not needed to boot -legacy +#define NUM_SYMBOLS 5 #define SYMBOL_CPUID_SET_INFO_STRING "_cpuid_set_info" #define SYMBOL_PANIC_STRING "_panic" @@ -109,7 +109,6 @@ // Unknown CPU's default: // TODO: Impersonate CPU based on user selection - //patch_cpuid_set_info(kernelData, CPUFAMILY_INTEL_PENRYN, CPUID_MODEL_PENRYN); // Impersonate CPU patch_cpuid_set_info(kernelData, 0, 0); // Remove Panic Call break;