change log for rtems (2011-11-27)

rtems-vc at rtems.org rtems-vc at rtems.org
Sun Nov 27 18:10:16 UTC 2011


 *gedare*:
2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>

	PR 1966/bsps
	* include/system_conf.h: support for the new UART core and interrupt
	map

M    1.5  c/src/lib/libbsp/lm32/milkymist/ChangeLog
M    1.3  c/src/lib/libbsp/lm32/milkymist/include/system_conf.h

diff -u rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog:1.4 rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog:1.5
--- rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog:1.4	Mon Aug  1 08:48:10 2011
+++ rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog	Sun Nov 27 11:26:25 2011
@@ -1,3 +1,9 @@
+2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>
+
+	PR 1966/bsps
+	* include/system_conf.h: support for the new UART core and interrupt
+	map
+
 2011-08-01	Sebastien Bourdeauducq <sebastien.bourdeauducq at gmail.com>
 
 	PR 1869/bsps

diff -u rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h:1.2 rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h:1.3
--- rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h:1.2	Mon Aug  1 08:48:11 2011
+++ rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h	Sun Nov 27 11:26:25 2011
@@ -26,6 +26,16 @@
 /* UART */
 #define MM_UART_RXTX            (0xe0000000)
 #define MM_UART_DIV             (0xe0000004)
+#define MM_UART_STAT            (0xe0000008)
+#define MM_UART_CTRL            (0xe000000c)
+
+#define UART_STAT_THRE          (0x1)
+#define UART_STAT_RX_EVT        (0x2)
+#define UART_STAT_TX_EVT        (0x4)
+
+#define UART_CTRL_RX_INT        (0x1)
+#define UART_CTRL_TX_INT        (0x2)
+#define UART_CTRL_THRU          (0x4)
 
 /* Timers */
 #define MM_TIMER1_COMPARE       (0xe0001024)
@@ -225,8 +235,17 @@
 
 /* MIDI */
 #define MM_MIDI_RXTX            (0xe000b000)
-#define MM_MIDI_DIVISOR         (0xe000b004)
-#define MM_MIDI_THRU            (0xe000b008)
+#define MM_MIDI_DIV             (0xe000b004)
+#define MM_MIDI_STAT            (0xe000b008)
+#define MM_MIDI_CTRL            (0xe000b00c)
+
+#define MIDI_STAT_THRE          (0x1)
+#define MIDI_STAT_RX_EVT        (0x2)
+#define MIDI_STAT_TX_EVT        (0x4)
+
+#define MIDI_CTRL_RX_INT        (0x1)
+#define MIDI_CTRL_TX_INT        (0x2)
+#define MIDI_CTRL_THRU          (0x4)
 
 /* IR */
 #define MM_IR_RX                (0xe000e000)
@@ -248,24 +267,22 @@
 #define BT656_FILTER_INFRAME    (0x4)
 
 /* Interrupts */
-#define MM_IRQ_UARTRX           (0)
-#define MM_IRQ_UARTTX           (1)
-#define MM_IRQ_GPIO             (2)
-#define MM_IRQ_TIMER0           (3)
-#define MM_IRQ_TIMER1           (4)
-#define MM_IRQ_AC97CRREQUEST    (5)
-#define MM_IRQ_AC97CRREPLY      (6)
-#define MM_IRQ_AC97DMAR         (7)
-#define MM_IRQ_AC97DMAW         (8)
-#define MM_IRQ_PFPU             (9)
-#define MM_IRQ_TMU              (10)
-#define MM_IRQ_ETHRX            (11)
-#define MM_IRQ_ETHTX            (12)
-#define MM_IRQ_VIDEOIN          (13)
-#define MM_IRQ_MIDIRX           (14)
-#define MM_IRQ_MIDITX           (15)
-#define MM_IRQ_IR               (16)
-#define MM_IRQ_USB              (17)
+#define MM_IRQ_UART             (0)
+#define MM_IRQ_GPIO             (1)
+#define MM_IRQ_TIMER0           (2)
+#define MM_IRQ_TIMER1           (3)
+#define MM_IRQ_AC97CRREQUEST    (4)
+#define MM_IRQ_AC97CRREPLY      (5)
+#define MM_IRQ_AC97DMAR         (6)
+#define MM_IRQ_AC97DMAW         (7)
+#define MM_IRQ_PFPU             (8)
+#define MM_IRQ_TMU              (9)
+#define MM_IRQ_ETHRX            (10)
+#define MM_IRQ_ETHTX            (11)
+#define MM_IRQ_VIDEOIN          (12)
+#define MM_IRQ_MIDI             (13)
+#define MM_IRQ_IR               (14)
+#define MM_IRQ_USB              (15)
 
 /* Flash layout */
 #define FLASH_BASE                      (0x80000000)


 *gedare*:
2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>

	PR 1966/bsps
	* milkymist_console/console.c, milkymist_console/uart.c,
	milkymist_console/uart.h, milkymist_midi/midi.c: support for the new
	UART core and interrupt map

M    1.3  c/src/lib/libbsp/lm32/shared/ChangeLog
M    1.3  c/src/lib/libbsp/lm32/shared/milkymist_console/console.c
M    1.3  c/src/lib/libbsp/lm32/shared/milkymist_console/uart.h
M    1.3  c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c
M    1.2  c/src/lib/libbsp/lm32/shared/milkymist_midi/midi.c

diff -u rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.2 rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.3
--- rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.2	Tue Aug  2 09:04:31 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/ChangeLog	Sun Nov 27 11:26:32 2011
@@ -1,3 +1,10 @@
+2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>
+
+	PR 1966/bsps
+	* milkymist_console/console.c, milkymist_console/uart.c,
+	milkymist_console/uart.h, milkymist_midi/midi.c: support for the new
+	UART core and interrupt map
+
 2011-08-02	Sebastien Bourdeauducq <sebastien.bourdeauducq at gmail.com>
 
 	PR 1869/bsps

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c:1.2 rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c:1.3
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c:1.2	Mon Aug  1 08:48:39 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c	Sun Nov 27 11:26:32 2011
@@ -119,25 +119,24 @@
   rtems_interrupt_level level;
 
   rtems_interrupt_disable(level);
-  BSP_uart_txbusy = true;
   MM_WRITE(MM_UART_RXTX, *buf);
   rtems_interrupt_enable(level);
   return 0;
 }
 
-static rtems_isr mmconsole_txdone(rtems_vector_number n)
-{
-  BSP_uart_txbusy = false;
-  lm32_interrupt_ack(1 << MM_IRQ_UARTTX);
-  rtems_termios_dequeue_characters(tty, 1);
-}
-
-static rtems_isr mmconsole_rxdone(rtems_vector_number n)
+static rtems_isr mmconsole_interrupt(rtems_vector_number n)
 {
   char c;
-  c = MM_READ(MM_UART_RXTX);
-  lm32_interrupt_ack(1 << MM_IRQ_UARTRX);
-  rtems_termios_enqueue_raw_characters(tty, &c, 1);
+  while (MM_READ(MM_UART_STAT) & UART_STAT_RX_EVT) {
+    c = MM_READ(MM_UART_RXTX);
+    MM_WRITE(MM_UART_STAT, UART_STAT_RX_EVT);
+    rtems_termios_enqueue_raw_characters(tty, &c, 1);
+  }
+  if (MM_READ(MM_UART_STAT) & UART_STAT_TX_EVT) {
+    MM_WRITE(MM_UART_STAT, UART_STAT_TX_EVT);
+    rtems_termios_dequeue_characters(tty, 1);
+  }
+  lm32_interrupt_ack(1 << MM_IRQ_UART);
 }
 
 static const rtems_termios_callbacks mmconsole_callbacks = {
@@ -166,10 +165,9 @@
   if (status != RTEMS_SUCCESSFUL)
     rtems_fatal_error_occurred(status);
 
-  rtems_interrupt_catch(mmconsole_txdone, MM_IRQ_UARTTX, &dummy);
-  rtems_interrupt_catch(mmconsole_rxdone, MM_IRQ_UARTRX, &dummy);
-  bsp_interrupt_vector_enable(MM_IRQ_UARTTX);
-  bsp_interrupt_vector_enable(MM_IRQ_UARTRX);
+  rtems_interrupt_catch(mmconsole_interrupt, MM_IRQ_UART, &dummy);
+  bsp_interrupt_vector_enable(MM_IRQ_UART);
+  MM_WRITE(MM_UART_CTRL, UART_CTRL_RX_INT|UART_CTRL_TX_INT);
 
   return RTEMS_SUCCESSFUL;
 }

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.h:1.2 rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.h:1.3
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.h:1.2	Mon Aug  1 08:48:39 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.h	Sun Nov 27 11:26:32 2011
@@ -1,21 +1,16 @@
 /*
- *  This file contains definitions for LatticeMico32 UART
+ *  This file contains definitions for the Milkymist UART
  *
  *  The license and distribution terms for this file may be
  *  found in the file LICENSE in this distribution or at
  *  http://www.rtems.com/license/LICENSE.
  *
  *  $Id$
- *
- *  COPYRIGHT (c) Yann Sionneau <yann.sionneau at telecom-sudparis.eu> (GSoC 2010)
- *  Telecom SudParis
  */
 
 #ifndef _BSPUART_H
 #define _BSPUART_H
 
-extern bool BSP_uart_txbusy;
-
 void BSP_uart_init(int baud);
 void BSP_uart_polled_write(char ch);
 int BSP_uart_polled_read(void);

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c:1.2 rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c:1.3
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c:1.2	Mon Aug  1 08:48:39 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c	Sun Nov 27 11:26:32 2011
@@ -17,8 +17,6 @@
 #include "../include/system_conf.h"
 #include "uart.h"
 
-bool BSP_uart_txbusy;
-
 void BSP_uart_init(int baud)
 {
   MM_WRITE(MM_UART_DIV, CPU_FREQUENCY/baud/16);
@@ -26,40 +24,24 @@
 
 void BSP_uart_polled_write(char ch)
 {
-  int ip;
   rtems_interrupt_level level;
 
   rtems_interrupt_disable(level);
-  if (BSP_uart_txbusy) {
-    /* wait for the end of the transmission by the IRQ-based driver */
-    do {
-      lm32_read_interrupts(ip);
-    } while (!(ip & (1 << MM_IRQ_UARTTX)));
-    lm32_interrupt_ack(1 << MM_IRQ_UARTTX);
-  }
+  while(!(MM_READ(MM_UART_STAT) & UART_STAT_THRE));
   MM_WRITE(MM_UART_RXTX, ch);
-  do {
-    lm32_read_interrupts(ip);
-  } while (!(ip & (1 << MM_IRQ_UARTTX)));
-  /* if TX was busy, do not ack the IRQ
-   * so that the IRQ-based driver ISR is run */
-  if (!BSP_uart_txbusy)
-    lm32_interrupt_ack(1 << MM_IRQ_UARTTX);
+  while(!(MM_READ(MM_UART_STAT) & UART_STAT_THRE));
   rtems_interrupt_enable(level);
 }
 
 int BSP_uart_polled_read(void)
 {
-  int ip;
   char r;
   rtems_interrupt_level level;
 
   rtems_interrupt_disable(level);
-  do {
-    lm32_read_interrupts(ip);
-  } while (!(ip & (1 << MM_IRQ_UARTRX)));
-  lm32_interrupt_ack(1 << MM_IRQ_UARTRX);
+  while(!(MM_READ(MM_UART_STAT) & UART_STAT_RX_EVT));
   r = MM_READ(MM_UART_RXTX);
+  MM_WRITE(MM_UART_STAT, UART_STAT_RX_EVT);
   rtems_interrupt_enable(level);
 
   return r;

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_midi/midi.c:1.1 rtems/c/src/lib/libbsp/lm32/shared/milkymist_midi/midi.c:1.2
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_midi/midi.c:1.1	Mon Aug  1 08:48:40 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_midi/midi.c	Sun Nov 27 11:26:32 2011
@@ -31,9 +31,12 @@
 {
   unsigned char msg;
 
-  lm32_interrupt_ack(1 << MM_IRQ_MIDIRX);
-  msg = MM_READ(MM_MIDI_RXTX);
-  rtems_message_queue_send(midi_q, &msg, 1);
+  while (MM_READ(MM_MIDI_STAT) & MIDI_STAT_RX_EVT) {
+    msg = MM_READ(MM_MIDI_RXTX);
+    MM_WRITE(MM_MIDI_STAT, MIDI_STAT_RX_EVT);
+    rtems_message_queue_send(midi_q, &msg, 1);
+  }
+  lm32_interrupt_ack(1 << MM_IRQ_MIDI);
 }
 
 rtems_device_driver midi_initialize(
@@ -57,11 +60,10 @@
   );
   RTEMS_CHECK_SC(sc, "create MIDI queue");
 
-  rtems_interrupt_catch(interrupt_handler, MM_IRQ_MIDIRX, &dummy);
-  bsp_interrupt_vector_enable(MM_IRQ_MIDIRX);
-
+  rtems_interrupt_catch(interrupt_handler, MM_IRQ_MIDI, &dummy);
+  bsp_interrupt_vector_enable(MM_IRQ_MIDI);
   /* Only MIDI THRU mode is supported atm */
-  MM_WRITE(MM_MIDI_THRU, 1);
+  MM_WRITE(MM_MIDI_CTRL, MIDI_CTRL_RX_INT|MIDI_CTRL_THRU);
 
   return RTEMS_SUCCESSFUL;
 }


 *gedare*:
2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>

	PR 1970/bsps
	* include/system_conf.h: Support for the new Milkymist sysctl and clock
	frequency detection.

M    1.6  c/src/lib/libbsp/lm32/milkymist/ChangeLog
M    1.4  c/src/lib/libbsp/lm32/milkymist/include/system_conf.h

diff -u rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog:1.5 rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog:1.6
--- rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog:1.5	Sun Nov 27 11:26:25 2011
+++ rtems/c/src/lib/libbsp/lm32/milkymist/ChangeLog	Sun Nov 27 11:30:11 2011
@@ -1,5 +1,11 @@
 2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>
 
+	PR 1970/bsps
+	* include/system_conf.h: Support for the new Milkymist sysctl and clock
+	frequency detection.
+
+2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>
+
 	PR 1966/bsps
 	* include/system_conf.h: support for the new UART core and interrupt
 	map

diff -u rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h:1.3 rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h:1.4
--- rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h:1.3	Sun Nov 27 11:26:25 2011
+++ rtems/c/src/lib/libbsp/lm32/milkymist/include/system_conf.h	Sun Nov 27 11:30:11 2011
@@ -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)


 *gedare*:
2011-11-27	Sebastien Bourdeauducq <seb at 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.

M    1.4  c/src/lib/libbsp/lm32/shared/ChangeLog
M    1.3  c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c
M    1.4  c/src/lib/libbsp/lm32/shared/milkymist_console/console.c
M    1.4  c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c
M    1.4  c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c

diff -u rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.3 rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.4
--- rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.3	Sun Nov 27 11:26:32 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/ChangeLog	Sun Nov 27 11:30:18 2011
@@ -1,5 +1,12 @@
 2011-11-27	Sebastien Bourdeauducq <seb at 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 at tmplab.org>
+
 	PR 1966/bsps
 	* milkymist_console/console.c, milkymist_console/uart.c,
 	milkymist_console/uart.h, milkymist_midi/midi.c: support for the new

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c:1.2 rtems/c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c:1.3
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c:1.2	Mon Aug  1 08:48:39 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_clock/ckinit.c	Sun Nov 27 11:30:18 2011
@@ -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);

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c:1.3 rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c:1.4
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c:1.3	Sun Nov 27 11:26:32 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c	Sun Nov 27 11:30:18 2011
@@ -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;
 }

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c:1.3 rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c:1.4
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c:1.3	Sun Nov 27 11:26:32 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_console/uart.c	Sun Nov 27 11:30:18 2011
@@ -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)

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c:1.3 rtems/c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c:1.4
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c:1.3	Mon Aug  1 08:48:40 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_timer/timer.c	Sun Nov 27 11:30:18 2011
@@ -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;


 *gedare*:
2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>

	PR 1972/bsps
	* milkymist_video/milkymist_video.h, milkymist_video/video.c: Adds an
	ioctl to implement selection of composite on any connector, S-Video
	and Component sources on the Milkymist One.

M    1.5  c/src/lib/libbsp/lm32/shared/ChangeLog
M    1.2  c/src/lib/libbsp/lm32/shared/milkymist_video/milkymist_video.h
M    1.2  c/src/lib/libbsp/lm32/shared/milkymist_video/video.c

diff -u rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.4 rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.5
--- rtems/c/src/lib/libbsp/lm32/shared/ChangeLog:1.4	Sun Nov 27 11:30:18 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/ChangeLog	Sun Nov 27 11:33:00 2011
@@ -1,5 +1,12 @@
 2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>
 
+	PR 1972/bsps
+	* milkymist_video/milkymist_video.h, milkymist_video/video.c: Adds an
+	ioctl to implement selection of composite on any connector, S-Video
+	and Component sources on the Milkymist One.
+
+2011-11-27	Sebastien Bourdeauducq <seb at tmplab.org>
+
 	PR 1970/bsps
 	* milkymist_clock/ckinit.c, milkymist_console/console.c,
 	milkymist_console/uart.c, milkymist_timer/timer.c: Support for the

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/milkymist_video.h:1.1 rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/milkymist_video.h:1.2
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/milkymist_video.h:1.1	Mon Aug  1 08:48:40 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/milkymist_video.h	Sun Nov 27 11:33:00 2011
@@ -8,7 +8,7 @@
  *
  *  $Id$
  *
- *  COPYRIGHT (c) 2010 Sebastien Bourdeauducq
+ *  COPYRIGHT (c) 2010, 2011 Sebastien Bourdeauducq
  */
 
 #ifndef __MILKYMIST_VIDEO_H_
@@ -33,6 +33,16 @@
 #define VIDEO_SET_REGISTER     0x5609
 #define VIDEO_GET_REGISTER     0x560a
 
+#define VIDEO_SET_FORMAT       0x560b
+
+enum {
+  VIDEO_FORMAT_CVBS6 = 0,
+  VIDEO_FORMAT_CVBS5,
+  VIDEO_FORMAT_CVBS4,
+  VIDEO_FORMAT_SVIDEO,
+  VIDEO_FORMAT_COMPONENT,
+};
+
 rtems_device_driver video_initialize(
   rtems_device_major_number major,
   rtems_device_minor_number minor,

diff -u rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/video.c:1.1 rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/video.c:1.2
--- rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/video.c:1.1	Mon Aug  1 08:48:40 2011
+++ rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/video.c	Sun Nov 27 11:33:00 2011
@@ -267,6 +267,37 @@
   );
 }
 
+static void set_format(int format)
+{
+  switch(format) {
+    case VIDEO_FORMAT_CVBS6:
+      write_reg(0x00, 0x00);
+      write_reg(0xc3, 0x05);
+      write_reg(0xc4, 0x80);
+      break;
+    case VIDEO_FORMAT_CVBS5:
+      write_reg(0x00, 0x00);
+      write_reg(0xc3, 0x0d);
+      write_reg(0xc4, 0x80);
+      break;
+    case VIDEO_FORMAT_CVBS4:
+      write_reg(0x00, 0x00);
+      write_reg(0xc3, 0x04);
+      write_reg(0xc4, 0x80);
+      break;
+    case VIDEO_FORMAT_SVIDEO:
+      write_reg(0x00, 0x06);
+      write_reg(0xc3, 0xd5);
+      write_reg(0xc4, 0x80);
+      break;
+    case VIDEO_FORMAT_COMPONENT:
+      write_reg(0x00, 0x09);
+      write_reg(0xc3, 0x45);
+      write_reg(0xc4, 0x8d);
+      break;
+  }
+}
+
 rtems_device_driver video_control(
   rtems_device_major_number major,
   rtems_device_minor_number minor,
@@ -333,7 +364,7 @@
       break;
     
     case VIDEO_SET_REGISTER:
-      write_reg(((unsigned int )a & 0xffff0000) >> 16,
+      write_reg(((unsigned int)a & 0xffff0000) >> 16,
         (unsigned int)a & 0x0000ffff);
       sc = RTEMS_SUCCESSFUL;
       break;
@@ -342,6 +373,11 @@
       sc = RTEMS_SUCCESSFUL;
       break;
     
+    case VIDEO_SET_FORMAT:
+      set_format((int)a);
+      sc = RTEMS_SUCCESSFUL;
+      break;
+    
     default:
       sc = RTEMS_UNSATISFIED;
       break;



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20111127/80e58e4c/attachment.html>


More information about the vc mailing list