Commit graph

417 commits

Author SHA1 Message Date
Daniel Leung b7eb04b300 x86: consolidate x86_64 architecture, SoC and boards
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.

() Removes the x86_64:x32 architecture and SoC, and replaces
   them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
   qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-25 17:57:55 -04:00
Andrew Boie a41c0d2bf9 qemu_x86_long: enable early console
Useful for debugging.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-10-15 09:00:49 -07:00
Charles E. Youse 3eb1a8b59a arch/x86: (Intel64) implement SMP support
Add duplicate per-CPU data structures (x86_cpuboot, tss, stacks, etc.)
for up to 4 total CPUs, add code in locore and z_arch_start_cpu().

The test board, qemu_x86_long, now defaults to 2 CPUs.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-07 19:46:55 -04:00
Charles E. Youse 8d97750eef arch/x86: (Intel64) add z_arch_curr_cpu() to enable CONFIG_SMP=y
And set qemu_x86_long board to build with CONFIG_SMP=y by default.
Apparently two benchmark tests - latency_measure and sys_kernel -
do not work with the SMP scheduler, so those tests are disabled.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-07 19:46:55 -04:00
Charles E. Youse 200056df2f arch/x86: rename CONFIG_X86_MULTIBOOT and related to CONFIG_MULTIBOOT
Simple naming change, since MULTIBOOT is clear enough by itself and
"namespacing" it to X86 is unnecessary and/or inappropriate.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse 1ffab8a5f2 arch/x86: rudimentary ACPI support
Implement a simple ACPI parser with enough functionality to
enumerate CPU cores and determine their local APIC IDs.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Kamil Piszczek a320010e4a boards: x86: qemu_x86: adding nvs capability
Added the NVS capability to the QEMU x86 board description.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-09-27 10:06:40 -07:00
Charles E. Youse e2a0eb0d1c boards/qemu_x86: remove stale flash reference from qemu_x86_long
The QEMU x86 .dts files were re-arranged before long mode was
merged. We don't need this reference to the flash region anymore.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-23 17:50:09 -07:00
Charles E. Youse 34120b9ee5 boards/x86/gpmrb: disable Multiboot header generation
We don't require this to boot with SBL, so disable for now.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-21 16:43:26 -07:00
Charles E. Youse 3bc79fdf2c arch/x86: refactor APIC timer configuration to SoC level
The APIC is part of the SoC, not the board, so move the defaults down.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-21 16:43:26 -07:00
Charles E. Youse af8df4f764 boards/x86/qemu_x86: remove stale reference to HPET_TIMER_IRQ
This config option is no longer present since HPET moved to DT.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-18 00:29:18 +08:00
Charles E. Youse 3038209695 drivers/timer/hpet.c: migrate to devicetree
This driver was still using CONFIG_* values to determine its address,
IRQ, etc. Add a binding for an "intel,hpet" device and migrate this
driver to devicetree.

Fixes: #18657

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-17 22:37:09 +08:00
Charles E. Youse 640c5a5e95 boards/x86: add Intel64 (64-bit long-mode) QEMU target board
Add qemu_x86_long board (with CONFIG_X86_LONGMODE=y) for testing.

This requires adding support to soc/ia32 for long mode (trivial),
and adding a quick 64- to 32-bit ELF conversion before invoking
QEMU, which apparently doesn't like 64-bit kernel files.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-15 11:33:47 +08:00
Erwan Gouriou e5380258b6 dts/Kconfig: Remove unused HAS_DTS_ETHERNET
Symbol not used clean it up.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-09-12 08:16:42 -05:00
Charles E. Youse ee525c2597 arch/x86: inline x2APIC EOI
From the Jailhouse days, this has been a function call. That's silly.
We now inline the EOI in the ISR when in x2APIC mode. Also clean up
z_irq_controller_eoi(), so it now uses the inline macros.

Also, we now enable x2APIC on up_squared by default.

Fixes: #17133

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-12 09:53:45 +08:00
Andrew Boie 9df9994572 x86: fix XIP SOC support and defaults
XIP support in x86 was something of a mess. This
patch does the following:

- Generic ia32 SOC no longer defines a "flash" region
  as generic X86 devices don't have a microcontroller-
  like concept of flash. The same has been done for apollo_lake.
- Generic ia32 and apollo_lake SOCs starts memory at 1MB.
- Generic ia32 SOC may optionally have CONFIG_XIP enabled.
  The board definition must provide a flash region definition
  that gets exposed as DT_PHYS_LOAD_ADDR.
- Fixed definitions for RAM/ROM source addresses in ia32's
  linker.ld when XIP is turned off.
- Support for enabling XIP on apollo_lake SOC removed, there's
  no use-case.
- acrn and gpmrb boards have flash and XIP related definitions
  removed.
- qemu_x86 has a fake flash region added, immediately after system
  RAM, for use when XIP is enabled. This used to be in the ia32 SOC.
  However, the default for qemu_x86 is to now have XIP disabled.
- Fixed tests/kernel/xip to run by default on boards that enable
  XIP by default, plus an additional test to exercise XIP on
  qemu_x86 (which supports it but has XIP switched off by default)

The overall effect of this patch is to:

- Remove XIP configuration for SOC/boards where it does not make
  any sense to have it
- Support testing XIP on qemu_x86 via tests/kernel/xip, but leave
  it off by default for other tests, to ensure it doesn't bit-rot
  and that the system works in both scenarios.
- XIP remains an available feature for boards that need it.

Fixes: #18956

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-09-11 21:11:38 -04:00
Kamil Piszczek 16d45a8a14 boards: qemu_x86: adding missing flash definitions
Added missing flash definitions.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-09-08 12:35:15 +02:00
Charles E. Youse 6767563f94 arch/x86: remove support for IAMCU ABI
This ABI is no longer required by any targets and is deprecated.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-07 10:07:42 -04:00
Charles E. Youse c02288b245 docs: fix errors/ambiguities in docs for Apollo Lake boards
The documentation for the GPMRB incorrectly made reference to the
up_squared board in its high-speed UART configuration section. We
consolidate the related documentation for all boards based on the
Apollo Lake SoC and adjust the language to be more generic.

Fixes: #18808

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-04 10:02:25 +02:00
David B. Kinder 60136f00cb doc: add how to exit from QEMU in samples
While trying out the hello_world sample built for QEMU, I was expecting
the sample app to exit and I'd return to a command prompt.  Nope.  You
need to exit QEMU manually, so add that step to the sample instructions.
Looking around, there are more uses of QEMU like this that could use
this added step after running the sample app.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-02 12:06:08 -04:00
Carles Cufi afcbc9992c doc: Use west everywhere to build and flash
Instead of having a mix of west and CMake/ninja instructions for
building and flashing, document it using only west. This will help
clarify that west is the default build tool in Zephyr and should also
reduce confusion over what tool to use.
Note that the biggest change is changing the default in
doc/extensions/zephyr/application.py for :tool:, from all to west.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-27 19:36:24 +02:00
Andrew Boie ce3cc4f974 x86: ia32: do not use the first megabyte
After witnessing some strange errors with memory not being
what it should be, lifiting everything above 1MB has solved
it. The Zephyr binary was being loaded into memory containing
reserved regions, resulting in data corruption.

We still simulate XIP for testing purposes by setting up the
memory map as follows:

0x000000 - 0x0FFFFF : Non-present
0x100000 - 0x4FFFFF : "Flash" ROM region
0x500000 - 0x8FFFFF : "SRAM" RAM region

For a total of 9 megabytes of physical RAM used.

Fixes problems observed in some large tests when code coverage
is enabled (which increases the amount of RAM used even more).

Fixes: #17782

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-07 12:50:53 -07:00
Andrew Boie c3b3aafaec x86: generate page tables at runtime
Removes very complex boot-time generation of page tables
with a much simpler runtime generation of them at bootup.

For those x86 boards that enable the MMU in the defconfig,
set the number of page pool pages appropriately.

The MMU_RUNTIME_* flags have been removed. They were an
artifact of the old page table generation and did not
correspond to any hardware state.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-07 12:50:53 -07:00
Andrew Boie bd709c7322 x86: support very early printk() if desired
Adapted from similar code in the x86_64 port.
Useful when debugging boot problems on actual x86
hardware if a JTAG isn't handy or feasible.

Turn this on for qemu_x86.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-08-02 00:29:21 -07:00
Anas Nashif da6b49b432 doc: minnowboard: add grub docs
Was previously documented as part of the galileo board. Moving here now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif ffaba63b10 boards: remove arduino 101 and related boards
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif a597c86c30 boards: remove galileo board
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Jukka Rissanen 5cf60a326a boards: Set support for serial port networking as netif:serial-net
As we now have PPP support, use more generic "serial-net" string instead
of "slip" when setting what kind of networking the board supports.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-07-29 10:24:46 +03:00
Peter A. Bigot 1bb59bb68e dts: add label property to all jedec,spi-nor nodes
The property is required on all SPI clients, but was missing from
several devicetree nodes.  Set it, using the capitalized version of the
node alias when present, with "jedec,spi-nor#0" as the fallback.

Closes #17662

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-20 17:23:08 -04:00
Andrzej Puzdrowski 5a3f106be3 boards/qemu_x86: fix emulated program memory size
Qemu_x86 didn't reflect emulated program memory size.
It was because chosen zephyr,flash was assigned to flash_simulator
which was helping to generate DT_FLASH properties for sim_flash node.

This change revert choice of flash0 which solve problem with
program memory size. Flash simulator have to use
DT_SOC_NV_FLASH_xxx labels for fetch its property since that.

fixes #15832

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-07-17 13:49:26 -07:00
Andrzej Puzdrowski cdc7b6d656 boards/qemu_x86: fix qemu memory map
The desired memory map is to have the 0 - 4K page non-present
to catch NULL pointer dereferences,
from 4K - 4MB for the program text (RO, Execute),
ROM (RO, No Execute), and 4MB-8MB for system RAM.

This patch cut text size by 4 KB which allow to meet above
requirements.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-07-17 13:49:26 -07:00
Anas Nashif d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 5843884887 cleanup: include/: move pwm.h to drivers/pwm.h
move pwm.h to drivers/pwm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif a8167ab17d cleanup: include/: move pinmux.h to drivers/pinmux.h
move pinmux.h to drivers/pinmux.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 8f692c7d38 cleanup: include/: move i2c.h to drivers/i2c.h
move i2c.h to drivers/i2c.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif ef281c4237 cleanup: include/: move sys_io.h to sys/sys_io.h
move sys_io.h to sys/sys_io.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Charles E. Youse c5e582038c boards/x86/up_squared: default to new local APIC timer
This is the "flagship" platform for the new local APIC timer driver.
The opportunity is taken clean up the configuration as well, so the
choice of local APIC vs HPET timer requires changing only one Kconfig.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-27 07:20:54 -04:00
Charles E. Youse ca4910827b boards/x86/quark_d2000_crb: drop support for Quark D2000 dev board
Remove the board directory as well as references in tests and samples.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
David B. Kinder 6b2cd29223 doc: fix misspellings in documentation
Fix misspellings and doc issues missed during regular reviews (including
some files without a trailing newline)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-18 15:08:19 -04:00
George Dima 955cac617d boards: galileo: Fix PINMUX_FUNC_D for io_pin 9.
Modified PINMUX_FUNC_C (which appears twice in a row for io_pin 9) with
PINMUX_FUNC_D.

Signed-off-by: George Dima <dima331453@gmail.com>
2019-06-18 12:39:03 -04:00
Ulf Magnusson a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Charles E. Youse 15223dd936 arch/x86/Kconfig: remove CONFIG_IA32_LEGACY_IO_PORTS
Hygiene. This option is never referenced by any code.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-14 05:49:13 -04:00
Charles E. Youse f3611fdd0c boards/x86_jailhouse: remove support for Jailhouse hypervisor
This configuration is not used, maintained or tested, so it is removed.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-08 15:41:36 -04:00
Charles E. Youse 0fe4e1b3a8 arch/x86: x2APIC support is not specific to jailhouse
Simple renaming and Kconfig reorganization. Choice of local APIC
access method isn't specific to the Jailhouse hypervisor.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-08 15:41:36 -04:00
Marti Bolivar 35d4e62300 boards: allow cmake-time overrides of all runners
Convert all board_set_xxer(foo) calls to board_set_xxer_ifndef(foo),
which allows the user to make their own decision at CMake time.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-06-07 13:43:51 +02:00
Marti Bolivar 1717332c7a cmake: add helpers for setting board runners
This helps by letting us add checks for when the runner has already
been set. There is documentation saying you can set
-DBOARD_DEBUG_RUNNER at the command line and have it take effect,
which turns out not to be true for a large number of boards.
A status message helps the user debug.

(We'll address the existing in-tree boards in the next patch.)

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-06-07 13:43:51 +02:00
Andrew Boie 55ff4ba5df x86: add qemu_x86_coverage target
Builds with coverage enabled are in a continuous state
of bit-rot as no CI job enables it. Introduce a dedicated
x86 target that builds with coverage enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-06 09:29:12 -07:00
David B. Kinder 9bcf629828 doc: fix typo in gpmrb doc
Fix typo missed during regular review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-05 21:13:33 -04:00
Geoffroy Van Cutsem 57728ffb27 boards/x86: scripts: build_grub.sh to use grub-2.04-rc1-17-g8e8723a6b
Newer versions of GCC (e.g. gcc 9.1.1) fail to compile the version of
Grub that is used by the Zephyr build_grub.sh script. This patch updates
the version of Grub to the latest (as of June 4 2019) which includes a
number of fixes that solve the problem.

Fixes: #16624
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-06-04 19:32:44 -04:00
Charles E. Youse 69c01d11e5 boards/x86/gpmrb: add Gordon Peak MRB board
Add board support (and documentation) for the Intel Gordon Peak
Module Reference Board, a dev board based on the Apollo Lake SoC.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-04 14:50:47 -04:00
Charles E. Youse 0fcc484944 boards/up_squared: soc/apollo_lake: I2C driver selection at SoC
While enabling specific I2C ports does indeed belong at the board
level Kconfig, the selection of driver (I2C_DW) is an SoC-level
choice, so it is moved accordingly.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-01 10:00:32 -04:00
Charles E. Youse 2b01e06052 boards/up_squared: soc/apollo_lake: enable UARTs per board, not SoC
Which UARTs are broken out from the SoC on a particular board is
board-specific; don't enable UARTs blindly in the SoC Kconfig.

Also, the default UART options are specified in the driver Kconfig, so
the same defaults specified in the SoC Kconfig are redundant. Removed.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-01 10:00:32 -04:00
Charles E. Youse c5aa535c98 boards/up_squared: soc/apollo_lake: devicetree default to status="ok"
Since Kconfig is responsible for enabling/disabling devices at build,
the devices in dt are defaulted to status="ok" to keep the output in
generated_dts_board.conf the same across configurations and simplify
the board-level dts files.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-01 10:00:32 -04:00
Charles E. Youse c0502d9602 soc/apollo_lake: boards/up_squared: move UART fixups to SoC
The UART references in dts_fixup.h are actually SoC-specific, not
board-specific, so they are moved. Since this leaves the board fixups
empty, the file is removed.

The SoC fixups are expanded to include the additional two ports that
are present on some revisions of the Apollo Lake.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-01 10:00:32 -04:00
Charles E. Youse 96961476c1 boards/up_squared: I2C support added (back) in
I2C support has been added back into the up_squared, leveraging the
new PCIe support in the DesignWare I2C driver.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 08:23:22 -04:00
Charles E. Youse 309dfef511 drivers/i2c/i2c_dw.c: rewrite for PCI(e) support
The legacy PCI support in the DesignWare I2C driver is replaced with
the new PCIe support. The Intel Quark X1000 SoC and the galileo board
configurations are updated accordingly.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 08:23:22 -04:00
Charles E. Youse a8dcb8b623 boards/up_squared: remove SBL-specific board configuration
The SBL configuration no longer differs in any detail (except its name)
from the "standard" UpSquared configuration, so it is removed.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 08:23:22 -04:00
Charles E. Youse 35d0ae39d8 boards/up_squared: temporarily remove I2C support
This needs to be pushed down to the SoC level, as it's an Apollo Lake
feature, not a feature of the UpSquared. Remove the Apollo Lake
references to the PCI devices because these will not be used when I2C
support is restored.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 08:23:22 -04:00
Charles E. Youse f9d7bc2977 boards/up_squared: remove CONFIG_SBL_FIXUP
This option is no longer used in the dts_fixup.h file since there
are no SBL-specific fixups.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 08:23:22 -04:00
Charles Youse 65352a740d boards/x86/acrn: fix documentation to reflect "demo" nature
The ACRN board configuration is not suitable for production use,
but many people are mistakenly using it as a starting point for
real-time applications. I've added a note to clarify.

Signed-off-by: Charles Youse <charles.youse@intel.com>
2019-05-19 13:40:19 -07:00
Andrzej Puzdrowski 56be0fd5a9 boards/x86/qemu_x86: increase RAM size
Increase ram size as flash simulator need it for
emulated storage. The qemu_x86 flash size is puted back to
its original value of 4092K

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-05-13 14:39:34 -04:00
Charles E. Youse b5eba0f6bb boards/x86/up_squared: move UART configuration to apollo_lake.dtsi
The UARTs are on the SoC, not the board, so move their descriptors
to the SoC-level. Also turn on auto IRQ detection as these are PCI-
attached and their IRQs are subject to change depending upon firmware
settings.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-04 18:29:32 -04:00
Charles E. Youse 6d30d949e5 boards/galileo: adjust PCI-related configuration
PCI and PCI enumeration aren't optional on the Galileo and should
not be treated as such.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-04 18:29:32 -04:00
Andrew Boie 87d1f0682b boards: qemu_x86: properly enable XIP
The '#if XIP' in the DTS file never worked properly,
causing the QEMU build to think it has much more RAM
then it actually has. If RAM overflowed, this would not
be caught by the build, instead there would be strange
crashes when the data copy takes place.

The QEMU targets themselves are not XIP, everything
is actually RAM, but the first 4 megabytes are
considered to be a memory-mapped flash region. This
is done to ensure that the XIP data copying infrastructure
doesn't bit-rot on x86. We are at the point where
a lot of things depend on this, so just select it in
the board Kconfig instead of enabling in the
defconfigs.

Fixes: #15835

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-05-03 22:38:22 -04:00
Charles E. Youse 18833ac0ef drivers/pcie: verify PCI(e) assigned interrupts
A new function pcie_irq_enable() is added to be used in lieu of
irq_enable() when the target device is PCI(e)-attached. The function
attempts to use MSI, when configured in the kernel and supported by
the endpoint; failing that, it will verify that IRQ requested is in
fact routed to the device by the boot firmware before enabling it.

The NS16550 UART driver is updated to use pcie_irq_enable().

The PCI(e) shell is extended to dump information about wired IRQs.

The up_squared devicetree is fixed (reverted?) to IRQ5 for UART1.

The galileo enables MSI by default.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-28 13:36:28 -04:00
Kamil Piszczek 5fd99f5e6a drivers: flash: simulator Kconfig cleanup
Moved the default selection of Flash simulator for qemu_x86 to the board
Kconfig.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-26 04:04:19 -07:00
Kamil Piszczek 968d3a9ef4 dts: flash simulator cleanup
Moved the DT node description for Flash simulator to the board dts file.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-26 04:04:19 -07:00
Kamil Piszczek d4be557fe9 boards: qemu_x86: reducing flash size
Reduced flash size for QEMU x86 so it does not consume a lot of RAM
memory where it is simulated.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-24 13:05:11 -07:00
Kamil Piszczek dae15fa736 tests: storage: flash_map: adding qemu platform
Added QEMU platform to the Flash Map test and defined partitions for
QEMU dts.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-24 13:05:11 -07:00
Kamil Piszczek 129936e63d boards: changing flash simulator device name alias
Changed alias used for flash simulator device name to match the real
one.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-24 13:05:11 -07:00
Kamil Piszczek c837d85c2b drivers: flash: add flash_simulator driver
This commit adds a flash driver implementation that writes to RAM and
exports statistics through stats.h. It can be used to simulate flash
memory for testing purposes.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-24 13:05:11 -07:00
Charles Youse fdf973de71 boards/x86/up_squared: update documentation to include HSUART info
Describe how to use devicetree to enable HSUART features on up_squared.

Signed-off-by: Charles Youse <charles.youse@intel.com>
2019-04-22 09:29:38 -07:00
Kumar Gala 9332abd3e1 boards: acrn: remove duplicated Kconfig HAS_DTS
We already select HAS_DTS at the arch level for X86 so we don't need to
duplicate it at the board level.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-04-20 08:54:27 -05:00
Carles Cufi bca3deb1e7 drivers: Bluetooth: Generalize IC-specific setup hook
In order to generalize the currently specialized nRF51 IC setup hook,
make the following changes:

- Generalize the hook to bt_ic_setup()
- Use a weak NOP version by default
- Move the currently existing one to the board folder

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-19 12:21:21 +02:00
Charles E. Youse e039053546 uart/ns16550, drivers/pcie: add PCI(e) support
A parallel PCI implementation ("pcie") is added with features for PCIe.
In particular, message-signaled interrupts (MSI) are supported, which
are essential to the use of any non-trivial PCIe device.

The NS16550 UART driver is modified to use pcie.

pcie is a complete replacement for the old PCI support ("pci"). It is
smaller, by an order of magnitude, and cleaner. Both pci and pcie can
(and do) coexist in the same builds, but the intent is to rework any
existing drivers that depend on pci and ultimately remove pci entirely.

This patch is large, but things in mirror are smaller than they appear.
Most of the modified files are configuration-related, and are changed
only slightly to accommodate the modified UART driver.

Deficiencies:

64-bit support is minimal. The code works fine with 64-bit capable
devices, but will not cooperate with MMIO regions (or MSI targets) that
have high bits set. This is not needed on any current boards, and is
unlikely to be needed in the future. Only superficial changes would
be required if we change our minds.

The method specifying PCI endpoints in devicetree is somewhat kludgey.
The "right" way would be to hang PCI devices off a topological tree;
while this would be more aesthetically pleasing, I don't think it's
worth the effort, given our non-standard use of devicetree.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-04-17 10:50:05 -07:00
Andrei Emeltchenko fa5d9d20ec quark_se_c1000_devboard: Fix broken DTS configuration
Fixes broken CC2520 on quark_se_c1000_devboard configuration after
commit 25d17db.

Fixes #15070

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-11 10:39:21 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Anas Nashif 9983710c44 boards: qemu_x86_nommu is a simulation platform
For some reason we dropped the simulation keyword and this platform is
not running any tests, we are just building the tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-03 21:33:19 -04:00
Patrik Flykt 5aecf9db37 boards: Rename reserved function names
Rename reserved function names in the boards/ subdirectory.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-04-03 17:31:00 -04:00
Geoffroy Van Cutsem 5900a6fef3 boards/x86: scripts: unset CFLAGS when running build_grub.sh
On Clear Linux, the CFLAGS is set and defines a number of aggressive
checks and optimizations. This causes a build failure when generating a
GRUB2 boot loader image using the 'build_grub.sh' script.

Unsetting it within the script allows it to proceed and successfully
build a functional GRUB2 boot loader image to be used with Zephyr.

Fixes: #14289
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-03-31 11:12:19 -04:00
David B. Kinder 223bbecf45 doc: fix ACRN board list format
One of the bullet list items didn't get rendered properly because
continuation line wasn't indented.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-23 19:26:27 -04:00
Carles Cufi cb44b7e768 doc: Bluetooth: Document the debug monitor and btmon in general
Move the original documentation in the arduino_101 board to a common
section in the Bluetooth documentation and document the use of `btmon`
in general.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-03-21 17:23:08 +02:00
Charles E. Youse 27a56ad75c boards/x86: add ACRN UOS sample board configuration
Based on prior work by @dcpleung. It's suboptimal, but it provides a
working starting point for ACRN work. The x86 board/SoC abstractions
really need to be refactored to make this "board" (and other x86-based
"boards", both extant and future) cleaner and easier to maintain. Punt.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-03-18 19:28:41 -04:00
Geoffroy Van Cutsem 209e92ef12 doc: up_squared: add 'west' build option to the UP2 documentation
It is also possible to use 'west' to build the 'hello_world' sample
application for the UP2 (up_squared) board. This patch makes it
explicit in the documentation.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-03-15 07:16:50 -05:00
David B. Kinder 6000a6205a doc: prepare for improving doc API linking
Linking to API material requires knowing the pecularities of how
doxygen, sphinx, and breathe work. In an attempt to hide some of this
we're preparing the current docs to allow use of configuration defaults
that will let us more simply use a default role that will hunt for a
reference target in the various domains that are available by using a
default "role" of "all".  This will let us use the simple notation
`functionname` or `typename` without fully specifying the reference as
:c:func:`functionname`.

This patch cleans up exising docs that were (incorrectly) using single
backtics where double backtics should have been used, and also found
some typos (such as a space between the role name and the reference,
such as :file: `filename`, and a missing colon such as
c:func:`functionname`)

This is a start to address issue #14313

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-15 05:47:19 +01:00
Geoffroy Van Cutsem 96235c5027 boards/x86: scripts: build_grub.sh to use grub-2.02-285-g5bc41db75
The build_grub.sh script cherry-picks 3 commits from the master branch
of grub because more recent build tools fail to build the latest stable
release (which is 2.02). This solves the problem on Fedora 29 for
example, but is not sufficient for Clear Linux.

This patch modifies the build_grub.sh script to use
grub-2.02-285-g5bc41db75 (latest from master as of 13 of March 2019).
That version compiles 'out-of-the-box' in the latest Ubuntu, Fedora and
Clear Linux.

There are additional tools required on the host system and the
documentation has been updated accordingly.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-03-14 19:20:24 -05:00
Ulf Magnusson 53376394b7 kconfig: Remove blank lines at the beginning/end of files
Maybe this is some "just in case" thing that got copied around. There's
no need to have a blank line at the beginning or end of Kconfig files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-13 07:29:42 -05:00
Andrew Boie 67c4c2e6f0 qemu_x86_iamcu: disable spec execution mitigations
This build target is intended to verify that enabling the
IAMCU ABI doesn't have any bit-rot since we can easily
run this under emulation.

However, the QEMU boards all derive from the generic IA32
SOC definition, which is any pc-like hardware. We need
to disable these mitigations for this target since the
IAMCU compiler doesn't even recognize instructions like
'lfence'.

Fixes: #14315

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-12 18:39:49 -05:00
Geoffroy Van Cutsem 0590fd528c x86: grub_build.sh: fix compilation failures on Fedora 29
Fedora 29 (and possibly other disctributions) are nowadays coming with
very recent versions of gcc (8.x) and binutils. These will cause some
compilation error when running the 'grub_build.sh' script to create a
GRUB2 boot loader image.

Fortunately, both issues have been fixed and merged in the upstream
project. This patch modifies the build script to cherry-pick those to
the local cloned version of grub before building it.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2019-03-12 11:30:31 +01:00
David B. Kinder 505cc2bb0e doc: use :zephyr_file: where appropriate
A new role :zephyr_file: is available that renders to a link to the file
or folder in GitHub.  Find appropriate references using :file: and
convert to :zephyr_file: to take advantage of its linking capability.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-09 09:50:27 -05:00
Ulf Magnusson 7089ec76b9 kconfig: pinmux: Remove lots of redundant PINMUX dependencies
Most of these are from source'ing a file within an 'if PINMUX', and then
adding another 'depends on PINMUX' within it.

'if FOO' is just shorthand for adding 'depends on FOO' to each item
within the 'if'. There are no "conditional includes" in Kconfig, so
'if FOO' has no special meaning around a 'source'. Conditional includes
wouldn't be possible, because an 'if' condition could include (directly
or indirectly) forward references to symbols not defined yet.

Tip: When adding a symbol, check its dependencies in the menuconfig
('ninja menuconfig', then / to jump to the symbol). The menuconfig also
shows how the file with the symbol got included, so if you see
duplicated dependencies, it's easy to hunt down where they come from.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-07 08:47:31 -05:00
Flavio Ceolin 051a7057a9 boards: galileo: Fix switch usage
According with MISRA-C every switch-clause must terminate with an
unconditional break.

MISRA-C rules 16.1 and 16.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-05 14:58:58 -08:00
Anas Nashif ed20fc9f30 doc: remove CONFIG_UART_QMSI_1_BAUDRATE from doc
This is now set by DTS.

Fixes #13752

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-03 13:09:48 -08:00
Ulf Magnusson 9fb4ec6a93 arduino_101_mcuboot: Remove CONFIG_UART_QMSI_0_BAUDRATE - moved to DTS
UART_QMSI_0_BAUDRATE was removed by commit 17c6456678 ("drivers/uart:
Use dts to set uart priorities for QMSI driver").

There's a reference to CONFIG_UART_QMSI_1_BAUDRATE as well, but getting
rid of it requires documentation updates.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-02 03:46:10 +01:00
Daniel Leung ee50b49621 boards: up_squared: turn on PCI enumeration
The MMIO addresses for peripherals are being assigned by BIOS
at boot. Different BIOS versions and number of enabled peripherals
affect how those addresses are assigned. This invalidates
the addresses for UART defined in DTS. Turn on PCI enumeration
so UART addresses are probed at boot to avoid non-usable
UART and black console.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-28 18:13:43 +01:00
Daniel Leung 603f068690 uart/ns16550: Use DT_ prefix for remaining device configs
Previous rename from CONFIG_* to DT_* left a few remaining
CONFIG_*. So rename them manually now.

Fix #13753

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-26 20:06:26 -06:00
Charles E. Youse d3adba8379 boards/x86: scripts: build_grub.sh fix for newer GCC versions
Recent versions of GCC won't build grub-2.02 because they're more
pedantic about warnings. This has been fixed upstream but is not
yet part of any release. The build script is modified to apply the
relevant commits before building.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-02-22 12:20:07 -06:00