Commit graph

374 commits

Author SHA1 Message Date
David B. Kinder c2bf3af1de doc: fix misspellings in Kconfig files
Missed some misspellings during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-02-07 14:51:46 -05:00
Ding Tao 6c00545d66 native: console: Fix Kconfig "multiple prompts" warnings
NATIVE_POSIX_STDIN_CONSOLE and NATIVE_POSIX_STDOUT_CONSOLE have more
than one prompts, this will cause warnings when run kconfig checks.

Remove one of two prompts.

Signed-off-by: Ding Tao <miyatsu@qq.com>
2018-02-07 08:35:29 -05:00
Alberto Escolar Piedras e3f727cc6e native: added stdin handling for shell
Now the native console driver also handles stdin
so we can drive the shell from the command line,
a pipe or a file

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-02 07:48:46 -08:00
Paul Sokolovsky e25df54eae various: Update/fix some textual material and code comments.
Of these, only struct net_ipv6_nbr_data::send_ns is a descriptive
change:

send_ns is used for timing Neighbor Solicitations in general, not
just for DAD.

The rest are typo/grammar fixes.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-12-29 09:45:39 -05:00
Anas Nashif 6b55598ad4 board: posix: add native_posix board definition
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-27 14:16:08 -05:00
Anas Nashif e2122cbf89 lib: move ring_buffer from misc/ to lib/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-15 20:02:01 -05:00
Anas Nashif 429c2a4d9d kconfig: fix help syntax and add spaces
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-13 17:43:28 -06:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Jukka Rissanen 55b8edc88e net: Fix LLVM compiler warnings
Jira: ZEP-2488
Jira: ZEP-2486
Jira: ZEP-2485
Jira: ZEP-2482
Jira: ZEP-2480

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-09 12:50:50 -04:00
Anas Nashif 09bcd8ee74 Kconfig: make all syslog variables depend on SYS_LOG
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-04 14:34:54 -05:00
Savinay Dharmappa c1e5cbfd41 devicetree: Generate BLUETOOTH_UART,UART_PIPE etc config from dt
patch uses chosen property zephyr,bt-uart, zephyr,uart-pipe
and zephyr,bt-mon-uart to determine the uart instance to be
used for bluetooth,uart_pipe and bluetooth_monitor and generate
appropriate configs.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-07-19 11:52:35 -04:00
Kumar Gala 65e72be8f7 devicetree: Generate CONFIG_UART_CONSOLE_ON_DEV_NAME from dt
We can use the chosen property "zephyr,console" to determine what uart
should be used as the console and find its name to generate a define for
CONFIG_UART_CONSOLE_ON_DEV_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-11 12:09:10 -05:00
Geoff Gustafson 1405627c37 net: context: Use K_NO_WAIT instead of 0 for timeout
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
2017-07-10 10:59:28 +03:00
Anas Nashif 397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
Andrew Boie 2d4a36fc1c drivers: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Andrew Boie 0d7962cee3 drivers: telnet_console: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
Andrew Boie b52a62b561 ipm_console_receiver: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
Paul Sokolovsky 25307d5331 net: net_pkt_append: Refactor to return length of data actually added
For stream-based protocols (TCP), adding less data than requested
("short write") is generally not a problem - the rest of data can
be sent in the next packet. So, make net_pkt_append() return length
of written data instead of just bool flag, which makes it closer
to the behavior of POSIX send()/write() calls.

There're many users of older net_pkt_append() in the codebase
however, so net_pkt_append_all() convenience function is added which
keeps returning a boolean flag. All current users were converted to
this function, except for two:

samples/net/http_server/src/ssl_utils.c
samples/net/mbedtls_sslclient/src/tcp.c

Both are related to TLS and implement mbedTLS "tx callback", which
follows POSIX short-write semantics. Both cases also had a code to
workaround previous boolean-only behavior of net_pkt_append() - after
calling it, they measured length of the actual data added (but only
in case of successful return of net_pkt_append(), so that didn't
really help). So, these 2 cases are already improved.

Jira: ZEP-1984

Change-Id: Ibaf7c029b15e91b516d73dab3612eed190ee982b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:09 +03:00
Adithya Baglody 23d946f4c0 drivers: console: Do not wait on the DTR signal from the host USB controller.
Jira: ZEP-1993
Change-Id: I4834d630f245f81381887af56e2d6ccd811094b4
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-04-25 02:33:01 +00:00
David B. Kinder 93e4d7258d spell: fix Kconfig help typos: /boards /drivers
Fix misspellings in Kconfig help text

Change-Id: I3ae28a5d23d8e266612114bc0eb8a6e158129dc7
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-21 21:31:30 +00:00
Kumar Gala ccad5bf3e3 drivers: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 10:06:48 -05:00
Tomasz Bursztyka db11fcd174 net/net_pkt: Fully separate struct net_pkt from struct net_buf
- net_pkt becomes a stand-alone structure with network packet meta
  information.
- network packet data is still managed through net_buf, mostly named
  'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
  or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
  memory when TCP is enabled.

Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Tomasz Bursztyka bf964cdd4c net: Renaming net nbuf API to net pkt API
There have been long lasting confusion between net_buf and net_nbuf.
While the first is actually a buffer, the second one is not. It's a
network buffer descriptor. More precisely it provides meta data about a
network packet, and holds the chain of buffer fragments made of net_buf.

Thus renaming net_nbuf to net_pkt and all names around it as well
(function, Kconfig option, ..).

Though net_pkt if the new name, it still inherit its logic from net_buf.
'
This patch is the first of a serie that will separate completely net_pkt
from net_buf.

Change-Id: Iecb32d2a0d8f4647692e5328e54b5c35454194cd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
David B. Kinder 896cf7a00a spell: fix doxygen comment typos: /drivers
Fix doxygen comment typos used to generate API docs

Change-Id: I6fd5051c99bdcc731740c92001e525349c254d85
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-19 10:45:34 -07:00
Max Filippov 0ad868a58c xtensa_sim_console: fix simcall
simcall must be in the volatile asm so that gcc does not optimize it
out. It also needs "memory" clobber to make sure data passed through
memory buffer is actually written back before the simcall.

Change-Id: I410b7348bf605d0d08f81ec5395f6cb144f33a43
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2017-04-13 20:33:27 +00:00
Andrew Boie 3cc4d41438 ipm_console: add Kconfig for receiver stack size
Change-Id: I27c1189e3bf87b4ea3dc06d38f63cab21663697b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-06 16:58:20 +00:00
Andrew Boie 42562b9367 xtensa: fix numerous checkpatch issues
Change-Id: I903f5f0692849fb9e7bf5d978b63b12bf1bd6e33
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:03 -08:00
Andrew Boie eab8a9f9ca xtensa_sim_console: remove deprecation warning
Change-Id: I10181f6c4d90e38927c1831c93fc459d33de6fd1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER b0669a04b3 Xtensa port: Added support for Xtensa simulator console driver.
Change-Id: I58effa98fd6ff53bcfd21cb8de2fcd89651dc1d9
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08: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
Tomasz Bursztyka 028896063f drivers/console/telnet: Select TCP when telnet is selected
Thus users won't have to first enable network stack and then telnet.

Change-Id: I30cb2b9debee3feaf804f9a70f9d3f90758f5f17
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 13:02:11 +00:00
Tomasz Bursztyka c5644fba20 drivers/console/telnet: Add ground support for telnet commands
This is the skeleton for such support. Let's see if this will be needed
and thus extended in the future.

For now, it's disabled by default, not advised to be enabled.
It supports AYT, AO and DO/SUPR_GA. This is very limited and only there
to show how it could be handled.

Change-Id: I736bfa23145e9b727af08db682ab001f494f8c8d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka 1d9402b3e3 drivers/console/telnet: Provide minimal input handling.
Telnet "Interpret As Command" (IAC) code is ignored.

Change-Id: I882397389d77b8adfcbce62fbd9654c0b0412ae3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka 2f1af492ee console/shell: Switch to generic console input
Let's use the generic console input type now. This will be useful for
other console input drivers such as telnet.

Change-Id: I787a1e9d86481d5f8c4803453726d9042a89dea4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka 3e65158936 drivers/console: Making console input generic
Input line length can be modified via Kconfig.

Change-Id: I3423fce9814e04b11d11e5d391f85fe1efbe8d17
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka fb9810978f drivers/uart_console: Fix tiny style issues
Basically missing {} on if statements.
Taking the opportunity to remove a useless switch.

Change-Id: Ic6b3951dfc257cb46d858ebcd12bdf1b4e7ff997
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka 01e70f4189 drivers/console: Add a basic telnet console
Telnet is started as an application, as it requires the net stack to be
ready. It will listen to any IP address on both protocols (IPv4, IPv6),
depending of course on which one is enabled.

Current behavior is very basic, as it does not handle any telnet
command (IAC). These will be silently ignored.

Jira: ZEP-1601

Change-Id: Id50656f23e6347bbbc893416953f1ba7116ef87d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:52 +02:00
Tomasz Bursztyka 4984ca742a drivers/console: Removing non existing Kconfig source
Change-Id: I89fdc6f702f3ea39822c6fbf6fce93e3eb77261c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:52 +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
Anas Nashif 6b65dcefd2 legacy: Move TICKS_UNLIMITED -> K_FOREVER
Change-Id: Ic1e73959a3444bc6e015e341899c75b1ef850189
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:35 +00:00
Carles Cufi 0e650d4eaf drivers: rtt: Lock interrupts around RTT Write
Since RTTWriteNoLock is not thread-safe or preemptable, it is necessary
to lock interrupts around the calls to it.

Change-id: I38b7e37a0f46e77bf82c1e07d549414393e84a51
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05 13:32:11 +01:00
Anas Nashif 7297f5db88 shell: move shell to its own subsystem
This moves the shell component into its own subsys and groups all
related files and options into a single place.

Additionally, one Kconfig option will now be required to enable the
shell:

 CONFIG_CONSOLE_SHELL=y

The header files was also moved to include/shell/shell.h and can be now
referenced with

 #include <shell/shell.h>

instead of

 #include <misc/shell.h>

Updated documentation as well.

Change-Id: Iffbba4acfa05408055e9fd28dffa213451351f94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 19:35:11 +00:00
Flavio Santes 3ec300fd94 shell: Init structure and add the ARG_UNUSED macro
The shell_cmd structure has three parameters and only two were
initialized. So, this commit initializes the remaining parameter
and also adds the ARG_UNUSED macro to avoid compiler warnings.

Change-Id: I667a4e9839ec5acd526df0bb465beb2062518315
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:53 +00:00
Flavio Santes 0a1c29cda4 driver: Add ARG_UNUSED to console and uart drivers
This patch adds the ARG_UNUSED macros to some function
arguments to avoid compiler warnings.

Change-Id: I628aea55d98cf8519c046ae5835e95cfa70a973f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:47 +00:00
Flavio Santes b04cdcd6e6 drivers: Remove legacy nanokernel.h include
This commit replaces the nanokernel.h include by kernel.h.

Change-Id: Ib42fbf2d9f77a73c0831f569b3dbbfb342ea2e1d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-04 14:59:37 -06:00
Carles Cufi 5f1c6ee2c8 console: Add a Segger RTT console driver
The Real Time Terminal functionality of the Segger J-Link
debug probe and software suite allows applications to write
to a certain RAM area that is read in real-time by the
debugger. This is specially useful when a UART is not
available to provide a console.
This commit adds a console driver that outputs over an RTT
"connection".

Change-Id: Ifce8020060e9f519a61f3f1fbe9f56f98da2ef7f
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-03 15:24:39 +00:00
Baohong Liu fa2d38e395 drivers: console: use unified kernel API
Change-Id: I2184f0565a9a4f2ebfdff1f57afc22ce36fe0646
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-30 23:49:04 +00:00
Vincenzo Frascino f3a9241045 console: Fix unreachable code condition
This patch fixes an unreachable code condition in the uart_console
driver.

If UART_CONSOLE_DEBUG_SERVER_HOOKS was not defined
handled_by_debug_server in console_out was always 0.

This issue was reported by Coverity (CID 131627).

Change-Id: I4376c3e5b3e68220218df6aabd91b6a8900ca31f
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-16 13:30:11 +00:00
Anas Nashif 2367df8d59 drivers: update ipm driver to use unified kernel
Move away from legacy APIs and use unified kenrel instead.

Change-Id: Icae86beec66df1b041405cbe3455913630fc8ad1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-13 13:53:53 +00:00
Johan Hedberg 488f72dd80 drivers: console: Fix compilation error in uart_console.c
Fix compilation error when CONFIG_USB_UART_CONSOLE is not enabled:

drivers/console/uart_console.c: In function 'uart_console_init':
drivers/console/uart_console.c:497:12: error: unused variable 'dtr' [-Werror=unused-variable]
  uint32_t  dtr = 0;

Change-Id: I592724150f86199f6a57354c3246197db2ac7a01
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-12 12:49:53 +02:00
Jithu Joseph fca0add22b console : usb: USB UART console output support
Add support for console output via the USB UART.
Note that console input via the USB UART doesnt work.

Adds a simulated poll method for UART interface exposed by USB.

Jira : ZEP-775

Change-Id: I357827ea52c027eb000baed80225f422df1f3358
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-11-12 01:39:30 +00:00
Luiz Augusto von Dentz 6b2443e99b console: Fix warnings related to the use of deprecated APIs
This fixes the warnings related to the use of deprecated APIs
converting them to use the unified version.

Change-Id: I76d076de27ecdae4af46abf4baac68e2cc1313c0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-11 14:50:58 +02: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
Anas Nashif f815d069b8 shell: move documentation out of kernel
The shell is not a kernel feature, it is more of a subsystem.

Change-Id: Iaba60b2086ddfe77af427d70b8fc8d06a8bebe14
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 13:48:16 +00:00
Anas Nashif b27d3a8a60 shell: split kernel shell into separate module
Add kernel functions to kernel module and make it part
of the shell sample.

Change-Id: If5e8ff8ce7b8edbbb8d62509964700b007eaf88b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 13:48:15 +00:00
Anas Nashif 559b46f37d shell: move shell Kconfig to drivers/console/shells
Cleanup some unneeded ifdefs in C files.

Change-Id: Icd1f34f2d24b531ad5320e3436cce048d236a4f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 13:48:15 +00:00
Szymon Janc 5f6f422ebb console: shell: Reduce completion stack usage
There is no need for copying command string to temporary variable on
the stack.

Change-Id: I41fd2582600908ac523b87c83a426eef27d1c454
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-03 12:50:19 +00:00
Szymon Janc a9386f9707 console: shell: Fix commands tab completion
This fix commands tab completion and make it similar to Linux shell
completion:
 - single match complets command and add space at the end
 - multi match lists matched commands and complete common part
 - no match does nothing

Change-Id: Ib2d90889c79e8d35a78b8847d2b9e124cdc00a6c
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2016-11-03 12:50:19 +00:00
Szymon Janc 6fc74083db console: shell: Fix not printing selected module prompt
If application prompt handler returns NULL curently selected module
prompt should also be checked before of printing default shell prompt.

Change-Id: Iba9c191041951c31036766b1cc8070b040655445
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2016-11-02 21:55:47 +00:00
Yael Avramovich d5db35204a console: shell: Support multiple modules
Ability to use Zephyr shell by multiple modules simultaneously, each
module for its own usage.

Old shell implementation enabled the user to call only one module
commands, not all of the modules simultaneously.

Change-Id: I0ef8fa2fd190b7490c44fe91d1016363258302c9
Signed-off-by: Yael Avramovich <yael.avramovich@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 00:23:18 +00:00
Szymon Janc a037316bb5 console: Add support for DEL key
This allows to delete character after cursor.

Change-Id: I9acc5e1edeb688ea4ec36e91aef69ecb5f5f6354
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-01 23:37:37 +00:00
Szymon Janc 6b0cf54c60 console: Add support for HOME and END keys
This allows to navigate to begining and end of the line easily.

Change-Id: I3a839a0499961d55574a310c65811dd2fe048703
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-01 23:37:36 +00:00
Marcus Shawcroft 1bc999cb8d drivers/uart: Refactor UART input hook.
This refactor is in preparation for making driver API structures
const.

The console driver provides a mechanism to install an input and an
output hook function.  These are primarily used by the onboard
gdb-server.  The output hook is entirely implemented within the
console driver.

The input hook is partially implemented in the top of the uart driver
and within the console driver.  The hook function itself is installed
in the uart API structure, but is invoked only by the console driver.

Installing the hook function directly into the uart API structure
prevents the API structure being const.  There are two approaches to
fixing this:

1) Implement setting of the input hook in the same way as
uart_irq_callback_set().

2) Move the input hook entirely to the console driver.

We implement the latter.  This approach has two benefits, first it
removes the need for every uart driver to implement the behaviour and
second, the current placement of the callback function in the uart API
seems odd given that the callback is only invoked by the console
driver, never by a uart driver.

Change-Id: I258b312d3055df1c2bdeb896bd4f4f39c40838f7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 11:31:08 +00:00
Marcus Shawcroft df098b7012 ipm: Make config_info pointers const.
Change-Id: I616c215f98f57d74ba495959d220de6d38ada9d0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 12:29:23 +00:00
Marcus Shawcroft 58026e327a ipm: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I8f2eb0f6dbd6f50e0d456ee329e3b00e4ce4b257
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 08:05:50 -04:00
Andy Ross 425145da08 uart_console: Fix line endings
Overwhelming industry practice when using two-byte line termination is
to end the line with "\r\n" and not "\n\r".

Also remove needless casts.  GCC does not warn on int-to-char
conversions.

Change-Id: If01a2e5ca327aacebcbcaf384af9c7131119689b
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-09-09 21:37:55 +00:00
Andrew Boie c97aead1d2 drivers: ipm_console: fix incorrect printk() usage
Change-Id: I2a3fcce2ceef9b0034eabada59adc2d3c7b3d96a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie bf89e1756d drivers: console_handler_shell: fix incorrect printk() usage
Change-Id: Ifbe1a2a5eb9feaa30d5aa47dd81adfe4a188ea6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Andrew Boie 926a368991 ipm_console: rate-limit to avoid losing messages
These console messages are for debugging and if sent too
rapidly, could be discarded. This was causing false positives on
test cases which rely on console output to determine success or
failure.

Issue: ZEP-704
Change-Id: I5a86c761311cde90f295cd2e65f2e70608f875fa
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-17 18:04:37 +00:00
Andrew Boie a5b640eb18 ipm_console_receiver: correctly populate driver data
The (currently) unused ipm_device field wasn't initialized.

Issue: ZEP-704
Change-Id: Icbeb50031c52d2513a1417f83a844e25b43429a7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-17 14:23:34 +00:00
Szymon Janc 07fb2e106b console: shell: Reduce stack usage of tab completion
Print commands names when matched instead of first creating
completion string in buffer. Common part of commands names
can only be reduced when matching further commands so only
first match needs to be kept for altering command line.

Change-Id: I5a9d2eb171ef4d31da9cbe6e93b577457b13c5a2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-06-02 13:28:15 +00:00
Szymon Janc 0595c47e17 console: shell: Add support for commands completion
This adds simple tab completion for shell use convenience.

Change-Id: If90ded32fb5044741232933d2cb0ce626227d025
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-26 13:06:59 +00:00
Szymon Janc d7e8fd0446 console: Add support for commands completion
This allows to register callback that will be called to
perform command completion.

Change-Id: Ide7a0427d9b8bb4dd8cfc0995ef2567b32e89632
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-05-26 12:02:51 +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
Luiz Augusto von Dentz 7941630e17 console: shell: Add return to command callback
This enable checking for errors and automatically print help string:

btshell> connect
connect <address: XX:XX:XX:XX:XX:XX> <address type: (public)>

Change-Id: Ie097ecddb72ab15bf6192e310d0bd839bfd251d5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-23 11:00:21 +03:00
Luiz Augusto von Dentz 39a4b17f3b console: shell: Print empty string if no help is passed
Change-Id: I5469ea18e878b6053caa911350426853477b8a6a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-20 16:08:21 +03:00
Luiz Augusto von Dentz a1094e92d6 console: shell: Add check for command help
This checks if the command string is either NULL or empty since in these
cases there shouldn't be necessary to do any lookup.

Change-Id: I27e6d5b07ab4000cce93a4d1f7952e3c57672657
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-20 16:05:17 +03:00
Luiz Augusto von Dentz c643b426ac console: shell: Fix use of strncmp
Contrary to strcmp strncmp does not match the entire string only the
initial bytes passed as len thus causing a prefix match not a exact
match logic.

Change-Id: I85f96beb2249223f44c81c4efd6bd01bf2033a2e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-20 16:05:17 +03:00
Luiz Augusto von Dentz a4b26fadfe console: shell: Add help string to command table
This adds a optional help string to the command table which is printed
when user enters > help <command>.

Change-Id: Id3a8995bb6c4ff6b009418e31968c0677e6e4921
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-05-19 08:43:18 +00:00
Chuck Jordan 12e29fe653 console: fix spelling error in comment
consloe changed to console

Change-Id: Ie6d6bd7762f1ab1dae64a1f5ccbe7dbc651e8c0f
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:51 +00:00
Benjamin Walsh 0ff5d37a4a console: add hook for debug server to handle outgoing characters
A debug server might want to redirect outgoing characters on the console
to another output if it piggybacks on the serial line normally reserved
for the console.

Change-Id: I534f5b35456306940a3926f52fe5cce2d5c94da4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:20 +00:00
Maciek Borzecki 5eb51feeb0 console: shell: expect const commands array
The commands array is not expected to change and can be declared
const. This allows callers to cleanly declare their commands lists as
const, effectively moving the structures from SRAM to code section.

Change-Id: Ie1710622b8cfa609e129eb79712f910f1d1aace3
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-04-01 13:12:56 +00:00
Mariusz Skamra 4800266cc6 drivers/console: Fix flush data on uart_pipe_setup
This patch fixes drain of data left in UART Rx fifo.
uart_irq_tx_ready checks if Rx IRQ has been raised,
but because Rx IRQ is disabled this won't work even
if there are some data left in the UART buffers.
So simply uart_fifo_read is used to discard the data that
left in UART buffer.

Change-Id: I17f145ba58640650bafd3602412fc75229f39664
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-03-29 16:41:50 +00:00
Daniel Leung 546b8ade37 refactor common driver initialization priorities
Most of the SoC and board Kconfig use the same values for
driver initialization priorities. So refactor them, and
discard duplicate ones.

The shared IRQ init priority was changed so that the kernel
default init and device init priorities can be standardized
across all SoC/boards. Same goes for DesignWare SPI driver.

This also changes the UART_CONSOLE_PRIORITY and
IPM_CONSOLE_PRIORITY to UART_CONSOLE_INIT_PRIORITY and
IPM_CONSOLE_INIT_PRIORITY, to standardize across all drivers.

Note that this does not take away the ability to override
those values. This just provides reasonable defaults such
that there is virtually no need to override.

Change-Id: Ibbd95d802c637df06f9a2fd48763ee1e6f4ff627
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-28 15:58:29 -07:00
Andre Guedes b3cb3a1f68 drivers: Replace DEV_INVALID_CONF by -EINVAL
This patch replaces all occurences of the macro DEV_INVALID_CONF by
-EINVAL at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: Idae0d5af8dd780416977c9261a5fb6188c3aab64
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 024cfe754e drivers: Replace DEV_OK by 0
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Daniel Leung e643cede3a uart: add ISR callback mechanism for UART drivers
The peripherals utilizing UART were required to register their own
ISR rountines. This means that all those peripherals drivers need
to know which IRQ line is attached to a UART controller, and all
the other config values required to register a ISR. This causes
scalibility issue as every board and peripherals have to define
those values.

Another reason for this patch is to support virtual serial ports.
Virtual serial ports do not have physical interrupt lines to
attach, and thus would not work.

This patch adds a simple callback mechanism, which calls a function
when UART interrupts are triggered. The low level plumbing still needs
to be done by the peripheral drivers, as these drivers may need to
access low level capability of UART to function correctly. This simply
moves the interrupt setup into the UART drivers themselves. By doing
this, the peripheral drivers do not need to know all the config values
to properly setup the interrupts and attaching the ISR. One drawback
is that this adds to the interrupt latency.

Note that this patch breaks backward compatibility in terms of
setting up interrupt for UART controller. How to use UART is still
the same.

This also addresses the following issues:

() UART driver for Atmel SAM3 currently does not support interrupts.
   So remove the code from vector table. This will be updated when
   there is interrupt support for the driver.
() Corrected some config options for Stellaris UART driver.

This was tested with samples/shell on Arduino 101, and on QEMU
(Cortex-M3 and x86).

Origin: original code
Change-Id: Ib4593d8ccd711f4e97d388c7293205d213be1aec
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-05 13:37:57 +00:00
Johan Hedberg 6543318194 drivers/console: Fix writing out carriage return on all terminals
Some terminals (e.g. screen) don't seem to propagate carriage returns
through, creating the following kind of results when pressing enter in
a shell:

btshell>
         btshell>
                  btshell>
                           btshell>

Fix this by always printing out '\r' when receiving a carriage return.

Change-Id: Ia5ce5612c9b830edc84619538dc17a654b6e805b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-10 18:52:29 -05:00
Andrei Emeltchenko 6948fc437a uart-pipe: Fix using fifo_fill instead of poll_out
For non-interrupt transfers poll_out should be used, This fixes data
lost issues on a real UART hardware like Arduino 101 and Galileo
boards.

Change-Id: Ic7a5d055941d83f9d62cbea9e911ce25730ed7b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:25:32 -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 a4ec963138 init: use SYS_INIT() where it makes sense
Mostly SoC initialization and some kernel subsystems, but also some
device drivers like the interrupt controllers.

Change-Id: I8dc1844c33acd877c075b6b03558fdca6f87500b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.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 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
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
Andrew Boie 2295e2abf7 uart: remove uart_irq_get()
This API is not being used for anything, the interrupts for UART
drivers are all being configured statically. Saves code space as
gc-sections can't tell that these APIs are unused.

Some instances where IRQ/priority information was being saved in
data structures and never used fixed.

Change-Id: If56b4fdc251b80be9094ffcbac6f61e265ac2ffd
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:16 -05:00
Peter Mitsis 54b782a88b nano_sema: Simplify nano_xxx_sem_take() API family
Changes the nanokernel semaphore API so that the timeout parameter must be
specified when invoking nano_isr_sem_take(), nano_fiber_sem_take(),
nano_task_sem_take() and nano_sem_take().

This obsoletes the following APIs:
	nano_fiber_sem_take_wait()
	nano_fiber_sem_take_wait_timeout()
	nano_task_sem_take_wait()
	nano_task_sem_take_wait_timeout()
	nano_sem_take_wait()
	nano_sem_take_wait_timeout()

Change-Id: If7a4bce1bd8ec8d6410d04f3c16ff1922ff0910e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Peter Mitsis cd6db374de nano_fifo: Simplify nano_xxx_fifo_get() API family
Changes the nanokernel FIFO API so that the timeout parameter must be
specified when invoking nano_isr_fifo_get(), nano_fiber_fifo_get(),
nano_task_fifo_get() and nano_fifo_get().

This obsoletes the following APIs:
	nano_fiber_fifo_get_wait()
	nano_fiber_fifo_get_wait_timeout()
	nano_task_fifo_get_wait()
	nano_task_fifo_get_wait_timeout()
	nano_fifo_get_wait()
	nano_fifo_get_wait_timeout()

Change-Id: Icbd2909292f1ced0bad8a70a075478536a141ef2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:14 -05:00
Andrew Boie 4d3e120109 ipm_console_receiver: fix carriage returns
It's unclear why the carriage returns were moved to the begnning and
not the end.

Change-Id: Ic6bda55c7537538c47477e6c44f5e4c1534573d4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:14 -05:00
Dirk Brandewie 0551ee0708 ipm: rework isr to service one set of requests at a time
Change-Id: I50604748cee1aeb43dc764f426d3a17fcc943cbe
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:25:12 -05:00
Anas Nashif 6bca3724c1 drivers: set default priority for drivers
Use a default priority to avoid Kconfig blocking when priority
is not set in SoC or Board.

Change-Id: I4edda47b955a7ee834f04dc40d0decbd8dee6305
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Johan Hedberg 8683dc4836 drivers/console: Add support for ANSI sequences with values
ANSI sequences may have a numbered prefix which means that the action
needs to be taken the number amount of times, e.g. "Esc[ValueA" (move
cursor forward Value number of characters). Some ANSI commands also
have two preceding values, such as Esc[Line;ColumnH (move cursor to
Line & Column).

To support these ANSI sequences we need to track a bit of extra state,
most conveniently done using a bit field. Since the ANSI parsing logic
gets a bit long at this point it's refactored into its own handle_ansi()
function.

Change-Id: I0711f869d5324f9f827915fde468fe470e7689ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:06 -05:00
Johan Hedberg ceba31ade4 drivers/console: Use cursor save/restore escape sequences
Instead of keeping track how many characters we need to move back to
get to the original position, take advantage of the save/restore
escape sequences. This allows us to drop the extra 'i' variable from
both insert_char() as well as del_char().

Change-Id: I69a2b5ea12ec2a7a2e4d519b55e4c737b5d5d25a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:06 -05:00
Andrew Boie 3589695508 ipi: rename to ipm
To many people, IPI connotes inter-processor interrupts on SMP
systems. Rename this to IPM, or Inter-Processor Mailboxes.

Change-Id: I032815e23c69a8297c0a43992132441c240fb71e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:04 -05:00
Johan Hedberg a9f6f89e84 drivers/console: Add support for editing the line internally
Add support for forward/backward ANSI sequences and the ability to
enter new text while the cursor is somewhere in the middle of the line
rather than at the end of it. printk is introduced into the game
rather than the old write_uart() since we need to make use of the
%u format string support for creating the ANSI sequence to move
backward/forward the right number of characters.

Change-Id: I41f880fc5de773573147c5a291e2cbe94d5370a4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:03 -05:00
Johan Hedberg f88cccd2b5 drivers/console: Handle basic control characters cleanly
By default, since we don't have special support for control characters
we should simply ignore them. This includes both pure (single) control
characters as well as ANSI escape sequences. The most important
control character to support for basic editing is Backspace.

The terminal creates a Delete (DEL) character by default when
Backspace is pressed. It also treats the Backspace character ('\b') as
a non-destructive backspace. To create the effect of destructive
backspace we have to send the sequence "\b \b".

Change-Id: Idc942d09be2a84b8dd0a60ace8429102c6c7e355
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:03 -05:00
Johan Hedberg 6147fc6384 drivers/console: Ignore characters when runnning out of buffer space
To clean up the logic and prepare for more control character support,
change the behavior so that instead of treating end of buffer as a
forced line break simply stop incrementing the position variable until
getting a carriage return.

Change-Id: Ie3970cb779dac3c826a3d21cf0b9ae57a43eddb2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:03 -05:00
Johan Hedberg 1c35329dc0 drivers/console: Remove unnecessary check for line feed character
The terminal doesn't generate line feed ('\n') when pressing return,
rather only a carriage return, so we can simplify the condition for
handling end of line.

Change-Id: I3eef8c6af19c43ef98ccdd9a5e3662d280834425
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:25:03 -05:00
Johan Hedberg 6eeec2137f drivers/console: Reduce scope of 'pos' variable
The 'pos' variable is only used within a very limited scope inside the
uart_console_isr() function. Move it's declaration there to avoid
having it exposed to the entire c-file.

Change-Id: I45ff0090ea4e0aabe77db2549d0194e26ebb63ef
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:58 -05:00
Johan Hedberg 5ad78034c9 drivers/console: Remove unnecessary indentation in uart_console_isr
Most of the uart_console_isr() function is heavily indented. We can
remove one level by converting:

	if (uart_irq_rx_ready(uart_console_dev)) {
		...
		...
	}

to:

	if (!uart_irq_rx_ready(uart_console_dev)) {
		continue;
	}

Change-Id: Ib2fe150490a8391de4001f29e4727431668853c4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:58 -05:00
Johan Hedberg 2893def459 drivers/console: shell: Add custom prompt callback support
Shell applications may want to have a dynamic prompt rather than a
fixed string. Add a new API to let the application specify a custom
callback instead of using the fixed string given to shell_init().

Change-Id: I9844481057fc8e164530a677e7cb1bfb6d02cfc0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:58 -05:00
Anas Nashif 275ca60b08 Fixed file description and applied doxygen style
Removed old style file description and documnetation and apply
doxygen synatx.

Change-Id: I3ac9f06d4f574bf3c79c6f6044cec3a7e2f6e4c8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:58 -05:00
Anas Nashif de40d9f90f uart: check for MVIC when creating stubs
Some systems are configured with CONFIG_MVIC which uses the same
call to create the stub.

Change-Id: I92f6657806159624dee9c271554a78bc76935613
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:57 -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
Daniel Leung 5cdd4584fe uart_pipe: use device name instead of index
Use device name to find the UART device for uart_pipe usage,
instead of relying on an arbitrary index.

Change-Id: I36aaa4ed8f0b4905e4e741ca1464947e59f30869
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:56 -05:00
Daniel Leung 08b4fd431b console/uart: use device name instead of index
Use device name to find the UART device for console usage, instead of
relying on an arbitrary index.

Change-Id: Iebe01c9bf392dfee6d8284367f67647f7d47561a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:56 -05:00
Daniel Leung 5faca5067a uart_pipe: let UART driver do the initialization
Remove the call to uart_init(), and let the UART drivers take care of
the port initialization.

Change-Id: Id3e46135ab993cb6596b1fb5339ab1664c65ab40
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:56 -05:00
Anas Nashif 48fad1d2cd shell: prefix types with shell_
To be consistent across the API.

Change-Id: I13081ac7d67a7bd2095925239f4431db96cd6242
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:55 -05:00
Thomas Heeley f85566a0b6 misc: add shell support.
Move btshell.h out of samples into include/misc and rename to shell.h

Move btshell.c into driver/console and rename to console_handler_shell.c
as an shell implementation based on new config
CONFIG_CONSOLE_HANDLER_SHELL.

Add shell_register_app_cmd_handler for an to app to optionally call so
that it can receive cmdlines not handled by the cmds registered with
shell_init

Change-Id: I5c1585e62ff7a0ee923c6c92833cc762cf912bad
Signed-off-by: Thomas Heeley <thomas.heeley@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:55 -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 fe218157b3 uart pipe: do not override objects in Makefile
uart_pipe when enabled was overriding all previous objects.

Change-Id: I5620b56dc7e42f887a7b78e07470e729a266d5f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Szymon Janc c0baad2262 Rename simple UART driver to pipe UART
Original name was too generic and confusing. This patch renames
driver to pipe UART and moves it to console drivers folder. Kconfig
destription is also improved.

Change-Id: I716fdbf7d636bbdc03b0fce27a59fd866f473246
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:52 -05:00
Dmitriy Korovkin f1420515a7 irq: Add flags to IRQ_CONNECT_STATIC() macro and irq_connect() function
Flags allow passing IRQ triggering option for x86 architecture.
Each platform defines flags for a particular device and then
device driver uses them when registers the interrupt handler.

The change in API means that device drivers and sample
applications need to use the new API.

IRQ triggering configuration is now handled by device drivers
by using flags passed to interrupt registering API:
IRQ_CONNECT_STATIC() or irq_connect()

Change-Id: Ibc4312ea2b4032a2efc5b913c6389f780a2a11d1
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:24:44 -05:00
Peter Mitsis b1c1020732 Add UART irq input hook to uart_console_isr()
Adds an input hook to be used by the interrupt handler uart_console_isr().
This hook permits the console input to detect a character escape sequence
that can be used to override the console's default input behavior.

This input hook can be set using the following API:
   void uart_irq_input_hook_set(struct device *dev,
                                int (*hook)(struct device *, uint8_t));

The hook returns 1 if the handler should stop processing the character,
and 0 if it should not stop.

Change-Id: I95e7da75e07fb6caaca2d45e80bfc4334a43c0ac
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:41 -05:00
Anas Nashif f140d6342c console: set range for UART_CONSOLE_INDEX
Catch cases where index is set to negative or wrong values.

Change-Id: Ieab73e0fb12cecfc6c3c3d74c7d41f640bc88f01
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:37 -05:00
Dan Kalowsky da67b29569 checkpatch: warning - block_comment_style
Change-Id: I6da43e41f9c6efee577b70513ec368ae3cce0144
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Andrei Emeltchenko c7b152932d galileo: Remove unneeded defines
If console handler is defined uart console should also be defined.

Change-Id: I3efcc6c837f8f1621340f7f13bf0603d7dc42fb2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:24:32 -05:00
Tomasz Bursztyka 17e06fb457 uart: Move generic API to root directory of include
Only driver specific public headers should be found in include/drivers.
All generic API are found in include/ directory.

Change-Id: Ic50931987bb9460fd4a3843abc6f5de107faf045
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:32 -05:00
Dirk Brandewie 147d6585ae x86: arm: Modify IRQ_CONFIG macro to have same signature as ARC
In order to have drivers that are usable cross architecture the
signature for IRQ_CONFIG needs to be the same to avoid #ifdef hell in
the driver code based on architecture.

Update the macro and it usage for existing drivers

Change-Id: I22e142b21d4e984add231d1dbd97020e4823985f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky 2e938481ce checkpatch: error - initialised_static
Change-Id: I8f51f861e2250c87c296b697ef5b6610ce644b34
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky a60c866c70 checkpatch: error - open_brace
Change-Id: I434037ce969bcd1fc08bd4b407f9508773e64b1e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:31 -05:00
Javier B Perez Hernandez f7fffae8aa Change BSD-3 licenses to Apache 2
Change all the Intel and Wind River code license from BSD-3 to Apache 2.

Change-Id: Id8be2c1c161a06ea8a0b9f38e17660e11dbb384b
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:29 -05:00
Andrew Boie 1cdb72b909 ipi_console_sender: enable printk() implementation
Change-Id: Ib4ce8b0bb128700dc1e3d72bf85ea1111f1a3880
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:21 -05:00
Dirk Brandewie f96f61d2f0 init: rename pure_early_init to pre_kernel_early_init
Change-Id: Id52cd7a5c1a715a5c609f88f940ec2e27341d81e
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie 4365f02391 init: rename pure_late_init to pre_kernel_late_init
Change-Id: I9561315a892933370d60fcf36c10d38078d66233
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie c48418f2bd init: remove pure_init macro
This macro is legacy from an early implementation of the init system
before the pure level was split into early and late phases remove it
now to avoid confusion going forward.

Change-Id: I6720874c840c9e14888fd6f411a8182e7420ca29
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:19 -05:00
Andrew Boie 086430e4a0 ipi_console_receiver: fix semaphore usage
Don't give on the semaphore if the ring buffer is full.
Fix a missing newline in a debug message.

Change-Id: Ic0030365665c32cc9f1c641f9dacffd1a1915b09
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:18 -05:00
Andrew Boie 9ae62b5bcc ipi_console_sender: filter out '\r'
Some platforms send over \r\n for newlines, just send over the \n.

Change-Id: Ia6072eb3719a4c7dd828457cf1634d16f4eec38a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:18 -05:00
Andrew Boie 7b52823f64 drivers/console: fix missing '+=' in Makefile
Change-Id: I9eaa40bed937ce2201a7b7f2b1c94c8c35b550d0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:18 -05:00
Andrew Boie 2a1e4266e8 IPI console driver with test case
This introduces a generic driver set for console messages routed over
inter-processor interrupt (IPI) channels. These drivers bind to a
low-level IPI driver instance for the actual transport of messages.

ipi_console_sender installs printk and/or stdout hooks to forward
messages over IPI. There is currently no buffering on the sending side.

ipi_console_receiver installs an IPI callback which stashes incoming
characters into a ring buffer, which is monitored by a nanokernel
fiber. The fiber buffers the characters on a per-line basis and sends
them to either printk or stdout. Multiple instances of this driver
may be created in case you need to receive console data from multiple
CPUs.

Change-Id: Icebc110794fbe040f975101cd2ae6e78fb38645a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -05:00
Andrew Boie 858decd162 misc: don't depend on serial drivers for printk()/printf()
We are introducing other kinds of drivers which support a console
that isn't over a UART.

Change-Id: I0dddbdce958437b5709c5ab26252ed47d030413d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -05:00
Andrew Boie d5feec5c64 ram_console: driver for emitting console messages to a buffer
This buffer can be examined at runtime with a debugger to see what
is going on. Helpful if there are no other working console drivers
on the system.

Change-Id: I759467a57d16204b4b316c4f6fa8b7d5e1d1d236
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:17 -05:00
Daniel Leung d8f10f4c01 uart_console: make baud rate configurable
Move the baud rate selection for uart_console into Kconfig.
This allows apps to specify custom speed. Default is 115200
which should be supported by almost all RS232 and USB adapters
out in the past few years.

Change-Id: I78649bf2a1b2ddfc90a20d611a6454e3ad3b1b3a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:25 -05:00
Daniel Leung c384571add console: uart_console: introduces CONFIG_UART_CONSOLE
This introduces the config option CONFIG_UART_CONSOLE,
and also CONFIG_CONSOLE. The UART console can finally
be disabled if desired.

The defconfigs are also being updated.

Change-Id: I5ebaf6471986deca105971e67fcddb43374de94a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:25 -05:00
Daniel Leung ad2d29689e console: uart_console: decouple uart console init from UART init
With this, the UART console has its own initialization which is not
dependent on UART init routines.

This will allow the app to utilize all UARTs for other purposes,
instead of always reserving one for console. Future patch
will enable this choice.

Note that the console init is effectively demoted to pure_init
from pure_early_init. The UART console depends on UART being
initialized, but there is no deferred init at this point.
So this initializes the console a bit later than UARTs,
simply to make sure the UART is initialized before using it.
Once there is a mechanism for some type of deferred initialization,
the UART console init can be promoted back to pure_early.

Change-Id: Iba95197b13384cb1a46e34c78638348b7a0bec8c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:25 -05:00
Daniel Leung 1ad2a56ee3 serial: rework functions to use struct device...
... instead of an array index to a global array. This is
an intermediate step to make the drivers conform to
the new driver model.

This only changes from using a direct array index to using
device structs. The UARTs are still staticlly defined.
Later patches will make the drivers utilize the driver
initialization procedure specified by the driver model.

Change-Id: I18041bbb4b0efdf8ae87088fd000b391d0827e9b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:25 -05:00
Anas Nashif d2fff1fb7a drivers: use subdir-ccflags-y for all drivers
All driver Makefiles are adding the same cflags and they
have been done inconsistenly, make all drivers inherit
from the top level Makefile and remove unused includes.

Change-Id: Ie66d0ba7a418ac26f7eb709f50c887dc682e935c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis 213db12fbf Move platforms to new arch/<arch>/platforms directory
Change-Id: I9ad5d51329d381c091aa47b482a8e38e7c194118
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Anas Nashif f367f071b6 doxygen: add @brief and capitalize
Remove function name from comment and add @brief instead.
Also capitilize first letter.

Change-Id: Ib708b49bf02e5bc89b0066637a55874e659637e0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:33 -05:00
Anas Nashif 1362e3c162 doxygen: RETURNS: -> @return
Previous comment style used RETRURNS:, use @return to comply
with javadoc style.

Change-Id: Ib1dffd92da1d97d60063ec5309b08049828f6661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:32 -05:00
Anas Nashif ea0d0b220c doxygen: change comment style to match javadoc
The change replaces multiple asterisks to ** at
the beginning of comments and adds a space before
the asterisks at the beginning of lines.

Change-Id: I7656bde3bf4d9a31e38941e43b580520432dabc1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:32 -05:00
Anas Nashif 8d879a5c32 define UART_CONSOLE_INDEX using Kconfig
Use Kconfig to define this variable and remove its
previous definitions from board.h. This will simplify
creation of different variants from a single platform.

Change-Id: I0aaa5aa81dedf096c6d8c1ea2d509c71817336d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:27 -05:00
Peter Mitsis 1ffabeaf3d Rename BSP_DIR to PLATFORM
Updates references to CONFIG_BSP_DIR to CONFIG_PLATFORM as part of the
BSP -> platform clean up.

Note that despite the renaming, the usage of the config option remains
unchanged.

Change-Id: I2846c3f761cf09871019c0855bf1824ae03e6b3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Dmitriy Korovkin 8d065343c2 Use static interrupt registration in device drivers
Make device drivers use static interrupt registration procedure.

DYNAMIC_INT_STUBS configuration parameter was used only by device
drivers to switch between static and dynamic interrupt registration
procedures. Now it is obsolete and is removed.

uart_int_connect() function is removed. If UART device driver still
needs to register interrupt dynamically, it should use
irq_connect(uart_irq_get()).

Change-Id: I80c695f337456e9b0c1b0fd56716e35794f7bdb7
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:25 -05:00
Anas Nashif bbe84f8ae5 Use ccflags-y and asflags-y instead of EXTRA_CFLAGS
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated." However, using make EXTRA_CFLAGS="-DSOMETHING" results in
EXTRA_CFLAGS from Makefiles being overwritten, obviously breaking the
build.  This patch converts to them to the newer ccflags-y which also
fixes the problem.

Change-Id: I6309439599d4c9cc184f9ecd941bde841982ef07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:14 -05:00
Dan Kalowsky c02dd34277 Renaming include/nanokernel to include/arch
Renaming the directory include/nanokernel to be include/arch, which
better reflects the real nature of the directory and the contents
inside.

Change-Id: I2bc33ebc6715e2f0403227a558279fdf52398ade
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:14:12 -05:00
Anas Nashif 89d50ec95a Kconfig: remove DRV_ configs
Change-Id: Id162a7fe3620f7ad2bc25fbbd55c90b800f9ef70
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:11 -05:00
Anas Nashif f4f5cc138c Kbuild: include files dynamically based on BSP_DIR
Change-Id: If36a03acb633c772d599ae1492ebabf04c432306
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz 70611f4c81 Kbuild: Fix duplicated ksymbol UART_INTERRUPT_DRIVEN.
This commit removes the UART_INTERRUPT_DRIVEN kconfig symbol from
the console section.
The symbols is already covered as a serial driver symbol and it
is a serial feature releated configuration option.

Change-Id: I4b9438d79eb7850b1293d5d963a75ce00733dbf7
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz c4535eeddf Kbuild: Kconfig source standard for drivers.
This commit standardize the Kconfig inclusion.
Selective sourcing of Kconfig files create conflict when merging
different configuration files (.config files).
Instead, now each kconfig symbols is dependant of its specific
DRV_* driver ksymbol.

Change-Id: I3d20d108a83f00d34067dc334758fd57e51feecf
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz d15251fec5 Kbuild: Kconfig license headers.
This commit add license headers to Kconfig files.

Change-Id: I79e60263b8c7b696463ecc84b8ad411af5415117
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz c818cd288c Kbuild: Additional Kconfig symbols.
This commit adds the following Kconfig symbols:
 - INIT_STACKS
 - UART_INTERRUPT_DRIVEN
 - CONSOLE_HANDLER
 - BUILD_TIMESTAMP
 - TICKLESS_KERNEL
 - CONTEXT_CUSTOM_DATA

Change-Id: Id96a7e759c8beac73f27193df07b5c7562379b2f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz 4ca3a4a515 Kbuild: Adaptation to the location change of driver headers.
This commit adaptes the Kbuild system to the change of location of
the header files for drivers.
Old location: driver/
New location: include/driver/

Change-Id: Ic49d373149ee44d781419c5c68e59408c8ef1c11
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz 808e5c4ba0 Fixes to Kbuild to build on ARM architecture.
This commit fixes issues to allow build on ARM architecture.
- It fixes the include paths in Makefiles.
- It fixes the include path for the offsets.c compilation.
- It fixes the linker command. This changes is needed because gcc
  ARM cross-compiler does not accept an AT() command without
  specifing an address explicitly. This corner case appears
  on ARM architectures when XIP is disabled.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ief8b53c4cc154abba7b7827121ec5a56f62b7b26
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz a05bce491f Kbuild fix for quark console driver.
This commit fixes the include path for quark BSP.

Change-Id: Idb9b5124476c0bec2d16a143407cd9d0c42e0801
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz f2ae6d5202 Creation of Makefiles for drivers directory.
This commit adds the Makefiles that describe the object-bundles
for the drivers directory and every subdirectory below.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Id77cff9cf0ab51827acc2aef32cbed3ec3ad586b
2016-02-05 20:14:04 -05:00
Andrei Emeltchenko 879541a918 console: Refactor serial console interface
Make serial console interface more robust. Enables interrupts only
when registering input, all memory is managed inside application.
Interface to application is changed to have two fifo queues. One
queue is a free line slots and another queue is keeping entered
lines. This way memory for lines is managed inside application which
provides free lines queue. It is also simpler to manage entered
lines by sleeping on fifo_get on app layer.

Change-Id: I4776c03eddd1e7d880df3b902bd48f5f2c901cad
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Tomasz Bursztyka ae09a48a7e console: Put the public API header in the right location
Only moving the header from drivers/console/uart_console.h to
include/drivers/console/uart_console.h so source file did not need to be
changed, only the defs.objs files to look into include/drivers/console.

Change-Id: I585e16b50d9ffecf01ca9225e80f0e101f62ee4c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:48 -05:00
Andrei Emeltchenko f1e1897ade console: Replace uartConsoleInit with uart_console_init
Rename camelCase uartConsoleInit function for consistency with the
rest of the code in serial console.

Change-Id: I519737070538e9c0f52a8d110a3eff68e0185ce2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:45 -05:00
Andrei Emeltchenko dfa5f2371b serial_console: Rename console_uart_isr to uart_console_isr
Following comments received during review rename console_uart_isr to
uart_console_isr for consistency reason.

Change-Id: Ibee1dec40ee19a9095f78969a07ffb73518fffbb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:45 -05:00
Andrei Emeltchenko 139c856403 Add serial console input handler
Serial console handler when registered allows to interact with serial
line. It can either execute callback from ISR or defer execution to
fiber or task. This will be used in Bluetooth development for tests and
simple interaction with Bluetooth stack.

Change-Id: Ia960b456a75062d614baea324608058d979aa11b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:41 -05:00
Inaky Perez-Gonzalez 8ddf82cf70 First commit
Signed-off-by:  <inaky.perez-gonzalez@intel.com>
2015-04-10 16:44:37 -07:00