1. 25 Feb, 2020 1 commit
  2. 04 Dec, 2019 2 commits
  3. 01 Aug, 2019 1 commit
    • Julius Werner's avatar
      Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__ · d5dfdeb6
      Julius Werner authored
      
      
      NOTE: __ASSEMBLY__ macro is now deprecated in favor of __ASSEMBLER__.
      
      All common C compilers predefine a macro called __ASSEMBLER__ when
      preprocessing a .S file. There is no reason for TF-A to define it's own
      __ASSEMBLY__ macro for this purpose instead. To unify code with the
      export headers (which use __ASSEMBLER__ to avoid one extra dependency),
      let's deprecate __ASSEMBLY__ and switch the code base over to the
      predefined standard.
      
      Change-Id: Id7d0ec8cf330195da80499c68562b65cb5ab7417
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      d5dfdeb6
  4. 17 Jul, 2019 2 commits
  5. 20 May, 2019 2 commits
  6. 09 May, 2019 1 commit
  7. 29 Jan, 2019 1 commit
    • Anson Huang's avatar
      imx: power optimization for i.mx8qm · 3a2b5199
      Anson Huang authored
      
      
      Current implementation of i.MX8QM power management related
      features does NOT optimize power number, all system resources
      like CCI, DDR, and A cluster etc. are kept in STBY mode (powered
      ON) when system suspend or CPU hotplug.
      
      To lower the power number, OFF mode should be adopted for those
      system resources whenever they can be OFF, A cluster will be OFF
      if the CPUs in the cluster are all off line, DDR/MU/DB can be OFF
      if system suspend, IRQ steer can be OFF if the wakeup source is
      belonged to system controller partition, so wakeup source runtime
      check is used to determine if IRQ steer can be OFF before system
      suspend.
      
      If resources are powered off for suspend, they should be restored
      properly after system resume.
      Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      3a2b5199
  8. 18 Jan, 2019 5 commits
  9. 17 Jan, 2019 3 commits
    • Anson Huang's avatar
      imx: add cpu-freq SIP runtime service support · d3996c59
      Anson Huang authored
      
      
      On i.MX8QM/i.MX8QX with system controller inside, the CPU's clock
      rate is managed by SCFW(system controller firmware) and can ONLY be
      changed from secure world, so SIP runtime service is needed for
      setting CPU's clock rate, this patch adds cpu-freq SIP runtime service
      support.
      Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      d3996c59
    • Anson Huang's avatar
      imx: add imx8qm/imx8qx SRTC SIP runtime service support · 025514ba
      Anson Huang authored
      
      
      On i.MX8QM/i.MX8QX with system controller inside, the SRTC is
      managed by SCFW(system controller firmware) and some functions
      like setting SRTC's time etc. can ONLY be requested from secure
      world, so SIP runtime service is needed for such kind of operations,
      this patch adds SRTC SIP runtime service support for i.MX8QM and
      i.MX8QX.
      Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      025514ba
    • Anson Huang's avatar
      Support for NXP's i.MX8 SoCs timer IPC · 1552df5d
      Anson Huang authored
      
      
      NXP's i.MX8 SoCs have system controller (M4 core) which takes
      control of timer management, including watchdog, srtc and system
      counter etc., other clusters like Cortex-A35 can send out command
      via MU (Message Unit) to system controller for timer operation.
      
      This patch adds timer IPC(inter-processor communication) support.
      Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      1552df5d
  10. 15 Jan, 2019 1 commit
    • Anson Huang's avatar
      imx: make imx uart work for debug mode · 2e8ab4f5
      Anson Huang authored
      
      
      With DEBUG_CONSOLE enabled, build will fail for imx8mq platform:
      
      ./build/imx8mq/release/bl31/imx8mq_bl31_setup.o:
      In function `bl31_early_platform_setup2':
      imx8mq_bl31_setup.c:(.text.bl31_early_platform_setup2+0x40):
      	undefined reference to `console_uart_register'
      Makefile:741: recipe for target 'build/imx8mq/release/bl31/bl31.elf' failed
      make: *** [build/imx8mq/release/bl31/bl31.elf] Error 1
      
      Besides, the .console_flush callback needs to be added to avoid
      panic when debug mode is enabled, since the console_flush() will
      call it without checking whether the function callback is valid.
      Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
      2e8ab4f5
  11. 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
  12. 05 Dec, 2018 1 commit
    • Bai Ping's avatar
      plat: imx: Add i.MX8MQ basic support · 81136819
      Bai Ping authored
      
      
      i.MX8MQ is new SOC of NXP's i.MX8M family based on
      A53. It can provide industry-leading audio, voice
      and video processing for applications that scale
      from consumer home audio to industrial building
      automation and mobile computers
      
      this patchset add the basic supoort to boot up
      the 4 X A53. more feature will be added later.
      Signed-off-by: default avatarBai Ping <ping.bai@nxp.com>
      81136819
  13. 08 Nov, 2018 1 commit
    • Antonio Nino Diaz's avatar
      Standardise header guards across codebase · c3cf06f1
      Antonio Nino Diaz authored
      
      
      All identifiers, regardless of use, that start with two underscores are
      reserved. This means they can't be used in header guards.
      
      The style that this project is now to use the full name of the file in
      capital letters followed by 'H'. For example, for a file called
      "uart_example.h", the header guard is UART_EXAMPLE_H.
      
      The exceptions are files that are imported from other projects:
      
      - CryptoCell driver
      - dt-bindings folders
      - zlib headers
      
      Change-Id: I50561bf6c88b491ec440d0c8385c74650f3c106e
      Signed-off-by: default avatarAntonio Nino Diaz <antonio.ninodiaz@arm.com>
      c3cf06f1
  14. 04 Sep, 2018 12 commits
    • 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
    • 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
      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
    • Bryan O'Donoghue's avatar
      imx: imx_clock: usb: Add USB clock API · 6176a4e5
      Bryan O'Donoghue authored
      
      
      This set of patches adds a very minimal layer of USB enabling patches to
      clock.c. Unlike the watchdog or UART blocks the USB clocks pertain to PHYs,
      the main USB clock etc, not to different instances of the same IP block.
      
      As a result this patch-set takes the clock CCGR clock identifier directly
      rather than as an index of an instance of blocks of the same type.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      6176a4e5
    • Bryan O'Donoghue's avatar
      imx: imx_clock: wdog: Add watchdog clock API · bbdcdd04
      Bryan O'Donoghue authored
      
      
      This patch adds a set of functions to enable the clock for each of the
      watchdog IP blocks.
      
      Unlike the MMC and UART blocks, the watchdog blocks operate off of the one
      root clock, only the clock-gates are enable/disabled individually.
      
      As a consequence the function clock_set_wdog_clk_root_bits() is used to set
      the root-slice just once for all of the watchdog blocks.
      
      Future implementations may need to change this model but for now on the one
      supported processor and similar NXP SoCs this model should work fine.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      bbdcdd04
    • Jun Nie's avatar
      imx: imx_clock: mmc: Add USDHC clock API · 14cf32aa
      Jun Nie authored
      
      
      This patch adds an API to configure up the base USDHC clocks, taking a
      bit-mask of silicon specific bits as an input from a higher layer in order
      to direct the necessary clock source.
      Signed-off-by: default avatarJun Nie <jun.nie@linaro.org>
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      14cf32aa
    • Bryan O'Donoghue's avatar
      imx: imx_clock: uart: Add UART clock API · dcd54e9b
      Bryan O'Donoghue authored
      
      
      This patch adds an API to configure up the base UART clocks, taking a
      bit-mask of silicon specific bits as an input from a higher layer in order
      to direct the necessary clock source.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      dcd54e9b
    • Bryan O'Donoghue's avatar
      imx: imx_clock: Add driver and associated clock register definitions · 82e35083
      Bryan O'Donoghue authored
      
      
      This commit:
      
      - Defines a clock stub with a conjoined header defining the clock
        memory map.
      
      - Defines the CCM Clock Gating Register which comes in a quadrumvirate
        register set to read, set, clear and toggle individual clock gates into
        one of four states based bitmask.
      
        00: Domain clocks not needed
        01: Domain clocks needed when in RUN
        10: Domain clocks needed when in RUN and WAIT
        11: Domain clocks needed all the time
      
      - Defines clock control register bits
      
        There are various quadrumvirate register blocks target-root, misc-root,
        post-root, pre-root in the CCM.
      
        The number of registers is huge but the four registers in each
        quadrumvirate block contain the same bits, so the number of bit
        definitions is actually quite low.
      
      - Defines clock identifiers
      
        An array of clock gates is provided in the CCM block. In order to index
        that array and thus enable/disable clock gates for the right components,
        we need to provide meaningful names to the indices.
      
        Section 5.2.5 of the i.MX7 Solo Application Processor Reference Manual
        Rev 0.1 provides the relevant details.
      
      - Defines target mux select bits
        This is a comprehensive definition of the target clock mux select bits.
        These bits are required to correctly select the clock source. Defining
        all of the bits up-front even for unused blocks in ATF means we can
        switch on any block we want at a later date without having to write new
        code in the clock-mux layer.
      
      - Defines identifier indices into root-slice array
        The root-slice array of control registers has a specific set of indices,
        which differ from the clock-gate indices.
      
      - Provides a clock gate enable/disable routine
        Provides a clock-gate enable/disable routine via the set/clr
        registers in a given clock-gate control register block.
      
        This index passed should be one of the enums associated with CCM and
        depending on enable/disable being passed either set or clr will be
        written to.
      
        The Domain0 bits are currently the only bits targeted by this write, more
        work may need to be done on the domain bits in subsequent patches as a
        result.
      
      - imx: Adds set/clr routines to clock layer
      
        Adds a set and clr routine to the clock layer. These routines allow us to
        access the set and clear registers of the "target" block registers. These
        are the registers where we select the clock source from the available list.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
      82e35083
  15. 22 Aug, 2018 1 commit
  16. 12 Jul, 2018 3 commits
  17. 19 Jun, 2018 2 commits