xref: /dragonfly/sys/dev/drm/radeon/evergreen_smc.h (revision c6f73aab)
157e252bfSMichael Neumann /*
257e252bfSMichael Neumann  * Copyright 2011 Advanced Micro Devices, Inc.
357e252bfSMichael Neumann  *
457e252bfSMichael Neumann  * Permission is hereby granted, free of charge, to any person obtaining a
557e252bfSMichael Neumann  * copy of this software and associated documentation files (the "Software"),
657e252bfSMichael Neumann  * to deal in the Software without restriction, including without limitation
757e252bfSMichael Neumann  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
857e252bfSMichael Neumann  * and/or sell copies of the Software, and to permit persons to whom the
957e252bfSMichael Neumann  * Software is furnished to do so, subject to the following conditions:
1057e252bfSMichael Neumann  *
1157e252bfSMichael Neumann  * The above copyright notice and this permission notice shall be included in
1257e252bfSMichael Neumann  * all copies or substantial portions of the Software.
1357e252bfSMichael Neumann  *
1457e252bfSMichael Neumann  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1557e252bfSMichael Neumann  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1657e252bfSMichael Neumann  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1757e252bfSMichael Neumann  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1857e252bfSMichael Neumann  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1957e252bfSMichael Neumann  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2057e252bfSMichael Neumann  * OTHER DEALINGS IN THE SOFTWARE.
2157e252bfSMichael Neumann  *
2257e252bfSMichael Neumann  */
2357e252bfSMichael Neumann #ifndef __EVERGREEN_SMC_H__
2457e252bfSMichael Neumann #define __EVERGREEN_SMC_H__
2557e252bfSMichael Neumann 
2657e252bfSMichael Neumann #include "rv770_smc.h"
2757e252bfSMichael Neumann 
2857e252bfSMichael Neumann #pragma pack(push, 1)
2957e252bfSMichael Neumann 
3057e252bfSMichael Neumann #define SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE 16
3157e252bfSMichael Neumann 
3257e252bfSMichael Neumann struct SMC_Evergreen_MCRegisterAddress
3357e252bfSMichael Neumann {
3457e252bfSMichael Neumann     uint16_t s0;
3557e252bfSMichael Neumann     uint16_t s1;
3657e252bfSMichael Neumann };
3757e252bfSMichael Neumann 
3857e252bfSMichael Neumann typedef struct SMC_Evergreen_MCRegisterAddress SMC_Evergreen_MCRegisterAddress;
3957e252bfSMichael Neumann 
4057e252bfSMichael Neumann 
4157e252bfSMichael Neumann struct SMC_Evergreen_MCRegisterSet
4257e252bfSMichael Neumann {
4357e252bfSMichael Neumann     uint32_t value[SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE];
4457e252bfSMichael Neumann };
4557e252bfSMichael Neumann 
4657e252bfSMichael Neumann typedef struct SMC_Evergreen_MCRegisterSet SMC_Evergreen_MCRegisterSet;
4757e252bfSMichael Neumann 
4857e252bfSMichael Neumann struct SMC_Evergreen_MCRegisters
4957e252bfSMichael Neumann {
5057e252bfSMichael Neumann     uint8_t                             last;
5157e252bfSMichael Neumann     uint8_t                             reserved[3];
5257e252bfSMichael Neumann     SMC_Evergreen_MCRegisterAddress     address[SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE];
5357e252bfSMichael Neumann     SMC_Evergreen_MCRegisterSet         data[5];
5457e252bfSMichael Neumann };
5557e252bfSMichael Neumann 
5657e252bfSMichael Neumann typedef struct SMC_Evergreen_MCRegisters SMC_Evergreen_MCRegisters;
5757e252bfSMichael Neumann 
5857e252bfSMichael Neumann #define EVERGREEN_SMC_FIRMWARE_HEADER_LOCATION 0x100
5957e252bfSMichael Neumann 
60*c6f73aabSFrançois Tigeot #define EVERGREEN_SMC_FIRMWARE_HEADER_softRegisters   0x8
6157e252bfSMichael Neumann #define EVERGREEN_SMC_FIRMWARE_HEADER_stateTable      0xC
6257e252bfSMichael Neumann #define EVERGREEN_SMC_FIRMWARE_HEADER_mcRegisterTable 0x20
6357e252bfSMichael Neumann 
6457e252bfSMichael Neumann 
6557e252bfSMichael Neumann #pragma pack(pop)
6657e252bfSMichael Neumann 
6757e252bfSMichael Neumann #endif
68