Commit graph

41120 commits

Author SHA1 Message Date
Daniel Leung
fba6c4bedf x86: galileo: shared IRQ config has to be earlier
Perform configuration of the shared IRQ has to be done earlier,
as the config code masks the interrupt by default. If configuration
is done after shared_irq_enable() is called, the interrupt is
effectively masked. So move the init level a bit earlier.

Change-Id: Ic7f059628e3cf122d323513e171c7d1a09e5d4a6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Daniel Leung
c97474c73b x86: galileo: HPET IRQ config init to be done after IOAPIC
The IOAPIC driver resets all interrupt vectors, so any configuration
has to be done after that. Move the HPET IRQ config to later init
level so we are sure that the configuration is being done.

Change-Id: Id169461cce15252f7fb77e9c07961300233f3344
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Daniel Leung
28079bec81 x86: galileo: fix typos from __ to _
With the typos, IRQ triggering conditions are not set correctly.

Change-Id: I0698ce69c3368411a2f91a32ac27608e9f1de252
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Daniel Leung
6324168e88 i2c: dw: fix setting default configuration
Fix previous rebasing errors (before merging) where deleted code
was reintroduced back. This causes the default configuration
in Kconfig to be ignored.

Change-Id: I29b246b1459136521d764127bf02e6d8e5aff30c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Daniel Leung
9299ef07cc x86: galileo: expand pinmux to setup GPIOs on SoC
This expands the Galileo pinmux driver to configure the GPIOs
on the DesignWare IP block, and the core/resume wells on
the legacy bridge.

Change-Id: Ia1df4b6fd3b104f08563fe9eab93f01efbb53b66
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Daniel Leung
87ba6358d9 x86: galileo: enable GPIO and all pin muxes by default
This enables all the GPIO blocks, and pin muxes on Galileo Gen2
board. GPIO and I2C are now sharing one interrupt line so both
can now get interrupt driven events.

Change-Id: I31a4823abba84539ce5d1cc84e85b7dc335cf831
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Daniel Leung
8c6714e297 gpio: dw: ISR bails early if no interrupts
If using with shared IRQ, this function will be called by
the shared IRQ driver. So we need to check and bail out
early if the interrupt is not coming from the GPIO
controller.

Change-Id: I4ae925f5fb9a5c32d03a180edc8460e978ec0aac
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Daniel Leung
5992aa363b i2c: dw: ISR bails early if no interrupts
If using with shared IRQ, this function will be called by
the shared IRQ driver. So we need to check and bail out
early if the interrupt is not coming from the I2C controller.

Change-Id: I3c3ae3c22aa5cf312de5c22b35765749d6c5929d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:22 -05:00
Anas Nashif
a4907a8e98 galileo: disable debugging by default
Debugging should only enabled in the application using this
platform, not for everyone.

Change-Id: If5c17d0a87ac1d15d19ece7de93102eb2461c324
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:22 -05:00
Juan Manuel Cruz
7fe3dc4510 build: help message config targets update
This commit removes *config targets that does not apply to
the system or that are not implemented

Change-Id: Ib7739fda4085562fbe7d14491b7de9f354d0dc7d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:22 -05:00
Juan Manuel Cruz
a5a6ec341b build: help message update
This commit updates the help message adding pristine target
and removing reference to a non-existent README file.

Change-Id: I38f32e6d1e2fc0723894b5e5a71570bc4333e615
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:22 -05:00
Anas Nashif
ee743c7d42 build: allow usage of a custom linker script
This change will allow the use of a custom linker script by
setting the config variable CUSTOM_LINKER_SCRIPT to a path outside
of Zephyr tree.

This is useful when an application needs to add sections into the
linker script and avoid having to change the script provided by
Zephyr.

Change-Id: Ibe31abcc8c0227e734f59bc26d3c8d5619951b29
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:22 -05:00
Andrew Boie
5d4eb7812b sanitycheck: fix issues if alternate binary name is used
Fixes an issue if CONFIG_KERNEL_BIN_NAME is customized.
There isn't a mechanism to parse the project defconfig, but
as there should be exactly one .elf artifact in the outdir
just glob it.

Change-Id: Ib3d517006dd13ef6e3e10ea3a8e975c287344d56
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:22 -05:00
Tomasz Bursztyka
5d0bc718da i2c: Kconfig: Do not provide platform specific default settings
Such settings belong to Galileo and thus are set in Galileo Kconfig.

Change-Id: Ib9ec721fcc68e92521f8b7690c2640eeb82b2f4c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:22 -05:00
Rodrigo Caballero
7c995f33b3 doc: Edit the Kconfig Reference Guides.
Edit text for grammar, style, markup, linkage, consistency and clarity.

Change-Id: I785179f867435f9d212718e10acc9e9c8f0f1e8a
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:22 -05:00
Gerardo A. Aceves
30a04a2250 doc: Edit redundant use of file
Removed the word "file" after all the MDEF to avoid redundancy
Edited single line under overview folder in order to
gramatically correct the use of "file".

Change-Id: Ie785aa8c620f095fcd4171ef4efd2d056d6fa04b
Signed-off-by: Gerardo A. Aceves <gerardo.aceves@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:22 -05:00
Gerardo A. Aceves
575c1ba172 Change minor markup errors.
Corrected formatting to produce cleaner HTML output.

Change-Id: I7f2f655498829ed7fd8c468e1d6d7d04d595f181
Signed-off-by: Gerardo A. Aceves <gerardo.aceves@intel.com>
2016-02-05 20:24:21 -05:00
steveballard123
981f4ab169 doc: Edited the Doxygen documentation
Edit for grammar, consistency, accuracy

Change-Id: I72eb48b546ab15097289469c25dc0c298bae46cb
Signed-off-by: steveballard123 <stephen.r.ballard@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:21 -05:00
Tomasz Bursztyka
ddb35ccfa6 i2c: Support the generic API callback in designware's controller driver
Call the callback when relevant:
- When STOP_DET if received
- On error

Change-Id: Id60190c6ac5c0b15a0a6cd3fb30b9cc41f2333e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:21 -05:00
Tomasz Bursztyka
d3d14846cc i2c: Add a callback to the generic API
Thus the caller will be noticed once its read and/or write calls have
gone through.
Taking the opportunity to fix the documentation about return code.

Change-Id: Id3f588fab978cad4393583f26509a9e91dcc8be2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:21 -05:00
Dan Kalowsky
e728cadfc1 i2c: doxygen fixes for public header
Adding in documentation for the return values of the I2C functions.

Change-Id: I89d4a6918f860a0ac34f6905e6f9bba77158f1ff
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:21 -05:00
Peter Mitsis
9664bc1a03 Remove use of SUPPORT_FP_SHARING
The Kconfig option SUPPORT_FP_SHARING does not exist.  In fact, it had been
previously renamed to FP_SHARING (this one case was missed).  Fixing this
allows the use of conditional directives in _ExcExit() to be simplified.

Change-Id: I61f98191afe776f70af3c9d9265c38c559be3486
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:21 -05:00
Tomasz Bursztyka
4df5c1cab0 gpio: dw: Verify interrupt status on available bits only
Handle only the pins which have been configured to be present on this
controller. Removing an unused #define as well.

Change-Id: I66d3638333f1fcd49b1b4f70a5c9d11dbc538fd0
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:21 -05:00
Peter Mitsis
8571845c15 x86: Fix default ESF
Fixes the initialization of the default exception stack frame to ensure that
every field of the structure is initialized to the dummy value of 0xdeaddead.

Change-Id: Ic7a5b66204172b53a657c9540196f01a74e1000c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
91ea542816 x86: galileo: enable shared IRQ support for I2C
The DesignWare GPIO and I2C are PCI devices which share the same
IRQ line. This patch enables the shared IRQ support for I2C. GPIO
support is to be followed.

This also enables I2C for nanokernel on Galileo.

Change-Id: I66681d71899914bdcb35c4af649d077ffb8d7970
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
32121585da i2c: dw: add shared IRQ support
On some platforms (e.g. Galileo), the I2C controller is on PCI bus,
which shares IRQ with other devices (GPIO on Galileo). This patch
adds support for utilizing shared IRQ.

Change-Id: Id4e4714aed37c2893d0ffe9ed1e4edaabb338121
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
25c5ceaad1 gpio: dw: add shared IRQ support
On some platforms (e.g. Galileo), the GPIO controller is on PCI bus,
which shares IRQ with other devices (I2C on Galileo). This patch
adds support for utilizing shared IRQ.

Change-Id: I4b44bae15356e4710d54f0343fed1bd27f35e484
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
0b45e8b0c2 x86: galileo: setup shared IRQ triggering condition
This adds the code to setup the IO-APIC for shared IRQ.
The code to enable shared IRQ with GPIO and I2C will follow.

Change-Id: I6e7de69f83bf7f1dd0da0571dbcb417beb2c232b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
006555a17b shared_irq: add config options for interrupt triggers
This adds options to the shared IRQ driver so the interrupt
triggering condition can be specified.

For example, the GPIO and I2C controllers are under same
interrupt line through PCI bus. The triggering condition
is level, active-low. So this option can be used by
the Galileo platform to program the IO-APIC correctly.

Change-Id: I1c3af98442e775b4987ab36a644c856052d85ec4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Dirk Brandewie
002c53b225 drivers: add shared interrupt driver
This driver allows multiple drivers to share a common interrupt
line. This functionality is required on system that conform to the PC
interrupt structure.  In the context of Zephyr this is needed for
SOC's that have their I/O IP blocks behind a PCI interface. Due to the
limited number of interrupt lines provided by the PCI interface
multiple IP blocks may be configured to share an interrupt line.

Drivers that share interrupts  must be modified to *not* register their
own interrupt service routine as part of their configuration/initialization
but instead bind to the correct instance of this driver by name, then
register their interrupt service routine with this driver.

Change-Id: I57b517b97ebeabce484ba53c8f940da993cb391d
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:21 -05:00
Gerardo A. Aceves
2fe611587d Doc: grammar fixes on platform.rst file
Corrected minor grammar issues related to platform config description

Change-Id: I6960366ae088957dbff588adabc01adb15385066
Signed-off-by: Gerardo A. Aceves <gerardo.aceves@intel.com>
2016-02-05 20:24:21 -05:00
steveballard123
15faebe139 DOC: edit the encryption documentation.
Edit for grammar, consistency, accuracy.

Change-Id: Iab9d315f350416ba1d863c5554305fd1f7a073a7
Signed-off-by: steveballard123 <stephen.r.ballard@intel.com>
2016-02-05 20:24:21 -05:00
Anas Nashif
0e503e54a3 kconfig: set range on IDT_NUM_VECTORS: 32-256
The first 32 entries are for well-known exceptions

Change-Id: I3342c48af6e7f687065fafd0c2af4dabc04d421e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:21 -05:00
Allan Stephens
ddaebc15b3 kernel: Eliminate use of main() in microkernel
Revises microkernel initialization code by incorporating the existing
_k_kernel_init() and main() routines into _main(). This optimizes kernel
initialization a bit, and allows application code to use main()
if desired -- for example, as the entry point to an application task.
The change also eliminates the need for sysgen to generate a routine
whose content is always the same.

This change preserves the existing order of operations done during
kernel initialization, and leaves further improvements for later.

Change-Id: Ie03d8a6f38f8a311f398667ed977fd8478719d70
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
a5f0974131 pwm: pca9685: use polling I2C write instead
The polling I2C write function guarantees the write operation
is completed. It is to make sure each write has been commited.

Change-Id: I37cd3b8a65c605837b1fae3ccd1c2b0235c07a37
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
32d42f313e gpio: pcal9535a: use polling I2C write instead
The polling I2C write function guarantees the write operation
is completed. Given that the initialization routine goes through
I2C write consecutively, we want to make sure each write
has been committed.

Also adds code to configure the I2C controller before transfer.

Change-Id: I2c8888e940edd1cb9fb01f03234a731ac991dfcf
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
bd86869cc5 i2c: dw: add polling write implementation
This implementation will wait to write, and wait for transfer
to complete before returning from the function. Currently has
a default timeout of 100ms to prevent being stuck in the loop
waiting for hardware to be ready.

Change-Id: I0340fc6fed100f1d31c0306c5b0ab09689364f63
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
dea96a68b5 i2c: add API to do polling transfer
There are instances where interrupts cannot be used for I2C transfer.
So add an API to do trasnfer in polling manner.

Change-Id: Ic030ef9469542aae9975aa7da55c578a2a6c5c93
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
8834967827 x86: galileo: config: MMIO GPIO is to use I/O port access
The GPIO ports on the legacy bridge have to be access by
I/O port read/write, instead of direct memory access.

Choices in Kconfig cannot have default values in Kconfig,
so it has to be done in defconfig instead.

Change-Id: I479f3776edf5690f73d8e857ce6683285db092c0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
0502a9a084 gpio: mmio: add access by I/O port
Add I/O port access to MMIO-based GPIO driver, in addition to
the existing direct memory access. This extends the driver,
so that it can address the registers through I/O read/write.

Change-Id: I53c74ad76472ac043764e33bfbb77a2bedc427fe
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Dan Kalowsky
ccb9b8f338 i2c: dw: interrupt selection no longer controller specific
The interrupt selectionss are no longer specific to a particular
controller (e.g. I2C_DW_0), but apply to all controllers on
the platform.

[DL: Extracted these changes into their own patch, instead of
     being squashed with others. Also modified the Kconfig
     options to move them into proper position.]

Change-Id: Idc7ac9769e947447b868dccf772a95dbb5fc8021
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
4c549fc021 x86: galileo: enable I2C by default
This adds the default config option to enable the I2C controller,
for both nanokernel and microkernel.

Note that choices in Kconfig cannot have default values in Kconfig,
so it has to be done in defconfig instead.

Change-Id: I2ac0c880629db68e5b9a6bf61e49939ab7418a89
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
0daf9dfd19 gpio: pcal9535a requires nano timer
Add a Kconfig option to enable NANO_TIMERS for PCAL9535A.
Without enabling nano timers, compilation may fail.

Change-Id: If96358a17b9522f9323f3480b4716c3dfd82a3de
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
8c27aedb79 pwm: pca9685: remove call to i2c_configure for every write
The I2C controller should have been already setup before this driver.

Since the only use right now is on Gelileo and I2C_DW driver. it is
safe to remove the i2c_configure() call now as the driver has default
configuration at boot.

Change-Id: Ia384e28871bf76dcfec899860f93da4bf0948ba6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Daniel Leung
2104dcde39 i2c: dw: provide default configuration for controller at init
This adds the Kconfig option to specify default configuration
for the I2C controller during driver initialization.

During boot, the controller needs to be configured before
communication to slave devices can start. After boot,
an app can re-configure the controller if needed.

Change-Id: I7bf252f75a31943ae444e4d914f3a9a1a3f3d91f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:21 -05:00
Andrew Boie
1cdb72b909 ipi_console_sender: enable printk() implementation
Change-Id: Ib4ce8b0bb128700dc1e3d72bf85ea1111f1a3880
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:21 -05:00
Gerardo A. Aceves
b47ec60080 doc: add the grouping documentation
Adds the correct use of Doxygen grouping
for in-code documentation.

Change-Id: I25d2e9259e27808da8a032f91dfeff4711bc1f4b
Signed-off-by: Gerardo A. Aceves <gerardo.aceves@intel.com>
2016-02-05 20:24:21 -05:00
Rodrigo Caballero
dd47daaaae doc: Edit the Makefiles reference documentation.
Edit for grammar, style, spelling, readability, clarity, linkage and
markup.

Change-Id: Idc8e5f83141639035b08c5664dd3d39567a993e6
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie
b89cb06f5c drivers/pci: kconfig: Add prompt for PCI options
Change-Id: I9b7d581c9407aaa191fdd241945d0b27da2a5ae2
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie
d47dfdb001 x86: kconfig: rename "General Platform Configuration" menu
Change-Id: I560001a920e41dbcb01a34dcacc9e7914f45edaf
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00