* [PATCH] Omap35xxPkg, BeagleBoardPkg: Use Pcd for INTERRUPT_BASE
@ 2016-11-27 23:26 Leif Lindholm
2016-12-05 16:40 ` Ard Biesheuvel
0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2016-11-27 23:26 UTC (permalink / raw)
To: edk2-devel; +Cc: Ard Biesheuvel, Andrew Fish
The base address for the interrupt controller is hard-coded in
Omap3530Interrupt.h, although Omap35xxPkg/InterruptDxe appears to
have initially intended to make use of PcdInterruptBaseAddress from
EmbeddedPkg. Move it to use said Pcd, and also declare use of it in
BeagleBoardLib, which makes a direct access.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---
Linux uses the same driver for OMAP2/OMAP3 and the AM3xxx variants,
so this tweak should make it possible to reuse across different
platforms.
BeagleBoardPkg/BeagleBoardPkg.dsc | 4 ++++
BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf | 3 +++
Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h | 5 ++++-
Omap35xxPkg/Omap35xxPkg.dsc | 4 ++++
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/BeagleBoardPkg/BeagleBoardPkg.dsc b/BeagleBoardPkg/BeagleBoardPkg.dsc
index f40095a..9b4142f 100644
--- a/BeagleBoardPkg/BeagleBoardPkg.dsc
+++ b/BeagleBoardPkg/BeagleBoardPkg.dsc
@@ -3,6 +3,7 @@
#
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -359,6 +360,9 @@
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000
+ # OMAP Interrupt Controller
+ gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x48200000
+
# We want to use the Shell Libraries but don't want it to initialise
# automatically. We initialise the libraries when the command is called by the
# Shell.
diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
index b1139a4..e004d6f 100644
--- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
+++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
@@ -1,5 +1,6 @@
#/* @file
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+# Copyright (c) 2016, Linaro Ltd. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -52,3 +53,5 @@
gArmTokenSpaceGuid.PcdSystemMemoryBase
gArmTokenSpaceGuid.PcdSystemMemorySize
+
+ gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress
diff --git a/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h b/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
index 774d873..d8d727e 100644
--- a/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
+++ b/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
@@ -1,6 +1,7 @@
/** @file
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -15,7 +16,9 @@
#ifndef __OMAP3530INTERRUPT_H__
#define __OMAP3530INTERRUPT_H__
-#define INTERRUPT_BASE (0x48200000)
+#include <Library/PcdLib.h>
+
+#define INTERRUPT_BASE (PcdGet32 (PcdInterruptBaseAddress))
#define INT_NROF_VECTORS (96)
#define MAX_VECTOR (INT_NROF_VECTORS - 1)
diff --git a/Omap35xxPkg/Omap35xxPkg.dsc b/Omap35xxPkg/Omap35xxPkg.dsc
index 4a3317f..436c10b 100644
--- a/Omap35xxPkg/Omap35xxPkg.dsc
+++ b/Omap35xxPkg/Omap35xxPkg.dsc
@@ -2,6 +2,7 @@
# Omap35xx SoC package.
#
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
+# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -159,6 +160,9 @@
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000
+ # OMAP Interrupt Controller
+ gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x48200000
+
#
# ARM Pcds
#
--
2.10.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Omap35xxPkg, BeagleBoardPkg: Use Pcd for INTERRUPT_BASE
2016-11-27 23:26 [PATCH] Omap35xxPkg, BeagleBoardPkg: Use Pcd for INTERRUPT_BASE Leif Lindholm
@ 2016-12-05 16:40 ` Ard Biesheuvel
2016-12-05 17:24 ` Leif Lindholm
0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2016-12-05 16:40 UTC (permalink / raw)
To: Leif Lindholm; +Cc: edk2-devel@lists.01.org, Andrew Fish
On 27 November 2016 at 23:26, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> The base address for the interrupt controller is hard-coded in
> Omap3530Interrupt.h, although Omap35xxPkg/InterruptDxe appears to
> have initially intended to make use of PcdInterruptBaseAddress from
> EmbeddedPkg. Move it to use said Pcd, and also declare use of it in
> BeagleBoardLib, which makes a direct access.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>
> Linux uses the same driver for OMAP2/OMAP3 and the AM3xxx variants,
> so this tweak should make it possible to reuse across different
> platforms.
>
> BeagleBoardPkg/BeagleBoardPkg.dsc | 4 ++++
> BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf | 3 +++
> Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h | 5 ++++-
> Omap35xxPkg/Omap35xxPkg.dsc | 4 ++++
> 4 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/BeagleBoardPkg/BeagleBoardPkg.dsc b/BeagleBoardPkg/BeagleBoardPkg.dsc
> index f40095a..9b4142f 100644
> --- a/BeagleBoardPkg/BeagleBoardPkg.dsc
> +++ b/BeagleBoardPkg/BeagleBoardPkg.dsc
> @@ -3,6 +3,7 @@
> #
> # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
> # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
> #
> # This program and the accompanying materials
> # are licensed and made available under the terms and conditions of the BSD License
> @@ -359,6 +360,9 @@
> gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77
> gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000
>
> + # OMAP Interrupt Controller
> + gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x48200000
> +
> # We want to use the Shell Libraries but don't want it to initialise
> # automatically. We initialise the libraries when the command is called by the
> # Shell.
> diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> index b1139a4..e004d6f 100644
> --- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> +++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> @@ -1,5 +1,6 @@
> #/* @file
> # Copyright (c) 2011-2013, ARM Limited. All rights reserved.
> +# Copyright (c) 2016, Linaro Ltd. All rights reserved.
> #
> # This program and the accompanying materials
> # are licensed and made available under the terms and conditions of the BSD License
> @@ -52,3 +53,5 @@
>
> gArmTokenSpaceGuid.PcdSystemMemoryBase
> gArmTokenSpaceGuid.PcdSystemMemorySize
> +
> + gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress
> diff --git a/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h b/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
> index 774d873..d8d727e 100644
> --- a/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
> +++ b/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
> @@ -1,6 +1,7 @@
> /** @file
>
> Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
> + Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
>
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD License
> @@ -15,7 +16,9 @@
> #ifndef __OMAP3530INTERRUPT_H__
> #define __OMAP3530INTERRUPT_H__
>
> -#define INTERRUPT_BASE (0x48200000)
> +#include <Library/PcdLib.h>
> +
> +#define INTERRUPT_BASE (PcdGet32 (PcdInterruptBaseAddress))
>
> #define INT_NROF_VECTORS (96)
> #define MAX_VECTOR (INT_NROF_VECTORS - 1)
> diff --git a/Omap35xxPkg/Omap35xxPkg.dsc b/Omap35xxPkg/Omap35xxPkg.dsc
> index 4a3317f..436c10b 100644
> --- a/Omap35xxPkg/Omap35xxPkg.dsc
> +++ b/Omap35xxPkg/Omap35xxPkg.dsc
> @@ -2,6 +2,7 @@
> # Omap35xx SoC package.
> #
> # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
> +# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
> #
> # This program and the accompanying materials
> # are licensed and made available under the terms and conditions of the BSD License
> @@ -159,6 +160,9 @@
> gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77
> gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000
>
> + # OMAP Interrupt Controller
> + gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x48200000
> +
> #
> # ARM Pcds
> #
> --
> 2.10.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Omap35xxPkg, BeagleBoardPkg: Use Pcd for INTERRUPT_BASE
2016-12-05 16:40 ` Ard Biesheuvel
@ 2016-12-05 17:24 ` Leif Lindholm
0 siblings, 0 replies; 3+ messages in thread
From: Leif Lindholm @ 2016-12-05 17:24 UTC (permalink / raw)
To: Ard Biesheuvel; +Cc: edk2-devel@lists.01.org, Andrew Fish
On Mon, Dec 05, 2016 at 04:40:44PM +0000, Ard Biesheuvel wrote:
> On 27 November 2016 at 23:26, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > The base address for the interrupt controller is hard-coded in
> > Omap3530Interrupt.h, although Omap35xxPkg/InterruptDxe appears to
> > have initially intended to make use of PcdInterruptBaseAddress from
> > EmbeddedPkg. Move it to use said Pcd, and also declare use of it in
> > BeagleBoardLib, which makes a direct access.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
>
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Thanks!
Pushed as 209b8f3.
/
Leif
> > ---
> >
> > Linux uses the same driver for OMAP2/OMAP3 and the AM3xxx variants,
> > so this tweak should make it possible to reuse across different
> > platforms.
> >
> > BeagleBoardPkg/BeagleBoardPkg.dsc | 4 ++++
> > BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf | 3 +++
> > Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h | 5 ++++-
> > Omap35xxPkg/Omap35xxPkg.dsc | 4 ++++
> > 4 files changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/BeagleBoardPkg/BeagleBoardPkg.dsc b/BeagleBoardPkg/BeagleBoardPkg.dsc
> > index f40095a..9b4142f 100644
> > --- a/BeagleBoardPkg/BeagleBoardPkg.dsc
> > +++ b/BeagleBoardPkg/BeagleBoardPkg.dsc
> > @@ -3,6 +3,7 @@
> > #
> > # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
> > # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
> > +# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
> > #
> > # This program and the accompanying materials
> > # are licensed and made available under the terms and conditions of the BSD License
> > @@ -359,6 +360,9 @@
> > gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77
> > gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000
> >
> > + # OMAP Interrupt Controller
> > + gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x48200000
> > +
> > # We want to use the Shell Libraries but don't want it to initialise
> > # automatically. We initialise the libraries when the command is called by the
> > # Shell.
> > diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> > index b1139a4..e004d6f 100644
> > --- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> > +++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardLib.inf
> > @@ -1,5 +1,6 @@
> > #/* @file
> > # Copyright (c) 2011-2013, ARM Limited. All rights reserved.
> > +# Copyright (c) 2016, Linaro Ltd. All rights reserved.
> > #
> > # This program and the accompanying materials
> > # are licensed and made available under the terms and conditions of the BSD License
> > @@ -52,3 +53,5 @@
> >
> > gArmTokenSpaceGuid.PcdSystemMemoryBase
> > gArmTokenSpaceGuid.PcdSystemMemorySize
> > +
> > + gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress
> > diff --git a/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h b/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
> > index 774d873..d8d727e 100644
> > --- a/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
> > +++ b/Omap35xxPkg/Include/Omap3530/Omap3530Interrupt.h
> > @@ -1,6 +1,7 @@
> > /** @file
> >
> > Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
> > + Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
> >
> > This program and the accompanying materials
> > are licensed and made available under the terms and conditions of the BSD License
> > @@ -15,7 +16,9 @@
> > #ifndef __OMAP3530INTERRUPT_H__
> > #define __OMAP3530INTERRUPT_H__
> >
> > -#define INTERRUPT_BASE (0x48200000)
> > +#include <Library/PcdLib.h>
> > +
> > +#define INTERRUPT_BASE (PcdGet32 (PcdInterruptBaseAddress))
> >
> > #define INT_NROF_VECTORS (96)
> > #define MAX_VECTOR (INT_NROF_VECTORS - 1)
> > diff --git a/Omap35xxPkg/Omap35xxPkg.dsc b/Omap35xxPkg/Omap35xxPkg.dsc
> > index 4a3317f..436c10b 100644
> > --- a/Omap35xxPkg/Omap35xxPkg.dsc
> > +++ b/Omap35xxPkg/Omap35xxPkg.dsc
> > @@ -2,6 +2,7 @@
> > # Omap35xx SoC package.
> > #
> > # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
> > +# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
> > #
> > # This program and the accompanying materials
> > # are licensed and made available under the terms and conditions of the BSD License
> > @@ -159,6 +160,9 @@
> > gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77
> > gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000
> >
> > + # OMAP Interrupt Controller
> > + gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x48200000
> > +
> > #
> > # ARM Pcds
> > #
> > --
> > 2.10.2
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-05 17:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-27 23:26 [PATCH] Omap35xxPkg, BeagleBoardPkg: Use Pcd for INTERRUPT_BASE Leif Lindholm
2016-12-05 16:40 ` Ard Biesheuvel
2016-12-05 17:24 ` Leif Lindholm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox