powerpc: Migrate SYS_L3_SIZE to Kconfig

Introduce three options, one for each observed L3 cache size, and have
the size select'd as needed.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/powerpc/cpu/mpc85xx/Kconfig b/arch/powerpc/cpu/mpc85xx/Kconfig
index 7abfe26..24d3f1f 100644
--- a/arch/powerpc/cpu/mpc85xx/Kconfig
+++ b/arch/powerpc/cpu/mpc85xx/Kconfig
@@ -165,6 +165,7 @@
 	select BOARD_LATE_INIT if CHAIN_OF_TRUST
 	select FSL_CORENET
 	select PHYS_64BIT
+	select SYS_L3_SIZE_1024KB
 	imply CMD_SATA
 	imply FSL_SATA
 
@@ -182,6 +183,7 @@
 	select SUPPORT_SPL
 	select PHYS_64BIT
 	select FSL_DDR_INTERACTIVE
+	select SYS_L3_SIZE_256KB
 	imply CMD_EEPROM
 	imply PANIC_HANG
 
@@ -191,6 +193,7 @@
 	select BOARD_LATE_INIT if CHAIN_OF_TRUST
 	select SUPPORT_SPL
 	select PHYS_64BIT
+	select SYS_L3_SIZE_256KB
 
 config TARGET_T1042D4RDB
 	bool "Support T1042D4RDB"
@@ -198,6 +201,7 @@
 	select BOARD_LATE_INIT if CHAIN_OF_TRUST
 	select SUPPORT_SPL
 	select PHYS_64BIT
+	select SYS_L3_SIZE_256KB
 	imply PANIC_HANG
 
 config TARGET_T1042RDB_PI
@@ -206,6 +210,7 @@
 	select BOARD_LATE_INIT if CHAIN_OF_TRUST
 	select SUPPORT_SPL
 	select PHYS_64BIT
+	select SYS_L3_SIZE_256KB
 	imply PANIC_HANG
 
 config TARGET_T2080QDS
@@ -216,6 +221,7 @@
 	select PHYS_64BIT
 	select FSL_DDR_FIRST_SLOT_QUAD_CAPABLE
 	select FSL_DDR_INTERACTIVE
+	select SYS_L3_SIZE_512KB
 	imply CMD_SATA
 
 config TARGET_T2080RDB
@@ -224,6 +230,7 @@
 	select BOARD_LATE_INIT if CHAIN_OF_TRUST
 	select SUPPORT_SPL
 	select PHYS_64BIT
+	select SYS_L3_SIZE_512KB
 	imply CMD_SATA
 	imply PANIC_HANG
 
@@ -233,6 +240,7 @@
 	select SUPPORT_SPL
 	select PHYS_64BIT
 	select FSL_DDR_FIRST_SLOT_QUAD_CAPABLE
+	select SYS_L3_SIZE_512KB
 	imply CMD_SATA
 	imply PANIC_HANG
 
@@ -244,6 +252,7 @@
 	bool "Support kmcent2"
 	select VENDOR_KM
 	select FSL_CORENET
+	select SYS_L3_SIZE_256KB
 
 endchoice
 
@@ -1296,6 +1305,21 @@
 config BACKSIDE_L2_CACHE
 	bool
 
+config SYS_L3_SIZE_256KB
+	bool
+
+config SYS_L3_SIZE_512KB
+	bool
+
+config SYS_L3_SIZE_1024KB
+	bool
+
+config SYS_L3_SIZE
+	int
+	default 262144 if SYS_L3_SIZE_256KB
+	default 524288 if SYS_L3_SIZE_512KB
+	default 1048576 if SYS_L3_SIZE_512KB
+
 config SYS_PPC64
 	bool