1. 08 6月, 2021 13 次提交
    • S
      sandbox: log: Avoid build error with !CONFIG_LOG · 8d9bb98f
      Simon Glass 提交于
      The pr_cont_test.c test requires CONFIG_LOG since it directly accesses
      fields in global_data that require it. Move the test into the CONFIG_LOG
      condition to avoid build errors.
      
      Enable CONFIG_LOG on sandbox (not sandbox_spl, etc.) so that we still run
      this test. This requires resyncing of the configs.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      8d9bb98f
    • S
      log: Add support for logging a buffer · 58b4b713
      Simon Glass 提交于
      The print_buffer() function is very useful for debugging. Add a version
      of this in the log system also.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      58b4b713
    • S
      display_options: Split print_buffer() into two functions · 0cceb99a
      Simon Glass 提交于
      At present print_buffer() outputs a hex dump but it is not possible to
      place this dump in a string. Refactor it into a top-level function which
      does the printing and a utility function that dumps a line into a string.
      This makes the code more generally useful.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      0cceb99a
    • S
      hexdump: Allow ctrl-c to interrupt output · 735dd6ef
      Simon Glass 提交于
      If a long hexdump is initated the user may wish to interrupt it. Add
      support for this.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      735dd6ef
    • S
      hexdump: Support any rowsize · 5d6d2b88
      Simon Glass 提交于
      At present print_hex_dump() only supports either 16- or 32-byte lines.
      With U-Boot we want to support any line length up to a maximum of 64.
      Update the function to support this, with 0 defaulting to 16, as with
      print_buffer().
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      5d6d2b88
    • S
      hexdump: Add support for sandbox · 19edf139
      Simon Glass 提交于
      The current implementation outputs an address as a pointer. Update the
      code to use an address instead, respecting the 32/64 nature of the CPU.
      
      Add some initial tests copied from print_test_display_buffer(), just the
      ones that can pass with the current implementation.
      
      Note that for this case print_hex_dump() and print_bufffer() produce the
      same result. For now the tests are duplicated sine we have separate
      functions.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      19edf139
    • S
      hexdump: Move API to header file · 2f410fe5
      Simon Glass 提交于
      Move the comments to the header file so people can find the function info
      without digging in the implementation. Fix up the code style and add an
      enum for the first arg.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      2f410fe5
    • S
      display_options: Drop two spaces before the ASCII column · c7b16d83
      Simon Glass 提交于
      At present with print_buffer() U-Boot shows four spaces between the hex
      and ASCII data. Two seems enough and matches print_hex_dump(). Change it.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      c7b16d83
    • S
      test: Add a test for print_buffer() · c614ddf2
      Simon Glass 提交于
      Add a test for this function, to cover the various features. Expand the
      expect_str length to take acount of the ~300-bytes lines generated in one
      case.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      c614ddf2
    • S
      test: Convert print tests to use ut framework · fbb99dce
      Simon Glass 提交于
      This test predates the test framework in U-Boot. It uses #define DEBUG and
      assert() to check the result. Update it to use the framework so it can
      report failure constitent with other tests.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      fbb99dce
    • S
      test: Detect when expect_str is too small · 090d664e
      Simon Glass 提交于
      If a line of more than 256 bytes is generated, the test will fail but the
      reason is not clear. Add a check for this condition and print a helpful
      message.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      090d664e
    • S
      console: Report an error when output buffer is exhausted · c1a2bb4f
      Simon Glass 提交于
      If the console output buffer is exhausted, characters are silently dropped
      from the end. Detect this condition and report an error when reading back
      the characters.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      c1a2bb4f
    • T
      Merge branch '2021-06-07-arm-cache-cp15-improvements' into next · 24e1e884
      Tom Rini 提交于
      To quote the series author, Patrick Delaunay:
      
      On STM32MP15x platform we can use OP-TEE, loaded in DDR in a region
      protected by a firewall. This region is reserved in the device with
      the "no-map" property as defined in the binding file
      doc/device-tree-bindings/reserved-memory/reserved-memory.txt.
      
      Sometime the platform boot failed in U-Boot on a Cortex A7 access to
      this region (depending of the binary and the issue can change with compiler
      version or with code alignment), then the firewall raise an error,
      for example:
      
      E/TC:0   tzc_it_handler:19 TZC permission failure
      E/TC:0   dump_fail_filter:420 Permission violation on filter 0
      E/TC:0   dump_fail_filter:425 Violation @0xde5c6bf0, non-secure privileged read,
               AXI ID 5c0
      E/TC:0   Panic
      
      After investigation, the forbidden access is a speculative request performed
      by the Cortex A7 because all the DDR is mapped as MEMORY with CACHEABLE
      property.
      
      The issue is solved only when the region reserved by OP-TEE is no more
      mapped in U-Boot as it is already done in Linux kernel.
      
      Tested on DK2 board with OP-TEE 3.12 / TF-A 2.4:
      
      With hard-coded address for OP-TEE reserved memory,
      the error doesn't occur.
      
       void dram_bank_mmu_setup(int bank)
       {
       ....
      
          	for (i = start >> MMU_SECTION_SHIFT;
       	     i < (start >> MMU_SECTION_SHIFT) + (size >> MMU_SECTION_SHIFT);
       	     i++) {
       		option = DCACHE_DEFAULT_OPTION;
       		if (i >= 0xde0)
       			option = INVALID_ENTRY;
       		set_section_dcache(i, option);
       	}
       }
      
      Just by modifying the test on 0xde0 to 0xdf0, the OP-TEE memory protected
      by firewall is mapped cacheable and the error occurs.
      
      I think that it can be a general issue for ARM architecture: the "no-map" tag
      of reserved memory in device should be respected by U-Boot if firewall
      is configured before U-Boot execution.
      
      But I don't propose a generic solution in
      arm/lib/cache-cp15.c:dram_bank_mmu_setup()
      because the device tree parsing done in lmb_init_and_reserve() takes a
      long time when it is executed without data cache.
      24e1e884
  2. 07 6月, 2021 11 次提交
  3. 05 6月, 2021 12 次提交
  4. 04 6月, 2021 4 次提交