Skip to content
Snippets Groups Projects
  1. Feb 05, 2022
  2. Feb 03, 2022
  3. Jan 28, 2022
  4. Jan 25, 2022
    • Patrice Chotard's avatar
      dm: Fix OF_BAD_ADDR definition · 9876ae7d
      Patrice Chotard authored and Simon Glass's avatar Simon Glass committed
      
      When OF_LIVE flag is enabled on a 64 bits platform, there is an
      issue when dev_read_addr() is called and need to perform an address
      translation using __of_translate_address().
      
      In case of error, __of_translate_address() return's value is OF_BAD_ADDR
      (wich is defined in include/dm/of.h to ((u64)-1) = 0xffffffffffffffff).
      The return value of dev_read_addr() is often compared to FDT_ADDR_T_NONE
      which is defined as (-1U) = 0xffffffff.
      In this case the comparison is always false.
      
      To fix this issue, define FDT_ADDR_T_NONE to (ulong)(-1) in case of
      AARCH64. Update accordingly related tests.
      
      Signed-off-by: Patrice Chotard's avatarPatrice Chotard <patrice.chotard@foss.st.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      9876ae7d
    • Simon Glass's avatar
      acpi: Tidy up the table list · 06f6f3d4
      Simon Glass authored
      
      At present this is really just a debugging aid, but it is a bit untidy.
      Add proper columns so it is easier to read.
      
      Sample output for coral:
      
          => acpi list
          Name      Base   Size  Detail
          ----  --------  -----  ------
          RSDP  79925000     24  v02 U-BOOT
          RSDT  79925030     48  v01 U-BOOT U-BOOTBL 20220101 INTL 0
          XSDT  799250e0     6c  v01 U-BOOT U-BOOTBL 20220101 INTL 0
          FACP  79929570     f4  v04 U-BOOT U-BOOTBL 20220101 INTL 1
          DSDT  79925280   32ea  v02 U-BOOT U-BOOTBL 20110725 INTL 20180105
          FACS  79925240     40
          MCFG  79929670     2c  v01 U-BOOT U-BOOTBL 20220101 INTL 0
          SPCR  799296a0     50  v02 U-BOOT U-BOOTBL 20220101 INTL 0
          TPM2  799296f0     4c  v04 U-BOOT U-BOOTBL 20220101 INTL 0
          APIC  79929740     6c  v02 U-BOOT U-BOOTBL 20220101 INTL 0
          SSDT  799297b0   1523  v02 U-BOOT U-BOOTBL 20220101 INTL 1
          NHLT  7992ace0    e60  v05 coral coral 3 INTL 0
          DBG2  7992db40     61  v00 U-BOOT U-BOOTBL 20220101 INTL 0
          HPET  7992dbb0     38  v01 U-BOOT U-BOOTBL 20220101 INTL 0
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      06f6f3d4
    • Simon Glass's avatar
      acpi: Tidy up the item list · a9246416
      Simon Glass authored
      
      At present this is really just a debugging aid, but it is a bit untidy.
      Add proper columns and display the type name instead of a number.
      
      Sample output for coral:
      
         => acpi items
         Seq  Type       Addr  Size  Device/Writer
         ---  -----  --------  ----  -------------
           0  other  79925000    240  0base
           1  other  79925240     40  1facs
           2  dsdt   799252a4     58  board
           3  dsdt   799252fc     10  lpc
           4  other  79925280   32f0  3dsdt
           5  other  79928570   1000  4gnvs
           6  other  79929570    100  5fact
           7  other  79929670     30  5mcfg
           8  other  799296a0     50  5spcr
           9  other  799296f0     50  5tpm2
           a  other  79929740     70  5x86
           b  ssdt   799297d4     fe  maxim-codec
           c  ssdt   799298d2     28  i2c2@16,0
           d  ssdt   799298fa    270  da-codec
           e  ssdt   79929b6a     28  i2c2@16,1
           f  ssdt   79929b92     28  i2c2@16,2
          10  ssdt   79929bba     83  tpm@50
          11  ssdt   79929c3d     28  i2c2@16,3
          12  ssdt   79929c65    282  elan-touchscreen@10
          13  ssdt   79929ee7    285  raydium-touchscreen@39
          14  ssdt   7992a16c     28  i2c2@17,0
          15  ssdt   7992a194     d8  elan-touchpad@15
          16  ssdt   7992a26c    163  synaptics-touchpad@2c
          17  ssdt   7992a3cf     28  i2c2@17,1
          18  ssdt   7992a3f7    111  wacom-digitizer@9
          19  ssdt   7992a508     8f  sdmmc@1b,0
          1a  ssdt   7992a597     4b  wifi
          1b  ssdt   7992a5e2    1a0  cpu@0
          1c  ssdt   7992a782    1a0  cpu@1
          1d  ssdt   7992a922    1a0  cpu@2
          1e  ssdt   7992aac2    211  cpu@3
          1f  other  799297b0   1530  6ssdt
          20  other  7992ace0   2f10  8dev
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      a9246416
    • Simon Glass's avatar
      x86: Move base tables to a writer function · 94ba15a3
      Simon Glass authored
      
      Use the new ACPI writer to write the base tables at the start of the area,
      moving this code from the x86 implementation.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      94ba15a3
    • Simon Glass's avatar
      x86: Use the ACPI table writer · 31c27eb8
      Simon Glass authored
      
      Use the new ACPI writer to write the ACPI tables. At present this is all
      done in one monolithic function. Future work will split this out.
      
      Unfortunately the QFW write_acpi_tables() function conflicts with the
      'writer' version, so disable that for sandbox.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      31c27eb8
    • Simon Glass's avatar
      x86: acpi: Split out context creation from base tables · cc1f8c39
      Simon Glass authored
      
      At present acpi_setup_base_tables() both sets up the ACPI context and
      writes out the base tables.
      
      We want to use an ACPI writer to write the base tables, so split this
      function into two, with acpi_setup_ctx() doing the context set, and
      acpi_setup_base_tables() just doing the base tables.
      
      Disable the writer's write_acpi_tables() function for now, to avoid
      build errors. It is enabled in a following patch.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      cc1f8c39
    • Simon Glass's avatar
      x86: Move the acpi table to generic global_data · 233f0e35
      Simon Glass authored
      
      Allow this to be used on any arch. Also convert to using macros so that
      we can check the CONFIG option in C code.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      233f0e35
  5. Jan 24, 2022
  6. Jan 19, 2022
  7. Jan 14, 2022
    • Alper Nebi Yasak's avatar
      phy: Track power-on and init counts in uclass · 226fce61
      Alper Nebi Yasak authored and Tom Rini's avatar Tom Rini committed
      
      On boards using the RK3399 SoC, the USB OHCI and EHCI controllers share
      the same PHY device instance. While these controllers are being stopped
      they both attempt to power-off and deinitialize it, but trying to
      power-off the deinitialized PHY device results in a hang. This usually
      happens just before booting an OS, and can be explicitly triggered by
      running "usb start; usb stop" in the U-Boot shell.
      
      Implement a uclass-wide counting mechanism for PHY initialization and
      power state change requests, so that we don't power-off/deinitialize a
      PHY instance until all of its users want it done. The Allwinner A10 USB
      PHY driver does this counting in-driver, remove those parts in favour of
      this in-uclass implementation.
      
      The sandbox PHY operations test needs some changes since the uclass will
      no longer call into the drivers for actions matching its tracked state
      (e.g. powering-off a powered-off PHY). Update that test, and add a new
      one which simulates multiple users of a single PHY.
      
      The major complication here is that PHY handles aren't deduplicated per
      instance, so the obvious idea of putting the counts in the PHY handles
      don't immediately work. It seems possible to bind a child udevice per
      PHY instance to the PHY provider and deduplicate the handles in each
      child's uclass-private areas, like in the CLK framework. An alternative
      approach could be to use those bound child udevices themselves as the
      PHY handles. Instead, to avoid the architectural changes those would
      require, this patch solves things by dynamically allocating a list of
      structs (one per instance) in the provider's uclass-private area.
      
      Signed-off-by: default avatarAlper Nebi Yasak <alpernebiyasak@gmail.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Tested-by: Peter Robinson <pbrobinson@gmail.com> - Rock960
      226fce61
    • Patrick Delaunay's avatar
      test: test_lsblk: Mark as sandbox specific · 0a4512b5
      Patrick Delaunay authored and Tom Rini's avatar Tom Rini committed
      
      This test checks for output specific to the sandbox blk device
      "sandbox_host_blk", mark it as sandbox specific.
      
      Signed-off-by: Patrick Delaunay's avatarPatrick Delaunay <patrick.delaunay@foss.st.com>
      0a4512b5
  8. Jan 13, 2022
    • Simon Glass's avatar
      bloblist: Add functions to obtain base address and size · e50a24a0
      Simon Glass authored
      
      Add a few convenience functions to obtain useful information about the
      bloblist.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      e50a24a0
    • Simon Glass's avatar
      bloblist: Use explicit numbering for the tags · f16ec777
      Simon Glass authored
      
      At present if someone adds a tag in the middle of the list it works well
      enough within a U-Boot build. But if these tags are used in another
      project, or with an older version of SPL, the numbers make become
      inconsistent.
      
      Use explicit tag numbers that never change, to resolve this problem.
      Allocate areas for existing U-Boot tags and set up an area for use by
      projects and vendors, as well as for private use. Keep tags above
      0x10000 unallocated for now.
      
      Update bloblist_tag_name() and the tests to work with this new setup.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      f16ec777
    • Simon Glass's avatar
      bloblist: Drop unused tags · f9abc1ca
      Simon Glass authored
      
      The EC event log tag is no-longer used. The vboot handoff is now handled
      by the vboot context instead.
      
      Drop these unused tags.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      f9abc1ca
    • Simon Glass's avatar
      bloblist: Put the magic number first · ff3bd498
      Simon Glass authored
      
      It seems best to put the magic number right at the start of the bloblist
      header, so it is easier to check. This is how devicetree works.
      
      Make this change now, before other projects make use of bloblist. Other
      changes may be needed / discussed, but that is TBD.
      
      Add a checker function as well.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      ff3bd498
  9. Dec 26, 2021
  10. Dec 23, 2021
  11. Dec 09, 2021
  12. Nov 30, 2021
  13. Nov 28, 2021
    • Simon Glass's avatar
      test/py: Raise a ValueError if a command fails · 452e8c90
      Simon Glass authored
      
      At present an Exception is raised if a command fails. This is a very broad
      class and makes it difficult for callers to catch the error without also
      catching other things, like programming bugs.
      
      Change it to ValueError to make this easier.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      452e8c90
    • Simon Glass's avatar
      test/py: Relax the naming rules for unit tests · 689d0a1c
      Simon Glass authored
      
      At present the collection function used by pytest is quite strict on the
      naming of the functions it detects. In particular it requires the name of
      the test to be repeated in the function name.
      
      This is not enforced anywhere else, but instead the tests are silently
      omitted from the pytest run. This affects a few dozen tests.
      
      The rule does not seem to have any particular purpose. Relax it, so that
      all tests that use the UNIT_TEST() macro will run, regardless of the name
      of the test function.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      689d0a1c
    • Simon Glass's avatar
      dm: core: Add a way to obtain a string list · 075bfc95
      Simon Glass authored
      
      At present we support reading a string list a string at a time. Apart
      from being inefficient, this makes it impossible to separate reading of
      the devicetree into the of_to_plat() method where it belongs, since any
      code which needs access to the string must read it from the devicetree.
      
      Add a function which returns the string property as an array of pointers
      to the strings, which is easily used by clients.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      075bfc95
    • Simon Glass's avatar
      dm: core: Add tests for stringlist functions · fb933d07
      Simon Glass authored
      
      These functions currently lack tests so add some. The error handling
      differs betwee livetree and flattree at present, so only check the error
      codes with livetree.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      fb933d07
    • Simon Glass's avatar
      test/py: Allow passing input to a program · 15156c95
      Simon Glass authored
      
      When running a program on the host, allow input to be passed in as stdin.
      This is needed for running sfdisk, for example.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      15156c95
  14. Nov 26, 2021
  15. Nov 20, 2021
Loading