1. 20 Oct, 2018 13 commits
    • Andre Przywara's avatar
      allwinner: A64: Add AXP803 PMIC support to power off the board · eae5fe79
      Andre Przywara authored
      
      
      Boards with the Allwinner A64 SoC are mostly paired with an AXP803 PMIC,
      which allows to programmatically power down the board.
      
      Use the newly introduced RSB driver to detect and program the PMIC on
      boot, then later to turn off the main voltage rails when receiving a
      PSCI SYSTEM_POWER_OFF command.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      eae5fe79
    • Andre Przywara's avatar
      allwinner: H6: Factor out I2C platform setup · d5ddf67a
      Andre Przywara authored
      
      
      In the H6 platform code there is a routine to do the platform
      initialisation of the R_I2C controller. We will need a very similar
      setup routine to initialise the RSB controller on the A64.
      
      Move this code to sunxi_common.c and generalise it to support all SoCs
      and also to cover the related RSB bus.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      d5ddf67a
    • Andre Przywara's avatar
      allwinner: Add RSB driver · 103f19f0
      Andre Przywara authored
      
      
      The "Reduced Serial Bus" is an Allwinner specific bus, bearing many
      similarities with I2C. It sports a much higher bus frequency, though,
      (typically 3 MHz) and requires much less handholding for the typical
      task of manipulating slave registers (fire-and-forget).
      On most A64 boards this bus is used to connect the PMIC to the SoC.
      
      This driver provides basic primitives to read and write slave registers,
      it will be later used by the PMIC code.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      103f19f0
    • Andre Przywara's avatar
      allwinner: H5: Implement power down for H5 reference design boards · 3d22228f
      Andre Przywara authored
      
      
      Allwinner produces reference board designs, which apparently most board
      vendors copy from. So every H5 board I checked uses regulators which are
      controlled by the same PortL GPIO pins to power the ARM CPU cores, the
      DRAM and the I/O ports.
      Add a SoC specific power down routine, which turns those regulators off
      when ATF detects running on an H5 SoC and the rich OS triggers a
      SYSTEM_POWEROFF PSCI call.
      
      NOTE: It sounds very tempting to turn the CPU power off, but this is not
      working as expected, instead the system is rebooting. Most probably this
      is due to VCC-SYS also being controlled by the same GPIO line, and
      turning this off requires an elaborate and not fully understood setup.
      Apparently not even Allwinner reference code is turning this regulator
      off. So for now we refrain to pulling down PL8, the power consumption is
      quite low anyway, so we are as close to poweroff as reasonably possible.
      Many thanks to Samuel for doing some research on that topic.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      3d22228f
    • Andre Przywara's avatar
      allwinner: Introduce GPIO helper function · 7020dca0
      Andre Przywara authored
      
      
      Many boards without a dedicated PMIC contain simple regulators, which
      can be controlled via GPIO pins.
      
      To later allow turning them off easily, introduce a simple function to
      configure a given pin as a GPIO out pin and set it to the desired level.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      7020dca0
    • Andre Przywara's avatar
      allwinner: Export sunxi_private.h · 4ec1a239
      Andre Przywara authored
      
      
      So far we have a sunxi_private.h header file in the common code directory.
      This holds the prototypes of various functions we share in *common*
      code. However we will need some of those in the platform specific code
      parts as well, and want to introduce new functions shared across the
      whole platform port.
      
      So move the sunxi_private.h file into the common/include directory, so
      that it becomes visible to all parts of the platform code.
      Fix up the existing #includes and add missing ones, also add the
      sunxi_read_soc_id() prototype here.
      
      This will be used in follow up patches.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      4ec1a239
    • Andre Przywara's avatar
      allwinner: A64/H5: Add basic and generic shutdown method · f953c30f
      Andre Przywara authored
      
      
      Some boards don't have a PMIC, so they can't easily turn their power
      off. To cover those boards anyway, let's turn off as many devices and
      clocks as possible, so that the power consumption is reduced. Then
      halt the last core, as before.
      This will later be extended with proper PMIC support for supported
      boards.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      f953c30f
    • Andre Przywara's avatar
      allwinner: Pass SoC ID to sunxi_pmic_setup() · fe57c7d4
      Andre Przywara authored
      
      
      In the BL31 platform setup we read the Allwinner SoC ID to identify the
      chip and print its name.
      In addition to that we will need to differentiate the power setup
      between the SoCs, to pass on the SoC ID to the PMIC setup routine.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      fe57c7d4
    • Andre Przywara's avatar
      allwinner: Introduce names for SoC IDs · 123bcb3f
      Andre Przywara authored
      
      
      We will soon make more use of the Allwinner SoC ID, to differentiate the
      platform setup.
      Introduce definitions to avoid dealing with magic numbers and make the
      code more readable.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      123bcb3f
    • Andre Przywara's avatar
      allwinner: H6: Fix SRAM size · f78f00aa
      Andre Przywara authored
      
      
      The SRAM in the Allwinner H6 SoC starts at 0x2000, with the last part
      ending at 0x117fff (although with gaps in between).
      So SUNXI_SRAM_SIZE should be 0xf8000, not 0x98000.
      
      Fix this to map the arisc exception vector area, which we will need
      shortly.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      f78f00aa
    • Andre Przywara's avatar
      allwinner: Disable USE_COHERENT_MEM · 43060513
      Andre Przywara authored
      
      
      According to the documentation, platforms may choose to trade memory
      footprint for performance (and elegancy) by not providing a separately
      mapped coherent page.
      
      Since a debug build is getting close to the SRAM size limit already, this
      allows us to save about 3.5KB of BSS and have some room for future
      enhancements.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      43060513
    • Andre Przywara's avatar
      allwinner: Adjust memory mapping to fit into 256MB · c3af6b00
      Andre Przywara authored
      
      
      At the moment we map as much of the DRAM into EL3 as possible, however
      we actually don't use it. The only exception is the secure DRAM for
      BL32 (if that is configured).
      
      To decrease the memory footprint of ATF, we save on some page tables by
      reducing the memory mapping to the actually required regions: SRAM, device
      MMIO, secure DRAM and U-Boot (to be used later).
      This introduces a non-identity mapping for the DRAM regions.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      c3af6b00
    • Andre Przywara's avatar
      allwinner: Unify platform.mk files · a80490c5
      Andre Przywara authored
      
      
      For the two different platforms we support in the Allwinner port we
      mostly rely on header files covering the differences. This leads to the
      platform.mk files in the respective directories to be almost identical.
      
      To avoid further divergence and make sure that one platform doesn't
      break accidentally, let's create a shared allwinner-common.mk file and
      include that from the platform directory.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      a80490c5
  2. 18 Oct, 2018 6 commits
  3. 17 Oct, 2018 17 commits
  4. 16 Oct, 2018 2 commits
  5. 15 Oct, 2018 2 commits