Commit Graph

368 Commits

Author SHA1 Message Date
Soby Mathew 3ccfcd6e3d
Merge pull request #1587 from antonio-nino-diaz-arm/an/deprecated
Remove deprecated interfaces for all platforms
2018-10-02 10:12:32 +01:00
Yann Gautier 97d5db8c5c mmc: Update framework to use standard response type
Respect official response type and update response to follow
official specification.
All the MMC_RESPONSE_R(_x) are replaced with each corresponding define.

Partly revert 2a82a9c95f for dw_mmc.c:
Responses R1, R1B and R5 have CRC.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-09-28 16:48:37 +02:00
Antonio Nino Diaz fe199e3bac Remove all other deprecated interfaces and files
Change-Id: Icd1cdd42afdc78895a9be6c46b414b0a155cfa63
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28 15:31:53 +01:00
Antonio Nino Diaz 61d2b40d28 drivers: cadence: cdns: Fix flush function
It is still a placeholder, but now it is registered correctly by the
macro finish_console_register.

Change-Id: Ic78c966d9be606cbc1a53cec43ead23b32963afe
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28 15:31:53 +01:00
Antonio Nino Diaz 28bcc45ec0 console: Remove deprecated files
Change-Id: Ib9eebbdff6f7868e1d1b8c41761cacc7501a25bd
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28 15:31:53 +01:00
Antonio Nino Diaz 1a3764edaa cci400: Remove deprecated driver
This driver is deprecated.

Change-Id: Ic6e154a5756e779743b17a329eed4570ccc61389
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28 15:31:53 +01:00
Antonio Nino Diaz b06b678ffb tzc400: Remove deprecated interfaces
Change-Id: I9874883ec33dbf293f607f9779d7c56f23cb8023
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28 15:31:53 +01:00
Antonio Nino Diaz f9ed3cb624 gic: Remove deprecated driver and interfaces
Change-Id: I567a406edb090ae9d109382f6874846a79dd7473
Co-authored-by: Roberto Vargas <roberto.vargas@arm.com>
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-28 15:31:53 +01:00
Shawn Guo a2a69bc89f drivers: mmc: Fix R2 response type definition
The Poplar is broken on eMMC initialization because of commit
2a82a9c95f ("drivers: emmc: dw_mmc: Add response flag into response ID
definition").  It changes the driver behavior on response type handling
in dw_send_cmd(), because MMC_RESPONSE_R(2) and MMC_RESPONSE_R2 are
different things.  MMC core is still sending the former while we already
changed to check the latter in dw_mmc driver.

This patch fixes R2 response type in MMC core code.  It's the same
thing as what commit 94522ff7f6 ("drivers: mmc: Fix R3 response type
definition") does for R3 response.

With this fix, Poplar is back to work.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
2018-09-28 14:37:09 +08:00
Andre Przywara dfc0fb2725 drivers: i2c: mentor: move platform code into header files
At the moment we have two I2C stub drivers (for the Allwinner and the
Marvell platform), which #include the actual .c driver file.
Change this into the more usual design, by renaming and moving the stub
drivers into platform specific header files and including these from the
actual driver file. The platform specific include directories make sure
the driver picks up the right header automatically.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2018-09-19 09:24:02 +01:00
Icenowy Zheng 5686b2eca2 allwinner: add I2C glue driver
Allwinner 64-bit SoCs all use the Mentor Graphics MI2CV I2C controller
core, with inverted clear quirk.

Add a glue driver for this.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2018-09-07 22:13:06 +08:00
Icenowy Zheng 2071991413 drivers: mentor: mi2cv: add inverted interrupt clear flag quirk
The I2C controller on Allwinner SoCs after A31 has a inverted interrupt
clear flag, which needs to be written 1 (rather than 0 on Marvell SoCs
and old Allwinner SoCs) to clear.

Add such a quirk to mi2cv driver common code.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2018-09-07 22:09:45 +08:00
Icenowy Zheng 7e4d562077 drivers: mentor: extract MI2CV driver from Marvell driver
The Marvell A8K SoCs use the MI2CV IP core from Mentor Graphics, which
is also used by Allwinner.

As Mentor Graphics allows a lot of customization, the MI2CV in the two
SoC families are not compatible, and driver modifications are needed.

Extract the common code to a MI2CV driver.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2018-09-05 22:43:38 +08:00
Icenowy Zheng f348c3519e marvell: drivers: use anonymous union in I2C driver
The I2C controller found in Marvell A8K SoCs (and some older SoCs) mux
status and baudrate registers into the same address, however, it's a
vendor customization, and the original IP core by Mentor Graphics uses
two different addresses for the two registers.

Use anonymous union in the driver, in order to ease code sharing for
other SoC vendors that use this IP core (Allwinner SoCs that are newly
introduced to mainline ATF use this core).

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2018-09-05 22:43:38 +08:00
Dimitris Papastamos 36044baf08
Merge pull request #1515 from bryanodonoghue/atf-master+linaro-warp7-squash-v4
Atf master+linaro warp7 squash v4
2018-09-05 12:20:10 +01:00
Dimitris Papastamos 05ca725465
Merge pull request #1554 from jts-arm/mbed
Mbed TLS shared heap
2018-09-05 12:19:03 +01:00
Jun Nie 8b6591302a drivers: imx: mxc_usdhc: Add USDHC driver to support boot EMMC
Add USDHC driver to support boot EMMC. Only initialization
and single/multiple block read are tested.

[bod: fixed checkpatch.pl complaints]
[bod: changed name to imx_usdhc for namespace consistency]
[bod: squashed antecedent fixes into this one patch]

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2018-09-04 13:36:14 +01:00
Bryan O'Donoghue 61752898a7 drivers: mmc: Add missing response type for some commands
Add missing response type for SWITCH command and STOP_TRANSMISSION
so that controller can be configured accordingly.

[bod: ported this change from Jun's eMMC patches to the MMC driver]

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2018-09-04 12:35:24 +01:00
Bryan O'Donoghue 94522ff7f6 drivers: mmc: Fix R3 response type definition
The R3 response type definition should be (1 << 0). Make sure we define the
expected response code in the appropriate fashion.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2018-09-04 12:35:24 +01:00
Jun Nie 2a82a9c95f drivers: emmc: dw_mmc: Add response flag into response ID definition
Add response flag into ID definition so that driver does not
need to handle it again.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2018-09-04 12:35:21 +01:00
Jun Nie e67606cf8e drivers: imx: imx_gpt: Add general purpose timer API binding
Add delay timer API so that it can be called by delay timer
layer and used as delay timer globally.

[bod: changed name from imx_delay_timer -> imx_gpt ]

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2018-09-04 11:52:15 +01:00
John Tsichritzis 6d01a46334 Prepare Mbed TLS drivers for shared heap
The Mbed TLS drivers, in order to work, need a heap for internal usage.
This heap, instead of being directly referenced by the drivers, now it
is being accessed indirectly through a pointer. Also, the heap, instead
of being part of the drivers, now it is being received through the
plat_get_mbedtls_heap() function. This function requests a heap from the
current BL image which utilises the Mbed TLS drivers.

Those changes create the opportunity for the Mbed TLS heap to be shared
among different images, thus saving memory. A default heap
implementation is provided but it can be overridden by a platform
specific, optimised implemenetation.

Change-Id: I286a1f10097a9cdcbcd312201eea576c18d157fa
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
2018-09-04 10:32:06 +01:00
Soby Mathew ebf417aa83
Merge pull request #1540 from MISL-EBU-System-SW/marvell-updates-18.09
Marvell updates 18.09
2018-09-04 03:35:54 +01:00
Marcin Wojtas 349df242ed marvell: drivers: correct RTC init sequence
It turned out that resetting the RTC time register is not
necessary during initial configuration. Safely remove it
from the sequence.

Change-Id: Id2b9c7db44a8c8dbe88a7f8a21695b72a7fd78ee
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Nadav Haklai <nadavh@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-09-03 15:47:01 +03:00
Marcin Wojtas 4acd900df6 gicv2: enable configuring IRQ trigger type
This patch introduces new helper routines that allow
configuring the individual IRQs to be edge/level-triggered
via GICD_ICFGR registers. This is helpful to modify
the default configuration of the non-secure GIC SPI's, which
are all set during initialization to be level-sensitive.

Change-Id: I23deb4a0381691a686a3cda52405aa1dfd5e56f2
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-09-03 15:46:14 +03:00
Grzegorz Jaszczyk 3c0024cc2c mvebu: cp110: fix spelling in register definition
Use PF instead of PP post-fix, since it is referring to "Phase Final"
(only G3 related register had correct spelling for relevant bit).

Change-Id: Ia5a9c9c78b74b15f7f8adde2c3ef4784c513da2c
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-09-02 14:10:47 +03:00
Grzegorz Jaszczyk f858e989c6 mvebu: cp110: align all comphy_index arguments type
The biggest comphy index can be equal to 6 so there is no need to use
uint64_t for storing it.

Change-Id: I14c2b68e51678a560815963c72aed0c37068f926
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-09-02 14:10:47 +03:00
Grzegorz Jaszczyk 3a9f8eecd7 drivers: marvell: mc_trustzone: add driver for mc trustzone
Add simple driver which allows to configure the memory controller trust
zones. It is responsible for opening mc trustzone window, with
appropriate base address, size and attributes.

Example of usage in upcoming commits.

Change-Id: I8bea17754d31451b305040ee7de331fb8db0c63f
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-09-02 14:10:47 +03:00
Konstantin Porotchkin 94d6dd677b plat: marvell: rename common include file
Rename a8k_common.h to armada_common.h to keep the same header
name across all other Marvell Armada platforms.
This is especially useful since various Marvell platforms may
use common platform files and share the driver modules.

Change-Id: I7262105201123d54ccddef9aad4097518f1e38ef
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-09-02 14:10:47 +03:00
Andrew F. Davis 2ac5002046 GIC: Fix build error
Pointers should be comparied to NULL.

Fixes: 3fea9c8b8e ("gic: Fix types")
Signed-off-by: Andrew F. Davis <afd@ti.com>
2018-08-30 14:35:25 -05:00
Bryan O'Donoghue 2f5307d6ba drivers: imx: crash-console: Add a mxc_crash_console driver
This patch does two main things

- It implements the crash console UART init in assembly, as a
  hard-coded 115200 8N1 assumed from the 24 MHz clock.

  If the clock setup code has not run yet, this code can't work but,
  setting up clocks and clock-gates is way out of scope for this type of
  recovery function.

- It adds code to write a character out of the NXP UART without using any
  stack-based operations when doing so.

- Provides support for crash console in DCE or DTE mode.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2018-08-30 17:38:32 +01:00
Bryan O'Donoghue 598cee482a drivers: imx: uart: Add mxc_console
- Adds a simple register read/write abstraction to cut-down on the
  amount of typing and text required to access UART registers in this driver.

- Adds a console getc() callback.

- Adds a console putc() callback, translating '\n' to '\r' + '\n'.

- Initializes the MXC UART, take a crude method of calculating the
  BAUD rate generator. The UART clock-gates must have been enabled prior
  to launching the UART init code.
  Special care needs to be taken to ensure the UBIR is initialized before the
  UBMR and we need to ensure that UCR2.SRST comes good before trying to
  program other registers associated with the UART.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
2018-08-30 17:38:32 +01:00
Dimitris Papastamos dcf95e7e90
Merge pull request #1542 from antonio-nino-diaz-arm/an/bl31-misra
Some MISRA fixes in BL31, cci and smmu
2018-08-30 16:18:49 +01:00
Antonio Nino Diaz 4213e9bacd drivers: cci: Fix MISRA defects
Change-Id: Ifdb0ceec19d267b14d796b5d31f08f7342190484
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-30 09:22:34 +01:00
Antonio Nino Diaz 6d5f0631a6 drivers: smmu: Fix MISRA defects
Change-Id: I2954a99d5b72069bcb7bac9d6926c6209d6ba881
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-30 09:22:34 +01:00
Antonio Nino Diaz 0117d2cae9 gic v3: Fix width of types of helper functions
Change-Id: I08447b44fffb6e54f9fab957eee369ccbda4247a
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-30 09:22:16 +01:00
Antonio Nino Diaz 3fea9c8b8e gic: Fix types
Change-Id: I6a2adef87c20f9279446a54b7e69618fba3d2a25
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-30 09:22:16 +01:00
Antonio Nino Diaz 8782922c25 gic: Fix definitions
Change-Id: I945029ca26ea2e63f0d92c5f33019b882f23bd72
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-30 09:22:15 +01:00
Antonio Nino Diaz b9f68dfbfe gic v3: Turn macros into static inline functions
Change-Id: Ib587f12f36810fc7d4f4b8f575195554299b8ed4
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-30 09:22:15 +01:00
Antonio Nino Diaz 39b6cc66d6 libc: Use printf and snprintf across codebase
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-22 10:26:05 +01:00
Dimitris Papastamos b73b60e554
Merge pull request #1517 from satheesbalya-arm/sb1_2607_mcd_reg
Console: Use callee-saved registers
2018-08-17 09:51:01 +01:00
Sathees Balya d35cc347db Console: Use callee-saved registers
This allows the console drivers to be implemented in C

Change-Id: Ibac859c4bcef0e92a0dcacc6b58ac19bc69b8342
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
2018-08-15 13:03:01 +01:00
Dimitris Papastamos 07da0bf976
Merge pull request #1516 from antonio-nino-diaz-arm/an/printf
Replace stdio.h functions by TF functions
2018-08-15 10:49:57 +01:00
Dimitris Papastamos 09895d42b5
Merge pull request #1520 from robertovargas-arm/cci-dsb
cci: Use dsb to wait before reading status register
2018-08-13 15:29:22 +01:00
Roberto Vargas fcb52dbf16 cci: Use dsb to wait before reading status register
The CCI500 TRM explicitily requires completion of the write
operation before the read operation, and it is not guaranteed
by dmb but it is dsb.

Change-Id: Ieeaa0d1a4b8fcb87108dea9b6de03d9c8a150829
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
2018-08-13 14:20:30 +01:00
Dimitris Papastamos 3ba9295715
Merge pull request #1510 from robertovargas-arm/romlib
Add support for moving libraries to ROM
2018-08-13 13:02:16 +01:00
Antonio Nino Diaz cadb36cb0a drivers/mmc: Fix warning about usage of uninitialized variable
Because of -Werror, this causes a build error.

Change-Id: I37a8c4bbfe3f2ced5e17981a2814985919ad483b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-08-10 14:58:08 +01:00
Haojian Zhuang 41583c5781 drivers/emmc: remove emmc framework
Replace emmc framework by mmc framework.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang 7a8b483067 drivers/dw_mmc: migrate to mmc framework
Migrate dw_mmc driver from emmc framework to mmc framework. The
emmc framework will be abandoned.

Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00
Haojian Zhuang bd4e3deee9 drivers/mmc: set buswidth and speed before reading data
It should set buswidth and speed of mmc controller before accessing
mmc.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
2018-08-10 17:11:12 +08:00