1. 15 12月, 2019 18 次提交
    • S
      x86: power: Add an ACPI PMC uclass · 6c6d88e1
      Simon Glass 提交于
      Intel x86 SoCs have a power manager/controller which handles several
      power-related aspects of the platform. Add a uclass for this, with a few
      useful operations.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      6c6d88e1
    • S
      x86: Drop unnecessary interrupt code for TPL · 76ab9f27
      Simon Glass 提交于
      We don't expect an exception in TPL and don't need to set up interrupts in
      TPL. Drop this whole file.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      76ab9f27
    • S
      x86: Drop unnecessary cpu code for TPL · caca13f6
      Simon Glass 提交于
      We don't need to know every detail about the CPU in TPL. Drop some
      superfluous functions to reduce code size. Add a simple CPU detection
      algorithm which just supports Intel and AMD, since we only support TPL
      on Intel, so far.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      caca13f6
    • S
      x86: timer: Reduce timer code size in TPL on Intel CPUs · 642e8487
      Simon Glass 提交于
      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 as
      
         39146a2e0b x86: Move CPU init to before spl_init()
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      642e8487
    • S
      x86: timer: use a timer base of 0 · 77dd7c68
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      77dd7c68
    • S
      board_r: Move early-timer init later · dd0edcb2
      Simon Glass 提交于
      At present the early timer init happens as soon as driver model is set up.
      This makes it impossible to do anything that needs driver model but must
      run before devices are probed (as needed with Intel's FSP-S, for example).
      
      In any case it is not a good idea to tie probing of particular drivers too
      closely to the DM init.
      
      Create a new function to init the timer and put it a bit later in the
      sequence.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      dd0edcb2
    • S
      dm: pinctrl: Allow enabling full pinctrl in SPL/TPL · 8aeafb54
      Simon Glass 提交于
      At present these options cannot be enabled for SPL/TPL, but this can be
      useful in some cases. Add Kconfig options to allow it.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      8aeafb54
    • S
      fdt: Show the preprocessed .dts file on error · 1653b6a4
      Simon Glass 提交于
      When device-tree compilation fails it is sometimes tricky to see which
      line is broken, since the input file to dtc is a pre-processed version
      of the device tree.
      
      Add a line that points to the file that needs to be checked:
      
      When the error is in the main .dts file, output is something like this:
      
         output: 'Error: arch/x86/dts/.chromebook_coral.dtb.pre.tmp:478.46-47
      	syntax error
         FATAL ERROR: Unable to parse input tree
      
      but in fact looking at that file shows nothing useful:
      
         PAD_CFG_NF_IOSSTATE_IOSTERM(GPIO_157, UP_20K, DEEP, NF1, HIZCRX1, DISPUPD)
      
      Instead we need to look at the preprocessed file, which shows:
      
         163 ((1U << 30) | (1 << 10)) ((0xb << 10) | PAD_CFG1_IOSSTATE_HIZCRX1)
      
      Here it is clear that PAD_CFG1_IOSSTATE_HIZCRX1 is not defined and so is
      not being resolved by the preprocessor.
      
      This commit adds an additional useful message:
      
         Check arch/x86/dts/.chromebook_coral.dtb.dts.tmp for errors
      
      Note that if the error is reported in an included file, such as
      u-boot.dtsi then the output is the following:
      
         Error: arch/x86/dts/u-boot.dtsi:137.14-15 syntax error
         FATAL ERROR: Unable to parse input tree
      
      But again, if the error is due to a preprocessor failure, like this:
      
         filename = CONFIG_IFW_INPUT_FILE;
      
      then you can't tell what the problem is by looking at the source. All you
      see is the original code:
      
      	intel-ifwi {
      		filename = CONFIG_IFW_INPUT_FILE;
      		...
      		};
      	};
      	intel-fsp-m {
      		filename = CONFIG_FSP_FILE_M;
      	};
      
      Everything looks fine. But looking at the output of the preprocessor:
      
       intel-ifwi {
        filename = CONFIG_IFW_INPUT_FILE;
        ...
       };
       intel-fsp-m {
        filename = "fsp_m.bin";
       };
      
      This shows that the filename (normally "fitimage.bin") has not been
      inserted the preprocess, leading to the realisation that the value should
      be CONFIG_IFWI_INPUT_FILE.
      
      If the above does not make sense, I encourage people to try introducing
      errors in the device tree preprocessed values.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      1653b6a4
    • S
      x86: spi: Add helper functions for Intel Fast SPI · d496162c
      Simon Glass 提交于
      Most x86 CPUs use a mechanism where the SPI flash is mapped into the very
      top of 32-bit address space, so that it can be executed in place and read
      simply by copying from memory. For an 8MB ROM the mapping starts at
      0xff800000.
      
      However some recent Intel CPUs do not use a simple 1:1 memory map. Instead
      the map starts at a different address and not all of the SPI flash is
      accessible through the map. This 'Fast SPI' feature requires that U-Boot
      check the location of the map. It is also possible (optionally) to read
      from the SPI flash using a driver.
      
      Add support for booting from Fast SPI. The memory-mapped version is used
      by both TPL and SPL on Apollo Lake.
      
      In respect of a SPI flash driver, the actual SPI driver is ich.c - this
      just adds a few helper functions and definitions.
      
      This is used by Apollo Lake.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      d496162c
    • S
      i2c: designware: Support use in SPL · fa11fe1b
      Simon Glass 提交于
      Allow this driver to set up an IO address in SPL using an 'early-regs'
      property. This allows SPL to use the I2C driver without having to enable
      the full PCI stack.
      
      Also split out ofdata_to_platdata in designware driver since this is more
      correct, and more convenient for the new logic.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      fa11fe1b
    • S
      i2c: designware: Avoid using static data · 8d72d5bf
      Simon Glass 提交于
      Drivers are not allowed to use static data since they may be used in SPL
      where BSS is not available.
      
      It is possible that driver model may provide support for numbering devices
      in the future. But for now, move this to global_data.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      8d72d5bf
    • S
      i2c: designware: Tidy up PCI support · 457df233
      Simon Glass 提交于
      This is hacked into the driver at present. It seems better to have it as
      a separate driver that uses the base driver. Create a new file and put
      the X86 code into it.
      
      Actually the Baytrail settings should really come from the device tree.
      
      Note that 'has_max_speed' is added as well. This is currently always false
      but since only Baytrail provides the config, it does not affect operation
      for other devices.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NHeiko Schocher <hs@denx.de>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      457df233
    • S
      net: Move the checksum functions to lib/ · d721001f
      Simon Glass 提交于
      These functions are used by code outside the network support, so move them
      to lib/ to be more accessible.
      
      Without this, the functions are only accessible in SPL/TPL only if
      CONFIG_SPL/TPL_NET are defined. Many boards do not enable those option but
      still want to do checksums in this format.
      
      Fix up a few code-style nits while we are here.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      d721001f
    • S
      dm: pci: Move pci_get_devfn() into a common file · 6dd4b014
      Simon Glass 提交于
      Early in boot it is necessary to decode the PCI device/function values for
      particular peripherals in the device tree or of-platdata. This is needed
      in TPL where CONFIG_PCI is not defined.
      
      To handle this, move pci_get_devfn() into a file that is built even when
      CONFIG_PCI is not defined.
      
      Also add a function for use by of-platdata, to convert a reg property to
      a pci_dev_t.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      6dd4b014
    • S
      dm: pci: Allow delaying auto-config until after relocation · 2206ac24
      Simon Glass 提交于
      At present PCI auto-configuration happens in U-Boot both before and after
      relocation. This is a waste of time and may mess up static addresses used
      in board_init_f(). Adjust the code to supporting doing auto-configuration
      once, after relocation, under control of a device-tree property.
      
      This is needed for Apollo Lake for debugging the silicon-init code. Once
      the UART is moved to a different MMIO address the debug UART does not work
      and any debug output in Apollo Lake's arch_fsp_init_r() causes a hang.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      2206ac24
    • S
      dm: core: Fix offset_to_ofnode() with invalid offset · b14c5339
      Simon Glass 提交于
      If the offset is -1 this function correctly sets up a null ofnode. But if
      the offset is any other negative number (e.g. -FDT_ERR_BADPATH) then it
      does the wrong thing.
      
      An offset of -1 in ofnode indicates that the ofnode is not valid. Any
      other negative value is not handled by ofnode_valid(). We could of course
      change that function, but it seems much better to always use the same
      value for an invalid node.
      
      Fix it by setting the offset to -1 if it is invalid for any reason.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      b14c5339
    • S
      dm: gpio: Allow control of GPIO uclass in SPL · bcee8d67
      Simon Glass 提交于
      At present if CONFIG_SPL_GPIO_SUPPORT is enabled then the GPIO uclass
      is included in SPL/TPL without any control for boards. Some boards may
      want to disable this to reduce code size where GPIOs are not needed in
      SPL or TPL.
      
      Add a new Kconfig option to permit this. Default it to 'y' so that
      existing boards work correctly.
      
      Change existing uses of CONFIG_DM_GPIO to CONFIG_IS_ENABLED(DM_GPIO) to
      preserve the current behaviour. Also update the 74x164 GPIO driver since
      it cannot build with SPL.
      
      This allows us to remove the hacks in config_uncmd_spl.h and
      Makefile.uncmd_spl (eventually those files should be removed).
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      bcee8d67
    • S
      binman: Add a library to access binman entries · 3c10dc95
      Simon Glass 提交于
      SPL and TPL can access information about binman entries using link-time
      symbols but this is not available in U-Boot proper. Of course it could be
      made available, but the intention is to just read the device tree.
      
      Add support for this, so that U-Boot can locate entries.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      3c10dc95
  2. 12 12月, 2019 1 次提交
  3. 11 12月, 2019 14 次提交
  4. 10 12月, 2019 7 次提交