Commit graph

304 commits

Author SHA1 Message Date
Flavio Ceolin 0866d18d03 irq: Fix irq_lock api usage
irq_lock returns an unsigned int, though, several places was using
signed int. This commit fix this behaviour.

In order to avoid this error happens again, a coccinelle script was
added and can be used to check violations.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-08-16 19:47:41 -07:00
Ulf Magnusson 8cf8db3a73 Kconfig: Use a short, consistent style for prompts
Consistently use

    config FOO
            bool/int/hex/string "Prompt text"

instead of

    config FOO
            bool/int/hex/string
            prompt "Prompt text"

(...and a bunch of other variations that e.g. swapped the order of the
type and the 'prompt', or put other properties between them).

The shorthand is fully equivalent to using 'prompt'. It saves lines and
avoids tricking people into thinking there is some semantic difference.

Most of the grunt work was done by a modified version of
https://unix.stackexchange.com/questions/26284/
how-can-i-use-sed-to-replace-a-multi-line-string/26290#26290, but some
of the rarer variations had to be converted manually.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-15 04:10:10 -07:00
Nathaniel Graff 45d5d5db48 boards: riscv: Convert HiFive1 to DTS
Adds DTS bindings for sifive,pwm0, sifive,uart0, sifive,spi0, and
riscv,plic0.

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2018-08-13 18:35:38 -05:00
Zide Chen 07e913a1e5 ioapic: IOREGSEL register needs to be treated as 32 bits
If IOREGSEL register is not accessed with 32 bits, it may not be
intercepted by type 1 hypervisor correctly.

Signed-off-by: Zide Chen <zide.chen@intel.com>
2018-07-24 09:04:05 -04:00
qianfan Zhao dffac9ab74 driver: interrupt_controller: Add support for stm32f2
Add kconfig and c code for stm32f2 interrupt controller driver

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-07-05 11:26:07 -05:00
Ulf Magnusson 13cb4cbb5f drivers: interrupt_controller: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though, and is
inconsistent.

This will make the auto-generated Kconfig documentation have "No
defaults. Implicitly defaults to n." as well, which is clearer than
'default n if ...'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-03 17:11:31 -04:00
Yurii Hamann 75d3d94c90 drivers: interrupt_controller: stm32: STM32F7 EXTI support
This patch adds EXTI support for STM32F7 family
microcontrollers.

Signed-off-by: Yurii Hamann <yurii@hamann.site>
2018-06-28 08:29:32 -05:00
Karol Gugala 1765d75ff4 riscv32: riscv-privilege: Microsemi Mi-V support
This commit adds support for Microsemi Mi-V RISC-V softcore CPU
running on the M2GL025 IGLOO2 FPGA development board.

signed-off-by: Karol Gugala <kgugala@antmicro.com>
2018-06-20 11:57:07 -04:00
Karol Gugala 23a5b5d171 riscv32: riscv-privilege: integrate common code
This commit moves code from fe310 platform into RISC-V privilege common
folder. This way the code can be reused by other platforms in future.

signed-off-by: Karol Gugala <kgugala@antmicro.com>
2018-06-20 11:57:07 -04:00
Karol Gugala 5417f29def drivers: plic: do not compile plic for qemu target
RISC-V qemu does not use PLIC controller, so plic.c file fails to
compile with qemu target. This change disables plic if qemu is
chosen.

signed-off-by: Karol Gugala <kgugala@antmicro.com>
2018-06-20 11:57:07 -04:00
Erwan Gouriou 1002e904d5 drivers/exti: stm32: Use CMSIS IRQ defines instead of zephyr
stm32cube SDK provides defines for IRQ line numbers.
It was not possible to use them, since enum where not supported
by IRQ_CONNECT macro.
Use them in order to get rid of zephyr manually coded IRQ lines.
They will later be replaced by device tree definitions when
made available

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-06-13 11:43:56 +02:00
Rajavardhan Gundi e5b0e9ac07 DTS: interrupt controller: Define IRQ priorities for CAVS & DW ICTL
IRQ priorities for CAVS and DW were previously defined in Kconfig.
They are now defined via DTS and removed from Kconfig.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-06-11 17:27:58 -04:00
Rajavardhan Gundi ddba3d667d kconfig: Define the IRQ priorities for CAVS & DW ICTL
CAVS_ICTL_0_IRQ_PRI to CAVS_ICTL_3_IRQ_PRI and DW_ICTL_IRQ_PRI
are now defined in Kconfig. This addresses the issue #7811.

This was not throwing up any compilation error earlier as the IRQ
priorities are all hardwired in Xtensa and hence are unconfigurable.
They are dummy for Xtensa arch but may be applicable if used in some
other arch.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-05-29 15:46:41 -04:00
Rajavardhan Gundi dadf9e7a81 xtensa: intel_s1000: implement interrupt mechanism
intel_s1000 has multiple levels of interrupts consisting of core, CAVS
Logic and designware interrupt controller. This patchset modifies
the regular gen_isr mechanism to support these multiple levels.

Change-Id: I0450666d4e601dfbc8cadc9c9d8100afb61a214c
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Rajavardhan Gundi e3f2fa4f89 drivers: interrupts: introduce Designware interrupt controller
This interrupt controller is a designware IP that combines several
sources of interrupt into one line that is then routed to the parent
controller.

This implementation supports only the regular irqs with no support
for priority filtering and vectored interrupts. Firqs are also not
supported.

Change-Id: I8bdf6f8df4632b6d7e8a3ba9a77116771d034a48
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Rajavardhan Gundi 74016bb64c drivers: interrupts: introduce CAVS interrupt logic
CAVS interrupt logic is an intel IP that combines several sources of
interrupt into one line that is then routed to the parent controller.
CAVS stands for "connected Audio, Voice and Speech". This IP supports
4 lines which can have a max of 32 interrupts each.

Change-Id: Ia6be51428bedf1011d148ae1fc5d4c34252c05da
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 16:46:41 -04:00
Endre Karlson 8e401e505e driver: interrupt_controller: Add support for stm32l0x
Add kconfig and c code for stm32l0x interrupt controller driver

Signed-off-by: Endre Karlson <endre.karlson@gmail.com>
2018-03-10 11:42:25 -06:00
Leandro Pereira d9538ec6b3 drivers: system_apic: Correctly assert interrupt line number
The interrupt line number is an unsigned integer; it makes no sense to
compare if it is greater than or equal to 0.

Coverity-CID: 182602
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-16 22:59:40 -05:00
Rajavardhan Gundi 1e6adba9ef drivers/interrupt_controller: Introduce multi-level interrupt support
In a scenario where a platform harbours multiple interrupts to the
extent the core cannot support it, an interrupt controller is added
as an additional level of interrupt. It typically combines several
sources of interrupt into one line that is then routed to the parent
controller.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-02-06 22:39:05 -05:00
Anas Nashif 5656489ac8 drivers: ioapic: remove pre DTS kconfigs
All X86 boards now using DTS.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-29 10:38:32 -06:00
Kumar Gala f19ab5efba irq: move shared irq support under drivers/interrupt_controller
The shared irq support doesn't really require its own dir, lets merge it
into drivers/interrupt_controller.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-23 13:37:01 -06:00
Savinay Dharmappa 54239d50a4 dts: x86: Add interrupt controller node
patch adds interrupt controller node and interrupt
property for device nodes.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-12-15 11:22:55 -06: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
Wayne Ren 528c960ae7 arch: arc: Add the support of secure mode for em
In ARC's SecureShield, a new secure mode (currently only em) is added.
The secure/normal mode is orthogonal to kernel/user mode. The
differences between secure mode and normal mode are following:

* different irq stack frame. so need to change the definition of
  _irq_stack_frame, assembly code.

* new aux regs, e.g, secure status(SEC_STAT), secure vector base
  (VECT_BASE_S)

* interrupts and exceptions, secure mode has its own vector base;
  interrupt can be configured as secure or normal through the
  interrupt priority aux reg.

* secure timers. Two secure timers (secure timer 0 and timer 1) are
  added.Here, for simplicity and backwards compatibility original
  internal timers (timer 0 and timer1) are used as sys clock of zephyr

* on reset, the processor is in secure mode and secure vector base is
  used.

Note: the mix of secure and normal mode is not supported, i.e. it's
assumed that the processor is always in secure mode.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2017-12-13 12:05:33 -05: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
Gustavo Lima Chaves 9bb07ff69a jailhouse: add support for x2APIC mode for all LOAPIC accesses
Besides the fact that we did not have that for the current supported
boards, that makes sense for this new, virtualized mode, that is meant
to be run on top of full-fledged x86 64 CPUs.

By having xAPIC mode access only, Jailhouse has to intercept those MMIO
reads and writes, in order to examine what they do and arbitrate if it's
safe or not (e.g. not all values are accepted to ICR register). This
means that we can't run away from having a VM-exit event for each and
every access to APIC memory region and this impacts the latency the
guest OS observes over bare metal a lot.

When in x2APIC mode, Jailhouse does not require VM-exits for MSR
accesses other that writes to the ICR register, so the latency the guest
observes is reduced to almost zero.

Here are some outputs of the the command line

  $ sudo ./tools/jailhouse cell stats tiny-demo

on a Jailhouse's root cell console, for one of the Zephyr demos using
LOAPIC timers, left for a couple of seconds:

Statistics for tiny-demo cell (x2APIC root, x2APIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                          7         0
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_msr                            1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xapic                          0         0
vmexits_xsetbv                         0         0

Statistics for tiny-demo cell (xAPIC root, xAPIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                       4087        40
vmexits_xapic                       4080        40
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_msr                            1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xsetbv                         0         0

Statistics for tiny-demo cell (xAPIC root, x2APIC inmate)

COUNTER                              SUM   PER SEC
vmexits_total                       4087        40
vmexits_msr                         4080        40
vmexits_management                     3         0
vmexits_cr                             2         0
vmexits_cpuid                          1         0
vmexits_exception                      0         0
vmexits_hypercall                      0         0
vmexits_mmio                           0         0
vmexits_pio                            0         0
vmexits_xapic                          0         0
vmexits_xsetbv                         0         0

See that under x2APIC mode on both Jailhouse/root-cell and guest, the
interruptions from the hypervisor are minimal. That is not the case when
Jailhouse is on xAPIC mode, though. Note also that, as a plus, x2APIC
accesses on the guest will map to xAPIC MMIO on the hypervisor just
fine.

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
Gustavo Lima Chaves 97a8716a4f x86: Jailhouse port, tested for UART (# 0, polling) and LOAPIC timer
This is an introductory port for Zephyr to be run as a Jailhouse
hypervisor[1]'s "inmate cell", on x86 64-bit CPUs (running on 32-bit
mode). This was tested with their "tiny-demo" inmate demo cell
configuration, which takes one of the CPUs of the QEMU-VM root cell
config, along with some RAM and serial controller access (it will even
do nice things like reserving some L3 cache for it via Intel CAT) and
Zephyr samples:

   - hello_world
   - philosophers
   - synchronization

The final binary receives an additional boot sequence preamble that
conforms to Jailhouse's expectations (starts at 0x0 in real mode). It
will put the processor in 32-bit protected mode and then proceed to
Zephyr's __start function.

Testing it is just a matter of:
  $ mmake -C samples/<sample_dir> BOARD=x86_jailhouse JAILHOUSE_QEMU_IMG_FILE=<path_to_image.qcow2> run
  $ sudo insmod <path to jailhouse.ko>
  $ sudo jailhouse enable <path to configs/qemu-x86.cell>
  $ sudo jailhouse cell create <path to configs/tiny-demo.cell>
  $ sudo mount -t 9p -o trans/virtio host /mnt
  $ sudo jailhouse cell load tiny-demo /mnt/zephyr.bin
  $ sudo jailhouse cell start tiny-demo
  $ sudo jailhouse cell destroy tiny-demo
  $ sudo jailhouse disable
  $ sudo rmmod jailhouse

For the hello_world demo case, one should then get QEMU's serial port
output similar to:

"""
Created cell "tiny-demo"
Page pool usage after cell creation: mem 275/1480, remap 65607/131072
Cell "tiny-demo" can be loaded
CPU 3 received SIPI, vector 100
Started cell "tiny-demo"
***** BOOTING ZEPHYR OS v1.9.0 - BUILD: Sep 12 2017 20:03:22 *****
Hello World! x86
"""

Note that the Jailhouse's root cell *has to be started in xAPIC
mode* (kernel command line argument 'nox2apic') in order for this to
work. x2APIC support and its reasoning will come on a separate commit.

As a reminder, the make run target introduced for x86_jailhouse board
involves a root cell image with Jailhouse in it, to be launched and then
partitioned (with >= 2 64-bit CPUs in it).

Inmate cell configs with no JAILHOUSE_CELL_PASSIVE_COMMREG flag
set (e.g. apic-demo one) would need extra code in Zephyr to deal with
cell shutdown command responses from the hypervisor.

You may want to fine tune CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for your
specific CPU—there is no detection from Zephyr with regard to that.

Other config differences from pristine QEMU defaults worth of mention
are:

   - there is no HPET when running as Jailhouse guest. We use the LOAPIC
     timer, instead
   - there is no PIC_DISABLE, because there is no 8259A PIC when running
     as a Jailhouse guest
   - XIP makes no sense also when running as Jailhouse guest, and both
     PHYS_RAM_ADDR/PHYS_LOAD_ADD are set to zero, what tiny-demo cell
     config is set to

This opens up new possibilities for Zephyr, so that usages beyond just
MCUs come to the table. I see special demand coming from
functional-safety related use cases on industry, automotive, etc.

[1] https://github.com/siemens/jailhouse

Reference to Jailhouse's booting preamble code:

Origin: Jailhouse
License: BSD 2-Clause
URL: https://github.com/siemens/jailhouse
commit: 607251b44397666a3cbbf859d784dccf20aba016
Purpose: Dual-licensing of inmate lib code
Maintained-by: Zephyr

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
Gustavo Lima Chaves 1a8e72c913 loapic_intr: factor (out) APIC accesses in static functions
This will accomodate newer access models later, with variations of those
functions' contents.

Signed-off-by: Gustavo Lima Chaves <gustavo.lima.chaves@intel.com>
2017-11-07 08:58:49 -05:00
Maciej Debski 0d80a3b574 drivers: interrupt_controller: provide support for stm32f0.
Fixes #3923

Signed-off-by: Maciej Debski <maciej.debski@rndity.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-10-23 12:31:47 +02:00
David B. Kinder f00f58517b doc: replace UTF-8 chars
Some our Zephyr tools don't like seeing UTF-8 characters, as reported in
issue #4131) so a quick scan and replace for UTF-8 characters in .rst,
.h, and Kconfig files using "file --mime-encoding" (excluding the /ext
folders) finds these files to tweak.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-03 20:03:57 -04:00
Wayne Ren f8d061faf7 arch: arc: add nested interrupt support
* add nested interrupt support for interrupts
   + use a varibale exc_nest_count to trace nest interrupt and exception
   + regular interrupts can be nested by regular interrupts and fast
interrupts
   + fast interrupt's priority is the highest, cannot be nested
* remove the firq stack and exception stack
   + remove the coressponding kconfig option
   + all interrupts (normal and fast) and exceptions will be handled
     in the same stack (_interrupt stack)
   + the pros are, smaller memory footprint (no firq stack), simpler
     stack management, simpler codes, etc.. The cons are, possible
     10-15 instructions overhead for the case where fast irq nests
     regular irq
* add the case of ARC in test/kernel/gen_isr_table

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-10 12:47:15 -04:00
Yannis Damigos 6003b1d0d2 interrupt_controller: add STM32F303XC EXTI lines number
Add the EXTI lines number for the STM32F303XC

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2017-07-01 08:36:51 -04: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
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
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
Jean-Paul Etienne d7b713e5b8 interrupt_controller: added support for the SiFive Freedom E310 PLIC driver
The SiFive Freedom E310 Platform Level Interrupt Controller (PLIC) follows
the riscv PLIC specification as defined in the riscv privilege
architecture specification.

It provides implementation for the riscv PLIC APIs as
required by the riscv-privilege SOC Family for SOCs providing
support for the RISCV_HAS_PLIC config.

Change-Id: I95d02edb53deeccd91e490776e8e1dbfb82d235f
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-04-02 15:15:16 +00:00
Anas Nashif cd35c575ef Revert "sys_bitfield*(): use 'void *' instead of memaddr_t"
This reverts commit 1f2ee5c6bc.

Change-Id: I6d6662952450e54aea2ffbc43973a5ecc40767bb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-28 16:06:22 -05:00
Inaky Perez-Gonzalez 1f2ee5c6bc sys_bitfield*(): use 'void *' instead of memaddr_t
Current users of sys_bitfield*() are bending over backwards to cast
what is most of the times a pointer into an integer.

Bitfields can be better described with an void *, so
uint{8,16,32,64}_t or any other container can be used. Most
sys_bitfield*() operations, by extension, can do the same. Note void *
has byte arithmetic, like char *.

This change will also make it implicit, for any future split of the
address space between virtual (what the SW is seeing) and physical
(what the HW is seeing) way clearer, as the functions dealing with
physical, non directly referentiable/mappeable addreses to use an
integer type, like mem_addr_t.

- include/arch/ARCH/*asm_inline*:

  - sys_bitfield*() all modified to take 'void *'

    Note 'void *' arihtmethic is byte based, which makes some things
    easier.

- include/sys_io.h:

  - introduces DEFINE_BITFIELD
  - update docs

- tests/kernel/bitfield: remove all the cast contortions, use DEFINE_BITFIELD
  PENDING: update other TCs

- include/arch/nios/nios2.h, drivers/interrupt_controller/ioapic_intr.c:
  remove cast contortions

Change-Id: I901e62c76af46f26ff0d29cdc37099597f884511
Jira: ZEP-1347
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-02-28 14:37:54 +00:00
Benjamin Walsh ee659ae1a1 build: add _ASMLANGUAGE to all asm files
This avoids asm files from having to explicitly define the _ASMLANGUAGE
symbol themselves.

Change-Id: I71f5a169f75d7443a58a0365a41c55b20dae3029
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-24 13:34:51 +00:00
Adam Podogrocki c80023fca3 exti/stm32: add support for F334 & F373 MCUs
Change-Id: Ide3a3842077e6138ec9e6ce87bacf744632413bc
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-01-23 15:15:52 -06: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
Julien Delayen cd8504cc9c arcv2_irq: Add power management suspend/resume
In order to resume the ARC from deep sleep,
the interrupts need to be restored.

The FIRQ stack needs to be saved and restored
when performing sleep operations.

During early initialization, the sp in the 2nd register bank
is made to refer to _firq_stack.
This allows for the FIRQ handler to use its own stack.
Fast Interrupts cannot be used after sleep if this information
is not restored.

This patch adds the suspend and resume functions.

Jira: ZEP-1223

Change-Id: Ic81980f05aee6c1f7b8c46c743f2648c65b29486
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
2016-12-15 12:49:31 +00:00
Julien Delayen 2008af30e7 arc: Define _arc_v2_irq_unit device
Move interrupt initialization for the ARC to its own
device. The init function for the arc will be only
doing platform specific operations

Jira: ZEP-1288

Change-Id: Icb04c3622890021c65cd24cecf6cafee6c37caf9
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
2016-12-15 12:49:30 +00:00
Neil Armstrong c34b0e0ac3 stm32l4: add exti support
Add EXTI support for the STM32l4XX family.

Change-Id: Ia92f26eaf49899ea23fae05dd3a7357007c9db20
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-06 10:31:45 -06: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
Flavio Santes 290a2aba88 drivers: Remove unused parameter warning
This patch fixes the unused parameter warning found at the
following drivers:

- adc_ti_adc108s102.c
- gpio_dw.c
- gpio_k64.c
- exti_stm32.c
- pinmux_dev_atmel_sam3x.c
- pinmux_dev_k64.c
- pinmux_dev_stm32.c
- uart_atmel_sam3.c

Change-Id: I76a17d19176683130d57e8f48e5195e7785060f3
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-03 14:49:08 +00:00
Benjamin Walsh f6ca7de09c kernel/arch: consolidate tTCS and TNANO definitions
There was a lot of duplication between architectures for the definition
of threads and the "nanokernel" guts. These have been consolidated.

Now, a common file kernel/unified/include/kernel_structs.h holds the
common definitions. Architectures provide two files to complement it:
kernel_arch_data.h and kernel_arch_func.h. The first one contains at
least the struct _thread_arch and struct _kernel_arch data structures,
as well as the struct _callee_saved and struct _caller_saved register
layouts. The second file contains anything that needs what is provided
by the common stuff in kernel_structs.h. Those two files are only meant
to be included in kernel_structs.h in very specific locations.

The thread data structure has been separated into three major parts:
common struct _thread_base and struct k_thread, and arch-specific struct
_thread_arch. The first and third ones are included in the second.

The struct s_NANO data structure has been split into two: common struct
_kernel and arch-specific struct _kernel_arch. The latter is included in
the former.

Offsets files have also changed: nano_offsets.h has been renamed
kernel_offsets.h and is still included by the arch-specific offsets.c.
Also, since the thread and kernel data structures are now made of
sub-structures, offsets have to be added to make up the full offset.
Some of these additions have been consolidated in shorter symbols,
available from kernel/unified/include/offsets_short.h, which includes an
arch-specific offsets_arch_short.h. Most of the code include
offsets_short.h now instead of offsets.h.

Change-Id: I084645cb7e6db8db69aeaaf162963fe157045d5a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-12 07:04:52 -05:00
Julien Delayen f540cbc5c5 power: Add ARC power states and update sample
Add Low Power States support to the power shim layer
and show the usage in the quark_se sample.

States are defined as follow:
- SYS_POWER_STATE_CPU_LPS: SS2 with LPSS enabled
- SYS_POWER_STATE_CPU_LPS_1: SS2 with LPSS disabled
- SYS_POWER_STATE_CPU_LPS_2: SS1 with LPSS disabled

Jira: ZEP-994

Change-Id: Ie4b93f6e539cb53fc035be00280b66b2cb0d9fea
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
2016-11-11 03:28:54 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

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

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

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
Neil Armstrong 1f4c05aad9 stm32_exti: add support for controllers with more than 32 lines
Some STM32 have more than 32 EXTI lines. Add support for them.

Change-Id: I9a2561664d0d81664acf268bb2257dd99b596a44
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-04 10:01:03 +00:00
Amit Kucheria 95e7fb6c98 arm: st_stm32: Add support for STM32F4x SoC family
This patch adds support for the STMicroelectronics STM32F4x family in the
STM32 MCU line. Configuration is included for the STM32F401RE MCU.

Acknowledgements to Pawel Wodnicki's earlier submission from February that
was used as a starting point for this port. In the end, we rewrote all of it.

Change-Id: I9797c282ac3c0cc66a63b9d34821de95df537ef6
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-28 18:58:02 +00:00
Kumar Gala 89f71ba0e2 stm32: cleanup how we get external interrupt base addr
Move to utilizing an inline function for getting the base addr of the
external interrupt register region.  This is in prep for support more
than 32 external interrupts.

Change-Id: Ifdaad67703068395a7749543ef68435435e7c9ba
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-10-20 12:18:41 +02:00
Ricardo Salveti b035209080 drivers: exti_stm32: fix clear pending exti
Pending bit gets cleared by writing 1 into it, so don't use the previous
value and just write the line bit offset instead.

Change-Id: I4c88016bf53327b2670a144d3b994945f26fc002
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>¬
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2016-10-19 11:56:00 +00:00
Ricardo Salveti 17a62dd268 exti: stm32: fix driver data handling
Since dd5e90ec the device_get_binding call returns NULL unless the
driver_api is set by the driver. Since the exti driver only uses an
internal struct to store the callbacks, remove the need for the device
binding call from other drivers (e.g. gpio).

Change-Id: If0b733c27754108118d87ef02640311f0535ab57
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2016-10-19 11:56:00 +00:00
Anas Nashif f720bb12a7 mvic: fixed printk format
Jira: ZEP-970
Change-Id: Ie57938d3d1c4740a7a4aa0ed403d2b2cc0e36eae
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-24 08:12:47 -04:00
Andrew Boie 7c385bd8b1 ioapic: make init-time RTE masking optional
In some cases we can either assume they are already masked
at boot and save some cycles, or the IOAPIC has configuration
from a prior boot stage that needs to be preserved.

Change-Id: I0c71ff0f01a6ee13a3b9c9e239d5a933d6cb6542
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-23 17:54:19 +00:00
Andrew Boie d3831180cf apic: set initial PM state at build time
Change-Id: I7531088d0455fb405513787eb61137ff79ca8b29
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-23 17:53:49 +00:00
Andrew Boie 325cae5c94 kernel: remove lingering irq_connect_dynamic() references
This API no longer exists.

Change-Id: I724bee8c0ebfbbe2d47c00c7645977d817bbcd36
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-23 15:36:51 +00:00
amirkapl c490219d1e power_mgmt: Update sample and drivers according to new pm device API
Update the power sample and drivers with the new device driver power
management API using the existing logic

Jira: ZEP-954
Change-Id: Idd94232e458767635973e94e9fc673c01612c1e2
Signed-off-by: Amir Kaplan <amir.kaplan@intel.com>
2016-09-22 00:23:43 +00:00
Andrew Boie eeacd2061d mvic: default to IRQ 10 instead of 0 for timer
This is a better choice of default; on Mint Valley using IRQ 0
for the timer collides with the DMA Error IRQ line.

Issue: ZEP-849
Change-Id: I14cb60fbe548488198813b2351e0ed1f07c2d07d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-12 17:53:21 +00:00
Andrew Boie eec13ca8c1 interrupt_controller: allow for indeterminate faulting vectors
You can't query the LOAPIC for every kind of interrupt that fires,
it has no idea about IRQs that were generated by an 'int' instruction
for example. Extend the semantics of _irq_controller_isr_vector_get()
to return -1 if the vector can't be identified.

Issue: ZEP-602
Change-Id: I1174aa62fbedffdcd329d60da8ef14fabb042dc3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-08 12:47:14 -07:00
Andrew Boie e98ac235e6 x86: declare internal API for interrupt controllers
Originally, x86 just supported APIC. Then later support
for the Mint Valley Interrupt Controller was added. This
controller is mostly similar to the APIC with some differences,
but was integrated in a somewhat hacked-up fashion.

Now we define irq_controller.h, which is a layer of abstraction
between the core arch code and the interrupt controller
implementation.

Contents of the API:

- Controllers with a fixed irq-to-vector mapping define
_IRQ_CONTROLLER_VECTOR_MAPPING(irq) to obtain a compile-time
map between the two.

- _irq_controller_program() notifies the interrupt controller
what vector will be used for a particular IRQ along with triggering
flags

- _irq_controller_isr_vector_get() reports the vector number of
the IRQ currently being serviced

- In assembly language domain, _irq_controller_eoi implements
EOI handling.

- Since triggering options can vary, some common defines for
triggering IRQ_TRIGGER_EDGE, IRQ_TRIGGER_LEVEL, IRQ_POLARITY_HIGH,
IRQ_POLARITY_LOW introduced.

Specific changes made:

- New Kconfig X86_FIXED_IRQ_MAPPING for those interrupt controllers
that have a fixed relationship between IRQ lines and IDT vectors.

- MVIC driver rewritten per the HAS instead of the tortuous methods
used to get it to behave like LOAPIC. We are no longer writing values
to reserved registers. Additional assertions added.

- Some cleanup in the loapic_timer driver to make the MVIC differences
clearer.

- Unused APIs removed, or folded into calling code when used just once.

- MVIC doesn't bother to write a -1 to the intList priority field since
it gets ignored anyway

Issue: ZEP-48
Change-Id: I071a477ea68c36e00c3d0653ce74b3583454154d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 18:35:47 +00:00
Andrew Boie c545e19a00 x86: remove dynamic interrupts and exceptions
Change-Id: I7e9756e9a0735a7d8257ee2142d5759e883e12cc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 18:35:24 +00:00
Andrew Boie a69ea78b8a _loapic_isr_vector_get: fix implementation
The comments state that higher-numbered vectors have priority,
but the function was doing the opposite. The code now agrees
with the comments.

Change-Id: I1a689fc22c8355458bdd734d95ff637da0655533
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-13 22:41:51 +00:00
Chuck Jordan db6adc6d2e int: Set default ARC interrupts to lowest priority to start
The code was setting the interrupt priority to 1 for each
vector to start. But I think it might be more appropriate
to set it to the LOWEST priority. Some ARCs will have
upwards to 15 priorities.

Change-Id: I9330ec8df323fe04ba0751faaafa39694f012364
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-06-09 00:34:03 +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
Jithu Joseph 09a0c2f619 pm/loapic: suspend/resume support for LOAPIC
Provide functions of saving and restoring LOAPIC
states to support deep sleep.

Jira: ZEP-223
Change-Id: I1fb427989b021ec8e3a4f6dd0f4766a214360621
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:38 +00:00
Jithu Joseph b1625df534 pm/ioapic: Add suspend/resume support for IOAPIC
Save and restore IOAPIC flags and irq to vector translation
info for supporting deep sleep.

Jira: ZEP-223
Change-Id: Ifc50a5a72699ff6782ad194d8e96b18fac34da18
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:38 +00:00
Jithu Joseph 05158f76d7 pm/apic: Keep irq to vector table in RAM when needed by PM
In scenarios where device PM is enabled and dynamic irqs are
used, move the irq to vector table to RAM and keep it updated,
so that we can use this to restore IOAPIC/LOAPIC vector entries.

Jira: ZEP-224
Change-Id: I0d4350d4e30f8ca337a2a1d4f012748c3cb450f4
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:38 +00:00
Jithu Joseph 7c29fefd7d apic : Refactor some macros into a header
Moving few macros into a header file.

Change-Id: I975e19ba518bd6184038d6c1715224be7190b3ad
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-05-24 00:31:37 +00:00
Chuck Jordan 4ad41d8d7f arc: early init should invalidate d-cache and set vector table
Some ARC targets can have a data-cache. Although there is no special
instruction to clear exceptions during early init, it is necessary to
invalidate the d-cache BEFORE any data is fetched. The ARC on arduino 101
doesn't have d-cache, and will thus skip this d-cache invalidate.

Also, it is important to set the vector table base register to point to
the interrupt vector table EARLY, so that if an exception is encountered,
the correct vector table is found. Set this base only if it is found to be
different from the one compiled in to the code.
These initialization steps assure that proper exception handling
is in place during early init.

Change-Id: Ie8b5928e5813e104680a6d6510c85d32dc8ed8f3
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-11 11:10:52 +00:00
cjordan 42f7741712 drivers/interrupt_controller: initialize only NUM_IRQS interrupts
Change-Id: I33b4d09bc9255ab75bd25ef8938fc37e74e81038
Signed-off-by: cjordan <cjordan@synopsys.com>
2016-05-04 14:55:10 +00:00
Anas Nashif 4b411b34a1 stm32: rename SOC_STM32F1X -> SOC_SERIES_STM32F1X
Use SOC_SERIES_* for naming SoCs with similar features and architectures
with the goal of code reuse. The Series in the config variable should avoid
name collisions and clearly denote the relationships within an SoC family.

Change-Id: I7a98542f96b5d5dc3acc23782c4d45f98cceb599
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Anas Nashif 9bf2da7ef4 stm32: rename CONFIG_SOC_STM32 -> CONFIG_SOC_FAMILY_STM32
Use CONFIG_SOC_FAMILY for the top level SoC family. A family
will have different SoCs or different SoC series with multiple
SoCs.
Adding the Family string to the config variable to avoid confusion
between actual SoCs and families and to prevent name collisions.

Change-Id: Ic99a2c1df7850dee3a45641027af82464dd6fadb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Maciek Borzecki 33907674dd interupt_controller/stm32_exti: driver for STM32 EXTI controller
Introcuce a driver for External Interrupt/Event Controller (EXTI) found
on STM32 MCUs.

Change-Id: Ib206521fcc51b5dfaaf5dea9d436f8304f3a36be
Origin: Original
Signed-off-by: Maciej Borzecki <maciek.borzecki@gmail.com>
2016-03-18 20:53:06 +00:00
Andrew Boie 24f6f36ad6 system_apic: rename irq_enable/disable
Make this explicit to conform to the abstraction layer
defined in include/irq.h

This only worked before because the preprocessor was
substituting the function prototypes.

Change-Id: Id4d46b01f1c53c3a942772640023e23796eeb43b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-03-04 18:52:53 +00:00
Andrew Boie 9fc3afc339 x86: rebase priority levels
Having priority levels 0 and 1 reserved on x86 due to implementation
details on how the CPU uses the vector table is confusing to users,
and makes it unnecessarily difficult to share drivers between arches.

Now on x86, priority levels 0 and 1 are available. Semantically, all
priority levels have had 2 subtracted from them.

It is no longer necessary to specify a priority level when the
vector itself is specified. If an IDT entry has a specific vector
associated with it, any priority argument is simply ignored.

In gen_idt, some simplifications have been made:
- The printed representation of a generated entry now fits on one line
- Some checks being done in validate_priority() were redundant, as
  generate_interrupt_vector_bitmap() also ensures that there are
  sufficient free vectors within a priority level.

Change-Id: I26669d8ee0a53f48fbc2283490a8c42d8b1daf8e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-08 21:45:07 -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 7cb5276158 x86: remove NANO_SOFT_IRQ from zephyr
This was never implemented on ARC/ARM and has been superseded
by irq_offload().

Some checks that were only done with CONFIG_LOAPIC_DEBUG fall
under the category of 'shouldn't ever happen' and have been
converted into assertions, instead of propagating return values
which are largely never checked.

Change-Id: I4eedca05bb7b384c4f3aa41a4f037f221f4a9cfe
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif dcf046c72d rename basic_atom with minnowboard
Use a real board name that can run this kernel instead of a generic
name. Basic functionality exits on this board with Zephyr.

Setup of the board is mostly similar to what we have in galileo (EFI
based)

Change-Id: Ic8554f26dcac0dbbbb6d35d863482f6207dc63c5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Andrew Boie 999e706dba mvic: fix how local interrupts are programmed
MVIC has only one local interrupt: the timer IRQ. What IRQ line
to use is not fixed, instead it is programmed into the LVTTIMER
register. This is unlike LOAPIC which has a fixed IRQ for the timer
and instead the *vector* to use for it is programmed into LVTTIMER.

We don't want _loapic_int_vec_set() to do anything as the relationship
between IRQ lines and vectors is fixed and we do not want to be
programming vector numbers into bits 0-3 of LVTTIMER.

The IRQ line to use for timer interrupts is programmed into LVTTIMER
when the MVIC is initialized.

Change-Id: Icba0429f65ece7541fa8542814a8fdc39ad43936
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:05 -05:00
Andrew Boie 88808f1247 quark_se: apic: work around EOI forwarding issue
Quark SE Lakemont core has a hardware bug where the LOAPIC does
not properly notify the IOAPIC to clear the IRR bit for level-
triggered interrupts.

This patch introduces a workaround where the vector ID of the
in-service interrupt is manually written to the IOAPIC_EOI
register, resulting in the bit being cleared.

Unfortunately, in the context where EOI happens it's very difficult
to identify which IRQ line is being serviced, so this is done
unconditionally for all interrupts vectors whether they are registered
in the IOAPIC RTE table or not.

Change-Id: I639cd258dec4f50934e17eadbb821e6a7112e636
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:05 -05:00
Andrew Boie c25d6c5d63 loapic: handle spurious interrupts
A special situation may occur when a processor raises its task
priority to be greater than or equal to the level of the
interrupt for which the processor INTR signal is currently
being asserted. If at the time the INTA cycle is issued, the
interrupt that was to be dispensed has become masked (programmed
by software), the local APIC will deliver a spurious-interrupt
vector. Dispensing the spurious-interrupt vector does not affect
the ISR, so the handler for this vector should return without an EOI.

Change-Id: I4cf4744bd6efd68b72e2c380269de4181dc80bd9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:04 -05:00
Andrew Boie a0e427f8a4 x86: remove loapic_int_vec_trigger()
This was only needed for an older implementation of software interrupts,
now superseded by the irq_offload() API (which doesn't interact with
the interrupt controller at all)

Change-Id: I8aa696d370ae1799872f6d70de69f3cb5b47456a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:04 -05:00
Daniel Leung 77d167d004 ioapic: move common init code into driver
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.

Those empty C files are there because the current Kbuild
requires Makefile to be present at those directories,
(due to arch/x86/Kbuild), which requires building some object
files. So the empty source files are there to produce empty
object files to satisfy this.

Change-Id: I14056347ea14cff227d9e8960192e8673c0019b8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:03 -05:00
Daniel Leung 921ee03094 loapic: move common init code into driver
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.

Change-Id: I1d379068f64855d5d4595838040ec50f97f638a0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:03 -05:00
Daniel Leung 8778152298 i8259: move init code into driver
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.

Change-Id: I1af8b2888779b2b58367feaff9ee1a6d97b4873c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:03 -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
Yonattan Louise dc12b5d06a Add _loapic_isr_vector_get to mvic
The kernel event logger requires this function to obtain
the irq that is being processed, but this was not implemented
for mvic. This patch add this function to mvic.

Change-Id: I5e1b4a6e2758b69ec713c18ac9f78aebad18a93f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:57 -05:00
Anas Nashif 77ba3c3b8b kconfig: define architecture as a kconfig variable
Do not depend on environment variables and use a kconfig variable
for defining the architecture.

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

Change-Id: Ia001db81ed007e6a43f34506fed9be1345b88a4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif 7625b098b9 MVIC: handle boards with fixed IRQ to vector mapping
Change-Id: I319bc2a18310a6a6808fced3e142640e225236d2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -05:00
Anas Nashif 00c4d32d42 x86: add Quark D2000 Interrupt Controller (MVIC)
This module is based on the standard Local APIC and IO APIC source modules.

This modules combines these modules into one source module that exports the
same APIs defined by the Local APIC and IO APIC header modules. These
routine have been adapted for the Quark D2000 Interrupt Controller which has
a cutdown implementation of the Local APIC & IO APIC register sets.

Change-Id: Ic80aa78918483663d76054ebadefa08d8a3f188a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:48 -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
Andrew Boie 5e1ae08765 loapic: get rid of function call overhead for _loapic_eoi()
We generally call this in interrupt code, and since it's just a register
write, get rid of all the function call overhead.

Change-Id: I251fa3cee0841fcdd8eecc7941d4d3782d112e66
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:42 -05:00
Andrew Boie b43758d22a x86: remove dynamically generated IRQ and exception code
We are interested in supporting some XIP x86 platforms which are
unable to fetch CPU instructions from system RAM. This requires
refactoring our dynamic IRQ/exc code which currently synthesizes
assembly language instructions to create IRQ stubs on-the-fly.

Instead, a new approach is taken. Given that the configuration at
build time specifies the number of required stubs, use this
to generate a build time a set of tiny stub functions which simply
push a 'stub id' and then call common dynamic interrupt code.
The handler function and handler argument is saved in a table keyed by
this stub id.

CONFIG_EOI_HANDLER_SUPPORTED removed, the code hasn't been conditionally
compiled for some time and in all cases we call _loapic_eoi() when
finished with an interrupt.

Some other out-of-date verbiage in comments related to supporting
non-APIC removed.

Previously, when dynamic exceptions were created a pointer would
be passed in by the caller reserving ram for the stub code. Since
this is no longer feasible, two new Kconfig options have been added.
CONFIG_NUM_DYNAMIC_EXC_STUBS and CONFIG_NUM_DYNAMIC_EXC_NO_ERR_STUBS
control how many stubs are created for exceptions that push
an error code, and no error code, respectively.

SW Interrupts are no longer triggered by "int <vector>" hard-coded
assembly instructions. Instead this is done by sending a self-directed
inter-processor interrupt from the LOAPIC, using a new API
loapic_int_vect_trigger(). In this way we get rid of dynamically
generated code in irq_test_common.h.

All interrupts call _loapic_eoi() when finished, since this is now
the right thing to do for all IRQs, including SW interrupts.

_irq_handler_set() for x86 no longer requires the old function pointer
to be supplied.

Change-Id: I78993d3d00dd153c9051c518b417cce8d3acee9e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:41 -05:00
Andrew Boie 876c86e1a8 ioapic_intr: remove dead code
XIOAPIC_DIRECT_ADDRESSING and IOAPIC_MSI_REDIRECT are never
set and not tied to any config options.

Change-Id: Ib64cd198c99fe670eb5bcd946ce93f616c03d12a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:36 -05:00
Dan Kalowsky 2a57d02400 checkpatch: warning - spacing
Change-Id: Ia63d6c9d8d3c1bd9c540a039263cb8507af82b1e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:35 -05:00
Andrew Boie 090385b666 x86: remove boi handler support, eoi argument
This was only needed for the older 8259A style PICs which are no
longer supported.

Since we now just support APIC, we always just call loapic_eoi which
no longer requires an argument and informs the IOAPIC that the interrupt
is complete if necessary.

Change-Id: I15c9b7b4f03b872656220af32220b62e043bfa6b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:35 -05:00
Dan Kalowsky e8563c2f97 checkpatch: error - trailing_whitespace
Change-Id: I819d13f0d7a23e3a61dcda6a3ced18810b192158
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
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
Dan Kalowsky 3a109b1f00 Adding in doxygen comment headers
Moving many of the functions from the old format of inline comments to
the newer doxygen format.

Change-Id: Ib0fe0d8627d7cd90219385a3ab627da8f9637d98
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky e4bb957a00 checkpatch: error - pointer_location
Change-Id: I9ce224cb75ba21caecffd6747833257f748b5ecf
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky 39063598db checkpatch: error - spacing
Change-Id: Ie6e1c43581dd4b0734625b3a4e59a4ca79619e99
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
Dirk Brandewie 25c9d021a5 x86: move IOAPIC driver to device model/init system
Change the IOAPIC driver to be initialized directly from the init
system. The function signature of _ioapic_init() function is updated
accordingly.

Change-Id: I2f824ac745926966eebb23f60445a41e1df9eb8f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:18 -05:00
Dirk Brandewie be1b1a4e35 x86: move LOAPIC driver to device model/init system
Change the LOAPIC driver to be initialized directly from the init
system. The function signature of _loapic_init() function is updated
accordingly.

Change-Id: I5ed26d53524c8526d413a05ac9a7a58dd4264c5a
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Dirk Brandewie 1bcb7a339a x86: Move PIC driver to device model/init system
Change the PIC driver to be initialized by the init system. To be
initialized by the init system the function signature of the
_i8259_init() function needs to be changed to the standard *_init()
function signature specified by the device model.

Change-Id: I63bf1cd0ce78920fa20da94f5966e5aab4bf41b2
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Dirk Brandewie dbd25aeb3b x86: Change SHUTOFF_PIC to PIC_DISABLE
Make config variable name match the function.  The PIC is never turned
on in the zephyr code so there is nothing to shut off.

Change-Id: I1627e5a35cc37ef7959f36758c1e1aec03e22782
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:15:41 -05:00
Dirk Brandewie 7b3e7544d1 x86: move drivers to sys_{in,out} functions from PLB_* macros
These x86 drivers are the last users of the PLB_* macros change to use
the sys_{in,out} functions.

Change-Id: Iebd0ad1bf5e74379498f86b24d835a0430db1311
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:15:41 -05:00
Anas Nashif 71ad87c7d0 loapic: add LOAPIC_DEBUG for debugging loapic
Change DEBUG option into something more specific.

Change-Id: If1f421fbf7d234ad6bfac410697205d5d74548c0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Anas Nashif 476a823c94 loapic: cleanup comments
Change-Id: I98c5ffea85fb951d993bcb6f7f6fe305a419d03a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:36 -05:00
Dirk Brandewie 0a7e4d1b9b Fix arc interrupt configuration
The _ARC_V2_IRQ_VECT_BASE register must be set to the vector table in
flash.

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Change-Id: Ied5451c98222f545cd669967023aef26c3d8e48e
2016-02-05 20:15:35 -05:00
Yonattan Louise d2108bf084 Profile interrupt events.
Add the interrupt profile points for x86 and ARM arquitectures. This
gives information regarding the time when interrupts occur.

Change-Id: Ic876c0e7f9e8819d53e0578416f09146f4456d3d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:15:28 -05:00
Anas Nashif 45a387fc46 ioapic: cleanup code comments and doxygenize the file description
Use doxygen format for file documentation and move 
parameters to be part of the function comments.

Change-Id: I01c0614e7cd3ef4c689d2aec3aa3e52e0d21ffcd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:20 -05:00
Anas Nashif 8cc32b8209 Enable IO-APIC debgging
Change-Id: I4f6c4400ec24d424b481703711d70bb5aff4f7e3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis c963861d47 Remove PIC code, but not PIC disabling code
Removes the non-PIC disabling PIC code as the PIC is not a supported interrupt
controller.  The PIC disabling code remains as it is needed to prevent the
generation of spurious interrupts from the PIC (see CONFIG_SHUTOFF_PIC).

Change-Id: Ic59aa17ab96f34685a5d7b5f24cab391de47edca
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis dbaa4a45ed Use LOAPIC and IOAPIC Kconfig options
Removes the LOAPIC and IOAPIC macros from board.h as they are no longer
appropriate since Kconfig options exist to use in their stead.

Change-Id: I2ce41a7a08d1859682389f35cd5a97c0e2cd5bf7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis 2db3db4ce2 Create IOAPIC and LOAPIC Kconfig options
Creating the IOAPIC and LOAPIC Kconfig options permits future commits to remove
those settings from the relevant board.h files.

Change-Id: Ie33c703f39c68d6e251d67b1c7cf75a0dd56a7e6
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis b643468280 IOAPIC defaults to y when LOAPIC is enabled
For as long as the IOAPIC and LOAPIC code is coupled (as it currently is),
enabling LOAPIC must select IOAPIC to be enabled as well.  If future commits
separate the two, then the "select IOAPIC" can be dropped.

Change-Id: Ibe7e6b86e5add19b8b3cc68ebecce760d8914c86
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:20 -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
Benjamin Walsh 6ebb212e18 ioapic: remove comment about split kernel
The Zephyr kernel must always be built as a monolithic image, not as
separate nanokernel and microkernel images.

Change-Id: I44fdd2349b32f409c84710f58bc4b3fe96fd79b7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis 2a4a6cf578 Remove references to BSP from drivers/ directory
Removes references to obsolete BSP terminology.  Where appropriate, replaces it
with platform terminology.

Change-Id: Ifb17f98bc12d3a28198810351629a109abdc18a5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:43 -05:00
Dmitriy Korovkin 63fe84bdaf Fix PIC shutoff.
Disable the PIC upon initialization to prevent it from
generating spurious interrupts.

Change-Id: I08ba1d00e269e1fd1d32960dcb844e9fa1ccc195
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:42 -05:00
Peter Mitsis dff49566e0 Kconfig: Update CONFIG_IOAPIC dependencies
Selection of the IOAPIC requires that the LOAPIC be previously selected.

Change-Id: I13d95d4bb4ff02c1aebb0b5e573cb2b89dbe530b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:41 -05:00
Peter Mitsis 53b721a706 Cosmetic: Fix whitespace in interrupt controller Kconfig
Change-Id: I2eb4184189925bcfe433617286a364dc1e35100c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:41 -05:00
Peter Mitsis 2871ca32d3 Rename x86 platforms
Changes the the names of the x86 platforms so that they are more generic.
  generic_pc -> ia32
  quark -> ia32_pci

NOTE: it is expected that the two platforms will eventually be merged into one.
one. At present, the two platforms support different hardware.  For example,
the ia32 supports bluetooth whereas the ia32_pci does not, and the ia32_pci
supports both PCI and HPET whereas the ia32 does not.

Change-Id: I8a980aaef55be8c59f7d19ddeb7fafbf11253408
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -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
Peter Mitsis 7e28edbc96 Generalize interrupt_controller include path
Improves code consistency by abstracting the architecture directory in the
set of assembly include paths.

Change-Id: I4b3638419a1242cb0628f128c5e3b82c3357d83c
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
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
Anas Nashif 08f8b65f25 arc: move interrupt controller to drivers/
Change-Id: I731c99062f4b5d2d4d1eb6a3c546ed5f3e494fa4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:26 -05:00
Dmitriy Korovkin 6dd108a263 IRQ_CONNECT_STATIC implementation for x86 platform
In order to simplify x86 interrupt stub creation, each interrupt
controller implements an interrupt stub definition macro.

Add IRQ_CONNECT_STATIC() for static interrupt registration, and
construct the interrupt stubs name from device and interrupt
handler names.

Add IRQ_CONFIG() macro for the interrupt controller configuration.
On x86 platform it programs APIC to associate an IRQ number with
the interupt vector.

Add HPET_TIMER0_INT_PRI parameter to Quark platform header to
make it build correctly.

Change-Id: I24ad25e1aa807ffa63733a27ad882877fcad72af
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:25 -05:00
Anas Nashif 9485729b3a Rename *.s files to *.S
Change-Id: I706a06e287f9e8e52c1cee4863c36673b21762f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:21 -05:00
Dirk Brandewie 09d2770377 x86/bsp: move io apic driver to drivers/interrupt_controller
Change-Id: I00f400e0405f526dd17cf22c703fab4a4968fce0
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:21 -05:00
Dirk Brandewie 124a27f210 x86/bsp: move local apic driver to drivers/interrupt_controller
Change-Id: I69350493c3b94d754f89fb37eaebe50a8076384b
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:21 -05:00
Dirk Brandewie 526e132eb1 x86/bsp: move PIC (i8259) driver to drivers/interrupt_controller
Change-Id: I383424667f291ad4985781a7e6566c01c76ba5e0
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:20 -05:00
Allan Stephens 5189844df5 Eliminate VxMicro branding in kernel code
Eliminates references to the obsolete OS name. In most cases the
name is simply removed, as it isn't necessary.

Change-Id: I32f9e7390e436aec008a9454b72657e129d65152
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens a1bd59de35 Eliminate obsolete coding convention comments
Gets rid of single-line comments required by a previous set of
coding conventions. These comments provide no value to readers
and just clutter things up.

Change-Id: I2a08b12cf5026253de56979efdfc510e7e68defe
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:14 -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 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 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 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
Yonattan Louise 323e0a133e Rename _I8259SpuriousIntCount to _i8259_spurious_interrupt_count
Updating global variable's name to follow a consistent naming convention.

Change accomplished with the following script:

   #!/bin/bash
   echo "Searching for ${1} to replace with ${2}"
   find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: Ifadb978e31770eb9f4987a3205483aad9a525b86
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Inaky Perez-Gonzalez 8ddf82cf70 First commit
Signed-off-by:  <inaky.perez-gonzalez@intel.com>
2015-04-10 16:44:37 -07:00