180 |
180 |
181 // FMMU configuration already prepared? |
181 // FMMU configuration already prepared? |
182 for (i = 0; i < sc->used_fmmus; i++) { |
182 for (i = 0; i < sc->used_fmmus; i++) { |
183 fmmu = &sc->fmmu_configs[i]; |
183 fmmu = &sc->fmmu_configs[i]; |
184 if (fmmu->domain == domain && fmmu->sync_index == sync_index) |
184 if (fmmu->domain == domain && fmmu->sync_index == sync_index) |
185 return fmmu->logical_start_address; |
185 return fmmu->logical_domain_offset; |
186 } |
186 } |
187 |
187 |
188 if (sc->used_fmmus == EC_MAX_FMMUS) { |
188 if (sc->used_fmmus == EC_MAX_FMMUS) { |
189 EC_CONFIG_ERR(sc, "FMMU limit reached!\n"); |
189 EC_CONFIG_ERR(sc, "FMMU limit reached!\n"); |
190 return -EOVERFLOW; |
190 return -EOVERFLOW; |
214 // and is not already paired with prev-prev fmmu |
214 // and is not already paired with prev-prev fmmu |
215 old_prev_tx_size = prev_fmmu->tx_size; |
215 old_prev_tx_size = prev_fmmu->tx_size; |
216 prev_fmmu->tx_size = max(fmmu->data_size, prev_fmmu->data_size); |
216 prev_fmmu->tx_size = max(fmmu->data_size, prev_fmmu->data_size); |
217 domain->tx_size += prev_fmmu->tx_size - old_prev_tx_size; |
217 domain->tx_size += prev_fmmu->tx_size - old_prev_tx_size; |
218 tx_size = 0; |
218 tx_size = 0; |
219 fmmu_logical_start_address = prev_fmmu->logical_start_address; |
219 fmmu_logical_start_address = prev_fmmu->logical_domain_offset; |
220 } |
220 } |
221 } |
221 } |
222 |
222 |
223 ec_fmmu_config_domain(fmmu, domain, fmmu_logical_start_address, tx_size); |
223 ec_fmmu_config_domain(fmmu, domain, fmmu_logical_start_address, tx_size); |
224 // Overlapping PDO Support from 4751747d4e6d |
224 // Overlapping PDO Support from 4751747d4e6d |
225 #endif |
225 #endif |
226 |
226 |
227 sc->used_fmmus++; |
227 sc->used_fmmus++; |
228 up(&sc->master->master_sem); |
228 up(&sc->master->master_sem); |
229 |
229 |
230 return fmmu->logical_start_address; |
230 return fmmu->logical_domain_offset; |
231 } |
231 } |
232 |
232 |
233 /*****************************************************************************/ |
233 /*****************************************************************************/ |
234 |
234 |
235 /** Attaches the configuration to the addressed slave object. |
235 /** Attaches the configuration to the addressed slave object. |