* add arc mpu driver
* modify the corresponding kconfig and kbuild
* currently only em_starterkit 2.2's em7d configuration
has mpu feature (mpu version 2)
* as the minimum region size of arc mpu version 2 is 2048 bytes and
region size should be power of 2, the stack size of threads
(including main thread and idle thread) should be at least
2048 bytes and power of 2
* for mpu stack guard feature, a stack guard region of 2048 bytes
is generated. This brings more memory footprint
* For arc mpu version 3, the minimum region size is 32 bytes.
* the codes are tested by the mpu_stack_guard_test and stackprot
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
As the device tree is board specific we should be using the board
Kconfig variable to decide which .dts to use and not the SoC one for
arduino_101.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This option enables full debugging output for memory allocations.
As that can produce lot of output and slow down the device under test,
it is disabled by default.
The previous CONFIG_NET_DEBUG_NET_PKT will collect information about
memory allocations but will not print any output. Use "net mem" or
"net allocs" commands in net-shell to see the memory allocation status.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Because the name of the memory pool can be quite long, print
it last so that the columns get aligned nicely.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we are not in ESTABLISHED state, then there is no need to
try to resend any pending data packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the expire send timer expires, then it sends the packet.
If that happens, then we must not try to send the same packet
again if we receive ACK etc. which can cause re-sends to happen.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the packet sending is slow then we must NOT increment the ref
count when re-sending it. This is unlikely but can happen if there
are lot of debug prints etc. extra activities that prevent the driver
to actually send the packet fast enough.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that the sent flag is only set after we have really
sent the packet and the driver has verified that.
If the net_pkt_set_sent() is called while still in tcp.c, then
depending on how fast the device is, it might happen that the
retry timer expires before the packet is actually sent. This was
seen in frdm-k64f with ethernet and various debug prints activated.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is a backlog entry when TCP context is released, then
cancel the ACK timer if one exists.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure that a network packet is sent after calling
http_response_send_data(). Othwerwise the packets might be
piling up and not sent in timely manner.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The array of k_thread "t" was declared non-static in 2 different
C files. Make them static.
Semaphores only used in local C file now declared static.
Use of variable 't' in thread_tslice() no longer shadows global
definition.
Fixes build errors with XCC compiler.
Increase RAM requirement to 20K.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This is a header file, the definition for _trace_list_sys_ring_buf
needs to be 'extern' otherwise multiple instances of this variable
could be instantiated, leading to linker errors.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Some older C libraries do not have errno for EPFNOSUPPORT.
Fixes issues with newlib in some versions of Xtensa XCC compiler.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
C++ standard mandates that main() return an 'int' even though
Zephyr does not use it. Fix build error with XCC compiler.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The initial function prototype did not have 'inline' in it,
resulting in a compiler warning with XCC.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
It's never a good idea to redefine functions as macros if intended
to be unused in some configuration
- "statement with no effect" warnings
- "unused argument" warnings
- No type checking done if the macros are used
These have been redefined as empty inline functions.
Fixes compiler warnings with XCC.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The second 'const' is misguided, indicating that the returns pointer
value itself cannot be changed, but since pointers are passed by value
anyway this is not useful and was generating warnings with XCC.
The leading 'const' indicates that the memory pointed to is constant,
which is all we needed.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Inline functions declared in header files need to be declared
static. Fixes a compiler warning with XCC compiler.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
XCC assembler freaks out if a section name has __FILE__ in it,
forward slashes and quotation marks confuse it and result in
build errors.
This is not a perfect fix, its possible for two sections to collide,
but at worst this will result is some unnecessary space in noinit,
fooling gc-sections.
XCC also doesn't support __COUNTER__, use __LINE__ as a substitute.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Nobody should be including a compiler-specific toolchain header
like this, the generic toolchain.h shouls always be used.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Stop using CONFIG_I2C_x_DEFAULT_CFG to get the initial value. Since we
only support master mode we always default to it for initial config and
we get the bitrate from the device tree.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Stop using CONFIG_I2C_x_DEFAULT_CFG to get the initial value. Since we
only support master mode we always default to it for initial config and
we get the bitrate from the device tree.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add _i2c_map_dt_bitrate() that maps from a bitrate to the I2C zephyr
cfg bit fields used in i2c_configure().
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Clarify that the clock-frequency is the bitrate at boot and introduce
defines that .dts files can use to set the clock-frequency.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Added a define to use in code that provides the amount we need to shift
the speed settings in the i2c config params.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Older value of 256 was introduced in 1.7 times. Testing on
BOARD=96b_carbon with 2 weeks old codebase however showed that TX
thread stack however can grow to 324 bytes. Finally, with the
latest master, following stacks are reported on BLE disconnect
(with CONFIG_INIT_STACKS enabled):
rx stack (real size 1024): unused 452 usage 572 / 1024 (55 %)
tx stack (real size 384): unused 16 usage 368 / 384 (95 %)
Two outcomes:
1. TX stack needs increase.
2. Over time, the stack usage grows, plus variations in SPI
drivers should also be taken into account.
So, increase the stack size to 416 bytes, to leave some headroom
beyond the immediate values seen on 96b_carbon.
Jira: ZEP-2510
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Currently, the HTTP_NETWORK_TIMEOUT setting is hard-coded as 20 seconds.
Not every application may want to wait that long, so let's change this
to a CONFIG option: CONFIG_HTTP_CLIENT_NETWORK_TIMEOUT
NOTE: This also removes HTTP_NETWORK_TIMEOUT from the public http.h
include file. It was not being used externally to HTTP client sources.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Partial implementation of the IEEE 1003.1 pthread API, including
mutexes and condition variables in their default behaviors, and
pthread barrier objects. The rwlock and spinlocks abstractions are
not supported in this commit (both only make sense in the presence of
multiple SMP processors).
Note that this is the IPC mechanisms only. The thread creation API
itself is unsupported: Zephyr threads work differently from pthreads
and don't port cleanly in all cases. Likewise the "_INITIALIZER"
macros from pthreads don't work cleanly here, and _DECLARE macros have
been provided to statically initialize pthread primitives in a manner
more native to Zephyr
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add cross-referenced information on the 96b_carbon and
96b_carbon_nrf51 pages which disambiguates between the two "boards".
Also describe how to flash 96b_carbon_nrf51 with
samples/bluetooth/hci_spi and 96b_carbon with samples/bluetooth/ipsp
to support a Bluetooth HCI stack on 96Boards Carbon (the physical
board).
While we're here, make the documentation page for 96b_carbon match the
format in doc/templates/board.tmpl.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Various of the printk messages in this sample app don't have
newlines. Let's fix the output by moving to SYS_LOG_xxx() macros
instead, which don't need them anyway. This also makes it easier to
tell errors apart from other messages, etc.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
On 96Boards Carbon, Bluetooth is provided by a secondary nRF51 chip
connected to SPI_1, so enable this peripheral and its driver when BT
is selected.
Similarly, provide BT_SPI_* configs to integrate with the BT HCI SPI
driver. The files these config values apply to only get built when
CONFIG_BT=y, but this configuration can't be handled in the "if BT"
section in 96b_carbon's Kconfig.defconfig. This is because BT_SPI is
a choice value, and thus doesn't support a default setting.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Some targets (e.g. STM32-based boards) only have SPI drivers using the
new API. To support both these and existing, legacy SPI drivers in the
SPI HCI driver, abstract out the SPI API into shim routines.
There are no behavioral differences due to this patch. The next patch
will add support for the new API.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Add a sample application that allows a Zephyr-based Bluetooth
controller to interface with an HCI driver via SPI. This sample
implements the same BT SPI protocol already as Zephyr's HCI SPI
driver.
Currently, the sample only supports the legacy SPI API.
Provide a single configuration file, avoiding board-specific
files. Some board-specific configuration information must be provided
via other means:
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_PIN
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Michael Scott <michael.scott@linaro.org>