forked from Imagelibrary/rtems
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:
@@ -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>
|
2011-11-27 Sebastien Bourdeauducq <seb@tmplab.org>
|
||||||
|
|
||||||
PR 1966/bsps
|
PR 1966/bsps
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
void Clock_driver_support_initialize_hardware(void)
|
void Clock_driver_support_initialize_hardware(void)
|
||||||
{
|
{
|
||||||
MM_WRITE(MM_TIMER0_COMPARE,
|
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_COUNTER, 0);
|
||||||
MM_WRITE(MM_TIMER0_CONTROL, TIMER_ENABLE | TIMER_AUTORESTART);
|
MM_WRITE(MM_TIMER0_CONTROL, TIMER_ENABLE | TIMER_AUTORESTART);
|
||||||
bsp_interrupt_vector_enable(MM_IRQ_TIMER0);
|
bsp_interrupt_vector_enable(MM_IRQ_TIMER0);
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ static int mmconsole_set_attributes(int minor, const struct termios *t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (baud > 0)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
void BSP_uart_init(int baud)
|
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)
|
void BSP_uart_polled_write(char ch)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ uint32_t benchmark_timer_read(void)
|
|||||||
if (ticks == 0xffffffff)
|
if (ticks == 0xffffffff)
|
||||||
printk("Timer overflow!\n");
|
printk("Timer overflow!\n");
|
||||||
|
|
||||||
total = ticks / (CPU_FREQUENCY / 1000000);
|
total = ticks / (MM_READ(MM_FREQUENCY) / 1000000);
|
||||||
|
|
||||||
if (benchmark_timer_find_average_overhead)
|
if (benchmark_timer_find_average_overhead)
|
||||||
return total;
|
return total;
|
||||||
|
|||||||
Reference in New Issue
Block a user