Re: [U-Boot] [PATCH] arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm

2016-12-02 Thread Tom Rini
On Fri, Dec 02, 2016 at 06:24:49PM +0200, Jyri Sarha wrote:
> On 12/02/16 15:06, Jyri Sarha wrote:
> >>> diff --git a/arch/arm/include/asm/arch-am33xx/ddr_defs.h 
> >>> b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
> >>> >> index 43e122e..c71cfd0 100644
> >>> >> --- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h
> >>> >> +++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
> >>> >> @@ -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_EVM0x003d3d3d
> >> > 
> >> > 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?
> > It is a combination of both. I'll add that to the comment.
> > 
> >> > Second, since these are board specific they should be in
> >> > board/ti/am335x/board.h.  Thanks!
> >> > 
> > Ok, I'll move the defines there.
> 
> H, 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!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm

2016-12-02 Thread Jyri Sarha
On 12/02/16 15:06, Jyri Sarha wrote:
>>> diff --git a/arch/arm/include/asm/arch-am33xx/ddr_defs.h 
>>> b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
>>> >> index 43e122e..c71cfd0 100644
>>> >> --- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h
>>> >> +++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
>>> >> @@ -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_BLACK0x00141414
>>> >> +#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?
> It is a combination of both. I'll add that to the comment.
> 
>> > Second, since these are board specific they should be in
>> > board/ti/am335x/board.h.  Thanks!
>> > 
> Ok, I'll move the defines there.

H, 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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm

2016-12-02 Thread Jyri Sarha
On 12/02/16 15:01, Tom Rini wrote:
> On Fri, Dec 02, 2016 at 09:54:39AM +0200, Jyri Sarha wrote:
> 
>> 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.
>>
>> Signed-off-by: Jyri Sarha 
> [snip]
>> diff --git a/arch/arm/include/asm/arch-am33xx/ddr_defs.h 
>> b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
>> index 43e122e..c71cfd0 100644
>> --- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h
>> +++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
>> @@ -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_BLACK0x00141414
>> +#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?

It is a combination of both. I'll add that to the comment.

> 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

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm

2016-12-02 Thread Tom Rini
On Fri, Dec 02, 2016 at 09:54:39AM +0200, Jyri Sarha wrote:

> 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.
> 
> Signed-off-by: Jyri Sarha 
[snip]
> diff --git a/arch/arm/include/asm/arch-am33xx/ddr_defs.h 
> b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
> index 43e122e..c71cfd0 100644
> --- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h
> +++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
> @@ -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!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm

2016-12-02 Thread Jyri Sarha
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.

Signed-off-by: Jyri Sarha 
---
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(+)

diff --git a/arch/arm/cpu/armv7/am33xx/ddr.c b/arch/arm/cpu/armv7/am33xx/ddr.c
index 6acf30c..690487e 100644
--- a/arch/arm/cpu/armv7/am33xx/ddr.c
+++ b/arch/arm/cpu/armv7/am33xx/ddr.c
@@ -180,6 +180,10 @@ void config_sdram(const struct emif_regs *regs, int nr)
writel(regs->ref_ctrl, _reg[nr]->emif_sdram_ref_ctrl);
writel(regs->ref_ctrl, _reg[nr]->emif_sdram_ref_ctrl_shdw);
writel(regs->sdram_config, _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, _reg[nr]->emif_l3_config);
 }
 
 /**
diff --git a/arch/arm/include/asm/arch-am33xx/ddr_defs.h 
b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
index 43e122e..c71cfd0 100644
--- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h
+++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
@@ -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 0x15
 #define MT47H128M16RT25E_EMIF_TIM1 0x0666B3C9
diff --git a/arch/arm/include/asm/emif.h b/arch/arm/include/asm/emif.h
index b00dece..9a46340 100644
--- a/arch/arm/include/asm/emif.h
+++ b/arch/arm/include/asm/emif.h
@@ -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;
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 16113b5..02e68a6 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -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,
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot