Sudhakar Rajashekhara <[email protected]> writes:
> EDMA in DM355 and DM644x has two transfer controllers while DM646x has four
> transfer controllers. Moving the queue to tc mapping and queue priority
> mapping to dm<soc>.c will be helpful to probe these mappings from platform
> device so that the machine_is_* testing will be avoided.
>
> Signed-off-by: Naresh Medisetty <[email protected]>
> Signed-off-by: Sudhakar Rajashekhara <[email protected]>
> ---
> arch/arm/mach-davinci/dm355.c | 30 ++++++++++++++++++----
> arch/arm/mach-davinci/dm644x.c | 30 ++++++++++++++++++----
> arch/arm/mach-davinci/dm646x.c | 38 +++++++++++++++++++++++-----
> arch/arm/mach-davinci/dma.c | 22 ++++-------------
> arch/arm/mach-davinci/include/mach/edma.h | 6 ++++
> 5 files changed, 90 insertions(+), 36 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
> index beda643..2040fb0 100644
> --- a/arch/arm/mach-davinci/dm355.c
> +++ b/arch/arm/mach-davinci/dm355.c
> @@ -558,13 +558,31 @@ static const s8 dma_chan_dm355_no_event[] = {
> -1
> };
>
> +static const s8
> +queue_tc_mapping[EDMA_MAX_EVQUE + 1][2] = {
> + /* {event queue no, TC no} */
> + {0, 0},
> + {1, 1},
> + {1, -1}
Another minor nit on all of these array defines, which is something I was
requested to fix as I was merging other code upstream...
The last entry should also have a trailing comma. This is the
preferred approach upstream so that adding entries is only a one line
patch instad of two.
Speaking of these arrays, why is it that all of the usages of
EDMA_MAX_EVQUE always add '+ 1' and the definition of EDMA_MAX_EVQUE
says 'FIXME too small'?
AFAICT, this define is never used in the code other than the
definition of these arrays. Instead, the arrays are iterated until a
terminator entry is found. So, why not drop this #define and just use
queue_priority_mapping[][2]...
Speaking of terminator entries, the loops seem to check if the first
element is -1, so on dm355 there's a bug in that there is no
terminator entry. Should'd this last one be {-1, -1}
[...]
> diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
> index ddc1d4f..5d4151b 100644
> --- a/arch/arm/mach-davinci/dm644x.c
> +++ b/arch/arm/mach-davinci/dm644x.c
> @@ -484,13 +484,31 @@ static const s8 dma_chan_dm644x_no_event[] = {
> -1
> };
>
> +static const s8
> +queue_tc_mapping[EDMA_MAX_EVQUE + 1][2] = {
> + /* {event queue no, TC no} */
> + {0, 0},
> + {1, 1},
> + {-1, -1}
> +};
> +
> +static const s8
> +queue_priority_mapping[EDMA_MAX_EVQUE + 1][2] = {
> + /* {event queue no, Priority} */
> + {0, 3},
> + {1, 7},
> + {-1, -1}
> +};
> +
As in dm3555, just drop these #defines since you are iterating
until you find terminators.
Use ..._mapping[][2]..
[...]
Kevin
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source