1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 03:45:19 +02:00

m1/patches: added soc11_2.diff posted by Sebastien on Nov 23

This commit is contained in:
Werner Almesberger 2011-11-25 05:21:32 -03:00
parent f2b46694a2
commit 94fd599ac9
2 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1,86 @@
From: S?bastien Bourdeauducq <sebastien@milkymist.org>
Subject: [Milkymist-devel] RTEMS support patch for new address map +
readable system frequency
Index: rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h
===================================================================
--- rtems.orig/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h 2011-11-25 05:05:51.000000000 -0300
+++ rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h 2011-11-25 05:18:11.000000000 -0300
@@ -15,9 +15,11 @@
#ifndef __SYSTEM_CONFIG_H_
#define __SYSTEM_CONFIG_H_
-#define CPU_FREQUENCY (80000000)
#define UART_BAUD_RATE (115200)
+/* Clock frequency */
+#define MM_FREQUENCY (0xe0001074)
+
/* FML bridge */
#define FMLBRG_FLUSH_BASE (0xc8000000)
#define FMLBRG_LINE_LENGTH (32)
@@ -65,10 +67,10 @@
#define GPIO_LED2 (0x00000002)
/* System ID and reset */
-#define MM_SYSTEM_ID (0xe000103c)
+#define MM_SYSTEM_ID (0xe000107c)
/* ICAP */
-#define MM_ICAP (0xe0001034)
+#define MM_ICAP (0xe0001040)
#define ICAP_READY (0x01)
#define ICAP_CE (0x10000)
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c
===================================================================
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c 2011-08-01 10:48:39.000000000 -0300
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c 2011-11-25 05:18:11.000000000 -0300
@@ -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);
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c
===================================================================
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c 2011-11-25 05:05:51.000000000 -0300
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c 2011-11-25 05:18:11.000000000 -0300
@@ -109,7 +109,7 @@
}
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;
}
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c
===================================================================
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c 2011-11-25 05:05:51.000000000 -0300
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c 2011-11-25 05:18:11.000000000 -0300
@@ -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)
Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c
===================================================================
--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c 2011-08-01 10:48:40.000000000 -0300
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c 2011-11-25 05:18:11.000000000 -0300
@@ -58,7 +58,7 @@
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;

View File

@ -4,3 +4,4 @@ chain-first-last.patch
coremsgsubmit-race.patch
milkymist-new-uart.patch
fix-sysconf-includes.patch
milkymist-map-sysfreq.patch