VGA output and cpufreq.

Matan Ziv-Av matan@svgalib.org
Sun Jun 27 20:41:58 CEST 2004


On Sat, 26 Jun 2004, Oleg Gusev wrote:

> On Saturday 26 June 2004 07:53 pm, you wrote:
> >
> > OK, I found the DS, and will calculate the optimal registers values.
> >
> If you can tell how you are doing this i will be interested.

In theory:

You do this by comparing the datasheets (chap 10-4 of the sa1100):
Let's assume 190MHz, so MCLK=95MHz (10.5ns period),

Simplest is Trp: The samsung datasheet says that the minimum is 30ns, so 
3 clocks (bits 7-10 of mdcnfg=2).

TRASR is (looking at CAS before RAS diagram in samsung datasheet) Tras, 
minimum 5ns which requires 6 clocks. I see that we actually use 5 
clocks, which is marginally bellow the minimum.

TDL - I don't understand.

DRI - The formula is given 128ms/4096*95MHz/4 gives about 740 I see we 
use 790, which again seems to be a bit stretching the spec.

For the MDCAS registers, we look at burst mode (hyper page in samsung 
DS):

CAS needs to be 1 for Trcd+Tcrp clocks (CPU clocks now), 3 clocks seem 
to be just enough. Then in every cycle it is 0 for Tcas (+ up to 2ns for 
rise and fall) which means at least 2 clocks. Then 1 for Tcp (+ up to 
2ns) - again atleast two clocks, so MDCAS needs to be (right to left):
...0011001100111


In practice even after those calculations, a lot of trial and error is 
needed.

> > Not directly, but possible thru the VMCAR+VMCDR. So I will be able to
> > implement cursor function for fbcon, but programs that read the FB won't
> > work on sa1101fb.
> 
> It is going to be dead slow ? I have looked at your patch.

The cursor is only a few pixels in size (32x32), and is not updated too 
much (probably less than a 100 times a second).

> Why do you need a static mapping for the framebuffer
> and commented out the 'ioremap' code ? IMHO, it will

Not really needed, I just saw that the static map was there for the rest 
of the mem map.

> be great to have a real module that can be inserted and removed
> on a running system (xres and yres as a parameter).

I don't know much about fb drivers as modules.

> I'm not really familiar with the fbmem code, but is it really
> necessary to modify the fbmem.c file for the initialization 
> routines ?

It is there for every fb driver line. At least if the driver is compiled 
in, that's the only way to initialize it.

> > Also I noted that there is a GPIO needed in order to activate the VGA. I
> > found this by booting to linux while the VGA was active, and comparing
> > the registers. Do you have a program that dumps the register values
> > while in windows? (to find values that the kernel changes while
> > initializing).
> 
> What GPIO do you mean ? SA1100 or SA1101 ? I don't have one

bit 1 of PBDWR. When it is zero, only the sync signals go to the 
monitor.

> "user friendly" program, but many of them, each for the specific register.
> Some time ago i have posted the tables of the GPIO changes i 
> was able to track. Look at them, and if you have some more
> detailed and specific questions, let me know.

I saw your table. The only question I have is what should be instead of 
all the question marks?

I think it will be very useful to have a windows program that upon 
running, dumps all 1101 and 1100 registers to a file (or even better, 
the serial port). So if anyone has an environment for compiling windows 
programs, and knows how to read the registers, and has the little 
patience needed to write such program, please do.

> PS. We have somewhat arbitrary value for the SA1100fb pixclock,
>         if you can recalculate it, that will be great, too.

Do you not use the same as windows does. LCD displays are usully not 
multiscanning, so the best is to use the same clock that windows uses.
The formula given in the SA1100 manual is PCD=(CCLK/(2*pixclock))+2.

The reverse formula is pixclock=CCLK/(2*PCD+2), so if you know the PCD 
value in windows, you can calculate the pixclock it uses.



-- 
Matan Ziv-Av.                         matan@svgalib.org



More information about the Jornada820 mailing list