mpc83xx: Migrate arbiter config to Kconfig

Migrate the arbiter configuration to Kconfig.

Signed-off-by: Mario Six <mario.six@gdsys.cc>
This commit is contained in:
Mario Six
2019-01-21 09:18:12 +01:00
parent ba463c1169
commit 73df96a38e
69 changed files with 269 additions and 172 deletions

View File

@@ -295,6 +295,7 @@ source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig"
source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig"
source "arch/powerpc/cpu/mpc83xx/hid/Kconfig"
source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig"
source "arch/powerpc/cpu/mpc83xx/arbiter/Kconfig"
menu "Legacy options"

View File

@@ -0,0 +1,139 @@
menu "Arbiter"
choice
prompt "Pipeline depth"
config ACR_PIPE_DEP_UNSET
bool "Don't set value"
config ACR_PIPE_DEP_1
bool "1"
config ACR_PIPE_DEP_2
bool "2"
config ACR_PIPE_DEP_3
bool "3"
config ACR_PIPE_DEP_4
bool "4"
endchoice
choice
prompt "Repeat count"
config ACR_RPTCNT_UNSET
bool "Don't set value"
config ACR_RPTCNT_1
bool "1"
config ACR_RPTCNT_2
bool "2"
config ACR_RPTCNT_3
bool "3"
config ACR_RPTCNT_4
bool "4"
config ACR_RPTCNT_5
bool "5"
config ACR_RPTCNT_6
bool "6"
config ACR_RPTCNT_7
bool "7"
config ACR_RPTCNT_8
bool "8"
endchoice
choice
prompt "Address parking"
config ACR_APARK_UNSET
bool "Don't set value"
config ACR_APARK_MASTER
bool "Park to master"
config ACR_APARK_LAST
bool "Park to last owner"
config ACR_APARK_DISABLE
bool "Disabled"
endchoice
choice
prompt "Parking master"
config ACR_PARKM_UNSET
bool "Don't set value"
config ACR_PARKM_E300
bool "e300 core"
config ACR_PARKM_TSEC_1_2
bool "TSEC1, TSEC2"
config ACR_PARKM_USB_I2C1_BOOT
bool "USB/I2C1_BOOT"
config ACR_PARKM_DMA_ESDHC_USB
bool "DMA, ESDHC, USB"
config ACR_PARKM_PEX
bool "PCI Express"
if MPC83XX_QUICC_ENGINE
config ACR_PARKM_ENC_CORE
bool "Encryption core"
endif
endchoice
config ACR_PIPE_DEP
hex
default 0x0 if ACR_PIPE_DEP_UNSET
default 0x0 if ACR_PIPE_DEP_1
default 0x10000 if ACR_PIPE_DEP_2
default 0x20000 if ACR_PIPE_DEP_3
default 0x30000 if ACR_PIPE_DEP_4
config ACR_RPTCNT
hex
default 0x0 if ACR_RPTCNT_UNSET
default 0x0 if ACR_RPTCNT_1
default 0x100 if ACR_RPTCNT_2
default 0x200 if ACR_RPTCNT_3
default 0x300 if ACR_RPTCNT_4
default 0x400 if ACR_RPTCNT_5
default 0x500 if ACR_RPTCNT_6
default 0x600 if ACR_RPTCNT_7
default 0x700 if ACR_RPTCNT_8
config ACR_APARK
hex
default 0x0 if ACR_APARK_UNSET
default 0x0 if ACR_APARK_MASTER
default 0x10 if ACR_APARK_LAST
default 0x20 if ACR_APARK_DISABLE
config ACR_PARKM
hex
default 0x0 if ACR_PARKM_UNSET
default 0x0 if ACR_PARKM_E300
default 0x2 if ACR_PARKM_TSEC_1_2
default 0x3 if ACR_PARKM_USB_I2C1_BOOT
default 0x4 if ACR_PARKM_DMA_ESDHC_USB
default 0x5 if ACR_PARKM_PEX
default 0x5 if ACR_PARKM_ENC_CORE
endmenu

View File

@@ -0,0 +1,28 @@
const __be32 acr_mask =
#ifndef CONFIG_ACR_PIPE_DEP_UNSET
ACR_PIPE_DEP |
#endif
#ifndef CONFIG_ACR_RPTCNT_UNSET
ACR_RPTCNT |
#endif
#ifndef CONFIG_ACR_APARK_UNSET
ACR_APARK |
#endif
#ifndef CONFIG_ACR_PARKM_UNSET
ACR_PARKM |
#endif
0;
const __be32 acr_val =
#ifndef CONFIG_ACR_PIPE_DEP_UNSET
CONFIG_ACR_PIPE_DEP |
#endif
#ifndef CONFIG_ACR_RPTCNT_UNSET
CONFIG_ACR_RPTCNT |
#endif
#ifndef CONFIG_ACR_APARK_UNSET
CONFIG_ACR_APARK |
#endif
#ifndef CONFIG_ACR_PARKM_UNSET
CONFIG_ACR_PARKM |
#endif
0;

View File

@@ -15,6 +15,7 @@
#include "lblaw/lblaw.h"
#include "elbc/elbc.h"
#include "sysio/sysio.h"
#include "arbiter/arbiter.h"
DECLARE_GLOBAL_DATA_PTR;
@@ -51,34 +52,6 @@ static void config_qe_ioports(void)
*/
void cpu_init_f (volatile immap_t * im)
{
__be32 acr_mask =
#ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
ACR_PIPE_DEP |
#endif
#ifdef CONFIG_SYS_ACR_RPTCNT /* Arbiter repeat count */
ACR_RPTCNT |
#endif
#ifdef CONFIG_SYS_ACR_APARK /* Arbiter address parking mode */
ACR_APARK |
#endif
#ifdef CONFIG_SYS_ACR_PARKM /* Arbiter parking master */
ACR_PARKM |
#endif
0;
__be32 acr_val =
#ifdef CONFIG_SYS_ACR_PIPE_DEP /* Arbiter pipeline depth */
(CONFIG_SYS_ACR_PIPE_DEP << ACR_PIPE_DEP_SHIFT) |
#endif
#ifdef CONFIG_SYS_ACR_RPTCNT /* Arbiter repeat count */
(CONFIG_SYS_ACR_RPTCNT << ACR_RPTCNT_SHIFT) |
#endif
#ifdef CONFIG_SYS_ACR_APARK /* Arbiter address parking mode */
(CONFIG_SYS_ACR_APARK << ACR_APARK_SHIFT) |
#endif
#ifdef CONFIG_SYS_ACR_PARKM /* Arbiter parking master */
(CONFIG_SYS_ACR_PARKM << ACR_PARKM_SHIFT) |
#endif
0;
__be32 spcr_mask =
#ifdef CONFIG_SYS_SPCR_OPT /* Optimize transactions between CSB and other dev */
SPCR_OPT |

View File

@@ -27,16 +27,16 @@ void cpu_init_f (volatile immap_t * im)
/* system performance tweaking */
#ifdef CONFIG_SYS_ACR_PIPE_DEP
#ifndef CONFIG_ACR_PIPE_DEP_UNSET
/* Arbiter pipeline depth */
im->arbiter.acr = (im->arbiter.acr & ~ACR_PIPE_DEP) |
(CONFIG_SYS_ACR_PIPE_DEP << ACR_PIPE_DEP_SHIFT);
CONFIG_ACR_PIPE_DEP;
#endif
#ifdef CONFIG_SYS_ACR_RPTCNT
#ifndef CONFIG_ACR_RPTCNT_UNSET
/* Arbiter repeat count */
im->arbiter.acr = (im->arbiter.acr & ~(ACR_RPTCNT)) |
(CONFIG_SYS_ACR_RPTCNT << ACR_RPTCNT_SHIFT);
CONFIG_ACR_RPTCNT;
#endif
#ifdef CONFIG_SYS_SPCR_OPT