1 /** @file 2 3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR> 4 5 This program and the accompanying materials are licensed and made available under 7 the terms and conditions of the BSD License that accompanies this distribution. 9 The full text of the license may be found at 11 http://opensource.org/licenses/bsd-license.php. 13 15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 17 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 19 21 23 Module Name: 24 25 26 SioPlatformPolicy.c 27 28 Abstract: 29 30 Sio Platform Policy Setting. 31 32 33 --*/ 34 35 #include "PlatformDxe.h" 36 #include <Protocol/LpcWpc83627Policy.h> 37 38 39 EFI_WPC83627_POLICY_PROTOCOL mSio83627PolicyData = { 40 { EFI_WPC83627_COM1_ENABLE, // Com1 41 EFI_WPC83627_LPT1_ENABLE, // Lpt1 42 EFI_WPC83627_FDD_DISABLE, // Floppy 43 EFI_WPC83627_FDD_WRITE_ENABLE, // FloppyWriteProtect 44 EFI_WPC83627_RESERVED_DEFAULT, // Port80 45 EFI_WPC83627_ECIR_DISABLE, // CIR 46 EFI_WPC83627_PS2_KBC_ENABLE, // Ps2Keyboard 47 EFI_WPC83627_RESERVED_DEFAULT, // Ps2Mouse 48 EFI_WPC83627_COM2_ENABLE, // Com2 49 EFI_WPC83627_COM3_ENABLE, // Com3 50 EFI_WPC83627_COM4_ENABLE, // Com4 51 EFI_WPC83627_RESERVED_DEFAULT, // Dac 52 0x00 // Rsvd 53 }, 54 LptModeEcp, // LptMode 55 }; 56 57 /** 58 59 Publish the platform SIO policy setting. 60 61 @retval EFI_SUCCESS 62 63 **/ 64 VOID 65 InitSioPlatformPolicy( 66 ) 67 { 68 69 EFI_HANDLE Handle; 70 EFI_STATUS Status; 71 72 Handle = NULL; 73 74 if((mSystemConfiguration.Serial) || (mBoardFeatures & B_BOARD_FEATURES_SIO_NO_COM1)) { 75 mSio83627PolicyData.DeviceEnables.Com1 = EFI_WPC83627_COM1_DISABLE; 76 } 77 78 if((mSystemConfiguration.Serial2) || ((mBoardFeatures & B_BOARD_FEATURES_SIO_COM2)==0)) { 79 mSio83627PolicyData.DeviceEnables.Com2 = EFI_WPC83627_COM2_DISABLE; 80 } 81 82 mSio83627PolicyData.LptMode = mSystemConfiguration.ParallelMode; 83 if((!mSystemConfiguration.Parallel) || (mBoardFeatures & B_BOARD_FEATURES_SIO_NO_PARALLEL)) { 84 mSio83627PolicyData.DeviceEnables.Lpt1 = EFI_WPC83627_LPT1_DISABLE; 85 } 86 87 Status = gBS->InstallProtocolInterface ( 88 &Handle, 89 &gEfiLpcWpc83627PolicyProtocolGuid, 90 EFI_NATIVE_INTERFACE, 91 &mSio83627PolicyData 92 ); 93 ASSERT_EFI_ERROR(Status); 94 95 } 96 97