summaryrefslogtreecommitdiff
path: root/plat/hisilicon
AgeCommit message (Collapse)Author
2018-03-08Merge pull request #1277 from hzhuang1/testing/bl2_el3_v0.6davidcunado-arm
hikey: migrate to BL2_EL3
2018-03-06hikey: fix build issue with CLANGHaojian Zhuang
plat/hisilicon/hikey/hikey_bl1_setup.c:565:47: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] __asm__ volatile ("mrs %0, cpacr_el1" : "=r"(data)); Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-06hikey960: fix build issue with CLANGHaojian Zhuang
plat/hisilicon/hikey960/drivers/pwrc/hisi_pwrc.c:290:20: error: unused function 'hisi_pdc_set_intmask' [-Werror,-Wunused-function] static inline void hisi_pdc_set_intmask(void *pdc_base_addr, ^ 1 error generated. Makefile:605: recipe for target 'build/hikey960/release/bl31/hisi_pwrc.o' failed make: *** [build/hikey960/release/bl31/hisi_pwrc.o] Error 1 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey960: move out duplicated codeHaojian Zhuang
Create hikey960_bl_common.c to store duplication initialization code in both BL1 and BL2. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey960: fix invoking driver init in image load driverHaojian Zhuang
It's unnecessary to call platform driver initialization in image load driver. We could make bl2_platform_setup() to executing just before SCP_BL2 by setting flag IMAGE_ATTRIB_PLAT_SETUP. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey960: migrate to bl2_el3Haojian Zhuang
Since non-TF ROM is used in HiKey960 platform (Hisilicon Hi3660 SoC), replace BL1 by BL2_EL3 in normal boot mode. When flush images in recovery mode, keep to use BL1. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey960: drop LOAD_IMAGE v1Haojian Zhuang
Since LOAD_IMAGE_V2 is always enabled in HiKey960 platform. Drop LOAD_IMAGE v1 to simplify code. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey960: fix memory overlapped in memory mapHaojian Zhuang
MAP_TSP_MEM could be either in SRAM or DRAM. When MAP_TSP_MEM is in DRAM, it's overlapped with MAP_DDR. Since TSP_MEM is always configured in DRAM case, it means MAP_OPTEE_PAGEABLE is always disabled. Just remove it. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey960: avoid to dump message when fetch boardidHaojian Zhuang
The main difference between HiKey960 v1 hardware and HiKey960 v2 hardware is on UART console. But the function of detecting boardid dumps message before console ready. So fix it by removing those messages. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey: move out duplicated codeHaojian Zhuang
Create hikey_bl_common.c to store duplicated initialization code in BL1 and BL2. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey: migrate to bl2_el3Haojian Zhuang
Since non-TF ROM is used in HiKey platform (Hisilicon Hi6220 SoC), replace BL1 by BL2_EL3 in normal boot mode. When we recovery images in recovery mode, keep to use BL1. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey: clean dcache for SRAM after initializedHaojian Zhuang
Although SRAM is initialized, DCACHE should be cleaned too. Because MCU is a parrallel core to access SRAM. We need to make sure that initialized value is really written to SRAM before MCU using it. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-03-05hikey: drop LOAD_IMAGE v1Haojian Zhuang
Since LOAD_IMAGE_V2 is always enabled in HiKey platform. Drop LOAD_IMAGE v1 to simplify code. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-02-27Update ULL() macro and instances of ull to comply with MISRADavid Cunado
MISRA C-2012 Rule 7.3 violation: lowercase l shall not be used as literal suffixes. This patch resolves this for the ULL() macro by using ULL suffix instead of the ull suffix. Change-Id: Ia8183c399e74677e676956e8653e82375d0e0a01 Signed-off-by: David Cunado <david.cunado@arm.com>
2018-02-17Merge pull request #1259 from hzhuang1/fix_uartdavidcunado-arm
hikey960: avoid hardcode on uart port
2018-02-17hikey960: avoid hardcode on uart portHaojian Zhuang
Avoid hardcode on uart port. The uart port could be auto detected on HiKey960 platform. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-02-08hikey*, poplar: platform.mk: Fix typo in variable assignmentsVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org>
2018-02-08poplar: Support Trusted OS extra image (OP-TEE header) parsingVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-08poplar: Add LOAD_IMAGE_V2 supportVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-08poplar: Add build option for dram sizeVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-07poplar: Fix typoVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-07poplar: Remove unused function prototypeVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-02-06Merge pull request #1224 from masahir0y/gzipdavidcunado-arm
Support GZIP-compressed images for faster loading and verification
2018-02-01Build: change the first parameter of TOOL_ADD_IMG to lowercaseMasahiro Yamada
In the next commit, I need the image name in lowercase because output files are generally named in lowercase. Unfortunately, TOOL_ADD_IMG takes the first argument in uppercase since we generally use uppercase Make variables. make_helpers/build_macros.mk provides 'uppercase' macro to convert a string into uppercase, but 'lowercase' does not exist. We can implement it if we like, but it would be more straightforward to change the argument of TOOL_ADD_IMG. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-02-01Build: rename FIP_ADD_IMG to TOOL_ADD_IMGMasahiro Yamada
Now FIP_ADD_IMG takes care of both fiptool and cert_create symmetrically. Rename it so that it matches the behavior. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-01-30hikey: fix memory overlapped in memory mapHaojian Zhuang
MAP_TSP_MEM could be either in SRAM or DRAM. When MAP_TSP_MEM is in DRAM, it's overlapped with MAP_DDR. Since MAP_OPTEE_PAGEABLE isn't used in SRAM case, just remove it. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-01-29Disable workaround for CVE-2017-5715 on unaffected platformsDimitris Papastamos
Change-Id: Ib67b841ab621ca1ace3280e44cf3e1d83052cb73 Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
2018-01-28hikey: fix assert in sec_protect()Victor Chong
`assert(e)` was used in place of `if (e) ERROR()` when sec_protect() was ported from hikey fork so the logic should have been reversed. Fixes: 3d5d9f5a ("hikey: configure the top 16MB of DRAM as secure") Fixes: 52988b38 ("hikey: configure 4 MB of secure DRAM for OP-TEE Secure Data Path") Signed-off-by: Victor Chong <victor.chong@linaro.org> Tested-by: Victor Chong <victor.chong@linaro.org>
2018-01-26Merge pull request #1205 from petegriffin/hikey-protect-memorydavidcunado-arm
Hikey protect optee / sdp memory
2018-01-25Merge pull request #1231 from Leo-Yan/hikey960_enable_fiq_handlingdavidcunado-arm
Hikey960: Enable invalid FIQ handling
2018-01-24hikey: configure 4 MB of secure DRAM for OP-TEE Secure Data PathPeter Griffin
Update the memory firewall configuration to reserve 4 MB of secure RAM for use by the kernel and OP-TEE as the Secure Data Path pool. Note that this address range (0x3E800000 - 0x3EC00000) falls in the range already set aside by UEFI (which reserves the upper 32 MB of the 1GB DRAM for OP-TEE [1]) and was previously unused. [1] https://github.com/96boards-hikey/edk2/blob/hikey/HisiPkg/HiKeyPkg/Library/HiKeyLib/HiKeyMem.c#L44 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Victor Chong <victor.chong@linaro.org>
2018-01-24hikey: configure the top 16MB of DRAM as secureJerome Forissier
DRAM region 0x3f000000 - 0x3fffffff is reserved for OP-TEE and should therefore be accessible only from secure world. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Peter Griffin <peter.griffin@linaro.org> Acked-by: Victor Chong <victor.chong@linaro.org>
2018-01-22poplar: Add support for recovery buildVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org> Acked-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-01-22poplar: Enable emmc supportVictor Chong
Let bl1 and bl2 have the ability to load images from emmc instead of dram (mmap). Signed-off-by: Victor Chong <victor.chong@linaro.org> Acked-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Shawn Guo <shawn.guo@linaro.org>
2018-01-22Hikey960: Enable invalid FIQ handlingLeo Yan
When some interrupts are configured as group 0 in GICv2, these interrupts trigger FIQ signal; this results in the Linux kernel panic by reporting log: "Bad mode in FIQ handler detected on CPU0, code 0x00000000 -- Unknown/Uncategorized". Unfortunately from kernel side it has no permission to read the GIC register for group 0 interrupts so we have no chance to get to know which interrupt is configured as secure interrupt and cause the kernel panic. For upper reason, this commit enables FIQ exception handling for SPD_none case. If the system has not enabled SPD the FIQ interrupt is trapped into EL3 and the FIQ handler can report the interrupt number so we can easily narrow down which FIQ introduce unexpected interrupt. After enable SPD we can rely on SPD interrupt route model to handle FIQ. Signed-off-by: Leo Yan <leo.yan@linaro.org>
2018-01-17Merge pull request #1211 from Leo-Yan/remove_ca73_cpu_nap_statedavidcunado-arm
Hikey960: Remove ca73 cpu nap state
2018-01-16Hikey960: Change CPU standby state for WFILeo Yan
At early time, the CPU CA73 retention state has been supported on Hikey960. Later we found the system has the hang issue and for resolving this issue Hisilicon released new MCU firmware, but unfortunately the new MCU firmware has side effect and results in the CA73 CPU cannot really enter retention state and roll back to WFI state. After discussion we cannot see the possibility to enable CA73 retention state anymore on Hikey960, based on this conclusion we should remove this state supporting from ARM-TF and roll back to WFI state only. We will commit one patch to remove CA73 CPU retention state in kernel DT binding as well. Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Haojian Zhuang <haojian.zhuang@linaro.org> Cc: Kevin Wang <jean.wangtao@linaro.org> Cc: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Leo Yan <leo.yan@linaro.org>
2018-01-16Revert "Hikey960: Change to use recommended power state id format"Leo Yan
This reverts commit fdae60b6ba27c216fd86d13b7432a1ff4f57dd84. The commit fdae60b6ba27c216fd86d13b7432a1ff4f57dd84 changed the parameter encoding for the hikey960. However that implies a DT change in the kernel side. After submitting the DT change for upstreaming, the backward compatibility issue and the interface change raise some concerns from the Linux community about the issues related to kernel <-> ATF alignment. There is no way to detect a mis-alignment of those without a deep knowledge of the ATF and the kernel. Furthermore, the failing calls to PSCI in the idle path (because of bad parameters), will lead to busy looping, implying: thermal issues and extra energy consumption. In regard of the Linux community concerns, the potential issues when the ATF and the kernel are not aligned, it is preferable to revert the commit. Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Haojian Zhuang <haojian.zhuang@linaro.org> Cc: Kevin Wang <jean.wangtao@linaro.org> Co-authored-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Leo Yan <leo.yan@linaro.org>
2018-01-16Merge pull request #1216 from hzhuang1/fix_pscidavidcunado-arm
Hikey960: Fix hikey960 pcie mount fail
2018-01-10Merge pull request #1207 from hzhuang1/isp_clkdavidcunado-arm
hikey960: set isp clks as unsecure mode
2018-01-09Hikey960: Fix hikey960 pcie mount failKaihua Zhong
Set IOC_AO_IOMG_033 function from GPIO213 to PCIE_CLKREQ_N bit[0-2]: 000: GPIO_213; 001: PCIE_CLKREQ_N; 010: GPIO_018_SH; 100: GPIO_014_SE; 110: FAC_TEST24; 111: FAC_TEST24; bit[3-31]: reserved Signed-off-by: Guangtao Zhang <zhangguangtao@hisilicon.com> Tested-by: Yao Chen <chenyao11@huawei.com> Acked-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-01-09Merge pull request #1167 from Leo-Yan/hikey-fix-alignmentdavidcunado-arm
Set alignment size to 512B for Hikey/Hikey960
2017-12-18hikey960: set isp clks as unsecure modeHaojian Zhuang
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2017-12-12poplar: Add BL32 (OP-TEE) supportVictor Chong
Signed-off-by: Victor Chong <victor.chong@linaro.org>
2017-12-12Poplar: Initialize security properties of IP blocks.Jiancheng Xue
The security properties of some IP blocks are configured to secure mode after reset. This means these IP blocks can only be accessed by cpus in secure state by default. These should be configured correclty as needed. Signed-off-by: y00241285 <yyangwei.yangwei@hisilicon.com> Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
2017-12-12poplar: Increase FIP_SIZEVictor Chong
This is currently the maximum allowed without affecting bootup. Signed-off-by: Victor Chong <victor.chong@linaro.org>
2017-12-12poplar: Rename PLAT_ARM_NS_IMAGE_OFFSETVictor Chong
to PLAT_POPLAR_NS_IMAGE_OFFSET Signed-off-by: Victor Chong <victor.chong@linaro.org>
2017-12-12poplar: Fix GPIO_MAXVictor Chong
Per https://github.com/sdrobertw/Poplar/blob/master/HardwareDocs/Processor_Datasheet_v2XX.pdf there are 13 groups of GPIO controllers, not 12. Signed-off-by: Victor Chong <victor.chong@linaro.org>
2017-12-11Merge pull request #1178 from davidcunado-arm/dc/enable_svedavidcunado-arm
Enable SVE for Non-secure world
2017-12-06Hikey960: Change to use recommended power state id formatLeo Yan
ARM Power State Coordination Interface (ARM DEN 0022D) chapter 6.5 "Recommended StateID Encoding" defines the state ID which can be used by platforms. The recommended power states can be presented by below values; and it divides into three fields, every field has 4 bits to present power states corresponding to core level, cluster level and system level. 0: Run 1: Standby 2: Retention 3: Powerdown This commit changes to use upper recommended power states definition on Hikey960; and changes the power state validate function to check the power state passed from kernel side. Signed-off-by: Leo Yan <leo.yan@linaro.org>