Ticket #1970: soc11_2.diff

File soc11_2.diff, 2.7 KB (added by seb, on 11/23/11 at 21:37:54)

patch

  • c/src/lib/libbsp/lm32/milkymist/include/system_conf.h

    old .  
    1515#ifndef __SYSTEM_CONFIG_H_
    1616#define __SYSTEM_CONFIG_H_
    1717
    18 #define CPU_FREQUENCY           (80000000)
    1918#define UART_BAUD_RATE          (115200)
    2019
     20/* Clock frequency */
     21#define MM_FREQUENCY            (0xe0001074)
     22
    2123/* FML bridge */
    2224#define FMLBRG_FLUSH_BASE       (0xc8000000)
    2325#define FMLBRG_LINE_LENGTH      (32)
     
    6567#define GPIO_LED2               (0x00000002)
    6668
    6769/* System ID and reset */
    68 #define MM_SYSTEM_ID            (0xe000103c)
     70#define MM_SYSTEM_ID            (0xe000107c)
    6971
    7072/* ICAP */
    71 #define MM_ICAP                 (0xe0001034)
     73#define MM_ICAP                 (0xe0001040)
    7274
    7375#define ICAP_READY              (0x01)
    7476#define ICAP_CE                 (0x10000)
  • c/src/lib/libbsp/lm32/shared/milkymist_console/console.c

    old .  
    109109  }
    110110
    111111  if (baud > 0)
    112     MM_WRITE(MM_UART_DIV, CPU_FREQUENCY/baud/16);
     112    MM_WRITE(MM_UART_DIV, MM_READ(MM_FREQUENCY)/baud/16);
    113113
    114114  return 0;
    115115}
  • c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c

    old .  
    1717
    1818void BSP_uart_init(int baud)
    1919{
    20   MM_WRITE(MM_UART_DIV, CPU_FREQUENCY/baud/16);
     20  MM_WRITE(MM_UART_DIV, MM_READ(MM_FREQUENCY)/baud/16);
    2121}
    2222
    2323void BSP_uart_polled_write(char ch)
  • c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c

    old .  
    5858  if (ticks == 0xffffffff)
    5959    printk("Timer overflow!\n");
    6060
    61   total = ticks / (CPU_FREQUENCY / 1000000);
     61  total = ticks / (MM_READ(MM_FREQUENCY) / 1000000);
    6262
    6363  if (benchmark_timer_find_average_overhead)
    6464    return total;
  • c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c

    old .  
    3535void Clock_driver_support_initialize_hardware(void)
    3636{
    3737  MM_WRITE(MM_TIMER0_COMPARE,
    38    (CPU_FREQUENCY/(1000000/rtems_configuration_get_microseconds_per_tick())));
     38   (MM_READ(MM_FREQUENCY)/(1000000/rtems_configuration_get_microseconds_per_tick())));
    3939  MM_WRITE(MM_TIMER0_COUNTER, 0);
    4040  MM_WRITE(MM_TIMER0_CONTROL, TIMER_ENABLE | TIMER_AUTORESTART);
    4141  bsp_interrupt_vector_enable(MM_IRQ_TIMER0);