VirtualBox

Ignore:
Timestamp:
Oct 28, 2015 8:17:18 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103761
Message:

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/8254TimerDxe/8254Timer.inf

    r48674 r58459  
    11## @file
    2 #
    3 # Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
     2# 8254 timer driver that provides Timer Arch protocol.
     3#
     4# Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
    45# This program and the accompanying materials                         
    56# are licensed and made available under the terms and conditions of the BSD License         
     
    1516  INF_VERSION                    = 0x00010005
    1617  BASE_NAME                      = Timer
     18  MODULE_UNI_FILE                = Timer.uni
    1719  FILE_GUID                      = f2765dec-6b41-11d5-8e71-00902707b35e
    1820  MODULE_TYPE                    = DXE_DRIVER
     
    3739
    3840[Protocols]
    39   gEfiCpuArchProtocolGuid
    40   gEfiLegacy8259ProtocolGuid
    41   gEfiTimerArchProtocolGuid
     41  gEfiCpuArchProtocolGuid       ## CONSUMES
     42  gEfiLegacy8259ProtocolGuid    ## CONSUMES
     43  gEfiTimerArchProtocolGuid     ## PRODUCES
    4244
    4345[Depex]
    4446  gEfiCpuArchProtocolGuid AND gEfiLegacy8259ProtocolGuid
     47[UserExtensions.TianoCore."ExtraFiles"]
     48  TimerExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/8254TimerDxe/Timer.c

    r48674 r58459  
    22  Timer Architectural Protocol as defined in the DXE CIS
    33
    4 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials                         
    66are licensed and made available under the terms and conditions of the BSD License         
     
    220220    if (TimerCount >= 65536) {
    221221      TimerCount = 0;
    222       if (TimerPeriod >= DEFAULT_TIMER_TICK_DURATION) {
    223         TimerPeriod = DEFAULT_TIMER_TICK_DURATION;
    224       }
     222      TimerPeriod = MAX_TIMER_TICK_DURATION;
    225223    }
    226224    //
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/8254TimerDxe/Timer.h

    r48674 r58459  
    22  Private data structures
    33
    4 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials                         
    66are licensed and made available under the terms and conditions of the BSD License         
     
    3434// ---------------- * 1,000,000 uS/S = 54925.4 uS = 549254 * 100 ns
    3535//   1,193,182 Hz
     36//
     37
     38//
     39// The maximum tick duration for 8254 timer
     40//
     41#define MAX_TIMER_TICK_DURATION     549254
    3642//
    3743// The default timer tick duration is set to 10 ms = 100000 100 ns units
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/8259InterruptControllerDxe/8259.c

    r48674 r58459  
    22  This contains the installation function for the driver.
    33
    4 Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    124124  )
    125125{
    126   UINT8 Mask;
    127 
     126  UINT8   Mask;
     127  EFI_TPL OriginalTpl;
     128
     129  OriginalTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
    128130  //
    129131  // Set vector base for slave PIC
     
    212214  IoWrite8 (LEGACY_8259_CONTROL_REGISTER_SLAVE, LEGACY_8259_EOI);
    213215  IoWrite8 (LEGACY_8259_CONTROL_REGISTER_MASTER, LEGACY_8259_EOI);
     216 
     217  gBS->RestoreTPL (OriginalTpl);
    214218
    215219  return EFI_SUCCESS;
     
    414418  )
    415419{
    416   if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {
     420  if ((UINT32)Irq > Efi8259Irq15) {
    417421    return EFI_INVALID_PARAMETER;
    418422  }
     
    446450  )
    447451{
    448   if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {
     452  if ((UINT32)Irq > Efi8259Irq15) {
    449453    return EFI_INVALID_PARAMETER;
    450454  }
     
    479483  )
    480484{
    481   if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {
     485  if ((UINT32)Irq > Efi8259Irq15) {
    482486    return EFI_INVALID_PARAMETER;
    483487  }
     
    556560  )
    557561{
    558   if (Irq < Efi8259Irq0 || Irq > Efi8259Irq15) {
     562  if ((UINT32)Irq > Efi8259Irq15) {
    559563    return EFI_INVALID_PARAMETER;
    560564  }
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf

    r48674 r58459  
    11## @file
    2 # 8259 Interrupt Controller driver
     2# 8259 Interrupt Controller driver that provides Legacy 8259 protocol.
    33#
    4 # Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
     4# Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
    55# This program and the accompanying materials                         
    66# are licensed and made available under the terms and conditions of the BSD License         
     
    1616  INF_VERSION                    = 0x00010005
    1717  BASE_NAME                      = Legacy8259
     18  MODULE_UNI_FILE                = Legacy8259.uni
    1819  FILE_GUID                      = 79CA4208-BBA1-4a9a-8456-E1E66A81484E
    1920  MODULE_TYPE                    = DXE_DRIVER
     
    3839 
    3940[Protocols]
    40   gEfiLegacy8259ProtocolGuid                    # PROTOCOL ALWAYS_PRODUCED
    41   gEfiPciIoProtocolGuid
     41  gEfiLegacy8259ProtocolGuid                    ## PRODUCES
     42  gEfiPciIoProtocolGuid                         ## SOMETIMES_CONSUMES
    4243
    4344[Pcd]
    44   gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeMask
    45   gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel
     45  gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeMask      ## CONSUMES
     46  gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel ## CONSUMES
    4647 
    4748[Depex]
    4849  TRUE
    4950
     51[UserExtensions.TianoCore."ExtraFiles"]
     52  Legacy8259Extra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/Bus/Pci/IdeControllerDxe/IdeControllerDxe.inf

    r48674 r58459  
    11## @file
    2 #  
    3 #    Component description file for the IDE Controller Init module.
     2# IDE Controller Init driver that provide IDE_CONTROLLER_INIT protocol and will be used by
     3# IDE Bus driver to support platform dependent timing information.
    44#
    5 #  Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
    6 #  This program and the accompanying materials
    7 #  are licensed and made available under the terms and conditions of the BSD License
    8 #  which accompanies this distribution.  The full text of the license may be found at
    9 #  http://opensource.org/licenses/bsd-license.php
    10 # 
    11 #  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    13 # 
     5# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
     6# This program and the accompanying materials
     7# are licensed and made available under the terms and conditions of the BSD License
     8# which accompanies this distribution.  The full text of the license may be found at
     9# http://opensource.org/licenses/bsd-license.php
     10#
     11# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     12# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     13#
    1414##
    1515
     
    1717  INF_VERSION                    = 0x00010005
    1818  BASE_NAME                      = IdeController
     19  MODULE_UNI_FILE                = IdeController.uni
    1920  FILE_GUID                      = 99549F44-49BB-4820-B9D2-901329412D67
    2021  MODULE_TYPE                    = UEFI_DRIVER
     
    4647
    4748[Protocols]
    48   gEfiPciIoProtocolGuid 
    49   gEfiIdeControllerInitProtocolGuid
     49  gEfiPciIoProtocolGuid             ## BY_START
     50  gEfiIdeControllerInitProtocolGuid ## TO_START
     51[UserExtensions.TianoCore."ExtraFiles"]
     52  IdeControllerExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/HpetTimerDxe/HpetTimer.c

    r48674 r58459  
    22  Timer Architectural Protocol module using High Precesion Event Timer (HPET)
    33
    4   Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
    55  This program and the accompanying materials
    66  are licensed and made available under the terms and conditions of the BSD License
     
    595595      //
    596596      IoApicConfigureInterrupt (mTimerIrq, PcdGet8 (PcdHpetLocalApicVector), IO_APIC_DELIVERY_MODE_LOWEST_PRIORITY, TRUE, FALSE);
     597      IoApicEnableInterrupt (mTimerIrq, TRUE);
    597598    }
    598599
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf

    r48674 r58459  
    11## @file
    2 #
    3 # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
     2# Timer Architectural Protocol module using High Precesion Event Timer (HPET).
     3#
     4# Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
    45# This program and the accompanying materials                         
    56# are licensed and made available under the terms and conditions of the BSD License         
     
    1516  INF_VERSION                    = 0x00010005
    1617  BASE_NAME                      = HpetTimerDxe
     18  MODULE_UNI_FILE                = HpetTimerDxe.uni
    1719  FILE_GUID                      = 6CE6B0DE-781C-4f6c-B42D-98346C614BEC
    1820  MODULE_TYPE                    = DXE_DRIVER
     
    4648
    4749[Protocols]
    48   gEfiTimerArchProtocolGuid                     # PROTOCOL ALWAYS_PRODUCED
    49   gEfiCpuArchProtocolGuid                       # PROTOCOL ALWAYS_CONSUMED
     50  gEfiTimerArchProtocolGuid                     ## PRODUCES
     51  gEfiCpuArchProtocolGuid                       ## CONSUMES
    5052
    5153[FeaturePcd]
    52   gPcAtChipsetPkgTokenSpaceGuid.PcdHpetMsiEnable
    53  
     54  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetMsiEnable    ## CONSUMES
     55
    5456[Pcd]
    55   gPcAtChipsetPkgTokenSpaceGuid.PcdHpetBaseAddress
    56   gPcAtChipsetPkgTokenSpaceGuid.PcdHpetLocalApicVector
    57   gPcAtChipsetPkgTokenSpaceGuid.PcdHpetDefaultTimerPeriod
     57  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetBaseAddress          ## CONSUMES
     58  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetLocalApicVector      ## CONSUMES
     59  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetDefaultTimerPeriod   ## CONSUMES
    5860
    5961[Depex]
    6062  gEfiCpuArchProtocolGuid
     63[UserExtensions.TianoCore."ExtraFiles"]
     64  HpetTimerDxeExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.c

    r48674 r58459  
    22  ISA ACPI Protocol Implementation
    33
    4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials                         
    66are licensed and made available under the terms and conditions of the BSD License         
     
    102102// Table of ISA Controllers
    103103//
    104 EFI_ISA_ACPI_RESOURCE_LIST gPcatIsaAcpiDeviceList[7] = {0};
     104EFI_ISA_ACPI_RESOURCE_LIST gPcatIsaAcpiDeviceList[7] = {{{0, 0}, NULL}};
    105105
    106106/**
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf

    r48674 r58459  
    11## @file
    2 #   Component description file for PCAT ISA ACPI driver
     2# IsaAcpi driver to install EFI_ISA_ACPI_PROTOCOL.
    33#
    4 # Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
    5 # This program and the accompanying materials                         
    6 # are licensed and made available under the terms and conditions of the BSD License         
    7 # which accompanies this distribution.  The full text of the license may be found at       
    8 # http://opensource.org/licenses/bsd-license.php                                           
    9 #                                                                                           
    10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
    11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
     4# Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
     5# This program and the accompanying materials
     6# are licensed and made available under the terms and conditions of the BSD License
     7# which accompanies this distribution.  The full text of the license may be found at
     8# http://opensource.org/licenses/bsd-license.php
     9#
     10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1212#
    1313#
     
    1717  INF_VERSION                    = 0x00010005
    1818  BASE_NAME                      = IsaAcpi
     19  MODULE_UNI_FILE                = IsaAcpi.uni
    1920  FILE_GUID                      = 38A0EC22-FBE7-4911-8BC1-176E0D6C1DBD
    2021  MODULE_TYPE                    = UEFI_DRIVER
     
    3435  BaseMemoryLib
    3536  PcdLib
    36  
     37
    3738[Sources]
    3839  PcatIsaAcpi.h
     
    4243
    4344[Protocols]
    44   gEfiPciIoProtocolGuid
    45   gEfiIsaAcpiProtocolGuid
     45  gEfiPciIoProtocolGuid     ## TO_START
     46  gEfiIsaAcpiProtocolGuid   ## BY_START
    4647
    4748[Pcd]
    48   gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom1Enable
    49   gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom2Enable
    50   gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2KeyboardEnable
    51   gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2MouseEnable
    52   gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyAEnable
    53   gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyBEnable
     49  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom1Enable        ## SOMETIMES_CONSUMES
     50  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom2Enable        ## SOMETIMES_CONSUMES
     51  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2KeyboardEnable ## SOMETIMES_CONSUMES
     52  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2MouseEnable    ## SOMETIMES_CONSUMES
     53  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyAEnable     ## SOMETIMES_CONSUMES
     54  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyBEnable     ## SOMETIMES_CONSUMES
     55[UserExtensions.TianoCore."ExtraFiles"]
     56  IsaAcpiExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c

    r48674 r58459  
    22  EFI PCAT ISA ACPI Driver for a Generic PC Platform
    33
    4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    207207  }
    208208
    209   Supports &= (EFI_PCI_IO_ATTRIBUTE_ISA_IO | EFI_PCI_IO_ATTRIBUTE_ISA_IO_16);
     209  Supports &= (UINT64) (EFI_PCI_IO_ATTRIBUTE_ISA_IO | EFI_PCI_IO_ATTRIBUTE_ISA_IO_16);
    210210  if (Supports == 0 || Supports == (EFI_PCI_IO_ATTRIBUTE_ISA_IO | EFI_PCI_IO_ATTRIBUTE_ISA_IO_16)) {
    211211    Status = EFI_UNSUPPORTED;
     
    357357  }
    358358
    359   Supports &= (EFI_PCI_IO_ATTRIBUTE_ISA_IO | EFI_PCI_IO_ATTRIBUTE_ISA_IO_16);
     359  Supports &= (UINT64) (EFI_PCI_IO_ATTRIBUTE_ISA_IO | EFI_PCI_IO_ATTRIBUTE_ISA_IO_16);
    360360
    361361  PcatIsaAcpiDev->PciIo->Attributes (
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/KbcResetDxe/Reset.inf

    r48674 r58459  
    11## @file
    2 #
    3 # Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     2# This driver implements Reset Architectural Protocol.
     3#
     4# It should depend on the ResetSystemLib instance that is implemented based on KBC.
     5#
     6# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    47# This program and the accompanying materials                         
    58# are licensed and made available under the terms and conditions of the BSD License         
     
    1922  INF_VERSION                    = 0x00010005
    2023  BASE_NAME                      = KbcReset
     24  MODULE_UNI_FILE                = KbcReset.uni
    2125  FILE_GUID                      = 6F0198AA-1F1D-426D-AE3E-39AB633FCC28
    2226  MODULE_TYPE                    = DXE_RUNTIME_DRIVER
     
    3842
    3943[Protocols]
    40   gEfiResetArchProtocolGuid
     44  gEfiResetArchProtocolGuid ## PRODUCES
    4145
    4246[Depex]
    4347  TRUE
     48
     49[UserExtensions.TianoCore."ExtraFiles"]
     50  KbcResetExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf

    r48674 r58459  
    11## @file
    2  Library instance for I/O APIC library class
     2Library instance for I/O APIC library class
    33#
    4 #  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
     
    1616  INF_VERSION                    = 0x00010005
    1717  BASE_NAME                      = BaseIoApicLib
     18  MODULE_UNI_FILE                = BaseIoApicLib.uni
    1819  FILE_GUID                      = 58ED6E5A-E36A-462a-9ED6-6E62C9A26DF8
    1920  MODULE_TYPE                    = BASE
     
    3637
    3738[Pcd]
    38   gPcAtChipsetPkgTokenSpaceGuid.PcdIoApicBaseAddress
     39  gPcAtChipsetPkgTokenSpaceGuid.PcdIoApicBaseAddress    ## CONSUMES
     40
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf

    r48674 r58459  
    11## @file
    2 #   Library instance for ResetSystem library class fort PCAT systems
     2#   Library instance for ResetSystem library class for PCAT systems
    33#
    4 #  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
     
    1616  INF_VERSION                    = 0x00010005
    1717  BASE_NAME                      = ResetSystemLib
     18  MODULE_UNI_FILE                = ResetSystemLib.uni
    1819  FILE_GUID                      = EC4F3E59-F879-418b-9E4C-7D6F434714A0
    1920  MODULE_TYPE                    = BASE
    2021  VERSION_STRING                 = 1.0
    21   LIBRARY_CLASS                  = ResetSystemLib 
     22  LIBRARY_CLASS                  = ResetSystemLib
    2223
    2324#
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf

    r48674 r58459  
    22#   Library instance for SerialIo library class
    33#
    4 #  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
     
    1616  INF_VERSION                    = 0x00010005
    1717  BASE_NAME                      = PcAtSerialPortLib
     18  MODULE_UNI_FILE                = PcAtSerialPortLib.uni
    1819  FILE_GUID                      = 1B25AF84-1EA8-4b52-894E-BFA6880B97FF
    1920  MODULE_TYPE                    = BASE
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PcAtChipsetPkg.dec

    r48674 r58459  
    55# PcAt defacto standard.
    66#
    7 # Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
     7# Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
    88#
    99# This program and the accompanying materials
     
    2020  DEC_SPECIFICATION              = 0x00010005
    2121  PACKAGE_NAME                   = PcAtChipsetPkg
     22  PACKAGE_UNI_FILE               = PcAtChipsetPkg.uni
    2223  PACKAGE_GUID                   = B728689A-52D3-4b8c-AE89-2CE5514CC6DC
    23   PACKAGE_VERSION                = 0.2
     24  PACKAGE_VERSION                = 0.3
    2425
    2526[Includes]
     
    3536
    3637[PcdsFeatureFlag]
    37   ## If TRUE, then the HPET Timer will be configured to use MSI interrupts if the HPET timer supports them.
    38   #  If FALSE, then the HPET Timer will be configued to use I/O APIC interrupts.
     38  ## Indicates the HPET Timer will be configured to use MSI interrupts if the HPET timer supports them, or use I/O APIC interrupts.<BR><BR>
     39  #   TRUE  - Configures the HPET Timer to use MSI interrupts if the HPET Timer supports them.<BR>
     40  #   FALSE - Configures the HPET Timer to use I/O APIC interrupts.<BR>
     41  # @Prompt Configure HPET to use MSI.
    3942  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetMsiEnable|TRUE|BOOLEAN|0x00001000
    40  
     43
    4144[PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule]
    42   ## Pcd8259LegacyModeMask defines the default mask value for platform. This value is determined
     45  ## Pcd8259LegacyModeMask defines the default mask value for platform. This value is determined<BR><BR>
    4346  #  1) If platform only support pure UEFI, value should be set to 0xFFFF or 0xFFFE;
    44   #     Because only clock interrupt is allowed in legacy mode in pure UEFI platform.
    45   #  2) If platform install CSM and use thunk module:
     47  #     Because only clock interrupt is allowed in legacy mode in pure UEFI platform.<BR>
     48  #  2) If platform install CSM and use thunk module:<BR>
    4649  #     a) If thunk call provided by CSM binary requires some legacy interrupt support, the corresponding bit
    47   #        should be opened as 0.
    48   #        For example, if keyboard interfaces provided CSM binary use legacy keyboard interrupt in 8259 bit 2, then
    49   #        the value should be set to 0xFFFC
     50  #        should be opened as 0.<BR>
     51  #        For example, if keyboard interfaces provided CSM binary use legacy keyboard interrupt in 8259 bit 1, then
     52  #        the value should be set to 0xFFFC.<BR>
    5053  #     b) If all thunk call provied by CSM binary do not require legacy interrupt support, value should be set
    51   #        to 0xFFFF or 0xFFFE.
     54  #        to 0xFFFF or 0xFFFE.<BR>
    5255  #
    5356  #  The default value of legacy mode mask could be changed by EFI_LEGACY_8259_PROTOCOL->SetMask(). But it is rarely
    5457  #  need change it except some special cases such as when initializing the CSM binary, it should be set to 0xFFFF to
    55   #  mask all legacy interrupt. Please restore the original legacy mask value if changing is made for these special case.
    56   #
     58  #  mask all legacy interrupt. Please restore the original legacy mask value if changing is made for these special case.<BR>
     59  # @Prompt 8259 Legacy Mode mask.
    5760  gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeMask|0xFFFF|UINT16|0x00000001
    5861 
    5962  ## Pcd8259LegacyModeEdgeLevel defines the default edge level for legacy mode's interrrupt controller.
     63  #  For the corresponding bits, 0 = Edge triggered and 1 = Level triggered.
     64  # @Prompt 8259 Legacy Mode edge level.
    6065  gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0000|UINT16|0x00000002
    6166
    62   ## This PCD specifies whether we need enable IsaAcpiCom1 device.
     67  ## Indicates if we need enable IsaAcpiCom1 device.<BR><BR>
     68  #   TRUE  - Enables IsaAcpiCom1 device.<BR>
     69  #   FALSE - Doesn't enable IsaAcpiCom1 device.<BR>
     70  # @Prompt Enable IsaAcpiCom1 device.
    6371  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom1Enable|TRUE|BOOLEAN|0x00000003
    6472
    65   ## This PCD specifies whether we need enable IsaAcpiCom2 device.
     73  ## Indicates if we need enable IsaAcpiCom2 device.<BR><BR>
     74  #   TRUE  - Enables IsaAcpiCom2 device.<BR>
     75  #   FALSE - Doesn't enable IsaAcpiCom2 device.<BR>
     76  # @Prompt Enable IsaAcpiCom12 device.
    6677  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom2Enable|TRUE|BOOLEAN|0x00000004
    6778
    68   ## This PCD specifies whether we need enable IsaAcpiPs2Keyboard device.
     79  ## Indicates if we need enable IsaAcpiPs2Keyboard device.<BR><BR>
     80  #   TRUE  - Enables IsaAcpiPs2Keyboard device.<BR>
     81  #   FALSE - Doesn't enable IsaAcpiPs2Keyboard device.<BR>
     82  # @Prompt Enable IsaAcpiPs2Keyboard device.
    6983  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2KeyboardEnable|TRUE|BOOLEAN|0x00000005
    7084
    71   ## This PCD specifies whether we need enable IsaAcpiPs2Mouse device.
     85  ## Indicates if we need enable IsaAcpiPs2Mouse device.<BR><BR>
     86  #   TRUE  - Enables IsaAcpiPs2Mouse device.<BR>
     87  #   FALSE - Doesn't enable IsaAcpiPs2Mouse device.<BR>
     88  # @Prompt Enable IsaAcpiPs2Mouse device.
    7289  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2MouseEnable|TRUE|BOOLEAN|0x00000006
    7390
    74   ## This PCD specifies whether we need enable IsaAcpiFloppyA device.
     91  ## Indicates if we need enable IsaAcpiFloppyA device.<BR><BR>
     92  #   TRUE  - Enables IsaAcpiFloppyA device.<BR>
     93  #   FALSE - Doesn't enable IsaAcpiFloppyA device.<BR>
     94  # @Prompt Enable IsaAcpiFloppyA device.
    7595  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyAEnable|TRUE|BOOLEAN|0x00000007
    7696
    77   ## This PCD specifies whether we need enable IsaAcpiFloppyB device.
     97  ## Indicates if we need enable IsaAcpiFloppyB device.<BR><BR>
     98  #   TRUE  - Enables IsaAcpiFloppyB device.<BR>
     99  #   FALSE - Doesn't enable IsaAcpiFloppyB device.<BR>
     100  # @Prompt Enable IsaAcpiFloppyB device.
    78101  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyBEnable|TRUE|BOOLEAN|0x00000008
    79102
    80103  ## This PCD specifies the base address of the HPET timer.
     104  # @Prompt HPET base address.
    81105  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetBaseAddress|0xFED00000|UINT32|0x00000009
    82106
    83107  ## This PCD specifies the Local APIC Interrupt Vector for the HPET Timer.
     108  # @Prompt HPET local APIC vector.
    84109  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetLocalApicVector|0x40|UINT8|0x0000000A
    85110
    86111  ## This PCD specifies the defaut period of the HPET Timer in 100 ns units.
    87112  #  The default value of 100000 100 ns units is the same as 10 ms.
     113  # @Prompt Default period of HPET timer.
    88114  gPcAtChipsetPkgTokenSpaceGuid.PcdHpetDefaultTimerPeriod|100000|UINT64|0x0000000B
    89115 
    90   ## This PCD specifies the base address of the HPET timer.
     116  ## This PCD specifies the base address of the IO APIC.
     117  # @Prompt IO APIC base address.
    91118  gPcAtChipsetPkgTokenSpaceGuid.PcdIoApicBaseAddress|0xFEC00000|UINT32|0x0000000C
     119
     120  ## This PCD specifies the minimal valid year in RTC.
     121  # @Prompt Minimal valid year in RTC.
     122  gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|1998|UINT16|0x0000000D
     123
     124  ## This PCD specifies the maximal valid year in RTC.
     125  # @Prompt Maximal valid year in RTC.
     126  gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear|2099|UINT16|0x0000000E
    92127 
     128[PcdsFixedAtBuild, PcdsPatchableInModule]
     129  ## Defines the ACPI register set base address.
     130  #  The invalid 0xFFFF is as its default value. It must be configured to the real value.
     131  # @Prompt ACPI Timer IO Port Address
     132  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddress         |0xFFFF|UINT16|0x00000010
     133
     134  ## Defines the PCI Bus Number of the PCI device that contains the BAR and Enable for ACPI hardware registers.
     135  # @Prompt ACPI Hardware PCI Bus Number
     136  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBusNumber            |  0x00| UINT8|0x00000011
     137
     138  ## Defines the PCI Device Number of the PCI device that contains the BAR and Enable for ACPI hardware registers.
     139  #  The invalid 0xFF is as its default value. It must be configured to the real value.
     140  # @Prompt ACPI Hardware PCI Device Number
     141  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciDeviceNumber         |  0xFF| UINT8|0x00000012
     142
     143  ## Defines the PCI Function Number of the PCI device that contains the BAR and Enable for ACPI hardware registers.
     144  #  The invalid 0xFF is as its default value. It must be configured to the real value.
     145  # @Prompt ACPI Hardware PCI Function Number
     146  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciFunctionNumber       |  0xFF| UINT8|0x00000013
     147 
     148  ## Defines the PCI Register Offset of the PCI device that contains the Enable for ACPI hardware registers.
     149  #  The invalid 0xFFFF is as its default value. It must be configured to the real value.
     150  # @Prompt ACPI Hardware PCI Register Offset
     151  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciEnableRegisterOffset |0xFFFF|UINT16|0x00000014
     152 
     153  ## Defines the bit mask that must be set to enable the APIC hardware register BAR.
     154  # @Prompt ACPI Hardware PCI Bar Enable BitMask
     155  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoBarEnableMask           |  0x00| UINT8|0x00000015
     156 
     157  ## Defines the PCI Register Offset of the PCI device that contains the BAR for ACPI hardware registers.
     158  #  The invalid 0xFFFF is as its default value. It must be configured to the real value.
     159  # @Prompt ACPI Hardware PCI Bar Register Offset
     160  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBarRegisterOffset    |0xFFFF|UINT16|0x00000016
     161
     162  ## Defines the offset to the 32-bit Timer Value register that resides within the ACPI BAR.
     163  # @Prompt Offset to 32-bit Timer register in ACPI BAR
     164  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiPm1TmrOffset              |0x0008|UINT16|0x00000017
     165
     166  ## Defines the bit mask to retrieve ACPI IO Port Base Address
     167  # @Prompt ACPI IO Port Base Address Mask
     168  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask     |0xFFFE|UINT16|0x00000018
     169
     170[UserExtensions.TianoCore."ExtraFiles"]
     171  PcAtChipsetPkgExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PcAtChipsetPkg.dsc

    r48674 r58459  
    22#  PC/AT Chipset Package
    33#
    4 #  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
    55#
    66#  This program and the accompanying materials
     
    1717  PLATFORM_NAME                  = PcAtChipset
    1818  PLATFORM_GUID                  = a653167b-34d7-4b91-bfe3-f0c7608f48da
    19   PLATFORM_VERSION               = 0.2
     19  PLATFORM_VERSION               = 0.3
    2020  DSC_SPECIFICATION              = 0x00010005
    2121  OUTPUT_DIRECTORY               = Build/PcAtChipset
     
    3333  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
    3434  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
    35   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
     35  TimerLib|PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
    3636  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
    3737  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
     
    4646  IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf
    4747  LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf
     48  ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
    4849
    4950[Components]
     
    5657  PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf
    5758  PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf
     59  PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
     60  PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
    5861  PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf
    5962  PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c

    r48674 r58459  
    22  RTC Architectural Protocol GUID as defined in DxeCis 0.96.
    33
    4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials
    66are licensed and made available under the terms and conditions of the BSD License
     
    105105  UINTN           DataSize;
    106106  UINT32          TimerVar;
     107  BOOLEAN         Enabled;
     108  BOOLEAN         Pending;
    107109
    108110  //
     
    205207  }
    206208  if (EFI_ERROR (Status)) {
     209    //
     210    // Report Status Code to indicate that the RTC has bad date and time
     211    //
     212    REPORT_STATUS_CODE (
     213      EFI_ERROR_CODE | EFI_ERROR_MINOR,
     214      (EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_BAD_DATE_TIME)
     215      );
    207216    Time.Second = RTC_INIT_SECOND;
    208217    Time.Minute = RTC_INIT_MINUTE;
     
    220229  //
    221230  Status = PcRtcSetTime (&Time, Global);
    222   if(!EFI_ERROR (Status)) {
     231  if (EFI_ERROR (Status)) {
     232    return EFI_DEVICE_ERROR;
     233  }
     234 
     235  //
     236  // Reset wakeup time value to valid state when wakeup alarm is disabled and wakeup time is invalid.
     237  // Global variable has already had valid SavedTimeZone and Daylight,
     238  // so we can use them to get and set wakeup time.
     239  //
     240  Status = PcRtcGetWakeupTime (&Enabled, &Pending, &Time, Global);
     241  if ((Enabled) || (!EFI_ERROR (Status))) {
    223242    return EFI_SUCCESS;
    224   } else {
     243  }
     244 
     245  //
     246  // When wakeup time is disabled and invalid, reset wakeup time register to valid state
     247  // but keep wakeup alarm disabled.
     248  //
     249  Time.Second = RTC_INIT_SECOND;
     250  Time.Minute = RTC_INIT_MINUTE;
     251  Time.Hour   = RTC_INIT_HOUR;
     252  Time.Day    = RTC_INIT_DAY;
     253  Time.Month  = RTC_INIT_MONTH;
     254  Time.Year   = RTC_INIT_YEAR;
     255  Time.Nanosecond  = 0;
     256  Time.TimeZone = Global->SavedTimeZone;
     257  Time.Daylight = Global->Daylight;;
     258
     259  //
     260  // Acquire RTC Lock to make access to RTC atomic
     261  //
     262  if (!EfiAtRuntime ()) {
     263    EfiAcquireLock (&Global->RtcLock);
     264  }
     265  //
     266  // Wait for up to 0.1 seconds for the RTC to be updated
     267  //
     268  Status = RtcWaitToUpdate (PcdGet32 (PcdRealTimeClockUpdateTimeout));
     269  if (EFI_ERROR (Status)) {
     270    if (!EfiAtRuntime ()) {
     271    EfiReleaseLock (&Global->RtcLock);
     272    }
    225273    return EFI_DEVICE_ERROR;
    226274  }
     275 
     276  ConvertEfiTimeToRtcTime (&Time, RegisterB, &Century);
     277
     278  //
     279  // Set the Y/M/D info to variable as it has no corresponding hw registers.
     280  //
     281  Status =  EfiSetVariable (
     282              L"RTCALARM",
     283              &gEfiCallerIdGuid,
     284              EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
     285              sizeof (Time),
     286              &Time
     287              );
     288  if (EFI_ERROR (Status)) {
     289    if (!EfiAtRuntime ()) {
     290      EfiReleaseLock (&Global->RtcLock);
     291    }
     292    return EFI_DEVICE_ERROR;
     293  }
     294 
     295  //
     296  // Inhibit updates of the RTC
     297  //
     298  RegisterB.Bits.Set  = 1;
     299  RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
     300 
     301  //
     302  // Set RTC alarm time registers
     303  //
     304  RtcWrite (RTC_ADDRESS_SECONDS_ALARM, Time.Second);
     305  RtcWrite (RTC_ADDRESS_MINUTES_ALARM, Time.Minute);
     306  RtcWrite (RTC_ADDRESS_HOURS_ALARM, Time.Hour);
     307
     308  //
     309  // Allow updates of the RTC registers
     310  //
     311  RegisterB.Bits.Set = 0;
     312  RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
     313 
     314  //
     315  // Release RTC Lock.
     316  //
     317  if (!EfiAtRuntime ()) {
     318    EfiReleaseLock (&Global->RtcLock);
     319  }
     320  return EFI_SUCCESS;
    227321}
    228322
     
    386480    return Status;
    387481  }
    388   //
    389   // Read Register B, and inhibit updates of the RTC
    390   //
    391   RegisterB.Data      = RtcRead (RTC_ADDRESS_REGISTER_B);
    392   RegisterB.Bits.Set  = 1;
    393   RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
    394 
    395   ConvertEfiTimeToRtcTime (&RtcTime, RegisterB, &Century);
    396 
    397   RtcWrite (RTC_ADDRESS_SECONDS, RtcTime.Second);
    398   RtcWrite (RTC_ADDRESS_MINUTES, RtcTime.Minute);
    399   RtcWrite (RTC_ADDRESS_HOURS, RtcTime.Hour);
    400   RtcWrite (RTC_ADDRESS_DAY_OF_THE_MONTH, RtcTime.Day);
    401   RtcWrite (RTC_ADDRESS_MONTH, RtcTime.Month);
    402   RtcWrite (RTC_ADDRESS_YEAR, (UINT8) RtcTime.Year);
    403   RtcWrite (RTC_ADDRESS_CENTURY, Century);
    404 
    405   //
    406   // Allow updates of the RTC registers
    407   //
    408   RegisterB.Bits.Set = 0;
    409   RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
    410 
    411   //
    412   // Release RTC Lock.
    413   //
    414   if (!EfiAtRuntime ()) {
    415     EfiReleaseLock (&Global->RtcLock);
    416   }
    417   //
    418   // Set the variable that contains the TimeZone and Daylight fields
    419   //
    420   Global->SavedTimeZone = Time->TimeZone;
    421   Global->Daylight      = Time->Daylight;
    422 
     482 
     483  //
     484  // Write timezone and daylight to RTC variable
     485  //
    423486  TimerVar = Time->Daylight;
    424487  TimerVar = (UINT32) ((TimerVar << 16) | (UINT16)(Time->TimeZone));
     
    430493              &TimerVar
    431494              );
    432   ASSERT_EFI_ERROR (Status);
     495  if (EFI_ERROR (Status)) {
     496    if (!EfiAtRuntime ()) {
     497      EfiReleaseLock (&Global->RtcLock);
     498    }
     499    return EFI_DEVICE_ERROR;
     500  }
     501
     502  //
     503  // Read Register B, and inhibit updates of the RTC
     504  //
     505  RegisterB.Data      = RtcRead (RTC_ADDRESS_REGISTER_B);
     506  RegisterB.Bits.Set  = 1;
     507  RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
     508
     509  ConvertEfiTimeToRtcTime (&RtcTime, RegisterB, &Century);
     510
     511  RtcWrite (RTC_ADDRESS_SECONDS, RtcTime.Second);
     512  RtcWrite (RTC_ADDRESS_MINUTES, RtcTime.Minute);
     513  RtcWrite (RTC_ADDRESS_HOURS, RtcTime.Hour);
     514  RtcWrite (RTC_ADDRESS_DAY_OF_THE_MONTH, RtcTime.Day);
     515  RtcWrite (RTC_ADDRESS_MONTH, RtcTime.Month);
     516  RtcWrite (RTC_ADDRESS_YEAR, (UINT8) RtcTime.Year);
     517  RtcWrite (RTC_ADDRESS_CENTURY, Century);
     518
     519  //
     520  // Allow updates of the RTC registers
     521  //
     522  RegisterB.Bits.Set = 0;
     523  RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
     524
     525  //
     526  // Release RTC Lock.
     527  //
     528  if (!EfiAtRuntime ()) {
     529    EfiReleaseLock (&Global->RtcLock);
     530  }
     531  //
     532  // Set the variable that contains the TimeZone and Daylight fields
     533  //
     534  Global->SavedTimeZone = Time->TimeZone;
     535  Global->Daylight      = Time->Daylight;
    433536
    434537  return EFI_SUCCESS;
     
    515618  // Get the alarm info from variable
    516619  //
     620  DataSize = sizeof (EFI_TIME);
    517621  Status = EfiGetVariable (
    518622              L"RTCALARM",
     
    628732  }
    629733  //
    630   // Read Register B, and inhibit updates of the RTC
    631   //
    632   RegisterB.Data      = RtcRead (RTC_ADDRESS_REGISTER_B);
    633 
    634   RegisterB.Bits.Set  = 1;
    635   RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
     734  // Read Register B
     735  //
     736  RegisterB.Data = RtcRead (RTC_ADDRESS_REGISTER_B);
    636737
    637738  if (Enable) {
    638739    ConvertEfiTimeToRtcTime (&RtcTime, RegisterB, &Century);
    639 
    640     //
    641     // Set RTC alarm time
    642     //
    643     RtcWrite (RTC_ADDRESS_SECONDS_ALARM, RtcTime.Second);
    644     RtcWrite (RTC_ADDRESS_MINUTES_ALARM, RtcTime.Minute);
    645     RtcWrite (RTC_ADDRESS_HOURS_ALARM, RtcTime.Hour);
    646 
    647     RegisterB.Bits.Aie = 1;
    648 
    649740  } else {
    650     RegisterB.Bits.Aie = 0;
    651741    //
    652742    // if the alarm is disable, record the current setting.
     
    661751    RtcTime.Daylight = Global->Daylight;
    662752  }
    663   //
    664   // Allow updates of the RTC registers
    665   //
    666   RegisterB.Bits.Set = 0;
    667   RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
    668753
    669754  //
     
    678763              );
    679764  if (EFI_ERROR (Status)) {
     765    if (!EfiAtRuntime ()) {
     766      EfiReleaseLock (&Global->RtcLock);
     767    }
    680768    return EFI_DEVICE_ERROR;
    681769  }
     770 
     771  //
     772  // Inhibit updates of the RTC
     773  //
     774  RegisterB.Bits.Set  = 1;
     775  RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
     776
     777  if (Enable) {
     778    //
     779    // Set RTC alarm time
     780    //
     781    RtcWrite (RTC_ADDRESS_SECONDS_ALARM, RtcTime.Second);
     782    RtcWrite (RTC_ADDRESS_MINUTES_ALARM, RtcTime.Minute);
     783    RtcWrite (RTC_ADDRESS_HOURS_ALARM, RtcTime.Hour);
     784
     785    RegisterB.Bits.Aie = 1;
     786
     787  } else {
     788    RegisterB.Bits.Aie = 0;
     789  }
     790  //
     791  // Allow updates of the RTC registers
     792  //
     793  RegisterB.Bits.Set = 0;
     794  RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
    682795
    683796  //
     
    843956  )
    844957{
    845   if (Time->Year < 1998 ||
    846       Time->Year > 2099 ||
     958  if (Time->Year < PcdGet16 (PcdMinimalValidYear) ||
     959      Time->Year > PcdGet16 (PcdMaximalValidYear) ||
    847960      Time->Month < 1 ||
    848961      Time->Month > 12 ||
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h

    r48674 r58459  
    3333#include <Library/UefiRuntimeServicesTableLib.h>
    3434#include <Library/PcdLib.h>
     35#include <Library/ReportStatusCodeLib.h>
    3536
    3637
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf

    r48674 r58459  
    11## @file
     2# PcRtc driver to install EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL.
    23#
    3 #  PcRtc driver to install EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL.
     4# This driver provides GetTime, SetTime, GetWakeupTime, SetWakeupTime services to Runtime Service Table.
     5# It will install a tagging protocol with gEfiRealTimeClockArchProtocolGuid.
    46#
    5 #  This driver provides GetTime, SetTime, GetWakeupTime, SetWakeupTime services to Runtime Service Table.
    6 #  It will install a tagging protocol with gEfiRealTimeClockArchProtocolGuid.
     7# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
     8# This program and the accompanying materials
     9# are licensed and made available under the terms and conditions of the BSD License
     10# which accompanies this distribution.  The full text of the license may be found at
     11# http://opensource.org/licenses/bsd-license.php
    712#
    8 #  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
    9 #  This program and the accompanying materials
    10 #  are licensed and made available under the terms and conditions of the BSD License
    11 #  which accompanies this distribution.  The full text of the license may be found at
    12 #  http://opensource.org/licenses/bsd-license.php
    13 #
    14 #  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    15 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     13# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     14# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    1615#
    1716##
     
    2019  INF_VERSION                    = 0x00010005
    2120  BASE_NAME                      = PcRtc
     21  MODULE_UNI_FILE                = PcRtc.uni
    2222  FILE_GUID                      = 378D7B65-8DA9-4773-B6E4-A47826A833E1
    2323  MODULE_TYPE                    = DXE_RUNTIME_DRIVER
     
    3939  MdePkg/MdePkg.dec
    4040  MdeModulePkg/MdeModulePkg.dec
     41  PcAtChipsetPkg/PcAtChipsetPkg.dec
    4142
    4243[LibraryClasses]
     
    5253  BaseLib
    5354  PcdLib
     55  ReportStatusCodeLib
    5456
    5557[Protocols]
     
    6062 
    6163[Pcd]
    62   gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout         ## CONSUMES
     64  gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout  ## CONSUMES
     65  gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear             ## CONSUMES
     66  gPcAtChipsetPkgTokenSpaceGuid.PcdMaximalValidYear             ## CONSUMES
     67
     68[UserExtensions.TianoCore."ExtraFiles"]
     69  PcRtcExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridge.c

    r48674 r58459  
    22  Provides the basic interfaces to abstract a PCI Host Bridge Resource Allocation
    33
    4 Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials are
    66licensed and made available under the terms and conditions of the BSD License
     
    2323UINTN RootBridgeNumber[1] = { 1 };
    2424
    25 UINT64 RootBridgeAttribute[1][1] = { EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM };
     25UINT64 RootBridgeAttribute[1][1] = { { EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM } };
    2626
    2727EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath[1][1] = {
    2828  {
    29     ACPI_DEVICE_PATH,
    30     ACPI_DP,
    31     (UINT8) (sizeof(ACPI_HID_DEVICE_PATH)),
    32     (UINT8) ((sizeof(ACPI_HID_DEVICE_PATH)) >> 8),
    33     EISA_PNP_ID(0x0A03),
    34     0,
    35     END_DEVICE_PATH_TYPE,
    36     END_ENTIRE_DEVICE_PATH_SUBTYPE,
    37     END_DEVICE_PATH_LENGTH,
    38     0
     29    {
     30      {
     31        {
     32          ACPI_DEVICE_PATH,
     33          ACPI_DP,
     34          {
     35            (UINT8) (sizeof(ACPI_HID_DEVICE_PATH)),
     36            (UINT8) ((sizeof(ACPI_HID_DEVICE_PATH)) >> 8)
     37          }
     38        },
     39        EISA_PNP_ID(0x0A03),
     40        0
     41      },
     42 
     43      {
     44        END_DEVICE_PATH_TYPE,
     45        END_ENTIRE_DEVICE_PATH_SUBTYPE,
     46        {
     47          END_DEVICE_PATH_LENGTH,
     48          0
     49        }
     50      }
     51    }
    3952  }
    4053};
    4154
    4255PCI_ROOT_BRIDGE_RESOURCE_APPETURE  mResAppeture[1][1] = {
    43   {0, 0xff, 0x80000000, 0xffffffff, 0, 0xffff}
     56  {{0, 0xff, 0x80000000, 0xffffffff, 0, 0xffff}}
    4457};
    4558
     
    269282    break;
    270283
     284  case EfiPciHostBridgeEndEnumeration:
     285    break;
     286
    271287  case EfiPciHostBridgeBeginBusAllocation:
    272288    //
     
    274290    //
    275291    HostBridgeInstance->CanRestarted = FALSE;
    276     return EFI_SUCCESS;
    277292    break;
    278293
     
    282297    //
    283298    //HostBridgeInstance->CanRestarted = FALSE;
    284     return EFI_SUCCESS;
    285299    break;
    286300
     
    290304    //
    291305    //HostBridgeInstance->CanRestarted = FALSE;
    292     return EFI_SUCCESS;
    293306    break;
    294307
     
    460473    HostBridgeInstance->CanRestarted     = TRUE;     
    461474    return ReturnStatus;
    462     break;
    463475
    464476  case EfiPciHostBridgeEndResourceAllocation:
     
    468480  default:
    469481    return EFI_INVALID_PARAMETER;
    470   }; // end switch
     482  }
    471483 
    472484  return EFI_SUCCESS; 
     
    11811193  }
    11821194
    1183   if (Phase < EfiPciBeforeChildBusEnumeration || Phase > EfiPciBeforeResourceCollection) {
     1195  if ((UINT32)Phase > EfiPciBeforeResourceCollection) {
    11841196    return EFI_INVALID_PARAMETER;
    11851197  }
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf

    r48674 r58459  
    11## @file
     2#  The basic interfaces implementation to a single segment PCI Host Bridge driver.
    23#
    3 #    Component description file a sinngle segment PCI Host Bridge driver.
    4 #
    5 #  Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
    65#  This program and the accompanying materials
    76#  are licensed and made available under the terms and conditions of the BSD License
    87#  which accompanies this distribution.  The full text of the license may be found at
    98#  http://opensource.org/licenses/bsd-license.php
    10 # 
     9#
    1110#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    1211#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    13 # 
     12#
    1413##
    1514
     
    1716  INF_VERSION                    = 0x00010005
    1817  BASE_NAME                      = PciHostBridge
     18  MODULE_UNI_FILE                = PciHostBridge.uni
    1919  FILE_GUID                      = 2383608E-C6D0-4e3e-858D-45DFAC3543D5
    2020  MODULE_TYPE                    = DXE_DRIVER
     
    4343  PciRootBridgeIo.c
    4444  PciHostBridge.h
     45  IoFifo.h
     46
     47[Sources.IA32]
     48  Ia32/IoFifo.asm
     49  Ia32/IoFifo.S
     50
     51[Sources.X64]
     52  X64/IoFifo.asm
     53  X64/IoFifo.S
    4554
    4655[Protocols]
    47   gEfiPciHostBridgeResourceAllocationProtocolGuid
    48   gEfiPciRootBridgeIoProtocolGuid
    49   gEfiMetronomeArchProtocolGuid
    50   gEfiDevicePathProtocolGuid
     56  gEfiPciHostBridgeResourceAllocationProtocolGuid       ## PRODUCES
     57  gEfiPciRootBridgeIoProtocolGuid                       ## PRODUCES
     58  gEfiMetronomeArchProtocolGuid                         ## CONSUMES
     59  gEfiDevicePathProtocolGuid                            ## PRODUCES
    5160
    5261[depex]
    5362  gEfiMetronomeArchProtocolGuid
    5463
     64[UserExtensions.TianoCore."ExtraFiles"]
     65  PciHostBridgeExtra.uni
  • trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/PciHostBridgeDxe/PciRootBridgeIo.c

    r53252 r58459  
    22  PCI Root Bridge Io Protocol implementation
    33
    4 Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
     4Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
    55This program and the accompanying materials are
    66licensed and made available under the terms and conditions of the BSD License
     
    1414
    1515#include "PciHostBridge.h"
     16#include "IoFifo.h"
    1617#ifdef VBOX
    1718# define IN_RING3
     
    774775  // Check to see if Width is in the valid range
    775776  //
    776   if (Width < EfiPciWidthUint8 || Width >= EfiPciWidthMaximum) {
     777  if ((UINT32)Width >= EfiPciWidthMaximum) {
    777778    return EFI_INVALID_PARAMETER;
    778779  }
     
    10231024          ASMInStrU32((RTIOPORT)Address, (uint32_t*)Buffer, (size_t)Count);
    10241025        break;
    1025       default:
    1026         ASSERT (FALSE);
     1026        default:
     1027          ASSERT (FALSE);
    10271028    }
    10281029  } else {
     
    12241225  }
    12251226
    1226   if (Width < 0 || Width > EfiPciWidthUint64) {
     1227  if ((UINT32)Width > EfiPciWidthUint64) {
    12271228    return EFI_INVALID_PARAMETER;
    12281229  }
     
    13311332  }
    13321333
    1333   if (Width < 0 || Width > EfiPciWidthUint64) {
     1334  if ((UINT32)Width > EfiPciWidthUint64) {
    13341335    return EFI_INVALID_PARAMETER;
    13351336  }
     
    15521553  UINT64      Result;
    15531554
    1554   if (Width < 0 || Width > EfiPciWidthUint64) {
     1555  if ((UINT32)Width > EfiPciWidthUint64) {
    15551556    return EFI_INVALID_PARAMETER;
    15561557  }   
     
    17261727  // Make sure that Operation is valid
    17271728  //
    1728   if (Operation < 0 || Operation >= EfiPciOperationMaximum) {
     1729  if ((UINT32)Operation >= EfiPciOperationMaximum) {
    17291730    return EFI_INVALID_PARAMETER;
    17301731  }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette