ARM: mvebu: a38x: updates
Subsystems (3)
cover ARM: mvebu: a38x: updates
This small series represents some low hanging fruit needed before we can bring in the updated version of Marvell's DDR training code. These are things that really shouldn't have been part of the DDR code in the first place but for one reason or another ended up there.
Patch 2 is borrowed in part from commit 09275c77 in
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell.git
Chris Packham (2):
ARM: mvebu: a38x: move definition of PEX_CFG_DIRECT_ACCESS
ARM: mvebu: a38x: move sys_env_device_rev_get
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h | 1 + arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c | 24 ++++++++++++++++++++++ .../ddr/marvell/a38x/ddr3_hws_hw_training_def.h | 2 -- drivers/ddr/marvell/a38x/ddr3_init.c | 24 ---------------------- 4 files changed, 25 insertions(+), 26 deletions(-)
Signature · 1 line
2.16.2
PATCH 1/2 ARM: mvebu: a38x: move definition of PEX_CFG_DIRECT_ACCESS
PEX_CFG_DIRECT_ACCESS was defined in ddr3_hws_hw_training_def.h despite only being used in the serdes code. Move this definition to ctrl_pex.h where all the other PEX defines are. Also remove the duplicate definition of PEX_DEVICE_AND_VENDOR_ID which is already defined in ctrl_pex.h.
---
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h | 1 + drivers/ddr/marvell/a38x/ddr3_hws_hw_training_def.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
arch/arm/mach-mvebu/serdes/a38x/ctrl_pex.h +1 -0
@@ -47,6 +47,7 @@/* Controller revision info */ #define PEX_DEVICE_AND_VENDOR_ID 0x000 +#define PEX_CFG_DIRECT_ACCESS (if, reg) (PEX_IF_REGS_BASE(if) + (reg))/* PCI Express Configuration Address Register */ #define PXCAR_REG_NUM_OFFS 2
drivers/ddr/marvell/a38x/ddr3_hws_hw_training_def.h +0 -2
@@ -422,8 +422,6 @@/* Power Management Clock Gating Control Register */ #define POWER_MNG_CTRL_REG 0x18220 -#define PEX_DEVICE_AND_VENDOR_ID 0x000 -#define PEX_CFG_DIRECT_ACCESS (if, reg) (PEX_IF_REGS_BASE(if) + (reg))#define PMC_PEXSTOPCLOCK_OFFS (p) ((p) < 8 ? (5 + (p)) : (18 + (p)))#define PMC_PEXSTOPCLOCK_MASK (p) (1 << PMC_PEXSTOPCLOCK_OFFS(p))#define PMC_PEXSTOPCLOCK_EN (p) (1 << PMC_PEXSTOPCLOCK_OFFS(p))
Signature · 1 line
2.16.2
PATCH 2/2 ARM: mvebu: a38x: move sys_env_device_rev_get
In reply to Chris PackhamMove sys_env_device_rev_get() from the ddr training code to sys_env_lib.c (which currently resides with the serdes code). This brings sys_env_device_rev_get() into line with sys_env_device_id_get() and sys_env_model_get().
---
arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c | 24 ++++++++++++++++++++++++ drivers/ddr/marvell/a38x/ddr3_init.c | 24 ------------------------ 2 files changed, 24 insertions(+), 24 deletions(-)
arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c +24 -0
@@ -235,3 +235,27 @@ u32 sys_env_device_id_get(void)return g_dev_id; } + +/* +* sys_env_device_rev_get - Get Marvell controller device revision number +* +* DESCRIPTION: +* This function returns 8bit describing the device revision as defined +* Revision ID Register. +* +* INPUT: +* None. +* +* OUTPUT: +* None. +* +* RETURN: +* 8bit desscribing Marvell controller revision number +*/ +u8 sys_env_device_rev_get (void ) +{ +u32 value; + + value =reg_read (DEV_VERSION_ID_REG ); +return (value & (REVISON_ID_MASK )) >>REVISON_ID_OFFS ; +}
drivers/ddr/marvell/a38x/ddr3_init.c +0 -24
@@ -108,30 +108,6 @@ static int ddr3_hws_tune_training_params(u8 dev_num);/* A39x revisions */ #define MV_88F69XX_Z1_ID 0x2 -/* -* sys_env_device_rev_get - Get Marvell controller device revision number -* -* DESCRIPTION: -* This function returns 8bit describing the device revision as defined -* Revision ID Register. -* -* INPUT: -* None. -* -* OUTPUT: -* None. -* -* RETURN: -* 8bit desscribing Marvell controller revision number -*/ -u8 sys_env_device_rev_get (void ) -{ -u32 value; - - value =reg_read (DEV_VERSION_ID_REG ); -return (value & (REVISON_ID_MASK )) >>REVISON_ID_OFFS ; -} -/* * sys_env_dlb_config_ptr_get *
Signature · 1 line
2.16.2