mirror of
https://github.com/apache/nuttx.git
synced 2025-12-11 21:20:26 +08:00
Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db8aff6778 | ||
|
|
ddeb703501 | ||
|
|
44778c69bd | ||
|
|
77119d8359 | ||
|
|
c48d0935a1 | ||
|
|
5fe0d01775 | ||
|
|
643c8d6401 | ||
|
|
da7b0d1d90 | ||
|
|
03e6e759a6 | ||
|
|
f3209435ab | ||
|
|
6f8dae2964 | ||
|
|
d7d1145863 | ||
|
|
b91d6d3b2f | ||
|
|
5b9425f1b6 | ||
|
|
c869e421e9 | ||
|
|
105aa81d1f | ||
|
|
00093c0a08 | ||
|
|
f43ffa05aa | ||
|
|
69ec9510a0 | ||
|
|
b85008dc63 | ||
|
|
04eac6d18a | ||
|
|
24dc336781 | ||
|
|
7bc52e9ea1 | ||
|
|
30ad777538 | ||
|
|
b1bc346305 | ||
|
|
a0318797d7 | ||
|
|
aa8343178b | ||
|
|
d69acf31de | ||
|
|
87743cdc8e | ||
|
|
23dcda6743 | ||
|
|
d63a0352a5 | ||
|
|
ec8c6ffb23 | ||
|
|
a401a91d03 | ||
|
|
dcf7c7c365 | ||
|
|
01207cc66e | ||
|
|
4283c46855 | ||
|
|
952db3328f | ||
|
|
09d6450ab3 | ||
|
|
a3d199f7ac | ||
|
|
cdfb48dac6 | ||
|
|
535038c5cc | ||
|
|
d265632c82 | ||
|
|
8c0ce78863 | ||
|
|
4f3ecdd85a | ||
|
|
cae9bad97b | ||
|
|
f72d286d19 | ||
|
|
f47c8cb529 | ||
|
|
7015014104 | ||
|
|
d82d41387b | ||
|
|
800afcd04d | ||
|
|
287e032069 | ||
|
|
6119aa0943 | ||
|
|
29aeec7b8a | ||
|
|
c60f939f91 | ||
|
|
1344768825 | ||
|
|
f5afe99329 | ||
|
|
09e2a0cc1e | ||
|
|
f5f4000981 | ||
|
|
454fededc8 | ||
|
|
e8c4bbf98e | ||
|
|
f33928ef6a | ||
|
|
6f1e5c74ef | ||
|
|
e260ea2fa8 | ||
|
|
fff3a9d265 | ||
|
|
d8cdca20f5 | ||
|
|
4a0697786a | ||
|
|
f0c085abec | ||
|
|
7e5a954d79 | ||
|
|
fb5466800f | ||
|
|
96c7f2422e | ||
|
|
e155bf66df | ||
|
|
cdd8fe239a | ||
|
|
c418e219ac | ||
|
|
14c19aa3d1 | ||
|
|
3237757a86 | ||
|
|
475e731751 | ||
|
|
0466636a01 | ||
|
|
d4ccda1bae | ||
|
|
09a3864fd5 | ||
|
|
445da7f795 | ||
|
|
13bd9989b2 | ||
|
|
576c4f55c2 | ||
|
|
4e52b5e11c | ||
|
|
00d1800b76 | ||
|
|
eff35dc99f | ||
|
|
729fad8b7d | ||
|
|
d583be7062 | ||
|
|
9a4b84349d | ||
|
|
c013dc876f |
47
ChangeLog
47
ChangeLog
@@ -148,7 +148,7 @@
|
||||
* Fixed ARM compilation errors introduced in 0.2.5 (that is what I get
|
||||
for only testing on the simulation).
|
||||
|
||||
0.2.7 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
0.2.7 2007-06-09 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added stat() to fs layer and to FAT
|
||||
* Fixed reference counting errors associated with mounted filesystems
|
||||
@@ -169,12 +169,53 @@
|
||||
* Restructured some Makefiles to better handle enabling and disabling
|
||||
NuttX features without having so much conditional compilation in the
|
||||
source files.
|
||||
* tools/mkconfig.c: No long depends on asprintf() and _GNU_SOURCE and
|
||||
* tools/mkconfig.c: No longer depends on asprintf() and _GNU_SOURCE and
|
||||
so should now build in non-GNU, non-GLIBC environments.
|
||||
* include/nuttx/compiler.h: Fix for using SDCC with the Z80.
|
||||
* include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support
|
||||
__FILE__and __LINE__ (not tested)
|
||||
* examples/ostest/barrier.c: Don't call usleep() when signals are
|
||||
disabled.
|
||||
* Started m68322
|
||||
|
||||
0.2.8 2007-07-02 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* tools/Makefile.mkconfig: Under Cygwin, executable has a different name
|
||||
* tools/mkdeps.sh & arch/arm/src/Makefile: Corrected a problem makeing dependencies
|
||||
* tools/zipme.sh: Force directory name to be nuttx-xx.yy.zz
|
||||
* fs/fs_opendir.c: Correct errors in semaphore usage that can cause deadlock.
|
||||
* lib/lib_getopt.c: Added getopt() support
|
||||
* examples/nsh/: NSH now supports cat, mount, umount, and mkdir. ls supports
|
||||
-l -s, and -R
|
||||
* Added basic OS support to manage environment variables: environment
|
||||
storage, cloning on task creation, sharing on pthread creation, destruction
|
||||
on thread/task exit.
|
||||
* Add environment variables APIs: environ, getenv, putenv, clearenv, setenv,
|
||||
unsetenv
|
||||
* Correct an error in realloc() when the block is extended "down" in memory.
|
||||
In this case, the old memory contents need to be copied to the new location
|
||||
and an allocated bit was not being set.
|
||||
* examples/ostest/: Added an environment variable test.
|
||||
* examples/nsh/: Break into several files.
|
||||
* lib/: Added strrchr, basename, dirname
|
||||
* examples/nsh/: Add cp, rm, rmdir, set, unset commands. echo will now print
|
||||
environment variables.
|
||||
|
||||
0.3.0 2007-11-06 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Imported uIP into the tree (see
|
||||
http://www.sics.se/~adam/uip/index.php/Main_Page)
|
||||
* Adding socket(), bind(), connect()
|
||||
* Added snprintf()
|
||||
* Added send() and sendto(); integrate write() and close() with socket descriptors.
|
||||
* Added recv() and recvfrom().
|
||||
* Added getsockopt() and setsockopt()
|
||||
* Documentation updated to address socket interfaces.
|
||||
* Implemented receive timeouts via setsockopt(SO_RCVTIMEO).
|
||||
* Provide support for multiple network devices
|
||||
* Implement socket ioctl() calls to set addresses
|
||||
* Added listen() and accept()
|
||||
* Added DM90x0 ethernet driver
|
||||
* ARP timer is now built into the network layer
|
||||
* Basic client functionality verified: socket(), bind(), connect(), recv(), send().
|
||||
|
||||
0.3.1 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<tr align="center" bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||
<p>Last Updated: June 9, 2007</p>
|
||||
<p>Last Updated: November 6, 2007</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -183,13 +183,28 @@
|
||||
</table>
|
||||
|
||||
<p>
|
||||
The 10th release of NuttX (nuttx-0.2.7) is available for download
|
||||
The 12th release of NuttX (nuttx-0.3.0) is available for download
|
||||
from the <a href="http://sourceforge.net/project/showfiles.php?group_id=189573">SourceForge</a>
|
||||
website.
|
||||
The change log associated with the release is available <a href="#currentrelease">here</a>.
|
||||
Unreleased changes after this release are avalable in CVS.
|
||||
These unreleased changes are listed <a href="#pendingchanges">here</a>.
|
||||
</p>
|
||||
<p>
|
||||
NuttX 30.3.0 includes the initial integration of a network subsystem and
|
||||
a TCP/IP stack based on <a href="http://www.sics.se/~adam/uip/index.php/Main_Page">uIP</a>.
|
||||
Also included is a device driver for the Davicom DM90x0 ethernet controller.
|
||||
</p>
|
||||
</p>
|
||||
This integration is very preliminary. Only a small portion of the
|
||||
network functionality has been integrated and there are a number of
|
||||
open issues. The network subsystem is pre-alpha this point in time.
|
||||
I expect that it will stabilize and mature over the next few releases.
|
||||
</p>
|
||||
<p>
|
||||
The baseline functionality of NuttX continues to mature and remains at
|
||||
post-beta (as long as the network is not used).
|
||||
</p>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
@@ -251,14 +266,14 @@
|
||||
</p>
|
||||
<p>
|
||||
<b>STATUS:</b>
|
||||
This port is in progress and should be available in the nuttx-0.2.7 release.
|
||||
Initial coding of this port code complete but has not yet been verified.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><img src="favicon.ico"></td>
|
||||
<td bgcolor="#5eaee1">
|
||||
<b>ARM9EJS</b>.
|
||||
<b>ARM926EJS</b>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -273,7 +288,7 @@
|
||||
</p>
|
||||
<p>
|
||||
<b>STATUS:</b>
|
||||
This port is code complete but totally untested due to hardware issues with my OSD.
|
||||
This port is complete and verified.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -329,7 +344,7 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<p><b>C5471 (Arm7)</b>
|
||||
<p><b>C5471 (ARM7)</b>
|
||||
The build for this ARM7 target that includes most of the OS features and
|
||||
a broad range of OS tests. The size of this executable as given by the
|
||||
Linux <tt>size</tt> command is (3/9/07):
|
||||
@@ -338,6 +353,14 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq
|
||||
text data bss dec hex filename
|
||||
53272 428 3568 57268 dfb4 nuttx
|
||||
</pre>
|
||||
<p><b>DM320 (ARM9)</b>
|
||||
This build for the ARM9 target includes a signficant subset of OS
|
||||
features, ethernet driver and full TCP/IP stack (via uIP).
|
||||
</p>
|
||||
<pre>
|
||||
text data bss dec hex filename
|
||||
51368 296 6072 57736 e188 nuttx
|
||||
</pre>
|
||||
<p><b>87C52</b>
|
||||
A reduced functionality OS test for the 8052 target requires only
|
||||
about 18-19Kb:
|
||||
@@ -560,17 +583,7 @@ Other memory:
|
||||
telldir(), rewindir().
|
||||
* Fixed ARM compilation errors introduced in 0.2.5 (that is what I get
|
||||
for only testing on the simulation).
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="currentrelease">ChangeLog for Current Release</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<pre><ul>
|
||||
0.2.7 2007-06-09 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Added stat() to fs layer and to FAT
|
||||
@@ -592,13 +605,63 @@ Other memory:
|
||||
* Restructured some Makefiles to better handle enabling and disabling
|
||||
NuttX features without having so much conditional compilation in the
|
||||
source files.
|
||||
* tools/mkconfig.c: No long depends on asprintf() and _GNU_SOURCE and
|
||||
* tools/mkconfig.c: No longer depends on asprintf() and _GNU_SOURCE and
|
||||
so should now build in non-GNU, non-GLIBC environments.
|
||||
* include/nuttx/compiler.h: Fix for using SDCC with the Z80.
|
||||
* include/assert.h & arch/pjrc-8051/src/up_assert.c: SDCC does support
|
||||
__FILE__and __LINE__ (not tested)
|
||||
* examples/ostest/barrier.c: Don't call usleep() when signals are
|
||||
disabled.
|
||||
|
||||
0.2.8 2007-07-02 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* tools/Makefile.mkconfig: Under Cygwin, executable has a different name
|
||||
* tools/mkdeps.sh & arch/arm/src/Makefile: Corrected a problem makeing dependencies
|
||||
* tools/zipme.sh: Force directory name to be nuttx-xx.yy.zz
|
||||
* fs/fs_opendir.c: Correct errors in semaphore usage that can cause deadlock.
|
||||
* lib/lib_getopt.c: Added getopt() support
|
||||
* examples/nsh/: NSH now supports cat, mount, umount, and mkdir. ls supports
|
||||
-l -s, and -R
|
||||
* Added basic OS support to manage environment variables: environment
|
||||
storage, cloning on task creation, sharing on pthread creation, destruction
|
||||
on thread/task exit.
|
||||
* Add environment variables APIs: environ, getenv, putenv, clearenv, setenv,
|
||||
unsetenv
|
||||
* Correct an error in realloc() when the block is extended "down" in memory.
|
||||
In this case, the old memory contents need to be copied to the new location
|
||||
and an allocated bit was not being set.
|
||||
* examples/ostest/: Added an environment variable test.
|
||||
* examples/nsh/: Break into several files.
|
||||
* lib/: Added strrchr, basename, dirname
|
||||
* examples/nsh/: Add cp, rm, rmdir, set, unset commands. echo will now print
|
||||
environment variables.
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
<tr bgcolor="#e4e4e4">
|
||||
<td>
|
||||
<a name="currentrelease">ChangeLog for Current Release</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<pre><ul>
|
||||
0.3.0 2007-11-06 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Imported uIP into the tree (see
|
||||
http://www.sics.se/~adam/uip/index.php/Main_Page)
|
||||
* Adding socket(), bind(), connect()
|
||||
* Added snprintf()
|
||||
* Added send() and sendto(); integrate write() and close() with socket descriptors.
|
||||
* Added recv() and recvfrom().
|
||||
* Added getsockopt() and setsockopt()
|
||||
* Documentation updated to address socket interfaces.
|
||||
* Implemented receive timeouts via setsockopt(SO_RCVTIMEO).
|
||||
* Provide support for multiple network devices
|
||||
* Implement socket ioctl() calls to set addresses
|
||||
* Added listen() and accept()
|
||||
* Added DM90x0 ethernet driver
|
||||
* ARP timer is now built into the network layer
|
||||
* Basic client functionality verified: socket(), bind(), connect(), recv(), send().
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
@@ -610,10 +673,7 @@ Other memory:
|
||||
</table>
|
||||
|
||||
<pre><ul>
|
||||
|
||||
0.2.8 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
* Started m68322
|
||||
0.3.1 2007-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</b></big>
|
||||
<p><small>by</small></p>
|
||||
<p>Gregory Nutt</p>
|
||||
<p><small>Last Update: May 26, 2007</small></p>
|
||||
<p><small>Last Update: September 8, 2007</small></p>
|
||||
</center>
|
||||
|
||||
<center><h1>Table of Contents</h1></center>
|
||||
@@ -46,9 +46,11 @@
|
||||
<li><a href="#DirStructInclude">2.7 include/</a></li>
|
||||
<li><a href="#DirStructLib">2.8 lib/</a></li>
|
||||
<li><a href="#DirStructMm">2.9 mm/</a></li>
|
||||
<li><a href="#DirStructSched">2.10 sched/</a></li>
|
||||
<li><a href="#DirStructTools">2.11 tools/</a></li>
|
||||
<li><a href="#topmakefile">2.12 Makefile</a></li>
|
||||
<li><a href="#DirStructNet">2.10 net</a></li>
|
||||
<li><a href="#DirStructNetUtils">2.11 netutils</a></li>
|
||||
<li><a href="#DirStructSched">2.12 sched/</a></li>
|
||||
<li><a href="#DirStructTools">2.13 tools/</a></li>
|
||||
<li><a href="#topmakefile">2.14 Makefile</a></li>
|
||||
</ul>
|
||||
<li><a href="#configandbuild">3.0 Configuring and Building</a></li>
|
||||
<ul>
|
||||
@@ -139,8 +141,8 @@
|
||||
| | | `-- <i>(board-specific source files)</i>
|
||||
| | `-- <i>(board-specific configuration files)</i>
|
||||
| `-- <i><other-boards></i>/
|
||||
|-- <a href="#DirStructDrivers">drivers</a>
|
||||
| |-- Makefile/
|
||||
|-- <a href="#DirStructDrivers">drivers</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(common driver source files)</i>
|
||||
|-- <a href="#DirStructExamples">examples</a>/
|
||||
| `-- <i>(example)</i>/
|
||||
@@ -148,9 +150,16 @@
|
||||
| `-- <i>(example source files)</i>
|
||||
|-- <a href="#DirStructFs">fs</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(fs source files)</i>
|
||||
| `-- <i>(common file system source files)</i>
|
||||
|-- <a href="#DirStructInclude">include</a>/
|
||||
| |-- <i>(standard header files)</i>
|
||||
| |-- arpa/
|
||||
| | `-- <i>(standard header files)</i>
|
||||
| |-- net/
|
||||
| | `-- uip/
|
||||
| | `-- <i>(uIP specific header files)</i>
|
||||
| |-- netinet/
|
||||
| | `-- <i>(standard header files)</i>
|
||||
| |-- nuttx/
|
||||
| | `-- <i>(nuttx specific header files)</i>
|
||||
| `- sys/
|
||||
@@ -160,7 +169,29 @@
|
||||
| `-- <i>(lib source files)</i>
|
||||
|-- <a href="#DirStructMm">mm</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(mm source files)</i>
|
||||
| `-- <i>(memory management source files)</i>
|
||||
|-- <a href="#DirStructNet">net</a>/
|
||||
| |-- Makefile
|
||||
| |-- uip/
|
||||
| | `-- <i>(uip source files)</i>
|
||||
| `-- <i>(socket source files)</i>
|
||||
|-- <a href="#DirStructNetUtils">netutils</a>/
|
||||
| |-- dhcp/
|
||||
| | `-- <i>(dhcp source files)</i>
|
||||
| |-- resolv/
|
||||
| | `-- <i>(resolv source files)</i>
|
||||
| |-- smtp/
|
||||
| | `-- <i>(smtp source files)</i>
|
||||
| |-- telnetd/
|
||||
| | `-- <i>(telnetd source files)</i>
|
||||
| |-- uiplib/
|
||||
| | `-- <i>(uiplib source files)</i>
|
||||
| |-- weblclient/
|
||||
| | `-- <i>(webclient source files)</i>
|
||||
| |-- webserver/
|
||||
| | `-- <i>(webserver source files)</i>
|
||||
| |-- Makefile
|
||||
| `-- <i>(fs source files)</i>
|
||||
|-- <a href="#DirStructSched">sched</a>/
|
||||
| |-- Makefile
|
||||
| `-- <i>(sched source files)</i>
|
||||
@@ -342,6 +373,9 @@
|
||||
This port does not support interrupts or a real timer (and hence no
|
||||
round robin scheduler) Otherwise, it is complete.
|
||||
</li>
|
||||
<p>NOTE: This target will not run on Cygwin probably for many reasons but
|
||||
first off because it uses some of the same symbols as does cygwind.dll.
|
||||
</p>
|
||||
|
||||
<li><code>arch/arm</code>:
|
||||
This directory holds common ARM architectures. At present, this includes
|
||||
@@ -604,18 +638,30 @@
|
||||
This is the NuttX memory manager.
|
||||
</p>
|
||||
|
||||
<h2>2.10 <a name="DirStructSched">sched</a></h2>
|
||||
<h2>2.10 <a name="DirStructNet">net</a></h2>
|
||||
<p>
|
||||
This directory contains the implementation of the socket APIs.
|
||||
The subdirectory, <code>uip</code> contians the uIP port.
|
||||
</P>
|
||||
|
||||
<h2>2.11 <a name="DirStructNetUtils">netutils</a></h2>
|
||||
<p>
|
||||
This directory contains most of the network applications contained under the uIP-1.0 apps directory.
|
||||
As the uIP apps/README says, these applications "are not all heavily tested."
|
||||
</p>
|
||||
|
||||
<h2>2.12 <a name="DirStructSched">sched</a></h2>
|
||||
<p>
|
||||
The files forming core of the NuttX RTOS reside here.
|
||||
</p>
|
||||
|
||||
<h2>2.11 <a name="DirStructTools">tools</a></h2>
|
||||
<h2>2.13 <a name="DirStructTools">tools</a></h2>
|
||||
<p>
|
||||
This directory holds a collection of tools and scripts to simplify
|
||||
configuring and building NuttX.
|
||||
</p>
|
||||
|
||||
<h2>2.12 <a name="topmakefile">Makefile</a></h2>
|
||||
<h2>2.14 <a name="topmakefile">Makefile</a></h2>
|
||||
<p>
|
||||
The top-level <code>Makefile</code> in the <code>${TOPDIR}</code> directory contains all of the top-level control
|
||||
logic to build NuttX.
|
||||
@@ -1294,6 +1340,75 @@ The system can be re-made subsequently by just typing <code>make</code>.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Network Support</h2>
|
||||
<h3>TCP/IP and UDP support via uIP</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NET</code>: Enable or disable all network features
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_IPv6</code>: Build in support for IPv6
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NSOCKET_DESCRIPTORS</code>: Maximum number of socket descriptors per task/thread.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_MAX_CONNECTIONS</code>: Maximum number of TCP connections (all tasks).
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_MAX_LISTENPORTS</code>: Maximum number of listening TCP ports (all tasks).
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_SOCKOPTS</code>: Enable or disable support for socket options.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_BUFFER_SIZE</code>: uIP buffer size
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_LOGGING</code>: Logging on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP</code>: UDP support on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP_CHECKSUMS</code>: UDP checksums on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_UDP_CONNS</code>: The maximum amount of concurrent UDP connections
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_STATISTICS</code>: uIP statistics on or off
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_PINGADDRCONF</code>: Use "ping" packet for setting IP address
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_RECEIVE_WINDOW</code>: The size of the advertised receiver's window
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_ARPTAB_SIZE</code>: The size of the ARP table
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_BROADCAST</code>: Broadcast support
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_LLH_LEN</code>: The link level header length
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_FWCACHE_SIZE</code>: number of packets to remember when looking for duplicates
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>UIP Network Utilities</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NET_DHCP_LIGHT</code>: Reduces size of DHCP
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NET_RESOLV_ENTRIES</code>: Number of resolver entries
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Stack and heap information</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
14
Makefile
14
Makefile
@@ -51,6 +51,10 @@ BOARD_DIR = configs/$(CONFIG_ARCH_BOARD)
|
||||
NONFSDIRS = sched lib $(ARCH_SRC) mm examples/$(CONFIG_EXAMPLE)
|
||||
FSDIRS = fs drivers
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
NONFSDIRS += net netutils
|
||||
endif
|
||||
|
||||
# CLEANDIRS are the directories that will clean in. These are
|
||||
# all directories that we know about.
|
||||
# MAKEDIRS are the directories in which we will build targets
|
||||
@@ -75,6 +79,10 @@ ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
|
||||
LINKLIBS += fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
LINKLIBS += net/libnet$(LIBEXT) netutils/libnetutils$(LIBEXT)
|
||||
endif
|
||||
|
||||
# This is the name of the final target
|
||||
BIN = nuttx$(EXEEXT)
|
||||
|
||||
@@ -184,6 +192,12 @@ $(ARCH_SRC)/libarch$(LIBEXT): context
|
||||
mm/libmm$(LIBEXT): context
|
||||
$(MAKE) -C mm TOPDIR=$(TOPDIR) libmm$(LIBEXT)
|
||||
|
||||
net/libnet$(LIBEXT): context
|
||||
$(MAKE) -C net TOPDIR=$(TOPDIR) libnet$(LIBEXT)
|
||||
|
||||
netutils/libnetutils$(LIBEXT): context
|
||||
$(MAKE) -C netutils TOPDIR=$(TOPDIR) libnetutils$(LIBEXT)
|
||||
|
||||
fs/libfs$(LIBEXT): context
|
||||
$(MAKE) -C fs TOPDIR=$(TOPDIR) libfs$(LIBEXT)
|
||||
|
||||
|
||||
25
ReleaseNotes
25
ReleaseNotes
@@ -1,14 +1,23 @@
|
||||
nuttx-0.2.7
|
||||
nuttx-0.3.0
|
||||
^^^^^^^^^^^
|
||||
|
||||
This is the 10th release of NuttX. This is primarily a bugfix release
|
||||
to correct a number of problems reported to me (thanks Didier!). This release
|
||||
does include the final changes complete the FAT filesystem logic including
|
||||
stat(), tatfs(), and non-standard APIs to manage FAT attributes. At present,
|
||||
FAT long file names and file trunction() are still not supported.
|
||||
This is the 12th release of NuttX. This release includes the initial
|
||||
integration of a network subsystem and the uIP TCP/IP stack into NuttX
|
||||
(see http://www.sics.se/~adam/uip/index.php/Main_Page). Also included
|
||||
is a device driver for the Davicom DM90x0 ethernet controller.
|
||||
|
||||
This integration is very preliminary. Only a small portion of the
|
||||
network functionality has been integrated and there are a number of
|
||||
open issues (see the TODO file). The network subsystem is pre-alpha
|
||||
at this point in time. I expect that it will stabilize and mature
|
||||
over the next few releases.
|
||||
|
||||
The baseline functionality of NuttX continues to mature and remains at
|
||||
post-beta (as long as the network is not used).
|
||||
|
||||
See the ChangeLog for a complete list of changes.
|
||||
|
||||
This release has been verified only on the Linux user-mode platform.
|
||||
This release has been verified only on the Neuros OSD (DM320 ARM9)
|
||||
platform using the DM90x0 driver.
|
||||
|
||||
This tarball contains a complete CVS snapshot from June 9, 2007.
|
||||
This tarball contains a complete CVS snapshot from November 6, 2007.
|
||||
|
||||
51
TODO
51
TODO
@@ -23,26 +23,59 @@ o Signals
|
||||
- 'Standard' signals and signal actions are not supported.
|
||||
|
||||
o pthreads
|
||||
- pthread_cancel(): Should implemenent cancellation points and pthread_testcancel()
|
||||
- pthread_cancel(): Should implement cancellation points and pthread_testcancel()
|
||||
|
||||
o C++ Support
|
||||
- Need to call static constructors
|
||||
|
||||
o Network
|
||||
- Port FreeBSD TCP/IP stack
|
||||
- Did not implement send() and sendto() timeouts. Option is setable via setsockopt,
|
||||
but is not implemented.
|
||||
- netutils/webserver netutils/telnetd (and maybe others) are seriously broken.
|
||||
Need to be re-written to use listen() and accept()
|
||||
- Should implement SOCK_RAW
|
||||
- listen() and accept() are untested.
|
||||
- accept() and recvfrom() need to return connection address
|
||||
- Performance Improvements (uIP is not very fast):
|
||||
- Improve performance by queing TX operations
|
||||
Add simple buffer management. CONFIG_NET_BUFFERS
|
||||
(1) On write, queue buffer for output get a new buffer for the socket (waiting if
|
||||
nececcesary
|
||||
(2) Copy buffer structure into uip_driver_structure when driver requests write
|
||||
data
|
||||
- Improve performance by stimulating the driver to accept new TX data before the
|
||||
next polling interval.
|
||||
|
||||
Add a txail callback into driver to eliminate send delays. Since we want to
|
||||
support multiple network devices, this means we will have to add some infrastructure
|
||||
to map to device.
|
||||
- Break uip_interrupt() (in uip.c) into several functions.
|
||||
- uIP polling issues:
|
||||
(1) uIP expects a single driver to poll at a 500ms interval (dm90x0 currently
|
||||
polls a 5sec).
|
||||
(2) Current logic will not support multiple ethernet drivers. Each driver should
|
||||
poll on TCP connections connect on the network supported by the driver; UDP
|
||||
polling should respond with TX data only if the UDP packet is intended for the
|
||||
the network supported by the driver.
|
||||
(3) If there were multiple drivers, polling would occur at double the rate.
|
||||
- TCP Bug:
|
||||
When TCP data is received with no read in place, it appears that uIP ACKs the data
|
||||
even though it was not taken accepted. We must either (1) buffer incoming data, or
|
||||
(2) not ACK it so that it will be re-sent.
|
||||
|
||||
o USB
|
||||
- Implement USB device support
|
||||
- Implement USB bulk device
|
||||
|
||||
o Libraries
|
||||
- sscanf() and lib_vsprintf() do not support floating point values.
|
||||
- The definition of environ in stdlib.h is bogus and will not work as it should. This
|
||||
is because the underlying representation of the environment is not an arry of pointers.
|
||||
|
||||
o File system
|
||||
- Add statfs(), chmod(), truncate().
|
||||
- Add chmod(), truncate().
|
||||
- FAT32: long file names
|
||||
|
||||
o Console Output
|
||||
|
||||
o Documentation
|
||||
- Document fs/ & driver/ logic
|
||||
- Document C-library APIs
|
||||
@@ -51,15 +84,16 @@ o Build system
|
||||
- Some names under arch are still incorrect. These should be processor architecture
|
||||
names: pjrc-8051 should be 805x
|
||||
- configs/pjrc-8051 should be configs/pjrc-87c52
|
||||
- 0.2.4 changes to create the arch/arm directory breaks dependency target in arch/arm/src.
|
||||
Probably need to add the path to the chip or common subdirectorys when
|
||||
running tools/mkdeps.sh
|
||||
- Dependencies do not work correctly under configs/<board>/src (same as arch/<arch>/src/board).
|
||||
|
||||
o Applications & Tests
|
||||
|
||||
o C5471
|
||||
|
||||
o DM320
|
||||
- It seems that when a lot of debug statements are added, the system no
|
||||
longer boots. There could be some issue with the bootloader or with
|
||||
the programming of the SDRAM MMU regions.
|
||||
|
||||
o LPC214x
|
||||
- Finish bringup
|
||||
@@ -82,3 +116,4 @@ o pjrc-8052 / MCS51
|
||||
clock_initialize.c at line 107
|
||||
pthread_create.c at 330
|
||||
sighand.c at 225 and 244
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
* Included Files
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <arch/chip/irq.h>
|
||||
|
||||
/************************************************************
|
||||
|
||||
@@ -103,7 +103,7 @@ endif
|
||||
@if [ -e board/Makefile ]; then \
|
||||
$(MAKE) -C board TOPDIR=$(TOPDIR) depend ; \
|
||||
fi
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
$(MKDEP) --dep-path chip --dep-path common $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
@@ -37,7 +37,7 @@ HEAD_ASRC = up_nommuhead.S
|
||||
|
||||
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S
|
||||
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \
|
||||
up_createstack.c up_dataabort.c up_delay.c up_doirq.c \
|
||||
up_createstack.c up_dataabort.c up_mdelay.c up_udealy.c up_doirq.c \
|
||||
up_exit.c up_idle.c up_initialize.c up_initialstate.c \
|
||||
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \
|
||||
up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/************************************************************
|
||||
* c5471/c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471c5471_serial.c
|
||||
* c5471/c5471_serial.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
@@ -38,16 +38,19 @@
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <semaphore.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/serial.h>
|
||||
#include <arch/serial.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
@@ -381,9 +384,9 @@ static int up_setup(struct uart_dev_s *dev)
|
||||
/* Both the IrDA and MODEM UARTs support RESET and UART mode. */
|
||||
|
||||
up_serialout(priv, UART_MDR_OFFS, MDR_RESET_MODE);
|
||||
up_delay(5);
|
||||
up_mdelay(5);
|
||||
up_serialout(priv, UART_MDR_OFFS, MDR_UART_MODE);
|
||||
up_delay(5);
|
||||
up_mdelay(5);
|
||||
|
||||
priv->regs.ier = up_inserial(priv, UART_IER_OFFS);
|
||||
priv->regs.lcr = up_inserial(priv, UART_LCR_OFFS);
|
||||
|
||||
@@ -38,11 +38,15 @@
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
@@ -163,9 +167,9 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
|
||||
{
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
up_ledon(LED_PANIC);
|
||||
up_delay(250);
|
||||
up_mdelay(250);
|
||||
up_ledoff(LED_PANIC);
|
||||
up_delay(250);
|
||||
up_mdelay(250);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* common/up_initialize.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
@@ -31,11 +31,11 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
@@ -45,37 +45,67 @@
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Define to enable timing loop calibration */
|
||||
|
||||
#undef CONFIG_ARM_CALIBRATION
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Private Function Prototypes
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Global Functions
|
||||
************************************************************/
|
||||
/****************************************************************************
|
||||
* Name: up_calibratedelay
|
||||
*
|
||||
* Description:
|
||||
* Delay loops are provided for short timing loops. This function, if
|
||||
* enabled, will just wait for 100 seconds. Using a stopwatch, you can
|
||||
* can then determine if the timing loops are properly calibrated.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
#if defined(CONFIG_ARM_CALIBRATION) & defined(CONFIG_DEBUG)
|
||||
static void up_calibratedelay(void)
|
||||
{
|
||||
int i;
|
||||
lldbg("Beginning 100s delay\n");
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
up_mdelay(1000);
|
||||
}
|
||||
lldbg("End 100s delay\n");
|
||||
}
|
||||
#else
|
||||
# define up_calibratedelay()
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_initialize
|
||||
*
|
||||
* Description:
|
||||
* up_initialize will be called once during OS
|
||||
* initialization after the basic OS services have been
|
||||
* initialized. The architecture specific details of
|
||||
* initializing the OS will be handled here. Such things as
|
||||
* setting up interrupt service routines, starting the
|
||||
* clock, and registering device drivers are some of the
|
||||
* things that are different for each processor and hardware
|
||||
* platform.
|
||||
* up_initialize will be called once during OS initialization after the
|
||||
* basic OS services have been initialized. The architecture specific
|
||||
* details of initializing the OS will be handled here. Such things as
|
||||
* setting up interrupt service routines, starting the clock, and
|
||||
* registering device drivers are some of the things that are different
|
||||
* for each processor and hardware platform.
|
||||
*
|
||||
* up_initialize is called after the OS initialized but
|
||||
* before the init process has been started and before the
|
||||
* libraries have been initialized. OS services and driver
|
||||
* services are available.
|
||||
* up_initialize is called after the OS initialized but before the user
|
||||
* initialization logic has been started and before the libraries have
|
||||
* been initialized. OS services and driver services are available.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void up_initialize(void)
|
||||
{
|
||||
@@ -83,6 +113,10 @@ void up_initialize(void)
|
||||
|
||||
current_regs = NULL;
|
||||
|
||||
/* Calibrate the timing loop */
|
||||
|
||||
up_calibratedelay();
|
||||
|
||||
/* Initialize the interrupt subsystem */
|
||||
|
||||
up_irqinitialize();
|
||||
@@ -100,5 +134,9 @@ void up_initialize(void)
|
||||
/* Initialize the serial device driver */
|
||||
|
||||
up_serialinit();
|
||||
|
||||
/* Initialize the netwok */
|
||||
|
||||
up_netinitialize();
|
||||
up_ledon(LED_IRQSENABLED);
|
||||
}
|
||||
|
||||
@@ -100,7 +100,6 @@ extern uint32 g_heapbase;
|
||||
extern void up_boot(void);
|
||||
extern void up_copystate(uint32 *dest, uint32 *src);
|
||||
extern void up_dataabort(uint32 *regs);
|
||||
extern void up_delay(int milliseconds);
|
||||
extern void up_decodeirq(uint32 *regs);
|
||||
extern void up_doirq(int irq, uint32 *regs);
|
||||
extern void up_fullcontextrestore(uint32 *regs) __attribute__ ((noreturn));
|
||||
@@ -157,6 +156,13 @@ extern void up_ledoff(int led);
|
||||
# define up_ledoff(led)
|
||||
#endif
|
||||
|
||||
/* Defined in board/up_network.c */
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
extern void up_netinitialize(void);
|
||||
#else
|
||||
# define up_netinitialize()
|
||||
#endif
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* __UP_INTERNAL_H */
|
||||
|
||||
90
arch/arm/src/common/up_mdelay.c
Normal file
90
arch/arm/src/common/up_mdelay.c
Normal file
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
* common/up_mdelay.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_mdelay
|
||||
*
|
||||
* Description:
|
||||
* Delay inline for the requested number of milliseconds.
|
||||
* *** NOT multi-tasking friendly ***
|
||||
*
|
||||
* ASSUMPTIONS:
|
||||
* The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_mdelay(unsigned int milliseconds)
|
||||
{
|
||||
volatile int i;
|
||||
volatile int j;
|
||||
|
||||
for (i = 0; i < milliseconds; i++)
|
||||
{
|
||||
for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
128
arch/arm/src/common/up_udelay.c
Normal file
128
arch/arm/src/common/up_udelay.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/****************************************************************************
|
||||
* common/up_udelay.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10)
|
||||
#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100)
|
||||
#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_udelay
|
||||
*
|
||||
* Description:
|
||||
* Delay inline for the requested number of microseconds. NOTE: Because
|
||||
* of all of the setup, several microseconds will be lost before the actual
|
||||
* timing looop begins. Thus, the delay will always be a few microseconds
|
||||
* longer than requested.
|
||||
*
|
||||
* *** NOT multi-tasking friendly ***
|
||||
*
|
||||
* ASSUMPTIONS:
|
||||
* The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_udelay(unsigned int microseconds)
|
||||
{
|
||||
volatile int i;
|
||||
|
||||
/* We'll do this a little at a time because we expect that the
|
||||
* CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in
|
||||
* the divisions of its calculation. We'll use the largest values that
|
||||
* we can in order to prevent significant error buildup in the loops.
|
||||
*/
|
||||
|
||||
while (microseconds > 1000)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds -= 1000;
|
||||
}
|
||||
|
||||
while (microseconds > 100)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds -= 100;
|
||||
}
|
||||
|
||||
while (microseconds > 10)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds -= 10;
|
||||
}
|
||||
|
||||
while (microseconds > 0)
|
||||
{
|
||||
for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++)
|
||||
{
|
||||
}
|
||||
microseconds--;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ HEAD_ASRC = up_head.S
|
||||
CMN_ASRCS = up_cache.S up_fullcontextrestore.S up_saveusercontext.S \
|
||||
up_vectors.S up_vectortab.S
|
||||
CMN_CSRCS = up_assert.c up_blocktask.c up_copystate.c up_createstack.c \
|
||||
up_dataabort.c up_delay.c up_exit.c up_idle.c \
|
||||
up_dataabort.c up_mdelay.c up_udelay.c up_exit.c up_idle.c \
|
||||
up_initialize.c up_initialstate.c up_interruptcontext.c \
|
||||
up_prefetchabort.c up_releasepending.c up_releasestack.c \
|
||||
up_reprioritizertr.c up_schedulesigaction.c \
|
||||
|
||||
112
arch/arm/src/dm320/dm320_emif.h
Normal file
112
arch/arm/src/dm320/dm320_emif.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/************************************************************************************
|
||||
* dm320/dm320_emif.h
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __DM320_DM320_EMIF_H
|
||||
#define __DM320_DM320_EMIF_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* External Memory Interface (EMIF) Registers */
|
||||
|
||||
#define DM320_EMIF_CS0CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A00) /* CS0 Control Register #1 */
|
||||
#define DM320_EMIF_CS0CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A02) /* CS0 Control Register #2 */
|
||||
#define DM320_EMIF_CS0CTRL3 (DM320_PERIPHERALS_VADDR + 0x0A04) /* CS0 Control Register #3 */
|
||||
#define DM320_EMIF_CS1CTRL1A (DM320_PERIPHERALS_VADDR + 0x0A06) /* CS1 Control Register #1A */
|
||||
#define DM320_EMIF_CS1CTRL1B (DM320_PERIPHERALS_VADDR + 0x0A08) /* CS1 Control Register #1B */
|
||||
#define DM320_EMIF_CS2CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A0A) /* CS1 Control Register #2 */
|
||||
#define DM320_EMIF_CS2CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A0C) /* CS2 Control Register #1 */
|
||||
#define DM320_EMIF_CS1CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A0E) /* CS2 Control Register #2 */
|
||||
#define DM320_EMIF_CS3CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A10) /* CS3 Control Register #1 */
|
||||
#define DM320_EMIF_CS3CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A12) /* CS3 Control Register #2 */
|
||||
#define DM320_EMIF_CS4CTRL1 (DM320_PERIPHERALS_VADDR + 0x0A14) /* CS4 Control Register #1 */
|
||||
#define DM320_EMIF_CS4CTRL2 (DM320_PERIPHERALS_VADDR + 0x0A16) /* CS4 Control Register #2 */
|
||||
#define DM320_EMIF_BUSCTRL (DM320_PERIPHERALS_VADDR + 0x0A18) /* Bus Control Register */
|
||||
#define DM320_EMIF_BUSRLS (DM320_PERIPHERALS_VADDR + 0x0A1A) /* Bus Release Control Register */
|
||||
#define DM320_EMIF_CFCTRL1 (DM320_PERIPHERALS_VADDR + 0x0A1C) /* CFC ControlRegister #1 */
|
||||
#define DM320_EMIF_CFCTRL2 (DM320_PERIPHERALS_VADDR + 0x0A1E) /* CFC ControlRegister#2 */
|
||||
#define DM320_EMIF_SMCTRL (DM320_PERIPHERALS_VADDR + 0x0A20) /* SmartMedia Control Register */
|
||||
#define DM320_EMIF_BUSINTEN (DM320_PERIPHERALS_VADDR + 0x0A22) /* Bus Interrupt Enable Register */
|
||||
#define DM320_EMIF_BUSSTS (DM320_PERIPHERALS_VADDR + 0x0A24) /* Bus Status Register */
|
||||
#define DM320_EMIF_BUSWAITMD (DM320_PERIPHERALS_VADDR + 0x0A26) /* Bus Wait Mode Register */
|
||||
#define DM320_EMIF_ECC1CP (DM320_PERIPHERALS_VADDR + 0x0A28) /* ECC Area 1 CP Register */
|
||||
#define DM320_EMIF_ECC1LP (DM320_PERIPHERALS_VADDR + 0x0A2A) /* ECC Area 1 LP Register */
|
||||
#define DM320_EMIF_ECC2CP (DM320_PERIPHERALS_VADDR + 0x0A2C) /* ECC Area 2 CP Register */
|
||||
#define DM320_EMIF_ECC2LP (DM320_PERIPHERALS_VADDR + 0x0A2E) /* ECC Area 2 LP Register */
|
||||
#define DM320_EMIF_ECC3CP (DM320_PERIPHERALS_VADDR + 0x0A30) /* ECC Area 3 CP Register */
|
||||
#define DM320_EMIF_ECC3LP (DM320_PERIPHERALS_VADDR + 0x0A32) /* ECC Area 3 LP Register */
|
||||
#define DM320_EMIF_ECC4CP (DM320_PERIPHERALS_VADDR + 0x0A34) /* ECC Area 4 CP Register */
|
||||
#define DM320_EMIF_ECC4LP (DM320_PERIPHERALS_VADDR + 0x0A36) /* ECC Area 4 LP Register */
|
||||
#define DM320_EMIF_ECC5CP (DM320_PERIPHERALS_VADDR + 0x0A38) /* ECC Area 5 CP Register */
|
||||
#define DM320_EMIF_ECC5LP (DM320_PERIPHERALS_VADDR + 0x0A3A) /* ECC Area 5 LP Register */
|
||||
#define DM320_EMIF_ECC6CP (DM320_PERIPHERALS_VADDR + 0x0A3C) /* ECC Area 6 CP Register */
|
||||
#define DM320_EMIF_ECC6LP (DM320_PERIPHERALS_VADDR + 0x0A3E) /* ECC Area 6 LP Register */
|
||||
#define DM320_EMIF_ECC7CP (DM320_PERIPHERALS_VADDR + 0x0A40) /* ECC Area 7 CP Register */
|
||||
#define DM320_EMIF_ECC7LP (DM320_PERIPHERALS_VADDR + 0x0A42) /* ECC Area 7 LP Register */
|
||||
#define DM320_EMIF_ECC8CP (DM320_PERIPHERALS_VADDR + 0x0A44) /* ECC Area 8 CP Register */
|
||||
#define DM320_EMIF_ECC8LP (DM320_PERIPHERALS_VADDR + 0x0A46) /* ECC Area 8 LP Register */
|
||||
#define DM320_EMIF_ECCCLR (DM320_PERIPHERALS_VADDR + 0x0A48) /* ECC Clear Register */
|
||||
#define DM320_EMIF_PAGESZ (DM320_PERIPHERALS_VADDR + 0x0A4A) /* SmartMedia Page Size Register */
|
||||
#define DM320_EMIF_PRIORCTL (DM320_PERIPHERALS_VADDR + 0x0A4C) /* Priority control for DMA */
|
||||
#define DM320_EMIF_IMGDSPDEST (DM320_PERIPHERALS_VADDR + 0x0A4E) /* DSP/IMGBUF DMA destination */
|
||||
#define DM320_EMIF_IMGDSPADDH (DM320_PERIPHERALS_VADDR + 0x0A50) /* DSP/IMGBUF high address */
|
||||
#define DM320_EMIF_IMGDSPADDL (DM320_PERIPHERALS_VADDR + 0x0A52) /* DSP/IMGBUG low address */
|
||||
#define DM320_EMIF_AHBADDH (DM320_PERIPHERALS_VADDR + 0x0A54) /* AHB high address */
|
||||
#define DM320_EMIF_AHBADDL (DM320_PERIPHERALS_VADDR + 0x0A56) /* AHB low address */
|
||||
#define DM320_EMIF_MTCADDH (DM320_PERIPHERALS_VADDR + 0x0A58) /* MTC high address */
|
||||
#define DM320_EMIF_MTCADDL (DM320_PERIPHERALS_VADDR + 0x0A5A) /* MTC low address */
|
||||
#define DM320_EMIF_DMASIZE (DM320_PERIPHERALS_VADDR + 0x0A5C) /* DMA Transfer Size Register */
|
||||
#define DM320_EMIF_DMAMTCSEL (DM320_PERIPHERALS_VADDR + 0x0A5E) /* DMA Device Select Register */
|
||||
#define DM320_EMIF_DMACTL (DM320_PERIPHERALS_VADDR + 0x0A60) /* DMA Control Register */
|
||||
#define DM320_EMIF_TEST (DM320_PERIPHERALS_VADDR + 0x0A62) /* Test Register.Do not use */
|
||||
|
||||
/************************************************************************************
|
||||
* Inline Functions
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __DM320_DM320_EMIF_H */
|
||||
@@ -90,7 +90,7 @@
|
||||
if ((pin) < 16) { _reg = (reg0); _pin = (pin); } \
|
||||
else if ((pin) < 32) { _reg = (reg1); _pin = ((pin) - 16); } \
|
||||
else { _reg = (reg2); _pin = ((pin) - 32); } \
|
||||
putreg16((getreg16(_reg) | (1 << _pin)), _reg)); \
|
||||
putreg16((getreg16(_reg) | (1 << _pin)), _reg); \
|
||||
} while (0)
|
||||
|
||||
#define _GIO_CLEAR_REG(pin, reg0, reg1, reg2) \
|
||||
@@ -99,7 +99,7 @@
|
||||
if ((pin) < 16) { _reg = (reg0); _pin = (pin); } \
|
||||
else if ((pin) < 32) { _reg = (reg1); _pin = ((pin) - 16); } \
|
||||
else { _reg = (reg2); _pin = ((pin) - 32); } \
|
||||
putreg16((getreg16(_reg) & ~(1 << _pin)), _reg)); \
|
||||
putreg16((getreg16(_reg) & ~(1 << _pin)), _reg); \
|
||||
} while (0)
|
||||
|
||||
/* Select GIO input or output */
|
||||
|
||||
@@ -37,8 +37,8 @@ HEAD_ASRC = lpc214x_head.S
|
||||
|
||||
CMN_ASRCS = up_saveusercontext.S up_fullcontextrestore.S up_vectors.S
|
||||
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c \
|
||||
up_createstack.c up_dataabort.c up_delay.c up_exit.c \
|
||||
up_idle.c up_initialize.c up_initialstate.c \
|
||||
up_createstack.c up_dataabort.c up_mdelay.c up_udelay.c \
|
||||
up_exit.c up_idle.c up_initialize.c up_initialstate.c \
|
||||
up_interruptcontext.c up_prefetchabort.c up_releasepending.c \
|
||||
up_releasestack.c up_reprioritizertr.c up_schedulesigaction.c \
|
||||
up_sigdeliver.c up_syscall.c up_unblocktask.c \
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include "clock_internal.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -97,11 +98,11 @@ void up_unblock_task(_TCB *tcb)
|
||||
sched_removeblocked(tcb);
|
||||
|
||||
/* Reset its timeslice. This is only meaningful for round
|
||||
* robin tasks but it doesn't here to do it for everything
|
||||
* robin tasks but it doesn't hurt to do it for all tasks
|
||||
*/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include "clock_internal.h"
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
@@ -96,11 +97,11 @@ void up_unblock_task(_TCB *tcb)
|
||||
sched_removeblocked(tcb);
|
||||
|
||||
/* Reset its timeslice. This is only meaningful for round
|
||||
* robin tasks but it doesn't here to do it for everything
|
||||
* robin tasks but it doesn't hurt to do it for all tasks.
|
||||
*/
|
||||
|
||||
#if CONFIG_RR_INTERVAL > 0
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_SEC;
|
||||
tcb->timeslice = CONFIG_RR_INTERVAL / MSEC_PER_TICK;
|
||||
#endif
|
||||
|
||||
/* Add the task in the correct location in the prioritized
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
#include "up_mem.h"
|
||||
|
||||
@@ -49,11 +49,16 @@ CSRCS = up_initialize.c up_idle.c up_interruptcontext.c \
|
||||
ifeq ($(CONFIG_FS_FAT),y)
|
||||
CSRCS += up_blockdevice.c up_deviceimage.c
|
||||
endif
|
||||
ifeq ($(CONFIG_NET),y)
|
||||
CSRCS += up_uipdriver.c
|
||||
SPECSRCS += up_tapdev.c
|
||||
endif
|
||||
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
SPECOBJS = $(SPECSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
SRCS = $(ASRCS) $(CSRCS) $(SPECSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS) $(SPECOBJS)
|
||||
|
||||
LDFLAGS = $(ARCHSCRIPT)
|
||||
EXTRA_LIBS = -lc
|
||||
@@ -74,31 +79,33 @@ $(AOBJS): %$(OBJEXT): %.S
|
||||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
$(SPECOBJS): %$(OBJEXT): %.c
|
||||
$(CC) -c $(HOSTCFLAGS) $< -o $@
|
||||
|
||||
libarch$(LIBEXT): $(OBJS)
|
||||
( for obj in $(OBJS) ; do \
|
||||
@( for obj in $(OBJS) ; do \
|
||||
$(AR) $@ $${obj} || \
|
||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||
done ; )
|
||||
|
||||
nuttx: $(LINKOBJS)
|
||||
nuttx$(EXEEXT): $(LINKOBJS)
|
||||
$(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \
|
||||
-Wl,--start-group $(LDLIBS) -Wl,--end-group $(EXTRA_LIBS)
|
||||
@$(NM) $(TOPDIR)/$@ | \
|
||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
sort > $(TOPDIR)/System.map
|
||||
|
||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||
sort > $(TOPDIR)/System.map
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
touch $@
|
||||
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
@touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
rm -f libarch$(LIBEXT) *~
|
||||
if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
|
||||
@rm -f libarch$(LIBEXT) *~
|
||||
@if [ ! -z "$(OBJEXT)" ]; then rm -f *$(OBJEXT); fi
|
||||
|
||||
distclean: clean
|
||||
rm -f Make.dep .depend
|
||||
@rm -f Make.dep .depend
|
||||
|
||||
-include Make.dep
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
*
|
||||
************************************************************/
|
||||
|
||||
#if !defined(linux) && !defined(__CYGWIN__)
|
||||
# error "Sorry, this will only work with Linux"
|
||||
#else
|
||||
|
||||
/************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
@@ -134,3 +138,6 @@ int up_putc(int ch)
|
||||
(void)up_write(1, &b, 1);
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* linux */
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <setjmp.h>
|
||||
#include <assert.h>
|
||||
#include <nuttx/os_external.h>
|
||||
#include <nuttx/init.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
/************************************************************
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
@@ -80,5 +80,11 @@ void up_idle(void)
|
||||
*/
|
||||
|
||||
sched_process_timer();
|
||||
|
||||
/* Run the network if enabled */
|
||||
|
||||
#if defined(CONFIG_NET) && defined(linux)
|
||||
uipdriver_loop();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -86,4 +86,7 @@ void up_initialize(void)
|
||||
devnull_register(); /* Standard /dev/null */
|
||||
up_devconsole(); /* Our private /dev/console */
|
||||
up_registerblockdevice(); /* Our simulated block device /dev/blkdev */
|
||||
#if defined(CONFIG_NET) && defined(linux)
|
||||
uipdriver_init(); /* Our "real" netwok driver */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -107,5 +107,22 @@ extern void up_registerblockdevice(void);
|
||||
|
||||
extern char *up_deviceimage(void);
|
||||
|
||||
/* up_tapdev.c ************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
extern unsigned long up_getwalltime( void );
|
||||
extern void tapdev_init(void);
|
||||
extern int tapdev_getmacaddr(unsigned char *macaddr);
|
||||
extern unsigned int tapdev_read(unsigned char *buf, unsigned int buflen);
|
||||
extern void tapdev_send(unsigned char *buf, unsigned int buflen);
|
||||
#endif
|
||||
|
||||
/* up_uipdriver.c *********************************************************/
|
||||
|
||||
#if defined(CONFIG_NET) && defined(linux)
|
||||
extern int uipdriver_init(void);
|
||||
extern void uipdriver_loop(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_UP_INTERNAL_H */
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
/**************************************************************************
|
||||
* Private Definitions
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
# define SYMBOL(s) _##s
|
||||
#else
|
||||
# define SYMBOL(s) s
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
* Private Types
|
||||
@@ -72,58 +78,65 @@
|
||||
**************************************************************************/
|
||||
|
||||
.text
|
||||
.globl up_setjmp
|
||||
.type up_setjmp, @function
|
||||
up_setjmp:
|
||||
.globl SYMBOL(up_setjmp)
|
||||
#ifndef __CYGWIN__
|
||||
.type SYMBOL(up_setjmp), @function
|
||||
#endif
|
||||
SYMBOL(up_setjmp):
|
||||
|
||||
/* %ebx, %esi, %edi, and %ebp must be preserved.
|
||||
* save %ebx, $esi, and %edi now... */
|
||||
|
||||
movl 4(%esp), %eax
|
||||
movl %ebx, (JB_EBX)(%eax)
|
||||
movl %esi, (JB_ESI)(%eax)
|
||||
movl %edi, (JB_EDI)(%eax)
|
||||
movl 4(%esp), %eax
|
||||
movl %ebx, (JB_EBX)(%eax)
|
||||
movl %esi, (JB_ESI)(%eax)
|
||||
movl %edi, (JB_EDI)(%eax)
|
||||
|
||||
/* Save the value of SP as will be after we return */
|
||||
/* Save the value of SP as will be after we return */
|
||||
|
||||
leal 4(%esp), %ecx
|
||||
movl %ecx, (JB_SP)(%eax)
|
||||
leal 4(%esp), %ecx
|
||||
movl %ecx, (JB_SP)(%eax)
|
||||
|
||||
/* Save the return PC */
|
||||
/* Save the return PC */
|
||||
|
||||
movl 0(%esp), %ecx
|
||||
movl %ecx, (JB_PC)(%eax)
|
||||
movl 0(%esp), %ecx
|
||||
movl %ecx, (JB_PC)(%eax)
|
||||
|
||||
/* Save the framepointer */
|
||||
/* Save the framepointer */
|
||||
|
||||
movl %ebp, (JB_EBP)(%eax)
|
||||
movl %ebp, (JB_EBP)(%eax)
|
||||
|
||||
/* And return 0 */
|
||||
|
||||
xorl %eax, %eax
|
||||
ret
|
||||
.size up_setjmp, . - up_setjmp
|
||||
ret
|
||||
#ifndef __CYGWIN__
|
||||
.size SYMBOL(up_setjmp), . - SYMBOL(up_setjmp)
|
||||
#endif
|
||||
.globl SYMBOL(up_longjmp)
|
||||
#ifndef __CYGWIN__
|
||||
.type SYMBOL(up_longjmp), @function
|
||||
#endif
|
||||
SYMBOL(up_longjmp):
|
||||
movl 4(%esp), %ecx /* U_pthread_jmpbuf in %ecx. */
|
||||
movl 8(%esp), %eax /* Second argument is return value. */
|
||||
|
||||
.globl up_longjmp
|
||||
.type up_longjmp, @function
|
||||
up_longjmp:
|
||||
movl 4(%esp), %ecx /* U_pthread_jmpbuf in %ecx. */
|
||||
movl 8(%esp), %eax /* Second argument is return value. */
|
||||
/* Save the return address now. */
|
||||
|
||||
/* Save the return address now. */
|
||||
movl (JB_PC)(%ecx), %edx
|
||||
|
||||
movl (JB_PC)(%ecx), %edx
|
||||
/* Restore registers. */
|
||||
|
||||
/* Restore registers. */
|
||||
movl (JB_EBX)(%ecx), %ebx
|
||||
movl (JB_ESI)(%ecx), %esi
|
||||
movl (JB_EDI)(%ecx), %edi
|
||||
movl (JB_EBP)(%ecx), %ebp
|
||||
movl (JB_SP)(%ecx), %esp
|
||||
|
||||
movl (JB_EBX)(%ecx), %ebx
|
||||
movl (JB_ESI)(%ecx), %esi
|
||||
movl (JB_EDI)(%ecx), %edi
|
||||
movl (JB_EBP)(%ecx), %ebp
|
||||
movl (JB_SP)(%ecx), %esp
|
||||
/* Jump to saved PC. */
|
||||
|
||||
/* Jump to saved PC. */
|
||||
|
||||
jmp *%edx
|
||||
.size up_longjmp, . - up_longjmp
|
||||
jmp *%edx
|
||||
#ifndef __CYGWIN__
|
||||
.size SYMBOL(up_longjmp), . - SYMBOL(up_longjmp)
|
||||
#endif
|
||||
|
||||
|
||||
375
arch/sim/src/up_tapdev.c
Normal file
375
arch/sim/src/up_tapdev.c
Normal file
@@ -0,0 +1,375 @@
|
||||
|
||||
/****************************************************************************
|
||||
* up_tapdev.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Based on code from uIP which also has a BSD-like license:
|
||||
*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef linux
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
#include <linux/net.h>
|
||||
|
||||
extern int lib_rawprintf(const char *format, ...);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define TAPDEV_DEBUG 1
|
||||
|
||||
#define DEVTAP "/dev/net/tun"
|
||||
|
||||
#ifndef CONFIG_EXAMPLE_UIP_DHCPC
|
||||
# define UIP_IPADDR0 192
|
||||
# define UIP_IPADDR1 168
|
||||
# define UIP_IPADDR2 0
|
||||
# define UIP_IPADDR3 128
|
||||
#else
|
||||
# define UIP_IPADDR0 0
|
||||
# define UIP_IPADDR1 0
|
||||
# define UIP_IPADDR2 0
|
||||
# define UIP_IPADDR3 0
|
||||
#endif
|
||||
|
||||
#define READ 3
|
||||
#define WRITE 4
|
||||
#define OPEN 5
|
||||
#define IOCTL 54
|
||||
#define SELECT 82
|
||||
#define SOCKETCALL 102
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/* Warning: This is very much Linux version specific! */
|
||||
|
||||
struct sel_arg_struct
|
||||
{
|
||||
unsigned long n;
|
||||
fd_set *inp;
|
||||
fd_set *outp;
|
||||
fd_set *exp;
|
||||
struct timeval *tvp;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef TAPDEV_DEBUG
|
||||
static int gdrop = 0;
|
||||
#endif
|
||||
static int gtapdevfd;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/* This is REALLY awkward.. we need to compile using the system header files,
|
||||
* but we can't use any of the libc calls because all of the symbols are
|
||||
* defined for NuttX (read, write, etc)! So we do hand rolled syscalls
|
||||
* to get to the Linux functions.
|
||||
*/
|
||||
|
||||
static inline int up_open(const char *filename, int flags, int mode)
|
||||
{
|
||||
int result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (OPEN), "b" ((int)(filename)), "c" ((int)(flags)), "d" ((int)(mode)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_socketcall(int call, unsigned long *args)
|
||||
{
|
||||
int result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (SOCKETCALL), "b" (call), "c" ((int)args) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_socket(int domain, int type, int protocol)
|
||||
{
|
||||
unsigned long args[3];
|
||||
args[0] = domain;
|
||||
args[1] = type;
|
||||
args[2] = protocol;
|
||||
return up_socketcall(SYS_SOCKET, args);
|
||||
}
|
||||
|
||||
static inline int up_read(int fd, void* buf, size_t count)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (READ), "b" ((int)(fd)), "c" ((int)(buf)), "d" ((int)(count)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_write(int fd, const void* buf, size_t count)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (WRITE), "b" ((int)(fd)), "c" ((int)(buf)), "d" ((int)(count)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_ioctl(int fd, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (IOCTL), "b" ((int)(fd)), "c" ((int)(cmd)), "d" ((long)(arg)) \
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
static inline int up_select(struct sel_arg_struct *arg)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
__asm__ volatile ("int $0x80" \
|
||||
: "=a" (result) \
|
||||
: "0" (SELECT),"b" ((struct sel_arg_struct *)(arg))
|
||||
: "memory");
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
#ifdef TAPDEV_DEBUG
|
||||
static inline void dump_ethhdr(const char *msg, unsigned char *buf, int buflen)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: %s %d bytes\n", msg, buflen);
|
||||
lib_rawprintf(" %02x:%02x:%02x:%02x:%02x:%02x %02x:%02x:%02x:%02x:%02x:%02x %02x%02x\n",
|
||||
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
|
||||
buf[6], buf[7], buf[8], buf[9], buf[10], buf[11],
|
||||
#if UIP_BYTE_ORDER == UIP_LITTLE_ENDIAN
|
||||
buf[12], buf[13]);
|
||||
#else
|
||||
buf[13], buf[12]);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
# define dump_ethhdr(m,b,l)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
unsigned long up_getwalltime( void )
|
||||
{
|
||||
struct timeval tm;
|
||||
(void)gettimeofday(&tm, NULL);
|
||||
return tm.tv_sec*1000 + tm.tv_usec/1000;
|
||||
}
|
||||
|
||||
void tapdev_init(void)
|
||||
{
|
||||
struct ifreq ifr;
|
||||
char buf[1024];
|
||||
int ret;
|
||||
|
||||
/* Open the tap device */
|
||||
|
||||
gtapdevfd = up_open(DEVTAP, O_RDWR, 0644);
|
||||
if (gtapdevfd < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: open failed: %d\n", -gtapdevfd );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Configure the tap device */
|
||||
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
|
||||
ret = up_ioctl(gtapdevfd, TUNSETIFF, (unsigned long) &ifr);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: ioctl failed: %d\n", -ret );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Assign an IPv4 address to the tap device */
|
||||
|
||||
snprintf(buf, sizeof(buf), "/sbin/ifconfig tap0 inet %d.%d.%d.%d\n",
|
||||
UIP_IPADDR0, UIP_IPADDR1, UIP_IPADDR2, UIP_IPADDR3);
|
||||
system(buf);
|
||||
}
|
||||
|
||||
int tapdev_getmacaddr(unsigned char *macaddr)
|
||||
{
|
||||
int ret = -1;
|
||||
if (macaddr)
|
||||
{
|
||||
/* Get a socket (only so that we get access to the INET subsystem) */
|
||||
|
||||
int sockfd = up_socket(PF_INET, SOCK_DGRAM, 0);
|
||||
if (sockfd >= 0)
|
||||
{
|
||||
struct ifreq req;
|
||||
memset (&req, 0, sizeof(struct ifreq));
|
||||
|
||||
/* Put the driver name into the request */
|
||||
|
||||
strncpy(req.ifr_name, "tap0", IFNAMSIZ);
|
||||
|
||||
/* Perform the ioctl to get the MAC address */
|
||||
|
||||
ret = up_ioctl(sockfd, SIOCGIFHWADDR, (unsigned long)&req);
|
||||
if (!ret)
|
||||
{
|
||||
/* Return the MAC address */
|
||||
|
||||
memcpy(macaddr, &req.ifr_hwaddr.sa_data, IFHWADDRLEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int tapdev_read(unsigned char *buf, unsigned int buflen)
|
||||
{
|
||||
struct sel_arg_struct arg;
|
||||
fd_set fdset;
|
||||
struct timeval tv;
|
||||
int ret;
|
||||
|
||||
/* We can't do anything if we failed to open the tap device */
|
||||
|
||||
if (gtapdevfd < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Wait for data on the tap device (or a timeout) */
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 1000;
|
||||
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(gtapdevfd, &fdset);
|
||||
|
||||
arg.n = gtapdevfd + 1;
|
||||
arg.inp = &fdset;
|
||||
arg.outp = NULL;
|
||||
arg.exp = NULL;
|
||||
arg.tvp = &tv;
|
||||
|
||||
ret = up_select(&arg);
|
||||
if(ret == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = up_read(gtapdevfd, buf, buflen);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: read failed: %d\n", -ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
dump_ethhdr("read", buf, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void tapdev_send(unsigned char *buf, unsigned int buflen)
|
||||
{
|
||||
int ret;
|
||||
#ifdef TAPDEV_DEBUG
|
||||
lib_rawprintf("tapdev_send: sending %d bytes\n", buflen);
|
||||
|
||||
gdrop++;
|
||||
if(gdrop % 8 == 7)
|
||||
{
|
||||
lib_rawprintf("Dropped a packet!\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
ret = up_write(gtapdevfd, buf, buflen);
|
||||
if (ret < 0)
|
||||
{
|
||||
lib_rawprintf("TAPDEV: write failed: %d", -ret);
|
||||
exit(1);
|
||||
}
|
||||
dump_ethhdr("write", buf, buflen);
|
||||
}
|
||||
|
||||
#endif /* linux */
|
||||
|
||||
|
||||
224
arch/sim/src/up_uipdriver.c
Normal file
224
arch/sim/src/up_uipdriver.c
Normal file
@@ -0,0 +1,224 @@
|
||||
/****************************************************************************
|
||||
* up_uipdriver.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Based on code from uIP which also has a BSD-like license:
|
||||
*
|
||||
* Copyright (c) 2001, Adam Dunkels.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef linux
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <sched.h>
|
||||
#include <nuttx/net.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BUF ((struct uip_eth_hdr *)g_sim_dev.d_buf)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
struct timer
|
||||
{
|
||||
uint32 interval;
|
||||
uint32 start;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static struct timer g_periodic_timer;
|
||||
static struct uip_driver_s g_sim_dev;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static void timer_set( struct timer *t, unsigned int interval )
|
||||
{
|
||||
t->interval = interval;
|
||||
t->start = up_getwalltime();
|
||||
}
|
||||
|
||||
static boolean timer_expired( struct timer *t )
|
||||
{
|
||||
return (up_getwalltime() - t->start) >= t->interval;
|
||||
}
|
||||
|
||||
void timer_reset(struct timer *t)
|
||||
{
|
||||
t->start += t->interval;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_PROMISCUOUS
|
||||
# define uipdriver_comparemac(a,b) (0)
|
||||
#else
|
||||
static inline int uip_comparemac(struct uip_eth_addr *paddr1, struct uip_eth_addr *paddr2)
|
||||
{
|
||||
return memcmp(paddr1, paddr2, sizeof(struct uip_eth_addr));
|
||||
}
|
||||
#endif
|
||||
|
||||
static int sim_uiptxpoll(struct uip_driver_s *dev)
|
||||
{
|
||||
/* If the polling resulted in data that should be sent out on the network,
|
||||
* the field d_len is set to a value > 0.
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
uip_arp_out(&g_sim_dev);
|
||||
tapdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
|
||||
/* If zero is returned, the polling will continue until all connections have
|
||||
* been examined.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void uipdriver_loop(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* tapdev_read will return 0 on a timeout event and >0 on a data received event */
|
||||
|
||||
g_sim_dev.d_len = tapdev_read((unsigned char*)g_sim_dev.d_buf, UIP_BUFSIZE);
|
||||
|
||||
/* Disable preemption through to the following so that it behaves a little more
|
||||
* like an interrupt (otherwise, the following logic gets pre-empted an behaves
|
||||
* oddly.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
/* Data received event. Check for valid Ethernet header with destination == our
|
||||
* MAC address
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > UIP_LLH_LEN && uip_comparemac( &BUF->dest, &g_sim_dev.d_mac) == 0)
|
||||
{
|
||||
/* We only accept IP packets of the configured type and ARP packets */
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
if (BUF->type == htons(UIP_ETHTYPE_IP6))
|
||||
#else
|
||||
if (BUF->type == htons(UIP_ETHTYPE_IP))
|
||||
#endif
|
||||
{
|
||||
uip_arp_ipin();
|
||||
uip_input(&g_sim_dev);
|
||||
|
||||
/* If the above function invocation resulted in data that
|
||||
* should be sent out on the network, the global variable
|
||||
* d_len is set to a value > 0.
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
uip_arp_out(&g_sim_dev);
|
||||
tapdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
}
|
||||
else if (BUF->type == htons(UIP_ETHTYPE_ARP))
|
||||
{
|
||||
uip_arp_arpin(&g_sim_dev);
|
||||
|
||||
/* If the above function invocation resulted in data that
|
||||
* should be sent out on the network, the global variable
|
||||
* d_len is set to a value > 0.
|
||||
*/
|
||||
|
||||
if (g_sim_dev.d_len > 0)
|
||||
{
|
||||
tapdev_send(g_sim_dev.d_buf, g_sim_dev.d_len);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Otherwise, it must be a timeout event */
|
||||
|
||||
else if (timer_expired(&g_periodic_timer))
|
||||
{
|
||||
timer_reset(&g_periodic_timer);
|
||||
uip_poll(&g_sim_dev, sim_uiptxpoll, UIP_DRV_TIMER);
|
||||
}
|
||||
sched_unlock();
|
||||
}
|
||||
|
||||
int uipdriver_init(void)
|
||||
{
|
||||
/* Internal initalization */
|
||||
|
||||
timer_set(&g_periodic_timer, 500);
|
||||
tapdev_init();
|
||||
(void)tapdev_getmacaddr(g_sim_dev.d_mac.addr);
|
||||
|
||||
/* Register the device with the OS so that socket IOCTLs can be performed */
|
||||
|
||||
(void)netdev_register(&g_sim_dev);
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* linux */
|
||||
|
||||
@@ -164,7 +164,8 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
up waiting tasks.
|
||||
|
||||
CONFIG_DISABLE_CLOCK, CONFIG_DISABLE_POSIX_TIMERS, CONFIG_DISABLE_PTHREAD.
|
||||
CONFIG_DISABLE_SIGNALS, CONFIG_DISABLE_MQUEUE, CONFIG_DISABLE_MOUNTPOUNT
|
||||
CONFIG_DISABLE_SIGNALS, CONFIG_DISABLE_MQUEUE, CONFIG_DISABLE_MOUNTPOUNT,
|
||||
CONFIG_DISABLE_ENVIRON
|
||||
|
||||
|
||||
Misc libc settings
|
||||
@@ -207,6 +208,35 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
structures. The system manages a pool of preallocated
|
||||
watchdog structures to minimize dynamic allocations
|
||||
|
||||
TCP/IP and UDP support via uIP
|
||||
CONFIG_NET - Enable or disable all network features
|
||||
CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors
|
||||
per task/thread.
|
||||
CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
|
||||
CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
CONFIG_NET_LOGGING - Logging on or off
|
||||
CONFIG_NET_UDP - UDP support on or off
|
||||
CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP
|
||||
connections
|
||||
CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's
|
||||
window
|
||||
CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
CONFIG_NET_BROADCAST - Broadcast support
|
||||
CONFIG_NET_LLH_LEN - The link level header length
|
||||
CONFIG_NET_FWCACHE_SIZE - number of packets to remember when
|
||||
looking for duplicates
|
||||
|
||||
UIP Network Utilities
|
||||
CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
|
||||
Stack and heap information
|
||||
|
||||
CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
|
||||
@@ -231,6 +261,9 @@ configs/sim
|
||||
This port does not support interrupts or a real timer (and hence no
|
||||
round robin scheduler) Otherwise, it is complete.
|
||||
|
||||
NOTE: This target will not run on Cygwin probably for many reasons but
|
||||
first off because it uses some of the same symbols as does cygwind.dll.
|
||||
|
||||
configs/c5471evm
|
||||
This is a port to the Spectrum Digital C5471 evaluation board. The
|
||||
C5471 is a dual core processor from TI with an ARM7TDMI general purpose
|
||||
|
||||
@@ -68,4 +68,9 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -248,6 +249,52 @@ CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
@@ -68,4 +68,7 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
@@ -152,6 +152,7 @@ CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -237,6 +238,52 @@ CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
@@ -68,4 +68,8 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
|
||||
@@ -176,6 +176,7 @@ CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -261,6 +262,52 @@ CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
@@ -68,4 +68,8 @@ ifeq ("${CONFIG_DEBUG}","y")
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
|
||||
11
configs/ntosd-dm320/README.txt
Normal file
11
configs/ntosd-dm320/README.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
README
|
||||
^^^^^^
|
||||
|
||||
The configuration netconfig may be used instead of the
|
||||
default configuration (defconfig). This configuration
|
||||
enables networking using the OSDs DM9000A ethernet
|
||||
interface.
|
||||
|
||||
Disclaimer: The NuttX network subsystem is a "work in
|
||||
progress" at this time and minimal network functionality
|
||||
should be expected.
|
||||
@@ -58,7 +58,7 @@ CONFIG_ARCH_CHIP=dm320
|
||||
CONFIG_ARCH_CHIP_DM320=y
|
||||
CONFIG_ARCH_BOARD=ntosd-dm320
|
||||
CONFIG_ARCH_BOARD_NTOSD_DM320=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=1250
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16945
|
||||
CONFIG_DRAM_SIZE=0x01000000
|
||||
CONFIG_DRAM_START=0x01000000
|
||||
CONFIG_DRAM_VSTART=0x00000000
|
||||
@@ -161,6 +161,7 @@ CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -246,6 +247,72 @@ CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Settings for examples/nettest
|
||||
CONFIG_EXAMPLE_NETTEST_IPADDR=(10<<24|0<<16|0<<8|2)
|
||||
CONFIG_EXAMPLE_NETTEST_DRIPADDR=(10<<24|0<<16|0<<8|1)
|
||||
CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
|
||||
CONFIG_EXAMPLE_NETTEST_CLIENTIP=(10<<24|0<<16|0<<8|1)
|
||||
|
||||
#
|
||||
# DM90x0 Driver Settings
|
||||
CONFIG_NET_DM90x0=n
|
||||
CONFIG_DM9X_NINTERFACES=1
|
||||
CONFIG_DM9X_STATS=1
|
||||
CONFIG_DM9X_BASE=0xd0000300
|
||||
CONFIG_DM9X_IRQ=27
|
||||
CONFIG_DM9X_BUSWIDTH8=n
|
||||
CONFIG_DM9X_BUSWIDTH16=y
|
||||
CONFIG_DM9X_BUSWIDTH32=n
|
||||
CONFIG_DM9X_CHECKSUM=n
|
||||
CONFIG_DM9X_ETRANS=n
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
#define GIO_KEY_SCAN3 4
|
||||
#define GIO_KEY_SCAN4 5
|
||||
#define GIO_MS_DETECT 5
|
||||
#define GIO_DM9000A_INT 6
|
||||
#define GIO_MMC_DETECT 8
|
||||
#define GIO_CFC_DETECT 9
|
||||
#define GIO_VIDEO_IN 10
|
||||
|
||||
338
configs/ntosd-dm320/netconfig
Normal file
338
configs/ntosd-dm320/netconfig
Normal file
@@ -0,0 +1,338 @@
|
||||
############################################################
|
||||
# defconfig
|
||||
#
|
||||
# Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################
|
||||
#
|
||||
# architecture selection
|
||||
#
|
||||
# CONFIG_ARCH - identifies the arch subdirectory and, hence, the
|
||||
# processor architecture.
|
||||
# CONFIG_ARCH_name - for use in C code. This identifies the
|
||||
# particular chip or SoC that the architecture is implemented
|
||||
# in.
|
||||
# CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory
|
||||
# CONFIG_ARCH_CHIP_name - For use in C code
|
||||
# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence,
|
||||
# the board that supports the particular chip or SoC.
|
||||
# CONFIG_ARCH_BOARD_name - for use in C code
|
||||
# CONFIG_ENDIAN_BIG - define if big endian (default is little endian)
|
||||
# CONFIG_BOARD_LOOPSPERMSEC - for delay loops
|
||||
# CONFIG_DRAM_SIZE - Describes the installed DRAM.
|
||||
# CONFIG_DRAM_START - The start address of DRAM (physical)
|
||||
# CONFIG_DRAM_VSTART - The startaddress of DRAM (virtual)
|
||||
# CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions
|
||||
#
|
||||
CONFIG_ARCH=arm
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_CHIP=dm320
|
||||
CONFIG_ARCH_CHIP_DM320=y
|
||||
CONFIG_ARCH_BOARD=ntosd-dm320
|
||||
CONFIG_ARCH_BOARD_NTOSD_DM320=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16945
|
||||
CONFIG_DRAM_SIZE=0x01000000
|
||||
CONFIG_DRAM_START=0x01000000
|
||||
CONFIG_DRAM_VSTART=0x00000000
|
||||
CONFIG_DRAM_NUTTXENTRY=0x01008000
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
|
||||
#
|
||||
# DM320 specific device driver settings
|
||||
#
|
||||
# CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the
|
||||
# console and ttys0 (default is the UART0).
|
||||
# CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received.
|
||||
# This specific the size of the receive buffer
|
||||
# CONFIG_UARTn_TXBUFSIZE - Characters are buffered before
|
||||
# being sent. This specific the size of the transmit buffer
|
||||
# CONFIG_UARTn_BAUD - The configure BAUD of the UART. Must be
|
||||
# CONFIG_UARTn_BITS - The number of bits. Must be either 7 or 8.
|
||||
# CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity
|
||||
# CONFIG_UARTn_2STOP - Two stop bits
|
||||
#
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
CONFIG_UART1_SERIAL_CONSOLE=n
|
||||
CONFIG_UART0_TXBUFSIZE=256
|
||||
CONFIG_UART1_TXBUFSIZE=256
|
||||
CONFIG_UART0_RXBUFSIZE=256
|
||||
CONFIG_UART1_RXBUFSIZE=256
|
||||
CONFIG_UART0_BAUD=115200
|
||||
CONFIG_UART1_BAUD=115200
|
||||
CONFIG_UART0_BITS=8
|
||||
CONFIG_UART1_BITS=8
|
||||
CONFIG_UART0_PARITY=0
|
||||
CONFIG_UART1_PARITY=0
|
||||
CONFIG_UART0_2STOP=0
|
||||
CONFIG_UART1_2STOP=0
|
||||
|
||||
#
|
||||
# General OS setup
|
||||
#
|
||||
# CONFIG_EXAMPLE - identifies the subdirectory in examples
|
||||
# that will be used in the build
|
||||
# CONFIG_DEBUG - enables built-in debug options
|
||||
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||
# CONFIG_MM_REGIONS - If the architecture includes multiple
|
||||
# regions of memory to allocate from, this specifies the
|
||||
# number of memory regions that the memory manager must
|
||||
# handle and enables the API mm_addregion(start, end);
|
||||
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||
# time console output
|
||||
# CONFIG_TICKS_PER_MSEC - The default system timer is 100Hz
|
||||
# or TICKS_PER_MSEC=10. This setting may be defined to
|
||||
# inform NuttX that the processor hardware is providing
|
||||
# system timer interrupts at some interrupt interval other
|
||||
# than 10 msec.
|
||||
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||
# this number of milliseconds; Round robin scheduling can
|
||||
# be disabled by setting this value to zero.
|
||||
# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
|
||||
# scheduler to monitor system performance
|
||||
# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
|
||||
# task name to save in the TCB. Useful if scheduler
|
||||
# instrumentation is selected. Set to zero to disable.
|
||||
# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY -
|
||||
# Used to initialize the internal time logic.
|
||||
# CONFIG_JULIAN_TIME - Enables Julian time conversions
|
||||
# CONFIG_DEV_CONSOLE - Set if architecture-specific logic
|
||||
# provides /dev/console. Enables stdout, stderr, stdin.
|
||||
#
|
||||
#CONFIG_EXAMPLE=uip
|
||||
CONFIG_EXAMPLE=nettest
|
||||
CONFIG_DEBUG=n
|
||||
CONFIG_DEBUG_VERBOSE=n
|
||||
CONFIG_MM_REGIONS=1
|
||||
CONFIG_ARCH_LOWPUTC=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_INSTRUMENTATION=n
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
CONFIG_START_YEAR=2007
|
||||
CONFIG_START_MONTH=2
|
||||
CONFIG_START_DAY=13
|
||||
CONFIG_JULIAN_TIME=n
|
||||
CONFIG_DEV_CONSOLE=y
|
||||
|
||||
#
|
||||
# The following can be used to disable categories of
|
||||
# APIs supported by the OS. If the compiler supports
|
||||
# weak functions, then it should not be necessary to
|
||||
# disable functions unless you want to restrict usage
|
||||
# of those APIs.
|
||||
#
|
||||
# There are certain dependency relationships in these
|
||||
# features.
|
||||
#
|
||||
# o mq_notify logic depends on signals to awaken tasks
|
||||
# waiting for queues to become full or empty.
|
||||
# o pthread_condtimedwait() depends on signals to wake
|
||||
# up waiting tasks.
|
||||
#
|
||||
CONFIG_DISABLE_CLOCK=n
|
||||
CONFIG_DISABLE_POSIX_TIMERS=n
|
||||
CONFIG_DISABLE_PTHREAD=n
|
||||
CONFIG_DISABLE_SIGNALS=n
|
||||
CONFIG_DISABLE_MQUEUE=n
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
#
|
||||
# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a
|
||||
# little smaller if we do not support fieldwidthes
|
||||
#
|
||||
CONFIG_NOPRINTF_FIELDWIDTH=n
|
||||
|
||||
#
|
||||
# Allow for architecture optimized implementations
|
||||
#
|
||||
# The architecture can provide optimized versions of the
|
||||
# following to improve sysem performance
|
||||
#
|
||||
CONFIG_ARCH_MEMCPY=n
|
||||
CONFIG_ARCH_MEMCMP=n
|
||||
CONFIG_ARCH_MEMMOVE=n
|
||||
CONFIG_ARCH_MEMSET=n
|
||||
CONFIG_ARCH_STRCMP=n
|
||||
CONFIG_ARCH_STRCPY=n
|
||||
CONFIG_ARCH_STRNCPY=n
|
||||
CONFIG_ARCH_STRLEN=n
|
||||
CONFIG_ARCH_BZERO=n
|
||||
CONFIG_ARCH_KMALLOC=n
|
||||
CONFIG_ARCH_KZMALLOC=n
|
||||
CONFIG_ARCH_KFREE=n
|
||||
|
||||
#
|
||||
# General build options
|
||||
#
|
||||
# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
|
||||
# BSPs from www.ridgerun.com
|
||||
#
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
|
||||
#
|
||||
# Sizes of configurable things (0 disables)
|
||||
#
|
||||
# CONFIG_MAX_TASKS - The maximum number of simultaneously
|
||||
# active tasks. This value must be a power of two.
|
||||
# CONFIG_MAX_TASK_ARGS - This controls the maximum number of
|
||||
# of parameters that a task may receive (i.e., maxmum value
|
||||
# of 'argc')
|
||||
# CONFIG_NPTHREAD_KEYS - The number of items of thread-
|
||||
# specific data that can be retained
|
||||
# CONFIG_NFILE_DESCRIPTORS - The maximum number of file
|
||||
# descriptors (one for each open)
|
||||
# CONFIG_NFILE_STREAMS - The maximum number of streams that
|
||||
# can be fopen'ed
|
||||
# CONFIG_NAME_MAX - The maximum size of a file name.
|
||||
# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate
|
||||
# on fopen. (Only if CONFIG_NFILE_STREAMS > 0)
|
||||
# CONFIG_NUNGET_CHARS - Number of characters that can be
|
||||
# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0)
|
||||
# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message
|
||||
# structures. The system manages a pool of preallocated
|
||||
# message structures to minimize dynamic allocations
|
||||
# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
|
||||
# a fixed payload size given by this settin (does not include
|
||||
# other message structure overhead.
|
||||
# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
|
||||
# can be passed to a watchdog handler
|
||||
# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
|
||||
# structures. The system manages a pool of preallocated
|
||||
# watchdog structures to minimize dynamic allocations
|
||||
# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX
|
||||
# timer structures. The system manages a pool of preallocated
|
||||
# timer structures to minimize dynamic allocations. Set to
|
||||
# zero for all dynamic allocations.
|
||||
#
|
||||
CONFIG_MAX_TASKS=64
|
||||
CONFIG_MAX_TASK_ARGS=4
|
||||
CONFIG_NPTHREAD_KEYS=4
|
||||
CONFIG_NFILE_DESCRIPTORS=32
|
||||
CONFIG_NFILE_STREAMS=16
|
||||
CONFIG_NAME_MAX=32
|
||||
CONFIG_STDIO_BUFFER_SIZE=1024
|
||||
CONFIG_NUNGET_CHARS=2
|
||||
CONFIG_PREALLOC_MQ_MSGS=32
|
||||
CONFIG_MQ_MAXMSGSIZE=32
|
||||
CONFIG_MAX_WDOGPARMS=4
|
||||
CONFIG_PREALLOC_WDOGS=32
|
||||
CONFIG_PREALLOC_TIMERS=8
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=y
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=8
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=y
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Settings for examples/nettest
|
||||
CONFIG_EXAMPLE_NETTEST_IPADDR=(10<<24|0<<16|0<<8|2)
|
||||
CONFIG_EXAMPLE_NETTEST_DRIPADDR=(10<<24|0<<16|0<<8|1)
|
||||
CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
|
||||
CONFIG_EXAMPLE_NETTEST_CLIENTIP=(10<<24|0<<16|0<<8|1)
|
||||
|
||||
#
|
||||
# DM90x0 Driver Settings
|
||||
CONFIG_NET_DM90x0=y
|
||||
CONFIG_DM9X_NINTERFACES=1
|
||||
CONFIG_DM9X_STATS=1
|
||||
CONFIG_DM9X_BASE=0xd0000300
|
||||
CONFIG_DM9X_IRQ=27
|
||||
CONFIG_DM9X_BUSWIDTH8=n
|
||||
CONFIG_DM9X_BUSWIDTH16=y
|
||||
CONFIG_DM9X_BUSWIDTH32=n
|
||||
CONFIG_DM9X_CHECKSUM=n
|
||||
CONFIG_DM9X_ETRANS=n
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
# CONFIG_BOOT_FROM_FLASH - Some configurations support XIP
|
||||
# operation from FLASH.
|
||||
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
|
||||
# all stack operations outside of the nuttx model.
|
||||
# CONFIG_STACK_POINTER - The initial stack pointer (arm7tdmi only)
|
||||
# CONFIG_PROC_STACK_SIZE - The size of the initial stack
|
||||
# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size
|
||||
# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size
|
||||
# CONFIG_HEAP_BASE - The beginning of the heap
|
||||
# CONFIG_HEAP_SIZE - The size of the heap
|
||||
#
|
||||
CONFIG_BOOT_FROM_FLASH=n
|
||||
CONFIG_CUSTOM_STACK=n
|
||||
CONFIG_STACK_POINTER=
|
||||
CONFIG_PROC_STACK_SIZE=4096
|
||||
CONFIG_PTHREAD_STACK_MIN=256
|
||||
CONFIG_PTHREAD_STACK_DEFAULT=4096
|
||||
CONFIG_HEAP_BASE=
|
||||
CONFIG_HEAP_SIZE=
|
||||
@@ -40,7 +40,7 @@ CFLAGS += -I$(TOPDIR)/sched
|
||||
|
||||
ASRCS =
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
CSRCS = up_leds.c
|
||||
CSRCS = up_leds.c up_network.c
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
|
||||
104
configs/ntosd-dm320/src/up_network.c
Normal file
104
configs/ntosd-dm320/src/up_network.c
Normal file
@@ -0,0 +1,104 @@
|
||||
/****************************************************************************
|
||||
* board/up_network.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_DM90x0)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#include "dm320_memorymap.h"
|
||||
#include "dm320_emif.h"
|
||||
#include "dm320_gio.h"
|
||||
|
||||
extern void dm9x_initialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_netinitialize
|
||||
****************************************************************************/
|
||||
|
||||
void up_netinitialize(void)
|
||||
{
|
||||
/* CS4 is used for DM9000A Ethernet. Interrupt is provided via GIO6
|
||||
* which must be configured to interrupt on the rising edge. Bus
|
||||
* width is 16-bits.
|
||||
*/
|
||||
|
||||
lldbg("CS4CTRL1=%04x CS4CTRL2=%04x\n",
|
||||
getreg16(DM320_EMIF_CS4CTRL1), getreg16(DM320_EMIF_CS4CTRL2));
|
||||
|
||||
/* It is assumed that bootloader has already configured CS4. Here,
|
||||
* we will only make certain that the GIO is properly configured
|
||||
*/
|
||||
|
||||
GIO_INPUT(GIO_DM9000A_INT);
|
||||
GIO_NONINVERTED(GIO_DM9000A_INT);
|
||||
GIO_INTERRUPT(GIO_DM9000A_INT);
|
||||
GIO_RISINGEDGE(GIO_DM9000A_INT);
|
||||
|
||||
lldbg("GIO DIR0=%04x INV0=%04x IRQPORT=%04x IRQEDGE=%04x\n",
|
||||
getreg16(DM320_GIO_DIR0), getreg16(DM320_GIO_INV0),
|
||||
getreg16(DM320_GIO_IRQPORT), getreg16(DM320_GIO_IRQEDGE));
|
||||
|
||||
/* Then initialize the driver */
|
||||
|
||||
dm9x_initialize();
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET && CONFIG_NET_DM90x0 */
|
||||
@@ -62,4 +62,9 @@ OBJEXT = .rel
|
||||
LIBEXT = .lib
|
||||
EXEEXT = .hex
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ CONFIG_DISABLE_PTHREAD=y
|
||||
CONFIG_DISABLE_SIGNALS=y
|
||||
CONFIG_DISABLE_MQUEUE=y
|
||||
CONFIG_DISABLE_MOUNTPOINT=y
|
||||
CONFIG_DISABLE_ENVIRON=y
|
||||
|
||||
#
|
||||
# Misc libc settings
|
||||
@@ -234,6 +235,52 @@ CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_PREALLOC_WDOGS=4
|
||||
CONFIG_PREALLOC_TIMERS=0
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
# CONFIG_NET - Enable or disable all network features
|
||||
# CONFIG_NET_IPv6 - Build in support for IPv6
|
||||
# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread.
|
||||
# CONFIG_NET_MAX_CONNECTIONS - Maximum number of TCP connections (all tasks)
|
||||
# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks)
|
||||
# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options
|
||||
# CONFIG_NET_BUFFER_SIZE - uIP buffer size
|
||||
# CONFIG_NET_LOGGING - Logging on or off
|
||||
# CONFIG_NET_UDP - UDP support on or off
|
||||
# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off
|
||||
# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections
|
||||
# CONFIG_NET_STATISTICS - uIP statistics on or off
|
||||
# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address
|
||||
# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window
|
||||
# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table
|
||||
# CONFIG_NET_BROADCAST - Broadcast support
|
||||
# CONFIG_NET_LLH_LEN - The link level header length
|
||||
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
|
||||
CONFIG_NET=n
|
||||
CONFIG_NET_IPv6=n
|
||||
CONFIG_NSOCKET_DESCRIPTORS=0
|
||||
CONFIG_NET_MAX_CONNECTIONS=40
|
||||
CONFIG_NET_MAX_LISTENPORTS=40
|
||||
CONFIG_NET_SOCKOPTS=y
|
||||
CONFIG_NET_BUFFER_SIZE=420
|
||||
CONFIG_NET_LOGGING=y
|
||||
CONFIG_NET_UDP=n
|
||||
CONFIG_NET_UDP_CHECKSUMS=y
|
||||
#CONFIG_NET_UDP_CONNS=10
|
||||
CONFIG_NET_STATISTICS=y
|
||||
#CONFIG_NET_PINGADDRCONF=0
|
||||
#CONFIG_NET_RECEIVE_WINDOW=
|
||||
#CONFIG_NET_ARPTAB_SIZE=8
|
||||
CONFIG_NET_BROADCAST=n
|
||||
#CONFIG_NET_LLH_LEN=14
|
||||
#CONFIG_NET_FWCACHE_SIZE=2
|
||||
|
||||
#
|
||||
# UIP Network Utilities
|
||||
# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP
|
||||
# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries
|
||||
CONFIG_NET_DHCP_LIGHT=n
|
||||
CONFIG_NET_RESOLV_ENTRIES=4
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user