mbox series

[edk2,0/6] ArmPkg EmbeddedPkg: clean up DmaLib implementations

Message ID 20170830082108.7470-1-ard.biesheuvel@linaro.org
Headers show
Series ArmPkg EmbeddedPkg: clean up DmaLib implementations | expand

Message

Ard Biesheuvel Aug. 30, 2017, 8:21 a.m. UTC
Currently, we have two DmaLib implementations: a cache coherent one called
'NullDmaLib' residing in EmbeddedPkg, and a non-cache coherent one called
'ArmDmaLib', residinh in ArmPkg.

In both cases, this is slightly awkward: NullDmaLib suggests no functionality
whatsoever, which is slightly misleading because 'nothing' is the correct
action in case of cache coherent DMA, rather than a lack of action. As for
ArmDmalib, this was never specific to ARM, and no longer depends on anything
that ArmPkg provides, so it does not really belong in ArmPkg anymore.

So let's rename them to CoherentDmaLib and NonCoherentDmaLib, respectively,
and move that latter into EmbeddedPkg where it arguably belongs. To align
the two further, add support for non-1:1 DMA mappings to CoherentDmaLib as
well.

Note that the final patch can only be merged after out-of-tree platforms
have switched from ArmDmaLib to NonCoherentDmaLib.

Ard Biesheuvel (6):
  EmbeddedPkg: rename NullDmaLib to CoherentDmaLib
  EmbeddedPkg/CoherentDmaLib: add support for non-1:1 DMA translation
  EmbeddedPkg: implement NonCoherentDmaLib based on ArmDmaLib
  Omap35xxPkg: switch to EmbeddedPkg's NonCoherentDmaLib
  BeagleBoardPkg: switch to generic non-coherent DmaLib
  ArmPkg: remove ArmDmaLib

 ArmPkg/ArmPkg.dsc                                                                                 |   2 -
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf                                                            |  49 ---------
 BeagleBoardPkg/BeagleBoardPkg.dsc                                                                 |   2 +-
 EmbeddedPkg/EmbeddedPkg.dec                                                                       |   7 ++
 EmbeddedPkg/EmbeddedPkg.dsc                                                                       |   3 +-
 EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.c => CoherentDmaLib/CoherentDmaLib.c}                  |  10 +-
 EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.inf => CoherentDmaLib/CoherentDmaLib.inf}              |  19 ++--
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.c => EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c | 105 +++++++++++---------
 EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf                                       |  50 ++++++++++
 Omap35xxPkg/Omap35xxPkg.dsc                                                                       |   2 +-
 10 files changed, 136 insertions(+), 113 deletions(-)
 delete mode 100644 ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
 rename EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.c => CoherentDmaLib/CoherentDmaLib.c} (94%)
 rename EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.inf => CoherentDmaLib/CoherentDmaLib.inf} (75%)
 rename ArmPkg/Library/ArmDmaLib/ArmDmaLib.c => EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c (82%)
 create mode 100644 EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf

-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Leif Lindholm Aug. 30, 2017, 1:06 p.m. UTC | #1
On Wed, Aug 30, 2017 at 09:21:02AM +0100, Ard Biesheuvel wrote:
> Currently, we have two DmaLib implementations: a cache coherent one called

> 'NullDmaLib' residing in EmbeddedPkg, and a non-cache coherent one called

> 'ArmDmaLib', residinh in ArmPkg.

> 

> In both cases, this is slightly awkward: NullDmaLib suggests no functionality

> whatsoever, which is slightly misleading because 'nothing' is the correct

> action in case of cache coherent DMA, rather than a lack of action. As for

> ArmDmalib, this was never specific to ARM, and no longer depends on anything

> that ArmPkg provides, so it does not really belong in ArmPkg anymore.

> 

> So let's rename them to CoherentDmaLib and NonCoherentDmaLib, respectively,

> and move that latter into EmbeddedPkg where it arguably belongs. To align

> the two further, add support for non-1:1 DMA mappings to CoherentDmaLib as

> well.

> 

> Note that the final patch can only be merged after out-of-tree platforms

> have switched from ArmDmaLib to NonCoherentDmaLib.


For 4-6/6:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


> Ard Biesheuvel (6):

>   EmbeddedPkg: rename NullDmaLib to CoherentDmaLib

>   EmbeddedPkg/CoherentDmaLib: add support for non-1:1 DMA translation

>   EmbeddedPkg: implement NonCoherentDmaLib based on ArmDmaLib

>   Omap35xxPkg: switch to EmbeddedPkg's NonCoherentDmaLib

>   BeagleBoardPkg: switch to generic non-coherent DmaLib

>   ArmPkg: remove ArmDmaLib

> 

>  ArmPkg/ArmPkg.dsc                                                                                 |   2 -

>  ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf                                                            |  49 ---------

>  BeagleBoardPkg/BeagleBoardPkg.dsc                                                                 |   2 +-

>  EmbeddedPkg/EmbeddedPkg.dec                                                                       |   7 ++

>  EmbeddedPkg/EmbeddedPkg.dsc                                                                       |   3 +-

>  EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.c => CoherentDmaLib/CoherentDmaLib.c}                  |  10 +-

>  EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.inf => CoherentDmaLib/CoherentDmaLib.inf}              |  19 ++--

>  ArmPkg/Library/ArmDmaLib/ArmDmaLib.c => EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c | 105 +++++++++++---------

>  EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf                                       |  50 ++++++++++

>  Omap35xxPkg/Omap35xxPkg.dsc                                                                       |   2 +-

>  10 files changed, 136 insertions(+), 113 deletions(-)

>  delete mode 100644 ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf

>  rename EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.c => CoherentDmaLib/CoherentDmaLib.c} (94%)

>  rename EmbeddedPkg/Library/{NullDmaLib/NullDmaLib.inf => CoherentDmaLib/CoherentDmaLib.inf} (75%)

>  rename ArmPkg/Library/ArmDmaLib/ArmDmaLib.c => EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.c (82%)

>  create mode 100644 EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf

> 

> -- 

> 2.11.0

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Aug. 30, 2017, 1:17 p.m. UTC | #2
On 30 August 2017 at 14:06, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Wed, Aug 30, 2017 at 09:21:02AM +0100, Ard Biesheuvel wrote:

>> Currently, we have two DmaLib implementations: a cache coherent one called

>> 'NullDmaLib' residing in EmbeddedPkg, and a non-cache coherent one called

>> 'ArmDmaLib', residinh in ArmPkg.

>>

>> In both cases, this is slightly awkward: NullDmaLib suggests no functionality

>> whatsoever, which is slightly misleading because 'nothing' is the correct

>> action in case of cache coherent DMA, rather than a lack of action. As for

>> ArmDmalib, this was never specific to ARM, and no longer depends on anything

>> that ArmPkg provides, so it does not really belong in ArmPkg anymore.

>>

>> So let's rename them to CoherentDmaLib and NonCoherentDmaLib, respectively,

>> and move that latter into EmbeddedPkg where it arguably belongs. To align

>> the two further, add support for non-1:1 DMA mappings to CoherentDmaLib as

>> well.

>>

>> Note that the final patch can only be merged after out-of-tree platforms

>> have switched from ArmDmaLib to NonCoherentDmaLib.

>

> For 4-6/6:

> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

>


Thanks,

#1 - #5 merged as

7385d2543e2a EmbeddedPkg: rename NullDmaLib to CoherentDmaLib
0bcb80106762 EmbeddedPkg/CoherentDmaLib: add support for non-1:1 DMA translation
723102c72fb0 EmbeddedPkg: implement NonCoherentDmaLib based on ArmDmaLib
c878cd95e132 Omap35xxPkg: switch to EmbeddedPkg's NonCoherentDmaLib
877f4460b3e3 BeagleBoardPkg: switch to generic non-coherent DmaLib

#6 needs to wait until the edk2-platforms changes are in.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Sept. 1, 2017, 12:01 p.m. UTC | #3
On 30 August 2017 at 14:17, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 30 August 2017 at 14:06, Leif Lindholm <leif.lindholm@linaro.org> wrote:

>> On Wed, Aug 30, 2017 at 09:21:02AM +0100, Ard Biesheuvel wrote:

>>> Currently, we have two DmaLib implementations: a cache coherent one called

>>> 'NullDmaLib' residing in EmbeddedPkg, and a non-cache coherent one called

>>> 'ArmDmaLib', residinh in ArmPkg.

>>>

>>> In both cases, this is slightly awkward: NullDmaLib suggests no functionality

>>> whatsoever, which is slightly misleading because 'nothing' is the correct

>>> action in case of cache coherent DMA, rather than a lack of action. As for

>>> ArmDmalib, this was never specific to ARM, and no longer depends on anything

>>> that ArmPkg provides, so it does not really belong in ArmPkg anymore.

>>>

>>> So let's rename them to CoherentDmaLib and NonCoherentDmaLib, respectively,

>>> and move that latter into EmbeddedPkg where it arguably belongs. To align

>>> the two further, add support for non-1:1 DMA mappings to CoherentDmaLib as

>>> well.

>>>

>>> Note that the final patch can only be merged after out-of-tree platforms

>>> have switched from ArmDmaLib to NonCoherentDmaLib.

>>

>> For 4-6/6:

>> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

>>

>

> Thanks,

>

> #1 - #5 merged as

>

> 7385d2543e2a EmbeddedPkg: rename NullDmaLib to CoherentDmaLib

> 0bcb80106762 EmbeddedPkg/CoherentDmaLib: add support for non-1:1 DMA translation

> 723102c72fb0 EmbeddedPkg: implement NonCoherentDmaLib based on ArmDmaLib

> c878cd95e132 Omap35xxPkg: switch to EmbeddedPkg's NonCoherentDmaLib

> 877f4460b3e3 BeagleBoardPkg: switch to generic non-coherent DmaLib

>

> #6 needs to wait until the edk2-platforms changes are in.


#6 pushed as 63ed4d2757eb

Thanks.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel