Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2018 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  */
0023 #ifndef __COMMON_BOCO_H__
0024 #define __COMMON_BOCO_H__
0025 #include "hwmgr.h"
0026 
0027 
0028 enum baco_cmd_type {
0029     CMD_WRITE = 0,
0030     CMD_READMODIFYWRITE,
0031     CMD_WAITFOR,
0032     CMD_DELAY_MS,
0033     CMD_DELAY_US,
0034 };
0035 
0036 struct baco_cmd_entry {
0037     enum baco_cmd_type cmd;
0038     uint32_t    reg_offset;
0039     uint32_t        mask;
0040     uint32_t        shift;
0041     uint32_t        timeout;
0042     uint32_t        val;
0043 };
0044 
0045 struct soc15_baco_cmd_entry {
0046     enum baco_cmd_type cmd;
0047     uint32_t    hwip;
0048     uint32_t    inst;
0049     uint32_t    seg;
0050     uint32_t    reg_offset;
0051     uint32_t        mask;
0052     uint32_t        shift;
0053     uint32_t        timeout;
0054     uint32_t        val;
0055 };
0056 
0057 extern bool baco_program_registers(struct pp_hwmgr *hwmgr,
0058                    const struct baco_cmd_entry *entry,
0059                    const u32 array_size);
0060 extern bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr,
0061                     const struct soc15_baco_cmd_entry *entry,
0062                     const u32 array_size);
0063 #endif