#ifndef __AMD_ATL_INTERNAL_H__
#define __AMD_ATL_INTERNAL_H__
#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/ras.h>
#include <asm/amd_nb.h>
#include "reg_fields.h"
#undef pr_fmt
#define pr_fmt(fmt) …
#define MAX_COH_ST_CHANNELS …
#define DF_FUNC0_ID_ZEN4_SERVER …
#define DF_FUNC0_ID_MI300 …
#define DF_DRAM_BASE_LIMIT_LSB …
#define MI300_DRAM_LIMIT_LSB …
#define INVALID_SPA …
enum df_revisions { … };
enum intlv_modes { … };
struct df4p5_denorm_ctx { … };
struct df_flags { … };
struct df_config { … };
extern struct df_config df_cfg;
struct dram_addr_map { … };
struct addr_ctx_inputs { … };
struct addr_ctx { … };
int df_indirect_read_instance(u16 node, u8 func, u16 reg, u8 instance_id, u32 *lo);
int df_indirect_read_broadcast(u16 node, u8 func, u16 reg, u32 *lo);
int get_df_system_info(void);
int determine_node_id(struct addr_ctx *ctx, u8 socket_num, u8 die_num);
int get_umc_info_mi300(void);
int get_address_map(struct addr_ctx *ctx);
int denormalize_address(struct addr_ctx *ctx);
int dehash_address(struct addr_ctx *ctx);
unsigned long norm_to_sys_addr(u8 socket_id, u8 die_id, u8 coh_st_inst_id, unsigned long addr);
unsigned long convert_umc_mca_addr_to_sys_addr(struct atl_err *err);
u64 add_base_and_hole(struct addr_ctx *ctx, u64 addr);
u64 remove_base_and_hole(struct addr_ctx *ctx, u64 addr);
#ifdef CONFIG_AMD_ATL_PRM
unsigned long prm_umc_norm_to_sys_addr(u8 socket_id, u64 umc_bank_inst_id, unsigned long addr);
#else
static inline unsigned long prm_umc_norm_to_sys_addr(u8 socket_id, u64 umc_bank_inst_id,
unsigned long addr)
{
return -ENODEV;
}
#endif
static inline u64 expand_bits(u8 bit_num, u8 num_bits, u64 data)
{ … }
static inline u64 remove_bits(u8 low_bit, u8 high_bit, u64 data)
{ … }
#define atl_debug(ctx, fmt, arg...) …
static inline void atl_debug_on_bad_df_rev(void)
{ … }
static inline void atl_debug_on_bad_intlv_mode(struct addr_ctx *ctx)
{ … }
#endif