Commit graph

463 commits

Author SHA1 Message Date
Piotr Mienkowski 323db1e366 drivers: eth_sam_gmac: Make sure not to leak net_buf in RX
Check net_recv_data() return value, if it returns an error release
the net_buf. Based on a fix in eth_mcux driver.

Change-Id: I44ca5fd8dfb7175620b7e8850a68443100039db6
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-13 15:21:43 +03:00
Jukka Rissanen 909069d2c7 drivers/eth/mcux: Make sure not to leak net_buf in RX
Check net_recv_data() return value and if it returns an error
then release the net_buf in order to avoid leaking it.

Coverity-CID: 158884

Change-Id: I10d411a2de4b7c7bbe2475df65d93f5b1e619679
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:41 +03:00
Piotr Mienkowski afdb0e0a70 drivers: eth_sam_gmac: Fix initialization order
Atmel SAM family GMAC Ethernet driver is implementing zero-copy
networking. As a result it has to reserve a defined amount of RX
data net buffers before bringing up the interface. Since net buffer
pool is initialized by the network stack and this driver was bringing
the interface up in its initialization function the driver initialization
was performed, as a workaround, after network stack initialization. It
is not a clean solution. This patch fixes this by bringing the
interface up in interface initialization function. The driver itself
can now be initialized before the network stack is.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I65886fd6db6f27a10628e393cfabd8e5f78c08ff
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-07 12:35:51 +03:00
Piotr Mienkowski 816fdae44d drivers: eth_sam_gmac: remove possible null pointer dereference
Fix eth_tx function which was dereferencing a pointer before
checking that it is not null.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: Idae4cf9d9a80f6ee9f74a94dd1debe7511c5fab4
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-07 12:35:49 +03:00
Maureen Helm aa9c14667b ext: mcux: Update to mcux 2.2 for k64
Updates the mcux drivers and device header files for the k64 from mcux
2.1 to mcux 2.2. Updates the k6x soc init and ethernet shim driver to
reflect mcux interface changes.

Origin: NXP MCUXpresso SDK 2.2
URL: mcux.nxp.com
Maintained-by: External

Change-Id: Icb578dddbe84c190e990b756193bef621010a898
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-27 09:05:58 -05:00
Piotr Mienkowski c54b3c7e8f drivers: Update Atmel SAM family GMAC Ethernet driver
Networking stack has split one global DATA pool to RX and TX DATA pools
and also added net_buf pool support to each context. Update the driver
to support this new design. Since the GMAC TX descriptor list has a fixed
size but the number of TX DATA buffers is no longer limited updating the
TX descriptor list has to be guarded by a semaphore.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I181e1cdd183e173b85d5d1711b6e78cd5165666d
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-03-17 10:34:44 +02:00
Paul Sokolovsky f1a919187e drivers: eth_enc28j60: Clarify comments in the header file.
Change-Id: Idfac3e6718a2be135e0b4c7f32aad0ddccf18e3c
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-03-13 18:02:34 +03:00
Marcus Shawcroft d261385ed4 eth/mcux: Turn down the PHY debug verbosity.
The PHY debug code is useful while working specifically with the PHY
state machine, but in general the frequent, periodic nature of the
output is a hinderance.  Turn down the verbosity, leave a local define
available for anyone who specifically needs to see the PHY state
machine debug.

Change-Id: I40e59b6df5c29702813d3a554ea9e795a3761c65
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:47 +02:00
Marcus Shawcroft 43a19bd322 eth/mcux: Fix Kconfig help formatting.
Change-Id: I3d3ff448ca866a2c970d87b4c9f25fc40549c36b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:47 +02:00
Juan Manuel Cruz 26b014800b drivers: enc28j60: buffer reception waits timeout
The enc28j60's reception routine requires a timeout
for a buffer assignation. The timeout is configurable
to allow a per application fine tuning.

The effect that K_NO_WAIT currently has is that there are frames
lost everytime that a buffer is required and there are none
available.

Jira: ZEP-1169

Change-Id: Ia18736fd85daee51fe1c2304977209cc7f0038b5
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:46 +02:00
Jukka Rissanen 5197266768 net: nbuf: Use net_nbuf_get_frag() to allocate a fragment
The code used net_nbuf_get_reserve_{rx|tx}_data() function to
allocate a fragment. Instead of that low level function, use
net_nbuf_get_frag() instead. There are few places this is not
possible or is too big change like in few test programs.

Change-Id: Ied7e2b7db352de998b200ffa6ff82471bfa5ebe3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen d32503f57e net: nbuf: Split one global DATA pool to RX and TX DATA pools
If we receive lot of packets, it might happen that we exhaust
all the DATA buffers in the system. This would prevent from
us sending anything to the network.
Change this by splitting the DATA buffer pool into RX and TX
parts. This way RX flooding cannot consume all DATA buffers
that needs to be sent.

Change-Id: I8e8934c6d5fdd47b579ffa6268721b5eb3d64b6d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Marcus Shawcroft e82818c59b eth/eth_mcux: Make promiscous mode configurable.
Provide a configuration option for promiscuous mode.

Promiscuous mode provides a convenient workaround for ZEP-1673 however
it generates significant demand for RX buffers on a loaded network.
Add a configuration option to conveniently enable / disable.

The Kconfig defaults promiscuous on to workaroudn 1673, once that
issue is resolved the default logic on NET_IPV6 will be dropped.

Change-Id: I6929aca70d7bd88ce88c65d6654d664ea6653b66
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:42 +02:00
Marcus Shawcroft e675352e10 eth/eth_mcux: Provide start and stop operations on the PHY driver.
Refactor the PHY state machine and add support for explicit start and
stop.

The stop implementation remains partial, the state machine will enter
a disabled state but will not actual attempt to power down the PHY.
This is deliberate, while implementing this it has become apparent
that issuing a PHY power down command is an effective way of bricking
frdm-k64f boards, hence explicit power down deliberately disabled
until the issue is properly understood.

Change-Id: I846a51b0ac48feed35d260cf20b50f4f1ac59298
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-27 10:28:55 +02:00
Marcus Shawcroft d9dfd503df eth/eth_mcux: Provide phy state name printing in debug
Change-Id: I07cb7d9958b00b94ed7e7801d6b8c0eb421ce4bf
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-27 10:28:55 +02:00
Jukka Rissanen 4eb2020055 net: Set the network link address type when setting link address
The interface L2 address type is set at the same time as the
L2 address is set to the network interface. This is most
convinient place to set the address type.

Change-Id: I712d7357d075959eb79df3463141cfbc6d163a74
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-22 17:28:25 +02:00
Paul Sokolovsky 5035f97686 eth/mcux: Add temporary workaround to unbreak IPv6 ND features.
This is a workaround for lack of driver API support for multicast
management. So, instead we want to receive all multicast frames
"by default", or otherwise basic IPv6 features, like address
resolution, don't work. On Kinetis Ethernet controller, that
translates to enabling promiscuous mode. The real fix depends
on ZEP-1673.

Change-Id: I98a27584be65bdc405de005383eb30bad2a7fcfc
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-02-14 08:30:35 +02:00
Marcus Shawcroft bbada2de50 eth/mcux: Add basic PHY support.
Add basic PHY management sufficient to detect link up, link down and
auto negotiated link speed / duplex.  The PHY driver is implemented as
a state machine that executed in the system work queue.  The
implementation is non blocking, using the MII interrupt to capture the
completion of read and write events.

This PHY management should be fairly generic. In the future, it may be
beneficial to pull this code out as a standalone PHY driver for use
with other ethernet drivers.

JIRA: ZEP-1674

Change-Id: I3dcb5c14982ef4b40591fcf10d84840b8a2558e5
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-14 08:30:34 +02:00
Jukka Rissanen bd3908b2a9 net: nbuf: Add timeout to net_buf getters
This commit changes the net_buf getter functions in nbuf.h
by adding a timeout parameter. These function prototypes
are changed to accept a timeout parameter.
	net_nbuf_get_rx()
	net_nbuf_get_tx()
	net_nbuf_get_data()
	net_nbuf_get_reserve_rx()
	net_nbuf_get_reserve_tx()
	net_nbuf_get_reserve_data()
	net_nbuf_copy()
	net_nbuf_copy_all()
	net_nbuf_push()
	net_nbuf_append()
	net_nbuf_write()
	net_nbuf_insert()

Following convinience functions have not been changed
	net_nbuf_append_u8
	net_nbuf_append_be16
	net_nbuf_append_be32
	net_nbuf_insert_u8
	net_nbuf_insert_be16
	net_nbuf_insert_be32
	net_nbuf_write_u8
	net_nbuf_write_be16
	net_nbuf_write_be32
so they call the base function using K_FOREVER. Use the
base function if you want to have a timeout when net_buf
is allocated.

Change-Id: I20bb602ffb73069e5a02668fce60575141586c0f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Jukka Rissanen b4ca6e8300 drivers/eth/mcux: Free net_buf using net_nbuf_unref
The driver was using net_buf_unref(). This technically works
ok but debugging the network buffer allocations is more
difficult if done like this.

Change-Id: If3453a49337c7a359c8af22cfdf331fccc697af5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:34 +02:00
Juan Manuel Cruz 35011815f3 drivers: enc28j60: Enables reception of multicast packets
Jira: ZEP-1544

Change-Id: I96a7f9cd40612c1eaebac79845f4a3157a8f7457
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2017-02-08 10:12:34 +02:00
Sergio Rodriguez 1bbfd3effe driver: ethernet: Fix typo on enc28j60 driver Kconfig
Change-Id: Ie7178db2da5e4de476192516dfb9ff3a5e8f082a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-02-03 15:59:14 +02:00
Anas Nashif 9f004d9b7c drivers: make ethernet init prio depend on NET_L2_ETHERNET
Change-Id: I5e72e7ba53e65e5ebc2b41fa30b84513fe10c998
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-02 14:43:51 +00:00
Piotr Mienkowski d519ef17b7 drivers: Add Atmel SAM family GMAC Ethernet driver
This is a zero-copy networking implementation of Ethernet driver.

Limitations:
- one shot PHY setup, no support for PHY disconnect/reconnect
- no support for devices with DCache enabled due to missing
  non-cacheable RAM regions in Zephyr.

Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-1492
Change-Id: Ib944f91193efbd12c1142b0bcf1f635388bf1b87
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-02-01 21:01:19 +00:00
Flavio Santes 1c21029237 drivers/ethernet: Update default GPIO pin for the ENC28J60 module
All sample applicatons in Zephyr, using the ENC28J60 driver, set
the ETH_ENC28J60_0_GPIO_PIN Kconfig variable to 19.
However, in the Kconfig.enc28j60 file this variable is set to 24.
That default value, 24, was used only during the first iterations
of this driver and never used again.

In this patch, we set the Kconfig variable to 19 and simplify
project configuration files by removing one line.

Change-Id: I3d5fd9da04a3f10845d2a409de56f5b9c235e995
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-20 16:23:17 +02:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Maureen Helm 40f5de5a56 ethernet: Rename ksdk to mcux
Renames the ksdk ethernet shim driver to mcux.

Change-Id: Ief03eabe4ce39be0d0896543c1cb660ff380b439
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:26 -06:00
Anas Nashif 3d8e86c12c drivers: eliminate nano/micro kernel usage
Jira: ZEP-1415

Change-Id: I4a009ff57edb799750175aef574a865589f96c14
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-21 18:45:02 +00:00
Marcus Shawcroft 6a1632ed26 eth/ksdk: Use k_sem instead of nano_sem
Change-Id: I6b024f6054dede28b74f97102d80ef50f9e45a04
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-21 12:58:11 +00:00
Marcus Shawcroft 4ede76a6f9 eth/ksdk: Use k_sem_init() initial count
Remove the existing code that iterates over k_sem_give() and setup the
initial counter directly, take the opportunity to set the maximum count.

Change-Id: Ib91ea263567ff761e4953c142a22a56658efe293
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-21 12:58:11 +00:00
Marcus Shawcroft f655da2b5e eth/enc28j60: CONFIG_ETHERNET no longer exists.
Change-Id: Ia011aa0ebbf4834bc068564d01cde3309f28a2a4
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-20 13:47:33 +00:00
Marcus Shawcroft 9094fdb8c4 eth/config: Group ethernet driver configuration into one menu.
Change-Id: Ieff568916f2c0428719e3e217ce0ca1ddf2908ff
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-20 13:47:32 +00:00
Anas Nashif a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +00:00
Tomasz Bursztyka 4687648a26 drivers: eth_ksdk: Simplifying MAC address generation
The ethernet controller being a freescale one, let's use its OUI. Then
only 3 bytes are needed for generating the rest of the MAC address.

Also, generating the MAC address in the right order.

Change-Id: Id3346ef44f8c24edc2e23dee6ac0581ac58cf4ff
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka 943d55d116 drivers: eth_ksdk: There is a unique L2 driver
Removing useless defines for L2 layer driver.

Change-Id: I53ba6268d8716f293eada29a192fc63324f02523
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka 6480594f0a drivers: eth_ksdk: Theres is no longer 'ETHERNET' Kconfig option
Only NET_L2_ETHERNET now.

Change-Id: Ic9bb3c57e0f91c7eeb53cbbfddab085c723a4a5a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka c1e52674d7 drivers: enc28j60: Removing useless legacy driver
Left over from old IP stack it seems.

Change-Id: Ic7ce731b8661294125fa0e0e058570aeff7b97cf
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka b94042d93b drivers: enc28j60: Expose RX thread stack size and prio config
Such stack size might vary if debug is enabled or not and depending also
on other factors. Let's do the same for priority as well, putting it to
high prio as default (15 is way too low level).

Change-Id: I16afab33895085bacdef087fe70adeb1ae3ca2ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka 214970a3a5 drivers: enc28j60: Add logging
Adding relevant error, debug and informational messages.

Change-Id: I0457395a3ac10164f08b3bab0416b769762c6c5a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka 3e62dfbc22 drivers: ennc28j60: There is a unique L2 driver
Removing unrelevant defines for L2 layer driver.

Change-Id: Iae0f11291f4c19134228ccd976127e7f0f0b635f
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka c38f1e78eb drivers: enc28j60: Fix one tiny naming issue
ll_len means link layer length, but it's misleading here as ll_len is
the whole net buffer length: reserved ll length + payload length.

Change-Id: If7ec0fc950245d370fa0f82ae1050b05c11c7b90
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka 28255fa014 drivers: enc28j60: Fix a Kconfig comment
s/I2C/SPI obviously

Change-Id: Ia589869694137f5e5302869349a39d090a8fee1d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka 7d6c50d1d0 drivers: enc28j60: Fix a tiny style issue
Change-Id: I39e9caae812903823ed2cdd7ee6510d5bd633820
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka d882e24002 drivers: ethernet: Enable sys log levels depending on NET_ETHERNET_L2
ETHERNET is a left-over from old and now unavailable IP stack.

Change-Id: I488d9ffcfb1fe3589b522dc2d620873daeb892c8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka 58c34af329 drivers: ethernet: Push DW specific Kconfig options to its own file
Note: This driver need to be ported to new native IP stack in order to
be available again.

Change-Id: I7825c8679e66f8a1d44d75c9d53e9da207b743af
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Tomasz Bursztyka aa2c4ec452 drivers: enc28j60: Let's remove the CRC in the end of the frame
At this point, if the frame was accepted by the controller, it means
that CRC was valid. Thus, there is no reason to get it in the buffer.
Let's just pop it out from controller's memory.

Jira: ZEP-1361

Change-Id: Ic8681c77b0afa30583c7fae281db1a89ff97ed2b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:54 +01:00
Johan Hedberg 30277538e7 drivers/ethernet: Fix SYS_LOG_DBG format specifier for MAC
The SYS_LOG macros now map to printk by default, and printk doesn't
(currently) support %2.2x, rather %02x needs to be used instead (it
gives the same result).

Change-Id: I0f7a5b7da91afba0c970bce7e2680de40c917bd3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-07 18:45:17 +02:00
Jukka Rissanen 68ea9377e6 net: Make native IP stack the default
As the native IP stack is now the default, there is no need
for corresponding Kconfig option.

Change-Id: I08e4992f540f928a2b7378e8803e634e38725348
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen 6b43821f20 net: Remove legacy Contiki based uIP stack
This commit removes the legacy Contiki based uIP stack.
The new native IP stack must be used after this commit.

The commit also removes following things:
- legacy cc2520 driver
- legacy ethernet drivers
- legacy IP stack samples

and changes these things:
- disabled tests that only work for legacy IP stack
- select new IP stack by default
- enable random number generator by default as it is needed
  by the new IP stack

Change-Id: I1229f9960a4c6654e9ccc6dac14a7efb9394e45d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen f2b7492269 ethernet: Add driver initialization priority to Kconfig
The default kernel init priority is too low. Make this
configurable and set the default priority so that the
ethernet driver is started just before the network stack.

This commit adds generic ethernet priority and changes
currently available ethernet drivers to use it.

Change-Id: If695e52b6dd9ea227f10ba306bb145d72d2312b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Mahavir Jain e12d73e45e ethernet: enc28j60: use unified kernel interface
Remove legacy kernel interface and use unified APIs

Change-Id: I8e99aa5399707a28a326e8abfa8725079de31be6
Signed-off-by: Mahavir Jain <mjain@marvell.com>
2016-12-02 12:41:17 +02:00
Juan Manuel Cruz 9e36897455 ethernet: enc28j60: fixes an issue caused during an internal rebase.
The original commit:

https://gerrit.zephyrproject.org/r/#/c/6256/

has changed because an internal rebase. Two lines adding an SPI
command are missing.
This commit adds back the missing lines.

Change-Id: I5cbeda73ef1eae5eb98dfa3b7f3086b7438da9a9
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:41:15 +02:00
Jukka Rissanen 0f8be63d8e ethernet: ksdk: Use unified kernel API
Dropping legacy API.

Change-Id: Id3d0b3e4ac7834e78a4d70ee5c99c6998958921e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Flavio Santes 69d9dfb027 net/eth: Fix priority value for the ENC28j60 Ethernet driver
Current value (100) is outside the default values: 0 - 15.

Jira: ZEP-1231

Change-Id: Ib3120b52e6eb3d95b369debd7df541fa2b0dfa6e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:41:04 +02:00
Paul Sokolovsky ad064e1434 eth: ksdk: Protect Ethernet frame buffer operations with IRQ lock.
As there's a single intermediate frame buffer used by both RX and TX
routines, protect operations on it with irq_lock() to avoid possibility
that it will be concurrently modified.

Change-Id: Ibbaf882a15fbb193054dbb13ae848becf9deef3f
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:41:01 +02:00
Paul Sokolovsky 8b1769a923 eth: ksdk: Update driver for native IP stack.
This updates driver for Kinetis SDK Ethernet device (used for example
by BOARD=frdm_k64f) to work with native Zephyr IP stack driver model.
The conversion is done based on the template of eth_enc28j60.c.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ifb0c7d3f921d663d00a2ded89ecdf2336b6e3783
2016-12-02 12:41:01 +02:00
Sergio Rodriguez 20424d5cc6 enc28j60: Fixes change to proper register bank
The register being set before checking the count of the remaining
packets is incorrect, so this code fixes it by setting the proper
register bank before access

Jira: ZEP-1138

Change-Id: Id49ee8439665ff69786f22e13e0d94a2148e4ae7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz 9f1a656511 enc28j60: Fixes an issue with concurrent tx and rx
The ENC28J60 hardware module does not support concurrent
transmission and reception.
This fix adds a control semaphore to exclude the execution
of both processes.

Applies the equivalent changes to the legacy driver.

Jira: ZEP-1097

Change-Id: I9602195d5a97f8d4bf652753c284d61f192357fe
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz d0cf3deb96 enc28j60: Improves interface with native IP stack
Tranmission:  Consider that fragments are no adjacent.

Reception:    Consider receiving data in more than one fragment.

SPI routines: Align SPI fragment size with default buffer fragment
              size (128 bytes) for better performance.

Change-Id: I51fc25d8540c36f3719e617a6f33cdea3f63032c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz 39779184ad enc28j60: Fixes a reception issue for big frames.
Everytime the devices receives a frame with odd length it will
add an extra byte of padding to the reception buffer.

This was causing and issue when receiving frames above 64 bytes
length and with odd length.

This commit pops the extra padding byte everytime the received
frame has an odd length.

The equivalent fix is applied to the legacy driver.

Jira: ZEP-1098

Change-Id: Ib93cbcdcf11f3812961b6702f1b7fa621590aab2
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz a8bb46f0ec enc28j60: Fixes an issue reading/writing from spi
When the driver receives or transmits a frames with a length
that is multiple of MAX_BUFFER_LENGTH the last block would be
read/sent twice to spi because a missed calculation on
num_remaining.

The issue is fixed by controling when the remaining bytes are
written/read into the spi device and by setting the spi command
on each spi write/read attempt.

The fix is applied to the legacy driver as well.

Jira: ZEP-1098

Change-Id: Icb2195d74e34dcbcf0c70531da9886ca315bd78b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Juan Manuel Cruz f63f2f4b97 enc28j60: The MAX_BUFFER_LENGTH is now declared in header.
The MAX_BUFFER_LENGTH symbols is now declared in the
eth_ecn28j60_priv.h file.

The legacy driver does not need this declaration here anymore.

Change-Id: I396fe92dbf5679c64183e25fa8b8d342c7f30dae
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:58 +02:00
Jukka Rissanen a559ad37c2 eth: enc28j60_legacy: Make driver config_info structure const.
Change-Id: Ic3aac209024bd9a6e8456b228705b39e88179b01
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:51 +02:00
Juan Manuel Cruz Alcaraz 8d6206c9be enc28j60: Adapt driver for native IP stack
Jira: ZEP-859

Change-Id: I7a073168a2bfba95291e43b227ffb6bfea1f5692
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:50 +02:00
Juan Manuel Cruz 3e1d001f9b enc28j60: Fixes an issue reading/writing long frames from SPI
Jira: ZEP-1302
Change-Id: Ia58d51aee14281aaeb2f8e85fbbf8c250eae8e06
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:19:21 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
Marcus Shawcroft 670f7328e8 driver/eth_ksdk: Limit name space, add static.
Change-Id: I45bad57f7a120c74c072287963a2c43f081bcea3
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:05 +00:00
Marcus Shawcroft ab7a768a18 driver/eth_dw: Limit name space, add static.
Change-Id: If9de0bec8bafb66119e158782cf9618143dc2a52
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:05 +00:00
Marcus Shawcroft 741d4751b2 driver/enc28j60: Limit name space, add static.
Change-Id: Ibf03dbb5134df81ca26aebe1e0518f1973789952
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-26 20:51:04 +00:00
Marcus Shawcroft 6ae68cc36a drivers/eth_enc28j60: Make driver_api structure const.
Change-Id: I7b479bc1ab5805f83bf880d5db3db8f4fad52e1d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:23 +00:00
Marcus Shawcroft b8f0de0e43 eth: enc28j60: Make driver config_info structure const.
Change-Id: Ib36cc9a2a1e72539196803d4a0bf61453d1a4b25
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:46 +00:00
Marcus Shawcroft df4b8d3915 eth: dw: Make driver config_info structure const.
Change-Id: I4b3a86c29c28cee09547973e85ea55489c5cc489
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:45 +00:00
Marcus Shawcroft fded21ab45 eth/dw: Move RW objects from device config_info to device driver_data.
Mutable driver state relocated from config_info to driver_info.  This
driver supports PCI enumeration.  We drop code that attempts to update
irq_num based on PCI enumeration because the interrupt found by PCI
enumeration must always be the same as the statically configured IRQ
number.

Change-Id: I5580b0ba95635696a825fe66dbf16259c54d5ba8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-19 12:10:59 +00:00
Marcus Shawcroft 87077727bf eth: Add KSDK ENET driver.
Provide a network driver wrapped around the KSDK ENET and PHY
drivers.

The driver performs one shot PHY setup.  There is no support for PHY
disconnect, reconnect or configuration change.  The PHY setup,
implement via KSDK contains polled code that can block the
initialization thread for a few seconds.

There is no statistics collection for either normal operation or error
behaviour.

Origin: Original

Change-Id: Ia0f2e89a61348ed949976070353e823c178fcb24
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-16 09:57:35 +00:00
Marcus Shawcroft ec7d259fa3 eth/enc28j60: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I75e51f396ce9dbe5d9f2339b551c142a5afcbfce
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-08 11:40:13 +00:00
Marcus Shawcroft 352ef5f033 eth: Rework LOG_ETHERNET_LEVEL config description.
Generalize the LOG_ETHERNET_LEVEL configuration parameter for use with
multiple ethernet drivers.

Change-Id: I26bc2189c8cf79db19f59e8082caec03b0d9c7b8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-05 11:29:37 +00:00
Kumar Gala 9ec847e608 Revert "rfc: ksdk: Add KSDK ENET driver."
This reverts commit 581e15ced2.

The commit was marked RFC and should not have been merged yet.

Change-Id: Iafd3587f8840e64670c32fa5726ea20ac9c9962a
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-09-23 09:07:26 -05:00
Marcus Shawcroft 581e15ced2 rfc: ksdk: Add KSDK ENET driver.
Provide a network driver wrapped around the KSDK ENET and PHY
drivers.

This driver is functional, just.  It is not in a fit state to be merged to master yet.

Origin: Original

Change-Id: Id29e756f33c6c0263926139188c49f9a9c3d5e09
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-09-23 01:54:00 +00:00
Juan Manuel Cruz b97f3f3996 eth: Add full-duplex configuration to ENC28J60
The driver originally gets the full-duplex configuration
from the PHCON1 register and PDPXMD bit as stated by the
ENC298J60 specification document section 2.6 "LED Configuration".
This section trust the board to LEDB connection to signal the
full-duplex configuration.

This commit gets the full-duplex configuration from Kconfig
symbols to allow a proper functionality even when the board
is not connecting LEDB apropriately.

Change-Id: I803958409a611e23e2c3e03f40b412f1695947af
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-17 22:43:52 +00:00
Juan Manuel Cruz bb4c1bd82a eth: Initial release to tx semaphore for the ENC28J60 driver.
There is a tx semaphore that controls a single access to the
transmission service. The device is capable to manage a single
transmission call at a time. Multiple requests need to wait
for the resource to be free.

This commit adds the initial release to the tx semaphore.

Jira: ZEP-895

Change-Id: Ic9879cfd15bb1494644b2cf0f4565f7e6a2c1c22
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-17 22:43:51 +00:00
Juan Manuel Cruz 8da0bad30a eth: Adjust ENC28J60 MAC configuration.
ENCC28J60 specs section 6.5 "MAC Initialization settings"
state that MACON3(7:5) register configure automatic padding and CRC.
It also states that the configuration 111 and 011 both configure as
all short frames to be zero padded with a valid CRC appended.

Nevertheless, experimentally, there are ocassions when configuring as 111
frames does not have a CRC appended. This frames could be rejected
by the receiver if it is configured to do so.

This commit changes configuration from 111 to 011, which is not
presenting that behavior.

Jira: ZEP-842

Change-Id: I302bb99f7a1f23b298fe0db0245963b640644040
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-17 22:43:51 +00:00
Juan Manuel Cruz 77e09abdda ethernet: Enables multicast reception for dw driver
Jira: ZEP-471

Change-Id: Id6a3ecbe31c055ab006abe475650c9871460f671
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-01 11:04:14 +00:00
Juan Manuel Cruz Alcaraz 6ec7fd5b42 enc28j60: Correction to ECON1.RXEN bit location
Per spec document, RXEN bit corresponds to bit 2
of the ECON1 register instead of bit 1.

Change-Id: I1bbfd048be248575a558679985ba9daadc43df0e
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-17 18:35:11 +00:00
Juan Manuel Cruz Alcaraz a1031ec5a6 enc28j60: rx fiber's stack size is increased
The rx fiber call contiki IP stack functions to register
received frames. This interaction requires more stack memory
in the rx fiber stack to avoid memory corruption.

Change-Id: I106339e7dd1ca9282426adfb54590e34297755b3
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-17 18:35:05 +00:00
Juan Manuel Cruz Alcaraz f53214e307 enc28j60: allow simultaneous reception and transmission
SPI bus is a shared resource between tx and rx processes.
The access to it must be synchronized to allow a rx process to
happen even when a tx process is taking place.
ECON1 register must be saved by the rx process and recovered
at the end to ensure that the tx process will continue operating
in the same register bank.

Change-Id: Ie9358bf02bef8ddb5bdf76c8847e998a627e5395
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-17 18:34:46 +00:00
Juan Manuel Cruz Alcaraz 2ac12e160c enc28j60: remove rx interruption handling
Transmision status is polled. Remove rx interruption enabling and
clearance.

Change-Id: I2893f89533adef5f77c711a36b5c1bbe21c48a23
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-17 18:34:46 +00:00
Juan Manuel Cruz Alcaraz 2f91a52519 enc28j60: hardware errata #14 ERXRDPT register failure
Even values in ERXRDPT register may corrupt the receive buffer.
Set ERXRDPT value one address behind the next value.
If it is zero, set the value to the reception buffer end address.

Change-Id: I7150e5190c5bfb7bfafbff598eea1c26959643d0
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-17 18:34:45 +00:00
Juan Manuel Cruz Alcaraz fd97f8addc enc28j60: hardware errata #6 PKTIF is unreliable
The Receive Packet Pending Interrupt Flag (EIR.PKTIF) does not
reliably/accurately report the status of pending packets.
Reception fails intermittently. The EPKTCNT register is used instead.

Change-Id: I599c3b4df1b74d769dd7104e5c6e253d9cf63bd4
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-17 17:19:37 +00:00
Juan Manuel Cruz 184a399f61 driver: ENC28J60 Ethernet SPI module
Adds the ENC28J60 Ethernet module driver.

Origin: Original
JIRA: ZEP-291

Change-Id: I2b5790ecb251f9059f172bcaafadef24bd27207a
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-08-05 20:36:44 +00:00
Ravi kumar Veeramally f93771a25c Revert "net: Restructured Ethernet driver menu"
This reverts commit 6de5643eb1.

Patch breaks applications running over Ethernet.

Jira: ZEP-565

Change-Id: Id147b7089f175c769c42c4e3dfb95408ee17ba9e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-07-20 22:57:55 +00:00
Jani Pajarinen 6de5643eb1 net: Restructured Ethernet driver menu
Created menu for Ethernet driver and moved driver + debugging setting
under it. Changed prompt from "Grove log level" to more describing and
fixed typos.

Change-Id: If2f79fee1a002a42e89e2493a2294332abec05ee
Signed-off-by: Jani Pajarinen <jani.pajarinen@intel.com>
2016-07-13 14:33:44 +00:00
Sebastien Griffoul 8237d0f882 eth: Fix spurious interrupt issues
The ethernet driver generates a lot of spurious interrupts.
These spurious interrupts have two sources:

1) The Mac Management Counter (MMC) module generates a lot of interrupts
   (GMI - bit 27 of the status register). Unfortunately the Interrupt
   enable register doesn't allow us to enable/disable it (bit 27 is
   reserved). Therefore the only way to mask this interrupt is to mask
   all the MMC interrupts (register REG_MMC_RX_INTR_MASK,
   REG_MMC_TX_INTR_MASK and REG_MMC_RX_IPC_INTR_MASK). By default
   these interrupts are not masked.

2) The RX interrupt is not correctly acknowledged. According to the
   datasheet, NIS is a sticky bit and must be cleared (by writing 1
   to this bit) each time a corresponding bit, which causes NIS to
   be set, is cleared.

Change-Id: I2033973849d87cddc328c65d0d4ad36b5a0c934e
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
2016-05-26 15:12:25 +00:00
Kumar Gala 9ec2f3be80 Cleanup whitespace in Kconfig files
Convert leading whitespace into tabs in Kconfig files.  Also replaced
double spaces between config and <prompt>.

Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 13:28:07 -05:00
Anas Nashif 90db02786c eth_dw: use sys log interface for debugging
Change-Id: I40ad4d2aa0419a7439a2fc0883a83430fa755b84
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:27 +00:00
Daniel Leung ba4099430b ethernet/dw: remove kconfigs that are SoC specific
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.

Change-Id: Ib483419be5199b52cf281b4b106cd8a3be95b7be
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-07 00:58:57 +00:00
Sebastien Griffoul 4b70134d1a eth_dw: fix buffer leak when RX frames are too large
When an ethernet frame is larger than UIP_BUFSIZE,
a net_buf is allocated but never released. Therefore
after few bad frames, no more RX network packet
can be received.

Fixed by allocating the net_buf after checking
the frame length.

Change-Id: I436487e3c26d739de347b4db6facc3a3dbebbe75
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
2016-03-31 23:18:17 +00:00
Andre Guedes 136d171588 drivers: Replace DEV_NOT_CONFIG by -EPERM
This patch replaces all occurences of the macro DEV_NOT_CONFIG by
-EPERM at the driver level. This patch is part of the effort to
transition from DEV_* codes to errno.h codes.

Change-Id: I3054c8aa76319a58a2eec089b8a72bf301c85391
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Jean-Paul Etienne 4f303a9967 eth_dw: fix compilation issue in eth_dw.c driver
got the following compilation error when trying
to compile the Synopsys DesignWare Ethernet driver:
In file included from drivers/ethernet/eth_dw.c:25:0:
drivers/ethernet/eth_dw_priv.h:27:28:
fatal error: contiki/ip/uip.h: No such file or directory

Fixed by adding correct include path in ethernet
Makefile

Change-Id: I8ea50e3ffb89e54349140de124f68d196a412f8e
Signed-off-by: Jean-Paul Etienne <jean-paul.etienne@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:31 -05:00
Andrew Boie 897ffaeb2c irq: rename irq_connect() to IRQ_CONNECT()
It's not a function and requires all its arguments to be build-time
constants. Make this more obvious to the end user to ease confusion.

Change-Id: I64107cf4d9db9f0e853026ce78e477060570fe6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh d340d4cb3f device: use DEVICE_INIT everwhere
This is the last step before obsoleting DEVICE_DEFINE() and
DEVICE_INIT_CONFIG_DEFINE().

Change-Id: Ica4257662969048083ab9839872b4b437b8b351b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh f027902305 net: use DEVICE_GET() instead of referencing __initconfig_xxx directly
Change-Id: I5cca7bf5f882cd2870c53f29dceb64faaf5b0d6e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh 2c1a95aee6 device: rename SYS_GET_DEVICE_NAME/SYS_GET_DEVICE
Rename them to DEVICE_NAME_GET and DEVICE_GET to fit in the 'device'
namespace.

Change-Id: I407a7f284ed4d1c071961b46615eea859c2e825f
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh 0303d8cab9 device: rename SYS_DEFINE_DEVICE()
Rename it to DEVICE_DEFINE() so that it fits in the 'device' namespace.

Change-Id: I3af3a39cf9154359b31d22729d0db9f710cd202b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh bfc27206b2 device: rename DECLARE_DEVICE_INIT_CONFIG()
Rename it to DEVICE_INIT_CONFIG_DEFINE(), because (a) it was not fitting
in any namespace and (b) it is not used to declare, but rather define a
object.

Change-Id: I1da5822f06b85a9fb024b5b184afd0ccc01012ec
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:25 -05:00
Peter Mitsis a0e4568760 c++: Add extern "C" { } block to header files
Adds extern "C" { } blocks to header files so that they can be
safely used by C++ source files.

Change-Id: Ia4db0c36a5dac5d3de351184a297d2af0df64532
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Andrew Boie d9cfbd5a61 interrupts: new static IRQ API
The interrupt API has been redesigned:

- irq_connect() for dynamic interrupts renamed to irq_connect_dynamic().
  It will be used in situations where the new static irq_connect()
  won't work, i.e. the value of arguments can't be computed at build time
- a new API for static interrupts replaces irq_connect(). it is used
  exactly the same way as its dynamic counterpart. The old static irq
  macros will be removed
- Separate stub assembly files are no longer needed as the stubs are now
  generated inline with irq_connect()

ReST documentation updated for the changed API. Some detail about the
IDT in ROM added, and an oblique reference to the internal-only
_irq_handler_set() API removed; we don't talk about internal APIs in
the official documentation.

Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:17 -05:00
Javier B Perez Hernandez 02812f4635 drivers: pci: struct pci_dev_info rename class
Rename class in pci_dev_info struct to allow to use C++ compilers.
Updated drivers to use new struct.

Change-Id: I17b94cb7bc094bccd615c8389a28589bfa90cab8
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:25:12 -05:00
Anas Nashif f6f81868f8 build: Remove PROJECTINCLUDE from application makefiles
PROJECTINCLUDE is not required in app makefiles.

Change-Id: I3751b7c51c453dfe47d207bb11d171138668c4e7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:04 -05:00
Juan Manuel Cruz bc1a79c4c3 irq: removes priority parameter from IRQ_CONFIG macro
Removes the 'priority' parameter from the IRQ_CONFIG macro.
This parameter was not used anymore in any architecture.
The priority is handled in the IRQ_CONNECT macro.
The documentation is updated as well.

Change-Id: I24a293c5e41bd729d5e759113e0c4a8a6a61e0dd
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:57 -05:00
Dmitriy Korovkin 57f2741e4f init: Implement fine-grained initialization policy
Put initialization priorities as device driver Kconfig
parameter.

Initialization priority value for each platform is defined
in the platform Kconfig file.

Drivers and platform code use SYS_DEFINE_DEVICE to add
and initialization function.

Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Anas Nashif 77ba3c3b8b kconfig: define architecture as a kconfig variable
Do not depend on environment variables and use a kconfig variable
for defining the architecture.

In addition, remove the X86_32 variable, it just duplicates X86 for
not good reason, at least until start supporting MCUs with 64bit.

Change-Id: Ia001db81ed007e6a43f34506fed9be1345b88a4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Jukka Rissanen 2272312b8d net: Refactor code to use new generic net_buf API
Change-Id: Id008bbf43062ca0641a76edaabef47c650287444
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:46 -05:00
Michael LeMay ebba3bf38b eth: dw: Add driver for Synopsys DesignWare Ethernet MAC
This patch adds a driver for a Synopsys DesignWare Ethernet MAC.  The
driver uses interrupts to handle received frames, but it uses a
spinloop when transmitting to wait for the transmit descriptor to
become available.  Transmission is coordinated by a fiber, so this
should not result in the system execution being blocked.  Only a
single descriptor is allocated for each of the transmit and receive
directions to save memory and simplify the code.  Another
simplification is that none of the offload capabilities of the
Ethernet device are used.  The driver currently only supports a single
instance of the Ethernet MAC, which is consistent with the limitation
in the network stack that only a single network device is supported.

Change-Id: I013b3d439a76e8ff91a775516f7035841b040870
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
2016-02-05 20:24:38 -05:00