Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Aneesh V | e6b42eb | 2012-08-17 14:05:15 +0530 | [diff] [blame] | 2 | /* |
| 3 | * OpenFirmware helpers for memory drivers |
| 4 | * |
| 5 | * Copyright (C) 2012 Texas Instruments, Inc. |
Krzysztof Kozlowski | df30727 | 2020-07-24 09:40:19 +0200 | [diff] [blame] | 6 | * Copyright (C) 2020 Krzysztof Kozlowski <krzk@kernel.org> |
Aneesh V | e6b42eb | 2012-08-17 14:05:15 +0530 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __LINUX_MEMORY_OF_REG_H |
| 10 | #define __LINUX_MEMORY_OF_REG_H |
| 11 | |
Stephen Warren | 7c304d7 | 2012-09-05 12:29:23 -0600 | [diff] [blame] | 12 | #if defined(CONFIG_OF) && defined(CONFIG_DDR) |
Krzysztof Kozlowski | df30727 | 2020-07-24 09:40:19 +0200 | [diff] [blame] | 13 | const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np, |
| 14 | struct device *dev); |
| 15 | const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr, |
| 16 | struct device *dev, |
| 17 | u32 device_type, u32 *nr_frequencies); |
| 18 | const struct lpddr3_min_tck *of_lpddr3_get_min_tck(struct device_node *np, |
| 19 | struct device *dev); |
| 20 | const struct lpddr3_timings * |
| 21 | of_lpddr3_get_ddr_timings(struct device_node *np_ddr, |
| 22 | struct device *dev, u32 device_type, u32 *nr_frequencies); |
Aneesh V | e6b42eb | 2012-08-17 14:05:15 +0530 | [diff] [blame] | 23 | #else |
| 24 | static inline const struct lpddr2_min_tck |
| 25 | *of_get_min_tck(struct device_node *np, struct device *dev) |
| 26 | { |
| 27 | return NULL; |
| 28 | } |
| 29 | |
| 30 | static inline const struct lpddr2_timings |
| 31 | *of_get_ddr_timings(struct device_node *np_ddr, struct device *dev, |
| 32 | u32 device_type, u32 *nr_frequencies) |
| 33 | { |
| 34 | return NULL; |
| 35 | } |
Lukasz Luba | 976897d | 2019-08-21 12:42:58 +0200 | [diff] [blame] | 36 | |
| 37 | static inline const struct lpddr3_min_tck |
| 38 | *of_lpddr3_get_min_tck(struct device_node *np, struct device *dev) |
| 39 | { |
| 40 | return NULL; |
| 41 | } |
| 42 | |
| 43 | static inline const struct lpddr3_timings |
| 44 | *of_lpddr3_get_ddr_timings(struct device_node *np_ddr, |
| 45 | struct device *dev, u32 device_type, u32 *nr_frequencies) |
| 46 | { |
| 47 | return NULL; |
| 48 | } |
Stephen Warren | 7c304d7 | 2012-09-05 12:29:23 -0600 | [diff] [blame] | 49 | #endif /* CONFIG_OF && CONFIG_DDR */ |
Aneesh V | e6b42eb | 2012-08-17 14:05:15 +0530 | [diff] [blame] | 50 | |
| 51 | #endif /* __LINUX_MEMORY_OF_REG_ */ |