1. 24 Aug, 2021 1 commit
    • Icenowy Zheng's avatar
      refactor(plat/allwinner): allow new AA64nAA32 position · 080939f9
      Icenowy Zheng authored
      
      
      In newer Allwiner SoCs, the AA64nAA32 wires are mapped to a new register
      called "General Control Register0" in the manual rather than the
      "Cluster 0 Control Register0" in older SoCs.
      
      Now the position of AA64nAA32 (reg and bit offset) is defined in a few
      macros instead assumed to be at bit offset 24 of
      SUNXI_CPUCFG_CLS_CTRL_REG0.
      
      Change-Id: I933d00b9a914bf7103e3a9dadbc6d7be1a409668
      Signed-off-by: default avatarIcenowy Zheng <icenowy@sipeed.com>
      080939f9
  2. 14 Dec, 2020 2 commits
    • Samuel Holland's avatar
      allwinner: Add SPC security setup for H6 · 49d98cd5
      Samuel Holland authored
      
      
      The H6 has a "secure port controller" similar to the A64/H5, but with
      more ports and a different register layout. Split the platform-specific
      parts out into a header, and add the missing MMIO base address.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: I3703868bc595459ecf9568b9d1605cb1be014bf5
      49d98cd5
    • Samuel Holland's avatar
      allwinner: Add R_PRCM security setup for H6 · 978a8240
      Samuel Holland authored
      
      
      H6 has a reorganized R_PRCM compared to A64/H5, with the security switch
      at a different offset. Until now, we did not notice, because the switch
      has no effect unless the secure mode e-fuse is blown.
      
      Since we are adding more platform-specific CCU registers, move them to
      their own header, and out of the memory map (where they do not belong).
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Ie77476db0515080954eaa2e32bf6c3de657cda86
      978a8240
  3. 13 Feb, 2020 1 commit
  4. 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
  5. 20 Oct, 2018 2 commits
    • Andre Przywara's avatar
      allwinner: Use the arisc to turn off ARM cores · 7db0c960
      Andre Przywara authored
      
      
      PSCI requires a core to turn itself off, which we can't do properly by
      just executing an algorithm on that very core. As a consequence we just
      put a core into WFI on CPU_OFF right now.
      To fix this let's task the "arisc" management processor (an OpenRISC
      core) with that task of asserting reset and turning off the core's power
      domain. We use a handcrafted sequence of OpenRISC instructions to
      achieve this, and hand this data over to the new sunxi_execute_arisc_code()
      routine.
      The commented source code for this routine is provided in a separate file,
      but the ATF code contains the already encoded instructions as data.
      The H6 uses the same algorithm, but differs in the MMIO addresses, so
      provide a SoC (family) specific copy of that code.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      7db0c960
    • 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
  6. 28 Jun, 2018 1 commit
  7. 15 Jun, 2018 3 commits
    • Andre Przywara's avatar
      allwinner: Add security setup · acb8b3ca
      Andre Przywara authored
      
      
      Some peripherals are TrustZone aware, so they need to be configured to
      be accessible from non-secure world, as we don't need any of them being
      exclusive to the secure world.
      This affects some clocks, DMA channels and the Secure Peripheral
      Controller (SPC). The latter controls access to most devices, but is not
      active unless booting with the secure boot fuse burnt.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      acb8b3ca
    • Samuel Holland's avatar
      allwinner: Add functions to control CPU power/reset · 333d66cf
      Samuel Holland authored
      
      
      sun50i_cpu_on will be used by the PSCI implementation to initialize
      secondary cores for SMP. Unfortunately, sun50i_cpu_off is not usable by
      PSCI directly, because it is not possible for a CPU to use this function
      to power itself down. Power cannot be shut off until the outputs are
      clamped, and MMIO does not work once the outputs are clamped.
      
      But at least CPU0 can shutdown the other cores early in the BL31 boot
      process and before shutting down the system.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      333d66cf
    • Samuel Holland's avatar
      allwinner: Add Allwinner A64 support · 64b3d9d8
      Samuel Holland authored
      
      
      The Allwinner A64 SoC is quite popular on single board computers.
      It comes with four Cortex-A53 cores in a singe cluster and the usual
      peripherals for set-top box/tablet SoC.
      
      The ATF platform target is called "sun50i_a64".
      
      [Andre: adapted to amended directory layout, removed unneeded definitions ]
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      64b3d9d8