1. 25 5月, 2021 3 次提交
  2. 14 5月, 2021 1 次提交
  3. 20 4月, 2021 2 次提交
  4. 15 4月, 2021 1 次提交
    • C
      sandbox: Add a DSA sandbox driver and unit test · ff98da06
      Claudiu Manoil 提交于
      The DSA sandbox driver is used for unit testing the DSA class code.
      It implements a simple 2 port switch plus 1 CPU port, and uses a
      very simple tag to identify the ports.
      
      The DSA sandbox device is connected via CPU port to a regular Ethernet
      sandbox device, called 'dsa-test-eth, managed by the existing eth
      sandbox driver.  The 'dsa-test-eth' is not intended for testing the
      eth class code however, but it is used to emulate traffic through the
      'lan0' and 'lan1' front pannel switch ports.  To achieve this the dsa
      sandbox driver registers a tx handler for the 'dsa-test-eth' device.
      The switch ports, labeled as 'lan0' and 'lan1', are also registered
      as eth devices by the dsa class code this time.  So pinging through
      these switch ports is as easy as:
      
      => setenv ethact lan0
      => ping 1.2.3.5
      
      Unit tests for the dsa class code were also added.  The 'dsa_probe'
      test exercises most API functions from dsa.h.  The 'dsa' unit test
      simply exercises ARP/ICMP traffic through the two switch ports,
      including tag injection and extraction, with the help of the dsa
      sandbox driver.
      
      I took care to minimize the impact on the existing eth unit tests,
      though some adjustments needed to be made with the addition of
      extra eth interfaces used by the dsa unit tests. The additional eth
      interfaces also require MAC addresses, these have been added to the
      sandbox default environment.
      Signed-off-by: NAlex Marginean <alexandru.marginean@nxp.com>
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Reviewed-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Message-Id: <20210216224804.3355044-5-olteanv@gmail.com>
      Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NPriyanka Jain <priyanka.jain@nxp.com>
      ff98da06
  5. 14 3月, 2021 1 次提交
  6. 19 12月, 2020 1 次提交
    • S
      linker_lists: Fix alignment issue · 0b2fa98a
      Simon Glass 提交于
      The linker script uses alphabetic sorting to group the different linker
      lists together. Each group has its own struct and potentially its own
      alignment. But when the linker packs the structs together it cannot ensure
      that a linker list starts on the expected alignment boundary.
      
      For example, if the first list has a struct size of 8 and we place 3 of
      them in the image, that means that the next struct will start at offset
      0x18 from the start of the linker_list section. If the next struct has
      a size of 16 then it will start at an 8-byte aligned offset, but not a
      16-byte aligned offset.
      
      With sandbox on x86_64, a reference to a linker list item using
      ll_entry_get() can force alignment of that particular linker_list item,
      if it is in the same file as the linker_list item is declared.
      
      Consider this example, where struct driver is 0x80 bytes:
      
      	ll_entry_declare(struct driver, fred, driver)
      
      ...
      
      	void *p = ll_entry_get(struct driver, fred, driver)
      
      If these two lines of code are in the same file, then the entry is forced
      to be aligned at the 'struct driver' alignment, which is 16 bytes. If the
      second line of code is in a different file, then no action is taken, since
      the compiler cannot update the alignment of the linker_list item.
      
      In the first case, an 8-byte 'fill' region is added:
      
       .u_boot_list_2_driver_2_testbus_drv
                      0x0000000000270018       0x80 test/built-in.o
                      0x0000000000270018                _u_boot_list_2_driver_2_testbus_drv
       .u_boot_list_2_driver_2_testfdt1_drv
                      0x0000000000270098       0x80 test/built-in.o
                      0x0000000000270098                _u_boot_list_2_driver_2_testfdt1_drv
       *fill*         0x0000000000270118        0x8
       .u_boot_list_2_driver_2_testfdt_drv
                      0x0000000000270120       0x80 test/built-in.o
                      0x0000000000270120                _u_boot_list_2_driver_2_testfdt_drv
       .u_boot_list_2_driver_2_testprobe_drv
                      0x00000000002701a0       0x80 test/built-in.o
                      0x00000000002701a0                _u_boot_list_2_driver_2_testprobe_drv
      
      With this, the linker_list no-longer works since items after testfdt1_drv
      are not at the expected address.
      
      Ideally we would have a way to tell gcc not to align structs in this way.
      It is not clear how we could do this, and in any case it would require us
      to adjust every struct used by the linker_list feature.
      
      One possible fix is to force each separate linker_list to start on the
      largest possible boundary that can be required by the compiler. However
      that does not seem to work on x86_64, which uses 16-byte alignment in this
      case but needs 32-byte alignment.
      
      So add a Kconfig option to handle this. Set the default value to 4 so
      as to avoid changing platforms that don't need it.
      
      Update the ll_entry_start() accordingly.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      0b2fa98a
  7. 13 12月, 2020 1 次提交
  8. 05 12月, 2020 2 次提交
    • S
      bootm: Support string substitution in bootargs · 51bb3384
      Simon Glass 提交于
      In some cases it is necessary to pass parameters to Linux so that it will
      boot correctly. For example, the rootdev parameter is often used to
      specify the root device. However the root device may change depending on
      whence U-Boot loads the kernel. At present it is necessary to build up
      the command line by adding device strings to it one by one.
      
      It is often more convenient to provide a template for bootargs, with
      U-Boot doing the substitution from other environment variables.
      
      Add a way to substitute strings in the bootargs variable. This allows
      things like "rootdev=${rootdev}" to be used in bootargs, with the
      ${rootdev} substitution providing the UUID of the root device.
      
      For example, to substitute the GUID of the kernel partition:
      
        setenv bootargs "console=/dev/ttyS0 rootdev=${uuid}/PARTNROFF=1
      		kern_guid=${uuid}"
        part uuid mmc 2:2 uuid
        bootm
      
      This is particularly useful when the command line from another place. For
      example, Chrome OS stores the command line next to the kernel itself. It
      depends on the kernel version being used as well as the hardware features,
      so it is extremely difficult to devise a U-Boot script that works on all
      boards and kernel versions. With this feature, the command line can be
      read from disk and used directly, with a few substitutions set up.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      51bb3384
    • S
      bootm: Add tests for fixup_silent_linux() · f158ba15
      Simon Glass 提交于
      This function currently has no tests. Export it so that we can implement
      a simple test on sandbox. Use IS_ENABLED() to remove the unused code,
      instead #ifdef.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      f158ba15
  9. 06 11月, 2020 2 次提交
  10. 04 11月, 2020 1 次提交
  11. 27 8月, 2020 1 次提交
  12. 07 8月, 2020 1 次提交
  13. 05 8月, 2020 1 次提交
    • J
      cmd: add clone command · 4a4830cf
      John Chau 提交于
      This patch adds a feature for block device cloning similar to dd
      command, this should be useful for boot-strapping a device where
      usb gadget or networking is not available. For instance one can
      clone a factory image into a blank emmc from an external sd card.
      Signed-off-by: NJohn Chau <john@harmon.hk>
      4a4830cf
  14. 29 7月, 2020 1 次提交
    • S
      x86: Change how selection of ROMs works · bcd4e6f3
      Simon Glass 提交于
      Most x86 boards build a u-boot.rom which is programmed into SPI flash. But
      this is not unique to x86. For example some rockchip boards can also boot
      from SPI flash.
      
      Also, at least on x86, binary blobs are sadly quite common. It is not
      possible to build a functional image without them, and U-Boot needs to
      know this at build time.
      
      Introduce a new CONFIG_HAS_ROM option which selects whether u-boot.rom is
      built and a new CONFIG_ROM_NEEDS_BLOBS option to indicate whether binary
      blobs are also needed. If they are not needed, it is safe to build the ROM
      always. Otherwise we still require the BUILD_ROM environment variable.
      
      For now this affects only x86, but future patches will enable this for
      rockchip too.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      bcd4e6f3
  15. 17 7月, 2020 1 次提交
  16. 25 5月, 2020 1 次提交
  17. 16 4月, 2020 1 次提交
  18. 15 12月, 2019 4 次提交
  19. 02 9月, 2019 1 次提交
  20. 26 8月, 2019 1 次提交
  21. 19 8月, 2019 1 次提交
  22. 19 7月, 2019 1 次提交
  23. 16 7月, 2019 1 次提交
  24. 11 7月, 2019 1 次提交
  25. 13 6月, 2019 1 次提交
  26. 24 5月, 2019 1 次提交
  27. 08 5月, 2019 3 次提交
  28. 05 5月, 2019 1 次提交
    • V
      arch: armv8: Provide a way to disable cache maintenance ops · add49671
      Vignesh Raghavendra 提交于
      On AM654 SoC(arm64) which is IO coherent and has L3 Cache, cache
      maintenance operations being done to support non-coherent platforms
      causes issues.
      
      For example, here is how U-Boot prepares/handles a buffer to receive
      data from a device (DMA Write). This may vary slightly depending on the
      driver framework:
      
      	Start DMA to write to destination buffer
      	Wait for DMA to be done (dma_receive()/dma_memcpy())
      	Invalidate destination buffer (invalidate_dcache_range())
      	Read from destination buffer
      
      The invalidate after the DMA is needed in order to read latest data from
      memory that’s updated by DMA write. Also, in case random prefetch has
      pulled in buffer data during the “wait for DMA” before the DMA has
      written to it. This works well for non-coherent architectures.
      
      In case of coherent architecture with L3 cache, DMA write would directly
      update L3 cache contents (assuming cacheline is present in L3) without
      updating the DDR memory. So invalidate after “wait for DMA” in above
      sequence would discard latest data and read will cause stale data to be
      fetched from DDR. Therefore invalidate after “wait for DMA” is not
      always correct on coherent architecture.
      
      Therefore, provide a Kconfig option to disable cache maintenance ops on
      coherent architectures. This has added benefit of improving the
      performance of DMA transfers as we no longer need to invalidate/flush
      individual cache lines(especially for buffer thats several KBs in size).
      
      In order to facilitate use of same Kconfig across different
      architecture, I have added the symbol to top level arch/Kconfig file.
      Patch currently disables cache maintenance ops for arm64 only.
      flush_dcache_all() and invalidate_dcache_all() are exclusively used
      during enabling/disabling dcache and hence are not disabled.
      Signed-off-by: NVignesh Raghavendra <vigneshr@ti.com>
      add49671
  29. 27 2月, 2019 1 次提交
  30. 20 2月, 2019 1 次提交