2011-11-27 Sebastien Bourdeauducq <seb@tmplab.org>

PR 1970/bsps
	* milkymist_clock/ckinit.c, milkymist_console/console.c,
	milkymist_console/uart.c, milkymist_timer/timer.c: Support for the
	new Milkymist sysctl and clock frequency detection.
This commit is contained in:
Gedare Bloom
2011-11-27 17:30:18 +00:00
parent cc3b482bc0
commit b8ee42cd81
5 changed files with 11 additions and 4 deletions

View File

@@ -1,3 +1,10 @@
2011-11-27 Sebastien Bourdeauducq <seb@tmplab.org>
PR 1970/bsps
* milkymist_clock/ckinit.c, milkymist_console/console.c,
milkymist_console/uart.c, milkymist_timer/timer.c: Support for the
new Milkymist sysctl and clock frequency detection.
2011-11-27 Sebastien Bourdeauducq <seb@tmplab.org>
PR 1966/bsps

View File

@@ -35,7 +35,7 @@
void Clock_driver_support_initialize_hardware(void)
{
MM_WRITE(MM_TIMER0_COMPARE,
(CPU_FREQUENCY/(1000000/rtems_configuration_get_microseconds_per_tick())));
(MM_READ(MM_FREQUENCY)/(1000000/rtems_configuration_get_microseconds_per_tick())));
MM_WRITE(MM_TIMER0_COUNTER, 0);
MM_WRITE(MM_TIMER0_CONTROL, TIMER_ENABLE | TIMER_AUTORESTART);
bsp_interrupt_vector_enable(MM_IRQ_TIMER0);

View File

@@ -109,7 +109,7 @@ static int mmconsole_set_attributes(int minor, const struct termios *t)
}
if (baud > 0)
MM_WRITE(MM_UART_DIV, CPU_FREQUENCY/baud/16);
MM_WRITE(MM_UART_DIV, MM_READ(MM_FREQUENCY)/baud/16);
return 0;
}

View File

@@ -19,7 +19,7 @@
void BSP_uart_init(int baud)
{
MM_WRITE(MM_UART_DIV, CPU_FREQUENCY/baud/16);
MM_WRITE(MM_UART_DIV, MM_READ(MM_FREQUENCY)/baud/16);
}
void BSP_uart_polled_write(char ch)

View File

@@ -58,7 +58,7 @@ uint32_t benchmark_timer_read(void)
if (ticks == 0xffffffff)
printk("Timer overflow!\n");
total = ticks / (CPU_FREQUENCY / 1000000);
total = ticks / (MM_READ(MM_FREQUENCY) / 1000000);
if (benchmark_timer_find_average_overhead)
return total;