
On Mon, Aug 22, 2016 at 12:28:19AM +0900, Masahiro Yamada wrote:
Hi Tom,
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index aef901c..15cd66a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -79,6 +79,11 @@ config SYS_ARM_ARCH default 4 if CPU_SA1100 default 8 if ARM64
+config SYS_CACHELINE_SIZE
int
default 64 if CPU_V7 || ARM64
Note! I had a brain fart here last night and used 'printf %x' when I thought I was doing 'printf %d', so, no, ARM64 should get moved up to shift 7 / 128 bytes.
default 32
I do not like this very much.
Next, I would need to change it to
config SYS_CACHELINE_SIZE int
default 128 if CACHE_UNIPHIER default 64 if CPU_V7 || ARM64 default 32
but I do not want to dirty the common place with my SoC-specific stuff.
Instead, can we have this part look like as follows?
config CACHE_SHIFT_7 bool
config CACHE_SHIFT_6 bool
config SYS_CACHELINE_SIZE int default 128 if CACHE_SHIFT_7 default 64 if CACHE_SHIFT_6 default 32
Then, my config option can select 'CACHE_SHIFT_7'.
config CACHE_UNIPHIER bool "Enable the UniPhier L2 cache controller" depends on ARCH_UNIPHIER_32BIT
select CACHE_SHIFT_7 default y
This idea was borrowed from Linux. (you can grep "_L1_CACHE_SHIFT" in Linux Kconfig files.)
I'm agreeable to moving over to shift to more obviously align with the Linux Kernel (and it will make other arches easier to migrate too). But the UniPhier case currently looks to me like it's overloading what CONFIG_SYS_CACHELINE_SIZE is doing, ie in the Linux Kernel it's not setting the shift to 7, in 32bit. Or is this a 64bit only feature? Thanks!