ddr: socfpga: Fix IO in Arria10 DDR driver
PATCH 1/2 ddr: socfpga: Fix IO in Arria10 DDR driver
The Altera Arria10 DDR driver was using constants in a few places instead of reading registers associated with those constants, fix this.
--- drivers/ddr/altera/sdram_arria10.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ddr/altera/sdram_arria10.c +3 -3
@@ -304,7 +304,7 @@ static void sdram_mmr_init(void)* bit[9:6] = Minor Release # * bit[14:10] = Major Release # */ -if ((socfpga_io48_mmr_base->niosreserve1 >>6 ) &0x1FF ) { +if ((readl (&socfpga_io48_mmr_base->niosreserve1) >>6 ) &0x1FF ) { update_value =readl (&socfpga_io48_mmr_base->niosreserve0);writel (((update_value &0xFF ) >>5 ), &socfpga_ecc_hmc_base->ddrioctrl);
@@ -394,7 +394,7 @@ static void sdram_mmr_init(void) caltim0_cfg_act_to_rdwr - (ctrlcfg0_cfg_ctrl_burst_len >> 2)); - io48_value = ((((socfpga_io48_mmr_base->dramtiming0 & + io48_value = ((((readl(&socfpga_io48_mmr_base->dramtiming0) & ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK) + 2 + 15 + (ctrlcfg0_cfg_ctrl_burst_len >> 1)) >> 1) -/* Up to here was in memory cycles so divide by 2 */
@@ -424,7 +424,7 @@ static void sdram_mmr_init(void) &socfpga_noc_ddr_scheduler_base->ddr_t_main_scheduler_ddrmode);/* Configure the read latency [0xFFD12414] */ -writel (((socfpga_io48_mmr_base->dramtiming0 & +writel (((readl (&socfpga_io48_mmr_base->dramtiming0) &ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK ) >>1 ) +DDR_READ_LATENCY_DELAY , &socfpga_noc_ddr_scheduler_base->
Signature · 1 line
2.20.1
PATCH 2/2 ddr: socfpga: Fix newline in debug print on A10
The debug print is missing a newline, add it.
--- drivers/ddr/altera/sdram_arria10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ddr/altera/sdram_arria10.c +1 -1
@@ -270,7 +270,7 @@ static u64 sdram_size_calc(void) size *= (2 << (readl (&socfpga_ecc_hmc_base->ddrioctrl) &ALT_ECC_HMC_OCP_DDRIOCTRL_IO_SIZE_MSK )); -debug ("SDRAM size=%llu" , size); +debug ("SDRAM size=%llu\n" , size);return size; }
Signature · 1 line
2.20.1
PATCH 2/2 ddr: socfpga: Fix newline in debug print on A10
Quoted 8 lines · Marek Vasut
The debug print is missing a newline, add it.
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>
Quoted 20 lines
--- drivers/ddr/altera/sdram_arria10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ddr/altera/sdram_arria10.c +1
-2@@ -270,7 +270,7 @@ static u64 sdram_size_calc(void) size *= (2 << (readl (&socfpga_ecc_hmc_base->ddrioctrl) &ALT_ECC_HMC_OCP_DDRIOCTRL_IO_SIZE_MSK )); -debug ("SDRAM size=%llu" , size); +debug ("SDRAM size=%llu\n" , size);return size; } --2.20.1
Chee
PATCH 2/2 ddr: socfpga: Fix newline in debug print on A10
Quoted 11 lines · Simon Goldschmidt
Quoted 9 lines · Marek Vasut
The debug print is missing a newline, add it.
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>Reviewed-by Simon Goldschmidt <[email protected]>
Quoted 23 lines
Quoted 23 lines
---
drivers/ddr/altera/sdram_arria10.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/ddr/altera/sdram_arria10.c +0
-0@@ -270,7 +270,7 @@ static u64 sdram_size_calc(void)size *= (2 << (
readl(&socfpga_ecc_hmc_base->ddrioctrl)&ALT_ECC_HMC_OCP_DDRIOCTRL_IO_SIZE_MSK));- debug("SDRAM size=%llu", size);
+ debug("SDRAM size=%llu\n", size);return size;
}
--
2.20.1
PATCH 1/2 ddr: socfpga: Fix IO in Arria10 DDR driver
In reply to Marek VasutQuoted 10 lines · Marek Vasut
The Altera Arria10 DDR driver was using constants in a few places instead of reading registers associated with those constants, fix this.
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>
Quoted 38 lines
--- drivers/ddr/altera/sdram_arria10.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/ddr/altera/sdram_arria10.c +3
-4@@ -304,7 +304,7 @@ static void sdram_mmr_init(void)* bit[9:6] = Minor Release # * bit[14:10] = Major Release # */ -if ((socfpga_io48_mmr_base->niosreserve1 >>6 ) &0x1FF ) { +if ((readl (&socfpga_io48_mmr_base->niosreserve1) >>6 ) &0x1FF ) { update_value =readl (&socfpga_io48_mmr_base->niosreserve0);writel (((update_value &0xFF ) >>5 ), &socfpga_ecc_hmc_base->ddrioctrl);@@ -394,7 +394,7 @@ static void sdram_mmr_init(void) caltim0_cfg_act_to_rdwr - (ctrlcfg0_cfg_ctrl_burst_len >> 2)); - io48_value = ((((socfpga_io48_mmr_base->dramtiming0 & + io48_value = ((((readl(&socfpga_io48_mmr_base->dramtiming0) & ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK) + 2 + 15 + (ctrlcfg0_cfg_ctrl_burst_len >> 1)) >> 1) -/* Up to here was in memory cycles so divide by 2 */ @@ -424,7 +424,7 @@ static void sdram_mmr_init(void) &socfpga_noc_ddr_scheduler_base->ddr_t_main_scheduler_ddrmode);/* Configure the read latency [0xFFD12414] */ - writel(((socfpga_io48_mmr_base->dramtiming0 & +writel (((readl (&socfpga_io48_mmr_base->dramtiming0) &ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK ) >>1 ) +DDR_READ_LATENCY_DELAY , &socfpga_noc_ddr_scheduler_base-> --2.20.1
Chee
PATCH 1/2 ddr: socfpga: Fix IO in Arria10 DDR driver
Quoted 7 lines · Simon Goldschmidt
Quoted 6 lines · Marek Vasut
The Altera Arria10 DDR driver was using constants in a few places instead of reading registers associated with those constants, fix this.
Quoted 6 lines
Quoted 5 lines
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>Reviewed-by Simon Goldschmidt <[email protected]>
Quoted 47 lines
Quoted 47 lines
---
drivers/ddr/altera/sdram_arria10.c | 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)drivers/ddr/altera/sdram_arria10.c +1
-1@@ -304,7 +304,7 @@ static void sdram_mmr_init(void)* bit[9:6] = Minor Release # * bit[14:10] = Major Release # */ - if ((socfpga_io48_mmr_base->niosreserve1 >> 6) & 0x1FF) { + if ((readl(&socfpga_io48_mmr_base->niosreserve1) >> 6) &0x1FF ) {update_value = readl(&socfpga_io48_mmr_base-
Quoted 1 line
niosreserve0);
writel(((update_value &
0xFF) >> 5),&socfpga_ecc_hmc_base->ddrioctrl);drivers/ddr/altera/sdram_arria10.c +0
-0@@ -394,7 +394,7 @@ static void sdram_mmr_init(void)caltim0_cfg_act_to_rdwr - (
ctrlcfg0_cfg_ctrl_burst_len>> 2));- io48_value = ((((
socfpga_io48_mmr_base->dramtiming0& + io48_value = ((((readl(&socfpga_io48_mmr_base->dramtiming0)&
ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK) + 2
+ 15 +
(ctrlcfg0_cfg_ctrl_burst_len >> 1)) >> 1) - /* Up to here was in memory cycles so divide by 2 */drivers/ddr/altera/sdram_arria10.c +0
-0@@ -424,7 +424,7 @@ static void sdram_mmr_init(void)&socfpga_noc_ddr_scheduler_base-
Quoted 1 line
ddr_t_main_scheduler_ddrmode);/* Configure the read latency [
0xFFD12414] */ - writel(((socfpga_io48_mmr_base->dramtiming0 & + writel(((readl(&socfpga_io48_mmr_base->dramtiming0) &ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK) >> 1) +DDR_READ_LATENCY_DELAY, &socfpga_noc_ddr_scheduler_base->
--
2.20.1