06 Feb, 2020
2 commits
-
At present dm/device.h includes the linux-compatible features. This
requires including linux/compat.h which in turn includes a lot of headers.
One of these is malloc.h which we thus end up including in every file in
U-Boot. Apart from the inefficiency of this, it is problematic for sandbox
which needs to use the system malloc() in some files.Move the compatibility features into a separate header file.
Signed-off-by: Simon Glass
-
At present devres.h is included in all files that include dm.h but few
make use of it. Also this pulls in linux/compat which adds several more
headers. Drop the automatic inclusion and require files to include devres
themselves. This provides a good indication of which files use devres.Signed-off-by: Simon Glass
Reviewed-by: Anatolij Gustschin
23 Jan, 2020
1 commit
-
The Nomadik Multi Timer Unit (MTU) provides 4 decrementing
free-running timers. It is used in ST-Ericsson Ux500 SoCs.The driver uses the first timer to implement UCLASS_TIMER.
Signed-off-by: Stephan Gerhold
Reviewed-by: Linus Walleij
15 Dec, 2019
2 commits
-
Most of the timer-calibration methods are not needed on recent Intel CPUs
and just increase code size. Add an option to use the known-good way to
get the clock frequency in TPL. Size reduction is about 700 bytes.Note that version 1 of this commit caused bootstage to crash since the CPU
was not identified. This is corrected by changes previously applied to
make sure that the CPU is identified before spl_init() is called, such as39146a2e0b x86: Move CPU init to before spl_init()
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
On x86 platforms the timer is reset to 0 when the SoC is reset. Having
this as the timer base is useful since it provides an indication of how
long it takes before U-Boot is running.When U-Boot sets the timer base to something else, time is lost and we
no-longer have an accurate account of the time since reset. This
particularly affects bootstage.Change the default to not read the timer base, leaving it at 0. Add an
option for when U-Boot is the secondary bootloader.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
03 Dec, 2019
5 commits
-
These functions do not use driver model but are fairly widely used in
U-Boot. But it is not clear that they will use driver model anytime soon,
so we don't want to label them as 'legacy'.Move them to a new irq_func.h header file. Avoid the name 'irq.h' since it
is widely used in U-Boot already.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
This function belongs in time.h so move it over and add a comment.
Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
This function belongs in time.h so move it over and add a comment.
Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
This is only used by a few files so it should not be in the common header.
Move it out.Signed-off-by: Simon Glass
Reviewed-by: Tom Rini -
This feature is not enabled by any board. Drop it.
Signed-off-by: Simon Glass
21 Nov, 2019
1 commit
-
To use this DM timer on socfpga as system tick, it needs to take itself
out of reset.Signed-off-by: Simon Goldschmidt
03 Nov, 2019
2 commits
-
At present the value of the timer base is used to determine whether the
timer has been set up or not. It is true that the timer is essentially
never exactly 0 when it is read. However 'time 0' may indicate the time
that the machine was reset so it is useful to be able to denote that.Update the code to use a separate flag instead.
Signed-off-by: Simon Glass
Tested-by: Aiden Park
Reviewed-by: Aiden Park
Reviewed-by: Bin Meng -
This function can be called before the timer is set up. Make sure that the
init function is called so that it works correctly.This is needed so that bootstage can work correctly in TPL.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
25 Jul, 2019
1 commit
-
It is possible that a timer device has a null ofnode, hence there is
no need to further parse DT for the clock rate.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass
11 May, 2019
1 commit
-
The dw-apb timer does not use 'gd', so remove its declaration.
Signed-off-by: Simon Goldschmidt
07 May, 2019
1 commit
-
Add OSTM timer driver for RZ/A1 SoC. The IP is very different
from the R-Car Gen2/Gen3 one already present in the tree, hence
a custom driver.Signed-off-by: Marek Vasut
Cc: Chris Brandt
Cc: Nobuhiro Iwamatsu
01 May, 2019
1 commit
-
Rockchip use 'arch-rockchip' instead of arch-$(SOC) as common
header file path, so that we can get the correct path directly.Signed-off-by: Kever Yang
Reviewed-by: Philipp Tomsich
25 Apr, 2019
1 commit
-
- Add support for Amlogic p200 & p201 Reference Designs
- Add Amlogic SoC information display
- Add support for the Libretech-AC AML-S805X-AC board
- Add Amlogic AXG reset compatible
- Add I2C support for Amlogic AXG
- Fix AXG PIN and BANK pinctrl definitions
- Fix regmap_read_poll_timeout warning about sandbox_timer_add_offset
- Add initial support for Amlogic G12A SoC and U200 board
- Enable PHY_REALTEK for selected boards
- Fix Khadas VIM2 README
23 Apr, 2019
1 commit
-
When fixing sandbox test for regmap_read_poll_timeout(), the
sandbox_timer_add_offset was introduced but only defined in sandbox code
thus generating warnings when used out of sandbox :include/regmap.h:289:2: note: in expansion of macro 'regmap_read_poll_timeout_test'
regmap_read_poll_timeout_test(map, addr, val, cond, sleep_us, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/meson_spifc.c:169:8: note: in expansion of macro 'regmap_read_poll_timeout'
ret = regmap_read_poll_timeout(spifc->regmap, REG_SLAVE, data,
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/meson_spifc.c: In function 'meson_spifc_txrx':
include/regmap.h:277:4: warning: implicit declaration of function 'sandbox_timer_add_offset' [-Wimplicit-function-declaration]This fix adds a timer_test_add_offset() only defined in sandbox, and
renames the previous sandbox_timer_add_offset() to it.Cc: Simon Glass
Reported-by: Tom Rini
Fixes: df9cf1cc08 ("test: dm: regmap: Fix the long test delay")
Signed-off-by: Neil Armstrong
Reviewed-by: Simon Glass
18 Apr, 2019
1 commit
-
The generic timer count is an incrementing 64bit value and a timer driver
must return an incrementing 64bit value. The DW APB timer only provides a
32bit timer counting down, thus the result must be inverted and converted
to a 64bit value. The current implementation is however missing the 64bit
up-conversion and this results in random timer roll-overs, which in turn
triggers random timeouts throughout the codebase.This patch adds the missing 64bit up-conversion to fix the issue.
Signed-off-by: Marek Vasut
Cc: Chin Liang See
Cc: Dinh Nguyen
Cc: Ley Foon Tan
Cc: Simon Goldschmidt
Cc: Tien Fong Chee
12 Feb, 2019
1 commit
-
Add native tsc calibration function. Calibrate the tsc timer the same
way as linux does in arch/x86/kernel/tsc.c.Fixes booting for Apollo Lake processors.
Signed-off-by: Bernhard Messerklinger
Reviewed-by: Andy Shevchenko
Reviewed-by: Bin Meng
18 Dec, 2018
1 commit
-
RISC-V privileged architecture v1.10 defines a real-time counter,
exposed as a memory-mapped machine-mode register - mtime. mtime must
run at constant frequency, and the platform must provide a mechanism
for determining the timebase of mtime. The mtime register has a
64-bit precision on all RV32, RV64, and RV128 systems.Different platform may have different implementation of the mtime
block hence an API riscv_get_time() is required by this driver for
platform codes to hide such implementation details. For example,
on some platforms mtime is provided by the CLINT module, while on
some other platforms a simple 'rdtime' can be used to get the timer
counter.With this timer driver the U-Boot timer functionalities like delay
works correctly now.Signed-off-by: Bin Meng
Reviewed-by: Lukas Auer
Reviewed-by: Anup Patel
29 Nov, 2018
1 commit
-
This patch adds clock source and clock event for the timer found
on the Mediatek SoCs.Signed-off-by: Ryder Lee
Tested-by: Matthias Brugger
Reviewed-by: Simon Glass
15 Nov, 2018
3 commits
-
When a driver declares DM_FLAG_PRE_RELOC flag, it wishes to be
bound before relocation. However due to a bug in the DM core,
the flag only takes effect when devices are statically declared
via U_BOOT_DEVICE(). This bug has been fixed recently by commit
"dm: core: Respect drivers with the DM_FLAG_PRE_RELOC flag in
lists_bind_fdt()", but with the fix, it has a side effect that
all existing drivers that declared DM_FLAG_PRE_RELOC flag will
be bound before relocation now. This may expose potential boot
failure on some boards due to insufficient memory during the
pre-relocation stage.To mitigate this potential impact, the following changes are
implemented:- Remove DM_FLAG_PRE_RELOC flag in the driver, if the driver
only supports configuration from device tree (OF_CONTROL)
- Keep DM_FLAG_PRE_RELOC flag in the driver only if the device
is statically declared via U_BOOT_DEVICE()
- Surround DM_FLAG_PRE_RELOC flag with OF_CONTROL check, for
drivers that support both statically declared devices and
configuration from device treeSigned-off-by: Bin Meng
Reviewed-by: Simon Glass -
This is currently out of order. Sort it.
Signed-off-by: Bin Meng
Reviewed-by: Simon Glass -
Currently the comments of several APIs (eg: dm_init_and_scan()) say:
@pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
flag. If false bind all drivers.The 'Pre-Relocation Support' chapter in doc/driver-model/README.txt
documents the same that both device tree properties and driver flag
are supported.However the implementation only checks these special device tree
properties without checking the driver flag at all. This updates
lists_bind_fdt() to consider both scenarios.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass
Squashed in http://patchwork.ozlabs.org/patch/996473/ :
Signed-off-by: Simon Glass
22 Oct, 2018
2 commits
-
So far the TSC timer driver supports trying hardware calibration first
and using device tree as last resort for its running frequency as the
normal timer.However when it is used as the early timer, it only supports hardware
calibration and if it fails, the driver just panics. This introduces
a new config option to specify the early timer frequency in MHz and
it should be equal to the value described in the device tree.Without this patch, the travis-ci testing on QEMU x86_64 target fails
each time after it finishes the 'bootefi selftest' as the test.py see
an error was emitted on the console like this:TSC frequency is ZERO
resetting ...
### ERROR ### Please RESET the board ###It's strange that this error is consistently seen on the travis-ci
machine, but only occasionally seen on my local machine (maybe 1 out
of 10). Since QEMU x86_64 target enables BOOTSTAGE support which uses
early timer, with this fix it should work without any failure.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass -
In initr_bootstage() we call bootstage_mark_name() which ends up calling
timer_get_us(). This call happens before initr_dm(), which inits driver
model.On x86 we set gd->timer to NULL in the transition from board_init_f()
to board_init_r(). See board_init_f_r() for this assignment. So U-Boot
knows there is no timer available in the period immediately after
relocation.On x86 the timer_get_us() call is implemented as calls to get_ticks() and
get_tbclk(). Both of these call dm_timer_init() to set up the timer, if
gd->timer is NULL and the early timer is not available.However dm_timer_init() cannot succeed before initr_dm() is called.
So it seems that on x86 if we want to use CONFIG_BOOTSTAGE we must enable
CONFIG_TIMER_EARLY. Update the Kconfig to handle this.Note: On most architectures we can rely on the pre-relocation memory still
being available, so that gd->timer pointers to a valid timer device and
everything works correctly. Admittedly this is not strictly correct since
the timer device is set up by pre-relocation U-Boot, but normally this is
fine. On x86 the 'CAR' (cache-as-RAM) memory used by pre-relocation U-Boot
disappears in board_init_f_r() and any attempt to access it will hang.
This is the reason why we must mark the timer as invalid when we get to
board_init_f_r().Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
18 Sep, 2018
2 commits
-
Add a timer driver for the MPC83xx architecture.
Signed-off-by: Mario Six
-
Makefile entries should be sorted.
Signed-off-by: Mario Six
11 Sep, 2018
2 commits
-
timer_pre_probe() tries to populate the clock rate from DT. omap
timer driver tries to overwrite this value irrespective of the value
populated fro DT. So update this value only when DT doesn't populate
the clock rate.Signed-off-by: Lokesh Vutla
-
In order to handle counter overflows use 64 bit values for counter.
Also load the initial value during probe.Signed-off-by: Lokesh Vutla
24 Aug, 2018
1 commit
-
Add timer driver for the Designware APB Timer IP. This is present
for example on the Altera SoCFPGA chips.Signed-off-by: Marek Vasut
Cc: Chin Liang See
Cc: Dinh Nguyen
Cc: Ley Foon Tan
20 Aug, 2018
1 commit
-
At present if TSC frequency is provided in the device tree, it takes
precedence over hardware calibration result. This swaps the order to
try hardware calibration first and uses device tree as last resort.This can be helpful when a generic dts (eg: coreboot/efi payload) is
supposed to work on as many hardware as possible, including emulators
like QEMU where TSC hardware calibration sometimes fails.Signed-off-by: Bin Meng
Reviewed-by: Christian Gmeiner
02 Jul, 2018
1 commit
-
With the introduction of early timer support in the TSC driver,
the capability of getting clock rate from device tree was lost
unfortunately. Now we bring such functionality back, but with a
limitation that when TSC is used as early timer, specifying clock
rate from device tree does not work.This fixes random boot failures seen on QEMU targets: printing "TSC
frequency is ZERO" and reset forever.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass
15 Jun, 2018
1 commit
-
This function is required for adding bootstage support.
Also enable it directly for ZynqMP R5 configuration.Signed-off-by: Michal Simek
13 Jun, 2018
1 commit
-
Starting with cpuid level 0x16 (Skylake-based processors)
it is possible to get CPU base freq via cpuid.This fixes booting on a skylake based system.
Signed-off-by: Christian Gmeiner
Reviewed-by: Bin Meng
[bmeng: fixed wrong indention of labels]
Signed-off-by: Bin Meng
31 May, 2018
1 commit
-
Use live-tree functions.
Reported-by: Simon Glass
Signed-off-by: Michal Simek
Reviewed-by: Simon Glass
11 May, 2018
1 commit
-
This driver was tested on Xilinx ZynqMP SoC.
Signed-off-by: Michal Simek
07 May, 2018
1 commit
-
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.Signed-off-by: Tom Rini