From ed09fd77fcea26ac645b7cbe1f620f1f43c37203 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 11 Aug 2000 19:26:31 +0000 Subject: 2000-08-11 Charles-Antoine Gauthier * README: Updated * console/console.c: Fix polled input. Add support for shared printk. Add support for more flexible polled I/O with and without termios. I/O mode and console is selectable either from NVRAM or from mvme167.cfg. Clean up comments. 2000-08-11 Charles-Antoine Gauthier * startup/page_table.c (page_table_init): Reorganize NVRAM parameters. * include/bsp.h: Reorganize NVRAM parameters. Add support for shared printk. * times: These are the times for the MVME167, not the MBX860-002. 2000-08-11 John Cotton * network/network.c: Fix NVRAM configuration parameter handling from previous revision. Check J1-4, restructure NVRAM parameter handling. 2000-08-11 Charles-Antoine Gauthier * network/network.c: Cleanup of network driver to reduce warnings. Addition of second parameter to uti596_attach. --- c/src/lib/libbsp/m68k/mvme167/README | 410 +++++++++++++---------------------- 1 file changed, 153 insertions(+), 257 deletions(-) (limited to 'c/src/lib/libbsp/m68k/mvme167/README') diff --git a/c/src/lib/libbsp/m68k/mvme167/README b/c/src/lib/libbsp/m68k/mvme167/README index 861d07eac4..379fd5ca2e 100644 --- a/c/src/lib/libbsp/m68k/mvme167/README +++ b/c/src/lib/libbsp/m68k/mvme167/README @@ -54,33 +54,84 @@ this file if you want S-records. Port Description + Console driver --------------- -This BSP includes an termios-capable console driver that supports all -four serial ports on the MVME167 model. The RTEMS console, /dev/console, -corresponds to channel 1 in the CD2401. This corresponds to Serial Port -2/TTY01 on the MVME712M. Serial Port 1/Console is normally used by 167Bug; -do not open /dev/tty00 if you are debugging using 167Bug. - -The console is initialized with whatever parameters are set up in termios -before it calls the firtOpen driver callback, EXCEPT THAT HARDWARE -HANDSHAKING IS TURNED OFF, i.e. CLOCAL is set in the struct termios -c_cflag field. We use 3-wire cables for I/O, and find hardware handshaking -a pain. If you enable hardware handshaking, you must drive CTS* low on the -CD2401 for output to occur. If the port is in the DTE configuration, you -must drive the RS-232 CTS line to space; if the port is in the DCE -configuration, you must drive the RS-232 RTS line to space. +This BSP includes an termios-capable interrupt-driven I/O console driver +that supports all four serial ports on the MVME167 model. The port labelled +Serial Port 1/Console on the MVME712 is normally used by 167Bug; do not open +/dev/tty00 if you are debugging using 167Bug. Limited support is provided for polled terminal I/O. This is used when -running the timing tests. Set the CD2401_POLLED_IO manifest constant to 1 -in rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c to enable polled -I/O. In this case, I/O is done through 167Bug, usually to the Serial Port -1/Console port. Interrupt-driven and polled I/O cannot be mixed in the -MVME167. +running the timing tests, and by the printk() debug output function. +Polled I/O may use termios, or it may bypass those services. The printk() +function does not use termios. When polled I/O is used, the terminal settings +must be set through 167-Bug; trying to change the line settings through RTEMS +has no effect. + +Three is no support for using interrupt-driven I/O without termios support. + +The default configuration is to use polled I/O and to bypass termios. This +is done so the test can be built at the same time as the rest of the system. +It is highly recommended that the defaults be changed in the mvme167.cfg file +to reflect the desired defaults, or that the appropriate parameters be set up +in NVRAM to select the appropriate I/O modes at boot time. + +When configured for interrupt-driven I/O, the console is initialized with +whatever parameters are set up in termios before it calls the firtOpen driver +callback, EXCEPT THAT HARDWARE HANDSHAKING IS TURNED OFF, i.e. CLOCAL is set +in the struct termios c_cflag field. We use 3-wire cables for I/O, and find +hardware handshaking a pain. If you enable hardware handshaking, you must drive +CTS* low on the CD2401 for output to occur. If the port is in the DTE +configuration, you must drive the RS-232 CTS line to space; if the port is +in the DCE configuration, you must drive the RS-232 RTS line to space. + +To use interrupt-driven I/O, set the CD2401_IO_MODE manifest constant to 1 in +rtems/make/custom/mvme167.cfg, or configure the appropriate parameter in +User Area Non-volatile RAM. See the Configuration Parameters section below +for instructions on setting up NVRAM. + +To use termios, set the CD2401_USE_TERMIOS manifest constant to 1 in +rtems/make/custom/mvme167.cfg, or configure the appropriate parameter in +User Area Non-volatile RAM. See the Configuration Parameters section +below for instructions on setting up NVRAM. + +The RTEMS console, i.e. the port used by stdin, stdout and stderr (do not +confuse it with the port labelled Console on the MVME712), must be +specified in the rtems/make/custom/mvme167.cfg file, or in the NVRAM +parameters. Set the value of CONSOLE_MINOR appropriately. See below for a +list of choices. See the Configuration Parameters section below for +instructions on setting up NVRAM. + +The RTEMS printk port, i.e. the port where printk sends it debugging output +text, must be specified in the rtems/make/custom/mvme167.cfg file, or in the +NVRAM parameters. Set the value of PRINTK_MINOR appropriately. See below for a +list of choices. See the Configuration Parameters section below for +instructions on setting up NVRAM. + +Interrupt-driven and polled I/O cannot be mixed in the MVME167, except that +printk always used polled I/O without termios. If interrupt-driven I/O is +used and printk is used, do not open the device that printk uses from an +RTEMS application. + +Console and printk port choices: + + 0 - /dev/tty0, Serial Port 1/Console on the MVME712M. + 1 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M. + 2 - /dev/tty2, Serial Port 3 on the MVME712M. + 3 - /dev/tty3, Serial Port 4 on the MVME712M. + +Setting the RTEMS console to port 0 when interrupt-driven I/O is specified +will prevent 167-Bug from using that port. + +To use polled I/O on port 2 or 3, the port must be configured in 167-Bug. See +the "PF" command in the "Debugging Package for Motorola 68K CISC CPUs User's +Manual", part number 68KBUG. Floating-point +-------------- The MC68040 has a built-in FPU. This FPU does not implement all the instruction of the MC68881/MC68882 floating-point coprocessors in @@ -135,42 +186,68 @@ against. Configuration Parameters +------------------------ If Jumper J1-4 is installed, certain configuration parameters may be read from the first 31 bytes of User Area NVRAM starting at 0xFFFC0000. In this case, the -user is responsible for writing the appropriate values to this memory location -(via 167Bug) in order to alter the default behaviour. A zero value results in -the default behaviour. The paramaters that are configurable and their default -settings are described below. - - Data Cache Enable (0xFFFC0000 - 1 byte) - write a non-zero value to this location to enable the data cache - default: disabled - - Instruction Cache Activation (0xFFFC0001 - 1 byte) - write a non-zero value to this location to enable the instruction cache - default: disabled +remaining J1-[5-7] jumpers are ignored, and the user is responsible for writing +the appropriate values in NVRAM (via 167-Bug) in order to alter the default +behaviour. A zero value in NVRAM results in the default behaviour. The paramaters +that are configurable and their default settings are described below. - Cache Mode (0xFFFC0002 - 2 bytes) - 0xFFF0 = cachable, write-through - 0xFFF1 = cachable, copyback - 0xFFF2 = noncachable, serialized - 0xFFF3 = noncachable, - default: cachable, copyback - + Cache Mode (0xFFFC0000 - 1 byte) + Set the following bits in the byte to set the desired cache mode: + bit 0 + 0 - data cache disable + 1 - data cache enable + bit 1 + 0 - instruction cache disable + 1 - instruction cache enable + bits 2 & 3: + 00 = cachable, write-through + 01 = cachable, copyback + 10 = noncachable, serialized + 11 = noncachable + + Console driver I/O mode (0xFFFC0001 - 1 byte) + Set the following bits in the byte to set the desired I/O mode: + bit 0 + 0 - do not use termios + 1 - use termios + bit 1 + 0 - polled I/O + 1 - interrupt-driven I/O + + Console driver ports (0xFFFC0002 - 1 byte) + Set the following bits in the byte to select the console and printk ports: + bit 0 & 1 select the RTEMS console port + 00 - /dev/tty0, Serial Port 1/Console on the MVME712M. + 01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M. + 10 - /dev/tty2, Serial Port 3 on the MVME712M. + 11 - /dev/tty3, Serial Port 4 on the MVME712M. + bit 4 & 5 select the RTEMS printk port + 00 - /dev/tty0, Serial Port 1/Console on the MVME712M. + 01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M. + 10 - /dev/tty2, Serial Port 3 on the MVME712M. + 11 - /dev/tty3, Serial Port 4 on the MVME712M. + If the printk port is the same as some other port that will be opened by an + RTEMS application, then the driver must use polled I/O, or the printk port + must not be used. + IP Address (0xFFFC0004 - 4 bytes) - write the hexidecimal representation of the board's IP address in this - location for example, 192.168.1.2 = 0xC0A80102 + write the hexadecimal representation of the IP address of the board in this + locatio, e.g. 192.168.1.2 = 0xC0A80102 default: obtain the IP address from an rtems_bsdnet_ifconfig structure Netmask (0xFFFC0008 - 4 bytes) - write the hexidecimal representation of the netmask in this location + write the hexadecimal representation of the netmask in this location for example, 255.255.255.0 = 0xFFFFFF00 default: obtain the netmask from an rtems_bsdnet_ifconfig structure Ethernet Address (0xFFFC000C - 6 bytes) - write the board's hardware address in this location - default: obtain the hardware address from an rtems_bsdnet_ifconfig structure + write the Ethernet address of the board in this location + default: obtain the hardware address from an rtems_bsdnet_ifconfig + structure Processor ID (0xFFFC0012 - 2 bytes) reserved for future use @@ -186,13 +263,14 @@ settings are described below. Cache Control and Memory Mapping +-------------------------------- If configuration is not obtained from non-volatile RAM (ie. J1-4 is off), cache control is done through the remaining J1 jumpers as follows: If Jumper J1-7 is installed, the data cache will be turned on. If Jumper -J1-6 is installed, the instruction cache will be turned on. Removing the -jumper causes the corresponding cache to be left disabled. +J1-6 is installed, the instruction cache will be turned on. (If a jumper +is off, its corresponding cache will remain disabled). If Jumper J1-5 is installed, the data cache will be placed in copyback mode. If it is removed, it will be placed in writethrough mode. @@ -203,7 +281,24 @@ port relies on the hardware to raise exceptions when addressing non-existent memory. Caching is not controllable on a finer grain. +Networking +---------- + +If configuration is not obtained from non-volatile RAM (ie. J1-4 is off), +the networking parameters shown above must be specified in an initialized +rtems_bsdnet_ifconfig struct. This structure is declared and initialized to +specify any network devices and includes entries for ip_address, ip_netmask +and hardware_address. See the Network Device Configuration section of the +RTEMS Networking Supplement. + +When non-default (non-zero) networking paramaters are provided in NVRAM (ie. +j1-4 is on), the user MUST ensure that the corresponding entries in the +ifconfig struct are NULL. Failing to do so is an error, because it causes +the memory allocated for the initialized struct values to be lost. + + Miscellaneous +------------- The timer and clock drivers were patterned after the MVME162 and MVME152 ports. @@ -238,12 +333,21 @@ With the latter environment, be patient; builds take a very looong time... Current development is done on a Pentium III PC running RedHat Linux 6.1. At the time this README was composed, the latest working compiler that was used successfully was gcc version 2.96 20000213 (experimental). Both the C -and C++ compilers were working. Binutils 2.9.1 are used. +and C++ compilers were working. Binutils 2.10 are used. Known Problems -------------- +Polled I/O without termios may not work very well on input. The problem +is that input processing is not done: applications may get characters too +early, and may get characters that they normally would not get, such as +backspace or delete. Furthermore, input is not buffered at all. The latest +versions of rtems seem to set the count field in the rtems_libio_rw_args_t +argument to the buffer size, not to the number of characters expected on +input. Rather than wait for 1024 characters on each call, the driver +returns each character when it is received. + The cdtest will not run with interrupt-driven I/O. The reason is that the constructors for the static objects are called at boot time when the interrupts are still disabled. The output buffer fills up, but never empties, @@ -252,10 +356,6 @@ should have been documented in the rtems/c/src/tests/PROBLEMS file. The moral of this story is: do not do I/O from the constructors or destructors of static objects. -The cpuuse and malloctest tests do not work properly, either with polled I/O -or interrupt-driven I/O. They are known not to work with interrupt-driven I/O, -but should work with polled I/O? - Output stops prematurely in the termios test when the console is operating in interrupt-driven mode because the serial port is re-initialized before all characters in the last raw output buffer are sent. Adding calls to tcdrain() @@ -287,8 +387,8 @@ it does not return control to 167Bug. Is this test supposed to work with interrupt-driven console I/O? -What's new ----------- +What is new +----------- Support for Java is being actively worked on. @@ -335,209 +435,5 @@ Single processor tests: All tests passed, except the following ones: Multi-processort tests: not applicable -- No MPCI layer yet. -Timing tests: - - Context Switch - - context switch: no floating point contexts 12 - context switch: self 3 - context switch: to another task 3 - fp context switch: restore 1st FP task 14 - fp context switch: save idle, restore initialized 5 - fp context switch: save idle, restore idle 15 - fp context switch: save initialized, restore initialized 5 - - - Miscellaneous +Timing tests: See rtems/c/src/lib/libbsp/m68k/mvme167/times - _ISR_Disable 1 - _ISR_Flash 0 - _ISR_Enable 0 - - _Thread_Disable_dispatch 0 - _Thread_Enable_dispatch 3 - _Thread_Set_state 9 - _Thread_Disptach (NO FP) 16 - _Thread_Resume 6 - _Thread_Unblock 4 - _Thread_Ready 6 - _Thread_Get 3 - _Thread_Get: invalid id 0 - - _Semaphore_Get 2 - - - Task Manager - - rtems_task_create 56 - rtems_task_ident 106 - rtems_task_start 21 - rtems_task_restart: calling task 24 - rtems_task_restart: suspended task -- returns to caller 27 - rtems_task_restart: blocked task -- returns to caller 36 - rtems_task_restart: ready task -- returns to caller 27 - rtems_task_restart: suspended task -- preempts caller 40 - rtems_task_restart: blocked task -- preempts caller 51 - rtems_task_restart: ready task -- preempts caller 52 - rtems_task_delete: calling task 67 - rtems_task_delete: suspended task 52 - rtems_task_delete: blocked task 54 - rtems_task_delete: ready task 54 - rtems_task_suspend: calling task 23 - rtems_task_suspend: returns to caller 12 - rtems_task_resume: task readied -- returns to caller 13 - rtems_task_resume: task readied -- preempts caller 22 - rtems_task_set_priority: obtain current priority 8 - rtems_task_set_priority: returns to caller 16 - rtems_task_set_priority: preempts caller 34 - rtems_task_mode: obtain current mode 4 - rtems_task_mode: no reschedule 5 - rtems_task_mode: reschedule -- returns to caller 12 - rtems_task_mode: reschedule -- preempts caller 26 - rtems_task_get_note 8 - rtems_task_set_note 8 - rtems_task_wake_after: yield -- returns to caller 4 - rtems_task_wake_after: yields -- preempts caller 19 - rtems_task_wake_when 36 - - - Interrupt Manager - - interrupt entry overhead: returns to nested interrupt 5 - interrupt entry overhead: returns to interrupted task 9 - interrupt entry overhead: returns to preempting task 7 - interrupt exit overhead: returns to nested interrupt 1 - interrupt exit overhead: returns to interrupted task 2 - interrupt exit overhead: returns to preempting task 26 - - - Clock Manager - - rtems_clock_set 20 - rtems_clock_get <1 - rtems_clock_tick 8 - - - Timer Manager - - rtems_timer_create 8 - rtems_timer_ident 104 - rtems_timer_delete: inactive 12 - rtems_timer_delete: active 13 - rtems_timer_fire_after: inactive 17 - rtems_timer_fire_after: active 18 - rtems_timer_fire_when: inactive 23 - rtems_timer_fire_when: active 23 - rtems_timer_reset: inactive 16 - rtems_timer_reset: active 17 - rtems_timer_cancel: inactive 9 - rtems_timer_cancel: active 10 - - - Semaphore Manager - - rtems_semaphore_create 22 - rtems_semaphore_ident 119 - rtems_semaphore_delete 24 - rtems_semaphore_obtain: available 10 - rtems_semaphore_obtain: not available -- NO_WAIT 10 - rtems_semaphore_obtain: not available -- caller blocks 35 - rtems_semaphore_release: no waiting tasks 11 - rtems_semaphore_release: task readied -- returns to caller 17 - rtems_semaphore_release: task readied -- preempts caller 27 - - - Message Queue Manager - - rtems_message_queue_create 85 - rtems_message_queue_ident 103 - rtems_message_queue_delete 32 - rtems_message_queue_send: no waiting tasks 25 - rtems_message_queue_send: task readied -- returns to caller 27 - rtems_message_queue_send: task readied -- preempts caller 39 - rtems_message_queue_urgent: no waiting tasks 26 - rtems_message_queue_urgent: task readied -- returns to caller 28 - rtems_message_queue_urgent: task readied -- preempts caller 39 - rtems_message_queue_broadcast: no waiting tasks 13 - rtems_message_queue_broadcast: task readied -- returns to caller 37 - rtems_message_queue_broadcast: task readied -- preempts caller 45 - rtems_message_queue_receive: available 21 - rtems_message_queue_receive: not available -- NO_WAIT 11 - rtems_message_queue_receive: not available -- caller blocks 37 - rtems_message_queue_flush: no messages flushed 7 - rtems_message_queue_flush: messages flushed 10 - - - Event Manager - - rtems_event_send: no task readied 7 - rtems_event_send: task readied -- returns to caller 18 - rtems_event_send: task readied -- preempts caller 29 - rtems_event_receive: obtain current events <1 - rtems_event_receive: available 10 - rtems_event_receive: not available -- NO_WAIT 5 - rtems_event_receive: not available -- caller blocks 28 - - - Signal Manager - - rtems_signal_catch 5 - rtems_signal_send: returns to caller 15 - rtems_signal_send: signal to self 24 - exit ASR overhead: returns to calling task 20 - exit ASR overhead: returns to preempting task 21 - - - Partition Manager - - rtems_partition_create 30 - rtems_partition_ident 103 - rtems_partition_delete 14 - rtems_partition_get_buffer: available 14 - rtems_partition_get_buffer: not available 9 - rtems_partition_return_buffer 18 - - - Region Manager - - rtems_region_create 25 - rtems_region_ident 105 - rtems_region_delete 13 - rtems_region_get_segment: available 13 - rtems_region_get_segment: not available -- NO_WAIT 17 - rtems_region_get_segment: not available -- caller blocks 49 - rtems_region_return_segment: no waiting tasks 16 - rtems_region_return_segment: task readied -- returns to caller 35 - rtems_region_return_segment: task readied -- preempts caller 58 - - - Dual-Ported Memory Manager - - rtems_port_create 13 - rtems_port_ident 103 - rtems_port_delete 14 - rtems_port_external_to_internal 5 - rtems_port_internal_to_external 5 - - - IO Manager - - rtems_io_initialize <1 - rtems_io_open <1 - rtems_io_close <1 - rtems_io_read <1 - rtems_io_write <1 - rtems_io_control <1 - - - Rate Monotonic Manager - - rtems_rate_monotonic_create 15 - rtems_rate_monotonic_ident 103 - rtems_rate_monotonic_cancel 16 - rtems_rate_monotonic_delete: active 18 - rtems_rate_monotonic_delete: inactive 20 - rtems_rate_monotonic_period: initiate period -- returns to caller 23 - rtems_rate_monotonic_period: conclude periods -- caller blocks 25 - rtems_rate_monotonic_period: obtain status 13 - -- cgit v1.2.3