mvebu-devbus.c (e23c34bb41da65f354fb7eee04300c56ee48f60c) mvebu-devbus.c (ce965c3d2e68c5325dd5624eb101d70423022fef)
1/*
2 * Marvell EBU SoC Device Bus Controller
3 * (memory controller for NOR/NAND/SRAM/FPGA devices)
4 *
5 * Copyright (C) 2013 Marvell
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 94 unchanged lines hidden (view full) ---

103 /* Get read timings */
104 err = of_property_read_u32(node, "devbus,bus-width", &r.bus_width);
105 if (err < 0) {
106 dev_err(devbus->dev,
107 "%s has no 'devbus,bus-width' property\n",
108 node->full_name);
109 return err;
110 }
1/*
2 * Marvell EBU SoC Device Bus Controller
3 * (memory controller for NOR/NAND/SRAM/FPGA devices)
4 *
5 * Copyright (C) 2013 Marvell
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 94 unchanged lines hidden (view full) ---

103 /* Get read timings */
104 err = of_property_read_u32(node, "devbus,bus-width", &r.bus_width);
105 if (err < 0) {
106 dev_err(devbus->dev,
107 "%s has no 'devbus,bus-width' property\n",
108 node->full_name);
109 return err;
110 }
111 /* Convert bit width to byte width */
112 r.bus_width /= 8;
113
111
112 /*
113 * The bus width is encoded into the register as 0 for 8 bits,
114 * and 1 for 16 bits, so we do the necessary conversion here.
115 */
116 if (r.bus_width == 8)
117 r.bus_width = 0;
118 else if (r.bus_width == 16)
119 r.bus_width = 1;
120 else {
121 dev_err(devbus->dev, "invalid bus width %d\n", r.bus_width);
122 return -EINVAL;
123 }
124
114 err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps",
115 &r.badr_skew);
116 if (err < 0)
117 return err;
118
119 err = get_timing_param_ps(devbus, node, "devbus,turn-off-ps",
120 &r.turn_off);
121 if (err < 0)

--- 151 unchanged lines hidden ---
125 err = get_timing_param_ps(devbus, node, "devbus,badr-skew-ps",
126 &r.badr_skew);
127 if (err < 0)
128 return err;
129
130 err = get_timing_param_ps(devbus, node, "devbus,turn-off-ps",
131 &r.turn_off);
132 if (err < 0)

--- 151 unchanged lines hidden ---