summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2017-05-11fix: ap806: enable 48-bit virtual addressMarcin Wojtas
Issue found when enable 48-bit Virtual Address in kernel In ARMv8 the CPU can work with 48-bit virtual address, at this case for propagating TLB maintenance 44-bit of Physical address are needed. Marvell interconnect is configured to be 40-bit address by default, therefore AxAddr[43:40] are not propagated so the DVM is not working. Change-Id: I7b8a3ec7960697814079f2c932fd06962bfa4c75 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/39185 Reviewed-by: Igal Liberman <igall@marvell.com> Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Hanna Hawa <hannah@marvell.com>
2017-05-11fix: pcie: move pcie initialization to cp110_ble_initIgal Liberman
In addition, add a call to cp110_pcie_clk_cfg(). This function is responsible for configuring PCIe ref clock and must me called before configuring PCIe interface. Change-Id: I807a4466d9c4459f9403b2542d771c961f07a46e Signed-off-by: Igal Liberman <igall@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/39257 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2017-05-11fix: mvebu: pcie: improve PCIE mac configurationIgal Liberman
This patch does the following: - Disable auto flush If auto flash is enabled, we can't enable/disable the link and perform "hot reset" - Set link equalization training to preset4 According to ETP, this is the best preset that our receiver can handle. - Remove VPD capability from the capability list It's not supported - Remove SRIOV capability from the capability list It's not supported - In end point mode: unmask the reset request: The hot reset and link disable/enable must penetrate and reset the MAC configurations. Change-Id: Ia189aaef29b175eb351ee9a861ae3883b3677fa9 Signed-off-by: Igal Liberman <igall@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/39226 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2017-05-11fix: pcie: cp110: fix pcie clock selectionIgal Liberman
There's a difference between PCIe clock configuration. in CP110 revision A1 and CP110 revision A2 CP110 revision A1: The SatR that decides if the PCIE uses internal refclock or external refclock does not work properly. When the clock is set to input we need to do extra configuration in order to make the input clock functional. (Iboth PCIe clocks must be aligned, so if one set to input, we must Performe the configuration). CP110 revision A2: PCIe Reference Clock Buffer Control register must be set according to the clock direction (input/output), there's a field for each refclock (pcie0 and pcie1) which are set accordingly to the clock configuration. Change-Id: I6b0150293bfd2d7595d19016c1fd82c4d4ed326a Signed-off-by: Igal Liberman <igall@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/39297 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2017-04-21gicv3: arm: support SPI and PPI irq save and restoreVictor Gu
During suspend and resume, some SoC will issue warm reset and the SPI and PPI irq states are cleared, so IO devices can not continue to work after resume. Thus the SPI and PPI irq states should be saved and restored. This patch adds the SPI and PPI irq state PM support in ARM GICv3 driver. Change-Id: Ief459375b5cd4f02ba2df015eed2f72d208cf0d1 Signed-off-by: Victor Gu <xigu@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/37430 Tested-by: iSoC Platform CI <ykjenk@marvell.com> Reviewed-by: Haim Boot <hayim@marvell.com> Reviewed-by: Hua Jing <jinghua@marvell.com> Signed-off-by: zachary <zhangzg@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/38075 Tested-by: Hua Jing <jinghua@marvell.com> Signed-off-by: zachary <zhangzg@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/38608
2017-04-19Introduce ARM GIC-600 driverJeenu Viswambharan
ARM GIC-600 IP complies with ARM GICv3 architecture, but among others, implements a power control register in the Redistributor frame. This register must be programmed to mark the frame as powered on, before accessing other registers in the frame. Rest of initialization sequence remains the same. The driver provides APIs for Redistributor power management, and overrides those in the generic GICv3 driver. The driver data is shared between generic GICv3 driver and that of GIC-600. For FVP platform, the GIC-600 driver is chosen when FVP_USE_GIC_DRIVER is set to FVP_GIC600. Also update user guide. Change-Id: I321b2360728d69f6d4b0a747b2cfcc3fe5a20d67 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/38156 Reviewed-by: Haim Boot <hayim@marvell.com> Tested-by: Haim Boot <hayim@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/38549 Reviewed-by: Kostya Porotchkin <kostap@marvell.com> Tested-by: Kostya Porotchkin <kostap@marvell.com>
2017-04-19GICv3: Introduce power management APIs for RedistributorJeenu Viswambharan
Some GICv3 implementations have provision for power management operations at Redistributor level. This patch introduces and provides place-holders for Redistributor power management. The default implementations are empty stubs, but are weakly bound so as to enable implementation-specific drivers to override them. Change-Id: I4fec1358693d3603ca5dce242a2f7f0e730516d8 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/38155 Reviewed-by: Haim Boot <hayim@marvell.com> Tested-by: Haim Boot <hayim@marvell.com> (cherry picked from commit 3d3fb7dfabb67e2a893296b8188ae394d329763b) Reviewed-on: http://vgitil04.il.marvell.com:8080/38548 Reviewed-by: Kostya Porotchkin <kostap@marvell.com> Tested-by: Kostya Porotchkin <kostap@marvell.com>
2017-04-10drivers: a3700: Add drivers for Marvell A3700 platformszachary
- Add UART drivers for Marvell A3700 SoC families Change-Id: Ie3363f98414317acd8958814698fc8fb4fc26c73 Signed-off-by: zachary <zhangzg@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/38604 Reviewed-by: Hua Jing <jinghua@marvell.com> Tested-by: Hua Jing <jinghua@marvell.com>
2017-04-04fix: cp110: enable optional RTC reconfigurationMarcin Wojtas
This commit enables optional reset of the RTC, in case its registers' contents did not sustain the reboot or power-off/on sequence. Without it, further usage of RTC is impossible (e.g. writing values to RTC_TIME register will not succeed). JIRA: A7K8K-1243 The reset is performed only if Clock Correction register does not comprise MVEBU_RTC_NOMINAL_TIMING, what helps to distinguish, whether the software configured RTC before or it comprises the default value. Change-Id: I9d6288ac85a453c545c1ec0b773b32144aea1759 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/38377 Reviewed-by: Kostya Porotchkin <kostap@marvell.com> Tested-by: Kostya Porotchkin <kostap@marvell.com>
2017-04-02drivers: Add drivers for Marvell A7K and A8K platformsKonstantin Porotchkin
Add Marvell drivers for A7K and A8K SoC families Change-Id: I7fb530e543e4f64782f41f8a058b6aabd82af9e8 Signed-off-by: Haim Boot <hayim@marvell.com> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/37916
2017-04-02io: Allow image load to address zeroKonstantin Porotchkin
Allow zero-address assertion bypass if requested by platform compilation flag PLAT_ALLOW_ZERO_ADDR_COPY. This patch allows loading BL33 (u-boot) to address 0x0 Change-Id: I10518db13466017110358437790ce5212d52d9e6 Signed-off-by: Haim Boot <hayim@marvell.com> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/37914
2017-04-02delay_timer: Add timer value get functionsKonstantin Porotchkin
Add ability to get timer value in micro- and milliseconds. Change-Id: I864619c23fe8a2a01cef86795e39d1b0bfd2e3d3 Signed-off-by: Victor Axelrod <victora@marvell.com> Signed-off-by: Ofir Fedida <ofedida@marvell.com> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-on: http://vgitil04.il.marvell.com:8080/37913 Reviewed-by: Haim Boot <hayim@marvell.com>
2016-09-12GICv3: Allow either G1S or G0 interrupts to be configuredYatharth Kochar
Currently the GICv3 driver mandates that platform populate both G1S and G0 interrupts. However, it is possible that a given platform is not interested in both the groups and just needs to specify either one of them. This patch modifies the `gicv3_rdistif_init()` & `gicv3_distif_init()` functions to allow either G1S or G0 interrupts to be configured. Fixes ARM-software/tf-issues#400 Change-Id: I43572b0e08ae30bed5af9334f25d35bf439b0d2b
2016-08-18Merge pull request #678 from soby-mathew/sm/PSCI_AArch32danh-arm
Introduce AArch32 support for PSCI library
2016-08-17Merge pull request #682 from sudeep-holla/gicv3_ns_intrdanh-arm
gicv3: disable Group1 NonSecure interrupts during core powerdown
2016-08-17Merge pull request #680 from hzhuang1/emmc_cmd23_v2danh-arm
emmc: support CMD23
2016-08-12emmc: support CMD23Haojian Zhuang
Support CMD23. When CMD23 is used, CMD12 could be avoided. Two scenarios: 1. CMD17 for single block, CMD18 + CMD12 for multiple blocks. 2. CMD23 + CMD18 for both single block and multiple blocks. The emmc_init() should initialize whether CMD23 is supported or not. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2016-08-11gicv3: disable Group1 NonSecure interrupts during core powerdownSudeep Holla
As per the GICv3 specification, to power down a processor using GICv3 and allow automatic power-on if an interrupt must be sent to a processor, software must set Enable to zero for all interrupt groups(by writing to GICC_CTLR or ICC_IGRPEN{0,1}_EL1/3 as appropriate. Also, NonSecure EL1 software may not be aware of the CPU power state details and fail to choose right states that require quiescing the CPU interface. So it's preferred that the PSCI implementation handles it as it is fully aware of the CPU power states. This patch adds disabling of Group1 NonSecure interrupts during processor power down along with Group0 and Group1 Secure interrupts so that all the interrupt groups are handled at once as per specification. Change-Id: Ib564d773c9c4c41f2ca9471451c030e3de75e641
2016-08-10AArch32: Add console driverSoby Mathew
This patch adds console drivers including the pl011 driver for the AArch32 mode. Change-Id: Ifd22520d370fca3e73dbbf6f2d97d6aee65b67dd
2016-08-10AArch32: Enable GIC and TZC supportSoby Mathew
This patch modifies GICv3 and TZC drivers to add AArch32 support. No modifications are required for the GICv2 driver for AArch32 support. The TZC driver assumes that the secure world is running in Little-Endian mode to do 64 bit manipulations. Assertions are present to validate the assumption. Note: The legacy GICv3 driver is not supported for AArch32. Change-Id: Id1bc75a9f5dafb9715c9500ca77b4606eb1e2458
2016-08-09Move console drivers to AArch64 folderSoby Mathew
This patch moves the various assembly console drivers into `aarch64` architecture specific folder. Stub files, which include files from new location, are retained at the original location for platform compatibility reasons. Change-Id: I0069b6c1c0489ca47f5204d4e26e3bc3def533a8
2016-08-04io: block: fix unaligned bufferHaojian Zhuang
If buffer address parameter isn't aligned, it may cause DMA issue in block device driver, as eMMC. Now check the buffer address. If it's not aligned, use temporary buffer in io block driver instead. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2016-07-27GICv3: Fix the GICD_IROUTER offsetSoby Mathew
This patch fixes the offset of GICD_IROUTER register defined in gicv3.h. Although the GICv3 documention mentions that the offset for this register is 0x6100-0x7FD8, the offset calculation for an interrupt id `n` is : 0x6000 + 8n, where n >= 32 This requires the offset for GICD_IROUTER to be defined as 0x6000. Fixes ARM-software/tf-issues#410 Change-Id: If9e91e30d946afe7f1f60fea4f065c7567093fa8
2016-07-18Rework type usage in Trusted FirmwareSoby Mathew
This patch reworks type usage in generic code, drivers and ARM platform files to make it more portable. The major changes done with respect to type usage are as listed below: * Use uintptr_t for storing address instead of uint64_t or unsigned long. * Review usage of unsigned long as it can no longer be assumed to be 64 bit. * Use u_register_t for register values whose width varies depending on whether AArch64 or AArch32. * Use generic C types where-ever possible. In addition to the above changes, this patch also modifies format specifiers in print invocations so that they are AArch64/AArch32 agnostic. Only files related to upcoming feature development have been reworked. Change-Id: I9f8c78347c5a52ba7027ff389791f1dad63ee5f8
2016-07-07GIC: Ensure SGIs and PPIs are Group0 before setupSoby Mathew
The legacy GIC driver assumes that the SGIs and PPIs are Group0 during initialization. This is true if the driver is the first one to initialize the GIC hardware after reset. But in some cases, earlier BL stages could have already initialized the GIC hardware which means that SGI and PPI configuration are not the expected reset values causing assertion failure in `gicd_set_ipriorityr()`. This patch explicitly resets the SGI and PPI to Group0 prior to their initialization in the driver. The same patch is not done in the GICv2-only driver because unlike in the legacy driver, `gicd_set_ipriorityr()` of GICv2 driver doesn't enforce this policy and the appropriate group is set irrespective of the initial value. Fixes ARM-software/tf-issues#396 Change-Id: I521d35caa37470ce542c796c2ba99716e4763105
2016-06-13Merge pull request #629 from ljerry/tf_issue_398danh-arm
Bring IO storage dummy driver
2016-06-03Allow dynamic overriding of ROTPK verificationSoby Mathew
A production ROM with TBB enabled must have the ability to boot test software before a real ROTPK is deployed (e.g. manufacturing mode). Previously the function plat_get_rotpk_info() must return a valid ROTPK for TBB to succeed. This patch adds an additional bit `ROTPK_NOT_DEPLOYED` in the output `flags` parameter from plat_get_rotpk_info(). If this bit is set, then the ROTPK in certificate is used without verifying against the platform value. Fixes ARM-software/tf-issues#381 Change-Id: Icbbffab6bff8ed76b72431ee21337f550d8fdbbb
2016-05-27Merge pull request #632 from rockchip-linux/support-for-gpio-driver-v2danh-arm
rockchip/rk3399: Support the gpio driver and configure
2016-05-27gpio: support gpio set/get pull statusCaesar Wang
On some platform gpio can set/get pull status when input, add these function so we can set/get gpio pull status when need it. And they are optional function.
2016-05-25CCN: Add API to query the PART0 ID from CCNSoby Mathew
This patch adds the API `ccn_get_part0_id` to query the PART0 ID from the PERIPHERAL_ID 0 register in the CCN driver. This ID allows to distinguish the variant of CCN present on the system and possibly enable dynamic configuration of the IP based on the variant. Also added an assert in `ccn_master_to_rn_id_map()` to ensure that the master map bitfield provided by the platform is within the expected interface id. Change-Id: I92d2db7bd93a9be8a7fbe72a522cbcba0aba2d0e
2016-05-20Implement generic delay timerAntonio Nino Diaz
Add delay timer implementation based on the system generic counter. This either uses the platform's implementation of `plat_get_syscnt_freq()` or explicit clock multiplier/divider values provided by the platform. The current implementation of udelay has been modified to avoid unnecessary calculations while waiting on the loop and to make it easier to check for overflows. Change-Id: I9062e1d506dc2f68367fd9289250b93444721732
2016-05-12Bring IO storage dummy driverGerald Lejeune
Allow to handle cases where some images are pre-loaded (by debugger for instance) without introducing many switches in files calling load_* functions. Fixes: arm-software/tf-issues#398 Signed-off-by: Gerald Lejeune <gerald.lejeune@st.com>
2016-04-27drivers: add emmc stackHaojian Zhuang
In a lot of embedded platforms, eMMC device is the only one storage device. So loading content from eMMC device is required in ATF. Create the emmc stack that could co-work with IO block driver. Support to read/write/erase eMMC blocks on both rpmb and normal user area. Support to change the IO speed and bus width. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2016-04-27IO: support block device typeHaojian Zhuang
FIP is accessed as memory-mapped type. eMMC is block device type. In order to support FIP based on eMMC, add the new io_block layer. io_block always access eMMC device as block size. And it'll only copy the required data into buffer in io_block driver. So preparing an temporary buffer is required. When use io_block device, MAX_IO_BLOCK_DEVICES should be declared in platform_def.h. It's used to support multiple block devices. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2016-04-12Use unsigned long long instead of uintptr_t in TZC400/DMC500 driversYatharth Kochar
Currently the `tzc400_configure_region` and `tzc_dmc500_configure_region` functions uses uintptr_t as the data type for `region_top` and `region_base` variables, which will be converted to 32/64 bits for AArch32/AArch64 respectively. But the expectation is to keep these addresses at least 64 bit. This patch modifies the data types to make it at least 64 bit by using unsigned long long instead of uintptr_t for the `region_top` and `region_base` variables. It also modifies the associated macros `_tzc##fn_name##_write_region_xxx` accordingly. Change-Id: I4e3c6a8a39ad04205cf0f3bda336c3970b15a28b
2016-04-08Merge pull request #569 from Xilinx/zynqmp-v1danh-arm
Support for Xilinx Zynq UltraScale+ MPSoC
2016-04-07Merge pull request #575 from soby-mathew/sm/new_tzc_driverdanh-arm
Refactor the TZC driver and add DMC-500 driver
2016-04-01drivers: Add Cadence UART driverSoren Brinkmann
Add a driver for the Cadence UART which is found in Xilinx Zynq SOCs. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
2016-03-31Add ARM CoreLink DMC-500 driver to program TrustZone protectionVikram Kanigiri
The ARM CoreLink DMC-500 Dynamic Memory Controller provides the programmable address region control of a TrustZone Address Space Controller. The access permissions can be defined for eight separate address regions plus a background or default region. This patch adds a DMC-500 driver to define address regions and program their access permissions as per ARM 100131_0000_02_en (r0p0) document. Change-Id: I9d33120f9480d742bcf7937e4b876f9d40c727e6
2016-03-31Refactor the ARM CoreLink TZC-400 driverVikram Kanigiri
TrustZone protection can be programmed by both memory and TrustZone address space controllers like DMC-500 and TZC-400. These peripherals share a similar programmer's view. Furthermore, it is possible to have multiple instances of each type of peripheral in a system resulting in multiple programmer's views. For example, on the TZC-400 each of the 4 filter units can be enabled or disabled for each region. There is a single set of registers to program the region attributes. On the DMC-500, each filter unit has its own programmer's view resulting in multiple sets of registers to program the region attributes. The layout of the registers is almost the same across all these variations. Hence the existing driver in `tzc400\tzc400.c` is refactored into the new driver in `tzc\tzc400.c`. The previous driver file is still maintained for compatibility and it is now deprecated. Change-Id: Ieabd0528e244582875bc7e65029a00517671216d
2016-03-31TBB: add non-volatile counter supportJuan Castillo
This patch adds support for non-volatile counter authentication to the Authentication Module. This method consists of matching the counter values provided in the certificates with the ones stored in the platform. If the value from the certificate is lower than the platform, the boot process is aborted. This mechanism protects the system against rollback. The TBBR CoT has been updated to include this method as part of the authentication process. Two counters are used: one for the trusted world images and another for the non trusted world images. ** NEW PLATFORM APIs (mandatory when TBB is enabled) ** int plat_get_nv_ctr(void *cookie, unsigned int *nv_ctr); This API returns the non-volatile counter value stored in the platform. The cookie in the first argument may be used to select the counter in case the platform provides more than one (i.e. TBSA compliant platforms must provide trusted and non-trusted counters). This cookie is specified in the CoT. int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr); This API sets a new counter value. The cookie may be used to select the counter to be updated. An implementation of these new APIs for ARM platforms is also provided. The values are obtained from the Trusted Non-Volatile Counters peripheral. The cookie is used to pass the extension OID. This OID may be interpreted by the platform to know which counter must return. On Juno, The trusted and non-trusted counter values have been tied to 31 and 223, respectively, and cannot be modified. ** IMPORTANT ** THIS PATCH BREAKS THE BUILD WHEN TRUSTED_BOARD_BOOT IS ENABLED. THE NEW PLATFORM APIs INTRODUCED IN THIS PATCH MUST BE IMPLEMENTED IN ORDER TO SUCCESSFULLY BUILD TF. Change-Id: Ic943b76b25f2a37f490eaaab6d87b4a8b3cbc89a
2016-03-11Add "size" function to IO memmap device driverGerald Lejeune
Hence memmap device can be used to load an image without being wrapped in a FIP. Fixes arm-software/tf-issues#371 Signed-off-by: Gerald Lejeune <gerald.lejeune@st.com>
2016-02-26Merge pull request #534 from jcastillo-arm/jc/fix_pl011danh-arm
Fix potential deadlock in PL011 init function
2016-02-24Fix potential deadlock in PL011 init functionJuan Castillo
The PL011 initialization function disables the UART, flushes the FIFO and waits for the current character to be transmitted before applying the configuration and enabling the UART. This waiting might result in a deadlock if the FIFO is disabled while another CPU is printing a message since the flush of FIFO will never finish. This patch fixes the problem by removing the flush operation and the loop for last character completion from the initialization function. The UART is disabled, configured and enabled again. Change-Id: I1ca0b6bd9f352c12856f10f174a9f6eaca3ab4ea
2016-02-22Merge pull request #518 from hzhuang1/pl061_gpio_v5danh-arm
Pl061 gpio v5
2016-02-18Add support for %p in tf_printf()Antonio Nino Diaz
This patch adds support for the `%p` format specifier in tf_printf() following the example of the printf implementation of the stdlib used in the trusted firmware. Fixes ARM-software/tf-issues#292 Change-Id: I0b3230c783f735d3e039be25a9405f00023420da
2016-02-12arm: gpio: add pl061 driverHaojian Zhuang
Add PL061 GPIO driver that is depend on gpio framework. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2016-02-12gpio: add gpio frameworkHaojian Zhuang
Define the gpio ops in gpio driver. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2016-02-11Merge pull request #517 from soby-mathew/sm/gic_set_prio_fixdanh-arm
Fix IPRIORITY and ITARGET accessors in GIC drivers
2016-02-09Move private APIs in gic_common.h to a private headerSoby Mathew
This patch moves the private GIC common accessors from `gic_common.h` to a new private header file `gic_common_private.h`. This patch also adds additional comments to GIC register accessors to highlight the fact that some of them access register values that correspond to multiple interrupt IDs. The convention used is that the `set`, `get` and `clr` accessors access and modify the values corresponding to a single interrupt ID whereas the `read` and `write` GIC register accessors access the raw GIC registers and it could correspond to multiple interrupt IDs depending on the register accessed. Change-Id: I2643ecb2533f01e3d3219fcedfb5f80c120622f9