Q: I have changed the FPGA system clock speed how did I get u-boot working again ?
A: Their are two files you need to change to get the timer & uart working correctly again
The following line in the above file needs to be changed
#define CFG_HZ (old FPGA system time / old timer0 pre-scale value)
#define CFG_HZ (new FPGA system time / new timer0 pre-scale value)
so u-boot knows how many ticks have passed per seconds.
The baud rate values within the serial_setbrg function in the above file need to be re-calculated for the new system clock using the equation below
New Divisor value = New system clock speed / 16 * the wanted baud rate
Q: I have changed the FPGA system clock speed how did I get linux working again ?
A: Changing the system clock directly effects the following peripherals
To get the UART working again the Oscillator frequency & Arm core clock kernel settings need to be updated this can be done from within the make menu as follows
cd into the uClinux-dist directory and type make menuconfig
select Kernel/Library/Defaults Selection and then select Customize Kernel settings
from the main kernel settings menu select System Type and then Actel M7 Options
from this meun change the Oscillator frequency & Arm core clock to the new system clock speed
The linux kernel works of a 10ms timer tick therefore timer0 will need to be adjusted to again give a 10ms tick with the new system clock speed this can be done by editing the #define statement in the following file
the value of INIT_VALUE needs to be setup to give a 10ms interrupt tick with the new system clock value (the value used should take into account the timers prescale value #defined by PRESCALE_COUNTER_INIT_VALUE). If the prescale value is changed from it default (divide by two) then the #define CLOCKS_PER_USEC will also need to be modified.
The SPI units prescaler may need to modified so that it works at the correct frequency with the new system clock value. The SPI units prescaler is initialised by the innovatorts_init_module function within the ads7846_ts_input driver, this driver can be located at
The i2c units prescaler may need to modified so that it works at the correct frequency with the new system clock value. The i2c units prescaler is initialised by the m7_i2c_unit_init function within the i2c-actelm7.c driver, this driver can be located at
Q: How do I set system date / time ?
A: To set the date and time from the terminal type
here 08 is the month 31 is the day of the month 2112 is the time ie 21:12 and 2009 is the year
Q: How do I set the real time clock value ?
A: After setting the system time (see above) from the terminal type
this will write the current system time into the real time clock