Port-amigappc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: amigappc test kernel for CSPPC and BPPC



On Dec 18, 2010, at 5:16 PM, Frank Wille wrote:

> Radoslaw Kujawa wrote:
>> Yes, that's the way to go. I have a vague idea how should it be
>> implemented using CIA timer, but it needs working time measurement
>> functions. The problem is that we set up timebase using bus clock. How
>> can I measure time flow _before_ timebase is set up? Will functions
>> like getmicrotime() work in amigappc_identify() ?
> 
> No, as the timecounters are not yet set up.

So I thought. 

> You will use the on-chip timebase or decrementer register to measure the
> amount of buscycles passed during a defined amount of time.

Looks like I have to do the mftb asm magic. I checked arch/powerpc/ and it 
seems we don't have any generic functions to access timebase register. 

> Example:
> 
> - reset CIA timer
> - reset timebase
> - start CIA timer, running for 1 second
> after 1 second (or a shorter value, to reduce the delay during configure()):
> - read timebase

Sounds good, but... how does one reset the timebase? I thought that it's only 
possible to read from it.

> The timebase * 4 now represents the number of bus clock cycles during this
> time.

Does always timebase frequency = busclock/4 ? Is it PowerUP specific? I heard 
that on (at least some) Macs timebase is set from external clock.

> To load the right value into the CIA timer you can use eclockfreq,
> which is passed by the bootloader (or just assume as 709kHz when not set).


eclockfreq is 709kHz only on PAL models. Should not be problematic, as 
bootloader always passes the correct value. 

Out of curiosity: Is it possible to use PMC instead of timebase register to 
achieve the same thing? Anyway, PMC is available only on 604 and newer CPUs.

Btw. today I cvs up'ed the source and GENERIC kernel does not boot anymore 
(even without my pll.patch, so I suppose that's not the problem). Can anyone 
confirm this? :(

--
Best regards,
RadosÅaw Kujawa



Home | Main Index | Thread Index | Old Index