12 #include <linux/device.h>
14 #include <linux/list.h>
18 #include <linux/export.h>
40 ret |= of_property_read_u32(np,
"tRPab-min-tck", &min->
tRPab);
41 ret |= of_property_read_u32(np,
"tRCD-min-tck", &min->
tRCD);
42 ret |= of_property_read_u32(np,
"tWR-min-tck", &min->
tWR);
43 ret |= of_property_read_u32(np,
"tRASmin-min-tck", &min->
tRASmin);
44 ret |= of_property_read_u32(np,
"tRRD-min-tck", &min->
tRRD);
45 ret |= of_property_read_u32(np,
"tWTR-min-tck", &min->
tWTR);
46 ret |= of_property_read_u32(np,
"tXP-min-tck", &min->
tXP);
47 ret |= of_property_read_u32(np,
"tRTP-min-tck", &min->
tRTP);
48 ret |= of_property_read_u32(np,
"tCKE-min-tck", &min->
tCKE);
49 ret |= of_property_read_u32(np,
"tCKESR-min-tck", &min->
tCKESR);
50 ret |= of_property_read_u32(np,
"tFAW-min-tck", &min->
tFAW);
60 dev_warn(dev,
"%s: using default min-tck values\n", __func__);
65 static int of_do_get_timings(
struct device_node *np,
70 ret = of_property_read_u32(np,
"max-freq", &tim->
max_freq);
71 ret |= of_property_read_u32(np,
"min-freq", &tim->
min_freq);
72 ret |= of_property_read_u32(np,
"tRPab", &tim->
tRPab);
73 ret |= of_property_read_u32(np,
"tRCD", &tim->
tRCD);
74 ret |= of_property_read_u32(np,
"tWR", &tim->
tWR);
75 ret |= of_property_read_u32(np,
"tRAS-min", &tim->
tRAS_min);
76 ret |= of_property_read_u32(np,
"tRRD", &tim->
tRRD);
77 ret |= of_property_read_u32(np,
"tWTR", &tim->
tWTR);
78 ret |= of_property_read_u32(np,
"tXP", &tim->
tXP);
79 ret |= of_property_read_u32(np,
"tRTP", &tim->
tRTP);
80 ret |= of_property_read_u32(np,
"tCKESR", &tim->
tCKESR);
81 ret |= of_property_read_u32(np,
"tDQSCK-max", &tim->
tDQSCK_max);
82 ret |= of_property_read_u32(np,
"tFAW", &tim->
tFAW);
83 ret |= of_property_read_u32(np,
"tZQCS", &tim->
tZQCS);
84 ret |= of_property_read_u32(np,
"tZQCL", &tim->
tZQCL);
85 ret |= of_property_read_u32(np,
"tZQinit", &tim->
tZQinit);
86 ret |= of_property_read_u32(np,
"tRAS-max-ns", &tim->
tRAS_max_ns);
87 ret |= of_property_read_u32(np,
"tDQSCK-max-derated",
110 u32 arr_sz = 0,
i = 0;
114 switch (device_type) {
117 tim_compat =
"jedec,lpddr2-timings";
120 dev_warn(dev,
"%s: un-supported memory type\n", __func__);
132 goto default_timings;
136 if (of_do_get_timings(np_tim, &timings[
i])) {
138 goto default_timings;
144 *nr_frequencies = arr_sz;
149 dev_warn(dev,
"%s: using default timings\n", __func__);