arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm
PATCH 1/1 arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm
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.
---
This patch have been part of TI's latest 2016LTS based release and has gone trough our regular tesing as a part of that. There has been no noticable side effects.
Cheers,
Jyri
arch/arm/cpu/armv7/am33xx/ddr.c | 4 ++++ arch/arm/include/asm/arch-am33xx/ddr_defs.h | 8 ++++++++ arch/arm/include/asm/emif.h | 1 + board/ti/am335x/board.c | 2 ++ 4 files changed, 15 insertions(+)
arch/arm/cpu/armv7/am33xx/ddr.c +4 -0
@@ -180,6 +180,10 @@ void config_sdram(const struct emif_regs *regs, int nr)writel (regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);writel (regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);writel (regs->sdram_config, &emif_reg[nr]->emif_sdram_config); + +/* Write REG_COS_COUNT_1, REG_COS_COUNT_2, and REG_PR_OLD_COUNT. */ +if (regs->ocp_config) +writel (regs->ocp_config, &emif_reg[nr]->emif_l3_config); }/**
arch/arm/include/asm/arch-am33xx/ddr_defs.h +8 -0
@@ -25,6 +25,14 @@#endif #define PHY_EN_DYN_PWRDN (0x1 << 20) +/** +* AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and +* REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame +* Synchronization Lost errors. +*/ +#define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414 +#define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3d +/* Micron MT47H128M16RT-25E */ #define MT47H128M16RT25E_EMIF_READ_LATENCY 0x100005#define MT47H128M16RT25E_EMIF_TIM1 0x0666B3C9
arch/arm/include/asm/emif.h +1 -0
@@ -1171,6 +1171,7 @@ struct emif_regs {u32 sdram_tim1;u32 sdram_tim2;u32 sdram_tim3; +u32 ocp_config;u32 read_idle_ctrl;u32 zq_config;u32 temp_alert_config;
board/ti/am335x/board.c +2 -0
@@ -201,6 +201,7 @@ static struct emif_regs ddr3_beagleblack_emif_reg_data = { .sdram_tim1 = MT41K256M16HA125E_EMIF_TIM1, .sdram_tim2 = MT41K256M16HA125E_EMIF_TIM2, .sdram_tim3 = MT41K256M16HA125E_EMIF_TIM3, + .ocp_config = EMIF_OCP_CONFIG_BEAGLEBONE_BLACK, .zq_config = MT41K256M16HA125E_ZQ_CFG, .emif_ddr_phy_ctlr_1 = MT41K256M16HA125E_EMIF_READ_LATENCY, };
@@ -211,6 +212,7 @@ static struct emif_regs ddr3_evm_emif_reg_data = { .sdram_tim1 = MT41J512M8RH125_EMIF_TIM1, .sdram_tim2 = MT41J512M8RH125_EMIF_TIM2, .sdram_tim3 = MT41J512M8RH125_EMIF_TIM3, + .ocp_config = EMIF_OCP_CONFIG_AM335X_EVM, .zq_config = MT41J512M8RH125_ZQ_CFG, .emif_ddr_phy_ctlr_1 =MT41J512M8RH125_EMIF_READ_LATENCY | PHY_EN_DYN_PWRDN,
Signature · 1 line
1.9.1
PATCH 1/1 arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm
Quoted 10 lines · Jyri Sarha
Initialize EMIF
OCP_CONFIGregistersREG_COS_COUNT_1,REG_COS_COUNT_2, andREG_PR_OLD_COUNTfield 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.Signed-off-by Jyri Sarha <[email protected]>
[snip]
Quoted 5 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +0
-0
arch/arm/include/asm/arch-am33xx/ddr_defs.h line 34
Quoted 10 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +7
-0@@ -25,6 +25,14 @@#endif #define PHY_EN_DYN_PWRDN (0x1 << 20) +/** +* AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and +* REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame +* Synchronization Lost errors. +*/ +#define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414 +#define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3d
OK, but the problems I see are that first we don't explain what these values are tied to physically. Is it the display? The DDR memory? Second, since these are board specific they should be in board/ti/am335x/board.h. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161202/b48f622c/attachment.sig>
PATCH 1/1 arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm
Quoted 21 lines · Tom Rini
Quoted 10 lines · Jyri Sarha
Initialize EMIF
OCP_CONFIGregistersREG_COS_COUNT_1,REG_COS_COUNT_2, andREG_PR_OLD_COUNTfield 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.Signed-off-by Jyri Sarha <[email protected]>[snip]
Quoted 8 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +0
-0@@ -25,6 +25,14 @@#endif #define PHY_EN_DYN_PWRDN (0x1 << 20)
Quoted 10 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h line 34
Quoted 7 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +7
-0+/** +* AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and +* REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame +* Synchronization Lost errors. +*/ +#define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414 +#define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3dOK, but the problems I see are that first we don't explain what these values are tied to physically. Is it the display? The DDR memory?
It is a combination of both. I'll add that to the comment.
Quoted 3 lines
Second, since these are board specific they should be in
board/ti/am335x/board.h. Thanks!
Ok, I'll move the defines there.
Thanks,
Jyri
PATCH 1/1 arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm
Quoted 18 lines · Jyri Sarha
Quoted 8 lines
Quoted 8 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +0
-0Quoted 7 lines
Quoted 7 lines
index 43e122e..c71cfd0 100644
arch/arm/include/asm/arch-am33xx/ddr_defs.h +0
-0@@ -25,6 +25,14 @@#endif #define PHY_EN_DYN_PWRDN (0x1 << 20)Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h line 34
Quoted 7 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +7
-0+/** +* AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and +* REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame +* Synchronization Lost errors. +*/ +#define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414 +#define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3dOK, but the problems I see are that first we don't explain what these values are tied to physically. Is it the display? The DDR memory?
Quoted 6 lines
It is a combination of both. I'll add that to the comment.
Quoted 3 lines
Quoted 3 lines
Second, since these are board specific they should be in
board/ti/am335x/board.h. Thanks!Ok, I'll move the defines there.
Hmmmm, there there are no defined constants in board/ti/am335x/board.h. Should I just put the constants above, with improved comment, somewhere in that file?
Best regards,
Jyri
PATCH 1/1 arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm
Quoted 21 lines · Jyri Sarha
Quoted 20 lines · Jyri Sarha
Quoted 8 lines
Quoted 8 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +0
-0Quoted 7 lines
Quoted 7 lines
index 43e122e..c71cfd0 100644
arch/arm/include/asm/arch-am33xx/ddr_defs.h +0
-0@@ -25,6 +25,14 @@#endif #define PHY_EN_DYN_PWRDN (0x1 << 20)Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h line 34
Quoted 7 lines
arch/arm/include/asm/arch-am33xx/ddr_defs.h +7
-0+/** +* AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and +* REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame +* Synchronization Lost errors. +*/ +#define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414 +#define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3dOK, but the problems I see are that first we don't explain what these values are tied to physically. Is it the display? The DDR memory?
It is a combination of both. I'll add that to the comment.
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Second, since these are board specific they should be in
board/ti/am335x/board.h. Thanks!Ok, I'll move the defines there.
Hmmmm, there there are no defined constants in
board/ti/am335x/board.h. Should I just put the constants above, with improved comment, somewhere in that file?
Yes, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161202/2aafc97e/attachment.sig>