1. 28 Sep, 2018 2 commits
  2. 27 Sep, 2018 1 commit
    • Shawn Guo's avatar
      poplar: fix build error with POPLAR_RECOVERY=1 · d5ed2946
      Shawn Guo authored
      Commit eba1b6b3
      
       ("plat/poplar: migrate to mmc framework") defines
      variable 'info' without !POPLAR_RECOVERY protection, and hence causes
      the following unused variable error with POPLAR_RECOVERY=1 build.
      
      plat/hisilicon/poplar/bl1_plat_setup.c: In function ‘bl1_platform_setup’:
      plat/hisilicon/poplar/bl1_plat_setup.c:95:25: error: unused variable ‘info’ [-Werror=unused-variable]
        struct mmc_device_info info;
                               ^~~~
      
      The patches fixes the build error with POPLAR_RECOVERY=1.
      Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
      d5ed2946
  3. 24 Sep, 2018 1 commit
  4. 19 Sep, 2018 1 commit
    • Andre Przywara's avatar
      drivers: i2c: mentor: move platform code into header files · dfc0fb27
      Andre Przywara authored
      
      
      At the moment we have two I2C stub drivers (for the Allwinner and the
      Marvell platform), which #include the actual .c driver file.
      Change this into the more usual design, by renaming and moving the stub
      drivers into platform specific header files and including these from the
      actual driver file. The platform specific include directories make sure
      the driver picks up the right header automatically.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      dfc0fb27
  5. 18 Sep, 2018 1 commit
  6. 17 Sep, 2018 2 commits
    • Andre Przywara's avatar
      allwinner: sun50i_h6: initialise I2C just before powering down · 159c5249
      Andre Przywara authored
      
      
      Even though we initialise the platform part and the I2C controller
      itself at boot time, we actually only access the bus on power down.
      Meanwhile a rich OS might have configured the I2C pins differently or
      even disabled the controller.
      So repeat the platform setup and controller initialisation just before
      we actually access the bus to power off the system. This is safe,
      because at this point the rich OS should no longer be running.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      159c5249
    • Andre Przywara's avatar
      allwinner: sun50i_h6: improve I2C setup · 1a910bce
      Andre Przywara authored
      
      
      Drop the unnecessary check for the I2C pins being already configured as
      I2C pins (we actually don't care).
      Also avoid resetting *every* peripheral that is covered by the PRCM reset
      controller, instead just clear the one line connected to the I2C controller.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      1a910bce
  7. 10 Sep, 2018 1 commit
  8. 09 Sep, 2018 1 commit
  9. 07 Sep, 2018 8 commits
  10. 05 Sep, 2018 1 commit
  11. 04 Sep, 2018 21 commits
    • Jens Wiklander's avatar
      plat: qemu: update the early platform setup API · aa91296a
      Jens Wiklander authored
      
      
      Replaces deprecated early platform setup APIs
      
      * Replaces bl31_early_platform_setup() with bl31_early_platform_setup2()
      * Replaces bl2_early_platform_setup() with bl2_early_platform_setup2()
      Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
      aa91296a
    • Bryan O'Donoghue's avatar
      warp7: Add warp7 platform to the build · 172e55be
      Bryan O'Donoghue authored
      
      
      Previous changes in this series made the necessary driver additions and
      updates. With those changes in-place we can add the platform.mk and
      bl2_el3_setup.c to drive the boot process.
      
      After this commit its possible to build a fully-functional TF-A for the
      WaRP7 and boot from the BootROM to the Linux command prompt in secure or
      non-secure mode.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      172e55be
    • Bryan O'Donoghue's avatar
      warp7: panic: hab: Call into BootROM failsafe on panic path · 20c0eca0
      Bryan O'Donoghue authored
      
      
      This patch adds a callback into the BootROM's provided High Assurance Boot
      (HAB) failsafe function when panicking i.e. the call is done without making
      use of stack.
      
      The HAB failsafe function allows a piece of software to call into the
      BootROM and place the processor into failsafe mode.
      
      Failsafe mode is a special mode which presents a serial download protocol
      interface over UART or USB at the time of writing.
      
      If the board has been set into secure mode, then only a signed binary can
      be used to recover the board.
      
      Thus failsafe gives a putatively secure method of performing a secure
      recovery over UART or USB.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Reviewed-by: default avatarRyan Harkin <ryan.harkin@linaro.org>
      20c0eca0
    • Bryan O'Donoghue's avatar
      warp7: mem_params_desc: Add boot entries to mem params array · a22d06ce
      Bryan O'Donoghue authored
      
      
      This patch adds entries to the mem params array for
      
      - BL32
      - BL32_EXTRA1
      - BL32_EXTRA2
      - BL33
      - HW_CONFIG_ID
      
      BL32 is marked as bootable to indicate that OPTEE is the thing that should
      be booted next.
      
      In our model OPTEE chain-loads onto u-boot so only BL32 is bootable.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      a22d06ce
    • Bryan O'Donoghue's avatar
      warp7: io_storage: Add initial stub warp7_io_storage.c · 5336ebd0
      Bryan O'Donoghue authored
      
      
      This commit adds support for parsing a FIP pre-loaded by a previous
      boot-phase such as u-boot or via ATF reading directly from eMMC.
      
      [bod: squashing several patches from Rui, Jun and bod]
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Signed-off-by: default avatarJun Nie <jun.nie@linaro.org>
      Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      5336ebd0
    • Bryan O'Donoghue's avatar
      warp7: Define a platform_def.h · c6020248
      Bryan O'Donoghue authored
      
      
      This patch defines a platform_def.h describing
      
      - FIP layout and location
      - eMMC device select
      - UART identity select
      - System clock frequency
      - Operational memory map
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Signed-off-by: default avatarRui Miguel Silva <rui.silva@linaro.org>
      Signed-off-by: default avatarJun Nie <jun.nie@linaro.org>
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      c6020248
    • Bryan O'Donoghue's avatar
      warp7: mem_params_desc: Add a file which exports a REGISTER_BL_IMAGE_DESCS · 1fe21ca6
      Bryan O'Donoghue authored
      
      
      In order to link even a basic image we need to declare
      REGISTER_BL_IMAGE_DESCS. This patch declares an empty structure which is
      passed to REGISTER_BL_IMAGE_DESCS(). Later patches will add in some
      meaningful data.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      1fe21ca6
    • Bryan O'Donoghue's avatar
      warp7: Add a warp7_private.h file · 073c91d0
      Bryan O'Donoghue authored
      
      
      Internal declarations for the WaRP7 port will go here. For now just include
      sys/types.h.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      073c91d0
    • Bryan O'Donoghue's avatar
      warp7: image_load: Add warp7_image_load.c · 82add05b
      Bryan O'Donoghue authored
      
      
      This commit adds warp7_image_load.c with the functions
      
      - plat_flush_next_bl_params()
      - plat_get_bl_image_load_info()
      - plat_get_next_bl_params()
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      82add05b
    • Bryan O'Donoghue's avatar
      warp7: Add initial warp7_helpers.S · 54544c99
      Bryan O'Donoghue authored
      
      
      This commit adds a warp7_helpers.S which contains a implementation of:
      
      - platform_mem_init
      - plat_get_my_entrypoint
      - plat_crash_console_init
      - plat_crash_console_putc
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      54544c99
    • Bryan O'Donoghue's avatar
      imx: imx_wdog: Add code to initialize the wdog block · b42ceebb
      Bryan O'Donoghue authored
      
      
      The watchdog block on the IMX is mercifully simple. This patch maps the
      various registers and bits associated with the block.
      
      We are mostly only really interested in the power-down-enable (PDE) bits in
      the block for the purposes of ATF.
      
      The i.MX7 Solo Applications Processor Reference Manual details the PDE bit
      as follows:
      
      "Power Down Enable bit. Reset value of this bit is 1, which means the power
      down counter inside the WDOG is enabled after reset. The software must
      write 0 to this bit to disable the counter within 16 seconds of reset
      de-assertion. Once disabled this counter cannot be enabled again. See
      Power-down counter event for operation of this counter."
      
      This patch does that zero write in-lieu of later phases in the boot
      no-longer have the necessary permissions to rewrite the PDE bit directly.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      b42ceebb
    • Bryan O'Donoghue's avatar
      imx: imx_caam: Add code to initialize the CAAM job-rings to NS-world · ca52cbe6
      Bryan O'Donoghue authored
      
      
      This patch defines the most basic part of the CAAM and the only piece of
      the CAAM silicon we are really interested in, in ATF, the CAAM control
      structure.
      
      The CAAM itself is a huge address space of some 32k, way out of scope for
      the purpose we have in ATF.
      
      This patch adds a simple CAAM init function that assigns ownership of the
      CAAM job-rings to the non-secure MID with the ownership bit set to
      non-secure.
      
      This will allow later logic in the boot process such as OPTEE, u-boot and
      Linux to assign job-rings as appropriate, restricting if necessary but
      leaving open the main functionality of the CAAM to the Linux NS runtime.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      ca52cbe6
    • Jens Wiklander's avatar
      qemu: make LOAD_IMAGE_V2=1 mandatory · 106cd733
      Jens Wiklander authored
      
      
      The QEMU platform has only been used with LOAD_IMAGE_V2=1 for some time
      now and bit rot has occurred for LOAD_IMAGE_V2=0. To ease the
      maintenance make LOAD_IMAGE_V2=1 mandatory and remove the platform
      specific code for LOAD_IMAGE_V2=0.
      Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
      106cd733
    • Siva Durga Prasad Paladugu's avatar
      zynqmp: Define and enable ARM_XLAT_TABLES_LIB_V1 · e8fae4bc
      Siva Durga Prasad Paladugu authored
      Enable ARM_XLAT_TABLES_LIB_V1 as ZynqMP is using
      v1 library of translation tables.
      
      With upstream patch d323af9e
      
      ,
      the usage of MAP_REGION_FLAT is referring to definition in file
      include/lib/xlat_tables/xlat_tables_v2.h but while preparing
      xlat tables in lib/xlat_tables/xlat_tables_common.c it is referring
      to include/lib/xlat_tables/xlat_tables.h which is v1 xlat tables.
      Also, ZynqMP was using v1 so defined ARM_XLAT_TABLES_LIB_V1 to
      use v1 xlat tables everywhere.
      This fixes the issue of xlat tables failures as it takes v2
      library mmap_region structure in some files and v1 in other
      files.
      Signed-off-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
      e8fae4bc
    • Bryan O'Donoghue's avatar
      imx: imx_hab: Define a HAB header file · db05fb77
      Bryan O'Donoghue authored
      
      
      The High Assurance Boot or HAB is an on-chip method of providing a
      root-of-trust from the reset vector to subsequent stages in the bootup
      flow of the Cortex-A7 on the i.MX series of processors.
      
      This patch adds a simple header file with pointer offsets of the provided
      set of HAH API callbacks in the BootROM.
      
      The relative offset of the function pointers is a constant and known
      quantum, a software-contract between NXP and an implementation which is
      defined in the NXP HAB documentation.
      
      All we need is the correct base offset and then we can map the set of
      function pointers relative to that offset.
      
      imx_hab_arch.h provides the correct offset and the imx_hab.h hooks the
      offset to the pre-determined callbacks.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Reviewed-by: default avatarRyan Harkin <ryan.harkin@linaro.org>
      db05fb77
    • Bryan O'Donoghue's avatar
      imx7: hab_arch: Provide a hab_arch.h file · 58254711
      Bryan O'Donoghue authored
      
      
      In order to enable compile time differences in HAB interaction, we should
      split out the definition of the base address of the HAB API.
      
      Some version of the i.MX series have different offsets from the BootROM
      base for the HAB callback table.
      
      This patch defines the header into which we will define the i.MX7 specific
      offset. The offset of the i.MX7 function-callback table is simultaneously
      defined.
      
      Once done, we can latch a set of common function pointer locations from the
      offset given here and if necessary change the offset for different
      processors without any other code-change.
      
      For now all we support is i.MX7 so the only offset being defined is that
      for the i.MX7.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Reviewed-by: default avatarRyan Harkin <ryan.harkin@linaro.org>
      58254711
    • Bryan O'Donoghue's avatar
      imx: imx_snvs: Add an SNVS core functionality · f7ea6d52
      Bryan O'Donoghue authored
      
      
      This patch adds snvs.c with a imx_snvs_init() function.
      
      imx_snvs_init() sets up permissions of the RTC via the SNVS HPCOMR.
      
      During previous work with OPTEE on the i.MX7 part we discovered that prior
      to switching from secure-world to normal-world it is required to apply more
      permissive permissions than are defaulted to in order for Linux to be able
      to access the RTC and CAAM functionality in general.
      
      This patch pertains to fixing the RTC permissions by way of the
      HPCOMR.NPSWA_EN bit.
      
      Once set non-privileged code aka Linux-kernel code has permissions to
      access the SNVS where the RTC resides.
      
      Perform that permissions fix in imx_snvs_init() now, with a later patch making
      the call from our platform setup code.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      f7ea6d52
    • Bryan O'Donoghue's avatar
      imx: imx_snvs: Define a SNVS header and memory map · a60ca3b4
      Bryan O'Donoghue authored
      
      
      This commit defines two things.
      
      - The basic SNVS memory map. At the moment that is total overkill for the
        permission bits we need to set inside the SNVS but, for the sake of
        completeness define the whole SNVS area as a struct.
      
      - The bits of the HPCOMR register
      
        A permission fix will need to be applied to the SNVS block prior to
        switching on TrustZone. All we need to do is waggle a bit in the HPCOMR
        register. To do that waggle we first need to define the bits of the
        HPCOMR register.
      
      - A imx_snvs_init() function definition
      
        Declare the snvs_init() function so that it can be called from our
        platform setup code.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      a60ca3b4
    • Bryan O'Donoghue's avatar
      imx: imx_csu: Add a simple CSU layer · c3334cb1
      Bryan O'Donoghue authored
      
      
      - Add a header to define imx_csu_init().
      - Defines the Central Security Unit's Config Security Level
        permission bits.
      - Define CSU_CSL_OPEN_ACCESS permission bitmask
      - Run a loop to setup peripheral CSU permissions
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      c3334cb1
    • Bryan O'Donoghue's avatar
      imx: imx_aips: Add initial AIPS support · 49a64134
      Bryan O'Donoghue authored
      
      
      This patch adds an initial AHB-to-IP TrustZone (AIPS-TZ) initialization
      routine. Setting up the AIPSTZ controller is required to inform the SoC
      interconnect fabric which bus-masters can read/write and if the read/writes
      are buffered.
      
      For our purposes the initial configuration is for everything to be open. We
      can lock-down later on as necessary.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      49a64134
    • Bryan O'Donoghue's avatar
      imx: imx_io_mux: Define an IO-mux layer · 965bda4d
      Bryan O'Donoghue authored
      
      
      This patch defines:
      
      - The full range of IO-mux register offsets relative to the base address of
        the IO-mux block base address.
      
      - The bits for muxing the UART1 TX/RX lines.
      
      - The bits for muxing the UART6 TX/RX lines.
      
      - The pad control pad bits for the UART
      
      Two functions are provided to configure pad muxes:
      
      - void io_muxc_set_pad_alt_function(pad_mux_offset, alt_function)
        Takes a pad_mux_offset and sets the alt_function bit-mask supplied.
        This will have the effect of switching the pad into one of its defined
        peripheral functions. These peripheral function modes are defined in the
        NXP documentation and need to be referred to in order to correctly
        configure a new alternative-function.
      
      - void io_muxc_set_pad_features(pad_feature_offset, pad_features)
        Takes a pad_feature_offset and applies a pad_features bit-mask to the
        indicated pad.
        This function allows the setting of PAD drive-strength, pull-up values,
        hysteresis glitch filters and slew-rate settings.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      965bda4d