Commit Graph

48 Commits

Author SHA1 Message Date
Nico Huber d8fae235d5 Makefile: Always disable warnings for out-of-order record fields
We added this as a GCC 10 quirk, but of course by now there are many
more versions with this flag. Stable GCC 10.1 was released almost 4
years ago and libhwbase is mostly used with coreboot's toolchain and
newer ones. So we don't have to keep compatibility with older GCC
releases.

Change-Id: I1131ebbdde71cd6223a9ea650512eec601401cc3
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/82052
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2024-04-23 20:57:49 +00:00
Nico Huber 584629b9f4 Avoid warning '"Pos64" is already use-visible'
Change-Id: If18a630d8e8a4e2439582777ef1bb969b7b88c6f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/76490
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2023-07-17 09:01:16 +00:00
Jeremy Compostella 95ad8c53c6 hw-debug: Place global variables in the .bss section
It places the Middle_Of_Line and Register_Write_Delay_Nanoseconds
variables in the .bss section. As a result they are set at runtime to
their desired default value which is respectively False and 0.

It helps to integrate the libhwbase library debug package in
environments where global initialized variables are not
supported such as coreboot romstage.

This change does not impact GNATprove as this package has SPARK_Mode
disabled.

BUG=b:252792591
BRANCH=firmware-brya-14505.B
TEST=Working as expected on skolas

Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Change-Id: Ib23699f3f3446219c34c60ccd9987346e17769f2
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/69854
Tested-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-12-22 15:32:38 +00:00
Elyes Haouas 8be5a82b85 Fix "unnecessary with of ancestor [-gnatwr]"
Change-Id: I3a8a161a5fd6f8f261d101f1752b452d3706a2df
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/67832
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-10-04 14:01:00 +00:00
Nico Huber fc2102f560 dynamic_mmio: Use volatile access type
GCC 11 complains about an incompatible access type, e.g.

hw-pci-dev.adb:28:04: instantiation error at hw-mmio_range.adb:32
hw-pci-dev.adb:28:04: instantiation error at hw-pci-mmconf.adb:36
hw-pci-dev.adb:28:04: designated type and access type are not compatible with respect to volatility due to Async_Readers, Async_Writers, Effective_Reads, Effective_Writes

Declaring the access type volatile works around the issue, but we
have to also treat `Range_A` as external state now. Declaring it
as `Base_Address` state was an odd hack anyway.

To avoid further hassle, we also disable `SPARK_Mode`. Treating
this as SPARK code was never intended, and we use a shadow imple-
mentation (`proof/hw-mmio_range.adb`) for proofs anyway.

TEST=Doesn't affect coreboot binaries.

Change-Id: I9ddc8d1dafdcb41810e4c8bf29164ef7130def3f
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/55390
Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: Patrick Georgi <pgeorgi@google.com>
2021-06-13 20:10:35 +00:00
Angel Pons a3edc6ef32 Makefile: Add `-gnatw_R` to suppress spurious warning
Looks like there's a new warning option that complains when the order of
component declarations, component clauses, and bit-level layout do not
all agree. However, we also enable `warnings are errors`. Plus, we use
mismatched component representation clauses on purpose in libgfxinit's
epilepsy-inducing gfxtest program to have RGB ordering on hardware that
works with BGR ordering. Hardware is cursed, so silence this warning.

Change-Id: I1565e3e834cd47b7f53fd2202b38fdf01a0b7619
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/43556
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-07-19 17:36:27 +00:00
Angel Pons d822df5219 Makefile: Delay expansion of `$(ADAFLAGS)`
This allows users of this library to extend `ADAFLAGS` from within their
Makefile. The added flexibility makes this a very well spent dollar :-)

Change-Id: I873d3eea48549e6945c4229b50c2318a3711bc4d
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/43557
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-07-19 17:35:46 +00:00
Angel Pons 4e22910f78 Makefile: Adapt $(space) definition
GNU Make 4.3 is more picky about the $(space) definition. It seems that
the variable ends up being empty.

Change-Id: If07db29fc63e8a45e9b0869df894ce3420fa9b95
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/39163
Tested-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-03-06 17:06:30 +00:00
Adrian-Ken Rueegsegger 9f87a10c6e time: Add T_First constant
The constant can be used to initialize variables of type HW.Time.T.

Change-Id: I65246d6776d464bfa8648075b48e7de61cd82902
Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/38983
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-02-21 08:55:19 +00:00
Adrian-Ken Rueegsegger 69e90862ce mutime: Make Sinfo an imported constant
The subject info data structure is static and is not changed during
runtime. Make Sinfo an imported constant and adjust refinement of
abstract timer state and global contract of Hz function accordingly.
They are no longer volatile.

Change-Id: I5729bc7f2d77c5c51a6cab2edc7953e95c9e4d29
Signed-off-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/38982
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2020-02-21 08:55:15 +00:00
Nico Huber bd0ed91cb9 Makefile: Revise support for generated sources
Handle generated source files more independently from normal source
files. This allows mixing of generated specs with existing source
bodies.

As with the source file list, we filter the list of generated sources,
`$(name)-gens`: All spec (.ads) files that have a respective body file
(.adb), are moved into `$(name)-extra-gens`. This way, we can still
add these files as dependencies to all pre-existing source files.

Change-Id: I5479c436f39088ae9d0ebddf9a97446be0f191f3
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/27139
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-05-06 21:45:26 +00:00
Nico Huber 455ed64bff direct pci, debug: Fix minor style issues
Change-Id: I8adbf75babc233dff79e5c8921d1f24692a939ab
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/26840
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: Nico Huber <nico.h@gmx.de>
2019-05-06 21:34:18 +00:00
Nico Huber 6582141149 Makefile.proof: Add --no-inlining to SPARKFLAGS
With `--no-inlining`, proof is about 10% faster for libgfxinit.

Change-Id: Ia6055da326901c1c25b9d0c757767891284bc515
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/26850
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Reto Buerki <reet@codelabs.ch>
2019-05-06 16:13:05 +00:00
Nico Huber c38015d052 mutime: Move to common/
It's valid SPARK now.

Change-Id: I03bc3fa7d9bea79680888c13679cfd871e772000
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/26839
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Reto Buerki <reet@codelabs.ch>
2019-05-06 16:12:50 +00:00
Nico Huber a6a4909d25 time: Revise state abstraction
Make abstract state `State` of HW.Time.Timer, that's used to derive the
Hz value for instance, External. This helps to fix flow issues in the
mutime implementation and also matches real hardware better: The clock
rate may be derived from the hardware state.

HW.Time.Timer.Hz had to be made a volatile function, therefore.

Change-Id: I35af2d0db1acbf9652ea00763aa288545746bb79
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/26838
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Reto Buerki <reet@codelabs.ch>
2019-05-06 16:12:41 +00:00
Nico Huber a60324f052 Makefile.proof: Remove cvc4 from prover list
Since we have z3, it was never of much use.

Change-Id: Ib0458bfe53fd999c60f8d1b7cf8709e6195d0a42
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/libhwbase/+/26837
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Reto Buerki <reet@codelabs.ch>
2019-05-06 16:12:34 +00:00
Nico Huber 637f2a4f21 pci: Make HW.PCI.MMConf a public generic
GCC 8 wants us to tie the hidden, private state of HW.PCI.MMConf to a
surrounding state. Though, as it's impossible to do that before the
package instantiation, we can only comply by making it public.

Change-Id: I41c3d1324a7d9acde5be2c246011f976361e8f2b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/26304
Tested-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2018-05-19 20:37:51 +00:00
Nico Huber 66859712e4 linux pci: Add dummy PCI access for shared contracts
Other implementations may update the PCI_State in Resource_Size() and
Map(). To share the contract with those implementations, we have to
simulate such accesses.

Change-Id: If994db22d91eb3707e555871d854c3a25a13678b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21206
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-30 15:14:20 +00:00
Nico Huber 1404fbbee4 Makefile.proof: Reorder theorem provers
Prefer Z3 over CVC4, the latter seems to not do anything for the current
code and just wastes CPU cycles.

Change-Id: Ia5e1341e881c5f887452486a318e8e72513f28fb
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20627
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
2017-08-29 09:46:36 +00:00
Nico Huber e05bf875c1 direct pci: Always initialize Address_State
Let Initialize() always initialize the Address_State. This is not only
the expected behaviour but also necessary to share the contract with
other implementations.

Change-Id: I0454dfd6c36f7d4298edeec5b84d929e3160eb7b
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21205
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
2017-08-28 20:17:18 +00:00
Nico Huber ff3240b253 pci: Add Linux sysfs implementation of HW.PCI.Dev
In Linux' sysfs, each PCI device has a directory like:

    /sys/devices/pci0000:00/0000:00:02.0/

Therein, the file `config` represents the PCI device's configuration
space. Alas, it's not mappable so we work on a read only copy. Should
we ever need dynamic read/write access, we'd have to implement it
using read()/write().

IO and MMIO resources are represented by mappable files, `resource[0-5]`
for uncacheable accesses and `resource[0-5]_wc` for write-combining
access.

Change-Id: I1358e9336edaf75e8eff50808a8169b997817d7e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20554
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-21 10:52:56 +00:00
Nico Huber ae9b85522a pci: Add bare metal HW.PCI.Dev implementation
Add a HW.PCI.Dev implementation that assumes direct hardware access,
i.e. its Map() implementations just returns the physical address of
a resource.

Change-Id: I055a05a17e207e8b43aa02d1b39023b027f94f6c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20551
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-21 10:52:50 +00:00
Nico Huber 36934fbde0 Add `debug.adc` and option DEBUG
The GNAT configuration file `debug.adc` has Assertion_Policy Debug
enabled to compile `pragma Debug` code. If `DEBUG` is set to `1`
during build, `debug.adc` is used instead of the default `gnat.adc`.

Change-Id: If5b52f5251cae7deed7aca2765f9b5db1c148fb7
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20558
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-20 21:16:20 +00:00
Nico Huber 4a10482666 Add Div_Round_Up() for positive integer types
Also rewrite Div_Round_Closest() as expression functions.

Change-Id: I9f4bb0f2f442510f821d367d8b11d14a4f697a7e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20557
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-08-20 21:16:15 +00:00
Nico Huber ba37830467 Makefile: Install generated spec files too
Change-Id: I514c621852f91c41f580fd53b295aeb7a5cb0cdd
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20555
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-08-20 21:16:12 +00:00
Nico Huber def89ebc05 posix file: Add procedure to query the size of a file
Change-Id: Ib3b31e90ca98dc09185463ce467a70770e0f222d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21095
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-20 21:16:06 +00:00
Nico Huber 81294ed049 gnat.adc: Allow exception handlers in pure Ada code
Change-Id: I5eb658f2ee0f55bb4f04da58e0e99bc9fc6780a5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/21094
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-20 21:16:03 +00:00
Nico Huber 967dd0d48e posix file: Add an `Offset` parameter and make `Len` optional
Give Map() an `Offset` parameter that will be passed to mmap(). Make the
`Len` parameter of Map() optional. If it's left at the default, `0`, map
until the end of the file (up to SIZE_MAX bytes).

Change-Id: I7b062ce1e9cddab87a66a2aedc8b64e4e8524d9f
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20553
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-08-20 21:15:55 +00:00
Nico Huber a43b1ee1c5 posix file: Let the OS decide addresses to map to
Reverse the direction of the `Addr` parameter of Map(). We let mmap()
decide which address to use and return that. Given that we can set the
address for `MMIO_Range` instances during runtime, we shouldn't ever
have to force static addresses.

Change-Id: I35bfd65e7b471daae4f43a9233ce613c7f45891e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20552
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-08-20 21:15:33 +00:00
Nico Huber ef4545afbf pci: Add PCI device infrastructure
Add generic PCI packages:

o HW.PCI containing basic definitions for PCI devices and
  configuration space headers,
o HW.PCI.MMConf that provides access to memory mapped confi-
  guration space of a PCI device, and
o HW.PCI.Dev adding a method to map resources of a PCI device.

Change-Id: I266ea35e273ff49fdb3176d617bb0b4ab1f13f93
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20258
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2017-08-19 00:24:45 +00:00
Nico Huber 359e314ba9 Add HW.Config for configuration constants
Change-Id: Id60c61fc53c6e153dcb3cf9f5c55668e38072817
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20556
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-08-19 00:24:42 +00:00
Nico Huber 874113d29c time: Juggle with types for proof
Helps with SPARK GPL 2017.

Change-Id: Idc0a038b132438be13aef496c41d15300069ed02
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20257
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-07-12 23:14:29 +00:00
Nico Huber 32f1489253 posix file: Match newer warning wording
For compatibility with GNAT GPL 2017.

Change-Id: I1b4b914aa4964967b1c598ef5ca303410bd413ec
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/20256
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2017-07-12 23:14:18 +00:00
Nico Huber 3bf6759dc0 gnat.adc: Remove restriction `No_Secondary_Stack`
This was only set to get more obvious error messages (i.e. restriction
violations instead of missing packages in the runtime environment).
However, it doesn't play well with the standard interfaces for console
applications. So remove the restriction to allow usage of the secondary
stack where possible.

Change-Id: Iceb64fe2b6f304e2e88b18cf3435fdbfda57440d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18784
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 18:03:57 +02:00
Nico Huber 78ca582d1b Makefile: Compile binder's output w/o gnat config
The code generated by the binder (gnatbind) isn't always compilable
with the restrictions in our gnat configuration file `gnat.adc`. This
is in accordance with how `gnatlink` would do the job.

Change-Id: I59ea4a68749cabfb6cccdda1db4c23c6c0d5be60
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18782
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 18:03:05 +02:00
Nico Huber f43881fa25 Makefile: Add support to bind/link application binaries
Since Ada supports different names for the Main() procedure, we have to
specify the main source file explicitly. Also, the binder (gnatbind)
insists on searching the required object files himself, so we only spe-
cify the object file of the main procedure.

Change-Id: I7227b845e38963e5434a4db0068d373fc4b7ee99
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18781
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 18:02:22 +02:00
Nico Huber 9d5d025306 Makefile: Remove -gnatg from ADAFLAGS
The `-gnatg` flag (internal GNAT implementation mode) was accidentally
copied over from the flags we use to build libgnat.

Change-Id: I2e9c6d1d5b68168d1608187aad2eae5aead759f9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18780
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-06 18:00:23 +02:00
Nico Huber f03ef4f2d4 Add support to map the contents of a file
Add a package HW.File with a single procedure Map():

   procedure Map
     (Path     : in     String;
      Addr     : in     Word64;
      Len      : in     Natural;
      Readable : in     Boolean := False;
      Writable : in     Boolean := False;
      Map_Copy : in     Boolean := False;
      Success  :    out Boolean)
   with
      Pre => (Readable or Writable) and
             (if Map_Copy then Readable and not Writable);

If `Map_Copy` is `False`, it should map `Len` bytes from the start of
the file given by `Path` into the application's address space at `Addr`
using mmap(). If `Map_Copy` is `True`, anonymous memory should be map-
ped instead and be filled with a copy of the file's content using
read().

The current implementation is backed by C code to reduce dependencies
to external libraries (e.g. Florist is not packaged by a famous Linux
distro).

While we are at it, also add a configuration file for common POSIX
environments (configs/posix).

Change-Id: Ic10c35b35d3216dab6a5b2baba7ba619c885b346
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18779
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2017-06-06 17:59:50 +02:00
Nico Huber e86fff93bd Makefile: Add simple compilation rule for C
We only use C as an interface (e.g. to POSIX). Thus, we keep the rules
simple and don't do any dependency tracking.

Change-Id: I62b4b4e4d3ae83d5e1f1811f783b559b225746e6
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18778
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2017-06-06 17:57:55 +02:00
Nico Huber 5f82d1ab97 ada/dynamic_mmio: Drop unnecessary Volatile aspect
The access variable `Range_A` was accidentally declared `Volatile` which
led to the following complaint by GCC 7.1:

    volatile object cannot appear in this context (SPARK RM 7.1.3(11))

This happened probably to make `Range_A` compatible with our state
abstraction, but we can just use the correct abstraction instead.

TEST=Compiled a coreboot target with libgfxinit and checked the
     emitted assembly: Only minor reordering regarding the pointer
     but not the dereference.
     Booted ThinkPad T420 with libgfxinit enabled.

Change-Id: I56a3fcadce59713fb03a089d192d2022bfb1d378
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19624
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
2017-05-22 21:07:18 +02:00
Nico Huber cf01ab6e40 Makefile: Fix whitespace and syntax highlighting nits
Change-Id: Id16ec035f4468f122f4ef3d5f6385252e428a0fc
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/18783
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Reviewed-by: Martin Roth <martinroth@google.com>
2017-03-14 11:53:04 +01:00
Nico Huber 868915fc4e Makefile: Add support for out-of-tree sources
Change-Id: If029c713a06a77aa8001cb4093806580086e3cbe
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18358
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
2017-02-20 20:43:41 +01:00
Nico Huber b6641197dc Add muen scheduling info as timer source
This is a very low precision clock. We just take the start of the cur-
rent scheduling minor frame as the minimum, yet elapsed moment and the
end of the frame as the maximum, yet reached moment in time. As a
result, every timer based delay will wait at least for the next minor
frame.

For the build, `musinfo.ads` and `muschedinfo.ads` from the Muen
project are required. One should point the `muen-common-path` variable
to the `common` subdir of the Muen source distribution.

Change-Id: Ib139749214bf8d2ca293e31327b156de5198b65d
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18357
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Adrian-Ken Rueegsegger <ken@codelabs.ch>
2017-02-20 20:43:36 +01:00
Nico Huber a5c8ba24c1 Add Div_Round_Closest() for positive integer types
Change-Id: Ic8d398902947bf18d97c9ab3c6ca6204aa0629f0
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/18356
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: Nico Huber <nico.h@gmx.de>
2017-02-14 13:01:27 +01:00
Nico Huber aab715f166 Relicense libhwbase under GPL v2+
Change-Id: Id91d759fa1f6691dbcd228730809064fc8305af2
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17053
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-10-20 13:05:03 +02:00
Nico Huber ded07e802f Makefile.proof: Add all source files to the dependencies
Change-Id: Ic1d19e4516bb20b9796ac02baee099e9df472ab5
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/17021
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2016-10-20 13:04:47 +02:00
Nico Huber f86fb18dab Makefile: Add a strip_quotes macro
Change-Id: I465416dd8e4f92f9700253fc031a3933bba93f38
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/16962
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: Patrick Georgi <pgeorgi@google.com>
2016-10-13 23:25:13 +02:00
Nico Huber 5e9b1b50e7 Initial upstream commit
The history contained unlicensed code so everything got squashed, sorry.

Change-Id: Ie1335ecfcee7f740bb6de2e9887606be30a2deff
Signed-off-by: Nico Huber <nico.huber@secunet.com>
2016-10-09 11:31:44 +02:00