Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-3-Clause */ |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Cadence DDR Driver |
| 4 | * |
| 5 | * Copyright (C) 2012-2021 Cadence Design Systems, Inc. |
| 6 | * Copyright (C) 2018-2021 Texas Instruments Incorporated - https://www.ti.com/ |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 7 | */ |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 8 | |
| 9 | #ifndef lpddr4_obj_if_h |
| 10 | #define lpddr4_obj_if_h |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 11 | |
| 12 | #include "lpddr4_if.h" |
| 13 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 14 | typedef struct lpddr4_obj_s { |
| 15 | u32 (*probe)(const lpddr4_config *config, u16 *configsize); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 16 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 17 | u32 (*init)(lpddr4_privatedata *pd, const lpddr4_config *cfg); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 18 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 19 | u32 (*start)(const lpddr4_privatedata *pd); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 20 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 21 | u32 (*readreg)(const lpddr4_privatedata *pd, lpddr4_regblock cpp, u32 regoffset, u32 *regvalue); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 22 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 23 | u32 (*writereg)(const lpddr4_privatedata *pd, lpddr4_regblock cpp, u32 regoffset, u32 regvalue); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 24 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 25 | u32 (*getmmrregister)(const lpddr4_privatedata *pd, u32 readmoderegval, u64 *mmrvalue, u8 *mmrstatus); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 26 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 27 | u32 (*setmmrregister)(const lpddr4_privatedata *pd, u32 writemoderegval, u8 *mrwstatus); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 28 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 29 | u32 (*writectlconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 30 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 31 | u32 (*writephyconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 32 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 33 | u32 (*writephyindepconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 34 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 35 | u32 (*readctlconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 36 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 37 | u32 (*readphyconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 38 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 39 | u32 (*readphyindepconfig)(const lpddr4_privatedata *pd, u32 regvalues[], u16 regnum[], u16 regcount); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 40 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 41 | u32 (*getctlinterruptmask)(const lpddr4_privatedata *pd, u64 *mask); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 42 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 43 | u32 (*setctlinterruptmask)(const lpddr4_privatedata *pd, const u64 *mask); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 44 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 45 | u32 (*checkctlinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_ctlinterrupt intr, bool *irqstatus); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 46 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 47 | u32 (*ackctlinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_ctlinterrupt intr); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 48 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 49 | u32 (*getphyindepinterruptmask)(const lpddr4_privatedata *pd, u32 *mask); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 50 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 51 | u32 (*setphyindepinterruptmask)(const lpddr4_privatedata *pd, const u32 *mask); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 52 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 53 | u32 (*checkphyindepinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_phyindepinterrupt intr, bool *irqstatus); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 54 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 55 | u32 (*ackphyindepinterrupt)(const lpddr4_privatedata *pd, lpddr4_intr_phyindepinterrupt intr); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 56 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 57 | u32 (*getdebuginitinfo)(const lpddr4_privatedata *pd, lpddr4_debuginfo *debuginfo); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 58 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 59 | u32 (*getlpiwakeuptime)(const lpddr4_privatedata *pd, const lpddr4_lpiwakeupparam *lpiwakeupparam, const lpddr4_ctlfspnum *fspnum, u32 *cycles); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 60 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 61 | u32 (*setlpiwakeuptime)(const lpddr4_privatedata *pd, const lpddr4_lpiwakeupparam *lpiwakeupparam, const lpddr4_ctlfspnum *fspnum, const u32 *cycles); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 62 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 63 | u32 (*geteccenable)(const lpddr4_privatedata *pd, lpddr4_eccenable *eccparam); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 64 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 65 | u32 (*seteccenable)(const lpddr4_privatedata *pd, const lpddr4_eccenable *eccparam); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 66 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 67 | u32 (*getreducmode)(const lpddr4_privatedata *pd, lpddr4_reducmode *mode); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 68 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 69 | u32 (*setreducmode)(const lpddr4_privatedata *pd, const lpddr4_reducmode *mode); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 70 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 71 | u32 (*getdbireadmode)(const lpddr4_privatedata *pd, bool *on_off); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 72 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 73 | u32 (*getdbiwritemode)(const lpddr4_privatedata *pd, bool *on_off); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 74 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 75 | u32 (*setdbimode)(const lpddr4_privatedata *pd, const lpddr4_dbimode *mode); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 76 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 77 | u32 (*getrefreshrate)(const lpddr4_privatedata *pd, const lpddr4_ctlfspnum *fspnum, u32 *tref, u32 *tras_max); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 78 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 79 | u32 (*setrefreshrate)(const lpddr4_privatedata *pd, const lpddr4_ctlfspnum *fspnum, const u32 *tref, const u32 *tras_max); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 80 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 81 | u32 (*refreshperchipselect)(const lpddr4_privatedata *pd, const u32 trefinterval); |
| 82 | } lpddr4_obj; |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 83 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 84 | extern lpddr4_obj *lpddr4_getinstance(void); |
Kevin Scholz | 3bb3f26 | 2019-10-07 19:26:36 +0530 | [diff] [blame] | 85 | |
Dave Gerlach | a8c13c7 | 2021-05-11 10:22:11 -0500 | [diff] [blame] | 86 | #endif /* lpddr4_obj_if_h */ |