blob: b1bbb5cc1a7d3749dba15dfd38553d56427668cf [file] [log] [blame]
Kevin Scholz521a4ef2019-10-07 19:26:36 +05301/* SPDX-License-Identifier: BSD-3-Clause */
Dave Gerlachd712b362021-05-11 10:22:11 -05002/*
3 * Cadence DDR Driver
4 *
Bryan Brattlof85b5cc82022-10-24 16:53:28 -05005 * Copyright (C) 2012-2022 Cadence Design Systems, Inc.
6 * Copyright (C) 2018-2022 Texas Instruments Incorporated - https://www.ti.com/
Kevin Scholz521a4ef2019-10-07 19:26:36 +05307 */
Kevin Scholz521a4ef2019-10-07 19:26:36 +05308
Dave Gerlachd712b362021-05-11 10:22:11 -05009#ifndef lpddr4_obj_if_h
10#define lpddr4_obj_if_h
Kevin Scholz521a4ef2019-10-07 19:26:36 +053011
Dave Gerlachd712b362021-05-11 10:22:11 -050012#include "lpddr4_if.h"
Kevin Scholz521a4ef2019-10-07 19:26:36 +053013
Dave Gerlachd712b362021-05-11 10:22:11 -050014typedef struct lpddr4_obj_s {
15 u32 (*probe)(const lpddr4_config *config, u16 *configsize);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053016
Dave Gerlachd712b362021-05-11 10:22:11 -050017 u32 (*init)(lpddr4_privatedata *pd, const lpddr4_config *cfg);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053018
Dave Gerlachd712b362021-05-11 10:22:11 -050019 u32 (*start)(const lpddr4_privatedata *pd);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053020
Dave Gerlachd712b362021-05-11 10:22:11 -050021 u32 (*readreg)(const lpddr4_privatedata *pd, lpddr4_regblock cpp, u32 regoffset, u32 *regvalue);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053022
Dave Gerlachd712b362021-05-11 10:22:11 -050023 u32 (*writereg)(const lpddr4_privatedata *pd, lpddr4_regblock cpp, u32 regoffset, u32 regvalue);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053024
Dave Gerlachd712b362021-05-11 10:22:11 -050025 u32 (*getmmrregister)(const lpddr4_privatedata *pd, u32 readmoderegval, u64 *mmrvalue, u8 *mmrstatus);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053026
Dave Gerlachd712b362021-05-11 10:22:11 -050027 u32 (*setmmrregister)(const lpddr4_privatedata *pd, u32 writemoderegval, u8 *mrwstatus);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053028
Dave Gerlachd712b362021-05-11 10:22:11 -050029 u32 (*writectlconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053030
Dave Gerlachd712b362021-05-11 10:22:11 -050031 u32 (*writephyconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053032
Dave Gerlachd712b362021-05-11 10:22:11 -050033 u32 (*writephyindepconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053034
Dave Gerlachd712b362021-05-11 10:22:11 -050035 u32 (*readctlconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053036
Dave Gerlachd712b362021-05-11 10:22:11 -050037 u32 (*readphyconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053038
Dave Gerlachd712b362021-05-11 10:22:11 -050039 u32 (*readphyindepconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053040
Dave Gerlachd712b362021-05-11 10:22:11 -050041 u32 (*getctlinterruptmask)(const lpddr4_privatedata *pd, u64 *mask);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053042
Dave Gerlachd712b362021-05-11 10:22:11 -050043 u32 (*setctlinterruptmask)(const lpddr4_privatedata *pd, const u64 *mask);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053044
Dave Gerlachd712b362021-05-11 10:22:11 -050045 u32 (*checkctlinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_ctlinterrupt intr, bool *irqstatus);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053046
Dave Gerlachd712b362021-05-11 10:22:11 -050047 u32 (*ackctlinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_ctlinterrupt intr);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053048
Dave Gerlachd712b362021-05-11 10:22:11 -050049 u32 (*getphyindepinterruptmask)(const lpddr4_privatedata *pd, u32 *mask);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053050
Dave Gerlachd712b362021-05-11 10:22:11 -050051 u32 (*setphyindepinterruptmask)(const lpddr4_privatedata *pd, const u32 *mask);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053052
Dave Gerlachd712b362021-05-11 10:22:11 -050053 u32 (*checkphyindepinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_phyindepinterrupt intr, bool *irqstatus);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053054
Dave Gerlachd712b362021-05-11 10:22:11 -050055 u32 (*ackphyindepinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_phyindepinterrupt intr);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053056
Dave Gerlachd712b362021-05-11 10:22:11 -050057 u32 (*getdebuginitinfo)(const lpddr4_privatedata *pd, lpddr4_debuginfo *debuginfo);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053058
Dave Gerlachd712b362021-05-11 10:22:11 -050059 u32 (*getlpiwakeuptime)(const lpddr4_privatedata *pd, const lpddr4_lpiwakeupparam *lpiwakeupparam, const lpddr4_ctlfspnum *fspnum, u32 *cycles);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053060
Dave Gerlachd712b362021-05-11 10:22:11 -050061 u32 (*setlpiwakeuptime)(const lpddr4_privatedata *pd, const lpddr4_lpiwakeupparam *lpiwakeupparam, const lpddr4_ctlfspnum *fspnum, const u32 *cycles);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053062
Dave Gerlachd712b362021-05-11 10:22:11 -050063 u32 (*geteccenable)(const lpddr4_privatedata *pd, lpddr4_eccenable *eccparam);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053064
Dave Gerlachd712b362021-05-11 10:22:11 -050065 u32 (*seteccenable)(const lpddr4_privatedata *pd, const lpddr4_eccenable *eccparam);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053066
Dave Gerlachd712b362021-05-11 10:22:11 -050067 u32 (*getreducmode)(const lpddr4_privatedata *pd, lpddr4_reducmode *mode);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053068
Dave Gerlachd712b362021-05-11 10:22:11 -050069 u32 (*setreducmode)(const lpddr4_privatedata *pd, const lpddr4_reducmode *mode);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053070
Dave Gerlachd712b362021-05-11 10:22:11 -050071 u32 (*getdbireadmode)(const lpddr4_privatedata *pd, bool *on_off);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053072
Dave Gerlachd712b362021-05-11 10:22:11 -050073 u32 (*getdbiwritemode)(const lpddr4_privatedata *pd, bool *on_off);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053074
Dave Gerlachd712b362021-05-11 10:22:11 -050075 u32 (*setdbimode)(const lpddr4_privatedata *pd, const lpddr4_dbimode *mode);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053076
Dave Gerlachd712b362021-05-11 10:22:11 -050077 u32 (*getrefreshrate)(const lpddr4_privatedata *pd, const lpddr4_ctlfspnum *fspnum, u32 *tref, u32 *tras_max);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053078
Dave Gerlachd712b362021-05-11 10:22:11 -050079 u32 (*setrefreshrate)(const lpddr4_privatedata *pd, const lpddr4_ctlfspnum *fspnum, const u32 *tref, const u32 *tras_max);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053080
Dave Gerlachd712b362021-05-11 10:22:11 -050081 u32 (*refreshperchipselect)(const lpddr4_privatedata *pd, const u32 trefinterval);
Bryan Brattlof85b5cc82022-10-24 16:53:28 -050082
83 u32 (*deferredregverify)(const lpddr4_privatedata *pd, lpddr4_regblock cpp, u32 regvalues[], u16 regnum[], u16 regcount);
Dave Gerlachd712b362021-05-11 10:22:11 -050084} lpddr4_obj;
Kevin Scholz521a4ef2019-10-07 19:26:36 +053085
Dave Gerlachd712b362021-05-11 10:22:11 -050086extern lpddr4_obj *lpddr4_getinstance(void);
Kevin Scholz521a4ef2019-10-07 19:26:36 +053087
Dave Gerlachd712b362021-05-11 10:22:11 -050088#endif /* lpddr4_obj_if_h */