Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725388

Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64

From André Przywara <andre.przywara@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64
Date 2017-09-02 00:40 +0200
Message-ID <ul2Lv-2Rg-1@gated-at.bofh.it> (permalink)
References <ukkKu-6lK-21@gated-at.bofh.it> <ukIa6-4zF-9@gated-at.bofh.it> <ukNjr-8kR-7@gated-at.bofh.it>
Organization ARM Ltd.

Show all headers | View raw


On 01/09/17 07:04, Maxime Ripard wrote:
> On Fri, Sep 01, 2017 at 01:31:35AM +0100, Andre Przywara wrote:
>> Hi,
>>
>> On 31/08/17 00:36, Stefan Brüns wrote:
>>> The A64 SoC has the same dma engine as the H3 (sun8i), with a
>>> reduced amount of physical channels. Add the proper config data
>>> and compatible string to support it.
>>
>> ...
>>
>>> diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
>>> index 5f4eee4513e5..6a17c5d63582 100644
>>> --- a/drivers/dma/sun6i-dma.c
>>> +++ b/drivers/dma/sun6i-dma.c
>>> @@ -1068,6 +1068,12 @@ static struct sun6i_dma_config sun8i_h3_dma_cfg = {
>>>  	.nr_max_vchans   = 34,
>>>  	.dmac_variant    = DMAC_VARIANT_H3,
>>>  };
>>> +
>>> +static struct sun6i_dma_config sun50i_a64_dma_cfg = {
>>> +	.nr_max_channels = 8,
>>> +	.nr_max_requests = 27,
>>> +	.nr_max_vchans   = 38,
>>> +	.dmac_variant    = DMAC_VARIANT_H3,
>>>  };
>>>  
>>>  static const struct of_device_id sun6i_dma_match[] = {
>>> @@ -1075,6 +1081,7 @@ static const struct of_device_id sun6i_dma_match[] = {
>>>  	{ .compatible = "allwinner,sun8i-a23-dma", .data = &sun8i_a23_dma_cfg },
>>>  	{ .compatible = "allwinner,sun8i-a83t-dma", .data = &sun8i_a83t_dma_cfg },
>>>  	{ .compatible = "allwinner,sun8i-h3-dma", .data = &sun8i_h3_dma_cfg },
>>> +	{ .compatible = "allwinner,sun50i-a64-dma", .data = &sun50i_a64_dma_cfg },
>>>  	{ /* sentinel */ }
>>>  };
>>>  MODULE_DEVICE_TABLE(of, sun6i_dma_match);
>>
>> I was wondering if should use the opportunity to expose those values as
>> DT properties instead of hard-wiring them to a compatible string in the
>> driver every time we add support for a new SoC?
>> We could introduce a new compatible string (say: "allwinner,sunxi-dma"),
>> then describe properties for the number of channels and requests and
>> vchans and parse those from the DT at probe time.
>> With this we might be able to support future SoCs without Linux *driver*
>> changes, by just providing the right DT. This would have worked already
>> for instance for the A83T support, which just changed those values.
>>
>> For instance with this quick patch below (just compile tested, and without
>> your refactoring).
>> The DT node would then read something like:
>> 	dma: dma-controller@01c02000 {
>> 		compatible = "allwinner,sun50i-a64-dma",
>> 			     "allwinner,sunxi-dma";
>> 		reg = <0x01c02000 0x1000>;
>> 		interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
>> 		clocks = <&ccu CLK_BUS_DMA>;
>> 		resets = <&ccu RST_BUS_DMA>;
>> 		#dma-cells = <1>;
>> 		allwinner,max_channels = <8>;
>> 		allwinner,max_requests = <27>;
>> 		allwinner,max_vchans = <38>;
>> 	};
> 
> We're still going to need a different compatible anyway, so it's not
> really like it would change anything.

Well, not for now, but possibly in the future. And we should start with
this at one point. If we would have had this type of binding already for
H3, we could have added the A64 support without driver changes just by a
DT change.

Cheers,
Andre.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] dmaengine: Fix DMA on current allwinner SoCs, add A64 support Stefan Brüns <stefan.bruens@rwth-aachen.de> - 2017-08-31 01:40 +0200
  [PATCH 2/3] arm64: allwinner: a64: Add device node for DMA controller Stefan Brüns <stefan.bruens@rwth-aachen.de> - 2017-08-31 01:40 +0200
  [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Stefan Brüns <stefan.bruens@rwth-aachen.de> - 2017-08-31 01:40 +0200
    Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Code Kipper <codekipper@gmail.com> - 2017-08-31 13:50 +0200
    Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-08-31 17:00 +0200
      Re: [linux-sunxi] Re: [PATCH 3/3] dmaengine: sun6i: Add support for  Allwinner A64 Code Kipper <codekipper@gmail.com> - 2017-08-31 18:40 +0200
    Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Andre Przywara <andre.przywara@arm.com> - 2017-09-01 02:40 +0200
      Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Stefan Bruens <stefan.bruens@rwth-aachen.de> - 2017-09-01 03:30 +0200
        Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 André Przywara <andre.przywara@arm.com> - 2017-09-02 00:40 +0200
          Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Stefan Bruens <stefan.bruens@rwth-aachen.de> - 2017-09-02 02:40 +0200
          Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Stefan Bruens <stefan.bruens@rwth-aachen.de> - 2017-09-02 04:10 +0200
            Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 André Przywara <andre.przywara@arm.com> - 2017-09-04 01:20 +0200
      Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-01 08:10 +0200
        Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 André Przywara <andre.przywara@arm.com> - 2017-09-02 00:40 +0200
          Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-04 09:10 +0200
            Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 André Przywara <andre.przywara@arm.com> - 2017-09-04 10:20 +0200
              Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-08 16:40 +0200
                Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64 Andre Przywara <andre.przywara@arm.com> - 2017-09-08 17:00 +0200
  [PATCH 1/3] dmaengine: sun6i: Correct DMA support on H3 Stefan Brüns <stefan.bruens@rwth-aachen.de> - 2017-08-31 01:40 +0200
    Re: [PATCH 1/3] dmaengine: sun6i: Correct DMA support on H3 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-08-31 17:00 +0200
      Re: [PATCH 1/3] dmaengine: sun6i: Correct DMA support on H3 Stefan Bruens <stefan.bruens@rwth-aachen.de> - 2017-09-01 05:10 +0200
        Re: [PATCH 1/3] dmaengine: sun6i: Correct DMA support on H3 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-01 15:40 +0200
          Re: [PATCH 1/3] dmaengine: sun6i: Correct DMA support on H3 Brüns, Stefan <Stefan.Bruens@rwth-aachen.de> - 2017-09-01 16:50 +0200
            Re: [PATCH 1/3] dmaengine: sun6i: Correct DMA support on H3 Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-09-04 09:00 +0200

csiph-web