summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-01-20 20:33:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-01-20 20:33:17 +0000
commitc0c6168feaea81fceceba3933c9ca90696b0620c (patch)
tree7e29853dc225d01a2e431dc7f82a84e261100c65 /c
parent2003-01-20 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-c0c6168feaea81fceceba3933c9ca90696b0620c.tar.bz2
2003-01-20 Duane Gustavus <duane@unt.edu>
* console/sci.c, include/mrm332.h, startup/linkcmds, startup/linkcmds_ROM: Various updates to make this run properly from ROM.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/m68k/mrm332/ChangeLog6
-rw-r--r--c/src/lib/libbsp/m68k/mrm332/console/sci.c23
-rw-r--r--c/src/lib/libbsp/m68k/mrm332/include/mrm332.h6
-rw-r--r--c/src/lib/libbsp/m68k/mrm332/startup/linkcmds17
-rw-r--r--c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM41
5 files changed, 77 insertions, 16 deletions
diff --git a/c/src/lib/libbsp/m68k/mrm332/ChangeLog b/c/src/lib/libbsp/m68k/mrm332/ChangeLog
index 1ac5b8b907..aed54e747e 100644
--- a/c/src/lib/libbsp/m68k/mrm332/ChangeLog
+++ b/c/src/lib/libbsp/m68k/mrm332/ChangeLog
@@ -1,3 +1,9 @@
+2003-01-20 Duane Gustavus <duane@unt.edu>
+
+ * console/sci.c, include/mrm332.h, startup/linkcmds,
+ startup/linkcmds_ROM: Various updates to make this run properly
+ from ROM.
+
2002-12-20 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* clock/Makefile.am: Don't include @RTEMS_BSP@.cfg.
diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.c b/c/src/lib/libbsp/m68k/mrm332/console/sci.c
index 7ea88de901..3d370190e8 100644
--- a/c/src/lib/libbsp/m68k/mrm332/console/sci.c
+++ b/c/src/lib/libbsp/m68k/mrm332/console/sci.c
@@ -36,6 +36,11 @@
* $Id$
*
* $Log$
+* Revision 1.2 2002/11/04 14:26:47 joel
+* 2002-11-04 Joel Sherrill <joel@OARcorp.com>
+*
+* * console/sci.c, spurious/spinit.c: Removed warnings.
+*
* Revision 1.1 2002/02/28 23:10:39 joel
* 2002-02-28 Mike Panetta <ahuitzot@mindspring.com>
*
@@ -117,6 +122,7 @@
Section A - Include Files
*****************************************************************************/
+#include <rtems.h>
#include <bsp.h>
#include <rtems/bspIo.h>
#include <stdio.h>
@@ -560,6 +566,7 @@ static void SciRcvBufFlush( void )
* Func: SciInterruptOpen
* Desc: open routine for the interrupt based device driver
* Default state is 9600 baud, 8 bits, No parity, and 1 stop bit. ??
+**CHANGED** Default baud rate is now 19200, 8N1
* called from rtems_termios_open which is called from console_open
* Inputs: major - device number
* minor - device number
@@ -598,8 +605,8 @@ signed32 SciInterruptOpen(
// SciSetBaud(115200); // set the baud rate
// SciSetBaud( 57600); // set the baud rate
// SciSetBaud( 38400); // set the baud rate
-// SciSetBaud( 19200); // set the baud rate
- SciSetBaud( 9600); // set the baud rate
+SciSetBaud( 19200); // set the baud rate
+// SciSetBaud( 9600); // set the baud rate
SciSetParity(SCI_PARITY_NONE); // set parity to none
@@ -724,7 +731,8 @@ signed32 SciSetAttributes(
if (!baud_requested)
{
- baud_requested = B9600; // default to 9600 baud
+// baud_requested = B9600; // default to 9600 baud
+ baud_requested = B19200; // default to 19200 baud
}
sci_rate = termios_baud_to_number( baud_requested );
@@ -832,8 +840,8 @@ signed32 SciPolledOpen(
// SciSetBaud(115200); // set the baud rate
// SciSetBaud( 57600); // set the baud rate
// SciSetBaud( 38400); // set the baud rate
-// SciSetBaud( 19200); // set the baud rate
- SciSetBaud( 9600); // set the baud rate
+ SciSetBaud( 19200); // set the baud rate
+// SciSetBaud( 9600); // set the baud rate
SciSetParity(SCI_PARITY_NONE); // set no parity
@@ -1457,6 +1465,8 @@ void SciWriteCharWait(unsigned8 c)
* are ignoring flow control from the other end).
* In the first case, higher baud rates will help.
*/
+ /* relinquish processor while waiting */
+ rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
}
*SCDR = c; // send the charcter
@@ -1506,7 +1516,8 @@ unsigned8 inline SciReadCharWait( void )
while ( SciCharAvailable() == 0 ) // anything there?
{
- // do nothing
+ /* relinquish processor while waiting */
+ rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
}
// if you have rcv ints enabled, then the isr will probably
diff --git a/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h b/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h
index c7cbbfa797..d6e97f1cec 100644
--- a/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h
+++ b/c/src/lib/libbsp/m68k/mrm332/include/mrm332.h
@@ -33,14 +33,14 @@
/* System Clock definitions */
#define XTAL 32768.0 /* crystal frequency in Hz */
-#if 1
+#if 0
/* Default MRM clock rate (8.388688 MHz) set by CPU32: */
#define MRM_W 0 /* system clock parameters */
#define MRM_X 0
#define MRM_Y 0x3f
#endif
-#if 0
+#if 1
/* 16.77722 MHz: */
#define MRM_W 1 /* system clock parameters */
#define MRM_X 1
@@ -55,7 +55,7 @@
#endif
#define SYS_CLOCK (XTAL*4.0*(MRM_Y+1)*(1 << (2*MRM_W+MRM_X)))
-#define SCI_BAUD 9600 /* RS232 Baud Rate */
+#define SCI_BAUD 19200 /* RS232 Baud Rate */
/* macros/functions */
diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
index 63e8266339..b36cb2cf95 100644
--- a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
@@ -33,15 +33,15 @@ __DYNAMIC = 0;
/*
* Declare some sizes.
*/
-_RamBase = DEFINED(_RamBase) ? _RamBase : 0x03000;
-_RamSize = DEFINED(_RamSize) ? _RamSize : 0x7d000;
+_RamBase = DEFINED(_RamBase) ? _RamBase : 0x10000;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 0x70000;
_RamEnd = _RamBase + _RamSize;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
MEMORY
{
- ram : ORIGIN = 0x03000, LENGTH = 0x7d000
+ ram : ORIGIN = 0x10000, LENGTH = 0x70000
}
_copy_data_from_rom = 0;
@@ -91,6 +91,16 @@ SECTIONS
*crtn.o(.fini)
/*
+ * Special FreeBSD sysctl sections.
+ */
+ . = ALIGN (16);
+ __start_set_sysctl_set = .;
+ *(set_sysctl_*);
+ __stop_set_sysctl_set = ABSOLUTE(.);
+ *(set_domain_*);
+ *(set_pseudo_*);
+
+ /*
* C++ constructors/destructors
*
* gcc uses crtbegin.o to find the start of the constructors
@@ -143,7 +153,6 @@ SECTIONS
*(COMMON)
. = ALIGN (16);
PROVIDE (end = .);
-
. += _StackSize;
. = ALIGN (16);
_stack_init = .;
diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM
index 7467f78a25..cf883874a4 100644
--- a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM
+++ b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds_ROM
@@ -50,7 +50,7 @@ _RamEnd = _RamBase + _RamSize;
__end_of_ram = 0x080000;
_copy_data_from_rom = 1;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
-_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
/*
*
@@ -91,7 +91,37 @@ SECTIONS
*(.fini)
*crtn.o(.fini)
- *(.eh_fram)
+ /*
+ * Special FreeBSD sysctl sections.
+ */
+ . = ALIGN (16);
+ __start_set_sysctl_set = .;
+ *(set_sysctl_*);
+ __stop_set_sysctl_set = ABSOLUTE(.);
+ *(set_domain_*);
+ *(set_pseudo_*);
+
+ /*
+ * C++ constructors/destructors
+ *
+ * gcc uses crtbegin.o to find the start of the constructors
+ * and destructors so we make sure it is first. Because this
+ * is a wildcard, it doesn't matter if the user does not
+ * actually link against crtbegin.o; the linker won't look for
+ * a file to match a wildcard. The wildcard also means that
+ * it doesn't matter which directory crtbegin.o is in. The
+ * constructor and destructor list are terminated in
+ * crtend.o. The same comments apply to it.
+ */
+ . = ALIGN (16);
+ *crtbegin.o(.ctors)
+ *(.ctors)
+ *crtend.o(.ctors)
+ *crtbegin.o(.dtors)
+ *(.dtors)
+ *crtend.o(.dtors)
+
+ *(.eh_frame)
. = ALIGN (16);
/*
@@ -99,7 +129,7 @@ SECTIONS
*/
. = ALIGN (16);
_rodata_start = . ;
- *(.rodata)
+ *(.rodata*)
*(.gnu.linkonce.r*)
etext = ALIGN(0x10);
@@ -130,6 +160,10 @@ SECTIONS
_copy_start = .;
_sdata = . ;
*(.data)
+ *(.gnu.linkonce.d*)
+ *(.gcc_except_table)
+ *(.jcr)
+
CONSTRUCTORS
edata = ALIGN(0x10);
_edata = .;
@@ -146,6 +180,7 @@ SECTIONS
_clear_start = .;
*(.bss)
*(COMMON)
+ . = ALIGN (16);
end = .;
_end = ALIGN(0x8);
__end = ALIGN(0x8);