Antonio Niño Díaz [Wed, 31 Oct 2018 14:32:58 +0000 (15:32 +0100)]
Merge pull request #1655 from deepan02/deepak-arm/introduce-n1sdp
plat/arm: Introduce the N1SDP.
Antonio Niño Díaz [Wed, 31 Oct 2018 14:31:32 +0000 (15:31 +0100)]
Merge pull request #1659 from vwadekar/sdei-fix-compilation
sdei: include "context.h" to fix compilation errors
Antonio Niño Díaz [Wed, 31 Oct 2018 11:02:22 +0000 (12:02 +0100)]
Merge pull request #1646 from Andre-ARM/allwinner/pmic-v2
Allwinner/pmic v2
Varun Wadekar [Wed, 31 Oct 2018 00:05:59 +0000 (17:05 -0700)]
sdei: include "context.h" to fix compilation errors
This patch includes context.h from sdei_private.h to fix the
following compilation errors:
<snip>
In file included from services/std_svc/sdei/sdei_event.c:9:0:
services/std_svc/sdei/sdei_private.h: In function 'sdei_client_el':
services/std_svc/sdei/sdei_private.h:164:2: error: unknown type name 'cpu_context_t'
cpu_context_t *ns_ctx = cm_get_context(NON_SECURE);
^
services/std_svc/sdei/sdei_private.h:165:2: error: unknown type name 'el3_state_t'
el3_state_t *el3_ctx = get_el3state_ctx(ns_ctx);
^
services/std_svc/sdei/sdei_private.h:165:2: error: implicit declaration of function 'get_el3state_ctx' [-Werror=implicit-function-declaration]
services/std_svc/sdei/sdei_private.h:165:25: error: initialization makes pointer from integer without a cast [-Werror]
el3_state_t *el3_ctx = get_el3state_ctx(ns_ctx);
^
services/std_svc/sdei/sdei_private.h:167:2: error: implicit declaration of function 'read_ctx_reg' [-Werror=implicit-function-declaration]
return ((read_ctx_reg(el3_ctx, CTX_SCR_EL3) & SCR_HCE_BIT) != 0U) ?
^
services/std_svc/sdei/sdei_private.h:167:33: error: 'CTX_SCR_EL3' undeclared (first use in this function)
return ((read_ctx_reg(el3_ctx, CTX_SCR_EL3) & SCR_HCE_BIT) != 0U) ?
^
services/std_svc/sdei/sdei_private.h:167:33: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
<snip>
Change-Id: Id0cad56accf81b19cb0d301784f3f086dd052722
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Antonio Niño Díaz [Tue, 30 Oct 2018 15:06:41 +0000 (16:06 +0100)]
Merge pull request #1652 from antonio-nino-diaz-arm/an/decouple-arm
poplar, warp7, ls1043: Decouple from plat/arm files
Antonio Niño Díaz [Tue, 30 Oct 2018 14:48:02 +0000 (15:48 +0100)]
Merge pull request #1651 from antonio-nino-diaz-arm/an/rand-misra
Fix some MISRA defects
Antonio Niño Díaz [Tue, 30 Oct 2018 14:47:48 +0000 (15:47 +0100)]
Merge pull request #1649 from Yann-lms/stm32mp1_doc_update
docs: stm32mp1: complete compilation and flashing steps
Antonio Nino Diaz [Fri, 26 Oct 2018 10:13:23 +0000 (11:13 +0100)]
warp7, ls1043: Remove unneeded include paths
include/plat/arm/common isn't needed by them, and is removed to avoid
dependency on Arm platform code.
Change-Id: Id9fccba33326fd075b3d1029bf1e4b012dfa0483
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 26 Oct 2018 10:12:31 +0000 (11:12 +0100)]
poplar: Decouple from plat/arm files
plat/arm files should only be used by Arm platforms. If other platforms
use them, they create dependencies that can introduce problems when
updating Arm platforms.
This patch copies the needed code from Arm platforms so that poplar can
be independent from them.
Change-Id: I0b194f5bdb0377b8ccacbd400e021614c026c7fe
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 25 Oct 2018 16:38:23 +0000 (17:38 +0100)]
Fix MISRA defects in PMF
No functional changes.
Change-Id: I64abd72026082218a40b1a4b8f7dc26ff2478ba6
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 25 Oct 2018 16:11:02 +0000 (17:11 +0100)]
Fix MISRA defects in workaround and errata framework
No functional changes.
Change-Id: Iaab0310848be587b635ce5339726e92a50f534e0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 25 Oct 2018 15:53:04 +0000 (16:53 +0100)]
plat/arm: Fix MISRA defects in SiP SVC handler
No functional changes.
Change-Id: I9b9f8d3dfde08d57706ad5450de6ff858a55ac01
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 25 Oct 2018 15:52:26 +0000 (16:52 +0100)]
Fix MISRA defects in extension libs
No functional changes.
Change-Id: I2f28f20944f552447ac4e9e755493cd7c0ea1192
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Deepak Pandey [Wed, 8 Aug 2018 05:02:51 +0000 (10:32 +0530)]
plat/arm: Introduce the N1SDP.
This patch adds support for the N1SDP (NeoVerse N1 System Development
Platform). It is an initial port and additional features are expected
to be added later.
The port includes only BL31 support as the System Control Processor
(SCP) is expected to take the role of primary boatloader
Change-Id: Ife17d8215a7bfcc1420204a72205e7ef920d0c10
Signed-off-by: Deepak Pandey <Deepak.Pandey@arm.com>
Soby Mathew [Mon, 29 Oct 2018 11:45:10 +0000 (11:45 +0000)]
Merge pull request #1654 from antonio-nino-diaz-arm/an/meson-console
meson: console: Add missing define to fix build
Antonio Nino Diaz [Mon, 29 Oct 2018 11:35:34 +0000 (11:35 +0000)]
meson: console: Add missing define to fix build
It isn't possible to build this driver without adding this define.
Change-Id: Iba2ced411cd8ce438787871fa01b414d32b9aa42
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Soby Mathew [Mon, 29 Oct 2018 10:56:30 +0000 (10:56 +0000)]
Merge pull request #1644 from soby-mathew/sm/pie_proto
Position Indepedent Executable (PIE) Support
Soby Mathew [Mon, 29 Oct 2018 10:27:22 +0000 (10:27 +0000)]
Merge pull request #1616 from antonio-nino-diaz-arm/an/gxbb
Initial port of Amlogic Meson S905 (GXBB)
Soby Mathew [Sun, 14 Oct 2018 07:13:44 +0000 (08:13 +0100)]
FVP: Enable PIE for RESET_TO_BL31=1
This patch enabled PIE for FVP when RESET_TO_BL31=1. The references
to BL31_BASE are replaced by BL31_START as being a symbol exported by
the linker, will create a dynamic relocation entry in .rela.dyn and
hence will be fixed up by dynamic linker at runtime. Also, we disable
RECLAIM_INIT_CODE when PIE is enabled as the init section overlay
creates some static relocations which cannot be handled by the
dynamic linker currently.
Change-Id: I86df1b0a8b2a8bbbe7c3f3c0b9a08c86c2963ec0
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Fri, 12 Oct 2018 16:08:28 +0000 (17:08 +0100)]
plat/arm: Use `mov_imm` macro to load immediate values
This patch makes use of mov_imm macro where possible to load
immediate values within ARM platform layer.
Change-Id: I02bc7fbc1fa334c9fccf76fbddf515952f9a1298
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Sun, 14 Oct 2018 07:09:22 +0000 (08:09 +0100)]
PIE: Position Independant Executable support for BL31
This patch introduces Position Independant Executable(PIE) support
in TF-A. As a initial prototype, only BL31 can support PIE. A trivial
dynamic linker is implemented which supports fixing up Global Offset
Table(GOT) and Dynamic relocations(.rela.dyn). The fixup_gdt_reloc()
helper function implements this linker and this needs to be called
early in the boot sequence prior to invoking C functions. The GOT is
placed in the RO section of BL31 binary for improved security and the
BL31 linker script is modified to export the appropriate symbols
required for the dynamic linker.
The C compiler always generates PC relative addresses to linker symbols
and hence referencing symbols exporting constants are a problem when
relocating the binary. Hence the reference to the
`__PERCPU_TIMESTAMP_SIZE__` symbol in PMF is removed and is now calculated
at runtime based on start and end addresses.
Change-Id: I1228583ff92cf432963b7cef052e95d995cca93d
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Mon, 17 Sep 2018 03:34:35 +0000 (04:34 +0100)]
Make errata reporting mandatory for CPU files
Previously the errata reporting was optional for CPU operation
files and this was achieved by making use of weak reference to
resolve to 0 if the symbol is not defined. This is error prone
when adding new CPU operation files and weak references are
problematic when fixing up dynamic relocations. Hence this patch
removes the weak reference and makes it mandatory for the CPU
operation files to define the errata reporting function.
Change-Id: I8af192e19b85b7cd8c7579e52f8f05a4294e5396
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Fri, 12 Oct 2018 15:40:28 +0000 (16:40 +0100)]
PIE: Use PC relative adrp/adr for symbol reference
This patch fixes up the AArch64 assembly code to use
adrp/adr instructions instead of ldr instruction for
reference to symbols. This allows these assembly
sequences to be Position Independant. Note that the
the reference to sizes have been replaced with
calculation of size at runtime. This is because size
is a constant value and does not depend on execution
address and using PC relative instructions for loading
them makes them relative to execution address. Also
we cannot use `ldr` instruction to load size as it
generates a dynamic relocation entry which must *not*
be fixed up and it is difficult for a dynamic loader
to differentiate which entries need to be skipped.
Change-Id: I8bf4ed5c58a9703629e5498a27624500ef40a836
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Tue, 28 Aug 2018 10:13:55 +0000 (11:13 +0100)]
Basic Makefile changes for PIE
Change-Id: I0b8ccba15024c55bb03927cdb50370913eb8010c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Soby Mathew [Fri, 12 Oct 2018 15:26:20 +0000 (16:26 +0100)]
Add helper to return reference to a symbol
This patch adds a utility function to return
the address of a symbol. By default, the compiler
generates adr/adrp instruction pair to return
the reference and this utility is used to override
this compiler generated to code and use `ldr`
instruction.
This is needed for Position Independent Executable
when it needs to reference a symbol which is constant
and does not depend on the execute address of the
binary.
For example, on the FVP, the GICv3 register context is
stored in a secure carveout (arm_el3_tzc_dram) within
DDR and does not relocate with the BL image. Now if
BL31 is executing at a different address other than
the compiled address, using adrp/adr instructions to
reference this memory will not work as they generate an
address that is PC relative. The way to get around this
problem is to reference it as non-PC relative (i.e
non-relocatable location) via `ldr` instruction.
Change-Id: I5008a951b007144258121690afb68dc8e12ee6f7
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Antonio Niño Díaz [Fri, 26 Oct 2018 14:18:03 +0000 (16:18 +0200)]
Merge pull request #1647 from antonio-nino-diaz-arm/an/setup-xlat
Improvements to setup page tables code
Roberto Vargas [Fri, 19 Oct 2018 15:44:18 +0000 (16:44 +0100)]
Convert arm_setup_page_tables into a generic helper
This function is not related to Arm platforms and can be reused by other
platforms if needed.
Change-Id: Ia9c328ce57ce7e917b825a9e09a42b0abb1a53e8
Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 19 Oct 2018 15:52:22 +0000 (16:52 +0100)]
xlat: Fix compatibility between v1 and v2
There are several platforms using arm_setup_page_tables(), which is
supposed to be Arm platform only. This creates several dependency
problems between platforms.
This patch adds the definition XLAT_TABLES_LIB_V2 to the xlat tables lib
v2 makefile. This way it is possible to detect from C code which version
is being used and include the correct header.
The file arm_xlat_tables.h has been renamed to xlat_tables_compat.h and
moved to a common folder. This way, when in doubt, this header can be
used to guarantee compatibility, as it includes the correct header based
on XLAT_TABLES_LIB_V2.
This patch also removes the usage of ARM_XLAT_TABLES_V1 from QEMU (so
that is now locked in xlat lib v2) and ZynqMP (where it was added as a
workaround).
Change-Id: Ie1e22a23b44c549603d1402a237a70d0120d3e04
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 10 Oct 2018 22:52:39 +0000 (23:52 +0100)]
docs: gxbb: Add documentation
Change-Id: Ie2465c1ccc482bd8eb5e5a71c580543095e4ba94
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 10 Oct 2018 22:50:35 +0000 (23:50 +0100)]
gxbb: Workaround for PSCI_CPU_OFF
There seems to be a problem where SCP can't turn CPU0 off. Instead of
returning PSCI_E_DENIED or crashing make CPU0 wait in a WFE loop. This
way all CPUs have a consistent behaviour from the point of view of the
caller.
Change-Id: I5c8c266ca3b69c9e7a4f5ae70afeea5dd36a0825
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 5 Oct 2018 19:42:42 +0000 (20:42 +0100)]
gxbb: Implement PSCI_CPU_OFF
This works fine for CPU1-3, but it fails for CPU0, where it is simply
ignored and leaves CPU0 in a WFI loop.
Change-Id: I7d73683fdd894f2021d6a5bc2cce6cd03e18e633
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 18 Sep 2018 00:36:00 +0000 (01:36 +0100)]
gxbb: Initial port of Amlogic Meson S905 (GXBB)
The Amlogic Meson S905 is a SoC with a quad core Arm Cortex-A53 running
at 1.5Ghz. It also contains a Cortex-M3 used as SCP.
This port is a minimal implementation of BL31 capable of booting
mainline U-Boot and Linux:
- Partial SCPI support.
- Basic PSCI support (CPU_ON, SYSTEM_RESET, SYSTEM_OFF).
- GICv2 driver set up.
- Basic SIP services (read efuse data, enable/disable JTAG).
This port has been tested in an ODROID-C2.
Change-Id: Ia4bc82d7aca42a69d6b118b947279f82b3f6c6da
Tested-by: Amit Singh Tomar <amittomer25@gmail.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 15 Aug 2018 21:07:35 +0000 (22:07 +0100)]
meson: console: Introduce console driver
It has only been tested with a system clock of 24 MHz.
It has only been implemented for the multi console API.
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Thu, 25 Oct 2018 13:00:38 +0000 (15:00 +0200)]
Merge pull request #1638 from chandnich/sgi575-update
Sgi575 update
Antonio Niño Díaz [Thu, 25 Oct 2018 09:54:57 +0000 (11:54 +0200)]
Merge pull request #1636 from antonio-nino-diaz-arm/an/console
Deprecate weak crash console functions
Antonio Niño Díaz [Thu, 25 Oct 2018 09:54:22 +0000 (11:54 +0200)]
Merge pull request #1640 from soby-mathew/sm/fin_con_reg
Multi-console: Deprecate the `finish_console_register` macro
Antonio Nino Diaz [Wed, 17 Oct 2018 15:49:26 +0000 (16:49 +0100)]
Deprecate weak crash console functions
The default behaviour of the plat_crash_console_xxx functions isn't
obvious to someone that hasn't read all the documentation. As they are
not mandatory, it is unlikely that the code will be checked when doing a
platform port, which may mean that some platforms may not have crash
console support at all.
The idea of this patch is to force platform maintainers to decide how
the crash console has to behave so that the final behaviour isn't
unexpected.
Change-Id: I40b2a7b56c5530c1dcd63eace5bd37ae6335056e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 16 Oct 2018 15:39:12 +0000 (16:39 +0100)]
rockchip: Use common crash console functions
This platform depends on weak functions defined in
``plat/common/aarch64/platform_helpers.S`` that are going to be removed.
Change-Id: I5104d091c32271d77ed9690e9dc257c061289def
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 16 Oct 2018 13:32:34 +0000 (14:32 +0100)]
Add sample crash console functions
Platforms that wish to use the sample functions have to add the file to
their Makefile. It is not included by default.
Change-Id: I713617bb58dc218967199248f68da86241d7ec40
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 16 Oct 2018 13:10:15 +0000 (14:10 +0100)]
plat/arm: Make crash console functions strong
In Arm platforms the crash console doesn't print anything if the crash
happens early enough. This happens in all images, not only BL1. The
reason is that they the files ``plat/common/aarch64/platform_helpers.S``
and ``plat/arm/common/aarch64/arm_helpers.S``, and the crash console
functions are defined as weak in both files. In practice, the linker
can pick the one in ``plat/common``, which simply switches the multi
console to crash mode when it wants to initialize the crash console.
In the case of Arm platforms, there are no console drivers registered
at that point, so nothing is printed.
This patch makes the functions in plat/arm strong so that they override
the weak functions in plat/common.
Change-Id: Id358db7d2567d7df0951790a695636cf6c9ac57f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 17 Oct 2018 14:29:34 +0000 (15:29 +0100)]
Add plat_crash_console_flush to platforms without it
Even though at this point plat_crash_console_flush is optional, it will
stop being optional in a following patch.
The console driver of warp7 doesn't support flush, so the implementation
is a placeholder.
TI had ``plat_crash_console_init`` and ``plat_crash_console_putc``, but
they weren't global so they weren't actually used. Also, they were
calling the wrong functions.
imx8_helpers.S only has placeholders for all of the functions.
Change-Id: I8d17bbf37c7dad74e134c61ceb92acb9af497718
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 17 Oct 2018 15:46:41 +0000 (16:46 +0100)]
zynqmp: Remove dependency on arm_helpers.S
Non-Arm platforms shouldn't use Arm platform code. This patch copies the
implementation of the functions in arm_helpers.S to zynqmp_helpers.S to
remove this dependency of zynqmp on Arm platforms.
Change-Id: Ia85f303c4c63bcf0ffa57c7f3ef9d88376729b6b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Wed, 24 Oct 2018 15:54:05 +0000 (17:54 +0200)]
Merge pull request #1637 from antonio-nino-diaz-arm/an/rpi3-dtb
rpi3: Add mem reserve region to DTB if present
Antonio Nino Diaz [Thu, 18 Oct 2018 23:57:16 +0000 (00:57 +0100)]
rpi3: Add mem reserve region to DTB if present
When a device tree blob is present at a known address, instead of, for
example, relying on the user modifying the Linux command line to warn
about the memory reserved for the Trusted Firmware, pass it on the DTB.
The current code deletes the memory reserved for the default bootstrap
of the Raspberry Pi and adds the region used by the Trusted Firmware.
This system replaces the previous one consisting on adding
``memmap=16M$256M`` to the Linux command line. It's also meant to be
used by U-Boot and any other bootloader that understands DTB files.
Change-Id: I13ee528475fb043d6e8d9e9f24228e37ac3ac436
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Wed, 24 Oct 2018 09:30:18 +0000 (11:30 +0200)]
Merge pull request #1643 from antonio-nino-diaz-arm/an/libfdt
Update libfdt to version 1.4.7
Antonio Niño Díaz [Wed, 24 Oct 2018 09:30:09 +0000 (11:30 +0200)]
Merge pull request #1639 from chandnich/scmi-update
plat/arm/scmi: introduce plat_css_get_scmi_info API
Antonio Niño Díaz [Wed, 24 Oct 2018 09:29:57 +0000 (11:29 +0200)]
Merge pull request #1641 from jeenu-arm/ptrauth
AArch64: Enable lower ELs to use pointer authentication
Yann Gautier [Wed, 24 Oct 2018 08:50:12 +0000 (10:50 +0200)]
docs: stm32mp1: complete compilation and flashing steps
Add U-Boot compilation information.
Add a chapter about how to populate SD-card.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Antonio Nino Diaz [Thu, 18 Oct 2018 23:56:54 +0000 (00:56 +0100)]
libfdt: Import version v1.4.7
Change-Id: Iad7adaf0b16a3d086594cb3432210ac2c4e207f8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 18 Oct 2018 23:56:46 +0000 (00:56 +0100)]
libfdt: Remove current version
The current version of libfdt (1.4.2) has been modified to integrate it
in this repository. In order to do a clean import it is needed to remove
the current version first.
Change-Id: I2cab8c8e5632280d282fa7a2f2339768a0ad1e0f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Tue, 23 Oct 2018 17:31:08 +0000 (18:31 +0100)]
juno: Increase BL2 max size
Version 1.4.7 of libfdt is bigger than the current one (1.4.2) and the
current reserved space for BL2 in Juno isn't enough to fit the Trusted
Firmware when compiling with clang or armclang.
Change-Id: I7b73394ca60d17f417773f56dd5b3d54495a45a8
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 18 Oct 2018 23:57:10 +0000 (00:57 +0100)]
libc: Integrate strrchr in libc
Change-Id: I3ddc07cb02d73cd7614af7a5b21827aae155f9a0
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Thu, 18 Oct 2018 23:57:01 +0000 (00:57 +0100)]
libc: Import strrchr from FreeBSD
Imported from lib/libc/string/strrchr.c from commit:
59fd2fb98e4cc7e9bfc89598e28e21d405fd470c
Change-Id: I898206c6f0372d4d211c149ec0fb9522d0a5b01c
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Tue, 23 Oct 2018 16:11:52 +0000 (18:11 +0200)]
Merge pull request #1648 from jforissier/qemu-dt-1M
qemu: increase PLAT_QEMU_DT_MAX_SIZE to 1 MiB
Antonio Niño Díaz [Tue, 23 Oct 2018 13:39:01 +0000 (15:39 +0200)]
Merge pull request #1645 from antonio-nino-diaz-arm/an/fix-windows
Makefile: Fix verbose builds on Windows
Antonio Niño Díaz [Tue, 23 Oct 2018 13:05:31 +0000 (15:05 +0200)]
Merge pull request #1634 from antonio-nino-diaz-arm/an/tzc
tzc: Fix MISRA defects
Antonio Nino Diaz [Mon, 15 Oct 2018 13:58:11 +0000 (14:58 +0100)]
tzc: Fix MISRA defects
The definitions FAIL_CONTROL_*_SHIFT were incorrect, they have been
fixed.
The types tzc_region_attributes_t and tzc_action_t have been removed and
replaced by unsigned int because it is not allowed to do logical
operations on enums.
Also, fix some address definitions in arm_def.h.
Change-Id: Id37941d76883f9fe5045a5f0a4224c133c504d8b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Andre Przywara [Thu, 27 Sep 2018 23:43:32 +0000 (00:43 +0100)]
allwinner: Use the arisc to turn off ARM cores
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 14 Oct 2018 10:45:41 +0000 (11:45 +0100)]
allwinner: Prepare for executing code on the management processor
The more recent Allwinner SoCs contain an OpenRISC management
controller (called arisc or CPUS), which shares the bus with the ARM cores,
but runs on a separate power domain. This is meant to handle power
management with the ARM cores off.
There are efforts to run sophisticated firmware on that core
(communicating via SCPI with the ARM world), but for now can use it for
the rather simple task of helping to turn the ARM cores off. As this
cannot be done by ARM code itself (because execution stops at the
first of the three required steps), we can offload some instructions to
this management processor.
This introduces a helper function to hand over a bunch of instructions
and triggers execution. We introduce a bakery lock to avoid two cores
trying to use that (single) arisc core. The arisc code is expected to
put itself into reset after is has finished execution.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Wed, 19 Sep 2018 20:17:00 +0000 (21:17 +0100)]
allwinner: PMIC: AXP803: Delay activation of DC1SW switch
There are reports that activating the DC1SW before certain other
regulators leads to the PMIC overheating and consequently shutting down.
To avoid this situation, delay the activation of the DC1SW line until
the very end, so those other lines are always activated earlier.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 16 Sep 2018 10:24:34 +0000 (11:24 +0100)]
allwinner: PMIC: AXP803: Setup basic voltage rails
Based on the just introduced PMIC FDT framework, we check the DT for more
voltage rails that need to be setup early:
- DCDC1 is typically the main board power rail, used for I/O pins, for
instance. The PMIC's default is 3.0V, but 3.3V is what most boards use,
so this needs to be adjusted as soon as possible.
- DCDC5 is supposed to be connected to the DRAM. The AXP has some
configurable reset voltage, but some boards get that wrong, so we better
set up this here to avoid over- or under-volting.
- DLDO1,2,3 and FLDO1 mostly drive some graphics related IP, some boards
need this to be up to enable HDMI or the LCD screen, so we get screen
output in U-Boot.
To get the right setup, but still being flexible, we query the DT for
the required voltage and whether that regulator is actually used. That
gives us some robust default setup U-Boot is happy with.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 16 Sep 2018 10:24:05 +0000 (11:24 +0100)]
allwinner: Scan AXP803 FDT node to setup initial power rails
Now that we have a pointer to the device tree blob, let's use that to
do some initial setup of the PMIC:
- We scan the DT for the compatible string to find the PMIC node.
- We switch the N_VBUSEN pin if the DT property tells us so.
- We scan over all regulator subnodes, and switch DC1SW if there is at
least one other node referencing it (judging by the existence of a
phandle property in that subnode).
This is just the first part of the setup, a follow up patch will setup
voltages.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sat, 8 Sep 2018 18:18:37 +0000 (19:18 +0100)]
allwinner: Pass FDT address to sunxi_pmic_setup()
For Allwinner boards we now use some heuritistics to find a preloaded
.dtb file.
Pass this address on to the PMIC setup routine, so that it can use the
information contained therein to setup some initial power rails.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 16 Sep 2018 01:08:06 +0000 (02:08 +0100)]
allwinner: Find DTB in BL33 image
The initial PMIC setup for the Allwinner platform is quite board
specific, and used to be guarded by reading the .dtb stub *name* from the
SPL image in the legacy ATF port. This doesn't scale particularly well,
and requires constant maintainance.
Instead having the actual .dtb available would be much better, as the PMIC
setup requirements could be read from there directly.
The only available BL33 for Allwinner platforms so far is U-Boot, and
fortunately U-Boot comes with the full featured .dtb, appended to the
end of the U-Boot image.
Introduce some code that scans the beginning of the BL33 image to look
for the load address, which is followed by the image size. Adding those
two values together gives us the end of the image and thus the .dtb
address. Verify that this heuristic is valid by sanitising some values
and checking the DTB magic.
Print out the DTB address and the model name, if specified in the root
node.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sat, 15 Sep 2018 00:18:49 +0000 (01:18 +0100)]
allwinner: A64: Add AXP803 PMIC support to power off the board
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 14 Oct 2018 21:13:53 +0000 (22:13 +0100)]
allwinner: H6: Factor out I2C platform setup
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Wed, 13 Dec 2017 01:08:01 +0000 (01:08 +0000)]
allwinner: Add RSB driver
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Mon, 1 Oct 2018 23:21:53 +0000 (00:21 +0100)]
allwinner: H5: Implement power down for H5 reference design boards
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 14 Oct 2018 11:03:23 +0000 (12:03 +0100)]
allwinner: Introduce GPIO helper function
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 14 Oct 2018 11:02:02 +0000 (12:02 +0100)]
allwinner: Export sunxi_private.h
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Mon, 1 Oct 2018 23:21:49 +0000 (00:21 +0100)]
allwinner: A64/H5: Add basic and generic shutdown method
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sat, 8 Sep 2018 18:18:37 +0000 (19:18 +0100)]
allwinner: Pass SoC ID to sunxi_pmic_setup()
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Sun, 16 Sep 2018 23:03:09 +0000 (00:03 +0100)]
allwinner: Introduce names for SoC IDs
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Mon, 15 Oct 2018 23:58:22 +0000 (00:58 +0100)]
allwinner: H6: Fix SRAM size
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 11 Oct 2018 21:14:30 +0000 (22:14 +0100)]
allwinner: Disable USE_COHERENT_MEM
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 20 Sep 2018 20:13:55 +0000 (21:13 +0100)]
allwinner: Adjust memory mapping to fit into 256MB
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: Andre Przywara <andre.przywara@arm.com>
Andre Przywara [Thu, 27 Sep 2018 23:37:19 +0000 (00:37 +0100)]
allwinner: Unify platform.mk files
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: Andre Przywara <andre.przywara@arm.com>
Soby Mathew [Wed, 10 Oct 2018 15:03:09 +0000 (16:03 +0100)]
Multi-console: Deprecate the `finish_console_register` macro
The `finish_console_register` macro is used by the multi console
framework to register the `console_t` driver callbacks. It relied
on weak references to the `ldr` instruction to populate 0 to the
callback in case the driver has not defined the appropriate
function. Use of `ldr` instruction to load absolute address to a
reference makes the binary position dependant. These instructions
should be replaced with adrp/adr instruction for position independant
executable(PIE). But adrp/adr instructions don't work well with weak
references as described in GNU ld bugzilla issue 22589.
This patch defines a new version of `finish_console_register` macro
which can spcify which driver callbacks are valid and deprecates the
old one. If any of the argument is not specified, then the macro
populates 0 for that callback. Hence the functionality of the previous
deprecated macro is preserved. The USE_FINISH_CONSOLE_REG_2 define
is used to select the new variant of the macro and will be removed
once the deprecated variant is removed.
All the upstream console drivers have been migrated to use the new
macro in this patch.
NOTE: Platforms be aware that the new variant of the
`finish_console_register` should be used and the old variant is
deprecated.
Change-Id: Ia6a67aaf2aa3ba93932992d683587bbd0ad25259
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Antonio Nino Diaz [Fri, 19 Oct 2018 14:44:30 +0000 (15:44 +0100)]
Makefile: Fix verbose builds on Windows
Commit <
ee1ba6d4ddf1> ("Makefile: Support totally quiet output with -s")
broke verbose (V=1) builds on Windows. This patch fixes it by adding
helpers to silence echo prints in a OS-dependent way.
Change-Id: I24669150457516e9fb34fa32fa103398efe8082d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Jerome Forissier [Thu, 18 Oct 2018 14:41:25 +0000 (16:41 +0200)]
qemu: increase PLAT_QEMU_DT_MAX_SIZE to 1 MiB
Since upstream QEMU commit
14ec3cbd7c1e ("device_tree: Increase
FDT_MAX_SIZE to 1 MiB"), which is included in release v2.12.1
and later, BL2 initialization fails with the following error (-3 is
-FDT_ERR_NOSPACE):
ERROR: Invalid Device Tree at 0x40000000: error -3
Increase PLAT_QEMU_DT_MAX_SIZE accordingly.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Chandni Cherukuri [Thu, 11 Oct 2018 08:38:08 +0000 (14:08 +0530)]
plat/arm/scmi: introduce plat_css_get_scmi_info API
The default values of 'plat_css_scmi_plat_info' is not applicable for
all the platforms. There should be a provision to let platform code to
register a platform specific instance of scmi_channel_plat_info_t.
Add a new API 'plat_css_get_scmi_info' which lets the platform to
register a platform specific instance of scmi_channel_plat_info_t and
remove the default values.
In addition to this, the existing 'plat_css_scmi_plat_info' structure
is removed from the common code and instantiated for the platforms that
need it. This allows for a consistent provisioning of the SCMI channel
information across all the existing and upcoming platforms.
Change-Id: I4fb65d7f2f165b78697b4677f1e8d81edebeac06
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Chandni Cherukuri [Fri, 17 Aug 2018 05:53:46 +0000 (11:23 +0530)]
plat/arm/sgi: add system-id node in HW_CONFIG dts
Dynamically populating the 'system-id' node in the HW_CONFIG dts makes
it difficult to enforce memory overlap checks. So add the system-id node
in the HW_CONFIG dts file as a place holder with 'platform-id' and
'config-id' set to zero.
The code at BL2 stage determines the values of 'platform-id' and
'config-id' at runtime and updates the corresponding fields in the
system-id node of HW_CONFIG dts.
Change-Id: I2ca9980b994ac418da8afa0c72716ede10aff68a
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Chandni Cherukuri [Tue, 4 Sep 2018 09:16:49 +0000 (14:46 +0530)]
plat/arm/sgi: move fdts files to sgi575 board directory
To align the placement of ftds files with that of other Arm platforms,
move the ftds files from plat/arm/css/sgi/ to plat/arm/board/sgi575.
Change-Id: Id7c772eb5cf3d308d4e02a3c8099218e889a0e96
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Chandni Cherukuri [Tue, 14 Aug 2018 09:55:34 +0000 (15:25 +0530)]
plat/arm/sgi: remove unused code
On SGI platforms, the interconnect is setup by the SCP and so the
existing unused interconnect setup in sgi575 platform code can be
removed. As a result of this, sgi_plat_config.c and sgi_bl1_setup.c
files can be removed as these files are now empty or can be
substainated by the existing weak functions.
Change-Id: I3c883e4d1959d890bf2213a9be01f02551ea3a45
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Chandni Cherukuri [Fri, 10 Aug 2018 05:47:58 +0000 (11:17 +0530)]
plat/arm/sgi: reorganize platform macros
In preparation of adding support for upcoming SGI platforms, macros
common to all the SGI platforms are moved into sgi_base_platform_def.h
file. Macros that are specific to sgi575 platform remain in the
platform_def.h file. In addition to this, the platform_def.h file is
moved to sgi575 board directory. Also the ENT_CPU_SOURCES has been
renamed to SGI_CPU_SOURCES and moved from sgi-common.mk to board
specific makefile platform.mk
Change-Id: Iccdd9f070f4feea232b9fbf4fdcc0ef2e8eccbf2
Signed-off-by: Chandni Cherukuri <chandni.cherukuri@arm.com>
Soby Mathew [Thu, 18 Oct 2018 09:44:53 +0000 (10:44 +0100)]
Merge pull request #1632 from Yann-lms/stm32mp1_mmc
Add MMC support for STM32MP1
Soby Mathew [Thu, 18 Oct 2018 08:54:55 +0000 (09:54 +0100)]
Merge pull request #1582 from ldts/rcar_gen3/upstream
rcar_gen3: initial support
Soby Mathew [Thu, 18 Oct 2018 08:49:03 +0000 (09:49 +0100)]
Merge pull request #1553 from glneo/dcache-late-disable
Allow D-Cache to remain on during core power-down
Soby Mathew [Thu, 18 Oct 2018 08:35:14 +0000 (09:35 +0100)]
Merge pull request #1629 from robertovargas-arm/hw-assisted-coherency-lock
Optimize bakery locks when HW_ASSISTED_COHERENCY is enabled
Soby Mathew [Thu, 18 Oct 2018 08:34:20 +0000 (09:34 +0100)]
Merge pull request #1631 from deepan02/deepak-arm/relocate-jump_if_cpu_midr
plat/arm: relocate the jump_if_cpu_midr macro.
Soby Mathew [Thu, 18 Oct 2018 08:20:04 +0000 (09:20 +0100)]
Merge pull request #1628 from antonio-nino-diaz-arm/an/sharing
plat/arm: Small reorganization of platform code
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:42:08 +0000 (09:42 +0200)]
rcar_gen3: drivers: watchdog
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:53 +0000 (09:41 +0200)]
rcar_gen3: drivers: serial controller interface
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:39 +0000 (09:41 +0200)]
rcar_gen3: drivers: spi multio bus controller
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:21 +0000 (09:41 +0200)]
rcar_gen3: drivers: rom api
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:10 +0000 (09:41 +0200)]
rcar_gen3: drivers: power controller
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:41:00 +0000 (09:41 +0200)]
rcar_gen3: drivers: console
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:40:45 +0000 (09:40 +0200)]
rcar_gen3: drivers: io [emmc/mem]
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:40:26 +0000 (09:40 +0200)]
rcar_gen3: drivers: i2c dvfs
Signed-off-by: ldts <jramirez@baylibre.com>
Jorge Ramirez-Ortiz [Sun, 23 Sep 2018 07:39:56 +0000 (09:39 +0200)]
rcar_gen3: drivers: emmc
Signed-off-by: ldts <jramirez@baylibre.com>