summaryrefslogtreecommitdiff
path: root/plat
AgeCommit message (Collapse)Author
2016-06-02sun50i: platform.mk: rewrap source file listingAndre Przywara
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: introduce get_highest_el() functionalityAndre Przywara
Add a function to get the highest implemented exception level and use that for entering BL3-3 in. Also we make the bit-size we enter non-secure world a parameter, so that we can easily switch between AArch32 and AArch64. (HACK: Keep entering U-Boot still in AArch32 SVC for now.) Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: remove unneeded platform specific address definitionsAndre Przywara
sun50iw1p1.h contains a lot of register addresses and platform specific defines, the vast majority of them both unused by the code and also not needed for a bl31 setup. Remove the header file and pull the actually needed definitions into sunxi_def.h. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: clean up serial (debug) driverAndre Przywara
The serial debug driver is hard to read. Also it uses a C struct to describe a fixed hardware device' register layout. Clean up the code to be more readable and switch to the usual (BASE_ADDR + REG_OFFSET) scheme for accessing registers. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: remove unneeded sunxi_config_setup()Andre Przywara
This function does nothing, apparently it was copied from the FVP code. Remove its definition and the call. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: define empty print_plat_interconnect_regsAndre Przywara
Instead of commenting the routine from FVP and the call, simply define the print_plat_interconnect_regs macros as empty, which is the recommended way in case there is no interconnect information available. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: MMU setup: remove unneeded EL1 versionAndre Przywara
We have macros to generate define and populate the memory map structures, but in fact need only one instance for EL3, as sunxi does not need EL1 page tables. Remove the unneeded code. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: remove unneeded TSP implementationAndre Przywara
The TSP is just for testing a secure payload, which we don't need, so just remove the code. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: remove unneeded BL1 and BL2 codeAndre Przywara
The sun50i port only uses BL31, so there is no need for then BL1 and BL2 code files (copied from the FVP port). Remove them. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: remove unneeded AEM and A57 codeAndre Przywara
No need to compile those code in. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: clean up sunxi_security codeAndre Przywara
Remove dead code, unused definitions and stream-line the code. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-06-02sun50i: simplify topology setupAndre Przywara
The topology code was apparently copied from the ARM FVP model, which is very versatile and allows for a sophisticated, configurable topology setup. Allwinner SoC on the other hand are at best multi-cluster - the A64 in fact has only one cluster. Simplify the sunxi specific topology code to support two affinity levels at most - this drastically reduces the code size and makes it much more readable. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-02-16sun50i: remove unused sunxi_gic_initAndre Przywara
2016-02-16sun50i: remove unused CCI initAndre Przywara
2016-02-16sun50i: fix timer frequencyAndre Przywara
The architected timer is hardwired to be driven by the 24 MHz clock. Remove all code that tries to determine this dynamically. Also fix the actual number, which is not 24 * 2^20, but 24 * 10^6 Hz. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2016-02-16sun50i: platform.S: clean up serial consoleAndre Przywara
Add some constants to the console code to make it more readable.
2016-02-06sun50i: plat_helpers.S cleanupAndre Przywara
A lot of code is not needed: - no need for empty function which have a default implementation - no need for A57 code and Juno workarounds - no need for specific core enumeration in a single cluster SoC
2016-02-04sun50i: bl33_entry: reactivate code (but still use SVC32)Andre Przywara
2016-02-04arisc: make debug macros -pedantic compatibleAndre Przywara
Allwinner removed "-pedantic" from the list of CFLAGS to get away with some conditional debug macros using a GNU extension. Fix those macros to use a standard compliant syntax and re-enable -pedantic.
2016-02-04Merge in files from Allwinners lichee BSP tarballAndre Przywara
The Pine64 Wiki[1] links to a BSP tarball, among other things containing a dump of an ARM Trusted Firmware source tree with Allwinner changes on top. Since the tarball does not contain any version history information about the changes, this commit is just the diff between the ATF 1.0 release and the files from the Allwinner provided tarball. The executable flag from many source has been removed. [1] http://wiki.pine64.org/index.php/Pine_A64_Software_Release#Linux_BSP_Related
2014-08-27Miscellaneous documentation fixesSandrine Bailleux
This patch gathers miscellaneous minor fixes to the documentation, and comments in the source code. Change-Id: I631e3dda5abafa2d90f464edaee069a1e58b751b Co-Authored-By: Soby Mathew <soby.mathew@arm.com> Co-Authored-By: Dan Handley <dan.handley@arm.com>
2014-08-21Rationalize UART usage among different BL stagesSoby Mathew
This patch changes the UART port assignment for various BL stages so as to make it consistent on the platform ports. The BL1, BL2 and BL3-1 now uses UART0 on the FVP port and SoC UART0 on the Juno port. The BL3-2 uses UART2 on the FVP port and FPGA UART0 on the Juno port. This provides an interim fix to ARM-software/tf-issues#220 until support is added for changing the UART port for a BL image between cold boot and runtime. Change-Id: Iae5faea90be3d59e41e597b34a902f93e737505a
2014-08-21Juno: Read primary CPU MPID from SCC GPR_1Juan Castillo
This patch removes the PRIMARY_CPU definition hardcoded in the Juno port. Instead, the primary CPU is obtained at runtime by reading the SCC General Purpose Register 1 (GPR_1), whose value is copied by the SCP into shared memory during the boot process. Change-Id: I3981daa92eb7142250712274cf7f655b219837f5
2014-08-21Juno: Implement PSCI SYSTEM_OFF and SYSTEM_RESET APIsJuan Castillo
This patch adds the Juno platform specific handlers for PSCI SYSTEM_OFF and SYSTEM_RESET operations. Change-Id: Ie389adead533ec2314af44d721b4d0f306147c7d
2014-08-21Juno: Add support for Test Secure-EL1 PayloadSandrine Bailleux
This patch implements the TSP on Juno. It executes from on-chip Trusted SRAM. Also, the other bootloader images (i.e. BL1 R/W, BL2 and BL3-1) have been moved around. The reason is, although there was enough space overall to store the TSP in SRAM, there was no contiguous free chunk of SRAM big enough to hold it. This patch keeps the overall memory layout (i.e. keeping BL1 R/W at the bottom, BL2 at the top and BL3-1 in between) but moves the base addresses of all the bootloader images in such a way that: - memory fragmentation is reduced enough to fit BL3-2 in; - new base addresses are suitable for release builds as well as debug ones; - each image has a few extra kilobytes for future growth. BL3-1 and BL3-2 are the images which received the biggest allocations since they will most probably grow the most. This patch also adds instruction synchronization barriers around the code which handles the timer interrupt in the TSP. This ensures that the interrupt is not acknowledged after or EOIed before it is deactivated at the peripheral. Change-Id: I1c5b51858700027ee283ac85d18e06863a27c72e
2014-08-21Juno: Implement PSCI CPU_OFF and CPU_SUSPEND APIsAchin Gupta
This patch adds support for PSCI CPU_OFF and CPU_SUSPEND APIs to the Juno port of the ARM Trusted Firmware. The maximum affinity level that can be suspended is the cluster level (affinity level 1). Support for suspending the system level is not present. Change-Id: Ie2c9da0acd7d1b0d5ac64940cdf40347153e52c8
2014-08-21Juno: Implement initial platform portSandrine Bailleux
This patch adds the initial port of the ARM Trusted Firmware on the Juno development platform. This port does not support a BL3-2 image or any PSCI APIs apart from PSCI_VERSION and PSCI_CPU_ON. It enables workarounds for selected Cortex-A57 (#806969 & #813420) errata and implements the workaround for a Juno platform errata (Defect id 831273). Change-Id: Ib3d92df3af53820cfbb2977582ed0d7abf6ef893
2014-08-20Add CPU specific power management operationsSoby Mathew
This patch adds CPU core and cluster power down sequences to the CPU specific operations framework introduced in a earlier patch. Cortex-A53, Cortex-A57 and generic AEM sequences have been added. The latter is suitable for the Foundation and Base AEM FVPs. A pointer to each CPU's operations structure is saved in the per-cpu data so that it can be easily accessed during power down seqeunces. An optional platform API has been introduced to allow a platform to disable the Accelerator Coherency Port (ACP) during a cluster power down sequence. The weak definition of this function (plat_disable_acp()) does not take any action. It should be overriden with a strong definition if the ACP is present on a platform. Change-Id: I8d09bd40d2f528a28d2d3f19b77101178778685d
2014-08-20Add platform API for reset handlingSoby Mathew
This patch adds an optional platform API (plat_reset_handler) which allows the platform to perform any actions immediately after a cold or warm reset e.g. implement errata workarounds. The function is called with MMU and caches turned off. This API is weakly defined and does nothing by default but can be overriden by a platform with a strong definition. Change-Id: Ib0acdccbd24bc756528a8bd647df21e8d59707ff
2014-08-20Introduce framework for CPU specific operationsSoby Mathew
This patch introduces a framework which will allow CPUs to perform implementation defined actions after a CPU reset, during a CPU or cluster power down, and when a crash occurs. CPU specific reset handlers have been implemented in this patch. Other handlers will be implemented in subsequent patches. Also moved cpu_helpers.S to the new directory lib/cpus/aarch64/. Change-Id: I1ca1bade4d101d11a898fb30fea2669f9b37b956
2014-08-19Rework use of labels in assembly macros.Soby Mathew
This patch provides a workaround for the ASM_ASSERT label issue and also reworks the use of labels in assembly macros. If the caller of the ASM_ASSERT macro happened to use the label '1' to jump past the ASM_ASSERT macro, it would not have worked since the ASM_ASSERT macro internally used the same label. Hence, as a workaround, this patch makes the label a high number in the expectation that the caller will never use it. Also updated the other assembly macros using numerical labels to named lables. Change-Id: Iec892359db84f2391ad2a83a92141c4d7049776a
2014-08-19fvp: Rework when platform actions are performedAchin Gupta
This patch reworks FVP port's power management implementation to perform platform actions only when the platform exported hook is invoked for the highest affinity level to enter/exit the OFF state. For example, during a CPU_OFF operation, fvp_affinst_off() is called twice: for affinity level 0 and affinity level 1 (in that order). CPU specific operations are deferred until the next invocation if it is determined through a call to psci_get_max_phys_off_afflvl() that this is CPU is the last in the cluster. Similarly, during power up if the CPU is the first in the cluster, both CPU and cluster specific operations are performed when fvp_affinst_on_finish() is invoked for affinity level 1. Earlier, they were done across the two invocations of the handler. Change-Id: I4288ed3ba1385db36a69cc2e598deb219f209b8a
2014-08-19Add support for PSCI SYSTEM_OFF and SYSTEM_RESET APIsJuan Castillo
This patch adds support for SYSTEM_OFF and SYSTEM_RESET PSCI operations. A platform should export handlers to complete the requested operation. The FVP port exports fvp_system_off() and fvp_system_reset() as an example. If the SPD provides a power management hook for system off and system reset, then the SPD is notified about the corresponding operation so it can do some bookkeeping. The TSPD exports tspd_system_off() and tspd_system_reset() for that purpose. Versatile Express shutdown and reset methods have been removed from the FDT as new PSCI sys_poweroff and sys_reset services have been added. For those kernels that do not support yet these PSCI services (i.e. GICv3 kernel), the original dtsi files have been renamed to *-no_psci.dtsi. Fixes ARM-software/tf-issues#218 Change-Id: Ic8a3bf801db979099ab7029162af041c4e8330c8
2014-08-19Clarify platform porting interface to TSPDan Handley
* Move TSP platform porting functions to new file: include/bl32/tsp/platform_tsp.h. * Create new TSP_IRQ_SEC_PHY_TIMER definition for use by the generic TSP interrupt handling code, instead of depending on the FVP specific definition IRQ_SEC_PHY_TIMER. * Rename TSP platform porting functions from bl32_* to tsp_*, and definitions from BL32_* to TSP_*. * Update generic TSP code to use new platform porting function names and definitions. * Update FVP port accordingly and move all TSP source files to: plat/fvp/tsp/. * Update porting guide with above changes. Note: THIS CHANGE REQUIRES ALL PLATFORM PORTS OF THE TSP TO BE UPDATED Fixes ARM-software/tf-issues#167 Change-Id: Ic0ff8caf72aebb378d378193d2f017599fc6b78f
2014-08-14Simplify interface to TZC-400 driverDan Handley
The TZC-400 driver previously allowed the possibility of multiple controller instances to be present in the same executable. This was unnecessary since there will only ever be one instance. This change simplifies the tzc_init() function to only take the base address argument needed by implementation, conforming to the driver initialization model of other drivers. It also hides some of the implementation details that were previously exposed by the API. The FVP port has been updated accordingly. THIS CHANGE REQUIRES ALL PLATFORM PORTS THAT USE THE TZC-400 DRIVER TO BE UPDATED Fixes ARM-software/tf-issues#181 Change-Id: I7b721edf947064989958d8f457d6462d92e742c8
2014-08-14Move IO storage source to drivers directoryDan Handley
Move the remaining IO storage source file (io_storage.c) from the lib to the drivers directory. This requires that platform ports explicitly add this file to the list of source files. Also move the IO header files to a new sub-directory, include/io. Change-Id: I862b1252a796b3bcac0d93e50b11e7fb2ded93d6
2014-08-14Remove redundant io_init() functionDan Handley
The intent of io_init() was to allow platform ports to provide a data object (io_plat_data_t) to the IO storage framework to allocate into. The abstraction was incomplete because io_plat_data_t uses a platform defined constant and the IO storage framework internally allocates other arrays using platform defined constants. This change simplifies the implementation by instantiating the supporting objects in the IO storage framework itself. There is now no need for the platform to call io_init(). The FVP port has been updated accordingly. THIS CHANGE REQUIRES ALL PLATFORM PORTS THAT USE THE IO STORAGE FRAMEWORK TO BE UDPATED. Change-Id: Ib48ac334de9e538064734334c773f8b43df3a7dc
2014-08-14Remove platform dependency in CCI-400 driverDan Handley
* Create cci_init() function in CCI-400 driver to allow platform to provide arguments needed by the driver (i.e. base address and cluster indices for the ACE slave interfaces). * Rename cci_(en|dis)able_coherency to cci_(en|dis)able_cluster_coherency to make it clear that the driver only enables/disables the coherency of CPU clusters and not other devices connected to the CCI-400. * Update FVP port to use new cci_init() function and remove unnecessary CCI defintions from platform_def.h. Also rename fvp_cci_setup() to fvp_cci_enable() to more clearly differentiate between CCI initialization and enabling. THIS CHANGE REQUIRES PLATFORM PORTS THAT USE THE CCI-400 DRIVER TO BE UPDATED Fixes ARM-software/tf-issues#168 Change-Id: I1946a51409b91217b92285b6375082619f607fec
2014-08-14Merge pull request #184 from jcastillo-arm/jc/tf-issues/100danh-arm
FVP: make usage of Trusted DRAM optional at build time
2014-08-14FVP: make usage of Trusted DRAM optional at build timeJuan Castillo
This patch groups the current contents of the Trusted DRAM region at address 0x00_0600_0000 (entrypoint mailboxes and BL3-1 parameters) in a single shared memory area that may be allocated to Trusted SRAM (default) or Trusted DRAM at build time by setting the FVP_SHARED_DATA_LOCATION make variable. The size of this shared memory is 4096 bytes. The combination 'Shared data in Trusted SRAM + TSP in Trusted DRAM' is not currently supported due to restrictions in the maximum number of mmu tables that can be created. Documentation has been updated to reflect these changes. Fixes ARM-software/tf-issues#100 Change-Id: I26ff04d33ce4cacf8d770d1a1e24132b4fc53ff0
2014-08-12Merge pull request #183 from danh-arm/dh/print_output2danh-arm
Add concept of console output log levels Rationalize console log output
2014-08-12Rationalize console log outputDan Handley
Fix the following issues with the console log output: * Make sure the welcome string is the first thing in the log output (during normal boot). * Prefix each message with the BL image name so it's clear which BL the output is coming from. * Ensure all output is wrapped in one of the log output macros so it can be easily compiled out if necessary. Change some of the INFO() messages to VERBOSE(), especially in the TSP. * Create some extra NOTICE() and INFO() messages during cold boot. * Remove all usage of \r in log output. Fixes ARM-software/tf-issues#231 Change-Id: Ib24f7acb36ce64bbba549f204b9cde2dbb46c8a3
2014-08-12FVP: apply new naming conventions to memory regionsJuan Castillo
Secure ROM at address 0x0000_0000 is defined as FVP_TRUSTED_ROM Secure RAM at address 0x0400_0000 is defined as FVP_TRUSTED_SRAM Secure RAM at address 0x0600_0000 is defined as FVP_TRUSTED_DRAM BLn_BASE and BLn_LIMIT definitions have been updated and are based on these new memory regions. The available memory for each bootloader in the linker script is defined by BLn_BASE and BLn_LIMIT, instead of the complete memory region. TZROM_BASE/SIZE and TZRAM_BASE/SIZE are no longer required as part of the platform porting. FVP common definitions are defined in fvp_def.h while platform_def.h contains exclusively (with a few exceptions) the definitions that are mandatory in the porting guide. Therefore, platform_def.h now includes fvp_def.h instead of the other way around. Porting guide has been updated to reflect these changes. Change-Id: I39a6088eb611fc4a347db0db4b8f1f0417dbab05
2014-08-11Reduce the runtime stack size in BL stages.Soby Mathew
This patch separates the stack size for each BL stage and reduces it after stack usage analysis was done. Fixes ARM-software/tf-issues#200 Change-Id: I8edc6de2551b0a6788761d121937692b2149bb29
2014-08-04Merge pull request #179 from jcastillo-arm/jc/tf-issues/219danh-arm
Call platform_is_primary_cpu() only from reset handler
2014-08-01Rework the TSPD setup codeVikram Kanigiri
There is no mechanism which allows the TSPD to specify what SPSR to use when entering BL3-2 instead of BL3-3. This patch divides the responsibility between tspd_setup() and tspd_init() for initializing the TSPD and TSP to support the alternate BL3-2 initialization flow where BL3-1 handsover control to BL3-2 instead of BL3-3. SPSR generated by TSPD for TSP is preserved due the new division of labour which fixes #174. This patch also moves the cpu_context initialization code from tspd_setup() to tspd_init() immediately before entering the TSP. Instead tspd_setup() updates the BL3-2 entrypoint info structure with the state required for initializing the TSP later. Fixes ARM-software/TF-issues#174 Change-Id: Ida0a8a48d466c71d5b07b8c7f2af169b73f96940
2014-08-01Call platform_is_primary_cpu() only from reset handlerJuan Castillo
The purpose of platform_is_primary_cpu() is to determine after reset (BL1 or BL3-1 with reset handler) if the current CPU must follow the cold boot path (primary CPU), or wait in a safe state (secondary CPU) until the primary CPU has finished the system initialization. This patch removes redundant calls to platform_is_primary_cpu() in subsequent bootloader entrypoints since the reset handler already guarantees that code is executed exclusively on the primary CPU. Additionally, this patch removes the weak definition of platform_is_primary_cpu(), so the implementation of this function becomes mandatory. Removing the weak symbol avoids other bootloaders accidentally picking up an invalid definition in case the porting layer makes the real function available only to BL1. The define PRIMARY_CPU is no longer mandatory in the platform porting because platform_is_primary_cpu() hides the implementation details (for instance, there may be platforms that report the primary CPU in a system register). The primary CPU definition in FVP has been moved to fvp_def.h. The porting guide has been updated accordingly. Fixes ARM-software/tf-issues#219 Change-Id: If675a1de8e8d25122b7fef147cb238d939f90b5e
2014-07-28Merge pull request #177 from jcastillo-arm/jc/tf-issues/096danh-arm
Rework incorrect use of assert() and panic() in codebase
2014-07-28Merge pull request #172 from soby-mathew/sm/asm_assertdanh-arm
Introduce asm assert and optimize crash reporting
2014-07-28Merge pull request #169 from achingupta/ag/tf-issues#198danh-arm
Ag/tf issues#198