Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2012-15 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  * Authors: AMD
0023  *
0024  */
0025 
0026 #include "dm_services.h"
0027 
0028 /*
0029  * Pre-requisites: headers required by header of this unit
0030  */
0031 #include "include/gpio_types.h"
0032 
0033 /*
0034  * Header of this unit
0035  */
0036 
0037 #include "hw_factory.h"
0038 
0039 /*
0040  * Post-requisites: headers required by this unit
0041  */
0042 
0043 #if defined(CONFIG_DRM_AMD_DC_SI)
0044 #include "dce60/hw_factory_dce60.h"
0045 #endif
0046 #include "dce80/hw_factory_dce80.h"
0047 #include "dce110/hw_factory_dce110.h"
0048 #include "dce120/hw_factory_dce120.h"
0049 #include "dcn10/hw_factory_dcn10.h"
0050 #include "dcn20/hw_factory_dcn20.h"
0051 #include "dcn21/hw_factory_dcn21.h"
0052 #include "dcn30/hw_factory_dcn30.h"
0053 #include "dcn315/hw_factory_dcn315.h"
0054 #include "dcn32/hw_factory_dcn32.h"
0055 
0056 bool dal_hw_factory_init(
0057     struct hw_factory *factory,
0058     enum dce_version dce_version,
0059     enum dce_environment dce_environment)
0060 {
0061     switch (dce_version) {
0062 #if defined(CONFIG_DRM_AMD_DC_SI)
0063     case DCE_VERSION_6_0:
0064     case DCE_VERSION_6_1:
0065     case DCE_VERSION_6_4:
0066         dal_hw_factory_dce60_init(factory);
0067         return true;
0068 #endif
0069     case DCE_VERSION_8_0:
0070     case DCE_VERSION_8_1:
0071     case DCE_VERSION_8_3:
0072         dal_hw_factory_dce80_init(factory);
0073         return true;
0074 
0075     case DCE_VERSION_10_0:
0076         dal_hw_factory_dce110_init(factory);
0077         return true;
0078     case DCE_VERSION_11_0:
0079     case DCE_VERSION_11_2:
0080     case DCE_VERSION_11_22:
0081         dal_hw_factory_dce110_init(factory);
0082         return true;
0083     case DCE_VERSION_12_0:
0084     case DCE_VERSION_12_1:
0085         dal_hw_factory_dce120_init(factory);
0086         return true;
0087     case DCN_VERSION_1_0:
0088     case DCN_VERSION_1_01:
0089         dal_hw_factory_dcn10_init(factory);
0090         return true;
0091     case DCN_VERSION_2_0:
0092         dal_hw_factory_dcn20_init(factory);
0093         return true;
0094     case DCN_VERSION_2_01:
0095     case DCN_VERSION_2_1:
0096         dal_hw_factory_dcn21_init(factory);
0097         return true;
0098     case DCN_VERSION_3_0:
0099     case DCN_VERSION_3_01:
0100     case DCN_VERSION_3_02:
0101     case DCN_VERSION_3_03:
0102     case DCN_VERSION_3_1:
0103     case DCN_VERSION_3_14:
0104     case DCN_VERSION_3_16:
0105         dal_hw_factory_dcn30_init(factory);
0106         return true;
0107     case DCN_VERSION_3_15:
0108         dal_hw_factory_dcn315_init(factory);
0109         return true;
0110     case DCN_VERSION_3_2:
0111     case DCN_VERSION_3_21:
0112         dal_hw_factory_dcn32_init(factory);
0113         return true;
0114     default:
0115         ASSERT_CRITICAL(false);
0116         return false;
0117     }
0118 }