zephyr/drivers
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
..
802.15.4 cc2520: Busywait max 500ms before trying to send another packet 2016-02-17 13:08:04 +00:00
adc adc : rename device to just ADC 2016-02-10 11:23:56 -05:00
aio aio/aio_dw_comparator: adds Kconfig for IRQ priority 2016-02-05 20:25:28 -05:00
bluetooth Bluetooth: Take advantage of the new net_buf_pull_u8() helper 2016-02-12 16:03:43 +00:00
clock_control device: use DEVICE_INIT everwhere 2016-02-05 20:25:25 -05:00
console drivers/console: Fix writing out carriage return on all terminals 2016-02-10 18:52:29 -05:00
ethernet eth_dw: fix compilation issue in eth_dw.c driver 2016-02-05 20:25:31 -05:00
gpio gpio: Enable QMSI driver for Quark D2000 2016-02-20 13:04:34 +00:00
grove device: use DEVICE_INIT everwhere 2016-02-05 20:25:25 -05:00
i2c i2c: Enable QMSI driver for Quark D2000 2016-02-20 02:51:49 +00:00
interrupt_controller x86: rebase priority levels 2016-02-08 21:45:07 -05:00
ipm device: use DEVICE_INIT everwhere 2016-02-05 20:25:25 -05:00
nble drivers/nble: Export bt_conn_lookup_handle() 2016-02-19 13:03:47 +00:00
pci pci: trivial if statement refactoring 2016-02-17 21:57:13 +00:00
pinmux c++: Add extern "C" { } block to header files 2016-02-05 20:25:22 -05:00
pwm struct packing 2016-02-10 16:21:26 +00:00
qmsi drivers: Add infrastructure for QMSI drivers 2016-02-05 20:25:15 -05:00
random Fixed file description and applied doxygen style 2016-02-05 20:24:58 -05:00
rtc rtc: Remove default value from platform-specific options 2016-02-20 14:20:32 +00:00
serial struct packing 2016-02-10 16:21:26 +00:00
shared_irq irq: rename irq_connect() to IRQ_CONNECT() 2016-02-05 20:25:25 -05:00
spi spi: dw: Quark SE Sensor Sub-System support 2016-02-20 15:39:16 +00:00
timer Revert "sys_clock: start the microkernel ticker in the MICROKERNEL init level" 2016-02-11 17:26:06 -05:00
watchdog watchdog: Remove default value from platform-specific options 2016-02-20 14:20:33 +00:00
Kconfig cc2520: Initial checkin for TI CC2520 802.15.4 driver 2016-02-05 20:25:23 -05:00
Makefile cc2520: Initial checkin for TI CC2520 802.15.4 driver 2016-02-05 20:25:23 -05:00