summaryrefslogtreecommitdiff
path: root/plat/hisilicon
AgeCommit message (Collapse)Author
2019-09-18hikey: fix to load FIP by partition table.Haojian Zhuang
Avoid to load FIP by hacking address. Load it by partition table instead. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Change-Id: I0283fc2e6e459bff14de19d92db4158e05106ee4
2019-09-18hikey960: fix to load FIP by partition tableHaojian Zhuang
Avoid to load FIP by hacking address. Load it by partition table instead. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Change-Id: Ib476d024a51e4b9705441a0007d78f9fdf0ca078
2019-08-01Switch AARCH32/AARCH64 to __aarch64__Julius Werner
NOTE: AARCH32/AARCH64 macros are now deprecated in favor of __aarch64__. All common C compilers pre-define the same macros to signal which architecture the code is being compiled for: __arm__ for AArch32 (or earlier versions) and __aarch64__ for AArch64. There's no need for TF-A to define its own custom macros for this. In order to unify code with the export headers (which use __aarch64__ to avoid another dependency), let's deprecate the AARCH32 and AARCH64 macros and switch the code base over to the pre-defined standard macro. (Since it is somewhat unintuitive that __arm__ only means AArch32, let's standardize on only using __aarch64__.) Change-Id: Ic77de4b052297d77f38fc95f95f65a8ee70cf200 Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-08-01Replace __ASSEMBLY__ with compiler-builtin __ASSEMBLER__Julius Werner
NOTE: __ASSEMBLY__ macro is now deprecated in favor of __ASSEMBLER__. All common C compilers predefine a macro called __ASSEMBLER__ when preprocessing a .S file. There is no reason for TF-A to define it's own __ASSEMBLY__ macro for this purpose instead. To unify code with the export headers (which use __ASSEMBLER__ to avoid one extra dependency), let's deprecate __ASSEMBLY__ and switch the code base over to the predefined standard. Change-Id: Id7d0ec8cf330195da80499c68562b65cb5ab7417 Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-07-23Use explicit-width data types in AAPCS parameter structsJulius Werner
It's not a good idea to use u_register_t for the members of aapcs64_params_t and aapcs32_params_t, since the width of that type always depends on the current execution environment. This would cause problems if e.g. we used this structure to set up the entry point of an AArch32 program from within an AArch64 program. (It doesn't seem like any code is doing that today, but it's probably still a good idea to write this defensively. Also, it helps with my next patch.) Change-Id: I12c04a85611f2b6702589f3362bea3e6a7c9f776 Signed-off-by: Julius Werner <jwerner@chromium.org>
2019-07-12Update hisilicon drivers to not rely on undefined overflow behaviourJustin Chadwell
This consists of ensuring that the left operand of each shift is unsigned when the operation might overflow into the sign bit. Change-Id: I67984b6c48c08af61e95a4dbd18047e2c3151f9a Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
2019-06-28Remove MULTI_CONSOLE_API flag and references to itAmbroise Vincent
The new API becomes the default one. Change-Id: Ic1d602da3dff4f4ebbcc158b885295c902a24fec Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-26hikey: Add define for UART2Michalis Pappas
Change-Id: I54869151bfc434df66933bd418c70cca9c3d0861 Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
2019-04-12Merge changes from topic "av/tls-heap" into integrationAntonio Niño Díaz
* changes: Mbed TLS: Remove weak heap implementation sgm: Fix bl2 sources
2019-04-12Mbed TLS: Remove weak heap implementationAmbroise Vincent
The implementation of the heap function plat_get_mbedtls_heap() becomes mandatory for platforms supporting TRUSTED_BOARD_BOOT. The shared Mbed TLS heap default weak function implementation is converted to a helper function get_mbedtls_heap_helper() which can be used by the platforms for their own function implementation. Change-Id: Ic8f2994e25e3d9fcd371a21ac459fdcafe07433e Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-10hikey960: Fix race condition between hotplug and idlesWei Yu
From the hotplug testing on Hikey960, in some case cores fail to become online in the system. When some cores are hotplugged off, if other cores in the same cluster enter into CPU idle states at the meantime, the cluster will be powered off. This introduces the state machine malfunction in the power controller, thus when hotplug on the core afterwards, it fails to boot up the core because the power controller thinks the cluster is powered on. This patch is to avoid race condition between hotplug and idles by preventing cluster power off when some of cores in the cluster are hotplugged off, if all cores in the same cluster are hotplugged off, the cluster can be powered off. Change-Id: Ib2feeb093357c70409a3536cb4f9da9b504fdcbe Signed-off-by: Wei Yu <yuwei3@hisilicon.com> Signed-off-by: Leo Yan <leo.yan@linaro.org>
2019-02-11hikey960: enable IOMCU DMACRyan Grachek
There exists a third DMA controller on the hi3660 SoC called the IOMCU DMAC. This controller is used by peripherals like SPI2 and UART3. Initialize channels 4-7 as non-secure, while 0-3 remain reserved and secure. Signed-off-by: Ryan Grachek <ryan@edited.us>
2019-02-05Merge pull request #1804 from antonio-nino-diaz-arm/an/cleanupAntonio Niño Díaz
Minor cleanup
2019-02-01Remove unneeded include paths in PLAT_INCLUDESAntonio Nino Diaz
Also, update platform_def.h guidelines about includes in the porting guide. Change-Id: I1ae338c9dd3242b309f6d53687ba2cb755d488c3 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-02-01Remove duplicated definitions of linker symbolsAntonio Nino Diaz
Many parts of the code were duplicating symbols that are defined in include/common/bl_common.h. It is better to only use the definitions in this header. As all the symbols refer to virtual addresses, they have to be uintptr_t, not unsigned long. This has also been fixed in bl_common.h. Change-Id: I204081af78326ced03fb05f69846f229d324c711 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-31hikey960: EDMAC: leave channel 0 as secureRyan Grachek
Channel 0 is used to communicate with LPM3, a coprocessor for power management. Leave it as secure. Signed-off-by: Ryan Grachek <ryan@edited.us>
2019-01-15Move BL1 and BL2 private defines to bl_common.hAntonio Nino Diaz
The definitions in bl1/bl1_private.h and bl2/bl2_private.h are useful for platforms that may need to access them. Change-Id: Ifd1880f855ddafcb3bfcaf1ed4a4e0f121eda174 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-10hikey960:Corrected erroneous DDR_SIZEJoel Hutton
Change-Id: I7194a9a5f0e41308eb3242d20c0d3434f72da591 Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2019-01-10hikey960: Increase max xlat tablesJoel Hutton
It is cleaner to use the same number of tables regardless of whether OP-TEE is used or not. This doesn't result in a significant memory usage increase. Change-Id: I38bcaa3f2f197c0a352153117592749f189a265c Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2019-01-04Sanitise includes across codebaseAntonio Nino Diaz
Enforce full include path for includes. Deprecate old paths. The following folders inside include/lib have been left unchanged: - include/lib/cpus/${ARCH} - include/lib/el3_runtime/${ARCH} The reason for this change is that having a global namespace for includes isn't a good idea. It defeats one of the advantages of having folders and it introduces problems that are sometimes subtle (because you may not know the header you are actually including if there are two of them). For example, this patch had to be created because two headers were called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform to avoid collision."). More recently, this patch has had similar problems: 46f9b2c3a282 ("drivers: add tzc380 support"). This problem was introduced in commit 4ecca33988b9 ("Move include and source files to logical locations"). At that time, there weren't too many headers so it wasn't a real issue. However, time has shown that this creates problems. Platforms that want to preserve the way they include headers may add the removed paths to PLAT_INCLUDES, but this is discouraged. Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-12-10io_block: define MAX_IO_BLOCK_DEVICES as unsignedYann Gautier
This is used as a table index, and already compared with an unsigned int: block_dev_count. Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-11-29hikey960: initialize EDMAC and channelsRyan Grachek
This is needed to utilize the DMA controller on the hikey960 Signed-off-by: Ryan Grachek <ryan@edited.us>
2018-11-26hikey: remove delay after eMMC initializedHaojian Zhuang
commit 386b14bf64124ebf0368eab33ef07603e0c3138a Author: Haojian Zhuang <haojian.zhuang@linaro.org> Date: Wed Nov 21 09:19:49 2018 +0800 mmc: poll eMMC status after EXT_CSD command EXT_CSD command needs to access data from eMMC device. Add the operation of polling eMMC device status. Make sure the command is finished. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> A hacked delay time can't fit each eMMC device. Since the above commit enables the polling operation, remove the hacked delay time now. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-11-15hikey: increase delay after eMMC initializedRyan Grachek
Some eMMC chips require a longer delay. After testing different chips, 20ms appears to work reliably. Signed-off-by: Ryan Grachek <ryan@edited.us>
2018-11-12Merge pull request #1674 from jforissier/hisi-multi-consoleAntonio Niño Díaz
hikey, hikey960, poplar: use new console APIs
2018-11-08poplar: Use new console APIsJerome Forissier
Switch to the new console APIs enabled by setting MULTI_CONSOLE_API=1. Enables building with ERROR_DEPRECATED=1. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2018-11-08hikey960: Use new console APIsJerome Forissier
Switch to the new console APIs enabled by setting MULTI_CONSOLE_API=1. Enables building with ERROR_DEPRECATED=1. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2018-11-08hikey: Use new console APIsJerome Forissier
Switch to the new console APIs enabled by setting MULTI_CONSOLE_API=1. Enables building with ERROR_DEPRECATED=1. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2018-11-08Standardise header guards across codebaseAntonio Nino Diaz
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: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-11-06Merge pull request #1661 from hzhuang1/emmc_delaySoby Mathew
hikey: add delay after eMMC initialized
2018-11-01context_mgmt: Fix MISRA defectsAntonio Nino Diaz
The macro EL_IMPLEMENTED() has been deprecated in favour of the new function el_implemented(). Change-Id: Ic9b1b81480b5e019b50a050e8c1a199991bf0ca9 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-10-31hikey: add delay after eMMC initializedHaojian Zhuang
It boots failure on CircuitCo HiKey board. The delay could fix the hang issue. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-10-30poplar: Decouple from plat/arm filesAntonio Nino Diaz
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>
2018-10-25Add plat_crash_console_flush to platforms without itAntonio Nino Diaz
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>
2018-10-10Replace S-EL3 references by EL3John Tsichritzis
The "Secure" prefix (S-ELx) is valid only for S-EL0 and S-EL1 but is meaningless for EL3, since EL3 is always secure. Hence, the "S" prefix has been removed from wherever it was used as "S-EL3". Change-Id: Icdeac9506d763f9f83d7297c7113aec7b85e9dbe Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
2018-10-02Merge pull request #1587 from antonio-nino-diaz-arm/an/deprecatedSoby Mathew
Remove deprecated interfaces for all platforms
2018-10-01Merge pull request #1589 from hzhuang1/topic/fix_clangDimitris Papastamos
Topic/fix clang
2018-09-28poplar: Migrate to new interfacesAntonio Nino Diaz
- Remove support for LOAD_IMAGE_V2=0. - Replace deprecated bl1_init_bl2_mem_layout(). - Migrate to bl2_early_platform_setup2(). - Migrate to bl31_early_platform_setup2(). - Use PLAT_VIRT_ADDR_SPACE_SIZE and PLAT_PHY_ADDR_SPACE_SIZE. - Remove references to removed build options. - Update Makefile paths. Change-Id: I52e02633365b3db4244f7ff0f99a6446eae619f0 Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28hikey960: Migrate to new interfacesAntonio Nino Diaz
- Migrate to new GIC interfaces. - Remove unused bl1_init_bl2_mem_layout(). - Migrate to bl31_early_platform_setup2(). - Use PLAT_VIRT_ADDR_SPACE_SIZE and PLAT_PHY_ADDR_SPACE_SIZE. - Remove references to removed build options. - Update Makefile paths. Change-Id: I583fd893555e6535f32d87ed67bbae430b8e6afe Tested-by: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28hikey: Migrate to new interfacesAntonio Nino Diaz
- Migrate to new GIC interfaces. - Remove unused bl1_init_bl2_mem_layout(). - Migrate to bl31_early_platform_setup2(). - Use PLAT_VIRT_ADDR_SPACE_SIZE and PLAT_PHY_ADDR_SPACE_SIZE. - Update Makefile paths. - Remove references to removed build options. Change-Id: Idd1e99b4864b2a72e9e12ff1fcd73d8285bc1c94 Tested-by: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-27poplar: fix build error with POPLAR_RECOVERY=1Shawn Guo
Commit eba1b6b3c724 ("plat/poplar: migrate to mmc framework") defines variable 'info' without !POPLAR_RECOVERY protection, and hence causes the following unused variable error with POPLAR_RECOVERY=1 build. plat/hisilicon/poplar/bl1_plat_setup.c: In function ‘bl1_platform_setup’: plat/hisilicon/poplar/bl1_plat_setup.c:95:25: error: unused variable ‘info’ [-Werror=unused-variable] struct mmc_device_info info; ^~~~ The patches fixes the build error with POPLAR_RECOVERY=1. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2018-09-26hikey960: fix build issue for clangHaojian Zhuang
plat/hisilicon/hikey960/include/plat_macros.S:19:55: error: unexpected token in '.asciz' directive .asciz "gicd_ispendr regs (Offsets 0x200 - 0x278)\n" " Offset:\t\t\tvalue\n" ^ Makefile:720: recipe for target 'build/hikey960/debug/bl1/cortex_a53.o' failed make: *** [build/hikey960/debug/bl1/cortex_a53.o] Error 1 Merge the two lines into one. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-09-26hikey: fix build issue for clangHaojian Zhuang
plat/hisilicon/hikey/include/plat_macros.S:19:55: error: unexpected token in '.asciz' directive .asciz "gicd_ispendr regs (Offsets 0x200 - 0x278)\n" " Offset:\t\t\tvalue\n" ^ Makefile:720: recipe for target 'build/hikey/debug/bl1/cortex_a53.o' failed make: *** [build/hikey/debug/bl1/cortex_a53.o] Error 1 Merge two lines into one line. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-09-09hikey960: Add development TBB supportTeddy Reed
This patch adds experimental support for TBB to the HiKey960 board. To build and test with TBB modify the uefi-tools project platforms.config +ATF_BUILDFLAGS=TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 SAVE_KEYS=1 \ MBEDTLS_DIR=./mbedtls Signed-off-by: Teddy Reed <teddy@casualhacking.io>
2018-08-22libc: Use printf and snprintf across codebaseAntonio Nino Diaz
tf_printf and tf_snprintf are now called printf and snprintf, so the code needs to be updated. Change-Id: Iffeee97afcd6328c4c2d30830d4923b964682d71 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-22libc: Fix all includes in codebaseAntonio Nino Diaz
The codebase was using non-standard headers. It is needed to replace them by the correct ones so that we can use the new libc headers. Change-Id: I530f71d9510cb036e69fe79823c8230afe890b9d Acked-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-15Merge pull request #1516 from antonio-nino-diaz-arm/an/printfDimitris Papastamos
Replace stdio.h functions by TF functions
2018-08-10plat/poplar: migrate to mmc frameworkHaojian Zhuang
Migrate from emmc framework to mmc framework. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10plat/hikey: migrate to mmc frameworkHaojian Zhuang
Migrate to mmc framework. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10Replace stdio.h functions by TF functionsAntonio Nino Diaz
Functions provided by stdio.h such as printf and sprintf are available in the codebase, but they add a lot of code to the final image if they are used: - AArch64: ~4KB - AArch32: ~2KB in T32, ~3KB in A32 tf_printf and tf_snprintf are a lot more simple, but it is preferable to use them when possible because they are also used in common code. Change-Id: Id09fd2b486198fe3d79276e2c27931595b7ba60e Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>