1. 17 Dec, 2019 6 commits
    • Simon South's avatar
      rockchip: rk3328: Enable workaround for erratum 855873 · 4c4cff6b
      Simon South authored
      
      
      Enable the workaround for Cortex-A53 erratum 855873 for the Rockchip
      RK3328, silencing a warning at startup.
      
      Change-Id: I5aa29d674d23c096c599abcb5e7dac970f9607d8
      Signed-off-by: default avatarSimon South <simon@simonsouth.net>
      4c4cff6b
    • Heiko Stuebner's avatar
      rockchip: make miniloader ddr_parameter handling optional · df5a9683
      Heiko Stuebner authored
      
      
      Transfering the regions of ddr memory to additionally protect is very much
      specific to some rockchip internal first stage bootloader and doesn't get
      used in either mainline uboot or even Rockchip's published vendor uboot
      sources.
      
      This results in a big error
          ERROR:   over or zero region, nr=0, max=10
      getting emitted on every boot for most users and such a message coming
      from early firmware might actually confuse developers working with the
      system.
      
      As this mechanism seems to be only be used by Rockchip's internal miniloader
      hide it behind a build conditional, so it doesn't confuse people too much.
      Signed-off-by: default avatarHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
      Change-Id: I52c02decc60fd431ea78c7486cad5bac82bdbfbe
      df5a9683
    • Heiko Stuebner's avatar
      rockchip: px30: cleanup securing of ddr regions · f55ef85e
      Heiko Stuebner authored
      
      
      So far the px30-related ddr security was loading data for regions to secure
      from a pre-specified memory location and also setting region0 to secure
      the first megabyte of memory in hard-coded setting (top=0, end=0, meaning
      1MB).
      
      To make things more explicit and easier to read add a function doing
      the settings for specified memory areas, like other socs have and also
      add an assert to make sure any descriptor read from memory does not
      overlap the TZRAM security in region0 and TEE security in region1.
      Signed-off-by: default avatarHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
      Change-Id: I78441875112bf66a62fde5f1789f4e52a78ef95f
      f55ef85e
    • Heiko Stuebner's avatar
      rockchip: px30: move secure init to separate file · d2483afa
      Heiko Stuebner authored
      
      
      Similar to others like rk3399 and rk3288 move the secure init to a
      separate file to unclutter the soc init a bit.
      Signed-off-by: default avatarHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
      Change-Id: Iebb38e24f1c7fe5353f139c896fb8ca769bf9691
      d2483afa
    • Heiko Stuebner's avatar
      rockchip: really use base+size for secure ddr regions · 7f0b2e78
      Heiko Stuebner authored
      
      
      The calls to secure ddr regions on rk3288 and rk3399 use parameters of
      base and size - as it custom for specifying memory regions, but the
      functions themself expect start and endpoints of the area.
      
      This only works by chance for the TZRAM, as it starts a 0x0 and therefore
      its end location is the same as its size.
      
      To not fall into a trap later on adapt the functions to really take
      base+size parameters.
      Signed-off-by: default avatarHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
      Change-Id: Idb9fab38aa081f3335a4eca971e7b7f6757fbbab
      7f0b2e78
    • Heiko Stuebner's avatar
      rockchip: bring TZRAM_SIZE values in line · c6ee020e
      Heiko Stuebner authored
      
      
      The agreed upon division of early boot locations is 0x40000 for bl31
      to leave enough room for u-boot-spl and 0x100000 for bl33 (u-boot).
      
      rk3288 and rk3399 already correctly secure the ddr up to the 1MB boundary
      so pull the other platforms along to also give the Rockchip TF-A enough
      room to comfortably live in.
      Signed-off-by: default avatarHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
      Change-Id: Ie9e0c927d3074a418b6fd23b599d2ed7c15c8c6f
      c6ee020e
  2. 14 Dec, 2019 10 commits
    • Samuel Holland's avatar
      allwinner: Convert AXP803 regulator setup code into a driver · 0bc752c9
      Samuel Holland authored
      
      
      Previously, the A64/H5 and H6 platforms' PMIC setup code was entirely
      independent. However, some H6 boards also need early regulator setup.
      
      Most of the register interface and all of the device tree traversal code
      can be reused between the AXP803 and AXP805. The main difference is the
      hardware bus interface, so that part is left to the platforms. The
      remainder is moved into a driver.
      
      I factored out the bits that were obviously specific to the AXP803;
      additional changes for compatibility with other PMICs can be made as
      needed.
      
      The only functional change is that rsb_init() now checks the PMIC's chip
      ID register against the expected value. This was already being done in
      the H6 version of the code.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Icdcf9edd6565f78cccc503922405129ac27e08a2
      0bc752c9
    • Samuel Holland's avatar
      allwinner: a64: power: Use fdt_for_each_subnode · 79b85465
      Samuel Holland authored
      
      
      This simplifies the code a bit. Verified to produce the same binary.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Ie1ec1ce2ea39c46525840906826c90a8a7eff287
      79b85465
    • Samuel Holland's avatar
      allwinner: a64: power: Remove obsolete register check · 494c8233
      Samuel Holland authored
      As of a561e41b
      
       ("allwinner: power: add enable switches for DCDC1/5")
      there are no longer regulators without an enable register provided.
      Since it seems reasonable that this will continue to be the case, drop
      the check.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Icd7ec26fc6450d053e6e6d855fc16229b1d65a39
      494c8233
    • Samuel Holland's avatar
      allwinner: a64: power: Remove duplicate DT check · 3bea03e7
      Samuel Holland authored
      
      
      should_enable_regulator() is already checked in the regulators subnode
      loop before setup_regulator() is called, so there's no need to check it
      again here.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Idb8b8a6e435246f4fb226bc84813449d80a0a977
      3bea03e7
    • Samuel Holland's avatar
      allwinner: Build PMIC bus drivers only in BL31 · 18fbfefb
      Samuel Holland authored
      
      
      These are used by the PMIC setup code, which runs during BL31
      initialization, and the PSCI shutdown code, also a part of BL31.
      They can't be needed before BL31, or it wouldn't be possible to boot.
      Allwinner platforms don't generally build anything but BL31 anyway, but
      this change improves clarity and consistency with allwinner-common.mk.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: I24f1d9ca8b4256e44badf5218d04d8690082babf
      18fbfefb
    • Samuel Holland's avatar
      allwinner: a64: power: Make sunxi_turn_off_soc static · df77a954
      Samuel Holland authored
      
      
      The function is only used in this file, and it doesn't make sense for it
      to be used anywhere else.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Iab18f082911edcdbc37ceeaff8c512be68e0cb0f
      df77a954
    • Samuel Holland's avatar
      allwinner: Merge duplicate code in sunxi_power_down · 818e6732
      Samuel Holland authored
      
      
      The action of last resort isn't going to change between SoCs. This moves
      that code back to the PSCI implementation, where it more obviously
      matches the code in sunxi_system_reset().
      
      The two error messages say essentially the same thing anyway.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: I62ac35fdb5ed78a016e9b18281416f1dcea38a4a
      818e6732
    • Samuel Holland's avatar
      allwinner: Clean up PMIC-related error handling · 4538c498
      Samuel Holland authored
      
      
      - Check the return value from sunxi_init_platform_r_twi().
      - Print the PMIC banner before doing anything that might fail.
      - Remove double prefixes in error messages.
      - Consistently omit the trailing period.
      - No need to print the unknown SoC's ID, since we already did that
        earlier in bl31_platform_setup().
      - On the other hand, do print the ID of the unknown PMIC.
      - Try to keep the messages concise, as the large string size in these
        files was causing the firmware to spill into the next page.
      - Downgrade the banner from NOTICE to INFO. It's purely informational,
        and people should be using debug builds on untested hardware anyway.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Ib909408a5fdaebe05470fbce48d245dd0bf040eb
      4538c498
    • Samuel Holland's avatar
      allwinner: Synchronize PMIC enumerations · c0e109f2
      Samuel Holland authored
      
      
      Ensure that the default (zero) value represents the case where we take
      no action. Previously, if a PLAT=sun50i_a64 build was booted on an
      unknown SoC ID, it would be treated as an H5 at shutdown.
      
      This removes some duplicate code and fixes error propagation on H6.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: I4e51d8a43a56eccb0d8088593cb9908e52e782bc
      c0e109f2
    • Samuel Holland's avatar
      allwinner: Enable clock before resetting I2C/RSB · eb75518d
      Samuel Holland authored
      
      
      The clock must be running for the module to be reset.
      Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
      Change-Id: Ic8fafc946f3a1a697174b91288e357ffa033ab9a
      eb75518d
  3. 13 Dec, 2019 1 commit
    • Joshua Watt's avatar
      rockchip: Prevent macro expansion in paths · 39a97dce
      Joshua Watt authored
      
      
      Instead of stringizing the paths to binary files, add them as string
      defines on the command line (e.g. -DFOO=\"BAR\" instead of -DFOO=BAR).
      This prevents macros from being expanded inside the string value itself.
      For example, -DFOO=/path/with-linux-in-it would have been expanded to
      "/path/with-1-in-it" because `linux=1` is one of the standard GCC
      defines.
      
      Change-Id: I7b65df3c9930faed4f1aff75ad726982ae3671e6
      Signed-off-by: default avatarJoshua Watt <JPEWhacker@gmail.com>
      39a97dce
  4. 12 Dec, 2019 1 commit
  5. 10 Dec, 2019 4 commits
  6. 09 Dec, 2019 2 commits
  7. 04 Dec, 2019 3 commits
  8. 28 Nov, 2019 13 commits