Hi Qiang,
Thanks for the information. Some questions and comments, though:
It would be helpful if your code (and the driver code in general) used the above defines instead of just the numbers. The code is full of unexplained magic numbers, which makes it hard to make changes in one place.
Compare the existing code:
/* Setup active data waveform to sync with DC */
_ipu_di_sync_config(ipu, disp, 4, 0, DI_SYNC_HSYNC,
v_sync_width + v_start_width, DI_SYNC_HSYNC, height,
DI_SYNC_VSYNC, 0, DI_SYNC_NONE,
DI_SYNC_NONE, 0, 0);
_ipu_di_sync_config(ipu, disp, 5, 0, DI_SYNC_CLK,
h_sync_width + h_start_width, DI_SYNC_CLK,
width, 4, 0, DI_SYNC_NONE, DI_SYNC_NONE, 0,
0);
with the code using the above defines:
/* Setup active data waveform to sync with DC */
_ipu_di_sync_config(disp, DI_COUNTER_ALINE, 0, DI_SYNC_HSYNC,
v_sync_width + v_start_width, DI_SYNC_HSYNC, height,
DI_SYNC_VSYNC, 0, DI_SYNC_NONE,
DI_SYNC_NONE, 0, 0);
_ipu_di_sync_config(disp, DI_COUNTER_ACLOCK, 0, DI_SYNC_CLK,
h_sync_width + h_start_width, DI_SYNC_CLK,
width, DI_COUNTER_ALINE, 0, DI_SYNC_NONE, DI_SYNC_NONE, 0, 0);
What does the DI_TVE_WAVEFORM define do? I don't see any references to it in the Linux code.
Does the above ipu_disp_new.c code actually work?
For instance, I see code in ipu_disp_new.c like:
/* reset all unused counters */
__raw_writel(0, DI_SW_GEN0(disp, 6));
__raw_writel(0, DI_SW_GEN1(disp, 6));
and then a few lines later:
reg = __raw_readl(DI_STP_REP(disp, 6));
reg &= 0x0000FFFF;
__raw_writel(reg, DI_STP_REP(disp, 6));
Won't this code reset the counter by zeroing the IPU_DI1_SW_GEN0_6, IPU_DI1_SW_GEN1_6, and (the top half of the) IPU_DI1_STP_REP_3 registers?
But if we're using counter #6 as DI_COUNTER_ACLOCK this won't work, will it?
Again, if the code had read something like:
/* reset all unused counters */
__raw_writel(0, DI_SW_GEN0(disp, DI_COUNTER_UNUSED1));
__raw_writel(0, DI_SW_GEN1(disp, DI_COUNTER_UNUSED1));
It would have been easier to catch this problem and to change it.
Like Paul, I want to move both DI_COUNTER_VGA_HSYNC and DI_COUNTER_VGA_VSYNC to other pins because of the conflicts with EIM pins.
In my case, I can use pins 4 and 6.
But I don't know where in the template microcode the counter references must be changed.