Use a real board name that can run this kernel instead of a generic
name. Basic functionality exits on this board with Zephyr.
Setup of the board is mostly similar to what we have in galileo (EFI
based)
Change-Id: Ic8554f26dcac0dbbbb6d35d863482f6207dc63c5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The Galileo board is based on the X1000 SoC, so move galileo to
boards and create this SoC instead, inheriting all SoC related code
and configuration items.
Change-Id: I9b39f1b44644775ee48acae284b82bae7876fffb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Using number_removed to find out how many packets from unack queue we
need to clear.
Change-Id: Icad948892f3ab1febc939e9ba6d6b3431973633e
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
We might get out of sync packet because of race collision, drop it.
Change-Id: Ic84a760199df1520dc7a95383972f9ec428c7fde
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Analyze stack when sending single ACK packet.
Change-Id: Ifd3a54f0d1ad9a644363563fa9b8bea05b895fa9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
If there is no packet to be sent after timeout we have to send ACK for
last received packet.
Change-Id: I30bbc4ae1a257f9a7351dc5a5d2f1269740ce447
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add initial code for three-wire (H5) Bluetooth uart driver.
At the moment the driver is EXPERIMENTAL. To test use following
method with qemu:
Run btproxy with three-wire emulation patches:
$ sudo tools/btproxy -d --pty -3
Opening pseudoterminal
New pts created: /dev/pts/21
Opening user channel for hci0
Notice that new device created: /dev/pts/21, use it with qemu -serial
parameter.
Run qemu target with following parameters:
$ make qemu 'QEMU_EXTRA_FLAGS=-serial /dev/pts/21'
Change-Id: I51579ffd8088583df9106689a03b2a0b4aa9e4cb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove extra line and correct style according to common style.
Change-Id: I5fc9434edce44e52b51fc40866638c0899985b1b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Needed headroom depends on type of the UART driver, change it
accordingly.
Change-Id: Ic9bf5f08a49be6823fce5eff8139d5f949b313ca
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The LCD display is an add-on, not a feature of the platform or the
board.
Set the defaults and remove the definition from Galileo Kconfig.
Change-Id: Ic319cd765d2dc1fe08cc65615680821fe9bc6a83
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1. Need to unmask interrupts for the sensor subsystem.
2. The GPIO controllers need their clock enabled before they can
start sending out interrupts.
3. Setting up ISR on ARC requires usage of irq_connect().
Change-Id: I633b07292f11e5c5e768fc51fabb70769d407609
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add an option to specify to which I2C master the Grove LCD
is connected, instead of already using the i2c_dw driver
port #0.
Change-Id: I4e61ef8e31c75ae912e2d16f8939369c0b8bbc2c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The code to poke the system integration module to disable clock gating
for UARTs only works for UART0-3 since all the bits are in the same
register. However, clocks for UART4 and UART5 are controlled by
another register. This means that we have been writing to the wrong
bit for enabling UART4.
This patch fixes this issue, and moves the clock gating clock into
board initialization. The incorrect code has also been removed to
prevent accidental mis-use. The dev_data struct is no longer needed
for uart_k20, so that is removed as well.
Change-Id: I67845a417e43647bf0ffcbdbda34ce68fa887713
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
ANSI sequences may have a numbered prefix which means that the action
needs to be taken the number amount of times, e.g. "Esc[ValueA" (move
cursor forward Value number of characters). Some ANSI commands also
have two preceding values, such as Esc[Line;ColumnH (move cursor to
Line & Column).
To support these ANSI sequences we need to track a bit of extra state,
most conveniently done using a bit field. Since the ANSI parsing logic
gets a bit long at this point it's refactored into its own handle_ansi()
function.
Change-Id: I0711f869d5324f9f827915fde468fe470e7689ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Instead of keeping track how many characters we need to move back to
get to the original position, take advantage of the save/restore
escape sequences. This allows us to drop the extra 'i' variable from
both insert_char() as well as del_char().
Change-Id: I69a2b5ea12ec2a7a2e4d519b55e4c737b5d5d25a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
MVIC has only one local interrupt: the timer IRQ. What IRQ line
to use is not fixed, instead it is programmed into the LVTTIMER
register. This is unlike LOAPIC which has a fixed IRQ for the timer
and instead the *vector* to use for it is programmed into LVTTIMER.
We don't want _loapic_int_vec_set() to do anything as the relationship
between IRQ lines and vectors is fixed and we do not want to be
programming vector numbers into bits 0-3 of LVTTIMER.
The IRQ line to use for timer interrupts is programmed into LVTTIMER
when the MVIC is initialized.
Change-Id: Icba0429f65ece7541fa8542814a8fdc39ad43936
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Quark SE Lakemont core has a hardware bug where the LOAPIC does
not properly notify the IOAPIC to clear the IRR bit for level-
triggered interrupts.
This patch introduces a workaround where the vector ID of the
in-service interrupt is manually written to the IOAPIC_EOI
register, resulting in the bit being cleared.
Unfortunately, in the context where EOI happens it's very difficult
to identify which IRQ line is being serviced, so this is done
unconditionally for all interrupts vectors whether they are registered
in the IOAPIC RTE table or not.
Change-Id: I639cd258dec4f50934e17eadbb821e6a7112e636
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Instead of having two config options to specify interrupt triggering
conditions, merge them into one option and clarify. This is now
similar to other drivers which have interrupt triggers.
Change-Id: I4e60c8c45a08d005dcc8256cb89e4c5be7c94307
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
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>
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.
Change-Id: Ie7262b69226ebffa7e1b9e35725fda24b3fe089f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.
Change-Id: I2d50457a45fae62ff085f7239712d580243253bb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the common #define for IOAPIC interrupt trigger flags out of
platform board.h and into the driver.
Change-Id: Ia0a069464392714f38037841de52e8d265fa4f49
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
A special situation may occur when a processor raises its task
priority to be greater than or equal to the level of the
interrupt for which the processor INTR signal is currently
being asserted. If at the time the INTA cycle is issued, the
interrupt that was to be dispensed has become masked (programmed
by software), the local APIC will deliver a spurious-interrupt
vector. Dispensing the spurious-interrupt vector does not affect
the ISR, so the handler for this vector should return without an EOI.
Change-Id: I4cf4744bd6efd68b72e2c380269de4181dc80bd9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This was only needed for an older implementation of software interrupts,
now superseded by the irq_offload() API (which doesn't interact with
the interrupt controller at all)
Change-Id: I8aa696d370ae1799872f6d70de69f3cb5b47456a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
To many people, IPI connotes inter-processor interrupts on SMP
systems. Rename this to IPM, or Inter-Processor Mailboxes.
Change-Id: I032815e23c69a8297c0a43992132441c240fb71e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
PROJECTINCLUDE is not required in app makefiles.
Change-Id: I3751b7c51c453dfe47d207bb11d171138668c4e7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add null definitions for the interrupt latency measurement API so we
can remove compile fences in C code.
Change-Id: If86eedf79afcb49002108814dd4fb864956eb667
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Now that i2c is fully synchronous on top of an interrupt based
implementation, polling mode can be removed. Applying the API change
into the existing drivers.
Change-Id: I05d2a6089743b6b69f7c9da6312057134578e2f7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The i2c_set_callback() does not check for NULL pointers
in driver's API struct. So create an empty set_callback()
function to avoid runtime exceptions, if it is called.
Change-Id: Iad8fed62228d10d42b8189e76873eb4c2ad12eb3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.
Those empty C files are there because the current Kbuild
requires Makefile to be present at those directories,
(due to arch/x86/Kbuild), which requires building some object
files. So the empty source files are there to produce empty
object files to satisfy this.
Change-Id: I14056347ea14cff227d9e8960192e8673c0019b8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.
Change-Id: I1d379068f64855d5d4595838040ec50f97f638a0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The initialization code and macros are the same. So extracts it
and puts it into the driver. This is another step to follow
the driver model.
Change-Id: I1af8b2888779b2b58367feaff9ee1a6d97b4873c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add support for forward/backward ANSI sequences and the ability to
enter new text while the cursor is somewhere in the middle of the line
rather than at the end of it. printk is introduced into the game
rather than the old write_uart() since we need to make use of the
%u format string support for creating the ANSI sequence to move
backward/forward the right number of characters.
Change-Id: I41f880fc5de773573147c5a291e2cbe94d5370a4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
By default, since we don't have special support for control characters
we should simply ignore them. This includes both pure (single) control
characters as well as ANSI escape sequences. The most important
control character to support for basic editing is Backspace.
The terminal creates a Delete (DEL) character by default when
Backspace is pressed. It also treats the Backspace character ('\b') as
a non-destructive backspace. To create the effect of destructive
backspace we have to send the sequence "\b \b".
Change-Id: Idc942d09be2a84b8dd0a60ace8429102c6c7e355
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To clean up the logic and prepare for more control character support,
change the behavior so that instead of treating end of buffer as a
forced line break simply stop incrementing the position variable until
getting a carriage return.
Change-Id: Ie3970cb779dac3c826a3d21cf0b9ae57a43eddb2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The terminal doesn't generate line feed ('\n') when pressing return,
rather only a carriage return, so we can simplify the condition for
handling end of line.
Change-Id: I3eef8c6af19c43ef98ccdd9a5e3662d280834425
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that the HCI driver is called H:4 use the shorter driver-specific
prefix h4_* for its internal symbols.
Change-Id: Icdab1147e5ec31f84e0a3d810192ddd462f4dfdd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll in the future also have a three-wire UART (H:5) HCI driver, so
the current H:4 driver cannot have a generic name.
Change-Id: Id326ae63d6f4d273d0d0c6120143e2f8d62968d1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make newline part of log macros so that caller doesn't have to
append '\n' every time logs are used. This make sure that no
log will be missing new line which results in concatenated log
messages.
Change-Id: I3231ae747c790816dbc1608e0a3bd56467ba0a1b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
() Fix compilation errors due to variable ordering.
() Fix the default config for Quark/SE SS as
the kconfig options were renamed in previous
patches.
Change-Id: I1004ae332fb857b60ed90df59831e7bd9c490cb8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The 'pos' variable is only used within a very limited scope inside the
uart_console_isr() function. Move it's declaration there to avoid
having it exposed to the entire c-file.
Change-Id: I45ff0090ea4e0aabe77db2549d0194e26ebb63ef
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Most of the uart_console_isr() function is heavily indented. We can
remove one level by converting:
if (uart_irq_rx_ready(uart_console_dev)) {
...
...
}
to:
if (!uart_irq_rx_ready(uart_console_dev)) {
continue;
}
Change-Id: Ib2fe150490a8391de4001f29e4727431668853c4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Shell applications may want to have a dynamic prompt rather than a
fixed string. Add a new API to let the application specify a custom
callback instead of using the fixed string given to shell_init().
Change-Id: I9844481057fc8e164530a677e7cb1bfb6d02cfc0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Clock gating is platform specific and not mandatory. Thus making it
Kconfig based as well as generic.
Change-Id: I4ea10eadb077ac3d57c9337b43b1a9fb14763302
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Clock gating is platform specific and not mandatory. Thus making in
Kconfig based as well as generic.
Change-Id: I01b7831536efd87cc66a95060fcf1faf4a340073
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Let's apply the interruption unmasking if only the mask is defined.
Which definition should be done in board.h thus applying the change to
quark_se and quark_d2000 platforms
Change-Id: I9c273e2e7e33dd077a54e8f9205fa949a5e3707a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Let's apply the interruption unmasking if only the mask is defined.
Which definition should be done in board.h thus applying the change to
quark_se and quark_d2000 platforms
Change-Id: Ie0a4912f0dfbd97f2273efed963f7810a985c0bd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Base address, IRQ, interrupt priority as well as the instance name: all
are now Kconfig based. Thus Applying the change to quark_se and
quark_d2000 platforms. Sample code is updated as well.
Change-Id: I1c225c1b68d94b22ca10423b50a78a0ba09a27a5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Base address, IRQ, interrupt priority as well as the instance name: all
are now Kconfig based. Thus Applying the change to quark_se and
quark_d2000 platforms. Sample code is updated as well.
Change-Id: Idcc89e6e9f4acc337fafc7d42f8de3061a5ece04
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A platform might provide multiple RTC, either internally or externally.
Applying the changes to the DesignWare driver relevantly as well as
to the sample code.
Change-Id: Ia70e791a6c45e186cbc4dc900a268fa882331af5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A platform might provide multiple watchdogs, either internally or
externally. Applying the changes to the DesignWare driver relevantly as
well as into the sample application.
Taking the opportunity to apply propre style when need (80 chars limit
for instance).
Change-Id: Iad020c697846db483a70a748cfc8fe7147ec3c04
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Removed old style file description and documnetation and apply
doxygen synatx.
Change-Id: I3ac9f06d4f574bf3c79c6f6044cec3a7e2f6e4c8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The kernel event logger requires this function to obtain
the irq that is being processed, but this was not implemented
for mvic. This patch add this function to mvic.
Change-Id: I5e1b4a6e2758b69ec713c18ac9f78aebad18a93f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Some systems are configured with CONFIG_MVIC which uses the same
call to create the stub.
Change-Id: I92f6657806159624dee9c271554a78bc76935613
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This adds CONFIG_UART_NSIM to enable the uart/nsim driver.
This fixes compilation issue where the base address parameter
is not defined due to CONFIG_NSIM=y but CONFIG_SERIAL=n.
Change-Id: I1dc1c15b22ad174d4db514d89551780f0dfcae66
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Now that i2c_transfer/i2c_read/i2c_write are fully synchronous, no need
to use the polling based function.
Change-Id: Ib578cf4a6d72ad0817e1aaeebc7e4dab9f9d293f
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add a semaphore. Each task or a fiber that initiates
a transmission waits on this semaphore for it to complete.
Change-Id: Ia6cf961397614ead252ebea3949c016056289311
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
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>
Function irq_connect() needs an extra parameter, so
add it in.
Change-Id: I4c7458e67ae57124228eeb486c8daf3b66a97f8f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds io/aux register support for IP configuration.
x86 and ARM configure IP through MMIO register access.
ARC architecture configure IP through io/aux register access.
Change-Id: I4d07b91af09d88b7eb6ac1aa02e875dcd626bd26
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
The Grove LCD driver requires running clock for delay. Since the clock
is only initialized in NANOKERNEL, so change the LCD driver init level
so that it starts after clock is initialized.
Change-Id: I6a2cadac1b34f95557f99c78615b1bd4aee541f5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The content of include/drivers/hpet.h is really private to
the driver and does not need to be exposed in public include
directory. So move the content into driver code.
Change-Id: Ica442e43c480a6b079b8d3c4e75e67adcfd0ba6b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Static irq api expect to have an isr with signature
void isr(void *arg).
This fixes the warning messages due the difference on
the isr parameter.
Change-Id: I64099ce47ba481b40446d5fb7e35fce0e46a9624
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Adapts IRQ macro calls for the new IRQ static support convention
on ARC.
The new IRQ_CONNECT macro requires to receive the irq numbers without
parenthesis around. This is needed to execute preprocesor substitution
correctly.
Change-Id: I318cb7916b6c3ff3a92b4d2e5a13379f8eed0b4e
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Since all the necessary bits utilizing UART by index have moved to
use device name instead, the uart_devs[] can finally be removed.
Change-Id: Idbae6b46c0af9eef6c22c59e121e9d6a6b52426a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Use device name to find the UART device for uart_pipe usage,
instead of relying on an arbitrary index.
Change-Id: I36aaa4ed8f0b4905e4e741ca1464947e59f30869
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Use device name to find the UART device for Bluetooth usage,
instead of relying on an arbitrary index.
The default device names being used are derived from the original
board.h for each platform. Some of them point to the same device
as UART console. Since this is a Kconfig option, the default
can be overridden so this is not a serious issue.
Change-Id: Ibe82f3968e72ba60f9c033aa3dfcb2fb3c41dc75
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Use device name to find the UART device for console usage, instead of
relying on an arbitrary index.
Change-Id: Iebe01c9bf392dfee6d8284367f67647f7d47561a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove unused code after refactoring all the serial/UART drivers.
() Since device initialization is done by the drivers themselves,
there is no need to have config_func(), port_init() and uart_init()
to perform configuration external to driver. So remove the related
bits.
() The IRQ priority is only being used when doing IRQ_CONNECT_STATIC().
So there is no need to send it over during uart_init().
Change-Id: I72eb3402036b53cbc01c1eb968de0ddfa0096ee2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Since the initialization is now done within driver, there is
no need to expose the port_init() function externally anymore.
After the consumers of port_init() have been updated. It is time
to perform the final step.
Change-Id: Ibe22c6d1dc9525c845acc094fa2066c922439ec3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Since the initialization is now done within driver, there is
no need to expose the port_init() function externally anymore.
After the consumers of port_init() have been updated. It is time
to perform the final step.
Change-Id: Iba7aeb056edd63ef3f9b47d3801a3e0eeb9b34d5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Since the initialization is now done within driver, there is
no need to expose the port_init() function externally anymore.
After the consumers of port_init() have been updated. It is time
to perform the final step.
Change-Id: I4e0d0a6802ddda4a6671c6d246233eaa5074d4ff
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove the call to uart_init(), and let the UART drivers take care of
the port initialization.
Change-Id: Id3e46135ab993cb6596b1fb5339ab1664c65ab40
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Remove the call to uart_init(), and let the UART drivers take care of
the port initialization.
Change-Id: Ibeca65b3fe64feb7a203a793c01c525ff5e6afda
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Rename nsim_uart.c to uart_nsim.c. This is to follow
the driver naming convention.
() Rename functions nsim_uart_*() to uart_nsim_*(),
following driver naming convention.
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
Change-Id: If015f39a6f6b4fcc65625e6e5f973b4469202f54
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Renames stellarisUartDrv.c to uart_stellaris.c. This is to follow
the driver naming convention.
() Renames functions stellaris_uart_*() to uart_stellaris_*(),
following driver naming convention.
() Renames CONFIG_STELLARIS_UART* to CONFIG_UART_STELLARIS*
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
Change-Id: I0eadc3878d69ff24d1637f8df5220fd2f161d24f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Rename k20UartDrv.c to uart_k20.c. This is to follow the driver
naming convention.
() Move driver/serial/k20_uart.h to drivers/serial/uart_k20_priv.h
as this contains definitions private to the driver, and
should not be exposed in public include directory.
() Rename functions k20_uart_*() to uart_k20_*(), following
driver naming convention.
() Renames CONFIG_K20_UART_* to CONFIG_UART_K20_*
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
Change-Id: If1be1fde083aba6ff68062db2059aef08617a286
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Renames ns16550.c to uart_ns16550.c. This is to follow
the driver naming convention.
() Renames functions ns16550_uart_*() to uart_ns16550_*(),
following driver naming convention.
() UART ports initialization is moved into the driver itself.
All the init code in platform config files is removed.
() Adds (many) Kconfig options. These don't have to be defined
in each platform's board.h anymore.
() Renames CONFIG_NS16550_* to CONFIG_UART_NS16550_*
() Disable NS16550 for ARC as no port is defined anyway.
Change-Id: I76bbe25b9bc75eb62df81e533f84f4f63a5257b7
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Quark D2000 which uses MVIC does not define CONFIG_IOAPIC,
so make the stubs work with MVIC.
Change-Id: If0ef53f16592a7a8a467629cffe976e37b258901
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
BIT() is already defined as a generic utility macro in misc/util.h
Change-Id: Ie74bbfe657de5de980439e30b2dcbb9168b69257
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is currently valid for quark_se platform. It's used internally to
suspend and/or resume the gpio controller.
Change-Id: I5147568ba6b0450363566b5f9fd2e8aa7e41df49
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change-Id: Ie58e8611a8fe9edec9ebcb123532a97f396098f4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There is no such feature per-pin. LS_SYNC is set or unset for the whole
controller.
Change-Id: Ic67048e29a9cc25a19e6a7bcc11d21dd1e65be61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Move btshell.h out of samples into include/misc and rename to shell.h
Move btshell.c into driver/console and rename to console_handler_shell.c
as an shell implementation based on new config
CONFIG_CONSOLE_HANDLER_SHELL.
Add shell_register_app_cmd_handler for an to app to optionally call so
that it can receive cmdlines not handled by the cmds registered with
shell_init
Change-Id: I5c1585e62ff7a0ee923c6c92833cc762cf912bad
Signed-off-by: Thomas Heeley <thomas.heeley@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The calls have been renamed and some drivers and documentation
are still using the old function name.
Change-Id: Ib7505fca6aadd68e3ea3a22bb445914c3eb6ed7f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Simplify driver by using sys_io functions and implement
wdt_read_config
Change-Id: I119615f1c391daae43a3b8db30319c51167ae05b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Removes the following deprecated routines:
nano_cycle_get_32()
task_cycle_get_32()
fiber_cycle_get_32()
isr_cycle_get_32()
Those routines have all been replaced by sys_cycle_get_32().
Change-Id: I8709952633bb87c8963e88caffe1036fb9add527
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Renames _sys_clock_cycle_get() (provided by the timer driver)
to sys_cycle_get_32(). It is the preferred method to read the
hardware clock.
Change-Id: Ifea5213d8c04a8bf7b9114b048c5db0ccee61549
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This platform if actually a subsystem of the Quark SE SoC and is
not standalone. Use a more descriptive name and remove the architecture
from the platform name.
Change-Id: I16b1ab8dd668441683b07fc4512c219924463441
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
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>
IRQ_CONNECT_STATIC now has the IRQ flags as the sixth parameter.
Change-Id: I680b21c92471e6bcb793598adcd286a73d539ddf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Avoid having to remove quotes wherever the platform name is used
by exporting the variable only once.
Change-Id: I4cb51901e4ac19d70d0310fe6bbacd157f586661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
IRQ_CONNECT_STATIC now has the IRQ flags as the sixth parameter.
Change-Id: Ib3efe15a128d74b84d83df3f8aeb39cdcea5ee41
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
uart_pipe when enabled was overriding all previous objects.
Change-Id: I5620b56dc7e42f887a7b78e07470e729a266d5f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The HPET reads its frequency at runtime, and thus must set all relevant
global constant values at runtime as well.
Change-Id: I965102bbdcea370297d5a2bbe14177ec0d0d3794
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Some timer devices, such as the HPET, read their frequencies at runtime.
All global constant values must be set at runtime in that case.
Change-Id: I408babce6deb857748a87691132d7e27e88f0bb8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
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>
- Provide the irq flags to IRQ_CONNECT_STATIC
- Provide the actual IRQ for that controller
Change-Id: If660baca7e92065cfdb588a2ae86ff13da0918eb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
- 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>
SYS_GET_DEVICE() needs the name set in DECLARE_DEVICE_INIT_CONFIG() not
the one in IRQ_CONNECT_STATIC().
Change-Id: Id1ed66953c863531411b34594ffed669ad524ef5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
That fixes a build error. Platfom's board.h have to provide such flags
if they enable dw gpio 1 controller.
Take the opportunity to provide the right isr to IRQ_CONNECT_STATIC.
Change-Id: I16900ea04f7f7c5d3c99b93a92b00c1f651494de
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Original name was too generic and confusing. This patch renames
driver to pipe UART and moves it to console drivers folder. Kconfig
destription is also improved.
Change-Id: I716fdbf7d636bbdc03b0fce27a59fd866f473246
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This module is based on the standard Local APIC and IO APIC source modules.
This modules combines these modules into one source module that exports the
same APIs defined by the Local APIC and IO APIC header modules. These
routine have been adapted for the Quark D2000 Interrupt Controller which has
a cutdown implementation of the Local APIC & IO APIC register sets.
Change-Id: Ic80aa78918483663d76054ebadefa08d8a3f188a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Adds the register definition for the DW GPIO hardware block.
This set of registers and offsets are specific for the SS
GPIO hardware block in the Quark SE platform.
In particular, the register BOTHEDGE (offset 0x68 in the
main GPIO block) does not exist on the SS GPIO block.
Change-Id: I4e16ec7c8e89015be1fc8bcdb1b7fa5377890b9d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This adds the I2C driver for the Sensor Subsystem on Quark SE.
This provides minimal support for the I2C controller, and does
only synchronous transfer at the moment.
Change-Id: I400b8ff3390d4b641bed5b8c617830c4217de3ff
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit adds the Synopsys source code for the arc ADC driver.
Change-Id: I140a63505685cda8ec9d3174b7cf4fc1e2e91b06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This adds the driver to support DesignWare AIO/Comparator
under drivers/aio.
Change-Id: Id6cb1b507c0526098f163f74c188e990590797c2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
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>
Implements a low-level IPI driver for Quark SE mailboxes.
Configures the Quark SE platform to initialize it and
configure an IPI console from ARC->LMT on channel 4.
Change-Id: I30123771d04c2e06ea6fcca585fd4ef74c0717a7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Quark SE provides various clock controllers through its SCSS block.
Peripheral, external, sensor, and others.
This current drivers provides only the clock gating capability, for
peripheral, external and sensor. But it could support divider and more
other features once defined in the generic API.
Note: such clock has _nothing_ to do with a Real Time Clock (RTC).
An RTC provide clock timing like a watch would do. Here the clock
controller is about circuit clocking.
Change-Id: I1a365ae730dfc6be7686271f7fbb693e64a6ff6f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Adding DW real time clock support. This driver is used by the Quark SE
and Quark D2000 SoCs.
Change-Id: Iba8ddee1b1b5fee298db95b63418e152774662a4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The driver should handle the initialization instead of relying on
platform initialization. This is to conform to the driver model.
Change-Id: Idc95d59bce2470b5118e416ee05f07548991a15c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
since we are in the same directory, include the file directly.
Change-Id: I21c959538e4a3d9e3fba99eaa9b09697fffe25b0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
since we are in the same directory, include the file directly.
Change-Id: I8c676e1e5acd7dbab2c283d914a3ef62c2d36cdc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Changing the ROM struct's interrupt_vector to reflect
what the value is properly referencing.
Change-Id: Ifb284821e82e01123c51a848d694da19e442c1e8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Due to a quirk of the k20 UART, when checking if either a Tx or Rx
irq is ready, one must first check whether the UART has enabled the
Tx and/or Rx interrupts. If this is not done, then all one is doing
is testing the UART to determine if it is ready to Tx and/or Rx.
Change-Id: I08a8280ed9fb0faef586f3c7d7befb3bfdec1e2d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
There's no need to do manual minumum calculation when there's the
min() helper available.
Change-Id: I4d5cfb088d9e6499750664680419ab4beb56e0d5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We can remove the need for the extra 1-byte headroom by simply
directly writing the H:4 header with uart_poll_out(). Also the
separate uart_out() function can be removed by taking advantage of the
counters already present in the net_buf.
Change-Id: I54bd852e28f416b3de250cd9f8a126269cccfc14
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We know the needed values at build-time, so there's no point in having
a runtime mechanism of accessing them in the code. Having the values
as defines makes it e.g. possible to use them as input for defining
the size of buffer pools.
Change-Id: Ib7556644719bfb631e638fa5bf29f3d1747a5072
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It is more intuitive to assume that the driver send() consumes (takes
ownership) of the buffer given to it.
Change-Id: I53d9cbebc0564d1d11110fc78a62ce0bbb3cdfd2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
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>
Somehow through the process of enabling Galileo, we have partially lost
the functionality needed to enable I2C1. Bringing back the I2C
configuration options for I2C1 to the DW IP block.
Change-Id: I296bd9c3d167969df5b2fe17627633f5ec4b1ba4
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Such controller is found in legacy bridge on Intel's platforms. Such as
Poulsbo or Quark x1000.
Change-Id: I30f205f1e73aaa680092e92717fdacbb74046fa3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now make use of sys_io_clear_bit and sys_io_set_bit
Change-Id: I11ebcd8c31d2a4c6d3dac37a0eca0ffcfacead61
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A tiny fix where the pin is the bit position, not its mask.
Change-Id: I4ed8c4b2968ff28b407cab88903351bafe6501ba
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fixes the logic in the routine k20_uart_fifo_read() so that it reads the
data from UART if the status register 1 indicates that data is available.
Change-Id: I1722b013e05c7477587c07f5a0b90c753ba34aab
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The ADC implementation requires that the kconfig option NANO_TIMEOUTS be
enabled as it uses the routine fiber_delayed_start().
Change-Id: Iec49fec4badd3fcf173a2d2cc9d2924299190150
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
- Changed behavior of duty cycle to have the signal ON time as the
duty percentage instead off the off time. Note however, this requires
that the off time is controlled. The behavior seems to be inverse of
what the user will expect on the header IO.
Change-Id: I1e7abf0324509de375d545a0215fd1edf2283814
Work-by: Johan Kruger <johan.kruger@windriver.com>
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Rename them to SYSTEM_CLOCK_DISABLE and sys_clock_disable to put
the symbols in the proper namespace and to align with the rest of
the timer APIs.
Change-Id: I341cdb1bd6cc01e5662d8526c293d4e0acd6ec24
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
ioapic_mkstub applies only when an IOAPIC is available in the platform.
Change-Id: I40294e4c11ef04739a1ce2146d125f3c5478013d
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This patch updates the ISR initialization code to reflect recent
changes in the underlying Zephyr ISR infrastructure. It also adds
assertions to detect failures to lookup device bindings during
initialization.
Change-Id: I4bf1955da44a97f8c2652b96a390804c5cea73e3
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
- 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>
We generally call this in interrupt code, and since it's just a register
write, get rid of all the function call overhead.
Change-Id: I251fa3cee0841fcdd8eecc7941d4d3782d112e66
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We are interested in supporting some XIP x86 platforms which are
unable to fetch CPU instructions from system RAM. This requires
refactoring our dynamic IRQ/exc code which currently synthesizes
assembly language instructions to create IRQ stubs on-the-fly.
Instead, a new approach is taken. Given that the configuration at
build time specifies the number of required stubs, use this
to generate a build time a set of tiny stub functions which simply
push a 'stub id' and then call common dynamic interrupt code.
The handler function and handler argument is saved in a table keyed by
this stub id.
CONFIG_EOI_HANDLER_SUPPORTED removed, the code hasn't been conditionally
compiled for some time and in all cases we call _loapic_eoi() when
finished with an interrupt.
Some other out-of-date verbiage in comments related to supporting
non-APIC removed.
Previously, when dynamic exceptions were created a pointer would
be passed in by the caller reserving ram for the stub code. Since
this is no longer feasible, two new Kconfig options have been added.
CONFIG_NUM_DYNAMIC_EXC_STUBS and CONFIG_NUM_DYNAMIC_EXC_NO_ERR_STUBS
control how many stubs are created for exceptions that push
an error code, and no error code, respectively.
SW Interrupts are no longer triggered by "int <vector>" hard-coded
assembly instructions. Instead this is done by sending a self-directed
inter-processor interrupt from the LOAPIC, using a new API
loapic_int_vect_trigger(). In this way we get rid of dynamically
generated code in irq_test_common.h.
All interrupts call _loapic_eoi() when finished, since this is now
the right thing to do for all IRQs, including SW interrupts.
_irq_handler_set() for x86 no longer requires the old function pointer
to be supplied.
Change-Id: I78993d3d00dd153c9051c518b417cce8d3acee9e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
use gpio_dw instead of gpio_<function>_dw to be consistent in the
driver itself and with other drivers.
Change-Id: Ifb0e50c230f142197eb4b01c1bb4ce1c16e4753f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We now have BIT defined in a header file globally, so lets use it.
Change-Id: Ie7b87478cb5a9e977ec045efa072d28fab86e78b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In order to have a name according to the functionality of the feature.
This commit rename any text, function and variable related with the
Profiler name to Event logger.
Change-Id: I4f612cbc7c37965c35a64f06cc3ce5e3249d90e5
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Adds an input hook to be used by the interrupt handler uart_console_isr().
This hook permits the console input to detect a character escape sequence
that can be used to override the console's default input behavior.
This input hook can be set using the following API:
void uart_irq_input_hook_set(struct device *dev,
int (*hook)(struct device *, uint8_t));
The hook returns 1 if the handler should stop processing the character,
and 0 if it should not stop.
Change-Id: I95e7da75e07fb6caaca2d45e80bfc4334a43c0ac
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The simple uart drivers expects configuration options to be defined in
board.h and fails on platforms that do not provide such options.
Throw an error if needed configuration options are not provided.
Change-Id: I8c938868171eb8c1382075275ad96379cfc05a5a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Allows to remove the both edges support from the DW GPIO driver.
Change-Id: I9e39cca320aeac5d10aafe7a83641917ad004fe6
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Removing many of the typedefs that are only used once to lessen the
checkpatch warning about creating new typedefs. A handful have been
behind as they would require a more invasive change to the code. It
has yet to be determined if this is a worthwhile endavour.
Change-Id: Ibeb29e0a1d37e8121218fccf0d986cbebd226e85
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Even if a buffer can't hold the needed amount of data we should still
cleanly discard the bytes so that the driver doesn't loose sync of the
next packet boundary. This way we also get to remove the now
unnecesary 'failed' label.
Change-Id: Ic921fbf6c0ddef4a7721cee7fa3e01a31b127778
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The space that the HCI driver needs to reserve for its own use is not
necessarily symmetrical. E.g. even with the current H4 driver we only
need to reserve space for sending data but not for receiving it.
Keeping track of these values independently enables more efficient use
of the buffers.
Change-Id: I64917b545c5cd77356ed038d09afe76422334661
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that we have the buffer type enum as part of the HCI driver API we
can take advantage of it to pass the buffer type information and not
have to have two separate callbacks.
Change-Id: Ib2ee5b1540e532c9b27903e97660a276c1293fbc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This way we avoid dealing with the specific buffer type value and to
make it clear that these are for drivers onle.
Change-Id: I8aef7ec6a767b2fa68cbe374eb371e2a6192f675
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is a necessary step in preparation for removing the buffer type
information from the buffers.
Change-Id: I29d8fae32aa660416a1c12e87840499c711e659f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It's invalid to try to send HCI events to the controller so we should
treat such buffer types as invalid in bt_uart_send().
Change-Id: I4108a158d5b91f364a9f3c56e3037f03755daa19
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To avoid unnecessary stack variables and to simplify code, add helper
macros to access the Bluetooth specific ACL and HCI user data that's
part of the buffers.
Change-Id: Idc337537721115c4091982c04f8a05bbbf0d5a19
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I8df37d214e1f93ee472cde82c4198d667709ff5a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch performs the minimal necessary conversion to the net_buf
API. It uses a temporary "#define bt_buf net_buf" to make it possible
to convert the code in smaller increments. Most old bt_buf function
also serve as one-line wrappers to the matching net_buf APIs. Once
everything is converted these helpers will be removed.
Change-Id: Ie31433d33576022c9c193a35d2389267005545d6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch adds a driver for a Synopsys DesignWare Ethernet MAC. The
driver uses interrupts to handle received frames, but it uses a
spinloop when transmitting to wait for the transmit descriptor to
become available. Transmission is coordinated by a fiber, so this
should not result in the system execution being blocked. Only a
single descriptor is allocated for each of the transmit and receive
directions to save memory and simplify the code. Another
simplification is that none of the offload capabilities of the
Ethernet device are used. The driver currently only supports a single
instance of the Ethernet MAC, which is consistent with the limitation
in the network stack that only a single network device is supported.
Change-Id: I013b3d439a76e8ff91a775516f7035841b040870
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
This patch adds the pci_enable_bus_master function that enables bus
master access for a PCI device.
Change-Id: I317daac1a613ccfc5a3894332c1a7dbbff05991f
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
There's no point in having a return value for uart_out() if it always
returns the same length that was passed to it. Just make it return
void and remove the error handling code from the caller (which would
never have been run).
Change-Id: I88dab7499a5f526ca65058640021f84e1b3486ca
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The reason why fifo_fill works in qemu but not on real hardware is
that qemu serializes all byte transmission 1 by 1. There is no
real hardware fifo emulated, and "fifo" depth is 1. On real
hardware, the controller owns an internal fifo, with a depth like
8 bytes on Quark x1000. And because of execution flow, how fast is
the controller etc etc... a fifo_fill call might fill in the
internal fifo of 8 bytes and then controller says "I am full"
(which means: "wait for the fifo to have space again"). That's
why poll_out() works: it does the same as fifo_fill and wait
that the internal fifo gets some space again before continuing.
And only when all bytes have been pushed in, it returns.
Change-Id: I452a6ebb2913c5e52ed01d999185e250aa3ed474
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Catch cases where index is set to negative or wrong values.
Change-Id: Ieab73e0fb12cecfc6c3c3d74c7d41f640bc88f01
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The galileo board no longer needs an extern of the initalize
routine once we've moved the process to the actual file.
Change-Id: I21a0748729b2435a368e28b3a2744b2089ed1e13
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Adding in dependency of GROVE_DEBUG to the GROVE configuration
option being set
Change-Id: I4108e619254ca3cde2b96de595e1b8300fe6a752
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
XIOAPIC_DIRECT_ADDRESSING and IOAPIC_MSI_REDIRECT are never
set and not tied to any config options.
Change-Id: Ib64cd198c99fe670eb5bcd946ce93f616c03d12a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The \NOMANUAL tag is a remnant from days of yore and is no longer
needed or useful. Cleaning up the code references to this.
Change-Id: I1b8cc9c9560d1dbb711f05fa63fd23386789875c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
This was only needed for the older 8259A style PICs which are no
longer supported.
Since we now just support APIC, we always just call loapic_eoi which
no longer requires an argument and informs the IOAPIC that the interrupt
is complete if necessary.
Change-Id: I15c9b7b4f03b872656220af32220b62e043bfa6b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
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>
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>
Obviously it's '&' and not '&&'.
Change-Id: I9bb9fee80a67697e8ea62bb001af1b72f5a356e6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The I2C1 device is currently using the older device initialization
method, and thus will not work.
Change-Id: If193f20275262abc3b08edd3a26679ae9ad39d94
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
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>
The kernel configuration option SHARED_IRQ_1_PRI is dependent upon
SHARED_IRQ_1, not SHARED_IRQ_0.
Change-Id: I018cd8e860c362572cdde8586e50aed990d350bc
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
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>
This patch corrects gpio_dw_setup to use the MMIO base address
determined by PCI enumeration when that enumeration feature is enabled
instead of always using the default base address specified at compile
time.
Change-Id: If139c40ce30275694e01196a4a4aa529cd714f06
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
Change-Id: I7e920e6de8f4b7a726c03c05edea3cbac69eb374
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I2276676142deea21cf8079449ce153f2fb887a8e
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I34a54230bc4a63c8a4391d03ff530835910c3705
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I819d13f0d7a23e3a61dcda6a3ced18810b192158
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I6e3dc44be7bb6d01a7181d8c8e90cdb72120c3db
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I6da43e41f9c6efee577b70513ec368ae3cce0144
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Change-Id: I2298add2399559d95c75a90c045286046372b7e0
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Moving many of the functions from the old format of inline comments to
the newer doxygen format.
Change-Id: Ib0fe0d8627d7cd90219385a3ab627da8f9637d98
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
If console handler is defined uart console should also be defined.
Change-Id: I3efcc6c837f8f1621340f7f13bf0603d7dc42fb2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Only driver specific public headers should be found in include/drivers.
All generic API are found in include/ directory.
Change-Id: Ic50931987bb9460fd4a3843abc6f5de107faf045
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
With ioapic_mkstub now taking a context value we can have a single isr
routine and move away from the isr trampolines we have now
Change-Id: Ibbb0f627ac515b12c0590a71da6a3267c952dd30
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Add a context value to the ioapic and loapic mkstub macros to allow
the developer to specify a context value that will be passed on the
stack to the interrupt service routines.
All the invocations for the loapic_mkstub and ioapic_mkstub macros
have been changed to pass in 0 so there is no functional difference
ATM. This change removes the need for drivers to have trampoline ISR
routines to pass a context vaule to their generic ISR routine.
This is the first step in getting rid of the hack where the driver
needs to look into the __initconfig_* linker objects.
Change-Id: I2c5eaa20d8cb5a42ef445762c426854be32c8452
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
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>
Change-Id: I8f51f861e2250c87c296b697ef5b6610ce644b34
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
checkpatch currently reports several files failing the C99 comment
verification. Cleaning these up now.
Change-Id: I35766c1f6c88a280c5e844b3f02668d6e1ad11d2
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Naming convention of the OS requires the use of underscores (_) for
filenames instead of dashes (-).
Change-Id: I62b615f1f336e839cbbef2c3721c1926afe76457
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Naming convention states we should be using an underscore (_) for
filenames not a dash (-).
Change-Id: I51a6ae02957bfc556b8718aae713636bd14c8b2c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
The naming convention is to use underscores (_) and not dashes (-)
within the filename.
Change-Id: I678cf01306d72a905ed7b161af116c6e4a2cd39c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
The naming convention used in the source is for there to be an
_ and not a - in the file. Fixing GPIO to be consistent with
the os naming conventions.
Change-Id: Ifc4356c14b52e2cc2411a7445b44c7cb57d2765c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Naming convention uses the _ not - in the file names. In a recent
commit for I2C this for some reason changed. Making the names now
more consistent with other files.
Change-Id: I1e363c0c09ae0c8b2ac3def3beeaaeafcc01eb74
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Change the new files from Intel in BSD-3 to Apache 2.0
Change-Id: Ica4b455e9cb8134889f2a88e2d96094ce7093734
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
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>
Initial import of the Grove LCD I2C controller. Data sheet can
be found at:
http://www.seeedstudio.com/wiki/images/0/03/JHD1214Y_YG_1.0.pdf
[DL: Updated command sequence according to datasheet.]
Change-Id: Id1b491f8dce346769dc42c41fac0ea3aabe3950a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
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>
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>
It's an SPI driven chip and proposes up to 8 channels for input
conversion. It's found on Galileo board.
Change-Id: I916367e9be0849812c6a509082a501730a01ce60
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
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>
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>
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>
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>
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>
With the introduction of generic transfer function, it is no longer
needed to specify read or write functions explicitly in drivers.
All read/write functions can now thus call the generic transfer
function to achieve the same result.
With this change, the transfer function becomes mandatory, and
should always be available.
Change-Id: Ia6fb98e58b84330a56a5d44ed3df9db42c3a5e88
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The newly introduced i2c_poll_transfer() is now used for register
read for PCAL9535A GPIO driver. The old write then read does not
work because every read or write ends with STOP. However,
the chip requires RESTART after writing the register address.
So the new generic transfer function is perfect for this.
Change-Id: I56d7ebe08f68cb04731c72138d60645ef124f65e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() For interrupt driven transfer, the driver already has
a generic transfer function, so this simply exposes it
for public consumption.
() The polling write is extended to support generic
transfer.
Change-Id: I657db8a6376282c723728b7a875813d389cf7d27
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
() Re-organize the steps involved in data transfer, according to
the datasheet's flowchart.
() Extract the common code for transfer initialization and put
it into its own function.
() i2c_write() and i2c_polling_write() are now using the common
data sending function.
Change-Id: Ieb90253ee10ddceb3b5d05b258e7fc6253d18729
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Both poll_in and poll_out are supposed to be implemented
in each driver, as these are basic function.
Change-Id: If1b6b11834f57934fe7e776bfcf818e088abdd0a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
PCI legacy bridge is a device connected to PCI bus and
allowing to program the routes from interrupt pins to IRQ
numbers.
Change-Id: I129719d71f958bbf5ad8c5c9949dcea93d94b89d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
PCI enumeration is not mandatory to enable as static information can be
provided. Plus, it does not integrate yet properly with shared IRQ as
well as setting dedicated IOAPIC paremeter for certain drivers.
Change-Id: I221b2a8a2179993a264e5f3eb93cda0e121d9abe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Providing the right settings through Galileo's Kconfig.
Change-Id: Ia5339eb90cb98d7dde3be0493bcfd9a6b6db60ed
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This provides the API to manipulte the pin muxing, where
a single pin may provide different functions depending on
settings.
[DL: changed commit message.]
Change-Id: Ifd161137c062dff184024b5aa34737604911d09c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the driver for PCA9685 I2C-based PWM chip, and provides
basic PWM functionality.
Change-Id: I8c711d9b703fdaf5ccb23657e07495a95cbe16ee
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fixes a build failure in designware gpio driver.
Change-Id: I90a540f56bff17ff56d0315356fde6d6c4d02407
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Register values are now being cached in memory, and are being used in
subsequent writes. This is to avoid reading from registers, as
we know what needs to be written to those registers all the time.
Change-Id: I9b344303c0cb9f28e974514ab674135004f68ea0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The _has_i2c_master() should return 1 if there is an I2C master.
The logic was incorrectly inverted. So fix it now.
Change-Id: Ic4bf44efc1f68644530a275f0c4e454740a2950a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the public APIs for PWM drivers. Also, this adds a Kconfig
and an empty makefile for drivers to extend.
Change-Id: I1cc0c908b6f5aeeb678b6368640d5b9a1cc9751d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Following the naming convention established, private functions
should be prefixed with an _
Change-Id: Ib6006ba3a928da88b8b8c3324f7d4b833f736270
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Many of the i2c functions continue to exist in a format of
<IP>_<interface> and will now follow the <interface>_<IP>_
naming convention.
Change-Id: Ic7ec879105f5c06f0213f8d771b3811253c49658
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Clearing an interrupt in DesignWare is done by reading the port
not by writing to it. Original problem found by Dmitriy@WR.
Change-Id: I1de052632ec36e2d496c563e81307169e9dabcf4
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Those ports uses different instructions to get accessed: in/out
instructions. It differs in many ways with memory access, and it's much
slower. It's unset by default, but some arch exposing legacy UART ports
might need it.
Change-Id: I06f2a7c7812e720863957bd20d5c2b8b02c10734
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
The header file was renamed in previous commits, but the #include
referred to a non-existing file. This causes compilation error.
This uses the correct file.
Change-Id: Ibda7dbca82323d99dcff71cbee8f642f6cd611d6
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This makes variables readable and consistent with other drivers
we have.
Change-Id: I816f133279497eafd5d5614013c8d224d5909590
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This driver naming is an exception which compared with all other drivers
we have. To keep things consistent the configuration options and variables
are renamed to <type>_<name>.
Change-Id: Ib95aa09630a507848f78d8f2c28706b545eed06d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Don't give on the semaphore if the ring buffer is full.
Fix a missing newline in a debug message.
Change-Id: Ic0030365665c32cc9f1c641f9dacffd1a1915b09
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Some platforms send over \r\n for newlines, just send over the \n.
Change-Id: Ia6072eb3719a4c7dd828457cf1634d16f4eec38a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This adds a simple driver for MMIO-based GPIO ports.
It does not trigger any interrupts due to pin level at this moment.
Change-Id: I0c439f221988817e4be72653c68257ef6ace5bde
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the driver for I2C-based PCAL9535A GPIO chip.
This currently only enables minimal set of features of the chip for
very simple input/output operations, and does not support interrupt
yet.
Change-Id: I32ea07a71a38866280a96e68cff49cb0df12b85d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This change puts the DW GPIO Kconfig selections inside GPIO menu.
This also groups all DW GPIO related selections under GPIO_DW.
Change-Id: I776f3f6b89e1a4dc366648f8290abb27de9eceb8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This was missing an include file, which caused the macro to not
be expanded correctly. Including init.h fixes the issue.
Change-Id: I6b190e0c75828d9b6eb42a84c213dfc174510740
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Change the IOAPIC driver to be initialized directly from the init
system. The function signature of _ioapic_init() function is updated
accordingly.
Change-Id: I2f824ac745926966eebb23f60445a41e1df9eb8f
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Change the LOAPIC driver to be initialized directly from the init
system. The function signature of _loapic_init() function is updated
accordingly.
Change-Id: I5ed26d53524c8526d413a05ac9a7a58dd4264c5a
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Change the PIC driver to be initialized by the init system. To be
initialized by the init system the function signature of the
_i8259_init() function needs to be changed to the standard *_init()
function signature specified by the device model.
Change-Id: I63bf1cd0ce78920fa20da94f5966e5aab4bf41b2
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
This introduces a generic driver set for console messages routed over
inter-processor interrupt (IPI) channels. These drivers bind to a
low-level IPI driver instance for the actual transport of messages.
ipi_console_sender installs printk and/or stdout hooks to forward
messages over IPI. There is currently no buffering on the sending side.
ipi_console_receiver installs an IPI callback which stashes incoming
characters into a ring buffer, which is monitored by a nanokernel
fiber. The fiber buffers the characters on a per-line basis and sends
them to either printk or stdout. Multiple instances of this driver
may be created in case you need to receive console data from multiple
CPUs.
Change-Id: Icebc110794fbe040f975101cd2ae6e78fb38645a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We are introducing other kinds of drivers which support a console
that isn't over a UART.
Change-Id: I0dddbdce958437b5709c5ab26252ed47d030413d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The code fragment to bind the instances of the I2C driver 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: I9ea132c9340437ccb292bb8f3fa3d3a2b2a794db
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
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>
The code fragment to bind the instances of the GPIO driver were being
replicated in every platform_config.c This code 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: Ie07a3d12d25201e82ce7074455e6c036f463851b
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
This buffer can be examined at runtime with a debugger to see what
is going on. Helpful if there are no other working console drivers
on the system.
Change-Id: I759467a57d16204b4b316c4f6fa8b7d5e1d1d236
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
When configured as GPIO_ACCESS_BY_PIN, the callback should
be called only if the pin is enabled and received an interrupt.
Change-Id: I7addeb57c8d46dddc027e9b82a92654cd210ade1
Signed-off-by: Ricardo de Almeida Gonzaga <ricardo.gonzaga@intel.com>
The send() callback of HCI drivers should be returning 0 on success
and a negative value on error. The uart_fifo_fill() function returns
the number of transmitted bytes so it can not be directly mapped to
the send() return value.
Change-Id: I59be478c1985f44a46f2a9613f61471423b0e63a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Rewrites the LOAPIC timer tickless idle implementation to cover all edge cases.
Change-Id: Ide0a235f298dfc5c75a090a45d1bf8275d81e248
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes tickless idle skew calculation as it is not particularly useful.
The actual "skew" may vary wildly depending upon whether cache is involved
or not.
Change-Id: Ie5c966eba5cdc3cff2610d4c1f3bb673c83ec8b7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Fixes two missed replacements of
_SysIdleElapsedTicks -> _sys_idle_elapsed_ticks
in the timer drivers.
Both were previously missed due to typos.
Change-Id: If55c9624df6f3bd7188e249f74d3ee3de61a68e4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Make config variable name match the function. The PIC is never turned
on in the zephyr code so there is nothing to shut off.
Change-Id: I1627e5a35cc37ef7959f36758c1e1aec03e22782
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
These x86 drivers are the last users of the PLB_* macros change to use
the sys_{in,out} functions.
Change-Id: Iebd0ad1bf5e74379498f86b24d835a0430db1311
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
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>
- 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>
Change DEBUG option into something more specific.
Change-Id: If1f421fbf7d234ad6bfac410697205d5d74548c0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Menu depends on X86, however some options are available
for all architectures.
Change-Id: I09cad39811319022d0323a4ff87d415346b5630a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This will let us getting rid of old outByte/inByte functions.
Change-Id: I3344151c54f99e5e281ac8d3d027e0b810796111
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Only 1 port is available on Quark through the PCI bus.
Change-Id: Ie0e0173686947134d2553dd0fd0230ffa5a1d456
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since such controller is found on Quark x1000 (Galileo, ...), it will
need to get configured and/or enabled through PCI.
Change-Id: I16d00364edcb17653eaaf073e87b4e5850de7299
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Using the OS provided sys-io functions for access to the registers
and lower level devices.
Change-Id: I1a88786189cbed0965f84146ffad9988a3b68a7b
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Initial import of Synopsis DesignWare I2C driver functionality
for the Zephyr Project. This import has been tested for host
master control. While it does contain the code to work as a host
slave, this code has not yet been completely tested and validated.
Change-Id: I3df0214f6e3b6798f7dad4819d09c3ec5998e508
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Adds the necessary changes to Kbuild and Makefiles to enable I2C
driver support to build.
Change-Id: I3113ccbbbbb4e06ef134ca73f509d2755a2abb59
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
- Device ID was wrong
- Setting default class id
Change-Id: I9fd1df284eca4067c21beffa7599307a40be5144
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
A fix for a mistake introduced in commit 1a7357.
Change-Id: I411937c85f29abb934ae5385f4858950f5d76887
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
No need to keep track of PCI class's bus and dev. First, there might be
more than 1 bus and/or 1 device which would hold the same class.
Secondly, with the new PCI_ENUMERATION option, enumeration PCI device is
now optional and it's advised to unset such option and statically
configure the PCI information of the devices (to gain in booting time
and code size). So finally removing all of this.
Change-Id: I395d08c8f6f5e76431af59aa6fc9b30d703f2e75
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Change-Id: I151b3c6516b9b5a38ab0da2948c951eb69d57498
Signed-off-by: Adrian Pochiu <adrianx.pochiu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The _ARC_V2_IRQ_VECT_BASE register must be set to the vector table in
flash.
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Change-Id: Ied5451c98222f545cd669967023aef26c3d8e48e
Only one wrong is sufficient to fail the test: the found device is not
the one we are looking up to.
Change-Id: I2a54b5683fedf7d54de1e1553aecba40b6b6b2e1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will help when debugging, since there might be different bus and
device on the same target.
Change-Id: I886a256f14a960d2faed71561416ee3bee20af1e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Updates the documentation as the quark platform configuration had been
previously renamed to 'galileo'.
Change-Id: I31e1920f30f57b243b07215fe92be08b5e5c9d59
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This will enable the possibility to use this driver with Quark X1000.
Change-Id: Ic40b750d608488e97cc7662cad6c6d66dbf428ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Just to align the code to generic memory mapped registers and bit
operations functions.
Change-Id: I0fe8b3b6687670d0ed0daffe52645ec2c6b4c674
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit fixes the set bit function.
If the value to set is different from zero, then
the indicated bit will be set.
Change-Id: I9c42f683d108b371ca821f446ac5a10541b89b9f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
[DL: captilize commit message title; fixed some whitespaces;
changed the __initconfig_gpio_* from level 0 to level 1,
which is the level of pure_init; and added include path
to board.h; ]
Change-Id: I7eea6a6ca9e4b7cf8d1ccabb57f07f786da93ef0
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
- Makes the code simpler in driver side
- Configuration is done on platform's config.c file and not the driver
- Handles CONFIG_PCI_ENUMERATION setting
Change-Id: I9b8376cebd7e0b62279251da132a2c4ee7b2e148
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
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>
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>
This option will be used to disable PCI enumeration (not PCI bus) to
gain in code size and execution as long as driver will be properly
configured statically. Thus setting this option as set by default.
Change-Id: I7da5d154c8ee89e44fc2bad8e85a5a20f498927e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
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>
This will be useful to enable memory mapped registers for PCI based
drivers that requires it. Removing redundant setting as well.
Change-Id: I52e47d01263a2de31c0c9f52ff65cc7e2734cf08
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will be useful for PCI based drivers to integrate fully within
the device driver model, where they will have to provide the function
they are found.
Change-Id: I7d64a4c6727cee52cbcb743c859cda43ac1a853b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Add the interrupt profile points for x86 and ARM arquitectures. This
gives information regarding the time when interrupts occur.
Change-Id: Ic876c0e7f9e8819d53e0578416f09146f4456d3d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
The uart_devs in platform config files have been converted to pointers
to struct device. This change is missing in the simple UART driver.
Change-Id: I8107f9e78daeeb3878140506f51bbd0025fde05b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The drivers provide _sys_clock_cycle_get(): moving the public APIs to
the drivers allow them to be aliases of it.
Change-Id: Ic5975a048f2b51f94510f0c3cd5e6ab3a8907718
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines.
Change-Id: I3866843a31e30e1dd464b27cafc830900d8dce4f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clean up variables and function arguments to conform to coding style.
Also align the function argument list.
Change-Id: I49eff429bfa369c8a544d8171e35a41523995aa3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines, updates
the comments for function, and adds missing comments.
Change-Id: I7610e8667cd85feb0c4c853b44880f7e29b6c05a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clean up variables and function arguments to conform to coding
style. Also align the function argument list.
Note that this only changes the parts related to UART.
Change-Id: I84a6ba88963784f6ddc77d5bda653a7d2de6a72b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Converts the file description to doxygen format, and updates
the information inside. Also removes empty lines, and updates
the comments for function.
Change-Id: I97672996510fec1c92a30f78d6f088f02279fb44
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clean up variables and function arguments to conform to coding
style. Also align the function argument list.
Change-Id: I0787558abe899e9376ede0ee5c5ac5728c42254d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fix the option that enables level triggered interrupts usage.
It depends on CONFIG_HPET_TIMER_LEVEL_HIGH and CONFIG_HPET_TIMER_LEVEL_LOW
configuration parameters.
Change-Id: I3529b1e57b1625e6f0f4b05d9c15eb563e9c4f83
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
The initialization procedures need to be called in the
following order:
- basic hardware initialization;
- devices initialization;
- hardware clock initialization, that the kernel needs to
run the kernel server.
This way, the board initialization routines is placed
to the pure_early_init level to make sure it runs first,
all device initialization procedures run at pure_init level,
so they are initialized early enough to be used for debugging
if needed. Hardware clock initialization is placed on
nano_early_init level to make sure hardware clock is initialized
just before the kernel server starts.
Change-Id: Ieecf9f0252c47c621b7208969687dc1113fc2ad0
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
This is just a cosmetic change to unify anything interrupt related
under 'irq'.
Change-Id: Ib8804d194e11eb49526fda952d9efc0f2ffac2df
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Move the baud rate selection for uart_console into Kconfig.
This allows apps to specify custom speed. Default is 115200
which should be supported by almost all RS232 and USB adapters
out in the past few years.
Change-Id: I78649bf2a1b2ddfc90a20d611a6454e3ad3b1b3a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is the final step to convert serial to the new driver model.
The dev->driver_api is now being used by individual drivers.
As a side effect, it is now possible to build multiple serial
drivers in the final image (though it won't make much sense).
Change-Id: I5d864e6503a5431b29006c311320155adf81cf5b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This introduces the config option CONFIG_UART_CONSOLE,
and also CONFIG_CONSOLE. The UART console can finally
be disabled if desired.
The defconfigs are also being updated.
Change-Id: I5ebaf6471986deca105971e67fcddb43374de94a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
With this, the UART console has its own initialization which is not
dependent on UART init routines.
This will allow the app to utilize all UARTs for other purposes,
instead of always reserving one for console. Future patch
will enable this choice.
Note that the console init is effectively demoted to pure_init
from pure_early_init. The UART console depends on UART being
initialized, but there is no deferred init at this point.
So this initializes the console a bit later than UARTs,
simply to make sure the UART is initialized before using it.
Once there is a mechanism for some type of deferred initialization,
the UART console init can be promoted back to pure_early.
Change-Id: Iba95197b13384cb1a46e34c78638348b7a0bec8c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This restructures the device structs and now utilizes the new
driver initialization model. This is another step towards
converting the serial driver to the new driver model.
Note that the serial driver does not initialize the hardware
unless it is being used by another driver. The configuration
of the serial port needs to be done by the driver utilizing
the port (e.g. baud rate, interrupt priority, etc.).
Therefore, some serial ports are declared but not exactly
configured.
Also note that the UART console is being initialized at
the same time as the serial port. This will be removed
in future patch, so the UART console driver will do
its own initialization.
Change-Id: Idd89954b2d0649a557ba8c869ee96512fec898e4
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This encapsulates the whole serial drivers Kconfig sections, and
allows the whole section to be deactivated.
Change-Id: I84f8d35da74f3c00a44d8c17786ea2297422d68b
Signed-off-by: Daniel Leung <danielcp@gmail.com>
This moves the static device definition from the driver file,
drivers/bluetooth/uart.c, into the platform config files for
each platform.
This is another step towards converting UART drivers to
the new driver model. Also, platform config files are a more
logical place for the definition.
Change-Id: I668a52de5a38005b8b2bcb67d74437ead377cb16
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
... instead of an array index to a global array. This is
an intermediate step to make the drivers conform to
the new driver model.
This only changes from using a direct array index to using
device structs. The UARTs are still staticlly defined.
Later patches will make the drivers utilize the driver
initialization procedure specified by the driver model.
Change-Id: I18041bbb4b0efdf8ae87088fd000b391d0827e9b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The new names reflect better what the functions do: they find the first
bit set starting from the least or most significant bit, i.e. they find
the least or most significant bit set, in a 32-bit word.
Change-Id: I6f0ee4b543f6f37c2f08f7067e14e039c92a6f6a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Standardize on using the find_[first|last]_set (non-inline) symbols
everywhere.
The non-inline versions provide absolutely no benefits, so they will be
removed in a subsequent commit, and the inline versions will have their
_inline suffix removed.
Change-Id: I5b3dee33ffe3878a05e1bb3c6400a8d8c1640ad4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Use doxygen format for file documentation and move
parameters to be part of the function comments.
Change-Id: I01c0614e7cd3ef4c689d2aec3aa3e52e0d21ffcd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Removes the non-PIC disabling PIC code as the PIC is not a supported interrupt
controller. The PIC disabling code remains as it is needed to prevent the
generation of spurious interrupts from the PIC (see CONFIG_SHUTOFF_PIC).
Change-Id: Ic59aa17ab96f34685a5d7b5f24cab391de47edca
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The PIT is an unsupported device. On x86 based platforms, the LOAPIC_TIMER and
HPET_TIMER are the only supported timers.
Change-Id: Ic890838c811b7eb62008aef0c8a92786f1579217
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes the LOAPIC and IOAPIC macros from board.h as they are no longer
appropriate since Kconfig options exist to use in their stead.
Change-Id: I2ce41a7a08d1859682389f35cd5a97c0e2cd5bf7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Creating the IOAPIC and LOAPIC Kconfig options permits future commits to remove
those settings from the relevant board.h files.
Change-Id: Ie33c703f39c68d6e251d67b1c7cf75a0dd56a7e6
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes the LOAPIC timer macros from board.h as they are no longer required
since appropriate Kconfig options exist to use in their stead.
Change-Id: Id0b509eba7cce1839b400f95b989bf886322e1a8
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Creating the LOAPIC timer Kconfig options permits future commits to remove
those settings from the relevant board.h files.
NOTE: No defconfig files have been modified as the LOAPIC_TIMER configuration
option is not enabled in any of them.
Change-Id: I7d97ed089cd4b734566b698183be95d3a166d71f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Fixes a copy-paste error that inadvertently had the LOAPIC timer being
referred to as the PIT.
Change-Id: I4760d150cd6feb76b7d7384845898c6276bace83
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
For as long as the IOAPIC and LOAPIC code is coupled (as it currently is),
enabling LOAPIC must select IOAPIC to be enabled as well. If future commits
separate the two, then the "select IOAPIC" can be dropped.
Change-Id: Ibe7e6b86e5add19b8b3cc68ebecce760d8914c86
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removes the HPET timer macros from board.h and uses the HPET timer Kconfig
options in their stead.
Change-Id: Ia0b3cd87716277ac25f12deb31d5c5934f355050
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Adds additional Kconfig options to the HPET timer for setting its base address,
IRQ, IRQ priority and condition for triggering an interrupt.
Change-Id: I80349c60237380129da9ef41ccf6850c6b874c3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
All driver Makefiles are adding the same cflags and they
have been done inconsistenly, make all drivers inherit
from the top level Makefile and remove unused includes.
Change-Id: Ie66d0ba7a418ac26f7eb709f50c887dc682e935c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The name of the device is SYSTICK. The device name should be part of the
file name, like all other timer drivers we support. The name
'cortex_m_timer' said nothing about which device the driver is for, since
it's way too generic: it could be for any timer present on any Cortex-M
board.
Change-Id: I39b4f79c32516ec9aff82c55c0ca639fad1b52bb
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The Zephyr kernel must always be built as a monolithic image, not as
separate nanokernel and microkernel images.
Change-Id: I44fdd2349b32f409c84710f58bc4b3fe96fd79b7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
Removes references to obsolete BSP terminology. Where appropriate, replaces it
with platform terminology.
Change-Id: Ifb17f98bc12d3a28198810351629a109abdc18a5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Qemu implements HPET so that it is connected to IRQ 2, which makes
necessary to use it in legacy emulation mode.
Add legacy emulation mode to HPET driver.
Change the way the HPET driver is initialized. QEMU requires that
the mode (one shot or periodic) gets set prior loading comparator
value.
Add debugging mode to HPET driver to ease the next port.
Change-Id: I668325d5968451585519a08b6c41863cf6e37f88
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Disable the PIC upon initialization to prevent it from
generating spurious interrupts.
Change-Id: I08ba1d00e269e1fd1d32960dcb844e9fa1ccc195
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Fixes the SYS_CLOCK_HW_CYCLES_PER_SEC Kconfig option dependencies such that
it can be overridden by a modified platform configuration file. This is
particularly important for the LOAPIC timer driver as
SYS_CLOCK_HW_CYCLES_PER_SEC is dependent upon the target's CPU/bus frequency.
Change-Id: I0fb49b4c540888cb1988c76e2a711a85e756f82c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Updates the timer driver dependencies to simplify the selection of a timer
driver. The timer driver menu only lists those drivers that are compatible
with the previously selected interrupt controller.
Change-Id: I5deea315f7c373c6660bacc411c6374e7b0ae84d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Selection of the IOAPIC requires that the LOAPIC be previously selected.
Change-Id: I13d95d4bb4ff02c1aebb0b5e573cb2b89dbe530b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The LOAPIC_TIMER_FREQ Kconfig option is not used.
Change-Id: I919fd2128f667e0b91467cb542041449738dd992
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Changes the the names of the x86 platforms so that they are more generic.
generic_pc -> ia32
quark -> ia32_pci
NOTE: it is expected that the two platforms will eventually be merged into one.
one. At present, the two platforms support different hardware. For example,
the ia32 supports bluetooth whereas the ia32_pci does not, and the ia32_pci
supports both PCI and HPET whereas the ia32 does not.
Change-Id: I8a980aaef55be8c59f7d19ddeb7fafbf11253408
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Improves code consistency by abstracting the architecture directory in the
set of assembly include paths.
Change-Id: I4b3638419a1242cb0628f128c5e3b82c3357d83c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Change the function signature of _InitHarware() function and rename
the function to a platform specific name now that it will be called
via a function pointer and not by name.
Call the platform *_init() function at PURE_INIT time.
Change-Id: I5168dfea81f406da135d491a2b4a24e8255f418a
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Update microkernel systems to use the new driver initialization model on the
timer driver.
Change-Id: Ida9ef2a395d0dddf4104d490d78b13b11ea3c347
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Update nanokernel systems to use the new driver initialization model on the
timer driver.
Change-Id: I22d8619f56052f094482d73ab34c9d610492d8c0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Prepares the _sys_clock_driver_init() routine to interface with the new driver
model. To this end, it must accept a pointer to a device structure and return
an integer.
Change-Id: I3c600ce1efb49c0864aae7b09663ca40d6289372
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
The revised name conforms to Zephyr OS naming conventions.
Change-Id: I5bcdaf1df7da9d8ce5787a08b29ead91dd8f24ce
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Removing the parameter to timer_driver() as it is not used.
Change-Id: I09275287eeb541be0dd315056b4f2bc6cbc2573c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
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>
Previous comment style used RETRURNS:, use @return to comply
with javadoc style.
Change-Id: Ib1dffd92da1d97d60063ec5309b08049828f6661
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
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>
Use Kconfig to define this variable and remove its
previous definitions from board.h. This will simplify
creation of different variants from a single platform.
Change-Id: I0aaa5aa81dedf096c6d8c1ea2d509c71817336d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Moves the Cortex-M timer driver so that it resides with the other timer
drivers.
Change-Id: I3324c53356efd9f5fd88752a98e4ae301ea38d47
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Adds the Kconfig option for selecting the Cortex-M systick timer. This helps
pave the way for moving the Cortex-M systick timer into the drivers/ directory.
Change-Id: Iee040083a425c9c1dbc5973991b89239e0a72eee
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
Updates references to CONFIG_BSP_DIR to CONFIG_PLATFORM as part of the
BSP -> platform clean up.
Note that despite the renaming, the usage of the config option remains
unchanged.
Change-Id: I2846c3f761cf09871019c0855bf1824ae03e6b3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
We had those options defined per BSP. Moving them
to a more generic place makes more sense. In this case
they are moved under serial drivers.
Change-Id: I8faf31321fc433eaa168bf36f2b590a6b8402f9e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The revised name better reflects the fact that the file defines
macros in addition to declaring variables. In addition, most of
these APIs use the "sys_clock_" prefix, which aligns well with
the new file name.
Change-Id: Ib33517d4b19ec2455303b87200c677e87640fcbc
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
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>
In order to provide the same irq_connect() on all platforms
on x86, irq_connect() now uses a static array of interrupt
stubs. Device driver does not need to provide interrupt stub
to irq_connect() function.
Add NUM_DYNAMIC_STUBS configuration parameter, the number
of interrupt stubs used for dynamic interrupt registration.
Modify tests for unified interrupt register API
Tests that deal with interrupts are modified to work
with the new interrupt registration API.
Add CONFIG_NUM_DYNAMIC_STUBS option to dynamic interrupt projects
Projects that use dynamic interrupt handler registration on x86
have to include CONFIG_NUM_DYNAMIC_STUBS parameter in the
configuration.
Change-Id: Ic90c726485521a57cf695fd3edc8cac85d0b827d
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
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>
This makes it clearer that this is a specialized API not intended for
general app usage (unlike most other things in bluetooth.h).
Change-Id: I0ce1d5903610a9b3a99cf0be9f0e1462b04bf45a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To make it clearer that these helpers are intended only for
Bluetooth-subsystem internal code, move them to a separate file.
Change-Id: Iea64780f5c61c1c96e12c9df378676bc49498fe4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated."
Change-Id: Iec6121b6b79a6a8c58ac26b8b08a542eac575c22
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Since the system generator pre-registers K_ticker as the handler
for the system tick event, there is no need for the timer driver
to re-register it at run time.
Change-Id: I7f20c19e5c6ccc7dfb6117aa2d2647b9dec0e549
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
The BLUETOOTH_DEBUG_UART config option should depend on BLUETOOTH_UART
and also be sorted after it in the hierarchy.
Change-Id: I3e049e52c2e353cd0c6f1a99ca8934a289e0cce8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Buffers returned by bt_uart_evt_recv() and bt_uart_acl_recv() may be
NULL in theory. This makes code consistent by checking return value.
Change-Id: Id39def39c8b1c4c6eefc7b2bf01702c54b3e565c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
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>
Eliminates references to the obsolete OS name. In most cases the
name is simply removed, as it isn't necessary.
Change-Id: I32f9e7390e436aec008a9454b72657e129d65152
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
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>
Gets rid of single-line comments required by a previous set of
coding conventions. These comments provide no value to readers
and just clutter things up.
Change-Id: I2a08b12cf5026253de56979efdfc510e7e68defe
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Closing comments to two CONFIG_MICROKERNEL ifdef blocks incorrectly identified
the ifdef block as NOT belonging to the microkernel.
Change-Id: Iee415e33d7f8a88c41009c5783b37da3a431461b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated." However, using make EXTRA_CFLAGS="-DSOMETHING" results in
EXTRA_CFLAGS from Makefiles being overwritten, obviously breaking the
build. This patch converts to them to the newer ccflags-y which also
fixes the problem.
Change-Id: I6309439599d4c9cc184f9ecd941bde841982ef07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The atomic APIs are not really tied to nanokernel-specific
capabilities, and can be used by anyone at anytime -- even
during system initialization!
Change-Id: I427954029b4b465127cb5b4b642c2f9968c17d5a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Since the kernel now provides a minimal string library, there is
no longer any reason not to use the standard memset() and memcpy()
APIs.
Change-Id: Iad587ace6f41fd94c9c961d13d9322495a7da1be
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Renaming the directory include/nanokernel to be include/arch, which
better reflects the real nature of the directory and the contents
inside.
Change-Id: I2bc33ebc6715e2f0403227a558279fdf52398ade
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Renaming the CONFIGRUE_UART_PORT macro to UART_PORT_CONFIGURE.
Done to better align with the current naming process, but also to
remove some possible confusion over the macros source now that
the tree has moved over to Kconfig/Kbuild options.
Change-Id: I1a7691d09818c3d529de346e7fa347ce5ac19aed
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
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>
The timer based pseudo random number generator returns the
number of system clock ticks. If the random number function is
called subsequently in a time less than a system clock tick, it
leads to getting same number.
To prevent this the counter is introduced. Counter gets changed
each call, so it ensures the caller gets different numbers each time
the random number function gets called.
Change-Id: Ibe57e1e7a23909b185623af8dbb7e80647c7ee08
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Remove ARM specific driver that duplicates the platform
independent one.
Rename x86 specific driver to make it unique.
Added configuration options for random and non-random
number generators.
Change-Id: Ie1b277d2927cdfe877650ae09134db7c86becb76
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
UART on Quark platfor, according to Quark BSP Programmer's
Reference Manual, is located in the following order on PCI bus:
COM2 BAR0: 16550 registers
BAR1: DMA registers
COM1 BAR0: 16550 registers
BAR1: DMA registers
So, the driver on Quark platform has to specify BAR (Base
Address Registers) number, the pci_bus_scan() function looks for.
As long as UART is a concole device, calling pci_show() during
it's initialization does not make any output.
Change-Id: I2261fbcc8f9e3ebc22d5307fdcbb18cb649c1224
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
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>
This commit removes the UART_INTERRUPT_DRIVEN kconfig symbol from
the console section.
The symbols is already covered as a serial driver symbol and it
is a serial feature releated configuration option.
Change-Id: I4b9438d79eb7850b1293d5d963a75ce00733dbf7
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit standardize the Kconfig inclusion.
Selective sourcing of Kconfig files create conflict when merging
different configuration files (.config files).
Instead, now each kconfig symbols is dependant of its specific
DRV_* driver ksymbol.
Change-Id: I3d20d108a83f00d34067dc334758fd57e51feecf
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit add license headers to Kconfig files.
Change-Id: I79e60263b8c7b696463ecc84b8ad411af5415117
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit organizes the bluetooth Ksymbols in:
- Driver symbols at drivers/bluetooth/Kconfig
- Stack symbols at net/bluetooth/Kconfig
Change-Id: I8ebadeb8ac7f8a769d7620e4e44077a05915dc86
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit adds the Makefile and Kconfig files
to support the bluetooth driver in the Kbuild system.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I1f72b13aca8fb098eece04c4f0e1b680639b520f
This commit changes the dependency schemme for DRV_RANDOM.
This fix an issue that prevented the merge of this symbol
as a config overlay.
Change-Id: I734a5814af90b9c57355b78cc43f96f05c1afa96
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit fixes an issue with the inclusion path for the
board.h file for the pentium BSP.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I28172f8071b907aa61660ec8b8009e83cb2aa5ea
This commit adaptes the Kbuild system to the change of location of
the header files for drivers.
Old location: driver/
New location: include/driver/
Change-Id: Ic49d373149ee44d781419c5c68e59408c8ef1c11
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit fixes issues to allow build on ARM architecture.
- It fixes the include paths in Makefiles.
- It fixes the include path for the offsets.c compilation.
- It fixes the linker command. This changes is needed because gcc
ARM cross-compiler does not accept an AT() command without
specifing an address explicitly. This corner case appears
on ARM architectures when XIP is disabled.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ief8b53c4cc154abba7b7827121ec5a56f62b7b26
This commit fixes the include path for quark BSP.
Change-Id: Idb9b5124476c0bec2d16a143407cd9d0c42e0801
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
This commit adds the Makefiles that describe the object-bundles
for the drivers directory and every subdirectory below.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Id77cff9cf0ab51827acc2aef32cbed3ec3ad586b
This commit adds the Kconfig files that describe the CONFIG
symbols that belongs to the drivers directory and subdirectories.
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I924835ece11a3d597e77a55ace21d724dd5ddbe5
Now that UART drivers are configured internally when it comes to
hardware specific information such as IRQ and registers (or mmaped
registers), bluetooth UART driver no longer needs to do it by itself. It
only requires to select the port it wants to use.
Change-Id: I5a30500f4b6f4155292609d0ed4a758f91930817
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
UART is configured statically into the driver directly and not anymore
in the board's system.c. Thus limiting the information to be scattered
into 2 files instead of 3. Then in future, it will also be possible to
remove driver specific informations from the generic UART API structure.
Change-Id: I001f2a6834df9a41ab395a80e4e39b347d545db3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now for x86 platforms, UART is configured statically or dynamically into
the driver and not anymore in the board's system.c. Thus limiting the
information to be scattered into 2 files instead of 3. Then in future,
it will also be possible to remove driver specific informations from the
generic UART API structure.
Change-Id: I7b7fa37f10f88316a4d375c99de3bbacf152a3e3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Remove camel case style on baseAddr, changing it into base.
Change-Id: Iea1e2d204a38912f4157cc6776a88640e29a04f6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Using "which" is somehow awkward to use when 'port', on the contrary, is
blatantly more readable.
Change-Id: I355c6e09d7c27b4b07ab6cd10b772a632855516b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Using "which" is somehow awkward to use when 'port', on the contrary, is
blatantly more readable.
Change-Id: Id4d3786a192a650ca042024521b94e557a3ec7e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
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>
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>
Replace duplicate code and will allow for further cleanup by possibly
consolidating micro/nano code that is currently guarded by preprocessor
conditionals.
Change-Id: I9aa9966c581244646b6ea317ef8b51fef9054dd4
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
The correct call is nano_isr_lifo_put, but they are aliases of each
other, so that never caused an issue at runtime.
Change-Id: Ibec8e6d3377133e5e67589c5a3ad1b8fb3cc652c
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
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>
The coding guidelines make an exception to the Linux kernel style
where all branches, even one-liners, should use braces.
Change-Id: I368930af3033eac15f0152a6671909e401d332e6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ifadb978e31770eb9f4987a3205483aad9a525b86
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ib426dad55e318bb8176c4e7660711db1484cc245
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I6098649b507dae09d4d0f19e712bc0fe3686dfc0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ie0770bd9ff872a9ed2b567baca1514d15fe6c90a
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Iee0936e2c92f2979b7e38f33a950108bdaf6f2c1
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I1f95ae3c2fd44ae3bd366cd33208551cf5ea6d10
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I5681dc0c33cc42ee48270eab418c99cc923f96b1
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Id7391e40bb709f03c58f552d6b783cad834bbdcc
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I28cbf0d02600d31548393870e712e6da062048da
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Ic28658f68d473b3a163fe5d97f611bfd572f140e
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
The prefix underscore is removed due to it's a local variable.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I31e267c1479dfaeeb0fba8c6ba0da45a3c011c0f
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating local variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I80ccb884f1ffd8f3740cd9298787462485b08024
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
In order to have a better compiler support consolidate
inline assembler code in a set of header files.
If another compiler is used, that supports a different
inline assembler format, asm_inline_<compiler name>.h
heder files have to be provided.
Change-Id: Iecc7d96419efd767a8463933badd4db4a557de5b
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
Configuration option BLUETOOTH_DEBUG_UART enables debug support for
Bluetooth UART driver.
Change-Id: I192f380be492df1a52ad212239447b6ee4b50aac
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
When the 'len' and 'min' parameters passed to bt_uart_read() are equal
the function is guaranteed to always return 'len' (it will keep
looping until that). This patch removes bt_uart_read() error checks
which would never occur in practice.
Change-Id: Icd879f1e15c6d33acc549155aabd24490098ffc5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There are some places where it's forgivable if bt_uart_read() wasn't
able to read as many bytes as requested. In other places it's not
acceptable (e.g. when reading ACL or event header). To avoid failing
in situations where we can handle receiving less data than requested
this patch adds a new parameter to bt_uart_read() to specify the
minimum required data amount.
Change-Id: I372e3af7aaa6bfabe14896eb10cc71c3deff94f2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If we're out of buffers the UART driver would previously loose sync of
where the packet boundaries go, because it was using the buffer itself
to store and parse the HCI packet headers. This patch modifies the
UART driver to use stack variable for initial header parsing, thereby
being able to always determine how many remaining bytes there are and
cleanly discard the bytes until the beginning of the next packet.
Change-Id: I278f3fc0c983e6a2a6904356ef1af1d25c9f06e4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If we get an invalid packet type here the buf pointer will be NULL.
Going to the cleanup section at the end of the function would trigger
a bt_but_put() call which would cause a NULL pointer access. Directly
returning from the function is the right thing to do instead.
Change-Id: I0c18646e0820cf829ef8aa3f77835ba0a14375b5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We may soon want to have a _wait() variant of bt_buf_get, so to avoid
the number of 'get' function growing too large consolidate the
existing get() and get_reserve() functions into a single one. The new
consolidated function also takes the type as input parameter so that
we know this from the very start and thereby plan for the split into
multiple buffer pools.
Change-Id: Ia09448565349def2be9bc08d9510fedd029480b4
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We'll soon want to have dedicated pools for outgoing and incoming ACL
data. To know from which pool to get and put the buffers each buffer
should contain enough information to distinguish the two types. This
patch splits the old BT_ACL type into two new BT_ACL_IN & BT_ACL_OUT
types.
Change-Id: I7d3c05c26d2a70f80fb1229e245aa21673ec378b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
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>
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>
Rename camelCase uartConsoleInit function for consistency with the
rest of the code in serial console.
Change-Id: I519737070538e9c0f52a8d110a3eff68e0185ce2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Following comments received during review rename console_uart_isr to
uart_console_isr for consistency reason.
Change-Id: Ibee1dec40ee19a9095f78969a07ffb73518fffbb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This patch adds a simple HCI UART (H4) driver that currently maps to
the second UART in the system. The main intention is to use this
together with qemu for accessing the Bluetooth controller available on
the host OS side.
The H4 HCI transport protocol is perhaps the simplest of the standard
HCI transports. It consists of a single byte in the beginning of each
packet which indicates the type of the packet: HCI event, HCI command,
ACL data, or SCO data (which we don't use at the moment).
Change-Id: I225a2a2361fbd7cd4ba82ea1f81ddc1271e9e7c2
Co-authored-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I4e5c9419fe0ccbc4b2990b96fc95c697decc18e0
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I5e249e34ee9666666e31db6b9f71fe2abcc22400
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: I2e501394b7fa4264d9854659e2dd008e5c94b540
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Updating global variable's name to follow a consistent naming convention.
Change accomplished with the following script:
#!/bin/bash
echo "Searching for ${1} to replace with ${2}"
find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" \) \
! -path "./host/src/genIdt/*" \
! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g';
Change-Id: Iebefec0e02cbb838564dd71fd4424c1adbff31f5
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
Rename UART_HOSTDRV_INTERRUPT_DRIVEN option to
UART_INTERRUPT_DRIVEN removing old definition.
Change-Id: Id48288db42e97a1ecbd809e259f33359d5a7c9d7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Serial console handler when registered allows to interact with serial
line. It can either execute callback from ISR or defer execution to
fiber or task. This will be used in Bluetooth development for tests and
simple interaction with Bluetooth stack.
Change-Id: Ia960b456a75062d614baea324608058d979aa11b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Adding a line after variable declaration in order to comply with
the defined coding style.
Change-Id: Id41af88404bd37227bfd59a2d71ce08d0d6ce005
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>