diff mbox series

[v2,1/2] ARM: cache: Allow SPL to build cache-pl310.c

Message ID 20220804105646.2285428-1-pro@denx.de
State Changes Requested
Delegated to: Tom Rini
Headers show
Series [v2,1/2] ARM: cache: Allow SPL to build cache-pl310.c | expand

Commit Message

Philip Oberfichtner Aug. 4, 2022, 10:56 a.m. UTC
Before this commit, the SPL could enable the PL310 L2 cache [1], but the
cache maintenance functions from cache-pl310.c were only useable for
non-SPL builds.

After enabling the cache one must be able to flush it, too. Thus this
commit allows cache-pl310.c to be included in the SPL build.

[1] See for example arch/arm/mach-imx/cache.c: v7_outer_cache_enable()

Signed-off-by: Philip Oberfichtner <pro@denx.de>
---

(no changes since v1)

 arch/arm/lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Aug. 4, 2022, 11:05 a.m. UTC | #1
On Thu, Aug 04, 2022 at 12:56:45PM +0200, Philip Oberfichtner wrote:

> Before this commit, the SPL could enable the PL310 L2 cache [1], but the
> cache maintenance functions from cache-pl310.c were only useable for
> non-SPL builds.
> 
> After enabling the cache one must be able to flush it, too. Thus this
> commit allows cache-pl310.c to be included in the SPL build.
> 
> [1] See for example arch/arm/mach-imx/cache.c: v7_outer_cache_enable()
> 
> Signed-off-by: Philip Oberfichtner <pro@denx.de>

It should be rather direct to migrate this to Kconfig, please do that
first, and introduce CONFIG_SPL_SYS_L2_PL310.  Thanks!
Philip Oberfichtner Aug. 8, 2022, 12:29 p.m. UTC | #2
On Thu, 2022-08-04 at 07:05 -0400, Tom Rini wrote:
> On Thu, Aug 04, 2022 at 12:56:45PM +0200, Philip Oberfichtner wrote:
> 
> > Before this commit, the SPL could enable the PL310 L2 cache [1],
> > but the
> > cache maintenance functions from cache-pl310.c were only useable
> > for
> > non-SPL builds.
> > 
> > After enabling the cache one must be able to flush it, too. Thus
> > this
> > commit allows cache-pl310.c to be included in the SPL build.
> > 
> > [1] See for example arch/arm/mach-imx/cache.c:
> > v7_outer_cache_enable()
> > 
> > Signed-off-by: Philip Oberfichtner <pro@denx.de>
> 
> It should be rather direct to migrate this to Kconfig, please do that
> first, and introduce CONFIG_SPL_SYS_L2_PL310.  Thanks!
> 

Hi,

converting CONFIG_SYS_L2_PL310 - no problem. For SYS_PL310_BASE the
moveconfig tool just hangs indefinitely on every defconfig that needs
conversion. Do you have any hints on this issue?

Below the Kconfig entry, that I used.

config SYS_PL310_BASE
       depends on SYS_L2_PL310
       hex "Base address of PL310"
       help
         Physical base address of PL310 controller register space
Marek Vasut Aug. 8, 2022, 12:52 p.m. UTC | #3
On 8/8/22 14:29, Philip Oberfichtner wrote:
> 
> 
> On Thu, 2022-08-04 at 07:05 -0400, Tom Rini wrote:
>> On Thu, Aug 04, 2022 at 12:56:45PM +0200, Philip Oberfichtner wrote:
>>
>>> Before this commit, the SPL could enable the PL310 L2 cache [1],
>>> but the
>>> cache maintenance functions from cache-pl310.c were only useable
>>> for
>>> non-SPL builds.
>>>
>>> After enabling the cache one must be able to flush it, too. Thus
>>> this
>>> commit allows cache-pl310.c to be included in the SPL build.
>>>
>>> [1] See for example arch/arm/mach-imx/cache.c:
>>> v7_outer_cache_enable()
>>>
>>> Signed-off-by: Philip Oberfichtner <pro@denx.de>
>>
>> It should be rather direct to migrate this to Kconfig, please do that
>> first, and introduce CONFIG_SPL_SYS_L2_PL310.  Thanks!
>>
> 
> Hi,
> 
> converting CONFIG_SYS_L2_PL310 - no problem. For SYS_PL310_BASE the
> moveconfig tool just hangs indefinitely on every defconfig that needs
> conversion. Do you have any hints on this issue?
> 
> Below the Kconfig entry, that I used.
> 
> config SYS_PL310_BASE
>         depends on SYS_L2_PL310
>         hex "Base address of PL310"

Try adding default values for known architectures/socs (use git grep in 
include/configs/ and sort -u to find out)
default 0x1234ab00 if ARCH_FOO
default 0x4321cd00 if ARCH_BAR

>         help
>           Physical base address of PL310 controller register space
Tom Rini Aug. 8, 2022, 1:35 p.m. UTC | #4
On Mon, Aug 08, 2022 at 02:29:02PM +0200, Philip Oberfichtner wrote:
> 
> 
> On Thu, 2022-08-04 at 07:05 -0400, Tom Rini wrote:
> > On Thu, Aug 04, 2022 at 12:56:45PM +0200, Philip Oberfichtner wrote:
> > 
> > > Before this commit, the SPL could enable the PL310 L2 cache [1],
> > > but the
> > > cache maintenance functions from cache-pl310.c were only useable
> > > for
> > > non-SPL builds.
> > > 
> > > After enabling the cache one must be able to flush it, too. Thus
> > > this
> > > commit allows cache-pl310.c to be included in the SPL build.
> > > 
> > > [1] See for example arch/arm/mach-imx/cache.c:
> > > v7_outer_cache_enable()
> > > 
> > > Signed-off-by: Philip Oberfichtner <pro@denx.de>
> > 
> > It should be rather direct to migrate this to Kconfig, please do that
> > first, and introduce CONFIG_SPL_SYS_L2_PL310.  Thanks!
> > 
> 
> Hi,
> 
> converting CONFIG_SYS_L2_PL310 - no problem. For SYS_PL310_BASE the
> moveconfig tool just hangs indefinitely on every defconfig that needs
> conversion. Do you have any hints on this issue?
> 
> Below the Kconfig entry, that I used.
> 
> config SYS_PL310_BASE
>        depends on SYS_L2_PL310
>        hex "Base address of PL310"
>        help
>          Physical base address of PL310 controller register space

We can just skip that one for the moment, it's a bit tricky. It
shouldn't be asked for as it's not configurable, it needs to be a list
of default X if ARCH_Y. Thanks for looking at this one too!
diff mbox series

Patch

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index c603fe61bc..ac1d4245bb 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -33,7 +33,6 @@  obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
 obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
-obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 else
 obj-$(CONFIG_$(SPL_TPL_)FRAMEWORK) += spl.o
 obj-$(CONFIG_SPL_FRAMEWORK) += zimage.o
@@ -46,6 +45,7 @@  else
 obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o
 obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o
 endif
+obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += semihosting.o
 
 ifneq ($(filter y,$(CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR) $(CONFIG_SAVE_PREV_BL_FDT_ADDR)),)