Changeset ed09fd77 in rtems


Ignore:
Timestamp:
Aug 11, 2000, 7:26:31 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
57b1f53
Parents:
b96ca51
Message:

2000-08-11 Charles-Antoine Gauthier <charles.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 <charles.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 <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 <charles.gauthier@…>

  • network/network.c: Cleanup of network driver to reduce warnings. Addition of second parameter to uti596_attach.
Location:
c/src/lib/libbsp/m68k/mvme167
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mvme167/ChangeLog

    rb96ca51 red09fd77  
     12000-08-11  Charles-Antoine Gauthier  <charles.gauthier@nrc.ca>
     2
     3        * README: Updated
     4        * console/console.c: Fix polled input.
     5        Add support for shared printk.
     6        Add support for more flexible polled I/O with and without termios.
     7        I/O mode and console is selectable either from NVRAM or from
     8        mvme167.cfg.  Clean up comments.
     9
     102000-08-11  Charles-Antoine Gauthier  <charles.gauthier@nrc.ca>
     11
     12        * startup/page_table.c (page_table_init): Reorganize NVRAM parameters.
     13        * include/bsp.h: Reorganize NVRAM parameters.
     14        Add support for shared printk.
     15        * times: These are the times for the MVME167, not the MBX860-002.
     16
     172000-08-11  John Cotton  <john.cotton@nrc.ca>
     18
     19        * network/network.c: Fix NVRAM configuration parameter
     20        handling from previous revision.
     21        Check J1-4,  restructure NVRAM parameter handling.
     22
     232000-08-11  Charles-Antoine Gauthier  <charles.gauthier@nrc.ca>
     24
     25        * network/network.c: Cleanup of network driver to reduce warnings.
     26        Addition of second parameter to uti596_attach.
    1272000-08-10      Joel Sherrill <joel@OARcorp.com>
    228
  • c/src/lib/libbsp/m68k/mvme167/README

    rb96ca51 red09fd77  
    5555
    5656Port Description
     57
    5758Console driver
    5859---------------
    5960
    60 This BSP includes an termios-capable console driver that supports all
    61 four serial ports on the MVME167 model. The RTEMS console, /dev/console,
    62 corresponds to channel 1 in the CD2401. This corresponds to Serial Port
    63 2/TTY01 on the MVME712M. Serial Port 1/Console is normally used by 167Bug;
    64 do not open /dev/tty00 if you are debugging using 167Bug.
    65 
    66 The console is initialized with whatever parameters are set up in termios
    67 before it calls the firtOpen driver callback, EXCEPT THAT HARDWARE
    68 HANDSHAKING IS TURNED OFF, i.e. CLOCAL is set in the struct termios
    69 c_cflag field. We use 3-wire cables for I/O, and find hardware handshaking
    70 a pain. If you enable hardware handshaking, you must drive CTS* low on the
    71 CD2401 for output to occur. If the port is in the DTE configuration, you
    72 must drive the RS-232 CTS line to space; if the port is in the DCE
    73 configuration, you must drive the RS-232 RTS line to space.
     61This BSP includes an termios-capable interrupt-driven I/O console driver
     62that supports all four serial ports on the MVME167 model. The port labelled
     63Serial Port 1/Console on the MVME712 is normally used by 167Bug; do not open
     64/dev/tty00 if you are debugging using 167Bug.
    7465
    7566Limited support is provided for polled terminal I/O. This is used when
    76 running the timing tests. Set the CD2401_POLLED_IO manifest constant to 1
    77 in rtems/c/src/lib/libbsp/m68k/mvme167/console/console.c to enable polled
    78 I/O. In this case, I/O is done through 167Bug, usually to the Serial Port
    79 1/Console port. Interrupt-driven and polled I/O cannot be mixed in the
    80 MVME167.
     67running the timing tests, and by the printk() debug output function.
     68Polled I/O may use termios, or it may bypass those services. The printk()
     69function does not use termios. When polled I/O is used, the terminal settings
     70must be set through 167-Bug; trying to change the line settings through RTEMS
     71has no effect.
     72
     73Three is no support for using interrupt-driven I/O without termios support.
     74
     75The default configuration is to use polled I/O and to bypass termios. This
     76is done so the test can be built at the same time as the rest of the system.
     77It is highly recommended that the defaults be changed in the mvme167.cfg file
     78to reflect the desired defaults, or that the appropriate parameters be set up
     79in NVRAM to select the appropriate I/O modes at boot time.
     80
     81When configured for interrupt-driven I/O, the console is initialized with
     82whatever parameters are set up in termios before it calls the firtOpen driver
     83callback, EXCEPT THAT HARDWARE HANDSHAKING IS TURNED OFF, i.e. CLOCAL is set
     84in the struct termios c_cflag field. We use 3-wire cables for I/O, and find
     85hardware handshaking a pain. If you enable hardware handshaking, you must drive
     86CTS* low on the CD2401 for output to occur. If the port is in the DTE
     87configuration, you must drive the RS-232 CTS line to space; if the port is
     88in the DCE configuration, you must drive the RS-232 RTS line to space.
     89
     90To use interrupt-driven I/O, set the CD2401_IO_MODE manifest constant to 1 in
     91rtems/make/custom/mvme167.cfg, or configure the appropriate parameter in
     92User Area Non-volatile RAM. See the Configuration Parameters section below
     93for instructions on setting up NVRAM.
     94
     95To use termios, set the CD2401_USE_TERMIOS manifest constant to 1 in
     96rtems/make/custom/mvme167.cfg, or configure the appropriate parameter in
     97User Area Non-volatile RAM. See the Configuration Parameters section
     98below for instructions on setting up NVRAM.
     99
     100The RTEMS console, i.e. the port used by stdin, stdout and stderr (do not
     101confuse it with the port labelled Console on the MVME712), must be
     102specified in the rtems/make/custom/mvme167.cfg file, or in the NVRAM
     103parameters. Set the value of CONSOLE_MINOR appropriately. See below for a
     104list of choices. See the Configuration Parameters section below for
     105instructions on setting up NVRAM.
     106
     107The RTEMS printk port, i.e. the port where printk sends it debugging output
     108text, must be specified in the rtems/make/custom/mvme167.cfg file, or in the
     109NVRAM parameters. Set the value of PRINTK_MINOR appropriately. See below for a
     110list of choices. See the Configuration Parameters section below for
     111instructions on setting up NVRAM.
     112
     113Interrupt-driven and polled I/O cannot be mixed in the MVME167, except that
     114printk always used polled I/O without termios. If interrupt-driven I/O is
     115used and printk is used, do not open the device that printk uses from an
     116RTEMS application.
     117
     118Console and printk port choices:
     119
     120  0 - /dev/tty0, Serial Port 1/Console on the MVME712M.
     121  1 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.
     122  2 - /dev/tty2, Serial Port 3 on the MVME712M.
     123  3 - /dev/tty3, Serial Port 4 on the MVME712M.
     124
     125Setting the RTEMS console to port 0 when interrupt-driven I/O is specified
     126will prevent 167-Bug from using that port.
     127
     128To use polled I/O on port 2 or 3, the port must be configured in 167-Bug. See
     129the "PF" command in the "Debugging Package for Motorola 68K CISC CPUs User's
     130Manual", part number 68KBUG.
    81131
    82132
    83133Floating-point
     134--------------
    84135
    85136The MC68040 has a built-in FPU. This FPU does not implement all the
     
    136187
    137188Configuration Parameters
     189------------------------
    138190
    139191If Jumper J1-4 is installed, certain configuration parameters may be read from
    140192the first 31 bytes of User Area NVRAM starting at 0xFFFC0000. In this case, the
    141 user is responsible for writing the appropriate values to this memory location
    142 (via 167Bug) in order to alter the default behaviour. A zero value results in
    143 the default behaviour. The paramaters that are configurable and their default
    144 settings are described below.
    145 
    146         Data Cache Enable (0xFFFC0000 - 1 byte)
    147                 write a non-zero value to this location to enable the data cache
    148                 default: disabled
    149        
    150         Instruction Cache Activation (0xFFFC0001 - 1 byte)
    151                 write a non-zero value to this location to enable the instruction cache
    152                 default: disabled
     193remaining J1-[5-7] jumpers are ignored, and the user is responsible for writing
     194the appropriate values in NVRAM (via 167-Bug) in order to alter the default
     195behaviour. A zero value in NVRAM results in the default behaviour. The paramaters
     196that are configurable and their default settings are described below.
    153197               
    154         Cache Mode (0xFFFC0002 - 2 bytes)
    155                 0xFFF0 = cachable, write-through
    156                 0xFFF1 = cachable, copyback
    157                 0xFFF2 = noncachable, serialized
    158                 0xFFF3 = noncachable,
    159                 default: cachable, copyback
    160 
     198        Cache Mode (0xFFFC0000 - 1 byte)
     199          Set the following bits in the byte to set the desired cache mode:
     200            bit 0
     201              0 - data cache disable
     202              1 - data cache enable
     203            bit 1
     204              0 - instruction cache disable
     205              1 - instruction cache enable
     206            bits 2 & 3:
     207                    00 = cachable, write-through
     208                    01 = cachable, copyback
     209                    10 = noncachable, serialized
     210                    11 = noncachable
     211
     212        Console driver I/O mode (0xFFFC0001 - 1 byte)
     213          Set the following bits in the byte to set the desired I/O mode:
     214            bit 0
     215              0 - do not use termios
     216              1 - use termios
     217            bit 1
     218              0 - polled I/O
     219              1 - interrupt-driven I/O
     220
     221        Console driver ports (0xFFFC0002 - 1 byte)
     222          Set the following bits in the byte to select the console and printk ports:
     223            bit 0 & 1 select the RTEMS console port
     224        00 - /dev/tty0, Serial Port 1/Console on the MVME712M.
     225        01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.
     226        10 - /dev/tty2, Serial Port 3 on the MVME712M.
     227        11 - /dev/tty3, Serial Port 4 on the MVME712M.
     228            bit 4 & 5 select the RTEMS printk port
     229        00 - /dev/tty0, Serial Port 1/Console on the MVME712M.
     230        01 - /dev/tty1, Serial Port 2/TTY01 on the MVME712M.
     231        10 - /dev/tty2, Serial Port 3 on the MVME712M.
     232        11 - /dev/tty3, Serial Port 4 on the MVME712M.
     233    If the printk port is the same as some other port that will be opened by an
     234    RTEMS application, then the driver must use polled I/O, or the printk port
     235    must not be used.
     236   
    161237        IP Address (0xFFFC0004 - 4 bytes)
    162                 write the hexidecimal representation of the board's IP address in this
    163                 location for example, 192.168.1.2 = 0xC0A80102
     238                write the hexadecimal representation of the IP address of the board in this
     239                locatio, e.g. 192.168.1.2 = 0xC0A80102
    164240                default: obtain the IP address from an rtems_bsdnet_ifconfig structure
    165241
    166242        Netmask (0xFFFC0008 - 4 bytes)
    167                 write the hexidecimal representation of the netmask in this location
     243                write the hexadecimal representation of the netmask in this location
    168244                for example, 255.255.255.0 = 0xFFFFFF00
    169245                default: obtain the netmask from an rtems_bsdnet_ifconfig structure
    170246               
    171247        Ethernet Address (0xFFFC000C - 6 bytes)
    172                 write the board's hardware address in this location
    173                 default: obtain the hardware address from an rtems_bsdnet_ifconfig structure
     248                write the Ethernet address of the board in this location
     249                default: obtain the hardware address from an rtems_bsdnet_ifconfig
     250                         structure
    174251
    175252        Processor ID (0xFFFC0012 - 2 bytes)
     
    187264
    188265Cache Control and Memory Mapping
     266--------------------------------
    189267
    190268If configuration is not obtained from non-volatile RAM (ie. J1-4 is off),
     
    192270
    193271If Jumper J1-7 is installed, the data cache will be turned on. If Jumper
    194 J1-6 is installed, the instruction cache will be turned on. Removing the
    195 jumper causes the corresponding cache to be left disabled.
     272J1-6 is installed, the instruction cache will be turned on. (If a jumper
     273is off, its corresponding cache will remain disabled).
    196274
    197275If Jumper J1-5 is installed, the data cache will be placed in copyback
     
    204282
    205283
     284Networking
     285----------
     286
     287If configuration is not obtained from non-volatile RAM (ie. J1-4 is off),
     288the networking parameters shown above must be specified in an initialized
     289rtems_bsdnet_ifconfig struct. This structure is declared and initialized to
     290specify any network devices and includes entries for ip_address, ip_netmask
     291and hardware_address. See the Network Device Configuration section of the
     292RTEMS Networking Supplement.
     293
     294When non-default (non-zero) networking paramaters are provided in NVRAM (ie.
     295j1-4 is on), the user MUST ensure that the corresponding entries in the
     296ifconfig struct are NULL. Failing to do so is an error, because it causes
     297the memory allocated for the initialized struct values to be lost.
     298
     299
    206300Miscellaneous
     301-------------
    207302
    208303The timer and clock drivers were patterned after the MVME162 and MVME152
     
    239334At the time this README was composed, the latest working compiler that was
    240335used successfully was gcc version 2.96 20000213 (experimental). Both the C
    241 and C++ compilers were working. Binutils 2.9.1 are used.
     336and C++ compilers were working. Binutils 2.10 are used.
    242337
    243338
    244339Known Problems
    245340--------------
     341
     342Polled I/O without termios may not work very well on input. The problem
     343is that input processing is not done: applications may get characters too
     344early, and may get characters that they normally would not get, such as
     345backspace or delete. Furthermore, input is not buffered at all. The latest
     346versions of rtems seem to set the count field in the rtems_libio_rw_args_t
     347argument to the buffer size, not to the number of characters expected on
     348input. Rather than wait for 1024 characters on each call, the driver
     349returns each character when it is received.
    246350
    247351The cdtest will not run with interrupt-driven I/O. The reason is that the
     
    252356of this story is: do not do I/O from the constructors or destructors of static
    253357objects.
    254 
    255 The cpuuse and malloctest tests do not work properly, either with polled I/O
    256 or interrupt-driven I/O. They are known not to work with interrupt-driven I/O,
    257 but should work with polled I/O?
    258358
    259359Output stops prematurely in the termios test when the console is operating in
     
    288388
    289389
    290 What's new
    291 ----------
     390What is new
     391-----------
    292392
    293393Support for Java is being actively worked on.
     
    336436
    337437
    338 Timing tests:
    339 
    340         Context Switch
    341 
    342     context switch: no floating point contexts 12
    343     context switch: self 3
    344     context switch: to another task 3
    345     fp context switch: restore 1st FP task 14
    346     fp context switch: save idle, restore initialized 5
    347     fp context switch: save idle, restore idle 15
    348     fp context switch: save initialized, restore initialized 5
    349    
    350    
    351   Miscellaneous
     438Timing tests: See rtems/c/src/lib/libbsp/m68k/mvme167/times
    352439 
    353     _ISR_Disable 1
    354     _ISR_Flash 0
    355     _ISR_Enable 0
    356    
    357     _Thread_Disable_dispatch 0
    358     _Thread_Enable_dispatch 3
    359     _Thread_Set_state 9
    360     _Thread_Disptach (NO FP) 16
    361     _Thread_Resume 6
    362     _Thread_Unblock 4
    363     _Thread_Ready 6
    364     _Thread_Get 3
    365     _Thread_Get: invalid id 0
    366    
    367     _Semaphore_Get 2
    368 
    369 
    370         Task Manager
    371 
    372     rtems_task_create 56
    373     rtems_task_ident 106
    374     rtems_task_start 21
    375     rtems_task_restart: calling task 24
    376     rtems_task_restart: suspended task -- returns to caller 27
    377     rtems_task_restart: blocked task -- returns to caller 36
    378     rtems_task_restart: ready task -- returns to caller 27
    379     rtems_task_restart: suspended task -- preempts caller 40
    380     rtems_task_restart: blocked task -- preempts caller 51
    381     rtems_task_restart: ready task -- preempts caller 52
    382     rtems_task_delete: calling task 67
    383     rtems_task_delete: suspended task 52
    384     rtems_task_delete: blocked task 54
    385     rtems_task_delete: ready task 54
    386     rtems_task_suspend: calling task 23
    387     rtems_task_suspend: returns to caller 12
    388     rtems_task_resume: task readied -- returns to caller 13
    389     rtems_task_resume: task readied -- preempts caller 22
    390     rtems_task_set_priority: obtain current priority 8
    391     rtems_task_set_priority: returns to caller 16
    392     rtems_task_set_priority: preempts caller 34
    393     rtems_task_mode: obtain current mode 4
    394     rtems_task_mode: no reschedule 5
    395     rtems_task_mode: reschedule -- returns to caller 12
    396     rtems_task_mode: reschedule -- preempts caller 26
    397     rtems_task_get_note 8
    398     rtems_task_set_note 8
    399     rtems_task_wake_after: yield -- returns to caller 4
    400     rtems_task_wake_after: yields -- preempts caller 19
    401     rtems_task_wake_when 36
    402 
    403 
    404         Interrupt Manager
    405 
    406     interrupt entry overhead: returns to nested interrupt 5
    407     interrupt entry overhead: returns to interrupted task 9
    408     interrupt entry overhead: returns to preempting task 7
    409     interrupt exit overhead: returns to nested interrupt 1
    410     interrupt exit overhead: returns to interrupted task 2
    411     interrupt exit overhead: returns to preempting task 26
    412 
    413 
    414         Clock Manager
    415 
    416     rtems_clock_set 20
    417     rtems_clock_get <1
    418     rtems_clock_tick 8
    419 
    420 
    421         Timer Manager
    422 
    423     rtems_timer_create 8
    424         rtems_timer_ident 104
    425     rtems_timer_delete: inactive 12
    426     rtems_timer_delete: active 13
    427     rtems_timer_fire_after: inactive 17
    428     rtems_timer_fire_after: active 18
    429     rtems_timer_fire_when: inactive 23
    430     rtems_timer_fire_when: active 23
    431     rtems_timer_reset: inactive 16
    432     rtems_timer_reset: active 17
    433     rtems_timer_cancel: inactive 9
    434     rtems_timer_cancel: active 10
    435 
    436 
    437         Semaphore Manager
    438 
    439     rtems_semaphore_create 22
    440     rtems_semaphore_ident 119
    441     rtems_semaphore_delete 24
    442     rtems_semaphore_obtain: available 10
    443     rtems_semaphore_obtain: not available -- NO_WAIT 10
    444     rtems_semaphore_obtain: not available -- caller blocks 35
    445     rtems_semaphore_release: no waiting tasks 11
    446     rtems_semaphore_release: task readied -- returns to caller 17
    447     rtems_semaphore_release: task readied -- preempts caller 27
    448 
    449 
    450         Message Queue Manager
    451 
    452     rtems_message_queue_create 85
    453     rtems_message_queue_ident 103
    454     rtems_message_queue_delete 32
    455     rtems_message_queue_send: no waiting tasks 25
    456     rtems_message_queue_send: task readied -- returns to caller 27
    457     rtems_message_queue_send: task readied -- preempts caller 39
    458     rtems_message_queue_urgent: no waiting tasks 26
    459     rtems_message_queue_urgent: task readied -- returns to caller 28
    460     rtems_message_queue_urgent: task readied -- preempts caller 39
    461     rtems_message_queue_broadcast: no waiting tasks 13
    462     rtems_message_queue_broadcast: task readied -- returns to caller 37
    463     rtems_message_queue_broadcast: task readied -- preempts caller 45
    464     rtems_message_queue_receive: available 21
    465     rtems_message_queue_receive: not available -- NO_WAIT 11
    466     rtems_message_queue_receive: not available -- caller blocks 37
    467     rtems_message_queue_flush: no messages flushed 7
    468     rtems_message_queue_flush: messages flushed 10
    469 
    470 
    471         Event Manager
    472 
    473     rtems_event_send: no task readied 7
    474     rtems_event_send: task readied -- returns to caller 18
    475     rtems_event_send: task readied -- preempts caller 29
    476     rtems_event_receive: obtain current events <1
    477     rtems_event_receive: available 10
    478     rtems_event_receive: not available -- NO_WAIT 5
    479     rtems_event_receive: not available -- caller blocks 28
    480 
    481 
    482         Signal Manager
    483 
    484     rtems_signal_catch 5
    485     rtems_signal_send: returns to caller 15
    486     rtems_signal_send: signal to self 24
    487     exit ASR overhead: returns to calling task 20
    488     exit ASR overhead: returns to preempting task 21
    489 
    490 
    491         Partition Manager
    492 
    493     rtems_partition_create 30
    494     rtems_partition_ident 103
    495     rtems_partition_delete 14
    496     rtems_partition_get_buffer: available 14
    497     rtems_partition_get_buffer: not available 9
    498     rtems_partition_return_buffer 18
    499 
    500 
    501         Region Manager
    502 
    503     rtems_region_create 25
    504     rtems_region_ident 105
    505     rtems_region_delete 13
    506     rtems_region_get_segment: available 13
    507     rtems_region_get_segment: not available -- NO_WAIT 17
    508     rtems_region_get_segment: not available -- caller blocks 49
    509     rtems_region_return_segment: no waiting tasks 16
    510     rtems_region_return_segment: task readied -- returns to caller 35
    511     rtems_region_return_segment: task readied -- preempts caller 58
    512 
    513 
    514         Dual-Ported Memory Manager
    515 
    516     rtems_port_create 13
    517           rtems_port_ident 103
    518     rtems_port_delete 14
    519     rtems_port_external_to_internal 5
    520     rtems_port_internal_to_external 5
    521 
    522 
    523         IO Manager
    524 
    525     rtems_io_initialize <1
    526     rtems_io_open <1
    527     rtems_io_close <1
    528     rtems_io_read <1
    529     rtems_io_write <1
    530     rtems_io_control <1
    531 
    532 
    533         Rate Monotonic Manager
    534 
    535     rtems_rate_monotonic_create 15
    536           rtems_rate_monotonic_ident 103
    537     rtems_rate_monotonic_cancel 16
    538     rtems_rate_monotonic_delete: active 18
    539     rtems_rate_monotonic_delete: inactive 20
    540     rtems_rate_monotonic_period: initiate period -- returns to caller 23
    541     rtems_rate_monotonic_period: conclude periods -- caller blocks 25
    542     rtems_rate_monotonic_period: obtain status 13
    543 
  • c/src/lib/libbsp/m68k/mvme167/console/console.c

    rb96ca51 red09fd77  
    134134#include <rtems/libio.h>
    135135
     136/* Utility functions */
     137void cd2401_udelay( unsigned long delay );
     138void cd2401_chan_cmd( rtems_unsigned8 channel, rtems_unsigned8 cmd, rtems_unsigned8 wait );
     139rtems_unsigned16 cd2401_bitrate_divisor( rtems_unsigned32 clkrate, rtems_unsigned32* bitrate );
     140void cd2401_initialize( void );
     141void cd2401_interrupts_initialize( rtems_boolean enable );
     142
     143/* ISRs */
     144rtems_isr cd2401_modem_isr( rtems_vector_number vector );
     145rtems_isr cd2401_re_isr( rtems_vector_number vector );
     146rtems_isr cd2401_rx_isr( rtems_vector_number vector );
     147rtems_isr cd2401_tx_isr( rtems_vector_number vector );
     148
     149/* Termios callbacks */
     150int cd2401_firstOpen( int major, int minor, void *arg );
     151int cd2401_lastClose( int major, int minor, void *arg );
     152int cd2401_setAttributes( int minor, const struct termios *t );
     153int cd2401_startRemoteTx( int minor );
     154int cd2401_stopRemoteTx( int minor );
     155int cd2401_write( int minor, const char *buf, int len );
     156int cd2401_drainOutput( int minor );
     157int _167Bug_pollRead( int minor );
     158int _167Bug_pollWrite( int minor, const char *buf, int len );
     159
     160
     161/* Printk function */
     162static void _BSP_output_char( char c );
     163BSP_output_char_function_type BSP_output_char = _BSP_output_char;
     164
    136165
    137166/* Channel info */
     
    146175  rtems_unsigned8  own_buf_A;   /* If true, buffer A belongs to the driver */
    147176  rtems_unsigned8  own_buf_B;   /* If true, buffer B belongs to the driver */
    148   rtems_unsigned8  txEmpty;     /* If true, the output FIFO is supposed to be empty */
     177  rtems_unsigned8  txEmpty;     /* If true, the output FIFO should be empty */
    149178} CD2401_Channel_Info[4];
    150179
     
    171200/* #define CD2401_RECORD_DEBUG_INFO */
    172201#include "console-recording.c"
    173 
    174 
    175 /* Utility functions */
    176 void cd2401_udelay( unsigned long delay );
    177 void cd2401_chan_cmd( rtems_unsigned8 channel, rtems_unsigned8 cmd, rtems_unsigned8 wait );
    178 rtems_unsigned16 cd2401_bitrate_divisor( rtems_unsigned32 clkrate, rtems_unsigned32* bitrate );
    179 void cd2401_initialize( void );
    180 void cd2401_interrupts_initialize( rtems_boolean enable );
    181 
    182 /* ISRs */
    183 rtems_isr cd2401_modem_isr( rtems_vector_number vector );
    184 rtems_isr cd2401_re_isr( rtems_vector_number vector );
    185 rtems_isr cd2401_rx_isr( rtems_vector_number vector );
    186 rtems_isr cd2401_tx_isr( rtems_vector_number vector );
    187 
    188 /* Termios callbacks */
    189 int cd2401_firstOpen( int major, int minor, void *arg );
    190 int cd2401_lastClose( int major, int minor, void *arg );
    191 int cd2401_setAttributes( int minor, const struct termios *t );
    192 int cd2401_startRemoteTx( int minor );
    193 int cd2401_stopRemoteTx( int minor );
    194 int cd2401_write( int minor, const char *buf, int len );
    195 int cd2401_drainOutput( int minor );
    196 int _167Bug_pollRead( int minor );
    197 int _167Bug_pollWrite( int minor, const char *buf, int len );
    198202
    199203
     
    260264    cd2401->car = channel;      /* Select channel */
    261265
    262     while ( cd2401->ccr != 0 ); /* Wait for completion of any previous command */
     266    while ( cd2401->ccr != 0 ); /* Wait for completion of previous command */
    263267    cd2401->ccr = cmd;          /* Send command */
    264268    if ( wait )
     
    299303  divisor = (clkrate + (divisor>>1)) / divisor; /* divisor for clk0 (CLK/8) */
    300304
    301   /*  Use highest speed clock source for best precision - try from clk0 to clk4: */
     305  /* Use highest speed clock source for best precision - try clk0 to clk4 */
    302306  for( clksource = 0; clksource < 0x0400 && divisor > 0x100; clksource += 0x0100 )
    303307      divisor >>= 2;
     
    359363   *  by the hardware, as suggested by the manual.
    360364   *
    361    *  The updated manual (part no 542400-007) has the story strait. The CD2401
    362    *  automatically initializes the LICR to contain the channel number in bits
    363    *  2 and 3. However, these bits are not preserved when the user defined bits
    364    *  are written.
     365   *  The updated manual (part no 542400-007) has the story straight. The
     366   *  CD2401 automatically initializes the LICR to contain the channel number
     367   *  in bits 2 and 3. However, these bits are not preserved when the user
     368   *  defined bits are written.
    365369   *
    366370   *  The same vector number is used for all four channels. Different vector
     
    604608    /*
    605609     *  Bus error occurred during DMA transfer. For now, just record.
    606      *  Get reason for DMA bus error and clear the report for the next occurrence
     610     *  Get reason for DMA bus error and clear the report for the next
     611     *  occurrence
    607612     */
    608613    buserr = pccchip2->SCC_error;
     
    10181023    cd2401_chan_cmd (minor, 0x40, 1);
    10191024
    1020     cd2401->car = minor;        /* Select channel */
    1021     cd2401->cmr = 0x42;         /* Interrupt Rx, DMA Tx, async mode */
     1025    cd2401->car = minor;    /* Select channel */
     1026    cd2401->cmr = 0x42;     /* Interrupt Rx, DMA Tx, async mode */
    10221027    cd2401->cor1 = parodd | parenb | ignpar | csize;
    10231028    cd2401->cor2 = sw_flow_ctl | hw_flow_ctl;
    10241029    cd2401->cor3 = extra_flow_ctl | cstopb;
    1025     cd2401->cor4 = 0x0A;        /* No DSR/DCD/CTS detect; FIFO threshold of 10 */
    1026     cd2401->cor5 = 0x0A;        /* No DSR/DCD/CTS detect; DTR threshold of 10 */
     1030    cd2401->cor4 = 0x0A;    /* No DSR/DCD/CTS detect; FIFO threshold of 10 */
     1031    cd2401->cor5 = 0x0A;    /* No DSR/DCD/CTS detect; DTR threshold of 10 */
    10271032    cd2401->cor6 = igncr | icrnl | inlcr | ignbrk | brkint | parmrk | inpck;
    1028     cd2401->cor7 = istrip;      /* No LNext; ignore XON/XOFF if frame error; no tx translations */
     1033    cd2401->cor7 = istrip;  /* No LNext; ignore XON/XOFF if frame error; no tx translations */
    10291034    /* Special char 1: XON character */
    10301035    cd2401->u1.async.schr1 = t->c_cc[VSTART];
     
    10411046    cd2401->rcor = (unsigned char)(rx_period >> 8); /* no DPLL */
    10421047    cd2401->tbpr = (unsigned char)tx_period;
    1043     cd2401->tcor = (tx_period >> 3) & 0xE0;         /* no x1 ext clk, no loopback */
     1048    cd2401->tcor = (tx_period >> 3) & 0xE0; /* no x1 ext clk, no loopback */
    10441049 
    10451050    /* Timeout for 4 chars at 9600, 8 bits per char, 1 stop bit */
     
    12391244 *  MUST NOT BE EXECUTED WITH THE CD2401 INTERRUPTS DISABLED!
    12401245 *  The txEmpty flag is set by the tx ISR.
     1246 *
     1247 *  DOES NOT WORK! DO NOT ENABLE THIS CODE. THE CD2401 DOES NOT COOPERATE!
     1248 *  The code is here to document that the output FIFO is NOT empty when
     1249 *  the CD2401 reports that the Tx buffer is empty.
    12411250 */
    12421251int cd2401_drainOutput(
     
    12731282 *
    12741283 *  CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
    1275  *  This function is invoked when the device driver is compiled with
    1276  *  CD2401_POLLED_IO set to 1 above. All I/O is then done through 167Bug.
    12771284 */
    12781285int _167Bug_pollRead(
     
    12821289  int char_not_available;
    12831290  unsigned char c;
    1284 
    1285   /* Check for a char in the input FIFO */
    1286   asm volatile( "movew  #0x1, -(%%sp)   /* Code for .INSTAT */
    1287                  movew  %1, -(%%sp)     /* Channel */
     1291  rtems_interrupt_level previous_level;
     1292
     1293  /*
     1294   *  Redirection of .INSTAT does not work: 167-Bug crashes.
     1295   *  Switch the input stream to the specified port.
     1296   *  Make sure this is atomic code.
     1297   */
     1298  rtems_interrupt_disable( previous_level );
     1299 
     1300  asm volatile( "movew  %1, -(%%sp)     /* Channel */
    12881301                 trap   #15             /* Trap to 167Bug */
    1289                  .short 0x60            /* Code for .REDIR */
     1302                 .short 0x61            /* Code for .REDIR_I */
     1303                 trap   #15             /* Trap to 167Bug */
     1304                                   .short 0x01            /* Code for .INSTAT */
    12901305                 move   %%cc, %0        /* Get condition codes */
    12911306                 andil  #4, %0"         /* Keep the Zero bit */
    12921307    : "=d" (char_not_available) : "d" (minor): "%%cc" );
    12931308
    1294   if (char_not_available)
     1309  if (char_not_available) {
     1310    rtems_interrupt_enable( previous_level );
    12951311    return -1;
     1312  }
    12961313
    12971314  /* Read the char and return it */
    12981315  asm volatile( "subq.l #2,%%a7         /* Space for result */
    1299                  movew  #0x0, -(%%sp)   /* Code for .INCHR */
    1300                  movew  %1, -(%%sp)     /* Channel */
    13011316                 trap   #15             /* Trap to 167 Bug */
    1302                  .short 0x60            /* Code for .REDIR */
     1317                 .short 0x00            /* Code for .INCHR */
    13031318                 moveb  (%%a7)+, %0"    /* Pop char into c */
    1304     : "=d" (c) : "d" (minor) );
    1305 
     1319    : "=d" (c) : );
     1320
     1321  rtems_interrupt_enable( previous_level );
     1322 
    13061323  return (int)c;
    13071324}
     
    13241341 *
    13251342 *  CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
    1326  *  This function is invoked when the device driver is compiled with
    1327  *  CD2401_POLLED_IO set to 1 above. All I/O is then done through 167Bug.
    13281343 */
    13291344int _167Bug_pollWrite(
     
    13491364
    13501365/*
    1351  *  Print functions: prototyped in bsp.h
    1352  *  Debug printing on Channel 1
    1353  */
    1354  
    1355 void printk( char *fmt, ... )
    1356 {
    1357   va_list  ap;                  /* points to each unnamed argument in turn */
    1358   static char buf[256];
    1359   unsigned int level;
     1366 *  do_poll_read
     1367 *
     1368 *  Input characters through 167Bug. Returns has soon as a character has been
     1369 *  received. Otherwise, if we wait for the number of requested characters, we
     1370 *  could be here forever!
     1371 *
     1372 *  CR is converted to LF on input. The terminal should not send a CR/LF pair
     1373 *  when the return or enter key is pressed.
     1374 *
     1375 *  Input parameters:
     1376 *    major - ignored. Should be the major number for this driver.
     1377 *    minor - selected channel.
     1378 *    arg->buffer - where to put the received characters.
     1379 *    arg->count  - number of characters to receive before returning--Ignored.
     1380 *
     1381 *  Output parameters:
     1382 *    arg->bytes_moved - the number of characters read. Always 1.
     1383 *
     1384 *  Return value: RTEMS_SUCCESSFUL
     1385 *
     1386 *  CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
     1387 */
     1388rtems_status_code do_poll_read(
     1389  rtems_device_major_number major,
     1390  rtems_device_minor_number minor,
     1391  void                    * arg
     1392)
     1393{
     1394  rtems_libio_rw_args_t *rw_args = arg;
     1395  int c;
     1396
     1397  while( (c = _167Bug_pollRead (minor)) == -1 );
     1398  rw_args->buffer[0] = (unsigned8)c;
     1399  if( rw_args->buffer[0] == '\r' )
     1400      rw_args->buffer[0] = '\n';
     1401  rw_args->bytes_moved = 1;
     1402  return RTEMS_SUCCESSFUL;
     1403}
     1404
     1405/*
     1406 *  do_poll_write
     1407 *
     1408 *  Output characters through 167Bug. Returns only once every character has
     1409 *  been sent.
     1410 *
     1411 *  CR is transmitted AFTER a LF on output.
     1412 *
     1413 *  Input parameters:
     1414 *    major - ignored. Should be the major number for this driver.
     1415 *    minor - selected channel
     1416 *    arg->buffer - where to get the characters to transmit.
     1417 *    arg->count  - the number of characters to transmit before returning.
     1418 *
     1419 *  Output parameters:
     1420 *    arg->bytes_moved - the number of characters read
     1421 *
     1422 *  Return value: RTEMS_SUCCESSFUL
     1423 *
     1424 *  CANNOT BE COMBINED WITH INTERRUPT DRIVEN I/O!
     1425 */
     1426rtems_status_code do_poll_write(
     1427  rtems_device_major_number major,
     1428  rtems_device_minor_number minor,
     1429  void                    * arg
     1430)
     1431{
     1432  rtems_libio_rw_args_t *rw_args = arg;
     1433  unsigned32 i;
     1434  char cr ='\r';
     1435
     1436  for( i = 0; i < rw_args->count; i++ ) {
     1437    _167Bug_pollWrite(minor, &(rw_args->buffer[i]), 1);
     1438    if ( rw_args->buffer[i] == '\n' )
     1439      _167Bug_pollWrite(minor, &cr, 1);
     1440  }
     1441  rw_args->bytes_moved = i;
     1442  return RTEMS_SUCCESSFUL;
     1443}
     1444
     1445
     1446/*
     1447 *  _BSP_output_char
     1448 *
     1449 *  printk() function prototyped in bspIo.h. Does not use termios.
     1450 */
     1451void _BSP_output_char(char c)
     1452{
     1453  rtems_device_minor_number printk_minor;
    13601454 
    1361   _CPU_ISR_Disable(level);
     1455  /*
     1456   *  Can't rely on console_initialize having been called before this function
     1457   *  is used.
     1458   */
     1459  if ( NVRAM_CONFIGURE )
     1460    /* J1-4 is on, use NVRAM info for configuration */
     1461    printk_minor = nvram->console_printk_port & 0x30;
     1462  else
     1463    printk_minor = PRINTK_MINOR;
     1464   
     1465  _167Bug_pollWrite(printk_minor, &c, 1);
     1466}
     1467
    13621468 
    1363   va_start(ap, fmt);            /* make ap point to 1st unnamed arg */
    1364   vsprintf(buf, fmt, ap);       /* send output to buffer */
    1365  
    1366   BSP_output_string(buf);       /* print buffer -- Channel 1 */
    1367  
    1368   va_end(ap);                           /* clean up and re-enable interrupts */
    1369   _CPU_ISR_Enable(level);
    1370 }
    1371 
    1372 
    1373 void BSP_output_string( char * buf )
    1374 {
    1375   int len = strlen(buf);                       
    1376   rtems_status_code sc;
    1377  
    1378   /* The first argument forces a print to Port2 (ttyS1) */
    1379   sc = _167Bug_pollWrite(1, buf, len);
    1380   if (sc != RTEMS_SUCCESSFUL)
    1381     rtems_fatal_error_occurred (sc);
    1382 }
    1383 
    1384 
    13851469/*
    13861470 ***************
     
    14011485{
    14021486  rtems_status_code status;
     1487  rtems_device_minor_number console_minor;
    14031488
    14041489  /*
    1405    * Set up TERMIOS
     1490   * Set up TERMIOS if needed
    14061491   */
    1407   rtems_termios_initialize ();
     1492  if ( NVRAM_CONFIGURE ) {
     1493    /* J1-4 is on, use NVRAM info for configuration */
     1494    console_minor = nvram->console_printk_port & 0x03;
     1495         
     1496    if ( nvram->console_mode & 0x01 )
     1497      /* termios */
     1498      rtems_termios_initialize ();
     1499  }
     1500  else {
     1501    console_minor = CONSOLE_MINOR;
     1502#if CD2401_USE_TERMIOS == 1
     1503    rtems_termios_initialize ();
     1504#endif
     1505  }
    14081506
    14091507  /*
    14101508   * Do device-specific initialization
     1509   * Does not affect 167-Bug.
    14111510   */
    14121511  cd2401_initialize ();
     
    14231522    rtems_fatal_error_occurred (status);
    14241523
    1425   status = rtems_io_register_name ("/dev/console", major, 1);
     1524  status = rtems_io_register_name ("/dev/console", major, console_minor);
    14261525  if (status != RTEMS_SUCCESSFUL)
    14271526    rtems_fatal_error_occurred (status);
     
    14471546)
    14481547{
    1449 #if CD2401_POLLED_IO
    1450 
    1451   /* I/O is limited to 167Bug console. minor is ignored! */
    1452   static const rtems_termios_callbacks callbacks = {
     1548  static const rtems_termios_callbacks pollCallbacks = {
    14531549    NULL,                       /* firstOpen */
    14541550    NULL,                       /* lastClose */
     
    14601556    0                           /* outputUsesInterrupts */
    14611557  };
    1462 
    1463 #else
    1464 
    1465   static const rtems_termios_callbacks callbacks = {
     1558 
     1559  static const rtems_termios_callbacks intrCallbacks = {
    14661560    cd2401_firstOpen,           /* firstOpen */
    14671561    cd2401_lastClose,           /* lastClose */
     
    14741568  };
    14751569
     1570  if ( NVRAM_CONFIGURE )
     1571    /* J1-4 is on, use NVRAM info for configuration */
     1572    if ( nvram->console_mode & 0x01 )
     1573      /* termios */
     1574      if ( nvram->console_mode & 0x02 )
     1575        /* interrupt-driven I/O */
     1576        return rtems_termios_open (major, minor, arg, &intrCallbacks);
     1577            else
     1578        /* polled I/O */
     1579        return rtems_termios_open (major, minor, arg, &pollCallbacks);
     1580          else
     1581            /* no termios -- default to polled I/O */
     1582            return RTEMS_SUCCESSFUL;
     1583#if CD2401_USE_TERMIOS == 1
     1584#if CD2401_IO_MODE != 1
     1585  else
     1586    /* termios & polled I/O*/
     1587    return rtems_termios_open (major, minor, arg, &pollCallbacks);
     1588#else
     1589  else
     1590    /* termios & interrupt-driven I/O*/
     1591    return rtems_termios_open (major, minor, arg, &intrCallbacks);
    14761592#endif
    1477 
    1478   return rtems_termios_open (major, minor, arg, &callbacks);
    1479 }
     1593#else
     1594  else
     1595    /* no termios -- default to polled I/O */
     1596    return RTEMS_SUCCESSFUL;
     1597#endif
     1598}
     1599
    14801600
    14811601/*
     
    14881608)
    14891609{
    1490   return rtems_termios_close (arg);
    1491 }
     1610  if ( NVRAM_CONFIGURE ) {
     1611    /* J1-4 is on, use NVRAM info for configuration */
     1612    if ( nvram->console_mode & 0x01 )
     1613      /* termios */
     1614      return rtems_termios_close (arg);
     1615    else
     1616      /* no termios */
     1617      return RTEMS_SUCCESSFUL;
     1618  }
     1619#if CD2401_USE_TERMIOS == 1
     1620  else
     1621    /* termios */
     1622    return rtems_termios_close (arg);
     1623#else
     1624  else
     1625    /* no termios */
     1626    return RTEMS_SUCCESSFUL;
     1627#endif
     1628}
     1629
    14921630
    14931631/*
     
    15001638)
    15011639{
    1502   return rtems_termios_read (arg);
    1503 }
     1640  if ( NVRAM_CONFIGURE ) {
     1641    /* J1-4 is on, use NVRAM info for configuration */
     1642    if ( nvram->console_mode & 0x01 )
     1643      /* termios */
     1644      return rtems_termios_read (arg);
     1645    else
     1646      /* no termios -- default to polled */
     1647      return do_poll_read (major, minor, arg);
     1648  }
     1649#if CD2401_USE_TERMIOS == 1
     1650  else
     1651    /* termios */
     1652    return rtems_termios_read (arg);
     1653#else
     1654  else
     1655    /* no termios -- default to polled */
     1656    return do_poll_read (major, minor, arg);
     1657#endif
     1658}
     1659
    15041660
    15051661/*
     
    15121668)
    15131669{
    1514   return rtems_termios_write (arg);
    1515 }
     1670  if ( NVRAM_CONFIGURE ) {
     1671    /* J1-4 is on, use NVRAM info for configuration */
     1672    if ( nvram->console_mode & 0x01 )
     1673      /* termios */
     1674      return rtems_termios_write (arg);
     1675    else
     1676      /* no termios -- default to polled */
     1677      return do_poll_write (major, minor, arg);
     1678  }
     1679#if CD2401_USE_TERMIOS == 1
     1680  else
     1681    /* termios */
     1682    return rtems_termios_write (arg);
     1683#else
     1684  else
     1685    /* no termios -- default to polled */
     1686    return do_poll_write (major, minor, arg);
     1687#endif
     1688}
     1689
    15161690
    15171691/*
     
    15241698)
    15251699{
    1526   return rtems_termios_ioctl (arg);
    1527 }
     1700  if ( NVRAM_CONFIGURE ) {
     1701    /* J1-4 is on, use NVRAM info for configuration */
     1702    if ( nvram->console_mode & 0x01 )
     1703      /* termios */
     1704      return rtems_termios_ioctl (arg);
     1705    else
     1706      /* no termios -- default to polled */
     1707      return RTEMS_SUCCESSFUL;
     1708  }
     1709#if CD2401_USE_TERMIOS == 1
     1710  else
     1711    /* termios */
     1712    return rtems_termios_ioctl (arg);
     1713#else
     1714  else
     1715    /* no termios -- default to polled */
     1716    return RTEMS_SUCCESSFUL;
     1717#endif
     1718}
  • c/src/lib/libbsp/m68k/mvme167/network/network.c

    rb96ca51 red09fd77  
    16581658  uti596_softc_ *sc = &uti596_softc;                            /* device dependent data structure */
    16591659  struct ifnet * ifp = (struct ifnet *)&sc->arpcom.ac_if;       /* ifnet structure */
     1660  unsigned char j1;    /* State of J1 jumpers */
    16601661  int unitNumber;
    16611662  char *unitName;
     
    16881689
    16891690  /*
    1690    * If an IP address and netmask are provided in NVRAM, cheat,
    1691    * and stuff them into the ifconfig structure, overriding any
    1692    * existing or NULL values.
     1691   * Check whether parameters should be obtained from NVRAM. If
     1692   * yes, and if an IP address, netmask, or ethernet address are
     1693   * provided in NVRAM, cheat, and stuff them into the ifconfig
     1694   * structure, OVERRIDING and existing or NULL values.
    16931695   *
    16941696   * Warning: If values are provided in NVRAM, the ifconfig entries
    1695    * should be NULL because buffer memory allocated to hold the
     1697   * must be NULL because buffer memory allocated to hold the
    16961698   * structure values is unrecoverable and would be lost here.
    16971699   */
    1698   if ( (addr = nvram->ipaddr) ) {
    1699     if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) )
    1700       pConfig->ip_address = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
    1701     else
    1702       rtems_panic("Can't allocate ip_address buffer!\n");
    1703   }
    1704   if ( (addr = nvram->netmask) ) {
    1705     if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) )
    1706       pConfig->ip_netmask = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
    1707     else
    1708       rtems_panic("Can't allocate ip_netmask buffer!\n");
    1709   }
    1710 
    1711   /* Ethernet address can be specified in NVRAM, or in the ifconfig
    1712    * structure. It will be read by default from BBRAM at $FFFC1F2C
    1713    * (6 bytes) mvme167 manual p. 1-47
    1714    */
    1715   if ( nvram->enaddr ) {
    1716         memcpy ((void *)sc->arpcom.ac_enaddr, &nvram->enaddr, ETHER_ADDR_LEN);
     1700
     1701  /* Read the J1 header */
     1702  j1 = (unsigned char)(lcsr->vector_base & 0xFF);
     1703
     1704  if ( !(j1 & 0x10) ) {
     1705        /* Jumper J1-4 is on, configure from NVRAM */
     1706 
     1707    if ( (addr = nvram->ipaddr) ) {
     1708      /* We have a non-zero entry, copy the value */
     1709      if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) )
     1710        pConfig->ip_address = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
     1711      else
     1712        rtems_panic("Can't allocate ip_address buffer!\n");
     1713    }
     1714   
     1715    if ( (addr = nvram->netmask) ) {
     1716      /* We have a non-zero entry, copy the value */
     1717      if ( (pAddr = malloc ( INET_ADDR_MAX_BUF_SIZE, 0, M_NOWAIT )) )
     1718        pConfig->ip_netmask = (char *)inet_ntop(AF_INET, &addr, pAddr, INET_ADDR_MAX_BUF_SIZE -1 );
     1719      else
     1720        rtems_panic("Can't allocate ip_netmask buffer!\n");
     1721    }
     1722
     1723    /* Ethernet address requires special handling -- it must be copied into
     1724     * the arpcom struct. The following if construct serves only to give the
     1725     * NVRAM parameter the highest priority if J1-4 indicates we are configuring
     1726     * from NVRAM.
     1727     *
     1728     * If the ethernet address is specified in NVRAM, go ahead and copy it.
     1729     * (ETHER_ADDR_LEN = 6 bytes).
     1730     */
     1731    if ( nvram->enaddr[0] || nvram->enaddr[1] || nvram->enaddr[2] ) {
     1732      /* Anything in the first three bytes indicates a non-zero entry, copy value */
     1733          memcpy ((void *)sc->arpcom.ac_enaddr, &nvram->enaddr, ETHER_ADDR_LEN);
     1734    }
     1735    else if ( pConfig->hardware_address) {
     1736      /* There is no entry in NVRAM, but there is in the ifconfig struct, so use it. */
     1737      memcpy ((void *)sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);
     1738    }
     1739    else {
     1740      /* There is no ethernet address provided, so it will be read
     1741       * from BBRAM at $FFFC1F2C by default. [mvme167 manual p. 1-47]
     1742       */
     1743      memcpy ((void *)sc->arpcom.ac_enaddr, (char *)0xFFFC1F2C, ETHER_ADDR_LEN);
     1744    }
    17171745  }
    17181746  else if ( pConfig->hardware_address) {
     1747    /* We are not configuring from NVRAM (J1-4 is off), and the ethernet address
     1748     * is given in the ifconfig structure. Copy it.
     1749     */
    17191750    memcpy ((void *)sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);
    17201751  }
    17211752  else {
     1753    /* We are not configuring from NVRAM (J1-4 is off), and there is no ethernet
     1754     * address provided in the ifconfig struct, so it will be read from BBRAM at
     1755     * $FFFC1F2C by default. [mvme167 manual p. 1-47]
     1756     */
    17221757    memcpy ((void *)sc->arpcom.ac_enaddr, (char *)0xFFFC1F2C, ETHER_ADDR_LEN);
    17231758  }
  • c/src/lib/libbsp/m68k/mvme167/startup/page_table.c

    rb96ca51 red09fd77  
    3434 *  MVME167s are configured to exist at physical addresses 0x00800000 to
    3535 *  0x00BFFFFF and 0x00C00000 to 0x00FFFFFF respectively. If jumper J1-4 is
    36  *  installed, memeory and cache control can be done by providing parameters
    37  *  in NVRAM. See the README for details. If J1-4 is removed, behaviour
    38  *  defaults to the following. We map the space from 0x0 to 0x7FFFFFFF as
    39  *  copyback, unless jumper J1-5 is removed, in which case we map as writethrough.
    40  *  If jumper J1-7 is removed, the data cache is NOT enabled. If jumper J1-6
    41  *  is removed, the instruction cache is not enabled.
     36 *  installed, memory and cache control can be done by providing parameters
     37 *  in NVRAM and jumpers J1-[5-7] are ignored. See the README for details.
     38 *  If J1-4 is removed, behaviour defaults to the following. We map the space
     39 *  from 0x0 to 0x7FFFFFFF as copyback, unless jumper J1-5 is removed, in which
     40 *  case we map as writethrough. If jumper J1-7 is removed, the data cache is
     41 *  NOT enabled. If jumper J1-6 is removed, the instruction cache is not enabled.
    4242 *
    4343 *  Copyright (c) 1998, National Research Council of Canada
     
    9595        /* Jumper J1-4 is on, configure from NVRAM */
    9696
    97         if ( nvram->dcache_enable )
     97        if ( nvram->cache_mode & 0x01 )
    9898                cacr |= 0x80000000;
    9999
    100         if ( nvram->icache_enable )
     100        if ( nvram->cache_mode & 0x02 )
    101101                cacr |= 0x00008000;
    102102
    103103        if ( nvram->cache_mode )
    104                 dtt0 = ((nvram->cache_mode & 0x0003) << 5) | (dtt0 & 0xFFFFFF9F);
     104                dtt0 = ((nvram->cache_mode & 0x0C) << 3) | (dtt0 & 0xFFFFFF9F);
    105105  }
    106106        else {
    107107                /* Configure according to other jumper settings */
    108108 
    109           if ( j1 & 0x80 )
    110           /* Jumper J1-7 if off, disable data caching */
    111                 cacr &= 0x7FFFFFFF;
     109          if ( !(j1 & 0x80) )
     110          /* Jumper J1-7 if on, enable data caching */
     111                cacr |= 0x80000000;
    112112     
    113           if ( j1 & 0x40 )
    114             /* Jumper J1-6 if off, disable instruction caching */
    115             cacr &= 0xFFFF7FFF;
     113          if ( !(j1 & 0x40) )
     114            /* Jumper J1-6 if on, enable instruction caching */
     115            cacr |= 0x00008000;
    116116     
    117117          if ( j1 & 0x20 )
  • c/src/lib/libbsp/m68k/mvme167/times

    rb96ca51 red09fd77  
    11#
    2 #  Timing Test Suite Results for the MBX860-002
     2#  Timing Test Suite Results for the MVME167
    33#
    44#  $Id$
Note: See TracChangeset for help on using the changeset viewer.