xref: /rk3399_ARM-atf/plat/ti/k3low/common/drivers/k3-ddrss/common/lpddr4_structs_if.h (revision 6c0c3a74dda68e7ffc8bd6c156918ddbfea7e03a)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Cadence DDR Driver
4  *
5  * Copyright (C) 2012-2026 Cadence Design Systems, Inc.
6  * Copyright (C) 2018-2026 Texas Instruments Incorporated - https://www.ti.com/
7  */
8 
9 #ifndef LPDDR4_STRUCTS_IF_H
10 #define LPDDR4_STRUCTS_IF_H
11 
12 #include "inttypes.h"
13 
14 #include "lpddr4_if.h"
15 
16 /*
17  * Both ti_lpddr4_config_s and ti_lpddr4_privatedata_s intentionally share the
18  * same four members. This follows the upstream Cadence LPDDR4 driver API
19  * convention: config holds caller-supplied settings passed to init(), while
20  * privatedata is the driver's internal state populated during init(). Keeping
21  * them as distinct types enforces the const/non-const ownership boundary in
22  * the API and prevents callers from accidentally aliasing the two roles.
23  */
24 
25 /* Input configuration passed to ti_lpddr4_init(). */
26 struct ti_lpddr4_config_s {
27 	struct ti_lpddr4_ctlregs_s *ctlbase;
28 	lpddr4_infocallback infohandler;
29 	lpddr4_ctlcallback ctlinterrupthandler;
30 	lpddr4_phyindepcallback phyindepinterrupthandler;
31 };
32 
33 /* Driver internal state populated by ti_lpddr4_init(). */
34 struct ti_lpddr4_privatedata_s {
35 	struct ti_lpddr4_ctlregs_s *ctlbase;
36 	lpddr4_infocallback infohandler;
37 	lpddr4_ctlcallback ctlinterrupthandler;
38 	lpddr4_phyindepcallback phyindepinterrupthandler;
39 };
40 
41 #endif  /* LPDDR4_STRUCTS_IF_H */
42