Commit graph

99014 commits

Author SHA1 Message Date
Andre Guedes
aa47bd8d6c newlib: Rename exit to _exit
This patch renames the 'exit' function from newlib/libc-hooks.c to
'_exit' since this is the correct name of the newlib system call.

This patch fixes some linking errors that occur when an applications
uses abort() or assert().

Change-Id: I593e5ec5dc0f84dbbebe4aceb38703256e140914
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-05 20:25:16 -05:00
Andrew Boie
89ec552be9 x86: iamcu: fix exception NANO_ESF parameter
On SysV ABI, the NANO_ESF parameter is passed in via the stack.
For IAMCU, this is instead expected to be in EAX.

_ExcEnter is currently using EAX to stash the return address of
the calling stub while it does a stack switch. Change it to use ECX
for this purpose, and if we are running with IAMCU place the
parameter in EAX instead of pushing it.

The output of the fault handler has been cleaned up a bit and it
now also includes the code segment.

Change-Id: I466e3990a26a1a82dd486f3d8af5395eab60b049
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif
06058ce4bc samples: grove_lcd/fram: unify config files, since they are the same
Remove architecture config files and have just one, they are the same
now.

Change-Id: I6d719d5409569ae8e741fce20e90e16efa701385
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif
6615f9c89b samples: I2C device is auto-selected by SoC Kconfig
Change-Id: Id5522a9b14dddaf8997b42c675e29f7cc1727442
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif
2c74c45be0 quark_d2000: toggle I2C0 when I2C is enabled
Change-Id: I79340a22932cf73b504b8fac8dd65dccb6c10009
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif
3280b700d7 quark_se_ss: toggle I2C0 when I2C is enabled
Change-Id: I3e8ff764dd51a1eb59a864b9ce58047977ebd68e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif
57e444ffa8 i2c: use a common name from i2c devices
Instead of relying on the Kconfig variables use a common scheme for
naming i2c devices and use it directly in application.

Change-Id: I745af68d7c1767cc8a24f9655fa45fa33f6baf93
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Ido Yariv
a8c48ea7b7 Workaround QEMU's multiboot loading issue
When QEMU loads a multiboot image based on the ELF headers, it
calculates the total memory size subtracting the minimum address from
the maximum address in the program header.

While the IDT section is removed from the ELF, an empty segment in the
program header is still kept at IDT_LIST base address. Since the IDT
segment isn't contiguous with the loadable code segment, QEMU is tricked
into thinking the total memory size is larger than it really is.

To workaround this, change the address of the IDT section to the address
of the text section. This will make objcopy remove the extra segment
entirely when the IDT section is removed.

This could have been fixed in QEMU since this isn't a bug in Zephyr
per-se, but it will be easier to avoid specific QEMU versions
requirements.

Change-Id: I062b7d0fb8fccfe4d0d0b4cb0afc4667bbb7f7dd
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
2016-02-05 20:25:16 -05:00
Andrew Boie
7cb5276158 x86: remove NANO_SOFT_IRQ from zephyr
This was never implemented on ARC/ARM and has been superseded
by irq_offload().

Some checks that were only done with CONFIG_LOAPIC_DEBUG fall
under the category of 'shouldn't ever happen' and have been
converted into assertions, instead of propagating return values
which are largely never checked.

Change-Id: I4eedca05bb7b384c4f3aa41a4f037f221f4a9cfe
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:16 -05:00
Andre Guedes
7b0076a777 rtc: Introduce QMSI RTC device driver
This patch introduces the 'QMSI RTC device driver' which is simply a shim
driver based on RTC driver provided by QMSI BSP.

Some config options are independent of the driver implementation used,
so use a consistent name for them. In this case RTC Interrupt number and
Priority use the same config options for both the QMSI and DesignWare
drivers.

In order to enable this driver, the following options should be set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="/path/to/libqmsi/directory"
CONFIG_RTC=y
CONFIG_RTC_QMSI=y

Change-Id: I48292406e5472e5786f3b9abbeb71016a273bfec
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
db2d48b66f arc: add atomic operations for ARC EM family processors
The ARC EM family processors do not support native atomic assembly
instructions (LLOCK and SCOND). Therefore, the assembly version
of atomic functions cannot be used. This adds pure C version of
these atomic functions.

Change-Id: Ic64dd31b0367b6dcf3a46f41c0c7ac2c2ce5eb8d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Anas Nashif
f08e73dcf8 kconfig: Add missing board definition
Change-Id: Ia037e338f312578deb468ecc1298839aedd2cc28
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Ido Yariv
ae08f73f72 samples: fix compilation error of nfc_hello
uart.h may include pci/pci.h, so add drivers/ to the include search
path.

Change-Id: Ic48a88c97c45e805ee7aec1df884cdb60d6fa33a
Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
2016-02-05 20:25:16 -05:00
Dan Kalowsky
ea6f5e09bd quark_se : quark_d2000 : shrink pinmux code size
Ben Walsh identified a few functions can be removed as they provide
duplicate code except for one small variant (register number).  Making
a common function that takes the register position as an input, it is
possible to remove an entire function, saving on code space.

Change-Id: I1850f461ed6d85f42aaf85745e1c2557850cdbad
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:25:16 -05:00
Andre Guedes
5c2dfcd53a watchdog: Introduce QMSI watchdog driver
This patch introduces the QMSI watchdog driver which is simply a shim
driver based on watchdog driver provided by QMSI BSP. This driver has
been tested with the latest version of QMSI BSP (1.0.0).

In order to enable this driver, the following options should be set:
CONFIG_QMSI_DRIVERS=y
CONFIG_QMSI_INSTALL_PATH="/path/to/libqmsi/directory"
CONFIG_WATCHDOG=y
CONFIG_WDT_QMSI=y

Change-Id: Id910fa7f8a0559bcd4746747d8ce4588a0c48589
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
00b0e06b92 samples/grove_lcd: build for x86 too
This adds the config file for x86 based platforms.
Also, it no longer clears the screen at each counter update,
as the app is writing the same amount of characters anyway.
This gets rid of the screen flickering.

Change-Id: I1db6dd4b7978b764b7538e120354fc5d010df283
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
7b4167ed78 i2c/i2c_dw: bail out if tx is aborted during send
This enables the driver to process the transmit abort signal
during send.

Change-Id: I3ad1f25669bee214b5e1a04cd858ccb4a8442333
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
0ac7a5b162 i2c/i2c_quark_se_ss: properly process abort during send
This actually makes the code to bail out when transmit is aborted
during send operation.

Change-Id: I3dda7ec4a6e15d1483738bb90d63d674a994903d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
7a5fefbcd8 i2c/i2c_quark_se_ss: extends to do multi-byte read requests
This changes to request bytes that will fill the RX FIFO
instead of requesting byte one-by-one.

Change-Id: I87c6577dc5fcc476284cd3ed0039a178a5221d24
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
61ea58b6cf i2c/i2c_dw: extends to do multi-byte read requests
This changes to request bytes that will fill the RX FIFO
instead of requesting byte one-by-one.

Change-Id: I30696c624c9f828818f6df9f1ee744a5bc515f27
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
9b8acb7b26 samples/i2c_fujitsu_fram: do some multi-bytes read/write
This extends the i2c_fujitsu_fram sample app to do multi-bytes.

Change-Id: I20ea0e08c340cf94158ad521c27d5315e522b6de
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Daniel Leung
f794b80ac5 samples/i2c_fujits_fram: build for x86 too
This adds the config file to build for x86-based platforms.

Change-Id: I42c32966507ba822726834a200edd079c90cc96b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:16 -05:00
Andrew Boie
2a8843a262 timers: don't build if there is no system clock in use
Change-Id: Ic1463d632562383c3fa0b0b1666a52a0d9a5c4de
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:16 -05:00
Andrew Boie
2295e2abf7 uart: remove uart_irq_get()
This API is not being used for anything, the interrupts for UART
drivers are all being configured statically. Saves code space as
gc-sections can't tell that these APIs are unused.

Some instances where IRQ/priority information was being saved in
data structures and never used fixed.

Change-Id: If56b4fdc251b80be9094ffcbac6f61e265ac2ffd
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:16 -05:00
Andrew Boie
59a6d3870d x86: fix description for CONFIG_NUM_DYNAMIC_EXC_NOERR_STUBS
Change-Id: I7a73aa261297ed986790973fe65e4e82e5576416
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:15 -05:00
Andrew Boie
4733187f1b x86: put the IDT in ROM if possible
If we are not doing any dynamic interrupts or exceptions, we
can put the IDT in ROM and save a considerable amount of RAM,
up to 2K if the IDT is the default size of 256 entries.

The _interrupt_vectors_allocated table can also be put in ROM
if we're not using any dynamic interrupts.

We introduce a new Kconfig option to force the IDT to be in RAM
for situations where no dynamic IRQs are used, but ROM footprint
needs to be conserved.

Change-Id: I38c9f1a8837b4db9f3dea1caa008374a26cbbf1d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:15 -05:00
Andrew Boie
cb5022fdba ipm_quark_se: lock irqs while waiting for status bit to clear
Change-Id: Ieb0ac7a32a91826dca39ddb6bec80081c7d2c888
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
06e78de681 build: do not use link-zephyr
Use makefile targets to build and link final binary. This removes
dependency on a shell script which is not portable and imporves
dependency tracking when building.

Change-Id: Ib75f162cdb1dde35ccaf980658bfe70daaf581b6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
204b66d150 build: reused declared LDFLAGS
Change-Id: Ia421fc3e796a889f3083b00ddcb058ccefb35291
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
ace0e227c7 remove unused variables and defines
Many variables being declared in the Makefiles are Linux specific
and never used by Zephyr.
This is an attempt to cleanup the Makefiles and just keep the code
we use.

Change-Id: Ib97d3d7e3a55077d6f9ec2b4170b3763424a1c99
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
cc2801c08d remove stray core-y redifinition
Adding emptiness into core-y does not add any value.

Change-Id: I695f9a8682eb35bcdb80eff9716338f88d84ab09
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
ce5dc6a3b7 build: remove unused init-y handling
This is not used in Zephyr

Change-Id: I27507fc72686d2a54d4565cd36414bd7ffbd0399
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
3bdae61cac build: remove unused linux related code
- Modules are not a feature of the Zephyr kernel.
- genksyms removed, not used by zephyr
- bin2c remove, not used in zephyr

Change-Id: Ic8f0e786530dcf410b07d6c5cc47f1087000d528
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
3315b1f89b KLIBC_DIR and LDLIBS_TOOLCHAIN are obsolete
This variables are not being used in the code any more.

Change-Id: I3d4b513ed61d98020f27e5968835090946fe0c8b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
afffff3a32 kconfig: ram size/start are set in platform Kconfig
The values are set in the board or SoC.

Change-Id: I03b358ba1e82c39a1f65ce80a3fb9c181b671109
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
d50b6a7f5c ia32_pci: remove obsolete soc/platform
Change-Id: I7a6a7ef2339061630d7c6dd693b1c03a95573352
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
32c48d1b2d arc: remove obsolete generic_arc
Change-Id: Ifa1506cd5c8ff6876a8b945507c7d6caf2f3bbc2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Anas Nashif
030c004fd3 enable iamcu on relevant platforms
This enables building with the iamcu variant of the x86 compiler
and enabled using the IAMCU ABIs.

Change-Id: Idf71251898e250b8df73c065462c93c289879fe2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Daniel Leung
32829a9a9b i2c/i2c_dw: tiny improvement to execution flow
() Rolls the transfer initialization function into the setup function,
   as it is logical to have just one function (not to mention there
   was duplicate code).
() The setup function returns early if there is any error.

Change-Id: Ie9d3057f2963a0ba5b74ac66e058ff4fee31f099
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:15 -05:00
Daniel Leung
dff5f6a038 i2c: make i2c_transfer() really generic
Make the i2c_transfer() to transact messages through the I2C bus.

It is useful for I2C storage devices, as now we can send one message
containing the destination byte/block address, then send the data
in another message. There is no need to construct one continuous
data buffer to send both address and data anymore.

The drivers and sample apps have been updated to utilize updated
API when appropriate. For i2c_dw, only master mode has been updated.
Slave mode will be updated once we can adequately test it.

Change-Id: I0a811d60567367817fcc8d15f5454e5c933722e2
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:15 -05:00
Daniel Leung
ee150853de i2c/i2c_dw: remove unused slave_mode field
It is not being used so remove it.

Change-Id: Ib933cf3cbd62e1f54a4dd0ee7bcba6970e2a29f1
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:15 -05:00
Daniel Leung
0e423317e2 i2c/i2c_quark_se_ss: fix build issue with debugging
Fixes a build issue when CONFIG_I2C_DEBUG is turned on.

Change-Id: I8df72e41d0809f99c9c3855cbfcbc5abc60cbca1
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:15 -05:00
Daniel Leung
05ba788070 quark_d2000_crb: make I2C controller work
There are a few bits missing on enabling I2C controller on
quark_d2000_crb. This adds the missing bits.

Change-Id: I05bbe8367a9e69962db573d496f1f9f0167ba597
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:25:15 -05:00
Andre Guedes
635351bcdd drivers: Add infrastructure for QMSI drivers
This patch introduces the infrastructure required to enable QMSI drivers.
QMSI drivers are shim drivers based on drivers provided by QMSI BSP. The
BSP provides a static library (libqmsi) which implements several drivers
for peripherals from Intel MCUs.

Next patch will introduce the first QMSI driver (watchdog driver) which
will rely on the infrastructure introduced by this patch.

Change-Id: Ic7da5d0249af0629eef8c91d124a153f84d4a76e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:15 -05:00
Fabien Chereau
49abcb3fff device: add a new macro to obtain the device object symbol name
The new SYS_GET_DEVICE_NAME macro can be used in combination with
SYS_GET_DEVICE to obtain an external reference to a static device
object, e.g.:

extern struct device SYS_GET_DEVICE_NAME(my_device_name);
struct device* dev = SYS_GET_DEVICE(my_device_name);

dev is here set at compile time.

Change-Id: I9094925c685177f01e0cef194ec382ad49658f9d
Signed-off-by: Fabien Chereau <fabien.chereau@intel.com>
2016-02-05 20:25:15 -05:00
Vinicius Costa Gomes
45dcfe1478 rtc: Fix naming of RTC symbols
These symbols have the same name as the symbols from lib QMSI, which
causes a compilation failure, when lib QMSI is used.

This replaces the offending symbols with names which are more consistent
with the rest of the file (rtc_ prefix).

Change-Id: I288a1a229bf0b40f3b6fc8ffb35c502f998054b8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-02-05 20:25:15 -05:00
Andre Guedes
1622e4f4b5 kbuild: Move CONFIG_STACK_CANARIES check
This patch moves the CONFIG_STACK_CANARIES check from architecture's
Makefile to the root Makefile since this option is kernel-related,
not architecture-related. This way we avoid replicating the same
CONFIG_STACK_CANARIES check in several Makefiles.

This patch also removes some blank lines from the Makefiles it touches.

Change-Id: I458f92fa6799526c608369d1e56579936bcb196e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
2016-02-05 20:25:15 -05:00
Rodrigo Caballero
772c85bed4 doc: Change README to reflect new API documentation.
Changed the README.rst to reflect the updates done on the API
documentation.

Change-Id: I591ddb7e618afedf9fd77eb322255aa1ee94c5a0
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:25:15 -05:00
Tomasz Bursztyka
403b26f665 quark-se: Add the development board support
It's basically the same pinmuxer as in CTB with different external
sensors wired to it.

Change-Id: Icea89a72b805d6dd2c5798c3f517c4fb00c819c9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:25:15 -05:00
Peter Mitsis
d63a4f7bf7 nano_timers: Simplify nano_xxx_timer_test() API family
Simplifies the nanokernel timer API so that the timeout parameter must be
specified when invoking nano_isr_timer_test(), nano_fiber_timer_test(),
nano_task_timer_test() and nano_timer_test().

This obsoletes the following APIs:
	nano_fiber_timer_wait()
	nano_task_timer_wait()
	nano_timer_wait()

Note that even the though the new API requires that the timeout parameter
be specified, there are currentl only two acceptable values:
	TICKS_NONE and TICKS_UNLIMITED

Theoretically, the current implementation would allow one to supply a
finite positive value for the timeout and the system would wait up to
that many ticks for the timer to expire. However, it is thought that
that unnecessarily complicates the nanokernel timer model and so it is
left as an unsupported option.  Should that change, then that feature
could be enabled by updating the documentation.

Change-Id: I8835c5342ab5025d6f70fdfbed54a50add7568d7
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:15 -05:00