summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap
diff options
context:
space:
mode:
authorDaniel Schultz <d.schultz@phytec.de>2017-01-26 09:25:44 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-30 07:25:18 +0100
commit80807102b904fbd418621a5865a3796107b3684d (patch)
tree7bcc6801d1ae0a7827f2aed6bc7176cd39dac02f /arch/arm/mach-omap
parentaa01ab27ffbee9a225cf96576c94f31986820b7e (diff)
downloadbarebox-80807102b904fbd418621a5865a3796107b3684d.tar.gz
barebox-80807102b904fbd418621a5865a3796107b3684d.tar.xz
arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT
This patch is based on a patch from the U-Boot and fixes two errors with the LCDC. Original commit message from Jyri Sarha [1]: "Initialize EMIF OCP_CONFIG registers REG_COS_COUNT_1, REG_COS_COUNT_2, and REG_PR_OLD_COUNT field for Beaglebone-Black and am335x-evm. With the default values LCDC suffers from DMA FIFO underflows and frame synchronization lost errors. The initialization values are the highest that work flawlessly when heavy memory load is generated by CPU. 32bpp colors were used in the test. On BBB the video mode used 110MHz pixel clock. The mode supported by the panel of am335x-evm uses 30MHz pixel clock." The register values are generated by testing, because there is no formula to calculate them. Also from Jyri Sarha [1]: "In practice the only rule to find an optimal value is to find as high as possible REG_PR_OLD_COUNT value that does not produce LCDC FIFO underflows under worst case scenario. The worst case happens when the highest pixel clock videomode with maximum bpp is used while memory subsystem is stressed by endless stream of writes hitting the same memory memory bank (can be the same address)." It only contains the BeagleBone Black and the Phytec SoM, because I don't have other boards. [1] https://patchwork.ozlabs.org/patch/704013/ Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap')
-rw-r--r--arch/arm/mach-omap/am33xx_generic.c3
-rw-r--r--arch/arm/mach-omap/include/mach/am33xx-silicon.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index 5eead5c589..513746248e 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -341,6 +341,9 @@ void am33xx_config_sdram(const struct am33xx_emif_regs *regs)
writel(regs->emif_tim3, AM33XX_EMIF4_0_REG(SDRAM_TIM_3));
writel(regs->emif_tim3, AM33XX_EMIF4_0_REG(SDRAM_TIM_3_SHADOW));
+ if (regs->ocp_config)
+ writel(regs->ocp_config, AM33XX_EMIF4_0_REG(OCP_CONFIG));
+
if (regs->zq_config) {
/*
* A value of 0x2800 for the REF CTRL will give us
diff --git a/arch/arm/mach-omap/include/mach/am33xx-silicon.h b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
index 10595d5ee7..0729369255 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-silicon.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-silicon.h
@@ -114,6 +114,7 @@
#define EMIF4_SDRAM_TIM_3_SHADOW 0x2C
#define EMIF0_SDRAM_MGMT_CTRL 0x38
#define EMIF0_SDRAM_MGMT_CTRL_SHD 0x3C
+#define EMIF4_OCP_CONFIG 0x54
#define EMIF4_ZQ_CONFIG 0xC8
#define EMIF4_DDR_PHY_CTRL_1 0xE4
#define EMIF4_DDR_PHY_CTRL_1_SHADOW 0xE8
@@ -217,6 +218,7 @@ struct am33xx_emif_regs {
u32 emif_tim1;
u32 emif_tim2;
u32 emif_tim3;
+ u32 ocp_config;
u32 sdram_config;
u32 sdram_config2;
u32 zq_config;