Commit graph

444 commits

Author SHA1 Message Date
Dmitriy Korovkin dc76dbf2ef unified: Add tickless idle support for ARC
Change-Id: I89684e7bee379be0a18f64e4f2c39ae132fe7e6d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-10-22 01:27:01 +00:00
Peter Mitsis 96cb05ca50 unified: Add tickless idle support for x86 and ARM
Change-Id: I42d20355321f431900727768a0836ee18e96b667
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-04 20:02:50 +00:00
Ramesh Thomas 0d2b8224b1 timer: Fixes a build error when MVIC is used
MVIC does not have _REG_TIMER_CFG defined because it does
not have a timer config register. Add checks for MVIC at
places where it is used.

Jira: ZEP-1015
Change-Id: I59f5c43cc2d1b17cf9e88b940631c2542e9729ab
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-03 17:28:02 +00:00
Andrew Boie edeb1f1c52 x86: interrupts: optimize and simplify IRQ stubs
Interrupt stubs now just push the ISR and parameter onto the stack
and jump to the common interrupt code, never to return.

Change-Id: I82543d8148b5c7dfe116c43f41791f852614bb28
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-28 20:28:06 +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
Javier B Perez 035ec8249d drivers: timer: cortex_m_systick remove dead code
Removed CONFIG_INT_LATENCY_BENCHMARK dead code.
CONFIG_INT_LATENCY_BENCHMARK depends on ARCH="x86", it will never
be true for ARM code.

Change-Id: Ia5779a69b1bf670ebb140c2923c9fe0af6b781d4
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-21 23:11:41 +00:00
Javier B Perez d4429bfb88 drivers: timer: loapic remove unused workaround
Removed unused workaround in loapic. There are no references
of usage.

Change-Id: I8700b4b7ce8efef5e7b95e6cdd2b201eae3f1f37
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-21 14:51:34 +00:00
Benjamin Walsh 3caec4e95d unified/drivers: adapt timer drivers to unified kernel
They must provide the k_cycles_get_32() API and must not refer to
command packets: the latter do not exist on unified kernels.

Change-Id: Ia354dc060e5ad2595850f97da82d8feb590d16b7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Ramesh Thomas fa175975e9 power_mgmt: Make device_pm_ops definition static
DEFINE_DEVICE_PM macro was not defining device_pm_ops
as 'static'. Fixes the issue and impacted areas.

Jira: ZEP-639
Change-Id: I5e1de6af97bf7b2b690af0c81034ce167e655e43
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-09-12 00:28:05 +00: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
Benjamin Walsh 36ece00163 arc/soc: remove unused CONFIG_TIMER0_CLOCK_FREQ
Defined in all SoCs, but never referenced anywhere. That definition has
been replaced by CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC.

Change-Id: I1801f72a03925717ded6fbfdef22b1993f843461
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-08-27 10:49:01 +00:00
Andrew Boie 533c2ee30d arc: fix management of IRQ priority levels
A previous re-work of IRQ priorities was led astray by an incorrect
comment. Priority level 1 is not a non-maskable interrupt priority.
In addition, zero latency IRQs are not implemented on ARC.

Timer driver now doesn't specify IRQ_ZERO_LATENCY (as that wouldn't be
correct) and its IRQ priority is now tunable in Kconfig. The default is 0.

IPM driver on both ARC and x86 side were being configured with hard-coded
priority of 2, which wasn't valid for ARC and caused an assertion failure.
The priority level is now tunable with Kconfig and defaults to 1 for ARC.

Issue: ZEP-693
Change-Id: If76dbfee214be7630d787be0bce4549a1ecbcb5b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-17 20:51:05 +00:00
Andrew Boie 96cadd1a9a arc: move special-purpose irq priorities to flags
We have already done this on x86 and ARM. The policy is as follows:

* IRQ priority levels starting at 0 all have the same semantics and
do not have special properties. The priority level is either ignored
on arches which do not support programmable priority levels, or lower
priority levels take precedence over higher ones.
* Special-case priorty levels are specified via flags, in which case
the supplied priority level is ignored.

Issue: ZEP-60
Change-Id: Ic603f49299ee1426fb9350ca29d0b8ef96a1d53a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-26 15:06:28 +00:00
Ramesh Thomas 8f0fdb668a timer: Adds device suspend/resume to loapic timer
This is part of a change to enable device suspend/resume and
Deep Sleep support in applications. Adds suspend/resume handling
in loapic timer.

Jira: ZEP-512
Change-Id: I9da2c8419bd9109fb71ef5a6caf736de7c7de9e1
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-07-21 11:25:31 -07:00
Andrew Boie 133dab4a63 altera_avalon_timer: new timer driver for Nios II
Tickless idle is not yet supported. We program the timer period
to the desired system clock tick rate (sys_clock_hw_cycles_per_tick).

This was renamed to the same name used in the Altera Embedded IP
Peripherals Guide; used by other CPUs than Nios II.

Change-Id: Ic4fca8c16b923295b77b63f98f45cd3483c5f560
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 19:00:35 +00:00
Ramesh Thomas a4568aac44 arc: fixes a missing declaration compile error
Building microkernel for ARC causes a compiler error
due to missing declaration of _sys_idle_elapsed_ticks.
Declare this as extern.

Jira: ZEP-397
Change-Id: I83701f693fea0fcb1ae2c30e0c52abe7987de1f1
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-05-26 02:15:06 +00:00
Chuck Jordan 49dec0dad5 arc: clarify in comment that ARC must have timer0
The timer implementation for ARC currently requires timer0 to be present.
I've added a comment that this is an assumption and to encourage developers
to build the ARC CPU with Timer0, when it is to be used with Zephyr.
There is also an optional provision for a Timer1. In future, this
code could be conditional to use either timer.

Change-Id: I4eb3aec59ba4e85f8b70d5531b21bdaab00b93bb
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-09 20:56:51 +00:00
Andrew Boie 9433895954 nios2: basic build, non-functional
Basic build framework for Nios2. Everything is stubbed out,
we just want to have a build going so that we can start to
parallelize implementation tasks.

This patch is not intended to be functional, but should be
able to produce a binary for all the nanokernel-based
sanity checks.

Change-Id: I12dd8ca4a2273f7662bee46175822c9bbd99202a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:45 +00:00
Ramesh Thomas bb19e6f82f power_mgmt: Make names consistent with new RFC
Changed names of Kconfig flags, variables, functions, files and
return codes consistent with names used in the RFC. Updated
relevant comments to match the changes.

Origin: Original
Change-Id: Ie7941032d7ad7af61fc02928f74538745e7966e8
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-26 14:35:11 -04:00
Dmitriy Korovkin 661d2f3a16 microkernel: Add support for *_sleep() during initialization
Add support for task_sleep() and fiber_sleep() during the
system initialization. When CONFIG_NANO_TIMEOUTS defined,
before the k_server() starts, kernel uses nanokernel
system clock announce and task sleep functionality.

To give device drivers early sleep functionality, the system
clock has to start on SECONDARY initialization level, same
as most of the drivers.

Change-Id: Ie1d391945cd1cfb9a5dc199783c2d224eb1b0ef3
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-26 10:17:15 +00:00
Simon Desfarges 9abc29e3ae arc_timer: assert that counter always lower than limit
ASSERT are put each time the timer0 limit register or the timer0 count register
is modified.

Change-Id: I38684d57803de285f4e26c68b449c71396e4c750
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
2016-03-24 12:05:37 +00:00
Simon Desfarges a51f88638e arc_timer: fix tickless idle
When exiting from tickless idle uppon an external IRQ, the TICK timer
is set to fire at next TICK boundary. The current algorithm can lead
to a point that timer0_count register is higher than the timer0_limit
register.

In this situation the next TICK will fire after the counter has
wrapped and performed another cycle (~133 seconds).

This condition appears when the counter reaches the limit after the
Interrupt Pending flag is checked. At this point the counter is
automatically wrapped to 0, but is set just next to the limit to fire
at next TICK boundary by SW. At exit of the _timer_idle_exit function,
the timer handler is called, and sets the limit to 1 TICK. At this
point the situation is:
- limit register == 1 TICK
- count register is just below the old limit register and higher than
  1 TICK

To fix this issue, at _timer_idle_exit, the limit register is always
set to 1 TICK and the count register set such as the next TICK fires
on time.

Change-Id: Ifa002809d426aa04109592e53d2b02a224f51101
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
2016-03-23 17:21:25 +00:00
Simon Desfarges e6ded3f581 arc_timer: fix wrong programmed limit when entering idle
The timer counts from 0 to programmed_limit included.

Change-Id: Ifc8585210c319f5452fafc911d4f6d72c4b91eaa
Signed-off-by: Simon Desfarges <simon.desfarges@intel.com>
2016-03-23 17:21:24 +00:00
Anas Nashif 4f9239984f Revert "microkernel: Add support for *_sleep() during initialization"
This reverts commit 0d50329105.

This breaks sanitychecks in CI. The early_sleep kernel test case is failing
randomly.

Change-Id: I015f20699c052b4089076699fc0180945c4d3d16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-03-11 22:08:44 +00:00
Dmitriy Korovkin 0d50329105 microkernel: Add support for *_sleep() during initialization
Add support for task_sleep() and fiber_sleep() during the
system initialization. When CONFIG_NANO_TIMEOUTS defined,
before the k_server() starts, kernel uses nanokernel
system clock announce and task sleep functionality.

To give device drivers early sleep functionality, the system
clock has to start on SECONDARY initialization level, same
as most of the drivers.

Change-Id: I5b3cf3da4c8d8398a966e901ab211f2fcee18dd6
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-03-10 18:39:33 +00:00
Benjamin Walsh e893869435 Revert "sys_clock: start the microkernel ticker in the MICROKERNEL init level"
This reverts commit 3c66686a43.

That commit fixed announcing ticks before the microkernel was up, but
prevented devices initializing before the MICROKERNEL level from having
access to the hi-res part of the system clock, which they could not poll
anymore.

Change-Id: Ia1c55d482e63d295160942f97ebc8e8afd1e8315
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-11 17:26:06 -05:00
Sergio Rodriguez 4dee326306 tickless idle x86: Tickless idle support on nanokernel for x86
Modifications to timer drivers and interrupt setup, to manage
the tickless idle for the x86 architecture

Change-Id: Ie02d484b7e5636de6ea382ba2eeed57e704c8498
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-02-11 19:10:24 +00:00
Benjamin Walsh 3c66686a43 sys_clock: start the microkernel ticker in the MICROKERNEL init level
The ticker was always initialized in the NANOKERNEL init level. In a
microkernel, this can cause problems if for the some reason the
initialization of the microkernel server is delayed, such as devices
initialization in the NANOKERNEL level taking non-insignificant time to
complete. What happens in that case is the ticker ISR will start firing
and piling up events in the microkernel server stack, and quite quickly
overrun it, since it has a finite size, causing random crashes.

So, in the microkernel, initialize the ticker once the microkernel
server is available. There is no point in sending ticker event before
anyway.

Change-Id: Ie9e13184f6ad35954023faf3bbff26242284b7be
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-10 01:35:14 +00: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
Tomasz Bursztyka d08ac2f241 clock: Make sure the clock is initialized prior to devices
On NANOKERNEL level only of course. Some devices, initialized at this
level, may require to get the clock running already.

Change-Id: Id2dd830d915474aac6c080068c2cf356cf841e0c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Andrew Boie d9cfbd5a61 interrupts: new static IRQ API
The interrupt API has been redesigned:

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

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

Change-Id: I280519993da0e0fe671eb537a876f67de33d3cd4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:17 -05:00
Andrew Boie 2a8843a262 timers: don't build if there is no system clock in use
Change-Id: Ic1463d632562383c3fa0b0b1666a52a0d9a5c4de
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:16 -05:00
Peter Mitsis aad3ba5134 arc timer: Fix tickless idle tick announcement
Change-Id: Iad6806c7be76661987652a63deb70a740c0d8e15
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Peter Mitsis 9cfd0de410 arc: add nanokernel tickless idle support in timer0 driver
Change-Id: Id2ee328458c5a1be944e90c34bbc2158464be325
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Peter Mitsis c100aa825f arc: Remove misleading comment in Timer0 driver
Change-Id: I42051af9503272b3b7a4dd7dfaf66ae7eb38c133
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:13 -05:00
Dirk Brandewie 88ce5bc8f5 kernel: remove CONFIG_INT_LATENCY_BENCHMARK fences from code path
Add null definitions for the interrupt latency measurement API so we
can remove compile fences in C code.

Change-Id: If86eedf79afcb49002108814dd4fb864956eb667
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:25:04 -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
Juan Manuel Cruz bc1a79c4c3 irq: removes priority parameter from IRQ_CONFIG macro
Removes the 'priority' parameter from the IRQ_CONFIG macro.
This parameter was not used anymore in any architecture.
The priority is handled in the IRQ_CONNECT macro.
The documentation is updated as well.

Change-Id: I24a293c5e41bd729d5e759113e0c4a8a6a61e0dd
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:57 -05:00
Daniel Leung ddab92c23a hpet: move content of include/drivers/hpet.h into driver
The content of include/drivers/hpet.h is really private to
the driver and does not need to be exposed in public include
directory. So move the content into driver code.

Change-Id: Ica442e43c480a6b079b8d3c4e75e67adcfd0ba6b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:56 -05:00
Peter Mitsis 53af19050d timer: Remove deprecated routines
Removes the following deprecated routines:
	nano_cycle_get_32()
	task_cycle_get_32()
	fiber_cycle_get_32()
	isr_cycle_get_32()

Those routines have all been replaced by sys_cycle_get_32().

Change-Id: I8709952633bb87c8963e88caffe1036fb9add527
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:55 -05:00
Peter Mitsis 92b21c7153 timer: Rename _sys_clock_cycle_get()
Renames _sys_clock_cycle_get() (provided by the timer driver)
to sys_cycle_get_32().  It is the preferred method to read the
hardware clock.

Change-Id: Ifea5213d8c04a8bf7b9114b048c5db0ccee61549
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:55 -05:00
Dmitriy Korovkin 57f2741e4f init: Implement fine-grained initialization policy
Put initialization priorities as device driver Kconfig
parameter.

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

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

Change-Id: I2f4f3c7370dac02408a1b50a0a1bade8b427a282
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -05:00
Benjamin Walsh bb94fbfd1f hpet: set sys_clock_hw_cycles_per_sec at runtime
The HPET reads its frequency at runtime, and thus must set all relevant
global constant values at runtime as well.

Change-Id: I965102bbdcea370297d5a2bbe14177ec0d0d3794
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh fcc2017563 timers: fix indentation in Kconfig
Change-Id: I917690b83d5ef85e338487e489423bda614eaac3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -05:00
Benjamin Walsh fde6458f0b sys_clock: add option for setting timer frequency at runtime
Some timer devices, such as the HPET, read their frequencies at runtime.
All global constant values must be set at runtime in that case.

Change-Id: I408babce6deb857748a87691132d7e27e88f0bb8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:53 -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 ac1f343c9a timer: Support for no local Apic Timer divider
Change-Id: Ic9c167761e31233e821da364121c01f3971a8f13
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
Benjamin Walsh 1e60ee31bc timer: allow enabling of sys_clock_disable()
Create the SYSTEM_CLOCK_DISABLE configuration option.

Change-Id: I9174fa2758988240d0850233146bb1e1d37a07c3
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:43 -05:00
Benjamin Walsh ac1148e1de timer: rename SYSTEM_TIMER_DISABLE/timer_disable
Rename them to SYSTEM_CLOCK_DISABLE and sys_clock_disable to put
the symbols in the proper namespace and to align with the rest of
the timer APIs.

Change-Id: I341cdb1bd6cc01e5662d8526c293d4e0acd6ec24
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:43 -05:00
Benjamin Walsh d44799de3e systick: remove unused stack variable
Change-Id: I065814867bf8f150e420412d45fadc10e6af7485
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:43 -05:00
Yonattan Louise e378747706 Rename Profiler to Event Logger.
In order to have a name according to the functionality of the feature.
This commit rename any text, function and variable related with the
Profiler name to Event logger.

Change-Id: I4f612cbc7c37965c35a64f06cc3ce5e3249d90e5
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:24:41 -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
Dan Kalowsky 2a63743192 cleanup: removing NOMANUAL
The \NOMANUAL tag is a remnant from days of yore and is no longer
needed or useful.  Cleaning up the code references to this.

Change-Id: I1b8cc9c9560d1dbb711f05fa63fd23386789875c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:35 -05:00
Dan Kalowsky 890cc2f1ef checkpatch: warning - line_spacing
Change-Id: I2276676142deea21cf8079449ce153f2fb887a8e
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 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 d11f8ecf9f checkpatch: error - static_initiazation
Change-Id: I6e3dc44be7bb6d01a7181d8c8e90cdb72120c3db
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
Dirk Brandewie 147d6585ae x86: arm: Modify IRQ_CONFIG macro to have same signature as ARC
In order to have drivers that are usable cross architecture the
signature for IRQ_CONFIG needs to be the same to avoid #ifdef hell in
the driver code based on architecture.

Update the macro and it usage for existing drivers

Change-Id: I22e142b21d4e984add231d1dbd97020e4823985f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky 2e938481ce checkpatch: error - initialised_static
Change-Id: I8f51f861e2250c87c296b697ef5b6610ce644b34
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:31 -05:00
Dan Kalowsky 978851fb6a checkpatch: code_indent failures
Corrects the checkpatch code_indent failures

Change-Id: I2ff93b8907d3eddbaa543ccbd12aecef8af7f698
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
Peter Mitsis e54276391b loapic_timer: rewrite tickless idle for loapic timer
Rewrites the LOAPIC timer tickless idle implementation to cover all edge cases.

Change-Id: Ide0a235f298dfc5c75a090a45d1bf8275d81e248
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:59 -05:00
Peter Mitsis 170b0c9251 loapic_timer: Rename global variables and routines
Renames the following global variables and routines to both improve
readability and comply with naming conventions:

Variables:
	counterLoadVal          -> cycles_per_tick
	clock_accumulated_count -> accumulated_cycle_count
	max_load_value          -> cycles_per_max_ticks
	idle_original_ticks     -> programmed_full_ticks
	idle_original_count     -> programmed_cycles

Routines:
	_loapicTimerStart()            -> timer_interrupt_unmask()
	_loapicTimerStop()             -> timer_interrupt_mask()
	_loapicTimerSetCount()         -> initial_count_register_set()
	_loapicTimerPeriodic()         -> periodic_mode_set()
	_loapicTimerOneShot()          -> one_shot_mode_set()
	_loapicTimerSetDivider()       -> divide_configuration_register_set()
	_loapicTimerGetRemaining()     -> current_count_register_get()
	_loapicTimerGetCount()         -> initial_count_register_get()
	_loapicTimerTicklessIdleInit() -> tickless_idle_init().

Change-Id: I2c1daa226d846e5be1aaad28d984d9f52bd02c00
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:59 -05:00
Peter Mitsis 00bb89357e loapic_timer: Remove tickless idle skew
Removes tickless idle skew calculation as it is not particularly useful.
The actual "skew" may vary wildly depending upon whether cache is involved
or not.

Change-Id: Ie5c966eba5cdc3cff2610d4c1f3bb673c83ec8b7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:59 -05:00
Peter Mitsis da384d5610 timers: Fix _sys_idle_elapsed_ticks name in comments
Fixes two missed replacements of
    _SysIdleElapsedTicks -> _sys_idle_elapsed_ticks
in the timer drivers.

Both were previously missed due to typos.

Change-Id: If55c9624df6f3bd7188e249f74d3ee3de61a68e4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:59 -05:00
Anas Nashif ebcdaf8ddd ia32_pci: HPET_TIMER depends on IOAPIC & LOAPIC
Change-Id: Id175712b88b434d9e3335f0736da8c2f04a95675
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:58 -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
Benjamin Walsh bb2ba33f10 sys_clock: move [nano|task]_cycle_get_32 to drivers
The drivers provide _sys_clock_cycle_get(): moving the public APIs to
the drivers allow them to be aliases of it.

Change-Id: Ic5975a048f2b51f94510f0c3cd5e6ab3a8907718
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Benjamin Walsh 87eeaa3249 sys_clock: rename timer_read to _sys_clock_cycle_get
Follow coding conventions.

Change-Id: I3ca5d1cf4eaacfc09d5e8c44c49be447549537c8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Dmitriy Korovkin 35e31e9c0c Fix level triggered interrupt handling
Fix the option that enables level triggered interrupts usage.
It depends on CONFIG_HPET_TIMER_LEVEL_HIGH and CONFIG_HPET_TIMER_LEVEL_LOW
configuration parameters.

Change-Id: I3529b1e57b1625e6f0f4b05d9c15eb563e9c4f83
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:26 -05:00
Dmitriy Korovkin 93b0ced44b Order hardware and device initialization
The initialization procedures need to be called in the
following order:
- basic hardware initialization;
- devices initialization;
- hardware clock initialization, that the kernel needs to
  run the kernel server.
This way, the board initialization routines is placed
to the pure_early_init level to make sure it runs first,
all device initialization procedures run at pure_init level,
so they are initialized early enough to be used for debugging
if needed. Hardware clock initialization is placed on
nano_early_init level to make sure hardware clock is initialized
just before the kernel server starts.

Change-Id: Ieecf9f0252c47c621b7208969687dc1113fc2ad0
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:15:26 -05:00
Peter Mitsis dba5ac622c Remove PIT code
The PIT is an unsupported device.  On x86 based platforms, the LOAPIC_TIMER and
HPET_TIMER are the only supported timers.

Change-Id: Ic890838c811b7eb62008aef0c8a92786f1579217
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 658bb54ed1 Use LOAPIC timer Kconfig options
Removes the LOAPIC timer macros from board.h as they are no longer required
since appropriate Kconfig options exist to use in their stead.

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

NOTE: No defconfig files have been modified as the LOAPIC_TIMER configuration
option is not enabled in any of them.

Change-Id: I7d97ed089cd4b734566b698183be95d3a166d71f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis be211ba91c Fix LOAPIC timer comments
Fixes a copy-paste error that inadvertently had the LOAPIC timer being
referred to as the PIT.

Change-Id: I4760d150cd6feb76b7d7384845898c6276bace83
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:20 -05:00
Peter Mitsis 578d417e87 Use HPET timer Kconfig options
Removes the HPET timer macros from board.h and uses the HPET timer Kconfig
options in their stead.

Change-Id: Ia0b3cd87716277ac25f12deb31d5c5934f355050
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis 366962557c HPET: Add additional Kconfig options
Adds additional Kconfig options to the HPET timer for setting its base address,
IRQ, IRQ priority and condition for triggering an interrupt.

Change-Id: I80349c60237380129da9ef41ccf6850c6b874c3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -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 ac60583b76 drivers: rename cortex_m_timer to cortex_m_systick
The name of the device is SYSTICK. The device name should be part of the
file name, like all other timer drivers we support. The name
'cortex_m_timer' said nothing about which device the driver is for, since
it's way too generic: it could be for any timer present on any Cortex-M
board.

Change-Id: I39b4f79c32516ec9aff82c55c0ca639fad1b52bb
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 8b0271dd2c Adapt HPET driver to work with QEMU
Qemu implements HPET so that it is connected to IRQ 2, which makes
necessary to use it in legacy emulation mode.

Add legacy emulation mode to HPET driver.

Change the way the HPET driver is initialized. QEMU requires that
the mode (one shot or periodic) gets set prior loading comparator
value.

Add debugging mode to HPET driver to ease the next port.

Change-Id: I668325d5968451585519a08b6c41863cf6e37f88
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:42 -05:00
Peter Mitsis d2857404f5 Kconfig: fix SYS_CLOCK_HW_CYCLES_PER_SEC dependencies
Fixes the SYS_CLOCK_HW_CYCLES_PER_SEC Kconfig option dependencies such that
it can be overridden by a modified platform configuration file.  This is
particularly important for the LOAPIC timer driver as
SYS_CLOCK_HW_CYCLES_PER_SEC is dependent upon the target's CPU/bus frequency.

Change-Id: I0fb49b4c540888cb1988c76e2a711a85e756f82c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:42 -05:00
Peter Mitsis d8a5c03404 Kconfig: Update timer driver dependencies
Updates the timer driver dependencies to simplify the selection of a timer
driver.  The timer driver menu only lists those drivers that are compatible
with the previously selected interrupt controller.

Change-Id: I5deea315f7c373c6660bacc411c6374e7b0ae84d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:41 -05:00
Peter Mitsis 61f0ce44c7 Kconfig: Remove option LOAPIC_TIMER_FREQ
The LOAPIC_TIMER_FREQ Kconfig option is not used.

Change-Id: I919fd2128f667e0b91467cb542041449738dd992
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:41 -05:00
Peter Mitsis dc0fb7ed38 Cosmetic: Fix whitespace in timer driver Kconfig
Change-Id: I2d44567756faee030a26004973ad8c306a47bbcd
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:41 -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 03ab32a66a Microkernel timer uses new driver initialization
Update microkernel systems to use the new driver initialization model on the
timer driver.

Change-Id: Ida9ef2a395d0dddf4104d490d78b13b11ea3c347
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Peter Mitsis 27e01a060a Nanokernel timer uses new driver initialization
Update nanokernel systems to use the new driver initialization model on the
timer driver.

Change-Id: I22d8619f56052f094482d73ab34c9d610492d8c0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Peter Mitsis 6e95fe0356 Update _sys_clock_driver_init() interface
Prepares the _sys_clock_driver_init() routine to interface with the new driver
model.  To this end, it must accept a pointer to a device structure and return
an integer.

Change-Id: I3c600ce1efb49c0864aae7b09663ca40d6289372
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Peter Mitsis 1bafa75ef1 Rename timer_driver() to _sys_clock_driver_init()
The revised name conforms to Zephyr OS naming conventions.

Change-Id: I5bcdaf1df7da9d8ce5787a08b29ead91dd8f24ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:33 -05:00
Peter Mitsis 136bef3c5d timer_driver() no longer takes a parameter
Removing the parameter to timer_driver() as it is not used.

Change-Id: I09275287eeb541be0dd315056b4f2bc6cbc2573c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:33 -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 d5f926fb4d Relocate Cortex-M timer driver
Moves the Cortex-M timer driver so that it resides with the other timer
drivers.

Change-Id: I3324c53356efd9f5fd88752a98e4ae301ea38d47
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Peter Mitsis 10a56b5a00 Add CORTEX_M_TIMER Kconfig option
Adds the Kconfig option for selecting the Cortex-M systick timer.  This helps
pave the way for moving the Cortex-M systick timer into the drivers/ directory.

Change-Id: Iee040083a425c9c1dbc5973991b89239e0a72eee
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Peter Mitsis 1ffabeaf3d Rename BSP_DIR to PLATFORM
Updates references to CONFIG_BSP_DIR to CONFIG_PLATFORM as part of the
BSP -> platform clean up.

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

Change-Id: I2846c3f761cf09871019c0855bf1824ae03e6b3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Anas Nashif f547c36df8 arc: move arc timer to drivers/
Change-Id: If4dccbf3bbe67c89b69aed1d62025bf867405d22
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:26 -05:00
Allan Stephens 478128cf9e Rename kernel's clock_vars.h to sys_clock.h
The revised name better reflects the fact that the file defines
macros in addition to declaring variables. In addition, most of
these APIs use the "sys_clock_" prefix, which aligns well with
the new file name.

Change-Id: Ib33517d4b19ec2455303b87200c677e87640fcbc
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:26 -05:00
Dmitriy Korovkin 8d065343c2 Use static interrupt registration in device drivers
Make device drivers use static interrupt registration procedure.

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

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

Change-Id: I80c695f337456e9b0c1b0fd56716e35794f7bdb7
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:25 -05:00
Dmitriy Korovkin 660878e4e2 irq_connect for x86 uses static stub array
In order to provide the same irq_connect() on all platforms
on x86, irq_connect() now uses a static array of interrupt
stubs. Device driver does not need to provide interrupt stub
to irq_connect() function.

Add NUM_DYNAMIC_STUBS configuration parameter, the number
of interrupt stubs used for dynamic interrupt registration.

Modify tests for unified interrupt register API

Tests that deal with interrupts are modified to work
with the new interrupt registration API.

Add CONFIG_NUM_DYNAMIC_STUBS option to dynamic interrupt projects

Projects that use dynamic interrupt handler registration on x86
have to include CONFIG_NUM_DYNAMIC_STUBS parameter in the
configuration.

Change-Id: Ic90c726485521a57cf695fd3edc8cac85d0b827d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:25 -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
Dirk Brandewie 11edf422b4 x86/bsp: move local apic timer driver to drivers/timer
Change-Id: I74f7297d21f3acf4a457ca335162602b35f4f6c1
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:21 -05:00
Dirk Brandewie 73d74a5abb x86/bsp: move hpet driver to drivers/timer
Change-Id: I63c361a586d2fd8c03674febd58bc1dfd2658fdc
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:14:21 -05:00
Oleg Zhurakivskyy cf59dda4a5 Fix compilation with CONFIG_DYNAMIC_INT_STUBS
Change-Id: I153747d441e8efe7a2941b01ef0cedda7e58237c
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2016-02-05 20:14:20 -05:00
Allan Stephens 893726ccb6 Eliminate duplicate registration of system tick event handler
Since the system generator pre-registers K_ticker as the handler
for the system tick event, there is no need for the timer driver
to re-register it at run time.

Change-Id: I7f20c19e5c6ccc7dfb6117aa2d2647b9dec0e549
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:19 -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 bb9ab0322e Eliminate unnecessary references to cpu.h and cputype.h
Gets rid of places where there is no need to include these files
at all, or places where these files are being indirectly included
due to the inclusion of nanokernel.h.

Change-Id: I7b58148af454b977830c00a6b519a78d0595603b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:14 -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
Peter Mitsis 6232a85059 Fix closing CONFIG_MICROKERNEL block comments
Closing comments to two CONFIG_MICROKERNEL ifdef blocks incorrectly identified
the ifdef block as NOT belonging to the microkernel.

Change-Id: Iee415e33d7f8a88c41009c5783b37da3a431461b
Signed-off-by: Peter Mitsis <peter.mitsis@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 89d50ec95a Kconfig: remove DRV_ configs
Change-Id: Id162a7fe3620f7ad2bc25fbbd55c90b800f9ef70
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:11 -05:00
Anas Nashif f4f5cc138c Kbuild: include files dynamically based on BSP_DIR
Change-Id: If36a03acb633c772d599ae1492ebabf04c432306
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz c4535eeddf Kbuild: Kconfig source standard for drivers.
This commit standardize the Kconfig inclusion.
Selective sourcing of Kconfig files create conflict when merging
different configuration files (.config files).
Instead, now each kconfig symbols is dependant of its specific
DRV_* driver ksymbol.

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

Change-Id: I79e60263b8c7b696463ecc84b8ad411af5415117
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:10 -05:00
Juan Manuel Cruz 721b9df9d1 Kbuild: Fix board.h include issue on pentium BSP.
This commit fixes an issue with the inclusion path for the
board.h file for the pentium BSP.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I28172f8071b907aa61660ec8b8009e83cb2aa5ea
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
Juan Manuel Cruz f98466d54b Kconfig symbols for drivers directory.
This commit adds the Kconfig files that describe the CONFIG
symbols that belongs to the drivers directory and subdirectories.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I924835ece11a3d597e77a55ace21d724dd5ddbe5
2016-02-05 20:14:04 -05:00
Benjamin Walsh da26208623 timer: use _sys_clock_tick_announce() in drivers
Replace duplicate code and will allow for further cleanup by possibly
consolidating micro/nano code that is currently guarded by preprocessor
conditionals.

Change-Id: I9aa9966c581244646b6ea317ef8b51fef9054dd4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh 0c798772cc timer: fix incorrect nano_fiber_lifo_put in ISR
The correct call is nano_isr_lifo_put, but they are aliases of each
other, so that never caused an issue at runtime.

Change-Id: Ibec8e6d3377133e5e67589c5a3ad1b8fb3cc652c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Yonattan Louise 0827ff7f80 Rename oldAcc to old_accumulated_count
Updating local 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: Ib426dad55e318bb8176c4e7660711db1484cc245
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 751022e43b Rename oldCount to old_count
Updating local 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: I6098649b507dae09d4d0f19e712bc0fe3686dfc0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 639aa532e4 Rename _i8253IntStub to _i8253_interrupt_stub
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: Ie0770bd9ff872a9ed2b567baca1514d15fe6c90a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise c43a34b312 Rename _TimerMode to timer_mode
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.

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: I1f95ae3c2fd44ae3bd366cd33208551cf5ea6d10
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 04d87ce58f Rename _TimerIdleSkew to timer_idle_skew
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.

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: I5681dc0c33cc42ee48270eab418c99cc923f96b1
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 23f1b6f4ca Rename _MaxLoadValue to max_load_value
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.

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: Id7391e40bb709f03c58f552d6b783cad834bbdcc
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 5d861d51bb Rename _IdleOrigTicks to idle_original_ticks
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.

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: I28cbf0d02600d31548393870e712e6da062048da
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise d6b04be694 Rename _MaxSysTicks to max_system_ticks
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.

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: Ic28658f68d473b3a163fe5d97f611bfd572f140e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise e111f30cec Rename _IdleOrigCount to idle_original_count
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.

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: I31e267c1479dfaeeb0fba8c6ba0da45a3c011c0f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Yonattan Louise 7770ec2db1 Rename accumulatedCount to clock_accumulated_count
Updating local 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: I80ccb884f1ffd8f3740cd9298787462485b08024
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:53 -05:00
Dmitriy Korovkin d33ad051ac Consolidate inline assembler code in a set of header files
In order to have a better compiler support consolidate
inline assembler code in a set of header files.
If another compiler is used, that supports a different
inline assembler format, asm_inline_<compiler name>.h
heder files have to be provided.

Change-Id: Iecc7d96419efd767a8463933badd4db4a557de5b
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:13:52 -05:00
Yonattan Louise ab9c05ac2a Rename _SysIdleElapsedTicks to _sys_idle_elapsed_ticks
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" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I4e5c9419fe0ccbc4b2990b96fc95c697decc18e0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:44 -05:00
Yonattan Louise 93a1d7ca89 Rename K_Args to _k_command_stack
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" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I5e249e34ee9666666e31db6b9f71fe2abcc22400
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise c4bd9cc6ab Rename nanoTimerList to _nano_timer_list
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" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

Change-Id: I2e501394b7fa4264d9854659e2dd008e5c94b540
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:43 -05:00
Yonattan Louise cf0b28d243 Rename nanoTicks to _nano_ticks
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" \) \
            ! -path "./host/src/genIdt/*" \
            ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';

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