/********************************************************************************* * * Routine Description: Config SB before ACPI S3 resume PCI config device restore * * Arguments: * * pConfig - SBconfiguration * * Returns: void * * Reference: AtiSbBfPciRestore * **********************************************************************************/ void sbBeforePciRestoreInit(AMDSBCFG* pConfig){ BUILDPARAM *pStaticOptions; TRACE((DMSG_SB_TRACE, "CIMx - Entering sbBeforePciRestoreInit \n")); pConfig->S3Resume = 1; pStaticOptions = &pConfig->BuildParameters; commonInitEarlyBoot(pConfig); // set /SMBUS/ACPI/IDE/LPC/PCIB abLinkInitBeforePciEnum(pConfig); // Set ABCFG registers usbInitBeforePciEnum(pConfig); // USB POST TIME Only fcInitBeforePciEnum(pConfig); // Preinit flash controller sataInitBeforePciEnum(pConfig); programSubSystemIDs(pConfig, pStaticOptions); // Set subsystem/vendor ID }
VOID sbBeforePciRestoreInit ( IN AMDSBCFG* pConfig ) { pConfig->S3Resume = 1; commonInitEarlyBoot (pConfig); // set /SMBUS/ACPI/IDE/LPC/PCIB abLinkInitBeforePciEnum (pConfig); // Set ABCFG registers usbInitBeforePciEnum (pConfig); // USB POST TIME Only sataInitBeforePciEnum (pConfig); gecInitBeforePciEnum (pConfig); // Init GEC azaliaInitBeforePciEnum (pConfig); // Detect and configure High Definition Audio sbPcieGppEarlyInit (pConfig); // Gpp port init abSpecialSetBeforePciEnum (pConfig); }
/********************************************************************************* * * Routine Description: Config SB Before PCI INIT * * Arguments: * * pConfig - SBconfiguration * * Returns: * * void * **********************************************************************************/ void sbBeforePciInit (AMDSBCFG* pConfig){ BUILDPARAM *pStaticOptions; pStaticOptions = &pConfig->BuildParameters; TRACE((DMSG_SB_TRACE, "CIMx - Entering sbBeforePciInit \n")); commonInitEarlyBoot(pConfig); commonInitEarlyPost(pConfig); #ifndef NO_EC_SUPPORT ecInitBeforePciEnum(pConfig); #endif usbInitBeforePciEnum(pConfig); // USB POST TIME Only fcInitBeforePciEnum(pConfig); // Preinit flash controller sataInitBeforePciEnum(pConfig); // Init SATA class code and PHY programSubSystemIDs(pConfig, pStaticOptions); // Set subsystem/vendor ID TRACE((DMSG_SB_TRACE, "CIMx - Exiting sbBeforePciInit \n")); }
VOID sbBeforePciInit ( IN AMDSBCFG* pConfig ) { commonInitEarlyBoot (pConfig); commonInitEarlyPost (pConfig); #ifndef NO_EC_SUPPORT ecInitBeforePciEnum (pConfig); #endif usbInitBeforePciEnum (pConfig); // USB POST TIME Only sataInitBeforePciEnum (pConfig); // Init SATA class code and PHY gecInitBeforePciEnum (pConfig); // Init GEC azaliaInitBeforePciEnum (pConfig); // Detect and configure High Definition Audio sbPcieGppEarlyInit (pConfig); // Gpp port init abSpecialSetBeforePciEnum (pConfig); usbDesertPll (pConfig); }
VOID sbBeforePciRestoreInit ( IN AMDSBCFG* pConfig ) { TRACE ((DMSG_SB_TRACE, "CIMx - Entering sbBeforePciRestoreInit \n")); RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REG00, AccWidthUint8, 0xFF, 0x1E); pConfig->S3Resume = 1; ValidateFchVariant (pConfig); commonInitEarlyBoot (pConfig); // set /SMBUS/ACPI/IDE/LPC/PCIB abLinkInitBeforePciEnum (pConfig); // Set ABCFG registers usbInitBeforePciEnum (pConfig); // USB POST TIME Only sataInitBeforePciEnum (pConfig); gecInitBeforePciEnum (pConfig); // Init GEC azaliaInitBeforePciEnum (pConfig); // Detect and configure High Definition Audio sbPcieGppEarlyInit (pConfig); // Gpp port init abSpecialSetBeforePciEnum (pConfig); RWMEM (ACPI_MMIO_BASE + PMIO_BASE + SB_PMIOA_REG00, AccWidthUint8, 0xFF, 0x1E); }
VOID sbBeforePciInit ( IN AMDSBCFG* pConfig ) { TRACE ((DMSG_SB_TRACE, "CIMx - Entering sbBeforePciInit \n")); RecordSbConfigPtr ( (UINT32) ((UINTN) (pConfig))); CheckEfuse (pConfig); ValidateFchVariant (pConfig); imcEnableSurebootTimer (pConfig); commonInitEarlyPost (pConfig); commonInitEarlyBoot (pConfig); #ifndef NO_EC_SUPPORT ecInitBeforePciEnum (pConfig); #endif usbInitBeforePciEnum (pConfig); // USB POST TIME Only sataInitBeforePciEnum (pConfig); // Init SATA class code and PHY gecInitBeforePciEnum (pConfig); // Init GEC azaliaInitBeforePciEnum (pConfig); // Detect and configure High Definition Audio sbPcieGppEarlyInit (pConfig); // Gpp port init abSpecialSetBeforePciEnum (pConfig); hwmInit (pConfig); TRACE ((DMSG_SB_TRACE, "CIMx - Exiting sbBeforePciInit \n")); }
/** * @brief SB Cimx entry point sbBeforePciInit wrapper */ static void sb800_enable(device_t dev) { struct southbridge_amd_cimx_wrapper_sb800_config *sb_chip = (struct southbridge_amd_cimx_wrapper_sb800_config *)(dev->chip_info); sb800_cimx_config(sb_config); printk(BIOS_DEBUG, "sb800_enable() "); /* Config SouthBridge SMBUS/ACPI/IDE/LPC/PCIB.*/ commonInitEarlyBoot(sb_config); commonInitEarlyPost(sb_config); switch (dev->path.pci.devfn) { case (0x11 << 3) | 0: /* 0:11.0 SATA */ if (dev->enabled) { sb_config->SATAMODE.SataMode.SataController = CIMX_OPTION_ENABLED; if (1 == sb_chip->boot_switch_sata_ide) sb_config->SATAMODE.SataMode.SataIdeCombMdPriSecOpt = 0; //0 -IDE as primary. else if (0 == sb_chip->boot_switch_sata_ide) sb_config->SATAMODE.SataMode.SataIdeCombMdPriSecOpt = 1; //1 -IDE as secondary. } else { sb_config->SATAMODE.SataMode.SataController = CIMX_OPTION_DISABLED; } sataInitBeforePciEnum(sb_config); // Init SATA class code and PHY break; case (0x12 << 3) | 0: /* 0:12:0 OHCI-USB1 */ case (0x12 << 3) | 2: /* 0:12:2 EHCI-USB1 */ case (0x13 << 3) | 0: /* 0:13:0 OHCI-USB2 */ case (0x13 << 3) | 2: /* 0:13:2 EHCI-USB2 */ case (0x14 << 3) | 5: /* 0:14:5 OHCI-USB4 */ case (0x16 << 3) | 0: /* 0:16:0 OHCI-USB3 */ case (0x16 << 3) | 2: /* 0:16:2 EHCI-USB3 */ usbInitBeforePciEnum(sb_config); // USB POST TIME Only break; case (0x14 << 3) | 0: /* 0:14:0 SMBUS */ { u32 ioapic_base; printk(BIOS_INFO, "sm_init().\n"); ioapic_base = IO_APIC_ADDR; clear_ioapic(ioapic_base); /* I/O APIC IDs are normally limited to 4-bits. Enforce this limit. */ #if (CONFIG_APIC_ID_OFFSET == 0 && CONFIG_MAX_CPUS * CONFIG_MAX_PHYSICAL_CPUS < 16) /* Assign the ioapic ID the next available number after the processor core local APIC IDs */ setup_ioapic(ioapic_base, CONFIG_MAX_CPUS * CONFIG_MAX_PHYSICAL_CPUS); #elif (CONFIG_APIC_ID_OFFSET > 0) /* Assign the ioapic ID the value 0. Processor APIC IDs follow. */ setup_ioapic(ioapic_base, 0); #else #error "The processor APIC IDs must be lifted to make room for the I/O APIC ID" #endif } break; case (0x14 << 3) | 1: /* 0:14:1 IDE */ if (dev->enabled) { sb_config->SATAMODE.SataMode.SataIdeCombinedMode = CIMX_OPTION_ENABLED; } else { sb_config->SATAMODE.SataMode.SataIdeCombinedMode = CIMX_OPTION_DISABLED; } sataInitBeforePciEnum(sb_config); // Init SATA class code and PHY break; case (0x14 << 3) | 2: /* 0:14:2 HDA */ if (dev->enabled) { if (AZALIA_DISABLE == sb_config->AzaliaController) { sb_config->AzaliaController = AZALIA_AUTO; } printk(BIOS_DEBUG, "hda enabled\n"); } else { sb_config->AzaliaController = AZALIA_DISABLE; printk(BIOS_DEBUG, "hda disabled\n"); } azaliaInitBeforePciEnum(sb_config); // Detect and configure High Definition Audio break; case (0x14 << 3) | 3: /* 0:14:3 LPC */ break; case (0x14 << 3) | 4: /* 0:14:4 PCI */ break; case (0x14 << 3) | 6: /* 0:14:6 GEC */ if (dev->enabled) { sb_config->GecConfig = 0; printk(BIOS_DEBUG, "gec enabled\n"); } else { sb_config->GecConfig = 1; printk(BIOS_DEBUG, "gec disabled\n"); } gecInitBeforePciEnum(sb_config); // Init GEC break; case (0x15 << 3) | 0: /* 0:15:0 PCIe PortA */ sb_config->PORTCONFIG[0].PortCfg.PortPresent = dev->enabled; return; case (0x15 << 3) | 1: /* 0:15:1 PCIe PortB */ sb_config->PORTCONFIG[1].PortCfg.PortPresent = dev->enabled; return; case (0x15 << 3) | 2: /* 0:15:2 PCIe PortC */ sb_config->PORTCONFIG[2].PortCfg.PortPresent = dev->enabled; return; case (0x15 << 3) | 3: /* 0:15:3 PCIe PortD */ sb_config->PORTCONFIG[3].PortCfg.PortPresent = dev->enabled; /* * GPP_CFGMODE_X4000: PortA Lanes[3:0] * GPP_CFGMODE_X2200: PortA Lanes[1:0], PortB Lanes[3:2] * GPP_CFGMODE_X2110: PortA Lanes[1:0], PortB Lane2, PortC Lane3 * GPP_CFGMODE_X1111: PortA Lanes0, PortB Lane1, PortC Lane2, PortD Lane3 */ if (sb_config->GppLinkConfig != sb_chip->gpp_configuration) { sb_config->GppLinkConfig = sb_chip->gpp_configuration; } sbPcieGppEarlyInit(sb_config); break; default: break; } /* Special setting ABCFG registers before PCI emulation. */ abSpecialSetBeforePciEnum(sb_config); usbDesertPll(sb_config); //sb_config->StdHeader.Func = SB_BEFORE_PCI_INIT; //AmdSbDispatcher(sb_config); }