12 Feb, 2019

1 commit


15 Nov, 2018

1 commit

  • 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 tree

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     

22 Oct, 2018

1 commit

  • 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

    Bin Meng
     

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

    Bin Meng
     

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

    Bin Meng
     

13 Jun, 2018

1 commit


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

    Tom Rini
     

16 Sep, 2017

2 commits

  • With bootstage we need access to the timer before driver model is set up.
    To handle this, put the required state in global_data and provide a new
    function to set up the device, separate from the driver's probe() method.

    This will be used by the 'early' timer also.

    Signed-off-by: Simon Glass
    Reviewed-by: Bin Meng

    Simon Glass
     
  • Per the Intel 64 and IA-32 Architecture Software Developer's Manual,
    add the reference clock for Intel Atom Processors based on the Airmont
    Microarchitecture (Braswell).

    This keeps in sync with Linux kernel commit:
    6fcb41c: x86/tsc_msr: Add Airmont reference clock values

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     

01 Aug, 2017

6 commits

  • Rename try_msr_calibrate_tsc() to cpu_mhz_from_msr(), as that
    better describes what the routine does.

    This keeps in sync with Linux kernel commit:
    02c0cd2: x86/tsc_msr: Remove irqoff around MSR-based TSC enumeration

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • Atom processors use a 19.2 MHz crystal oscillator.

    Early processors generate 100 MHz via 19.2 MHz * 26 / 5 = 99.84 MHz.

    Later processors generate 100 MHz via 19.2 MHz * 125 / 24 = 100 MHz.

    Update the Silvermont-based tables accordingly, matching the Software
    Developers Manual.

    Also, correct a 166 MHz entry that should have been 116 MHz, and add
    a missing 80 MHz entry for VLV2.

    This keeps in sync with Linux kernel commit:
    05680e7: x86/tsc_msr: Correct Silvermont reference clock values

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • Some processor abbreviations in the comments of freq_desc_tables[]
    are obscure. This updates part of these to mention processors
    that are known to us. Also expand frequency definitions.

    This keeps in sync with Linux kernel commit:
    9e0cae9: x86/tsc_msr: Update comments, expand definitions

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • If either ratio or freq is zero, the return value is zero. There
    is no need to create a fail branch and return zero there.

    This keeps in sync with Linux kernel commit:
    14bb4e3: x86/tsc_msr: Remove debugging messages

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • try_msr_calibrate_tsc() is currently Intel-specific, and should not
    execute on any other vendor's parts.

    This keeps in sync with Linux kernel commit:
    ba82683: x86/tsc_msr: Identify Intel-specific code

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     
  • Currently we read the tsc radio like this:

    ratio = (MSR_PLATFORM_INFO >> 8) & 0x1f;

    Thus we get bit 8-12 of MSR_PLATFORM_INFO, however according to the
    Intel manual, the ratio bits are bit 8-15.

    Fix this problem by masking 0xff instead.

    This keeps in sync with Linux kernel commit:
    886123f: x86/tsc: Read all ratio bits from MSR_PLATFORM_INFO

    Signed-off-by: Bin Meng
    Reviewed-by: Simon Glass

    Bin Meng
     

09 Dec, 2015

1 commit

  • Right now i8254_init() is called from timer_init() in the tsc timer
    driver. But actually i8254 and tsc are completely different things.
    Since tsc timer has been converted to driver model, we should find
    a new place that is appropriate for U-Boot to call i8254_init(),
    which is now x86_cpu_init_f().

    Signed-off-by: Bin Meng
    Acked-by: Simon Glass

    Bin Meng
     

01 Dec, 2015

1 commit