Loading...
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * OpenFirmware helpers for memory drivers
4 *
5 * Copyright (C) 2012 Texas Instruments, Inc.
6 * Copyright (C) 2020 Krzysztof Kozlowski <krzk@kernel.org>
7 */
8
9#ifndef __LINUX_MEMORY_OF_REG_H
10#define __LINUX_MEMORY_OF_REG_H
11
12#if defined(CONFIG_OF) && defined(CONFIG_DDR)
13const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
14 struct device *dev);
15const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr,
16 struct device *dev,
17 u32 device_type, u32 *nr_frequencies);
18const struct lpddr3_min_tck *of_lpddr3_get_min_tck(struct device_node *np,
19 struct device *dev);
20const struct lpddr3_timings *
21of_lpddr3_get_ddr_timings(struct device_node *np_ddr,
22 struct device *dev, u32 device_type, u32 *nr_frequencies);
23
24const struct lpddr2_info *of_lpddr2_get_info(struct device_node *np,
25 struct device *dev);
26#else
27static inline const struct lpddr2_min_tck
28 *of_get_min_tck(struct device_node *np, struct device *dev)
29{
30 return NULL;
31}
32
33static inline const struct lpddr2_timings
34 *of_get_ddr_timings(struct device_node *np_ddr, struct device *dev,
35 u32 device_type, u32 *nr_frequencies)
36{
37 return NULL;
38}
39
40static inline const struct lpddr3_min_tck
41 *of_lpddr3_get_min_tck(struct device_node *np, struct device *dev)
42{
43 return NULL;
44}
45
46static inline const struct lpddr3_timings
47 *of_lpddr3_get_ddr_timings(struct device_node *np_ddr,
48 struct device *dev, u32 device_type, u32 *nr_frequencies)
49{
50 return NULL;
51}
52
53static inline const struct lpddr2_info
54 *of_lpddr2_get_info(struct device_node *np, struct device *dev)
55{
56 return NULL;
57}
58#endif /* CONFIG_OF && CONFIG_DDR */
59
60#endif /* __LINUX_MEMORY_OF_REG_ */
1/*
2 * OpenFirmware helpers for memory drivers
3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_MEMORY_OF_REG_H
13#define __LINUX_MEMORY_OF_REG_H
14
15#if defined(CONFIG_OF) && defined(CONFIG_DDR)
16extern const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
17 struct device *dev);
18extern const struct lpddr2_timings
19 *of_get_ddr_timings(struct device_node *np_ddr, struct device *dev,
20 u32 device_type, u32 *nr_frequencies);
21#else
22static inline const struct lpddr2_min_tck
23 *of_get_min_tck(struct device_node *np, struct device *dev)
24{
25 return NULL;
26}
27
28static inline const struct lpddr2_timings
29 *of_get_ddr_timings(struct device_node *np_ddr, struct device *dev,
30 u32 device_type, u32 *nr_frequencies)
31{
32 return NULL;
33}
34#endif /* CONFIG_OF && CONFIG_DDR */
35
36#endif /* __LINUX_MEMORY_OF_REG_ */