-
Notifications
You must be signed in to change notification settings - Fork 7.4k
drivers: dma: Add dts dma consumer support and generic DMA support for stm32 #13364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
c6d453d
3c458a4
3f6f0f8
6978350
fc3d7aa
f1cea94
de9896d
0eef5f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,5 +52,21 @@ | |
label = "GPIOE"; | ||
}; | ||
}; | ||
|
||
dma1: dma@40020000 { | ||
interrupts = <9 0 10 0 10 0 11 0 11 0 11 0 11 0>; | ||
erwango marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
|
||
dma2: dma@40020400 { | ||
compatible = "st,stm32-dma"; | ||
#dma-cells = <4>; | ||
reg = <0x40020400 0x400>; | ||
interrupts = <9 0 10 0 10 0 11 0 11 0 11 0 | ||
11 0 10 0 10 0 11 0 11 0 11 0>; | ||
clocks = <&rcc STM32_CLOCK_BUS_AHB1 0x2>; | ||
st,mem2mem; | ||
status = "disabled"; | ||
label = "DMA_2"; | ||
}; | ||
}; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this change (dma2) apply also to F051 and F071? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But F051 and F071 has only one DMA instance according to the datasheet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, correct. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Copyright (c) 2019, Song Qiang <[email protected]> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
title: DMA Base Structure | ||
|
||
description: > | ||
This binding gives the base structures for all DMA devices | ||
|
||
include: base.yaml | ||
|
||
child-bus: dma | ||
|
||
properties: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Include base.yaml |
||
label: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By including base.yaml, a lot of the duplication in here should go away. Also we've removed 'generation:' field. |
||
required: true | ||
|
||
"#dma-cells": | ||
type: int | ||
required: true | ||
description: Number of items to expect in a DMA specifier |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# Copyright (c) 2019, Song Qiang <[email protected]> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
title: STM32 DMA | ||
|
||
description: > | ||
This is a representation of the STM32 DMA nodes | ||
|
||
compatible: "st,stm32-dma" | ||
|
||
include: dma.yaml | ||
|
||
properties: | ||
reg: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by inherit from dma & base.yaml you can remove a lot of duplication here. (for things like reg). |
||
required: true | ||
|
||
interrupts: | ||
required: true | ||
|
||
st,mem2mem: | ||
type: boolean | ||
required: true | ||
description: If the controller supports memory to memory transfer | ||
|
||
"#dma-cells": | ||
const: 4 | ||
|
||
# Parameter syntax of stm32 follows the dma client dts syntax | ||
# in the Linux kernel declared in | ||
# https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/plain/Bindings/dma/stm32-dma.txt | ||
|
||
"#cells": | ||
- channel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels like overkill and a fair amount of what should be specified in the API and not in .dts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I don't quit get your point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the "parameters" should be what's needed to identify the dma channel, not all the runtime aspects of the dma transfer. The application should be defining (direction, src_data_size, dst_data_size, src_burst_length, dst_burst_length, src_addr_increment, dst_addr_increment, circular_mode). Think of the DTS as being HW description, not runtime parameters. |
||
- slot | ||
- channel_config | ||
- features |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it correct priority==0?
Moreover, how should I read the sequence of couples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Priority is 0 means using the default priority I think. Sorry I don't understand what is 'sequence of couples', Could you give me a more specific description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like 9 0, 10 0, 10 0, 11 0, 11 0
Five couples which represent, I guess, irqs for the DMA channel/slot.
Can you describe it to me better? Thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply. For five couples, the first one in them represents the irq channel used in hardware, which is described in the datasheet, and the second one is the priority we would use. This DMA instance has 5 channels in hardware, so five couples of data. This is the default explanation for 'interrupts' for all dts nodes. Hope this anwsers your question.