Commit graph

1005 commits

Author SHA1 Message Date
Andrei Emeltchenko 850e121ea7 drivers: spi_k64: Fix compile error when syslog is enabled
Fixes following error:
...
drivers/spi/spi_k64.c:717:86: error: 'cnt' undeclared (first use in
this function)
...

Change-Id: If49fa4838265cd39a6f72eb265388ff7faae9a9e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-03 21:37:05 +00:00
Baohong Liu b0cdc4bce3 drivers: spi_shim: add return value check
Add function return value check. This was caught by
Coverity.

Coverity-CID: 157124

Change-Id: I93b23325d657dc787300908b9117b6976617fdba
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-03 00:37:05 +00:00
Iván Briano 2e6e0a7c38 drivers spi_ss: Fix setting of wrong config for SPI 1
Jira: ZEP-1287

Change-Id: I3678631aa5843e769b8e1611734767fa6264b9af
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-11-16 14:05:54 +00:00
JuanX Solano Menacho a5fce7aa11 spi_qmsi_ss: Use qm_ss_spi_save/restore_context APIs
This commit updates the spi_qmsi_ss driver by adding save/restore
context functionality for power management, using the corresponsing
QMSI APIs.

Jira: ZEP-664

Change-Id: I9e62729f91c4808eb557d8a64c0f10955f5456f3
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
2016-11-11 23:33:21 +00:00
Baohong Liu 6a791a3286 drivers: spi: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I372bf24cf34b2f01a6487f4c50071fa40d6103ba
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 23:33:43 +00:00
Andrew Boie 0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

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

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

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
Baohong Liu 6096e7866c drivers: spi: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I0424e8b1fee51df6fd3eb06ba6d99284a2e83393
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-09 02:40:32 +00:00
JuanX Solano Menacho 05daf3a6f0 spi_qmsi: Use qm_spi_save/restore_context APIs
This commit updates the spi_qmsi driver by removing the temporary Zephyr
save/restore context implementation and using the new QMSI APIs.

Jira: ZEP-997
Change-Id: I70c6838025253d13d6ebe690ec90dfc1b18bfcea
Signed-off-by: JuanX Solano Menacho <juanx.solano.menacho@intel.com>
2016-11-03 23:52:08 +00:00
Iván Briano 0094ab228d ext qmsi: Update to QMSI 1.3 release
Update the QMSI drop we maintain in Zephyr, and fix the build where
needed:

- QM_SCSS_INT is renamed to QM_INTERRUPT_ROUTER;
- every member of QM_INTERRUPT_ROUTER was renamed as well;
- QM_IRQ_* renamed too, mostly added _INT at the end;
- some isr functions were renamed to keep their names consistent;
- build for x86 needs to define QM_LAKEMONT, as QM_SENSOR was for ARC.

Change-Id: I459029ca0d373f6c831e2bb8ebd52402a55994d1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-10-31 13:26:06 +00:00
Marcus Shawcroft da37763b5b spi/spi_qmsi: Make driver_api structure const.
Change-Id: Icbed6ecd1b405a282e40e3cce1d8e6e1d8235702
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:46 +00:00
Marcus Shawcroft 39e7dc4626 spi/spi_k64: Make driver_api structure const.
Change-Id: Id2ff845f30fa13346eea6e646710192494a5f32e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:45 +00:00
Marcus Shawcroft a5943c9bf1 spi/spi_intel: Make driver_api structure const.
Change-Id: Iecf69f099521f967d65fd1a417f40e96429cc0f8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:45 +00:00
Marcus Shawcroft 6fa3e3436a spi/spi_dw: Make driver_api structure const.
Change-Id: Ib400e73512ab3a0532aa0854ea0c9eba6339487d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-25 18:45:44 +00:00
Marcus Shawcroft 1385a65b82 spi/dw: Make driver config_info structure const.
Change-Id: I76e60e1a412a25c9a86d749cdd0b558164381050
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:53 +00:00
Marcus Shawcroft 5e2b549cb4 spi/intel: Make driver config_info structure const.
Change-Id: Ic4f44cf375a27fbd50175673ab3f0f064faadf15
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:53 +00:00
Marcus Shawcroft 84e805c78c spi/k64: Make driver config_info structure const.
Change-Id: I82a382b7240d75ce8479565680b72f93a8cb5997
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:53 +00:00
Marcus Shawcroft d1dabe27f4 spi/qmsi: Make driver config_info structure const.
Change-Id: I6d593c3a1af4fdfb6dd855872383165cb6b8142d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:52 +00:00
Marcus Shawcroft eef251bba9 spi/qmsi_ss: Make driver config_info structure const.
Change-Id: Id2cf7b88cc05b42600828c32f36e5821eb764821
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-20 16:48:52 +00:00
Genaro Saucedo Tejada 78316bd8c7 fix: Add missing structure at spi_intel_resume_from_suspend
Change e4b89571aa renamed the variable
to an undeclared one, without breaking verify but daly breaks.

A local variable of type spi_intel_data was missing on this
function.

Jira: ZEP-1095

Change-Id: Ie410933c2472378d4a6f24d6ca932ac203e3b08c
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
2016-10-19 21:22:41 +00:00
Marcus Shawcroft e4b89571aa spi/intel: Move RW driver context from config to runtime structure.
Mutable driver state relocated from config_info to driver_info.  This
driver supports PCI enumeration.  We drop code that attempts to update
irq_num based on PCI enumeration because the interrupt found by PCI
enumeration must always be the same as the statically configured IRQ
number.

Change-Id: I97198ae9603505606a872b07824d6c61688f0ced
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-19 12:10:58 +00:00
Marcus Shawcroft be6872f5ca spi/dw: Make config structure static.
Change-Id: I15236d62b330ffe2363fa438179fe1f79c168592
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-15 16:44:06 +00:00
Anas Nashif e05fa64f4c frdm_k64: spi: fixed wrong kconfig used in driver
Change-Id: I43f31562cdfa0b722907e5c6018e3e56d141ed4f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-10 21:26:30 +00:00
Marcus Shawcroft 5e95f11afe spi/qmsi: Make config_info pointers const.
Make pointers to struct config_info const in prepration for a const
config_info.

Change-Id: I1ca9e999840a6ad81dc369b56b1da554f3c1cb49
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-08 11:40:11 +00:00
Marcus Shawcroft fb4cfcba14 spi/qmsi_ss: Make config_info pointers const.
Make pointers to struct config_info const in prepration for a const
config_info.

Change-Id: I71bcfa48b31934bc683a344d40bb03f5247bbbec
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 20:33:57 +00:00
Marcus Shawcroft 4ed5a6e9b2 spi/k64: Make the driver configuration structure static.
Change-Id: I67a679106a0e0407c0d5da4593983fb83f732141
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 08:05:50 -04:00
Marcus Shawcroft 7c29c68675 spi/k64: Make config_info pointers const.
Preparation for const driver configuration data.

Change-Id: I2c860eac392ff43faf9c91a18e58a82eb7c4f860
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-07 08:05:50 -04:00
Marcus Shawcroft 92591d66b7 spi/dw: Make config_info pointers const.
Make pointers to struct config_info const in prepration for a const
config_info.

Change-Id: I28789a7f1f26e4a0d499f5a89a567ae8c61eae51
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@gmail.com>
2016-10-07 12:04:39 +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
Anas Nashif 5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Anas Nashif 5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Dragan Cvetic eb147c650c spi_qmsi: Add suspend/resume
This patch implements suspend/resume routines which
preserve SPI master 0 and 1 context in SYS_PM_DEEP_SLEEP.
The following parameters are suspended/resumed:
- All non-sticky RW registers for the SPI device which
  are not related to a transfer.
- The SPI MASK registers (interrupt routing register).

The suspend/resume functionality is implemented in
the QMSI shim layer as a fast and temporary solution,
it will be removed and migrated to QMSI later.

Change-Id: Ib60317ca41013a3e794820e9c3ef34f35d108209
Signed-off-by: Dragan Cvetic <dragan.cvetic@intel.com>
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
2016-09-12 12:17:16 +00:00
Amit Kucheria 8fd658c06b drivers: spi: Fix typos in SPI port numbers
Also, SPI 0 isn't specific to Intel, make it a generic message. This patch
only fixes the cosmetics w/o changing undering Kconfig option names.

Change-Id: Ia58f9537c594004a1b5fb8b4af21d7e8b729efb7
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
2016-08-31 14:41:36 +00:00
Iván Briano fd8b0eaccb spi: Remove suspend and resume hooks from spi_driver_api
Drivers that implement power management should use the preferred
device_pm_ops method instead.

Change-Id: I337722b1e06afe8508b5c84c00c3542571232e07
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-29 23:10:10 +00:00
Iván Briano bce65437c0 spi: intel: Move suspend and resume hooks to pm_ops
The suspend and resume hooks in the spi_driver_api struct are relics
from before the current power management infrastructure was in place.
The correct way to implement this now is through the device_pm_ops
struct, by way of the DEFINE_DEVICE_PM_OPS and DEVICE_AND_API_INIT_PM
macros, which make the hooks available through a generic mechanism for
all devices, rather than using per-type APIs.

Since the existing spi_suspend() and spi_resume() functions don't check
if the driver_api hooks are NULL, there's now a place holder function
to prevent breaking functionality until the hooks are removed.

Change-Id: I48287c58e9a8649d3e1be7547e3d0d293c84327a
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-29 23:10:09 +00:00
Iván Briano c0eda9ec7e spi: k64: Move suspend and resume hooks to pm_ops
The suspend and resume hooks in the spi_driver_api struct are relics
from before the current power management infrastructure was in place.
The correct way to implement this now is through the device_pm_ops
struct, by way of the DEFINE_DEVICE_PM_OPS and DEVICE_AND_API_INIT_PM
macros, which make the hooks available through a generic mechanism for
all devices, rather than using per-type APIs.

Since the existing spi_suspend() and spi_resume() functions don't check
if the driver_api hooks are NULL, there's now a place holder function
to prevent breaking functionality until the hooks are removed.

Change-Id: I6a3e3db370860ad46f428d287943b1ca58a80ae1
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-07-29 23:10:09 +00:00
Jesus Sanchez-Palencia abd7496225 ext qmsi: Update to QMSI 1.1-Beta
QMSI 1.1 Beta is available on Github:
https://github.com/01org/qmsi/releases/tag/v1.1.0-beta

Update the QMSI drop we maintain in Zephyr and
keep the modification to qm_soc_regs.h introduced on commit
6b88a6b945 "ext qmsi: Add USB base and interrupt defines" since
that patch hasn't made into the QMSI 1.1-Beta release in time.

Also, fix the build where needed:
- add hard dependency from qm_i2c to qm_dma
- fix spi_qmsi_ss.c due to new parameter naming
- fix adc_qmsi.c and adc_qmsi_ss.c due to a new parameter

Change-Id: I01388c787f5ee6ee97fece2e42b24a717522207f
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2016-07-01 13:43:02 -07:00
Genaro Saucedo Tejada 7a6bab308a sys_log: replace old debug macros on K64 PSI driver
SPI drivers for K64 is now using system log.

Change-Id: Ifd0d321e2ff84c581261b7cb3a7a4485afbd67f6
Signed-off-by: Genaro Saucedo Tejada <genaro.saucedo.tejada@intel.com>
JIRA: ZEP-311
2016-06-30 17:50:56 +00:00
Sergio Rodriguez 7c00c4d3be spi:quark_se ss: Use locking mechanism to guard critical regions.
This will allow the driver to be fiber and task safe

Jira: ZEP-410

Change-Id: I61d3d9e4128bae781f1c86c07af79eb6e43ebeda
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-05-31 22:54:40 +00:00
Sergio Rodriguez c2a0a59481 spi: Use locking mechanism to guard critical regions.
This will allow the driver to be fiber and task safe

Change-Id: I916d4ad67ab6f51f41f3d1136c105e4d1445de48
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-05-26 21:41:00 +00:00
Chuck Jordan d11ed0b13e spi: can use a tx threshold of 50%
The TX fifo threshold is pretty arbitrary.
Set this too big and too many interrupts will occur
for no good reason. Set it too small, and latency
in the SPI transactions is introduced. User's will probably
have to tune this per their application and SPI frequency, etc.
I think setting this to 50% is a good guess for now.

Change-Id: Ib325d40bc7ee10473d99443b3b3cd00fd6e4b95f
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-26 17:34:32 +00:00
Kumar Gala 9ec2f3be80 Cleanup whitespace in Kconfig files
Convert leading whitespace into tabs in Kconfig files.  Also replaced
double spaces between config and <prompt>.

Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-05-25 13:28:07 -05:00
Baohong Liu 35633586f2 spi: quark se: Add QMSI 1.1-based SPI shim driver
Add SPI sub-driver for sensor system.

Use SPI irq number definitions already in Zephyr header file.

Origin: Original
Change-Id: I215db3acc535093dd75c0817cbe5af77e6e76e16
Signed-off-by: Baohong Liu baohong.liu@intel.com
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:30:43 +00:00
Anas Nashif f35d6e04e3 qmsi: update qmsi to 1.1 alpha
Change-Id: Ib35ebcb32954f764ef8e33f6a1c11ad9f63931bc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-23 21:30:04 +00:00
Chuck Jordan df962d9a0e spi: Stability improvements to the DesignWare SPI driver
I've found many problems with the SPI driver and this repairs many of them.

The baud rate divisor was being derived from the CPU clock. But, some
targets may have a seperate clock attached to SPI. If the soc.h file
defines the symbol SPI_DW_SPI_CLOCK, it will use this instead
of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for the baud rate calculation.

completed() had a mistake where it would terminate the SPI transaction
too early, well before the tx data has cleared the FIFO. I found I couldn't
drive an OLED display correctly because completed() was wrong.
The repair is to now consider a new flag called spi->last_tx,
which will be set after the TX interrupt occurs with nothing to send any
longer. There is also a while loop added to SPIN until BUSY drops.

Another improvement is that push_data will NOT consider RX fifo size
if there is no RX going on. The calculation here when RX is going on
could go negative. I've added a check for that and prevent TX handling
if RX buffer is full. I think that is the intention -- to deal with RX first
if its fifos are more full.

In spi_dw_transceive, if we are only doing spi_write w/o reading,
don't enable RX interrupts at all. The OLED I'm working with failed
to have a pull-up on MISO SPI signal. As a result, a huge number of
garbage RX events arrive, and the interrupt handler finds there is
no rx buffer, so it tosses the data. But this is a waist of realtime.
It seems WRONG to enable RX interrupts if its something your not using,
so software can GATE these spurious events in this way.

With these changes, SPI can be used much more reliably, with FIFOs
that are deeper, and SPI devices that only require TX.

Change-Id: I0fe0745f2381c61c8a19ce086496b422a32a30a5
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-21 00:48:16 +00:00
Chuck Jordan 7f637af2bd spi: For spi_dw, added SPI_DW_FIFO_DEPTH as configurable paramter
When using the Synopsys DesignWare Synchronous Serial Interface (SSI),
the FIFO depth can vary from 2-256, depending upon how this module is built.
For quark_se_ss, it was using a depth of 8. For EM Starterkit, it will be
32. Adding this now as a configurable option. A larger FIFO really helps
reduce SPI interrupts.

Change-Id: Id2bc8470bfc08ab447d38b89c7904cff010c63bd
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-19 01:24:57 +00:00
Chuck Jordan f2fd12cc32 spi: add macro so that txftlr register can be read
Just as rxftlr can be read, a macro is needed so that txftlr can be read.
Symmetry.

Change-Id: Id987f700d89268feca60850f4fdf512f990f3ab6
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-18 23:18:19 +00:00
Chuck Jordan 0a5bc3b0d9 spi: DW IP can have 16 slaves + SINGLE_LINE IRQ configured in soc.h
A recent submission caused a build error for DW
CONFIG_SPI_DW_INTERRUPT_SINGLE_LINE because the symbols
CONFIG_SPI_<0,1>_IRQ went missing from Kconfig.
I think these should probably NOT be configurable, because
on an SOC, interrupt lines are hard. So I'm changing
the names back to SPI_DW_PORT_<0,1>_IRQ, with there
definitions originatig in the soc.h file.

Also, on DesignWare ARC EM Starterkit, the SPI interface
has 6 slave selects, but IP itself can handle up to 16.
Why does this start from 1 and not 0? Argh!

DBG_COUNTER_RESULT() should expand to 0 when not used.

Also, don't check version from DesignWare IP because
it can be different for each target.

spi_dw_isr() requires a cast when converting arg to dev.

Change-Id: I83d55e0405583e7cafab80b09cbef44e0f96fcb8
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-05-18 22:32:30 +00:00
Anas Nashif ae97f6a4d4 spi: use syslog infratructure for debugging
Remove custom debugging macros and use SYS_LOG

Change-Id: I235935eeb9c14cba3f3c10a766a79e39d8a3971d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:27 +00:00
Anas Nashif fbe7d90ead spi: consalidate and simplify
Use the same Kconfig infrastructure and options for all SPI drivers.

Jira: ZEP-294
Change-Id: I7097bf3d2e1040fcec166761a9342bff707de4dd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:26 +00:00
Anas Nashif a2b9b4b71a spi: remove kconfig variables that can be define in headers
Most of the values are SoC specific and come from the SoC definition,
not need to define them in Kconfig.

Jira: ZEP-294
Change-Id: I962ce36b7e2361ea77ae4178bb7c86c19a241c4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:26 +00:00
Anas Nashif 9096daa53f spi: intel: move soc specific values to header file
Most of the values are SoC specific and come from the SoC definition,
not need to define them in Kconfig.

Jira: ZEP-294
Change-Id: I7688ca523915e3fa8a1d28dea7a1d84a66b39d56
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:25 +00:00
Daniel Leung c977b1b8cd spi/qmsi: don't assign driver_api if init fails
Change-Id: Ia2225dc1a389c49ddb256e66bd0c4ee86e29c4cb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-28 01:03:39 +00:00
Anas Nashif a6915c070d qmsi: spi: use built-in qmsi driver
Change-Id: Ic7e86e015d4beb11a01d75aa50bc50f95c784e5e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif 8e4f04d735 qmsi: spi: fixed warning due to const paramter in API call
Change-Id: I0cc6f5948a9f3d93aec970950c7b2db441bff570
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:55:36 -04:00
Anas Nashif b46f9db04b spi: use global init priority
Do not have priority per IP, use one config instead.

Change-Id: Ieb2923d4749a294e2a1c677d47d56a14cee3f36d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-22 20:46:29 -04:00
Anas Nashif 65c06afa58 kinetis: reorganise soc directory using soc family
Add Kinetis SoC family and rename fsl_frdm_k64f to mk64f12.
This will allow adding new SoCs of the same family and the reuse of code
among SoCs of the family and series.

Change-Id: Iea1a663aef7ce0487f147bdd36f668bebe80deb5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-18 21:24:58 +00:00
Daniel Leung 196b88f4d0 spi/k64: convert to use DEVICE_AND_API_INIT()
Change-Id: I6eda6fdcc735250f83c39b43973655582090401e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:13 +00:00
Daniel Leung 2898e249da spi/dw: convert to use DEVICE_AND_API_INIT()
Note that the failure case can only be reached when compiling
for ARC side of Quark SE. Otherwise, the code is never compiled
which reduces code size for other platforms.

Change-Id: Ic76890cbaf22da5c3563e056cba9b39615d3da0c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-15 22:06:11 +00:00
Daniel Leung 90e93dce05 spi/intel: move driver_api assignment later
This moves the assignment of driver_api to just before
the init function returns. This is in preparation to
make device_get_binding() return NULL if driver
initialization fails.

Change-Id: I69590c463b84877d250c63d4460b7e254b79c8b3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Laurentiu Palcu 7dd2372dd5 spi_dw: use SPI bus frequency in spi_dw_configure()
The SPI API states:

"max_sys_freq is the maximum frequency supported by the slave it
will deal with"

However, currently, for DW the max_sys_freq is a divider which confuses
the user.

This patch adds a small hack to allow users to use both dividers and
frequencies when configuring the bus. The only trade-off is one has to
use dividers for bus frequencies smaller than 65536Hz. However, since
most devices nowadays can run at clock frequencies more than 100kHz,
this is a good compromise.

Change-Id: I44386cc8ad501b08eeaf71bc7588661ff36e108b
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-04-02 23:08:49 +00:00
Daniel Leung 546b8ade37 refactor common driver initialization priorities
Most of the SoC and board Kconfig use the same values for
driver initialization priorities. So refactor them, and
discard duplicate ones.

The shared IRQ init priority was changed so that the kernel
default init and device init priorities can be standardized
across all SoC/boards. Same goes for DesignWare SPI driver.

This also changes the UART_CONSOLE_PRIORITY and
IPM_CONSOLE_PRIORITY to UART_CONSOLE_INIT_PRIORITY and
IPM_CONSOLE_INIT_PRIORITY, to standardize across all drivers.

Note that this does not take away the ability to override
those values. This just provides reasonable defaults such
that there is virtually no need to override.

Change-Id: Ibbd95d802c637df06f9a2fd48763ee1e6f4ff627
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-28 15:58:29 -07:00
Daniel Leung a2ba5d1ba3 spi/k64: remove SoC specific SPI constants from kconfig
The base address, IRQ line, chip select numbers, and clock
gating constants are static per SoC, so there is no need to
make them configurable in Kconfig.

Change-Id: I9f87ca29c28c38c42d4e4f1a3a41fa231f63ef03
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-26 20:36:32 -04:00
Yannis Damigos f978d37466 drivers: spi: Make K64 spi submenu available only for K64 soc
Makes K64 spi driver submenu available only if K64 soc is
selected.

Change-Id: I0ada8863a592f056dbe48e78d9374f2348dcac14
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-23 15:36:43 +00:00
Daniel Leung a33aecc611 spi: restructure kconfig options
() Moves config options for each controllers into their own
   Kconfig files. This keeps upper level Kconfig from getting
   too big.
() Options for each controller are moved under their own
   submenus.

Origin: refactored from existing file
Change-Id: I813694f26126b43523b08ebdb0a5383edd241cda
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-03-17 21:05:12 +00:00
Andre Guedes 136d171588 drivers: Replace DEV_NOT_CONFIG by -EPERM
This patch replaces all occurences of the macro DEV_NOT_CONFIG by
-EPERM at the driver level. This patch is part of the effort to
transition from DEV_* codes to errno.h codes.

Change-Id: I3054c8aa76319a58a2eec089b8a72bf301c85391
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes afcc923172 drivers: Replace DEV_USED by -EBUSY
This patch replaces all occurences of the macro DEV_USED by -EBUSY
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I21eb3ffe9bdfde98593dcf63c50a8bdcd376e49e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes b3cb3a1f68 drivers: Replace DEV_INVALID_CONF by -EINVAL
This patch replaces all occurences of the macro DEV_INVALID_CONF by
-EINVAL at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: Idae0d5af8dd780416977c9261a5fb6188c3aab64
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 245e140da6 drivers: Replace DEV_INVALID_OP by -ENOTSUP
This patch replaces all occurences of the macro DEV_INVALID_OP by
-ENOTSUP at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I46aec3c65963018c479b01602e4a3eec8650eaff
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 7c956d2ece drivers: Replace DEV_FAIL by -EIO
This patch replaces all occurences of the macro DEV_FAIL by -EIO
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I0594ab5dbe667e074c250129e7c13ce512ac940f
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Andre Guedes 024cfe754e drivers: Replace DEV_OK by 0
This patch replaces all occurences of the macro DEV_OK by the actual
value 0 at the driver level. So this patch touch the files under
drivers/, include/ and samples/drivers/.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I69980ecb9755f2fb026de5668ae9c21a4ae62d1e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-03-16 19:30:04 -04:00
Laurentiu Palcu 27a3f8bb10 spi: dw: arc: add delay between writing DR strobe bit and reading FIFO
According to documentation, there must be at least one cycle delay
between two consecutive writes of the DR register. Apparently, this is
true for reading too, though undocumented.

The read_dr() inline function is called as follows:

*(spi->rx_buf) = read_dr(info->regs);

which the compiler, with full optimizations on, turns it into:

ld_s       r2,[r1,24]       <- the spi->rx_buf
sr         0x80000000,[r4]  <- this is the strobe bit write !!!
lr         r4,[r4]          <- this is the FIFO read!!!
stb        r4,[r2]          <- store the result

Unfortunately, the read from the FIFO is always 0 since the FIFO data is
not yet available.

During my investigations, I found that the following code works:

sys_out32(1 << 31, info->regs + 0xd);
*(spi->rx_buf) = sys_in32(info->regs + 0xd);

This does, basically, the same thing. But the compiler inserts an
instruction in between the write/read:

sr         0x80000000,[r4] <- write of the strobe bit!!!
ld_s       r2,[r1,24]      <- the pointer goes to r2
lr         r4,[r4]         <- read from FIFO!!!
stb        r4,[r2]         <- store the result

A single clock cycle between writing the register and reading seems
to be enough for the data to become available for reading.

This patch adds a nop in the read_dr() inline function.

Change-Id: I0c216d5738d5771835b1052e2e83363e8e3abf0c
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
2016-03-12 03:18:54 +00:00
Jeff Blais 995a9ba72a arm: K64 SPI module driver
Support for Freescale/NXP K64 SPI modules, limited to:

- Master mode
- A single active set of clock and transfer attributes (CTAR0), which
includes non-adjustable delay parameters
- Tx FIFO fill and Rx FIFO drain interrupt handling
- Standard, continuous select and continuous SCK SPI transfer formats

Also, divide-by-zero code generation in this driver is prevented.
The 'volatile' attribute is added to some of the variables in the baud
rate and delay calculation functions of the K64 SPI driver in order to
prevent bad code generation by gcc toolchains for ARM seen when an
optimization setting above -O0 is used.
Specifically, a register is loaded with the constant 0 and is used as
the divisor in a following divide instruction, resulting in a
divide-by-zero exception.
This issue has been seen with gcc versions 4.8.1 (the VxWorks toolchain)
and 5.2.0 (the Zephyr SDK toolchain).

Change-Id: Ib5b2b748aad8fdfd5e8d40544e6e1abef3713abe
Signed-off-by: Jeff Blais <jeff.blais@windriver.com>
2016-03-09 15:50:16 +00:00
Johan Hedberg 0efd558cbc SPI: Change read/write buffer pointers to void *
There's no reason to require callers to cast their data to uint8_t *
when the data might e.g. originate in a packed struct or some other
data type. Instead, be nice to callers and let them use any pointer
they want. Additionally, declare the TX buffer as a const pointer so
unnecessary typecasts aren't needed for that either (if the data
originates in a const location).

Change-Id: I1482ca4e350b5a7fbda6871ed9f54f255af3aa9e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-04 20:13:21 +00:00
Johan Hedberg 8708b73c65 drivers/spi: intel: Fix typo in DBG log
This log is in spi_intel_configure, not in spi_intel_transceive.

Change-Id: I5d62dd63d0cfa2c86f2dd5f9a6d367b7ad47b355
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-04 20:13:21 +00:00
Johan Hedberg 7c5563fd3a drivers/spi: dw: Fix unaligned access
The buffers aren't guaranteed to be aligned so that they're always
aligned for uint16_t or uint32_t data. Use the available unaligned
access macros to read/write the data.

Change-Id: Ie87c108aa370af196b9c759b59ed7fb9d1ed6183
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-04 20:11:57 +00:00
Vlad Lungu 616bf84db1 spi: intel: fix write failures at low speeds
When configured at a frequency of 2MHz, a transaction writing
3 bytes and reading 1 byte fails silently (last byte cannot be
read back from the device). Enabling CONFIG_SPI_DEBUG fixes the
issue.

Scope traces show that the transaction (from /CS assert to /CS
deassert)  takes 14us and there is activity on the MOSI line
after /CS is deasserted. A transaction writing 2 bytes and reading
3 bytes take 22us.

The issue is due to the fact that completed() deasserts /CS after
the driver has put 3 bytes in the TXFIFO and taken 1 byte from RXFIFO.
Just because the last byte made it to the TXFIFO, it doesn't mean that
it was put on the MOSI line.

The fix:
For a transaction sending T bytes and expecting R bytes, let N=max(T,R).
Send exactly N bytes and wait for exactly N bytes (or an error). This
way, we are sure that all the bytes were sent to the target device.

Also:
Stop calling pull_data() after every byte sent, it might take a while
for a byte to show up in RXFIFO.
If RFS bit is set, stop sending bytes (will be really useful with a
bigger RFT).
Flushing RXFIFO in spi_intel_transceive() is not needed anymore.

Change-Id: Ifb06a12b03e3e20d6ace4d9f3a20fc11ec3bb010
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
2016-03-03 11:00:45 +00:00
Vlad Lungu 99cb8a6ab4 spi: intel: fix typo in port 1 configuration
Remove semicolon that triggers a build failure
when CONFIG_SPI_INTEL_PORT_1=y

Change-Id: Iea49d44059377cf9eb0b5b5e14b625cb316a65bb
Signed-off-by: Vlad Lungu <vlad.lungu@windriver.com>
2016-03-03 11:00:45 +00:00
Andre Guedes 1eaaa6434b spi: Remove default value from platform-specific options
This patch removes the default value from some platform/SoC specific
options which are declared in drivers/spi/Kconfig because 1) most of
the time they are not valid values and 2) the correct values are
already set in the SoC Kconfig.

It also moves the interrupt priority definition from the driver's
Kconfig to the platform's Kconfig since it is a platform-specific
configuration.

Change-Id: Ic992749b3210ed8a2e454edece41ceca5edbaf2e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-24 14:26:23 -03:00
Tomasz Bursztyka ec678375a3 spi: dw: Quark SE Sensor Sub-System support
Though it's an ARC core, Quark SE SS does not follow the same registers
mapping as the official DesignWare document. Some parts are common, some
not.

Instead of bloating spi_dw.c with a lot of #ifdef or rewriting a whole
new driver though the logic is 99% the same, it's then better to:
 - centralize common macros and definitions into spi_dw.h
 - have a specific spi_dw_quark_se_ss_reg.h for register map, clock
   gating and register helpers dedicated to Quark SE SS.
 - have a spi_dw_regs.h for the common case, i.e. not Quark SE SS.

GPIO CS emulation and interrupt masking ends up then in spi_dw.h.
Clock gating is specific thus found in respective *_regs.h header.

Adding proper interrupt masks to quark_se_ss soc.h file as well.

One of the main difference is also the interrupt management: through one
line or multiple lines (one for each interrupt: rx, tx and error). On
Quark SE Sensor Sub-System it has been set to use multiple lines, thus
introducing relevant Kconfig options and managing those when configuring
the IRQs.

Quark SE SS SPI controller is also working on a lower level, i.e. it
requires a tiny bit more logic from the driver. Main example is the data
register which needs to be told what is happening from the driver.

Taking the opportunity to fix minor logic issues:
- ICR register should be cleared by reading, only on error in the ISR
  handler, but it does not harm doing it anyway and because Quark SE SS
  requires to clear up interrupt as soon as they have been handled,
  introducing a clear_interrupts() function called at the and of the ISR
  handler.
- TXFTLR should be set after each spi_transceive() since last pull_data
  might set it to 0.
- Enable the clock (i.e. open the clock gate) at initialization.
- No need to mask interrupts at spi_configure() since these are already
  masked at initialization and at the end of a transaction.
- Let's use BIT() macro when relevant.

Change-Id: I24344aaf8bff3390383a84436f516951c1a2d2a4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-20 15:39:16 +00:00
Andre Guedes 424cd841e2 spi: Enable QMSI driver for Quark D2000
This patch fixes the QMSI SPI shim driver so we are able to use it in
Quark D2000 based platforms. The only change required to enable this
driver is an #if guard in spi_qmsi_init() because the macro QM_SPI_MST_1
and the function qm_spi_master_1_isr are not defined in QMSI headers
from Quark D2000.

Since this drivers is now properly working on Quark D2000, this patch
also sets the QMSI driver default options in arch/x86/soc/quark_d2000/
Kconfig.

Change-Id: Ic6e2f7f5a2c3f350ddf360b23ffab6b812948572
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-20 14:57:45 +00:00
Dan Kalowsky bfe756da7d spi : moving to a single SPI naming
Currently we have devices named "dw_spi_0" and "intel_spi_0" etc, which makes
it difficult for an application to look up.  Or worse, forcing a 3rd party IP
to hardcode in support for only one specific IP block.

Change-Id: Ie485e2350b171b66b22cd7ab39e0fcd196f38af8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-11 11:28:18 -08:00
Dan Kalowsky 4743684e4f struct packing
Looking at all structs as to where we can pack them a little better, and
calling out the padding/stride at the end for future expansion.

Change-Id: I4a651092e950dd3d915af9fa0ee0d7d59803e58f
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-10 16:21:26 +00:00
Tomasz Bursztyka 4f88ff49e1 spi: dw: Improve debug output
Available only when CONFIG_SPI_DEBUG is set:
- Print out all exported functions with relevant infos
- Remove superfluous messages
- Make counter in push/pull not being instanciated when not debugging

Change-Id: Iaa96a897008d360a14bc83da54152c264f42c60d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-08 21:45:07 -05:00
Tomasz Bursztyka 6ba201e288 spi: dw: If an error occurs, nothing should prevent to stop
It's a bug that did not happen, but is a valid one:
if there is an error, we should not care at all about current stage of
transmission, thus it will stop right away.

Change-Id: Iec2b519d8118233f570ded18d6c6eb4084371e5b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-08 21:45:07 -05:00
Vinicius Costa Gomes b5ff3fe0dd spi: qmsi: Fix enabling the CS line too late
There are situations when the transfer starts before we have the time to
enable the CS line, so to be sure, we active it before even attempting
to start the transfer.

This fixes an CC2520 driver initialization issue using the QMSI SPI driver.

Change-Id: Ib9b324b77260ac537f714376c8056b1543e7e3b3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-05 20:25:30 -05:00
Vinicius Costa Gomes 8166cf8d8f spi: qmsi: Add support for selecting the driver's init priority
Because of the necessity of using a GPIO pin as Chip Select, we need to
set the initialization priority of the SPI driver so it occurs after the
GPIO driver.

Change-Id: I02d675d8267ee07b267155a3806be85fbf57378c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-05 20:25:29 -05:00
Vinicius Costa Gomes 39d87755c1 spi: qmsi: Add support for using a GPIO pin as CS
There are cases that it is needed to use a GPIO pin as chip
select (frames would be too long, for example), so using a GPIO pin as
chip select to keep the line active while the transfer is ongoing is the
usual solution.

This implements that solution for the QMSI shim driver.

Change-Id: Ia6b8f0f17161e20f87ad3def1468fe0abea65fdc
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-05 20:25:29 -05:00
Vinicius Costa Gomes 40f8914376 spi: Add QMSI-based implementation
This driver uses the QMSI library and mostly translates calls from the
Zephyr API to QMSI ones.

This driver conflicts with the native driver implemenation. In order to
enable it, you must set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="PATH_TO_QMSI"
CONFIG_SPI_QMSI=y
CONFIG_SPI_QMSI_PORT_0=y
CONFIG_SPI_QMSI_PORT_1=y

Missing:
 - Support for using a GPIO pin as Chip Select;

Change-Id: I0d8eca88a2a803b6b3604f396f874313fe90753c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-05 20:25:29 -05:00
Andrew Boie 897ffaeb2c irq: rename irq_connect() to IRQ_CONNECT()
It's not a function and requires all its arguments to be build-time
constants. Make this more obvious to the end user to ease confusion.

Change-Id: I64107cf4d9db9f0e853026ce78e477060570fe6f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:25 -05:00
Benjamin Walsh 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 2c1a95aee6 device: rename SYS_GET_DEVICE_NAME/SYS_GET_DEVICE
Rename them to DEVICE_NAME_GET and DEVICE_GET to fit in the 'device'
namespace.

Change-Id: I407a7f284ed4d1c071961b46615eea859c2e825f
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
Benjamin Walsh 99a4f13bbc device: rename synchronous_call_ APIs
Rename them to device_sync_ to fit in the device_ namespace.

Change-Id: I1088dda958584ed90b97137298050fee44c20ee4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:25:24 -05:00
Tomasz Bursztyka eb96f0a73a spi: dw: Fix Tx and Rx threshold after each push/pull
Reading: As when setting up the transfer, Rx has to adapt to current
left Tx lenght.
Writing: If nothing will be transmitted anymore, downsizing the level to
0. This fixes a hanging issue while making the controller being busy for
nothing. Another hack found to fix the same issue was to test the SR
Busy flag bit in the ISR handler. As the threshold level makes more
sense, kepping this one.

Change-Id: I87ba393d507c9418295f188d866d9979f423536c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:23 -05:00
Peter Mitsis a0e4568760 c++: Add extern "C" { } block to header files
Adds extern "C" { } blocks to header files so that they can be
safely used by C++ source files.

Change-Id: Ia4db0c36a5dac5d3de351184a297d2af0df64532
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka bcb2e2e45c spi: dw: Rework the logic on testing/setting controller's readyness
Controller should not be enabled while configuring or setting up a
transfer call. It's enabled once the transfer call is ready to proceed,
and disabled once the last interrupt has be raised.

Change-Id: Ib9125a3600971b57e642730682f2b3bfb91b1e02
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka 6021c64844 spi: dw: Add an initialization priority Kconfig option
On Quark SE, SPI might require GPIO to be ready before hand, to emulate
CS, thus providing an option to tweak the intialization priority for SPI
DW driver.

Change-Id: Ifa373948ac8227bf6e4ed1113bcb4dc9139b6663
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka 3ef1517c1a spi: dw: Add Kconfig option to emulate CS through a GPIO pin
It might be necessary to emulate CS through a GPIO pin depending on
these 2 conditions:
- the controller's CS pin is not wired, and thus a GPIO pin is the only
  option
- The controller is unstable at a certain frequency and cannot set/unset
  CS reliably. This is actually a possible issue on DesignWare's SPI
  controller in Quark SE or Quarks D2000 where it has been found
  unstable at 1Mhz and above.

Change-Id: Ib6a06577906c005ddd347070d476a367a9c3da8a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka 655fb9fb2e spi: dw: Fix how internal FIFO is handled
- Refine how DFS is calulated now that it is strictely used to
  manipulate buffer lengths.
- Fix threshold limit
- Tune RX threshold relevantly (reduce it if rx_len is lower than actual)
- Don't push more than available left space in FIFO
- Tune the private structure to lower memory space occupation

Change-Id: I65b1b48b996b2104cebcb24cc366fb4dcbf7d53b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka bfb8b375a3 spi: Rework constants for better identification
IMR and ISR bits are same, but it stil better to differentiate them
properly. Also fixing naming where all ISR ends with an 'S'.

Change-Id: I2fc1e1d8d2743c3d98f5da40a5f4720a85c4f9a7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka a4d8e14008 spi: dw: Add support for auxiliariy registers based access
On ARC, the SPI IP block might be accessible only via user extended
auxiliary registers, which requires different instructions to read from
and write to.

Change-Id: I3aa5f223938a9aed7795de4aedc64bd529d62942
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka 4320dffe0f spi: dw: Differentiate ARC to other arch support
Registers offsets are hopefully all the same, but size differs.
On x86, thus 32bits support, CTRL0 or DR for instance are 32 bits r/w.
And DFS on 32 bits support is placed differently as well.

Change-Id: I5115d5c3c9bba71ece4a6f4a1d3d2fdc203c8da1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Ramesh Thomas 3d5351b624 spi: dw:support all frame sizes
Only 8 bit frames were supported. Added support for bigger data frames
which can go up to 32 bits (on 32bits version of the controller, 16 bits
otherwise). Store the frame size in bytes during configure, and use it
during pull/push to read/write correct frame size.

Change-Id: Iae8c55442e0a205403aa3febd1811b36aaf4c5b6
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:22 -05:00
Tomasz Bursztyka de00223c04 spi: Make sure option are generated according to their dependencies
If SPI_INTEL is not requested, no need to instanciate specific value.

Change-Id: I5f41d919e258e420f2bd099db88ed2259f9cd27e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:21 -05:00
Tomasz Bursztyka 13c2b1ac7b spi: Rename files according to rules
Renaming files as:
<domain>_<model or manufacturer>.<c/h>

Change-Id: I018f6fdb4ba8aac8bb96e848f0f3633bd032b44e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:25:21 -05:00
Tomasz Bursztyka d205c0fc74 spi: dw: Fix build issue
Introduced by commit 01d6f9f5ee0867f6ee8dc1506c2ebe62d9f296bb
Reported by Gustavo Lima Chaves

Change-Id: Ic29c33f4339c83a55ca45e93000cbc07b8dadbd2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:21 -05:00
Tomasz Bursztyka aaf542e6c7 spi: dw: Fix build error
Introduced by commit a6873a00d816daf303b0380dda91accd28df6497
Reordering the irq config function, and removing useless parameter.

Change-Id: I2d22cfe81153b104044d8672dd57115138437ed9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:21 -05:00
Tomasz Bursztyka 86fde21f3b spi: Make the API fully synchronous
The driver has to implement the logic in an interrupt based manner.
Applying the changes to the existing drivers.

Changing ADC's API and implementation as well to follow those changes.

Change-Id: Ie0c3e3e318f619ade6be935adb064a25446cc29c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:17 -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
Javier B Perez Hernandez 02812f4635 drivers: pci: struct pci_dev_info rename class
Rename class in pci_dev_info struct to allow to use C++ compilers.
Updated drivers to use new struct.

Change-Id: I17b94cb7bc094bccd615c8389a28589bfa90cab8
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
2016-02-05 20:25:12 -05:00
Anas Nashif 6bca3724c1 drivers: set default priority for drivers
Use a default priority to avoid Kconfig blocking when priority
is not set in SoC or Board.

Change-Id: I4edda47b955a7ee834f04dc40d0decbd8dee6305
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Anas Nashif 10bb38c186 Use SoC instead of platform.
Change terminology and use SoC instead of platform. An SoC provides
features and default configurations available with an SoC. A board
implements the SoC and adds more features and IP block specific to the
board to extend the SoC functionality such as sensors and debugging
features.

Change-Id: I15e8d78a6d4ecd5cfb3bc25ced9ba77e5ea1122f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:11 -05:00
Daniel Leung c71dddb2c2 spi: dw: intel: move IOAPIC interrupt trigger flags into driver
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.

Change-Id: I89090181acb5f48dd797e7773ab65c5f3d46c42a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:05 -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
Anas Nashif 5115fb57ad quark_se: rename platform and remove x86 suffix
Change-Id: I19ac3a4c6081720736c6fbf16b649ccf6ae60e2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:54 -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
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
Tomasz Bursztyka 14267b85c9 spi: dw: Fix various building and support issues
- Build the actual driver when relevant
- Provide the IOAPIC stub
- Provide the IRQ flags for IRQ_CONNECT_STATIC
- Set the default IRQ priorities

Change-Id: Iea20ef67c92cf7f48791fba5a8021448b7059950
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:52 -05:00
Tomasz Bursztyka f7a6c5c263 spi: Add support for Designware SPI controller
Such controller is found on Quark SE Lakemont and ARC cores. This
driver currently supports the Lakemont core (x86).

Change-Id: Iefebd6ce9dbe81aa3902e7c2d801b07c027c548a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.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
Tomasz Bursztyka 9b9367176e spi: intel: Fix byte flow and error handling
- ROR interrupt needs to be acked by resetting the bit to 0
- Rx threshold seems buggy on that controller and setting it above 1
  generates unreliable transmission as sometimes it does not trigger any
  interrupt though the rx fifo is just full.

Change-Id: I4949c1fe7b42c70973efd4e0dafd14c6171f13f6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:42 -05:00
Tomasz Bursztyka e560c90c0e galileo: SPI and pinmux init level need to be reversed
SPI port 1 needs the pinmuxer to be initialized first. Or then, all
modifications required from the CS GPIO logic won't apply.

Change-Id: Ibe4b2d4096065a9add23373075090d5e8a014650
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:35 -05:00
Tomasz Bursztyka 95116abb0b spi: galileo: SPI port 1 uses DW GPIO pin 2 for CS
As for the SPI port 0, SPI port 1 needs a GPIO pin to emulate the CS.

Change-Id: I00911cd25c3fa0ae17a02ee6f43cbea7f4fbcca2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:35 -05:00
Tomasz Bursztyka 75a11278f1 spi: intel: Fix the retrieval of the clock divider
Obviously it's '&' and not '&&'.

Change-Id: I9bb9fee80a67697e8ea62bb001af1b72f5a356e6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:35 -05:00
Dan Kalowsky 5339eccc23 intel_spi: convert SPI to new driver init method
Convering the intel_spi to use the updated device model

Change-Id: I016822aeecaf707ffa31b57b4e51e99262fce0e5
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:35 -05:00
Peter Mitsis 5084b6da56 Fix various default IRQ priorities
Changes the default IRQ priority level from 0 to 2 for the following
kernel configuration options as priorities 0 and 1 are reserved for the
first 32 IDT entries.

	SHARED_IRQ_0_PRI
	SHARED_IRQ_1_PRI
	I2C_DW_0_INT_PRIORITY
	GPIO_DW_0_PRI
	GPIO_DW_1_PRI
	SPI_INTEL_PORT_0_PRI
	SPI_INTEL_PORT_1_PRI

Change-Id: I0fc821c68156eb1e1fe776b2bd4ff5890bba40e8
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:24:34 -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
shuang.he@intel.com f6d62ec1bd spi: Fix one simple typo
Change-Id: I1e8236deef5270f3d86334652fb456b820357639
Signed-off-by: shuang.he@intel.com <shuang.he@intel.com>
2016-02-05 20:24:32 -05:00
Anas Nashif bcc16634ac spi: move static stubs to driver directory
Change-Id: Idd08e79eec429df00673a10790ec85afbe3183f6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:32 -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 39063598db checkpatch: error - spacing
Change-Id: Ie6e1c43581dd4b0734625b3a4e59a4ca79619e99
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:31 -05:00
Allan Stephens 7b006066a4 init: Simplify symbol name generated by DECLARE_DEVICE_INIT_CONFIG()
Gets rid of the trailing initialization level character from the
name of the device variable generated by the macro, since it serves
no useful purpose. (The linker scripts place the various initialization
sections in ascending order based on the name of the section, so there
is no need to embed the initialization level in the variable name itself.)

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

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

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

Change-Id: Ie7e834e82b931e4b02ded3f9f619735b31b0a121
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka 6090d779d7 spi: intel: Move back private structures to the right locations
Since the driver is the only one needing those, no need to expose them
anywhere.

Change-Id: Iac4eaa65a9dbdaa8e72c70ea0de35cd2b3d836d1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka f18275a5be spi: intel: Switch CS before unmasking and after masking interrupts
At this points the slave is ready to deal with the master.

Change-Id: I815d3c577bd0b73100cbf585cc8ca78f180ec713
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka 15058e21ef spi: intel: Fixing how speed is set
This was failing, the documentationg provides numbers only telling at
one places these are hexadecimal values. So switching to hexadecimal.
Then DDS rate retrieving macro was bogus, so fixing it.
And adding debug output about the DDS rate and the clock ratio.

Change-Id: I9cc414796fbd7f7123f1f406c6bce7ffacf641e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka 553cee8aea spi: galileo: Pre-configure SPI ports present on Galileo board
Providing the right settings through Galileo's Kconfig.

Change-Id: Ia5339eb90cb98d7dde3be0493bcfd9a6b6db60ed
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:22 -05:00
Tomasz Bursztyka 3f5083e9f6 spi: ia32_pci: galileo: Add options to allow SPI IRQ trigger
Add Kconfig option to specify how interrupt is triggered for SPI.
Also enabling such support for Galileo platform.

Change-Id: Id3112d100089197940f826b827493174d0f22669
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:22 -05:00
Tomasz Bursztyka 4cace6d2d7 spi: Add the CS pin control over GPIO for intel spi port 0
This is specific to Galileo board where its SPI port 0 needs to setup
the CS pin through a GPIO pin.

Change-Id: I9df6f7144a96bcd10f61fc7d057f89caa0e599d1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:22 -05:00
Tomasz Bursztyka 854d77aa37 spi: Fix init level data id
Change-Id: I51612bbea34fa7b32b09bd15a97ab0c6e0a8c9fd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:22 -05:00
Dirk Brandewie 4365f02391 init: rename pure_late_init to pre_kernel_late_init
Change-Id: I9561315a892933370d60fcf36c10d38078d66233
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie 58a534b929 init: add pure_core_init level
There are devices that need are part of the architecture core the need
to be initialized prior to devices that are integrated around a core
to make up a complete SOC. Namely the interrupt controller in the SOC
must be configured in order to allow the integrated IP blocks drivers
to initialize correctly.

Change-Id: I0a91e08f98516a7b7dd402ffc6494a071f1326b2
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:20 -05:00
Dirk Brandewie c48418f2bd init: remove pure_init macro
This macro is legacy from an early implementation of the init system
before the pure level was split into early and late phases remove it
now to avoid confusion going forward.

Change-Id: I6720874c840c9e14888fd6f411a8182e7420ca29
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:19 -05:00
Dirk Brandewie f4ded7a0c1 x86: spi: Move system binding code to intel_spi.c
The code fragment to bind the instances of the SPI driveri is not
platform specific but is driver specific.

All the information required to bind a driver instance comes from
CONFIG_ variables.  Having the binding code with the driver code
avoids duplicating the code fragments in each platform where the
driver may be used.

Change-Id: Iff40227e3e25d431ae870d585445971f35d934dd
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:24:17 -05:00
Tomasz Bursztyka ad35e5dacf spi: Mask tx interrupt once over with any transmission
Or then the controller will spin around requesting to get its fifo
filled-in though it's unnecessary.

Change-Id: I81e7c483345236dee7691c3e780b1b06d6b2d0f8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:41 -05:00
Tomasz Bursztyka 9d0af1c270 spi: Intel spi driver fixes
- Handle the new error callback type, a ROR interrupt is irrecoverable.
- Removing the fifo pre-fill: this should never be done that way. It's
  up to the controller to request via an interrupt to get its fifo
  filled-in. (TFS bit on SSSR register is the one requesting such
  filling)
- Disabling the controller once completed (following transfer will
  re-enable it)
- Removing useless debugging info

Change-Id: I466a8efb65a41f3315a6a36e10ea519d0c4b01e9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:36 -05:00
Tomasz Bursztyka e4479cd0cf spi: Handle the support for PCI_ENUMERATION
Without it, it won't go through a pci scan, and will just trust the
pre-set information for the bus/dev/function to enable the memory
mapped registers.

Change-Id: Ica9156be541619dce9684dd45f70e05b69782a7c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:32 -05:00
Tomasz Bursztyka ff3f81b44c pci: Make use of pci_show without #ifdef
This will make code that use it not too crowded with #ifdef #endif

Change-Id: Iec0fa662445b1cefdc7c64d9483e1ae483106a90
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:32 -05:00
Tomasz Bursztyka 3e32b29f57 spi: Fix the case when PCI is not in use on intel driver
Change-Id: Id1c5f259e6788d8cba024139e710db9c9d78d943
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:15:32 -05:00
Tomasz Bursztyka d96943b04c spi: Add support for Intel's SPI controller
Such controllers are found in Quark's X1000 series, and thus are found
on Galileo boards v1 and v2.

Change-Id: Ib71486c9f27de1b6c48ce3cb3dd138d69833c2ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:28 -05:00
Tomasz Bursztyka d5d525562e drivers: Add the common directory and files for SPI
Add the necessary Kconfig, Makefile etc...

Change-Id: I3682ab353ef71f3827520ab3fc4b16a122180d99
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:28 -05:00