1. 01 Apr, 2019 1 commit
  2. 25 Jan, 2019 1 commit
  3. 04 Jan, 2019 1 commit
    • Antonio Nino Diaz's avatar
      Sanitise includes across codebase · 09d40e0e
      Antonio Nino Diaz authored
      Enforce full include path for includes. Deprecate old paths.
      
      The following folders inside include/lib have been left unchanged:
      
      - include/lib/cpus/${ARCH}
      - include/lib/el3_runtime/${ARCH}
      
      The reason for this change is that having a global namespace for
      includes isn't a good idea. It defeats one of the advantages of having
      folders and it introduces problems that are sometimes subtle (because
      you may not know the header you are actually including if there are two
      of them).
      
      For example, this patch had to be created because two headers were
      called the same way: e0ea0928 ("Fix gpio includes of mt8173 platform
      to avoid collision."). More recently, this patch has had similar
      problems: 46f9b2c3 ("drivers: add tzc380 support").
      
      This problem was introduced in commit 4ecca339
      
       ("Move include and
      source files to logical locations"). At that time, there weren't too
      many headers so it wasn't a real issue. However, time has shown that
      this creates problems.
      
      Platforms that want to preserve the way they include headers may add the
      removed paths to PLAT_INCLUDES, but this is discouraged.
      
      Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      09d40e0e
  4. 07 Dec, 2018 3 commits
    • Julius Werner's avatar
      drivers/console: Reimplement MUTLI_CONSOLE_API framework in C · 91b48c9f
      Julius Werner authored
      
      
      Now that we have switched to using the stack in MULTI_CONSOLE_API
      framework functions and have factored all code involved in crash
      reporting out into a separate file, there's really no reason to keep the
      main framework code in assembly anymore. This patch rewrites it in C
      which allows us to have a single implementation across aarch32/64 and
      should be much easier to maintain going forward.
      
      Change-Id: I6c85a01e89a79e8b233f3f8bee812f0dbd026221
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      91b48c9f
    • Julius Werner's avatar
      drivers/console: Link console framework code by default · 985ee0b7
      Julius Werner authored
      
      
      This patch makes the build system link the console framework code by
      default, like it already does with other common libraries (e.g. cache
      helpers). This should not make a difference in practice since TF is
      linked with --gc-sections, so the linker will garbage collect all
      functions and data that are not referenced by any other code. Thus, if a
      platform doesn't want to include console code for size reasons and
      doesn't make any references to console functions, the code will not be
      included in the final binary.
      
      To avoid compatibility issues with older platform ports, only make this
      change for the MULTI_CONSOLE_API.
      
      Change-Id: I153a9dbe680d57aadb860d1c829759ba701130d3
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      985ee0b7
    • Julius Werner's avatar
      plat/common/crash_console_helpers.S: Fix MULTI_CONSOLE_API support · 63c52d00
      Julius Werner authored
      Crash reporting via the default consoles registered by MULTI_CONSOLE_API
      has been broken since commit d35cc347
      
       (Console: Use callee-saved
      registers), which was introduced to allow console drivers written in C.
      It's not really possible with the current crash reporting framework to
      support console drivers in C, however we should make sure that the
      existing assembly drivers that do support crash reporting continue to
      work through the MULTI_CONSOLE_API.
      
      This patch fixes the problem by creating custom console_putc() and
      console_flush() implementations for the crash reporting case that do not
      use the stack. Platforms that want to use this feature will have to link
      plat/common/aarch64/crash_console_helpers.S explicitly.
      
      Also update the documentation to better reflect the new reality (of this
      being an option rather than the expected default for most platforms).
      
      Change-Id: Id0c761e5e2fddaf25c277bc7b8ab603946ca73cb
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      63c52d00
  5. 19 Oct, 2018 1 commit
    • Soby Mathew's avatar
      Multi-console: Deprecate the `finish_console_register` macro · cc5859ca
      Soby Mathew authored
      
      
      The `finish_console_register` macro is used by the multi console
      framework to register the `console_t` driver callbacks. It relied
      on weak references to the `ldr` instruction to populate 0 to the
      callback in case the driver has not defined the appropriate
      function. Use of `ldr` instruction to load absolute address to a
      reference makes the binary position dependant. These instructions
      should be replaced with adrp/adr instruction for position independant
      executable(PIE). But adrp/adr instructions don't work well with weak
      references as described in GNU ld bugzilla issue 22589.
      
      This patch defines a new version of `finish_console_register` macro
      which can spcify which driver callbacks are valid and deprecates the
      old one. If any of the argument is not specified, then the macro
      populates 0 for that callback. Hence the functionality of the previous
      deprecated macro is preserved. The USE_FINISH_CONSOLE_REG_2 define
      is used to select the new variant of the macro and will be removed
      once the deprecated variant is removed.
      
      All the upstream console drivers have been migrated to use the new
      macro in this patch.
      
      NOTE: Platforms be aware that the new variant of the
      `finish_console_register` should be used and the old variant is
      deprecated.
      
      Change-Id: Ia6a67aaf2aa3ba93932992d683587bbd0ad25259
      Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
      cc5859ca
  6. 28 Sep, 2018 1 commit
  7. 21 Sep, 2018 1 commit
  8. 15 Aug, 2018 1 commit
  9. 17 May, 2018 1 commit
    • Daniel Boulby's avatar
      Ensure read and write of flags are 32 bit · 8abcdf92
      Daniel Boulby authored
      
      
      In 'console_set_scope' and when registering a console, field 'flags' of
      'console_t' is assigned a 32-bit value. However, when it is actually
      used, the functions perform 64-bit reads to access its value. This patch
      changes all 64-bit reads to 32-bit reads.
      
      Change-Id: I181349371409e60065335f078857946fa3c32dc1
      Signed-off-by: default avatarDaniel Boulby <daniel.boulby@arm.com>
      8abcdf92
  10. 11 May, 2018 1 commit
    • Antonio Nino Diaz's avatar
      multi console: Assert that consoles aren't registered twice · c2e05bb7
      Antonio Nino Diaz authored
      
      
      In the multi console driver, allowing to register the same console more
      than once may result in an infinte loop when putc is called.
      
      If, for example, a boot message is trying to be printed, but the
      consoles in the loop in the linked list are runtime consoles, putc will
      iterate forever looking for a console that can print boot messages (or
      a NULL pointer that will never come).
      
      This loop in the linked list can occur after restoring the system from a
      system suspend. The boot console is registered during the cold boot in
      BL31, but the runtime console is registered even in the warm boot path.
      Consoles are always added to the start of the linked list when they are
      registered, so this it what should happen if they were actually
      different structures:
      
         console_list -> NULL
         console_list -> BOOT -> NULL
         console_list -> RUNTIME -> BOOT -> NULL
         console_list -> RUNTIME -> RUNTIME -> BOOT -> NULL
      
      In practice, the two runtime consoles are the same one, so they create
      this loop:
      
         console_list -> RUNTIME -.    X -> BOOT -> NULL
                             ^    |
                             `----'
      
      This patch adds an assertion to detect this problem. The assertion will
      fail whenever the same structure tries to be registered while being on
      the list.
      
      In order to assert this, console_is_registered() has been implemented.
      It returns 1 if the specified console is registered, 0 if not.
      
      Change-Id: I922485e743775ca9bd1af9cbd491ddd360526a6d
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      c2e05bb7
  11. 01 Mar, 2018 1 commit
    • Dan Handley's avatar
      Improve MULTI_CONSOLE_API deprecation warnings · bc1a03c7
      Dan Handley authored
      
      
      For platforms that have not migrated to MULTI_CONSOLE_API == 1, there
      are a lot of confusing deprecated declaration warnings relating to
      use of console_init() and console_uninit(). Some of these relate to use
      by the generic code, not the platform code. These functions are not really
      deprecated but *removed* when MULTI_CONSOLE_API == 1.
      
      This patch consolidates these warnings into a single preprocessor warning.
      The __deprecated attribute is removed from the console_init() and
      console_uninit() declarations.
      
      For preprocessor warnings like this to not cause fatal build errors,
      this patch adds -Wno-error=cpp to the build flags when
      ERROR_DEPRECATED == 0.
      This option (and -Wno-error=deprecated-declarations) is now added to
      CPPFLAGS instead of TF_CFLAGS to ensure the build flags are used in the
      assembler as well as the compiler.
      
      This patch also disentangles the MULTI_CONSOLE_API and ERROR_DEPRECATED
      build flags by defaulting MULTI_CONSOLE_API to 0 instead of
      ERROR_DEPRECATED. This allows platforms that have not migrated to
      MULTI_CONSOLE_API to use ERROR_DEPRECATED == 1 to emit a more meaningful
      build error.
      
      Finally, this patch bans use of MULTI_CONSOLE_API == 1 and AARCH32, since
      the AArch32 console implementation does not support
      MULTI_CONSOLE_API == 1.
      
      Change-Id: If762165ddcb90c28aa7a4951aba70cb15c2b709c
      Signed-off-by: default avatarDan Handley <dan.handley@arm.com>
      bc1a03c7
  12. 12 Dec, 2017 1 commit
    • Julius Werner's avatar
      Add new function-pointer-based console API · 9536bae6
      Julius Werner authored
      
      
      This patch overhauls the console API to allow for multiple console
      instances of different drivers that are active at the same time. Instead
      of binding to well-known function names (like console_core_init),
      consoles now provide a register function (e.g. console_16550_register())
      that will hook them into the list of active consoles. All console
      operations will be dispatched to all consoles currently in the list.
      
      The new API will be selected by the build-time option MULTI_CONSOLE_API,
      which defaults to ${ERROR_DEPRECATED} for now. The old console API code
      will be retained to stay backwards-compatible to older platforms, but
      should no longer be used for any newly added platforms and can hopefully
      be removed at some point in the future.
      
      The new console API is intended to be used for both normal (bootup) and
      crash use cases, freeing platforms of the need to set up the crash
      console separately. Consoles can be individually configured to be active
      active at boot (until first handoff to EL2), at runtime (after first
      handoff to EL2), and/or after a crash. Console drivers should set a sane
      default upon registration that can be overridden with the
      console_set_scope() call. Code to hook up the crash reporting mechanism
      to this framework will be added with a later patch.
      
      This patch only affects AArch64, but the new API could easily be ported
      to AArch32 as well if desired.
      
      Change-Id: I35c5aa2cb3f719cfddd15565eb13c7cde4162549
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      9536bae6
  13. 03 May, 2017 1 commit
  14. 31 Mar, 2017 1 commit
  15. 10 Aug, 2016 1 commit
    • Soby Mathew's avatar
      AArch32: Add console driver · 66be868e
      Soby Mathew authored
      This patch adds console drivers including the pl011 driver
      for the AArch32 mode.
      
      Change-Id: Ifd22520d370fca3e73dbbf6f2d97d6aee65b67dd
      66be868e
  16. 09 Aug, 2016 1 commit
    • Soby Mathew's avatar
      Move console drivers to AArch64 folder · 9c94d3b3
      Soby Mathew authored
      This patch moves the various assembly console drivers
      into `aarch64` architecture specific folder. Stub files,
      which include files from new location, are retained at the
      original location for platform compatibility reasons.
      
      Change-Id: I0069b6c1c0489ca47f5204d4e26e3bc3def533a8
      9c94d3b3
  17. 21 Jan, 2016 1 commit
    • Juan Castillo's avatar
      Disable PL011 UART before configuring it · 9400b40e
      Juan Castillo authored
      The PL011 TRM (ARM DDI 0183G) specifies that the UART must be
      disabled before any of the control registers are programmed. The
      PL011 driver included in TF does not disable the UART, so the
      initialization in BL2 and BL31 is violating this requirement
      (and potentially in BL1 if the UART is enabled after reset).
      
      This patch modifies the initialization function in the PL011
      console driver to disable the UART before programming the
      control registers.
      
      Register clobber list and documentation updated.
      
      Fixes ARM-software/tf-issues#300
      
      Change-Id: I839b2d681d48b03f821ac53663a6a78e8b30a1a1
      9400b40e
  18. 04 Jan, 2016 1 commit
  19. 09 Dec, 2015 1 commit
    • Soby Mathew's avatar
      Introduce console_uninit() API in ARM Trusted Firmware · 487461cb
      Soby Mathew authored
      Allowing console base address to be set to NULL conveniently
      allows console driver to ignore further invocations to console_putc()
      and console_getc(). This patch adds `console_uninit()` API to the
      console driver which sets console base address as NULL. The BL images can
      invoke this API to finish the use of console and ignore any further
      invocations to print to the console.
      
      Change-Id: I00a1762b3e0b7c55f2be2f9c4c9bee3967189dde
      487461cb
  20. 09 Jul, 2015 1 commit
    • Juan Castillo's avatar
      Use uintptr_t as base address type in ARM driver APIs · 02462972
      Juan Castillo authored
      This patch changes the type of the base address parameter in the
      ARM device driver APIs to uintptr_t (GIC, CCI, TZC400, PL011). The
      uintptr_t type allows coverage of the whole memory space and to
      perform arithmetic operations on the addresses. ARM platform code
      has also been updated to use uintptr_t as GIC base address in the
      configuration.
      
      Fixes ARM-software/tf-issues#214
      
      Change-Id: I1b87daedadcc8b63e8f113477979675e07d788f1
      02462972
  21. 28 Apr, 2015 1 commit
    • Dan Handley's avatar
      Separate out common console functionality · d3b638cb
      Dan Handley authored
      Separate out the common console functionality in
      `drivers/arm/pl011/pl011_console.S` into a new source file
      `drivers/console/console.S`. The former includes the latter to
      provide backwards compatibility for platform make files.
      
      Also add a skeleton console implementation for platforms that do not
      want to use PL011.
      
      Change-Id: I1ff963b2b54a872fbcf1eb0700797b9e9afa2538
      d3b638cb
  22. 06 May, 2014 1 commit
    • Dan Handley's avatar
      Move include and source files to logical locations · 4ecca339
      Dan Handley authored
      Move almost all system include files to a logical sub-directory
      under ./include. The only remaining system include directories
      not under ./include are specific to the platform. Move the
      corresponding source files to match the include directory
      structure.
      
      Also remove pm.h as it is no longer used.
      
      Change-Id: Ie5ea6368ec5fad459f3e8a802ad129135527f0b3
      4ecca339
  23. 14 Apr, 2014 1 commit
    • Dan Handley's avatar
      Move console.c to pl011 specific driver location · d72f6e31
      Dan Handley authored
      Rename drivers/console/console.c to
      drivers/arm/peripherals/pl011/pl011_console.c. This makes it clear
      that this is a pl011 specific console implementation.
      
      Fixes ARM-software/tf-issues#129
      
      Change-Id: Ie2f8109602134c5b86993e32452c70734c45a3ed
      d72f6e31
  24. 26 Mar, 2014 2 commits
    • Vikram Kanigiri's avatar
      Initialise UART console in all bootloader stages · 0796fe01
      Vikram Kanigiri authored
      This patch reworks the console driver to ensure that each bootloader stage
      initializes it independently. As a result, both BL3-1 and BL2 platform code
      now calls console_init() instead of relying on BL1 to perform console setup
      
      Fixes ARM-software/tf-issues#120
      
      Change-Id: Ic4d66e0375e40a2fc7434afcabc8bbb4715c14ab
      0796fe01
    • Soby Mathew's avatar
      Move console functions out of pl011.c · c1df3be7
      Soby Mathew authored
      This commit isolates the accessor functions in pl011.c and builds
      a wrapper layer for console functions.
      
      This also modifies the console driver to use the pl011 FIFO.
      
      Fixes ARM-software/tf-issues#63
      
      Change-Id: I3b402171cd14a927831bf5e5d4bb310b6da0e9a8
      c1df3be7