Skip to content

Instantly share code, notes, and snippets.

View openedev's full-sized avatar

Jagan Teki openedev

View GitHub Profile
static int sdram_init(struct dram_info *dram,
struct rk3399_sdram_params *sdram_params)
{
unsigned char dramtype = sdram_params->base.dramtype;
unsigned int ddr_freq = sdram_params->base.ddr_freq;
u32 training_flag = PI_READ_GATE_TRAINING;
int channel, ch;
u32 rank;
int ret;
static int sdram_init(struct dram_info *dram,
struct rk3399_sdram_params *sdram_params)
{
unsigned char dramtype = sdram_params->base.dramtype;
unsigned int ddr_freq = sdram_params->base.ddr_freq;
u32 training_flag = PI_READ_GATE_TRAINING;
int channel, ch;
u32 rank;
int ret;
LOOP0. rank 2, channel 0
LOOP0. rank 2, channel 1
LOOP1. rank 2, ch 0
LOOP0. rank 1, channel 0
LOOP0. rank 1, channel 1
diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 778562b31598..56ef24b21448 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -75,11 +75,11 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
struct sun4i_tcon *tcon = dclk->tcon;
unsigned long best_parent = 0;
u8 best_div = 1;
+ u64 ideal = (u64)rate * tcon->dclk_mul;
int i;
[ 1.783994] sun6i-mipi-dsi 1ca0000.dsi: Attached device fy07024di26a30d
[ 1.820892] sun4i-drm display-engine: bound 1100000.mixer (ops sun8i_mixer_ops)
[ 1.830196] sun4i-drm display-engine: bound 1200000.mixer (ops sun8i_mixer_ops)
[ 1.837718] sun4i_dclk_recalc_rate: val = 1, rate = 588000000
[ 1.843717] sun4i-drm display-engine: No panel or bridge found... RGB output disabled
[ 1.851577] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops sun4i_tcon_ops)
[ 1.859791] sun4i-drm display-engine: bound 1c0d000.lcd-controller (ops sun4i_tcon_ops)
[ 1.867820] 0.0 drm_connector_init
[ 1.871237] 0. 282992392-1-0 (null)
[ 1.874737] 0.1 drm_connector_init
diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 778562b31598..4e59f672455f 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -95,10 +95,11 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
rounded = clk_hw_round_rate(clk_hw_get_parent(hw),
ideal);
- printk("ideal = %d, rounded = %d\n", ideal, rounded);
+ printk("ideal = %d, rounded = %d, i = %d\n", ideal, rounded, i);
[ 1.784128] sun6i-mipi-dsi 1ca0000.dsi: Attached device fy07024di26a30d
[ 1.820927] sun4i-drm display-engine: bound 1100000.mixer (ops sun8i_mixer_ops)
[ 1.830167] sun4i-drm display-engine: bound 1200000.mixer (ops sun8i_mixer_ops)
[ 1.837688] sun4i_dclk_recalc_rate: val = 1, rate = 588000000
[ 1.843683] sun4i-drm display-engine: No panel or bridge found... RGB output disabled
[ 1.851542] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops sun4i_tcon_ops)
[ 1.859766] sun4i-drm display-engine: bound 1c0d000.lcd-controller (ops sun4i_tcon_ops)
[ 1.867796] 0.0 drm_connector_init
[ 1.871213] 0. 282992392-1-0 (null)
[ 1.874714] 0.1 drm_connector_init
[ 2.500602] printk: console [ttyS0] enabled
[ 2.506767] sun6i-mipi-dsi 1ca0000.dsi: Attached device ts8550b
[ 2.542180] sun4i-drm display-engine: bound 1100000.mixer (ops sun8i_mixer_ops)
[ 2.551519] sun4i-drm display-engine: bound 1200000.mixer (ops sun8i_mixer_ops)
[ 2.559042] sun4i_dclk_recalc_rate: val = 1, rate = 594000000
[ 2.565017] sun4i-drm display-engine: No panel or bridge found... RGB output disabled
[ 2.572875] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops sun4i_tcon_ops)
[ 2.581096] sun4i-drm display-engine: bound 1c0d000.lcd-controller (ops sun4i_tcon_ops)
[ 2.589125] 0.0 drm_connector_init
[ 2.592541] 0. 282992392-1-0 (null)
diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
index 778562b31598..32d84c10f876 100644
--- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
+++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
@@ -74,14 +74,17 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
struct sun4i_dclk *dclk = hw_to_dclk(hw);
struct sun4i_tcon *tcon = dclk->tcon;
unsigned long best_parent = 0;
+ u64 ideal = (u64)rate * tcon->dclk_mul;
u8 best_div = 1;
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 94f24c5e2dc5..4febd51429b6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -338,8 +338,9 @@ static void sun4i_tcon0_mode_set_cpu(struct sun4i_tcon *tcon,
u32 block_space, start_delay;
u32 tcon_div;
- tcon->dclk_min_div = bpp/lanes;
- tcon->dclk_max_div = bpp/lanes;