Commit graph

479 commits

Author SHA1 Message Date
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
Anas Nashif 20764a2e8d doxygen: javadoc style
Change all occurances of /*! to /** to match javadoc
style.

Change-Id: I3a759d34e0e928216f61252682266e64c5b875f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:32 -05:00
Oleg Zhurakivskyy e5cdfc8ecc uart: Get rid of camelCase style
Change-Id: I3b0f0c3ead18416105a356794b6c79444f7e29cf
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2016-02-05 20:14:27 -05:00
Oleg Zhurakivskyy 58dbcfd589 Expose uartGenericInfoInit()
This is helpful when working with UART through dynamic
interrupt stubs.

Change-Id: I91d64f575aa755fcfd894d678a1c078219447f16
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2016-02-05 20:14:27 -05:00
Dmitriy Korovkin 8d065343c2 Use static interrupt registration in device drivers
Make device drivers use static interrupt registration procedure.

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

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

Change-Id: I80c695f337456e9b0c1b0fd56716e35794f7bdb7
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:25 -05:00
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
Benjamin Walsh 617f9c5b4c nanokernel: allow nano time tracking to be used in microkernels
The nanokernel time tracking code (ticker) can now exist in microkernel
systems. This allows the ticker that drives nano timers and timeouts to
advance the tick count for these in a microkernel, thus allow their
presence there. Previously, nano timers could not be used in a
microkernel.

Change-Id: I17f2b659691a081b0f9bf3961ed030533aa02a15
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:14:22 -05:00
Benjamin Walsh 6b8589612f sys_clock: rename nanokernel's _do_sys_clock_tick_announce
Rename nanokernel's _do_sys_clock_tick_announce() to
_nano_sys_clock_tick_announce() so that it can be called from the
microkernel tick handling code without name ambiguity.

Change-Id: I2ec9dd92ceda51f00be1dd95bc3239d6b2e82943
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.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
Szymon Janc 6d27b0a33c Add simple UART driver
This driver is a very simple UART driver that can be used to implement
a protocol in application. It has no protocol logic and just allow
application to receive and send data over UART in platform independent
manner.

API is designed to minimize number of required memory copies.
Application is able to provide new buffer every time it decides to
consume received data. It is also able to just alter offset and
reuse current buffer eg if data was corrupted or otherwise invalid.

Change-Id: I8d3827fe2e242196e986d0419bc5487357481558
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:16 -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
Peter Mitsis db8a41c90d Replace use of __attribute__((packed)) with __packed
The __attribute__ keyword is toolchain specific.

Change-Id: Ia3c0ff54d778785679c864704f8db6a3ba898948
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Dmitriy Korovkin ec8a461bfb Introduce public APIs for random number generation
Convert the existing non-public random number generation APIs
into public APIs (i.e. sys_rand32_init and sys_rand32_get).

Change-Id: Id93e81e351a66d02c08cf3f5d2dd54a3b4b213c5
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:12 -05:00
Dmitriy Korovkin a91736ab9a Convert PCI_DEBUG parameter to a configuration parameter
Change-Id: Ie0272b52bbba56e3381cf33fded873aaa0709af6
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:11 -05:00
Dmitriy Korovkin 627155afeb PCI scan by BAR number
Added BAR (Base Address Registers) as a parameter for PCI scan.
Some devices (as UART in Quark) use two set of BARs for different
purposes. A driver may require only one of them.

BARs are numbered from 0 to PCI_MAX_BARS.
PCI_BAR_ANY means ignore the BAR number. Constants are defined
in drivers/pci.h

If device class is not specified as a scanning parameter, and
set to 0, ignore it.

Change-Id: I6b7116c5c6cf9c470ab22bec9eb74842f15b5d99
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:14:11 -05:00
Tomasz Bursztyka 0b4413d607 uart: Removing driver specific informations from the generic API
IRQ and registers are hardware and driver specific information and as
such should no be exposed through the generic API.

Change-Id: I33e6d7ec7bd9fb82a4e343d99b7a5c17886d1470
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:14:01 -05:00
Tomasz Bursztyka 0a7c8ea578 uart: Follow the same parameter naming everywhere
Just a tiny change s/which/port.

Change-Id: I69be83f9805d71f5ec0ad68b146816d2a4fe221a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:14:01 -05:00
Tomasz Bursztyka d3a4177d92 pci: Provide a simpler yet powerful PCI enumeration API
This fixes many issues around PCI enumeration from old API:
- a static internal table was fed with scanning results, thus eating
  memory, and worse: due to the limit of its size, scanning for new
  classes was impossible unless growing statically the size of this
  table --> more memory eaten! Not to mention PCI enumeration is done
  once at boot time for driver initialization and that's all, so this
  table is hanging around for nothing afterwards.
- one needs first to scan a class, then maybe he will be able to find
  his device via pci_dev_find. Where all could be done at once.
- pci_dev_find was not trustworthy due again to the internal table. Now
  if the device is not found, one will know it really went through all
  the possbilities.
- still let the possibility for hard-coded BARs value on driver side
  (thus no PCI scan required). However this is greatly advised not to do
  so as BARs might change over a firmware/BIOS update.

Comparison:

old pci_dev_scan: could only filter out via class mask.
new pci_dev_scan: can filter out via a class, a vendor and device ID
(it could easily do the same for Function and BAR index as these are
usually fixed and informed through datasheet)

old pci_dev_scan: was limited in its findings by the size of the
internal result table.
new pci_dev_scan: can proceed through all the buses and devices every
time (there are optimizations to avoid useless work of course)

old results did not tell about the function or BAR index.
new one tells, and the structure has not bloated.

old internal code: was storing a big table of results
new internal code: is only storing a small lookup structure and an
array of Bus:Dev pairs for each PCI class for optimizations purpose.
(though, if needed, we could disable this through some #ifdef)

Usage:

- Have a local struct dev_info
- Fill it with what you want to look for, currently: only class and
  vendor_id/device_id. Function and BAR index could be added if needed.
- Call pci_bus_scan_init(): this will reset the internal lookup
  structure.
- Call pci_dev_scan(<a pointer to your dev_info>): at first call, the
  internal lookup structure will pick up the informations from dev_info
  and will try to find out what has been requested. It will return 1 on
  success, or 0. On 1, your dev_info structure will be updated with the
  found informations. If more devices can be found against the same
  lookup informations, just call again pci_dev_scan(<a pointer to your
  dev_info>) as long as it returns 1. When 0 is hit, it will mean you
  found all.

Change-Id: Ibc2a16c4485ee3fed7ef4946af0ece032ae406e4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:14:01 -05:00
Dirk Brandewie 1a159cb3f5 loapic: Expose APIC LVT mask definition
When the local APIC timer driver is configured into the system it needs to
ability to enable/disable the local APIC timer. The definition of the
LVT mask bit was moved into the APIC interrupt driver as part of the
driver reroganization effort. Move the definition to the public header
file.

Change-Id: I8e7f8eab9f39aa17b96079836c182bde6f7b4fd1
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:00 -05:00
Yonattan Louise dbada63eee Fix coding style issues.
Some checkpatch issues were solved by scripts leaving other problems
such as alignment and indentation issues.  In order to comply with the
defined coding style the following fixes were made:

- Fixed the function declaration moving the parameters' comments above
  the function in accordance to the doxygen format.
- Fixed functions' opening and closing brackets. These brackets should
  not be indented.
- Fixed the 'if', 'for' and 'while' statements adding the brackets
  around the sentence.
- Fixed comments' alignment.
- Fixed indentation.

The work was done manually and submitted as one commit. I didn't
separate these changes in different commits because they were fixed all
at once. Basically, all errors were fixed in every file at once.

Change-Id: Icc94a10bfd2cff82007ce60df23b2ccd4c30268d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Benjamin Walsh 153503d766 timer: micro/nano abstraction for announcing tick
The gain is two-fold:

- Removes the need of preprocessor conditionals in the timer drivers'
  ISRs.
- Allows removing the duplication of the 'tick announce' code across
  all timer drivers.

Change-Id: I6078a0b00a833c1d1ca76474987c3214a0c05f7b
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:13:59 -05:00
Andrei Emeltchenko 879541a918 console: Refactor serial console interface
Make serial console interface more robust. Enables interrupts only
when registering input, all memory is managed inside application.
Interface to application is changed to have two fifo queues. One
queue is a free line slots and another queue is keeping entered
lines. This way memory for lines is managed inside application which
provides free lines queue. It is also simpler to manage entered
lines by sleeping on fifo_get on app layer.

Change-Id: I4776c03eddd1e7d880df3b902bd48f5f2c901cad
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Tomasz Bursztyka 40b1080150 pci: Put the public API header in the right location
Instead of drivers/pci/, the public API headers will be found in
include/drivers/pci.

Change-Id: I577036660383e6bd9c015d6bbbcbc14bf8fb67ec
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:48 -05:00
Tomasz Bursztyka ae09a48a7e console: Put the public API header in the right location
Only moving the header from drivers/console/uart_console.h to
include/drivers/console/uart_console.h so source file did not need to be
changed, only the defs.objs files to look into include/drivers/console.

Change-Id: I585e16b50d9ffecf01ca9225e80f0e101f62ee4c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:13:48 -05:00
Dmitriy Korovkin 7a3ee5e95e Rename driver header files according to naming standard
Change-Id: Ib384fd93c3d35abab1754b37d6464ff7dfe4a893
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:13:40 -05:00
Inaky Perez-Gonzalez 8ddf82cf70 First commit
Signed-off-by:  <inaky.perez-gonzalez@intel.com>
2015-04-10 16:44:37 -07:00