Commit graph

41176 commits

Author SHA1 Message Date
Rodrigo Caballero
314432e90f doc: Edit About Zephyr for readability.
Edit the content, adding bold text and headings for readability.
Revised the structure based on comments by developers.
Resubmitted to solve merge issues.

Change-Id: I7679eb7c71eab5cd18addcdb296c376923984494
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:29 -05:00
Rodrigo Caballero
ebbecd072b doc: Edits to the about.rst and simple.rst files.
Book titles need italics, other minor issues Line length fixed.
Markup errors corrected.
Resubmitted to solve merge issues.

Change-Id: I069463a45655e1bd4c57828008c0868083757344
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
0066da7b65 checkpatch: ignore PREFER_KERNEL_TYPES
u16 and other types are linux specific

Change-Id: I5df86fb511343ac0db18fd9b919f37a5cada6ef1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
9104031a96 toolchain: change aligned/used macros to support external c libraries
use __aligned__ and __used__ instead of aligned/used to avoid conflicts
with macros of the same name.

Change-Id: Ic36067dfc9df7ebcea486a075f759825d0dbde70
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
db13998741 toolchain: change section macro to support external c libraries
rename the sections macro to avoid conflicts with the same
macro being defined in sys/cdefs.h of an external libc.

Change-Id: I4d9e060eeff788ca4112c0ad3e98f0bea135f145
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
360682b5b5 toolchain: extend iamcu variant to support provided libc
Change-Id: I2c6681a4ea3a4c8bc2367a5e9d6baeabc5a0dd90
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
fa2e18b294 kbuild: make menuconfig work with local configuration
Calling 'make menuconfig' from an application will prepare
the configuration defined in the application (Makefile) and
will launch menuconfig with the correct configuration rather
than the default for the architecture.

Change-Id: I6c611ddaa23b67632c507291294a73b6c4283cea
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Rodrigo Caballero
a5e1b78141 doc: Changed the API table in the Bluetooth document.
Changed the existing API table to a list as it was done
in the Kernel Primer.

Change-Id: Ib0d7952c650316b414ac9258ab3c48e9f6c70c4e
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
cbfb62c93d checkpatch: Update to latest version from the Linux kernel
Lots of enhancements and bug fixes but primarily it fixes an issue
where checkpatch was reporting errors in lines that have not changed.

Change-Id: If141a294b92cbabd4ad8978a40168abb062aebfb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
20439b488e gcc: build with -fstack-usage
will generate an extra file that specifies the maximum amount
of stack used, on a per-function basis.

Using a static stack checker the data can be analysed, for example:
   http://dlbeer.co.nz/oss/avstack.html

Change-Id: I23bd8ce7c4516bd0c7ffb74504e6d379677f25f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Tomasz Bursztyka
d2669b7a00 spi: intel: Port 0 needs gpio driver to be ready if using it for CS
GPIO driver is initialized at pre-kernel-late level, if SPI does it too,
it will happen before GPIO (depends on the ordered list of
initialization). In order to ensure it gets GPIO initialized always
before SPI, let's set SPI to initalize at the next level: nano-early.

Change-Id: I6e34168c88fca0187a809bf5c7971492bd5acb5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:29 -05:00
Anas Nashif
ecf3951990 samples: disable exception debug for test_static_idt
This test fails with exception debug enabled.  Make sanity pass again
while we debug this issue.

Change-Id: I0df279d2ec2f8fb29c30d25ec0d05da18e929964
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Andrew Boie
be3e3b0f8c x86: Improve exception/trap debugging
Currently when an unhandled exception or trap occurs, we don't know
specifically which one happened. The CONFIG_EXCEPTION_DEBUG option
installs handlers for various exceptions and prints out details
when they happen.

Change-Id: I4d3fe4544c3e2583c4f83b306b86ac0595d9ce0e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:29 -05:00
Dmitriy Korovkin
4d2fa77334 spi: Fix SPI configuration flags
SPH and SPO flags are not mutual exclusive, this way
they need to occupy different bit fields.

Added missing () around _in_ parameters of macros as well.

Change-Id: I6175231dddaca84a2a3190a5d0a388496a549baf
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:24:29 -05:00
Rodrigo Caballero
8e56617761 doc: Edit the build systems's Targets Documentation.
Remove unnecessary bullets and replaced them with indentation.
Added articles and performed other edits for clarity, markup and style.

Change-Id: I390d04a6a3c20eabde2eb100cac4fc88a3ca8cc8
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:29 -05:00
Rodrigo Caballero
367a8a7c1a doc: Edit the Application Development information of the build system.
The document was edited for clarity, style, consistency, grammar, and
spelling.

Change-Id: If1af5cfd8285bb13606a1bff257177521af7ab3d
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:29 -05:00
Rodrigo Caballero
2a0f0bc150 doc: Edit the build system's toolchains documentation.
Edited grammar, spelling, style, markup and consistency.

Change-Id: I4629924d153d6ae3e8b2756fb382a8f761933599
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:29 -05:00
Rodrigo Caballero
c1c1ffe7f7 doc: Change API tables to lists in the Kernel Primer.
The tables in the Kernel Primer are changed to lists. Making it easier
to update them. Other minor changes were done to ensure consitency.
The :c: and :cpp: markup has been fixed. When the documentation for a
call exists, then it is linked.

Change-Id: I8f389a0a0ca7c5fe904c0a1fa520e2e499f1001b
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:29 -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
Peter Mitsis
5705d06874 x86: Properly initialize _interrupt_vectors_allocated[] bitmap
Updates the 'gen_idt' tool to generate a bitmap of (statically) allocated
interrupt vectors that is linked into the final image in a manner similar to
the static IDT. The kernel then uses this bitmap when dynamically connecting
an interrupt vector, thereby preventing the dynamic irq connections
from clobbering the static irq connections.

Change-Id: I0a8f488408dad4912736865179f32f63ff1ca98f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
56fa1a98d0 x86: Update generation of static IDT
Adds two new fields to the ISR_LIST structure (irq and priority) to allow
the decoupling of the vector ID and priority from the IRQ number at some
future time.

As a result of the addition of these two new fields, the gen_idt tool is
modified to both process these new fields as well as validate them.

Change-Id: I343dac68d99c78168a25b19784140f85d5db7578
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
3dc247825c Refactor gen_idt
Refactor gen_idt tool to detect more errors as well as be both more clear and
easily expanded.

Change-Id: I035a0666871733cc670f64302a1e85be455550ee
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
ad76795063 gen_idt: Fix issues found by checkpatch
Change-Id: Ib486d8453c16c093dd188cd9e84c1eb2282ab746
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
b8780c7813 gen_idt: Update file description section
Change-Id: Ice0c88228f5d79404277502f68594db91058344b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
25359412ba x86: Do not use IRQ priority for DPL
Fixes a bug in the x86 IRQ_CONNECT_STATIC() macro that resulted in setting
the DPL for the interrupt to the IRQ priority level.

Note 1: Using a proper value for the DPL (instead of the priority) prevents
the corruption of the other IDT fields.

Note 2: The priority of the IRQ is completely ignored.

Change-Id: Ic9f59bd91db4b356263f533cc26a0168b1d236e1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
3bcaad8a39 x86: Simplify _IntVecAlloc() logic
Instead of using logic choosing between invoking find_lsb_set() and
find_msb_set(), mask out the unwanted bits and always invoke find_lsb_set().
This also has the side benefit of simplifying the error checking when DEBUG is
enabled.

Change-Id: I7f3e529ab3807b4433291197793e79e371d06ae3
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
616ca21599 x86: Lock interrupts when connecting interrupts
When dyanmicaly connecting an interrupt via irq_connect(), interrupts must be
locked both when allocating a dynamic interrupt stub and when updating the
interrupt descriptor table (IDT) to prevent race conditions.

Change-Id: I9c68c1f73dda478880f1a32793a84cb6eb87735e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Peter Mitsis
ae448ff6ca Update galileo minimal footprint configuration
The galileo minimal footprint project requires at least 53 IDT entries
to accommodate the HPET.  This is due to the current algorithm used to
map an IRQ number to an interrupt vector.
            Interrupt vector = IRQ number + 0x20

Change-Id: I6de2cd72da631af04237615082823e7de65d8b22
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:28 -05:00
Rodrigo Caballero
e53aa04dc1 doc: Friendlier advice for contributing to project.
Edited file to have a friendlier tone regarding collaboration standards for the project.

Signed-off-by: Leona Cook <leonax.cook@intel.com>
Change-Id: I5e02b9d9065c3c9c4d96ed67215770167b9b94e1
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:28 -05:00
L.S. Cook
d229efe476 doc: cleaning up tone to be a little more polite to potential feedback givers
Gerrit review improvements

Signed-off-by: Leona Cook <leonax.cook@intel.com>
Change-Id: I39d00195c47ac015246068b308ef69e0ecb2d024
2016-02-05 20:24:28 -05:00
Anas Nashif
a401ddec57 remove linux configs and compile options not being used
The makefile has some options we do not have in Zephyr, so better
remove them to avoid any confusion and misconfiguration.

Change-Id: I35663261bceb741a28d35bdbe87df451aa298c86
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
1cc1ac4b2f move cflags setting to arch/<arch>/Makefile
Move Zephyr specific CFLAGS that depend on config options to
the Makefile where they can better be managed among other cflag
options.

Change-Id: Ia79a2f2def4f51857f6d661aa78e9fb7eb7a5e22
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
6f8d628d77 re-enable compile time option checking and make it conditional
When building a sinle application, use the compiler option checking
macro, disable macro if running sanity checks to speed up build
time.

Change-Id: I63b17f4bd9fdff9030f1b2550ec8b05ee0bc2df2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
2ce8d30892 remove nano/micro defconfigs, use 1 file only
Do not use micro_* or nano_* defconfigs, instead maintain platform
in one single defconfig and merge nano or micro support on top.

Change-Id: I0d5184f37865ed8312e516e48cf5a8584a287dfe
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
2cf0df018d sanity: build testcase defconfigs for config_whitelist
Originally, the config_whitelist was done on the platform level
ignoring any config options in the testcase. This change generates
the defconfig for all relevant testcases that have config_whitelist
and applies filters based on the testcase defconfig.
If we have many testcases using config_whitelist it might be a bit
slower, but it is more accurate.

Change-Id: Ie1e871e85f05196d04419d6cf9a87f9927bfbfd1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Allan Stephens
dcb31f140d samples: Add test code for sys_thread_busy_wait() API
Enhances the existing nanokernel context test application to
validate busy waiting.

Change-Id: I08cd74f74ed596f0baa30d879e1d98000b1d4c85
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Allan Stephens
843f8a6224 doc: Add documentation for sys_thread_busy_wait()
Change-Id: I71f405448f141ae02c28889afd3fc03ddef55ecd
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:28 -05:00
Allan Stephens
6ac33f2b9f kernel: Introduce sys_thread_busy_wait() API
Provides a way for a fiber or task to busy wait for a specified
period of time. This is useful in situations where a delay needs
to be performed without switching execution to another context,
such as:

1) It would take longer to switch to another context and then switch
   back again than to simply busy wait.

2) A delay is required by the kernel's main task (i.e. the nanokernel's
   background task or the microkernel's idle task). This task is not
   allowed to voluntarily relinquish the CPU because this would leave
   the kernel with nothing to execute in its place.

Change-Id: Icbe28613014f659e9528893ae58f7b8008c18a61
Original-work-by: Jeff Blais <jeff.blais@windriver.com>
Further-adapted-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:28 -05:00
Benjamin Walsh
136c18e683 sys_clock: add some more useful time conversion macros
Change-Id: I0ae05d1b9f871b7b832581552442409233cdec5e
Original-work-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
30d1387c5c sanity: add platform/arch exclude functionality
Change-Id: I8af20c04ba8b0872d5196aa166d2479bfa048275
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
07e195a273 samples: use arch_whitelist instead of config_whitelest
Change-Id: I1ef4a2e653ebaa1bf0e62bbc07b29f311c209092
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
f5e3be2af7 build: re-add initconfig to generate .config
run make initconfig to only create the .config in outdir.
The .config will be the result of the defconfig merged with the local
application config define in CONF_FILE.

Change-Id: If2a308ac3805d32cea8dd7be7a14772f22443600
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Anas Nashif
267db291e6 sanity: run sha256 on select platforms only
This test takes too long to run, do not run it on multiple
platforms of the same architecture.

Change-Id: I3f121cfd22b99f3910fcbb9ef45a53b0abf79360
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:28 -05:00
Tomasz Bursztyka
27e8c5beb2 samples: Add a tiny test application for ADC API
Currently useful only for Galileo.

Change-Id: I8d4fafd530e11a50f91cedd0de1691393f270b9c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:28 -05:00
Tomasz Bursztyka
5fbf815419 galileo: Kconfig: Add pre-configured settings for Galileo's ADC chip
Setting up the right SPI port, its configuration and max frequency.
Also, setting NANO_TIMEOUTS by default as it is required for delayed
operation inside ADC's driver.

Change-Id: I63b2b872ff858f1d80065a94ba3e2f303d279a67
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:28 -05:00
Tomasz Bursztyka
5bcdfbe255 adc: Adding driver for TI's adc108s102 chip
It's an SPI driven chip and proposes up to 8 channels for input
conversion. It's found on Galileo board.

Change-Id: I916367e9be0849812c6a509082a501730a01ce60
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:28 -05:00
Tomasz Bursztyka
935eedeedf byteorder: Add all remaining helpers for both little and big endian
- making bswap_16 and bswap_32 for both
- adding sys_be16_to_cpu, sys_cpu_to_be16, sys_be32_to_cpu and
  sys_cpu_to_be32

Change-Id: I3aacc91590ee584d83c512d78a9287380969d9aa
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
b6303c0236 galileo: Kconfig: Make SPI built by default
Taking the opportunity to set simpler driver names for port 0 and 1.

Change-Id: I994bc43daaf6bc43b0dad564a72577c874f72d2d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
524a50e61e spi: Add a utility pointer for the application on SPI callback
It might be needed sometime to get some private data forwarded to the
callback, thus such user_data pointer is the easiest way to proceed.
Adding a macro to set the word size as well.

Change-Id: I68cbe2d480120253ccb13f13c656a38c27e21604
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
ded73a41b1 spi: intel: Only look for TFS and RFS in status when handling isr
If those are not set it means the controller has nothing to request
anymore from the driver.

Change-Id: Ie7e834e82b931e4b02ded3f9f619735b31b0a121
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00