Commit Graph

724 Commits

Author SHA1 Message Date
Marek Vasut 7479a33f45 rcar_gen3: drivers: qos: H3: Drop MD pin check
The DBSC_SCFCTST2 is always written with the same value, no matter
what the MD pin value is, drop the entire check and just write the
register with the one and only possible value.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I4d8926eb3c44c61ec777c05c581ce8247f13daa6
2019-06-17 13:25:06 +02:00
Marek Vasut 1a9eb1ed62 rcar_gen3: drivers: qos: H3: Drop useless comments
Drop useless comments in dbsc_setting(). No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I9e3d025567ff4e10e2b4448e8a518b4eee13f6c5
2019-06-17 13:25:06 +02:00
Marek Vasut 606dfb2c12 rcar_gen3: drivers: qos: H3: Drop extra level of nesting
The extra level of nesting is not necessary, drop it.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I7b55a6fa53145ff0427e05656234917f486031df
2019-06-17 13:25:06 +02:00
Marek Vasut fcc9d57c06 rcar_gen3: drivers: qos: H3: Convert mstat table to uint64_t
Convert the mstat table from a complex structure to simple sequence
of uint64_t values, since the structure described just that and the
loop can operate over incrementing sequence of addresses just fine.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I379a1a5dfe2095d9477b364393ab120c4d8e1ba4
2019-06-17 13:25:06 +02:00
Marek Vasut 4318b58082 rcar_gen3: drivers: qos: H3: Factor out mstat fix into separate file
Pull out the mstat fix array into separate file, to align the structure
of the driver with the other SoCs. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ia92abe11c425220a065d707c350644c955efef92
2019-06-17 13:25:06 +02:00
Marek Vasut 60d78ca478 rcar_gen3: drivers: qos: H3: Use common register definition
Use common qos_regs.h instead of a local copy in the H3 QoS init.
Fill missing registers into qos_regs.h . No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I0b5ceab71be07e270885bdff403e5292e3373787
2019-06-17 13:25:05 +02:00
Marek Vasut 018358fc37 rcar_gen3: console: Convert to multi-console API
Convert the R-Car Gen3 platform and both SCIF and Log drivers
to multi-console API.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I18556973937d150b60453f9150d54ee612571e35
2019-06-14 00:16:55 +02:00
Sandrine Bailleux 2efb7ddc3b Fix type of cot_desc_ptr
The chain of trust description and the pointer pointing to its first
element were incompatible, thus requiring an explicit type cast for
the assignment.

- cot_desc was an array of
  const pointers to const image descriptors.

- cot_desc_ptr was a const pointer to
  (non-constant) pointers to const image descriptors.

Thus, trying to assign cot_desc to cot_desc_ptr (with no cast) would
generate the following compiler warning:

drivers/auth/tbbr/tbbr_cot.c:826:14: warning: initialization discards
  ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 REGISTER_COT(cot_desc);
              ^~~~~~~~

Change-Id: Iae62dd1bdb43fe379e3843d96461d47cc2f68a06
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2019-06-13 12:53:17 +02:00
James kung acc2985268 Prevent pending G1S interrupt become G0 interrupt
According to Arm GIC spec(IHI0069E, section 4.6.1),
when GICD_CTLR.DS == 0, Secure Group 1 interrupts
are treated as Group 0 by a CPU interface if:
- The PE does not implement EL3.
- ICC_SRE_EL1(S).SRE == 0

When a cpu enter suspend or deep idle, it might be
powered off. When the cpu resume, according to
the GIC spec(IHI0069E, section 9.2.15, 9.2.16 and
9.2.22) the ICC_SRE_EL1.SRE reset value is 0 (if
write is allowed) and G0/G1S/G1NS interrupt of the
GIC cpu interface are all disabled.

If a G1S SPI interrupt occurred and the target cpu
of the SPI is assigned to a specific cpu which is
in suspend and is powered off, when the cpu resume
and start to initial the GIC cpu interface, the
initial sequence might affect the interrupt group
type of the pending interrupt on the cpu interface.

Current initial sequence on the cpu interface is:
1. Enable G0 interrupt
2. Enable G1S interrupt
3. Enable ICC_SRE_EL1(S).SRE

It is possible to treat the pending G1S interrupt
as G0 interrupt on the cpu interface if the G1S
SPI interrupt occurred between step2 and step3.

To prevent the above situation happend, the initial
sequence should be changed as follows:
1. Enable ICC_SRE_EL1(S).SRE
2. Enable G0 interrupt
3. Enable G1S interrupt

Change-Id: Ie34f6e0b32eb9a1677ff72571fd4bfdb5cae25b0
Signed-off-by: James Kung <kong1191@gmail.com>
2019-06-05 11:05:05 +08:00
Masahisa Kojima 292bc55193 drivers: scmi: scmi_sq: Modify wrong payload length
Payload length of the get dram mapping information message is 0.
The mbx_mem->len parameter should be 4, it only contains
message header.

Fixes: b67d202 ("plat/synquacer: enable SCMI support")
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Change-Id: If1cd4c855da2dc5dc4b6da3bea152b8441971de7
2019-05-23 14:41:35 +09:00
Yoshifumi Hosoya 197822e2aa rcar_gen3: drivers: qos: update QoS setting
Update M3 Ver.3.0 QoS setting rev.0.03.

Change-Id: I892521d456c606ac3d30f2b2ac6b4e16faa5fc48
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-05-22 01:06:38 +02:00
Soby Mathew 519a7db252 Merge "drivers: ufs: Extend the delay after reset to wait for some slower chips" into integration 2019-05-15 15:58:17 +00:00
John Stultz cbebadf595 drivers: ufs: Extend the delay after reset to wait for some slower chips
We've seen issues with some THG based UFS chips, where
after reset the LUNs don't always enumerate properly.

After some debugging, we found that extending the mdelay
here seems to resolve the issue by giving the chips enough
time to complete reset.

Change-Id: I848f810b2438ed6ad3d33db614c61d2cef9ac400
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-05-13 17:11:07 -07:00
Alexei Fedorov 1461ad9feb SMMUv3: Abort DMA transactions
For security DMA should be blocked at the SMMU by default
unless explicitly enabled for a device. SMMU is disabled
after reset with all streams bypassing the SMMU, and
abortion of all incoming transactions implements a default
deny policy on reset.
This patch also moves "bl1_platform_setup()" function from
arm_bl1_setup.c to FVP platforms' fvp_bl1_setup.c and
fvp_ve_bl1_setup.c files.

Change-Id: Ie0ffedc10219b1b884eb8af625bd4b6753749b1a
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2019-05-10 16:09:19 +01:00
Alexei Fedorov ccd4d475ea SMMUv3: refactor the driver code
This patch is a preparation for the subsequent changes in
SMMUv3 driver. It introduces a new "smmuv3_poll" function
and replaces inline functions for accessing SMMU registers
with mmio read/write operations. Also the infinite loop
for the poll has been replaced with a counter based timeout.

Change-Id: I7a0547beb1509601f253e126b1a7a6ab3b0307e7
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2019-05-03 09:27:46 +00:00
Heiko Stuebner 6f78eb5cf0 drivers: ti: uart: add a aarch32 variant
Rockchip re-uses the ti uart console driver and for aarch32 needs a
specific variant, so add it.
There are also aarch32 ti socs, so it may be useful for them as well
at some point.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Change-Id: I31ede7cc7b10347b3691cff051db2b985fd59e17
2019-04-25 13:37:56 +02:00
Ambroise Vincent 71892ca331 Console: Allow to register multiple times
It removes the need to unregister the console on system suspend.

Change-Id: Ic9311a242a4a9a778651f7e6380bd2fc0964b2ce
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-24 10:50:16 +01:00
Aditya Angadi f79abf5e98 drivers/sbsa: add sbsa watchdog driver
Add a driver for configuring the SBSA Generic Watchdog which aids in
the detection of errant system behaviour.

Change-Id: I5a1e7149c69fd8b85be7dfbcf511f431339946f4
Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
2019-04-17 18:24:35 +05:30
Antonio Niño Díaz 72db70ca18 Merge changes from topic "av/tls-heap" into integration
* changes:
  Mbed TLS: Remove weak heap implementation
  sgm: Fix bl2 sources
2019-04-12 10:40:15 +00:00
Ambroise Vincent 2374ab1799 Mbed TLS: Remove weak heap implementation
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-12 09:52:52 +01:00
Toshiyuki Ogasahara 7704ff9132 rcar_gen3: drivers: Change to restore timer counter value at resume
Changed to save and restore cntpct_el0 using memory mapped
register for generic timer when System Suspend and Resume.

Reported by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>
Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: I40fd9f5434c4d52b320cd1d20322b9b8e4e67155
2019-04-11 12:57:03 +02:00
Yoshifumi Hosoya 4983f8b63c rcar_gen3: drivers: pwrc: Add DBSC4 setting before self-refresh mode
Very rarely, LPDDR4 power consumption may not decrease
In self-refresh mode.

This patch fixes the DBSC4 self-refresh mode sequence.

Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Kenji Miyazawa <kenji.miyazawa.xt@renesas.com>
Signed-off-by: Chiaki Fujii <chiaki.fujii.wj@renesas.com>
Change-Id: I838fa0892b1caf1ecd3f04538b3427e7d971ef59
2019-04-11 12:57:02 +02:00
Chiaki Fujii 4988c4c165 rcar_gen3: drivers: ddr: Update DDR setting rev.0.35
[IPL/DDR]
- Update DDR setting rev.0.35.

Signed-off-by: Chiaki Fujii <chiaki.fujii.wj@renesas.com>
Change-Id: I2b936ca8621ca320cc97353f99240da5f24781f7
2019-04-11 12:57:00 +02:00
Yoshifumi Hosoya d8e666a35d rcar_gen3: drivers: qos: change subslot cycle
Subslot cycle from 132 to 126 as default setting.
Subslot cycle from 264 to 252.

 [IPL/QoS]
 - Update H3 Ver.2.0 QoS setting rev.0.21.
 - Update H3 Ver.3.0 QoS setting rev.0.11.
 - Update M3 Ver.1.1 QoS setting rev.0.19.
 - Update M3 Ver.3.0 QoS setting rev.0.02.
 - Update M3N Ver.1.1 QoS setting rev.0.09.

Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Change-Id: I52b1bf880163ce03065dc8933d7f193e45cfd9a5
2019-04-11 12:57:00 +02:00
Yusuke Goda 8c7155878c rcar_gen3: drivers: board: Add new board revision for H3ULCB
Board Revision[2:0]
 3'b000 Rev1.0 OB
 3'b001 Rev1.0 CE
 3'b010 Rev2.0	[New]

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Change-Id: I0f109cddc95eca78aea34c7149e70f14e2f1620b
2019-04-11 12:56:59 +02:00
Joel Hutton 7a246d64d5 Checkpatch: Style fix
Change-Id: I0cb9f0db1ef3491f55c038a10db5a88d37e89697
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2019-04-09 09:29:58 +01:00
Joel Hutton 30070427e3 cot-desc: optimise memory further
This changes the auth_img_desc_t struct to have pointers to struct
arrays instead of struct arrays. This saves memory as many of these
were never used, and can be NULL pointers. Note the memory savings are
only when these arrays are not initialised, as it is assumed these
arrays are fixed length. A possible future optimisation could allow for
variable length.

memory diff:
bl1:        bl2:
    text        text
      -12         -12
    bss         bss
      -1463       0
    data        data
      -56         -48
    rodata      rodata
      -5688       -2592
    total       total
      -7419       -2652

Change-Id: I8f9bdedf75048b8867f40c56381e3a6dc6402bcc
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2019-04-08 14:24:21 +01:00
Joel Hutton 0b6377d1c6 Reduce memory needed for CoT description
When Trusted Board Boot is enabled, we need to specify the Chain of
Trust (CoT) of the BL1 and BL2 images. A CoT consists of an array
of image descriptors. The authentication module assumes that each
image descriptor in this array is indexed by its unique image
identifier. For example, the Trusted Boot Firmware Certificate has to
be at index [TRUSTED_BOOT_FW_CERT_ID].

Unique image identifiers may not necessarily be consecutive. Also,
a given BL image might not use all image descriptors. For example, BL1
does not need any of the descriptors related to BL31. As a result, the
CoT array might contain holes, which unnecessarily takes up space in
the BL binary.

Using pointers to auth_img_desc_t structs (rather than structs
themselves) means these unused elements only use 1 pointer worth of
space, rather than one struct worth of space. This patch also changes
the code which accesses this array to reflect the change to pointers.

Image descriptors not needed in BL1 or BL2 respectively are also
ifdef'd out in this patch. For example, verifying the BL31 image is
the responsibility of BL2 so BL1 does not need any of the data
structures describing BL31.

memory diff:
bl1:        bl2:
    text        text
      -20         -20
    bss         bss
      -1463       0
    data        data
      -256        -48
    rodata      rodata
      -5240       -1952
    total       total
      -6979       -2020

Change-Id: I163668b174dc2b9bbb183acec817f2126864aaad
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2019-04-08 14:21:21 +01:00
Ambroise Vincent 6e756f6d6d Makefile: remove extra include paths in INCLUDES
Now it is needed to use the full path of the common header files.

Commit 09d40e0e08 ("Sanitise includes across codebase") provides more
information.

Change-Id: Ifedc79d9f664d208ba565f5736612a3edd94c647
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-03 15:30:46 +01:00
Ambroise Vincent cc69cfd28c tzc: remove deprecated types
Types tzc_action_t and tzc_region_attributes_t are deprecated.

Change-Id: Ieefeb8521a0e1130f39d09b5c0d2728f05084773
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-03 14:55:18 +01:00
Ambroise Vincent be3991c0c3 Console: remove deprecated finish_console_register
The old version of the macro is deprecated.

Commit cc5859ca19 ("Multi-console: Deprecate the
`finish_console_register` macro") provides more details.

Change-Id: I3d1cdf6496db7d8e6cfbb5804f508ff46ae7e67e
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-03 14:55:18 +01:00
Antonio Niño Díaz 682c307d2c
Merge pull request #1917 from marex/arm/master/v3meagle-v2.0.1
rcar_gen3: plat: Add R-Car V3M support
2019-04-03 14:06:21 +01:00
Remi Pommarel b99f9224ed meson/gxl: Add support for SHA256 DMA engine
In order to configure and boot SCP, BL31 has to compute and send
the SHA-256 of the firmware data via scpi. Luckily Amlogic GXL SOC
has a DMA facility that could be used to offload SHA-256
computations. This adds basic support of this hardware SHA-256
engine.

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
2019-04-02 16:33:59 +02:00
Valentine Barshak b709fe9c43 rcar_gen3: plat: Add R-Car V3M support
Add R-Car V3M support. This is based on the original
V3M support patch for Yocto v2.23.1 by Vladimir Barinov.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
---
Marek: Update on top of mainline ATF/master
2019-04-02 15:37:00 +02:00
Marek Vasut 15652ec3ff rcar_gen3: drivers: qos: Add D3 QoS tables
Add QoS tables for R-Car D3 SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Marek Vasut b645d22b50 rcar_gen3: drivers: pfc: Add D3 PFC tables
Add PFC tables for R-Car D3 SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Marek Vasut b60b9b5a66 rcar_gen3: drivers: ddr_a: Add D3 DDR init
Add R-Car D3 DDR initialization code. The code is in staging and needs
cleanup, and possibly can even be merged with the E3 init code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Marek Vasut cdea546d70 rcar_gen3: drivers: swdt: Add D3 support
Add WTCNT register configuration for the D3 SoC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Marek Vasut ada66133e9 rcar_gen3: drivers: scif: Add D3 support
Add SCIF configuration specifics for the D3 SoC, that is detection
of the D3 SoC and SCBRR configuration.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Marek Vasut 5c1d535730 rcar_gen3: drivers: pwrc: Add D3 support
The D3 SoC has one CPU core, just return 1 as a CPU number.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Marek Vasut 90ff8ba6be rcar_gen3: drivers: rom: Mark NEW table as D3 compatible
Add comment into the ROM driver that the new table is also D3 compatible.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Marek Vasut bfbf5df405 rcar_gen3: plat: Add initial D3 support
Add R-Car D3 SoC platform specifics. Driver, PFC, QoS, DDR init code
will be added separately.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-04-02 03:40:51 +02:00
Ambroise Vincent bde2836fcc Remove several warnings reported with W=2
Improved support for W=2 compilation flag by solving some nested-extern
and sign-compare warnings.

The libraries are compiling with warnings (which turn into errors with
the Werror flag).

Outside of libraries, some warnings cannot be fixed.

Change-Id: I06b1923857f2a6a50e93d62d0274915b268cef05
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-01 10:43:42 +01:00
Ambroise Vincent 609e053caa Remove several warnings reported with W=1
Improved support for W=1 compilation flag by solving missing-prototypes
and old-style-definition warnings.

The libraries are compiling with warnings (which turn into errors with
the Werror flag).

Outside of libraries, some warnings cannot be fixed without heavy
structural changes.

Change-Id: I1668cf99123ac4195c2a6a1d48945f7a64c67f16
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
2019-04-01 10:43:42 +01:00
Tien Hock, Loh 2baa727011 driver: synosys: Fix SD MMC not initializing correctly
dw_params.mmc_dev_type should be assigned before mmc_init, otherwise SDMMC
initialization will fail as the initialization treats the device as EMMC
instead of SD.

Signed-off-by: Tien Hock, Loh <tien.hock.loh@intel.com>
2019-03-22 12:54:31 +08:00
Soby Mathew b79239db1c
Merge pull request #1879 from pbeesley-arm/pb/todo-removal
Pb/todo removal
2019-03-13 15:32:15 +00:00
Soby Mathew c61a807a4f
Merge pull request #1874 from hadi-asyrafi/qspi_boot
intel: QSPI boot enablement
2019-03-13 15:31:33 +00:00
Soby Mathew 77913d446c
Merge pull request #1858 from thloh85-intel/dwmmc_fixes
drivers: synopsys: Fix synopsys MMC driver
2019-03-13 15:25:54 +00:00
Soby Mathew eb9da9e182
Merge pull request #1856 from masahisak/synquacer-scmi-support
plat/synquacer: enable SCMI support
2019-03-13 15:24:11 +00:00
Muhammad Hadi Asyrafi Abdul Halim f5ba408c34 intel: QSPI boot enablement
Manages QSPI initialization, configuration and IO handling as boot device

Signed-off-by: Muhammad Hadi Asyrafi Abdul Halim <muhammad.hadi.asyrafi.abdul.halim@intel.com>
2019-03-13 10:17:14 +08:00
Masahisa Kojima b67d20297f plat/synquacer: enable SCMI support
Enable the SCMI protocol support in SynQuacer platform.
Aside from power domain, system power and apcore management protocol,
this commit adds the vendor specific protocol(0x80).
This vendor specific protocol is used to get the dram mapping information
from SCP.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2019-03-13 09:54:15 +09:00
Paul Beesley 7d721816a3 drivers: Remove TODO from io_fip.c
The comment suggests checking version numbers and
a checksum but there doesn't seem to be any usable
data for either of these.

For example, fip_toc_header_t doesn't contain any
version information and neither does fip_toc_entry_t.

As the function name "is_valid_header" suggests, this
function is not concerned with checksumming any of
the table of contents entries.

Change-Id: I8673ae5dd37793771760169f26b2f55c15fbf587
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-03-12 13:42:08 +00:00
Paul Beesley 9a2fffb800 drivers: Remove TODO from io_storage
This TODO was added five years ago so I assume that there is not
going to be a shutdown API added after all.

Change-Id: If0f4e2066454df773bd9bf41ed65d3a10248a2d3
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-03-12 13:42:08 +00:00
Tien Hock, Loh 3d0f30bb54 drivers: synopsys: Fix synopsys MMC driver
There are some issues with synopsys MMC driver:
- CMD8 should not expect data (for SD)
- ACMD51 should expect data (Send SCR for SD)
- dw_prepare should not dictate size to be MMC_BLOCK_SIZE, block size is
now handled in the dw_prepare function
- after the CMD completes, when doing dw_read, we need to invalidate cache
and wait for the data transfer to complete
- Need to set FIFO threshold, otherwise DMA might never get the interrupt
to read or write

Signed-off-by: Tien Hock, Loh <tien.hock.loh@intel.com>
2019-03-12 14:39:50 +08:00
Yann Gautier b248bb4a74 mmc: stm32_sdmmc2: fill ocr_voltage
STM32MP1 SDMMC device voltage is 3.3V. We should then precise the 2 ranges
3.2 to 3.3V and 3.3 to 3.4V in ocr_voltage field.

Change-Id: I88e479f8f16bfe608a7808eace0df3fdec48deab
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-03-08 10:59:00 +01:00
Dimitris Papastamos 3c652a2d1c
Merge pull request #1863 from thloh85-intel/mmc_fixes
drivers: mmc: Fix some issues with MMC stack
2019-03-08 09:41:22 +00:00
Tien Hock, Loh a468e75637 drivers: mmc: Fix some issues with MMC stack
Some bugs in MMC stack needs to be fixed:
- scr cannot be local as this will cause cache issue when invalidating
after the read DMA transfer is completed
- ACMD41 needs to send voltage information in initialization, otherwise the
command is a query, thus will not initialize the controller
- when checking device state, retry until the retries counter goes to zero
before failing

Signed-off-by: Tien Hock, Loh <tien.hock.loh@intel.com>
2019-03-07 11:34:20 +08:00
Antonio Niño Díaz f009c5f312
Merge pull request #1847 from jts-arm/mbedtls
Remove Mbed TLS dependency from plat_bl_common.c
2019-03-05 10:39:14 +00:00
Marek Vasut 9b70cd5f0d rcar_gen3: drivers: pfc: Configure GP5_09 as input on ULCB
Configure the GPIO5 09 pin as input on the ULCB board by default,
since the pin is routed on the expansion connector and not connected
to anything by default.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-03-04 13:29:32 +01:00
Marek Vasut 845d8fbb6e rcar_gen3: Add M3-W 3.0 support
Add support for the M3W 3.0 SoC and synchronize the upstream ATF with
Renesas downstream ATF release v2.0.1.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-03-04 13:29:32 +01:00
John Tsichritzis 17e1335c89 Remove Mbed TLS dependency from plat_bl_common.c
Due to the shared Mbed TLS heap optimisation introduced in 6d01a463,
common code files were depending on Mbed TLS specific headers. This
dependency is now removed by moving the default, unoptimised heap
implementation inside the Mbed TLS specific files.

Change-Id: I11ea3eb4474f0d9b6cb79a2afd73a51a4a9b8994
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
2019-02-28 14:01:42 +00:00
Antonio Nino Diaz 73308618fe Minor changes to documentation and comments
Fix some typos and clarify some sentences.

Change-Id: Id276d1ced9a991b4eddc5c47ad9a825e6b29ef74
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-02-28 13:35:21 +00:00
Ying-Chun Liu (PaulLiu) 2c8ef2ae6b rpi3: sdhost: SDHost driver improvement
This commit improves the SDHost driver for RPi3 as following:
 * Unblock MMC_CMD(17). Using MMC_CMD(17) is more efficient on
   block reading.
 * In some low probability that SEND_OP_COND might results CRC7
   error. We can consider that the command runs correctly. We don't
   need to retry this command so removing the code for retry.
 * Using MMC_BUS_WIDTH_1 as MMC default value to improve the stability.
 * Increase the clock to 50Mhz in data mode to speed up the io.
 * Change the pull resistors configuration to gain more stability.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
2019-02-27 01:06:57 +08:00
Antonio Niño Díaz ab3d22473d
Merge pull request #1836 from Yann-lms/docs_and_m4
Update documentation for STM32MP1 and add Cortex-M4 support
2019-02-22 15:23:52 +00:00
Yann Gautier b053a22e8a stm32mp1: add minimal support for co-processor Cortex-M4
STM32MP1 chip embeds a dual Cortex-A7 and a Cortex-M4.
The support for Cortex-M4 clocks is added when configuring the clock tree.
Some minimal security features to allow communications between A7 and M4
are also added.

Change-Id: I60417e244a476f60a2758f4969700b2684056665
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-02-20 17:34:21 +01:00
Usama Arif a5aa25af65 Division functionality for cores that dont have divide hardware.
Cortex a5 doesnt support hardware division such as sdiv and udiv commands.
This commit adds a software division function in assembly as well as include
appropriate files for software divison.

The software division algorithm is a modified version obtained from:
http://www.keil.com/support/man/docs/armasm/armasm_dom1359731155623.htm

Change-Id: Ib405a330da5f1cea1e68e07e7b520edeef9e2652
Signed-off-by: Usama Arif <usama.arif@arm.com>
2019-02-19 17:07:48 +00:00
Yann Gautier 0d21680c35 stm32mp1: update clock driver
Remove useless private structure in function prototypes.
Add a reference counter on clocks.
Prepare for future secured/shared/non-secured clocks.

Change-Id: I3dbed81721da5ceff5e10b2c4155b1e340c036ee
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas LE BAYON <nicolas.le.bayon@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier 5202cb393d stm32mp1: add timeout detection in reset driver
This change makes the platform to panic in case of peripheral reset
resource malfunction.

Change-Id: I17eb9cb045b78a4e5142a8c33b744e84992d732a
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Nicolas LE BAYON <nicolas.le.bayon@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier 7ae58c6ba7 stm32mp1: use functions to retrieve some peripheral addresses
PWR, RCC, DDRPHYC & DDRCTRL addresses can be retrieved from device tree.
Platform asserts the value read from the DT are the SoC addresses.

Change-Id: I43f0890b51918a30c87ac067d3780ab27a0f59de
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Nicolas LE BAYON <nicolas.le.bayon@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier 447b2b137d stm32mp1: split clkfunc code
Create a new file stm32mp_clkfunc.c to put functions that could be common
between several platforms.

Change-Id: Ica915c796b162b2345056b33328acc05035a242c
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier d82d4ff066 stm32mp1: update I2C and PMIC drivers
Regulator configuration at boot takes more information from DT.
I2C configuration from DT is done in I2C driver.
I2C driver manages more transfer modes.
The min voltage of buck1 should also be increased to 1.2V,
else the platform does not boot.

Heavily modifies stm32_i2c.c since many functions move inside the source
file to remove redundant declarations.

Change-Id: I0bee5d776cf3ff15e687427cd6abc06ab237d025
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas LE BAYON <nicolas.le.bayon@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier dfdb057a17 stm32mp1: use new functions to manage timeouts
Remove the previously use function: get_timer, and use new functions
timeout_init_us and timeout_elapsed.

Change-Id: I4e95b123648bff7ca91e40462a2a3ae24cfe1697
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Nicolas LE BAYON <nicolas.le.bayon@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier e0a8ce5d0d stm32mp1: remove some dependencies on clocks and reset in drivers
Include all RCC, clocks and reset headers from stm32mp1_def.h
which if exported to the firmware through platform_def.h.
The same dependency removal is done in common code as well.
Some useless includes are also removed in stm32_sdmmc2 driver.

Change-Id: I731ea5775c3fdb7f7b0c388b93923ed5e84b8d3f
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier 3f9c97842e stm32mp1: make functions and macros more common
Mainly remove suffix 1 from prefix stm32mp1 in several macros and functions
that can be used in drivers shared by different platforms.

Change-Id: I2295c44f5b1edac7e80a93c0e8dfd671b36e88e7
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2019-02-14 11:20:23 +01:00
Yann Gautier c9d75b3cf9 stm32mp1: split code between common and private parts
Some parts of code could be shared with platform derivatives,
or new platforms.
A new folder plat/st/common is created to put common parts.

stm32mp_common.h is a common API aggregate.

Remove some casts where applicable.
Fix some types where applicable.
Remove also some platform includes that are already in stm32mp1_def.h.

Change-Id: I46d763c8d9e15732d1ee7383207fd58206d7f583
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2019-02-14 11:20:23 +01:00
Antonio Niño Díaz eaea119ea1
Merge pull request #1820 from thloh85-intel/integration_mbr
drivers: partition: Add simple MBR partition entries support
2019-02-13 15:53:18 +00:00
Loh Tien Hock 30f833cabd drivers: partition: Add simple MBR partition entries support
This is to add simple MBR partition entry support. This will read all four
MBR partition into the partition list, and the partition type will be saved
in the list.name[0] entry.

Signed-off-by: Loh Tien Hock <tien.hock.loh@intel.com>
2019-02-13 14:26:15 +08:00
Ying-Chun Liu (PaulLiu) 70086dc466 imx: warp7: Migrate to MULTI_CONSOLE_API
This commit migrates to MULTI_CONSOLE_API for IMX Warp7 board.
We also rename the functions in imx_uart driver to more specific one.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
2019-02-12 18:56:29 +08:00
Antonio Nino Diaz 29a24134c1 drivers: generic_delay_timer: Assert presence of Generic Timer
The Generic Timer is an optional extension to an ARMv7-A implementation.
The generic delay timer can be used from any architecture supported by
the Trusted Firmware. In ARMv7 it is needed to check that this feature
is present. In ARMv8 it is always present.

Change-Id: Ib7e8ec13ffbb2f64445d4ee48ed00f26e34b79b7
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-02-06 09:54:42 +00:00
Soby Mathew 5dc2c3f95c GICv3: Allow probe for fewer GICR interfaces than exposed by the frame
Previously the GICv3 redistributor probe function
(gicv3_rdistif_base_addrs_probe()) asserted that the number of
per-CPU redistributor interfaces expected to be probed by the
platform is equal to the number exported by the redistributor
frame. This is a problem in case the number of CPUs in the
platform is less than the number of redistributor interfaces
in the frame. Hence this patch removes the assertion check
and allows probe for fewer redistributor interfaces as required
by the platform.

Change-Id: I3449763a3ad70817224442cbe184d001030c9874
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2019-02-04 15:42:36 +00:00
Antonio Niño Díaz 5735057d15
Merge pull request #1796 from grandpaul/rpi3-sdhost-driver
RPi3 SDHost driver
2019-02-04 11:26:00 +00:00
Ying-Chun Liu (PaulLiu) 0503adf4f3 rpi3: Add SDHost driver
This commit adds SDHost driver for RaspberryPi3. SDHost driver uses the
GPIO driver to connect the SDCard and SDHost. By using this driver it is
able to read/write raw blocks on SDCard.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
2019-02-01 04:09:31 +08:00
Antonio Niño Díaz 5ce301b5cf
Merge pull request #1793 from marex/arm/master/fixes-v2.0.0
Arm/master/fixes v2.0.0
2019-01-31 10:22:36 +00:00
Antonio Niño Díaz 8e7d969885
Merge pull request #1753 from Yann-lms/emmc_ret
mmc: correctly check ret in mmc_fill_device_info
2019-01-31 09:20:45 +00:00
Antonio Niño Díaz 5755a30b85
Merge pull request #1786 from laroche/static_vars_functions
Change some vars and functions to be static.
2019-01-29 13:43:46 +00:00
Marek Vasut c87c8f85b1 rcar_gen3: drivers: ddr: Clean up printouts
Clean up the NOTICE() and FATAL_MSG() outputs, so that they contain
proper newlines and BL2 prefixes.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-29 06:07:21 +01:00
Sergii Boryshchenko 458a449cfd rcar_gen3: drivers: cpld: fix power-off on reset
Method cpld_reset_cpu of bl31 is called from the Linux kernel and uses
GPIO6, GPIO2 pins as SPI bus lines to control the CPLD device. But in the
kernel GPIO6_8 pin are initialized to work in interrupt mode instead of
the input/output mode. This leads to the fact that the SPI bus becomes
non-functional. In this patch we switch the GPIO6_8 pin back to the
input-output mode.

Signed-off-by: Sergii Boryshchenko <sergii.boryshchenko@globallogic.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-29 06:07:21 +01:00
Marek Vasut 47366cb13c rcar_gen3: plat: Add missing cpu_on_check() implementation
The ATF code fails to build with PMIC_ROHM_BD9571=0, add the missing
function into the PWRC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-29 06:07:21 +01:00
Antonio Niño Díaz d4dcadb067
Merge pull request #1773 from grandpaul/rpi3-gpio-driver
Rpi3 gpio driver
2019-01-28 12:04:13 +00:00
Antonio Niño Díaz 83a2285ec8
Merge pull request #1784 from antonio-nino-diaz-arm/an/includes-arm
plat/arm: Cleanup of includes and drivers
2019-01-28 10:53:29 +00:00
Florian La Roche 9822852967 Change some vars and functions to be static.
Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2019-01-27 14:30:12 +01:00
Joel Hutton e84c871391 multi_console: Check functions are not NULL
Change-Id: I2d67bb1bebd15e6a7d69ea5e7b6fda9c972f9d86
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
2019-01-25 16:23:54 +00:00
Ying-Chun Liu (PaulLiu) d604ac4831 rpi3: Add GPIO driver
This commit adds GPIO driver for RaspberryPi3. The GPIO driver for RPi3
also provides the way to do pinmux selections.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
2019-01-26 00:13:49 +08:00
Antonio Nino Diaz 560293bb6f fvp: pwrc: Move to drivers/ folder
Change-Id: I670ea80e0331c2d4b2ccfa563a45469a43f6902d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-25 16:04:11 +00:00
Antonio Nino Diaz 5932d194d7 plat/arm: sds: Move to drivers/ folder
Change-Id: Ia601d5ad65ab199e747fb60af4979b7db477d249
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-25 16:04:11 +00:00
Antonio Nino Diaz 2d4135e08f plat/arm: scp: Move to drivers/ folder
Change-Id: Ida5dae39478654405d0ee31a6cbddb4579e76a7f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-25 16:04:11 +00:00
Antonio Nino Diaz 0387aa42ac plat/arm: scpi: Move to drivers/ folder
Change-Id: Icc59cdaf2b56f6936e9847f1894594c671db2e94
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-25 16:04:11 +00:00
Antonio Nino Diaz c411396e55 plat/arm: mhu: Move to drivers/ folder
Change-Id: I656753a1825ea7340a3708b950fa6b57455e9056
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-25 16:04:11 +00:00
Antonio Nino Diaz 14928b88ab plat/arm: scmi: Move to drivers/ folder
Change-Id: I8989d2aa0258bf3b50a856c5b81532d578600124
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2019-01-25 16:04:11 +00:00
Yann Gautier 88ef0425da stm32mp1: add BSEC driver
The BSEC (Boot and Security and OTP control) is intended to control an OTP
(one time programmable) fuse box, used for on-chip non-volatile storage
for device configuration and security parameters.

Change-Id: I38c44684c7b9c6a1f24ec0ae3fe99cec481d5a51
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Mathieu Belou <mathieu.belou@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
2019-01-18 15:45:08 +01:00
Yann Gautier 1fc2130c5b stm32mp1: update device tree and gpio functions
Change fdt_check_status function to fdt_get_status.
Update GPIO defines.
Move some functions in gpio driver, instead of dt helper file.
Add GPIO bank helper functions.
Use only one status field in dt_node_info structure including both status
and secure status.

Change-Id: I34f93408dd4aac16ae722f564bc3f7d6ae978cf4
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
2019-01-18 15:45:08 +01:00
Yann Gautier 4156d4daa8 drivers: st: update drivers code
Reword some traces.
Use uintptr_t where required.
Reduce scope of variables.
Improve io_stm32image algo.
Complete some IP registers definitions.
Add failure on supported DDR (stm32mp1_ddr_init()).
Fix cache flush on cache disable (stm32mp1_ddr_setup).

Change-Id: Ie02fa71e02b9d69abc807fd5b7df233e5be6668c
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-01-18 15:45:08 +01:00
Yann Gautier 077f682853 drivers: st: pmic: update stpmic1 driver
Change-Id: I4a1b281925e0a3a1e2a34b3e363537e4a7f13823
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
2019-01-18 15:45:08 +01:00
Yann Gautier c948f77136 stm32mp1: update device tree files
The drivers are also updated to reflect the changes.
Set RCC as non-secure.

Change-Id: I568fa1f418355830ad1d4d1cdcdb910fb362231b
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-01-18 15:45:08 +01:00
Yann Gautier 23684d0e81 stm32mp1: rename stpmu1 to stpmic1
This is the correct name of the IP.
Rename stm32mp1_pmic files to stm32mp_pmic.

Change-Id: I238a7d1f9a1d099daf7788dc9ebbd3146ba2f15f
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-01-18 15:45:08 +01:00
Yann Gautier 435832abfd drivers: st: move i2c driver in its own folder
The driver could be used for other devices than PMIC.

Change-Id: I4569e7c0028e52e1ff2fe9d38f11de11e95d1897
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-01-18 15:45:08 +01:00
Yann Gautier 5f9984ef5d mmc: correctly check ret in mmc_fill_device_info
In patch 93768644, ret will be MMC_STATE_TRAN (=4), which is a valid value.
We shouldn't exit the function in that case, but only if ret is < 0.

Change-Id: I776693fe847b6b45190af028f12d2e724ca46399
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-01-17 11:17:05 +01:00
Paul Beesley 8aabea3358 Correct typographical errors
Corrects typos in core code, documentation files, drivers, Arm
platforms and services.

None of the corrections affect code; changes are limited to comments
and other documentation.

Change-Id: I5c1027b06ef149864f315ccc0ea473e2a16bfd1d
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
2019-01-15 15:16:02 +00:00
Antonio Niño Díaz 34efb683e3
Merge pull request #1724 from jbech-linaro/emmc_enumeration
mmc: increase delay when initializing mmc
2019-01-10 09:23:42 +00:00
Marek Vasut ca031dff9c rcar_gen3: drivers: pwrc: Switch to common delay implementation
Replace the ad-hoc implementation of delay in PWRC driver
with common R-Car delay code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut c97c5b5eee rcar_gen3: drivers: delay: Rewrite from assembler to C
Rewrite the delay code from assembler to C.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut 452031e658 rcar_gen3: drivers: scif: Use TEND flag for transmission end detection
Use the SCIF SCFSR:TEND bit to check that all data were transmitted by
the SCIF and that there are no more valid data to transmit in the FIFO.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut e32b6228fe rcar_gen3: drivers: qos: Synchronize tables
Synchronize the QoS tables with Renesas ATF release 2.0.0 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut 042b4d456f rcar_gen3: drivers: pfc: Synchronize tables
Synchronize the pin control tables with Renesas ATF release 2.0.0 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut 544cc7203a rcar_gen3: drivers: ddr-b: Synchronize tables
Synchronize the R-Car DDR-B driver, used on R-Car H3/M3W/M3N,
with Renesas ATF release 2.0.0 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut aff7e00d72 rcar_gen3: drivers: ddr-a: Checkpatch cleanup
Run Linux kernel checkpatch on the DDR-A init code to clean it up:
$ checkpatch.pl --fix --fix-inplace -f drivers/staging/renesas/rcar/ddr/ddr_a/*

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut 5e3c4bb0a4 rcar_gen3: drivers: ddr-a: Synchronize tables
Synchronize the R-Car DDR-A driver, used on R-Car E3,
with Renesas ATF release 2.0.0 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut bd57db5316 rcar_gen3: drivers: cpld: Move rcar_cpld_reset_cpu() into header
Move the rcar_cpld_reset_cpu() function into header file and zap the externs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut 8cbc417836 rcar_gen3: drivers: swdt: Access SCR in EL3
The code runs in EL3, use EL3 accessors to manipulate the interrupt bit.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut dc03e8438f rcar_gen3: drivers: auth-mod: Access SCTLR in EL3
The code runs in EL3, use EL3 accessors to manipulate the cache bits.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut b51a773ec3 rcar_gen3: plat: Clean up rcar_pwrc_code_copy_to_system_ram()
Call the function only from architecture setup and at the end of
suspend cycle instead of calling it all over the place.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:08:44 +01:00
Marek Vasut a72e4f242d rcar_gen3: plat: Drop ddr_regdef_len()
This function is unused and triggers clang error, drop it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2019-01-08 14:04:38 +01:00
Yann Gautier 6e6ab282f7 stm32mp1: do not include platform header files directly in drivers
Instead, only platform_def.h is included.
The required files to be included are added in stm32mp1_def.h.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-01-07 11:17:24 +01:00
Antonio Nino Diaz 09d40e0e08 Sanitise includes across codebase
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: e0ea0928d5 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a2 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca33988 ("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>
2019-01-04 10:43:17 +00:00
Joakim Bech 7d6394297d mmc: increase delay when initializing mmc
Running TF-A 2.0 and later seems to cause a regression on HiKey 620.

    NOTICE:  BL2: v2.0(release):v2.0
    NOTICE:  BL2: Built : 17:41:23, Dec 17 2018
    NOTICE:  acpu_dvfs_set_freq: set acpu freq success!ERROR:   CMD1 failed after 100 retries
    ERROR:   BL2: Failed to load image (-5)

The reason seems to be that during emmc enumeration when BL2 sends the command
    OCR_SECTOR_MODE | OCR_VDD_MIN_2V7 | OCR_VDD_MIN_1V7

it for some reason takes some more time to get a reply. So a delay with
mdelay(1), seems to not be enough any longer and therefore we increase it to
mdelay(10) instead which makes the device boot as expected again.

Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
2018-12-18 10:25:06 +01:00
Soby Mathew c0940083bc
Merge pull request #1708 from Yann-lms/warnings
Add possibility to add compilation warnings
2018-12-12 15:54:47 +00:00
Soby Mathew fd809dc8d8
Merge pull request #1715 from pangupta/master
ccn: for RN-I, used node id instead of node postion
2018-12-12 15:54:09 +00:00
Pankaj Gupta 2f2b9ec822 ccn: for RN-I, used node id instead of node postion
For RN-I, node id is used instead of node postion in the bitmap
to calculate the region id.

Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
2018-12-12 09:18:27 +05:30
Yann Gautier b7c6529c41 io_block: define MAX_IO_BLOCK_DEVICES as unsigned
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-12-10 18:09:49 +01:00
Soby Mathew 85456a9201
Merge pull request #1700 from jwerner-chromium/JW_crashfix
MULTI_CONSOLE_API fixes and cleanups
2018-12-10 14:00:01 +00:00
Julius Werner 91b48c9f8f drivers/console: Reimplement MUTLI_CONSOLE_API framework in C
Now that we have switched to using the stack in MULTI_CONSOLE_API
framework functions and have factored all code involved in crash
reporting out into a separate file, there's really no reason to keep the
main framework code in assembly anymore. This patch rewrites it in C
which allows us to have a single implementation across aarch32/64 and
should be much easier to maintain going forward.

Change-Id: I6c85a01e89a79e8b233f3f8bee812f0dbd026221
Signed-off-by: Julius Werner <jwerner@chromium.org>
2018-12-06 16:18:10 -08:00
Julius Werner 985ee0b7e8 drivers/console: Link console framework code by default
This patch makes the build system link the console framework code by
default, like it already does with other common libraries (e.g. cache
helpers). This should not make a difference in practice since TF is
linked with --gc-sections, so the linker will garbage collect all
functions and data that are not referenced by any other code. Thus, if a
platform doesn't want to include console code for size reasons and
doesn't make any references to console functions, the code will not be
included in the final binary.

To avoid compatibility issues with older platform ports, only make this
change for the MULTI_CONSOLE_API.

Change-Id: I153a9dbe680d57aadb860d1c829759ba701130d3
Signed-off-by: Julius Werner <jwerner@chromium.org>
2018-12-06 16:13:50 -08:00
Julius Werner 63c52d0071 plat/common/crash_console_helpers.S: Fix MULTI_CONSOLE_API support
Crash reporting via the default consoles registered by MULTI_CONSOLE_API
has been broken since commit d35cc34 (Console: Use callee-saved
registers), which was introduced to allow console drivers written in C.
It's not really possible with the current crash reporting framework to
support console drivers in C, however we should make sure that the
existing assembly drivers that do support crash reporting continue to
work through the MULTI_CONSOLE_API.

This patch fixes the problem by creating custom console_putc() and
console_flush() implementations for the crash reporting case that do not
use the stack. Platforms that want to use this feature will have to link
plat/common/aarch64/crash_console_helpers.S explicitly.

Also update the documentation to better reflect the new reality (of this
being an option rather than the expected default for most platforms).

Change-Id: Id0c761e5e2fddaf25c277bc7b8ab603946ca73cb
Signed-off-by: Julius Werner <jwerner@chromium.org>
2018-12-06 16:10:32 -08:00
Antonio Niño Díaz 8dc395e3ed
Merge pull request #1706 from Yann-lms/mmc_init_check
MMC init check and STM32MP1 MMC driver improvements
2018-12-06 11:28:53 +01:00
Antonio Nino Diaz df54406df5 tzc380: Fix some asserts
This driver can be compiled in release builds, but GCC generates warnings
for some comparisons and that prevents the firmware from being built in
debug builds.

Change-Id: Ic52e1b4a11896ecf086864fbe2b5bfc143ec9b1b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-12-05 11:21:42 +00:00
Antonio Niño Díaz 36bc633eec
Merge pull request #1653 from JackyBai/master
Add NXP i.MX8MQ basic support
2018-12-05 11:22:55 +01:00
Antonio Niño Díaz 6d422c3e2b
Merge pull request #1702 from MISL-EBU-System-SW/patches-18.12
Update code with latest changes from Marvell LSP 18.12
2018-12-04 15:01:48 +01:00
Christine Gharzuzi 1020e0d326 ble: ap807: Switch to PLL mode and update CPU frequency
- Update CPU frequency on AP807 to 2GHz for SAR 0x0.
- Increase AVS to 0.88V for 2GHz clock

Change-Id: Ic945b682ab2f8543e34294bfc56c3eae2c5e0c8e
Signed-off-by: Christine Gharzuzi <chrisg@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Igal Liberman 55df84f974 mvebu: cp110: avoid pcie power on/off sequence when called from Linux
In Armada 8K DB boards, PCIe initialization can be executed only once
because PCIe reset performed during chip power on and it cannot be
executed via GPIO later.
This means that power on can be executed only once, when it's called
from the bootloader.
Power on:
	Read bit 21 of the mode, it marks if the caller is
	the bootloader or the Linux Kernel.
Power off:
	Check if the comphy was already configured to PCIe, if yes,
	check if the caller is bootloader, if both conditions are true
	(PCIe mode and called by Linux) - skip the power-off.

In addition, fix incorrect documentation describing mode fields -
PCIe width is 3 bits, not 2.

NOTE: with this patch, please use LK4.14.76 (LK4.4.120 may not work
with it).

Change-Id: I4b929011f97a0a1869a51ba378687e78b3eca4ff
Signed-off-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Grzegorz Jaszczyk 0529106c4b mvebu: cp110: fix phy selector configuration for XFI1
Extended phy selector configuration about XFI1 mode.

Change-Id: I1309770bbb5fdbfb0127b6f12ee78974d1d6b19f
Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
2018-12-04 14:09:44 +02:00
Peng Fan 46f9b2c3a2 drivers: add tzc380 support
Add tzc380 support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-12-04 18:06:41 +08:00
Yann Gautier 1d7bcaa636 drivers: st: mmc: improve error cases in send_cmd function
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Yann Gautier 77614a9949 drivers: mmc: check mmc_reset_to_idle return
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-04 10:38:41 +01:00
Antonio Niño Díaz 3af48da771
Merge pull request #1698 from hzhuang1/rm_emmc_delay
Rm emmc delay
2018-11-29 16:05:17 +01:00
Antonio Niño Díaz 051cf88962
Merge pull request #1679 from pangupta/master
ccn: Introduce API to set and read value of node register
2018-11-29 16:05:05 +01:00
Haojian Zhuang 9376864479 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>
2018-11-26 09:20:23 +08:00
Pankaj Gupta 6f7dba4b24 ccn: Introduce API to set and read value of node register
Signed-off-by: Pankaj Gupta <pankaj.gupta@nxp.com>
2018-11-23 16:38:43 +05:30
Vijayenthiran Subramaniam 9d3b191a48 drivers/tzc-dmc620: add driver to setup DMC-620 TZC controller
ARM CoreLink DMC-620 Dynamic Memory Controller includes a TZC controller
to setup secure or non-secure regions of DRAM memory. The TZC controller
allows to setup upto eight such regions of memory in DRAM. This driver
provides helper functions to setup the TZC controller within DMC-620.

Change-Id: Iee7692417c2080052bdb7b1c2873a024bc5d1d10
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
2018-11-21 19:25:35 +05:30
Antonio Niño Díaz bbbf7f6b88
Merge pull request #1682 from MISL-EBU-System-SW/migrate-multi-console
Marvell: Migrate to multi console API
2018-11-19 12:48:54 +01:00
Konstantin Porotchkin d7c4420cb8 plat/marvell: Migrate to multi-console API
Migrate Marvell platforms from legacy console API to
multi-console API.

Change-Id: I647f5f49148b463a257a747af05b5f0c967f267c
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-11-15 13:42:45 +02:00
Yann Gautier 8b7a26d0d6 drivers: st: uart: remove old API
Now that MULTI_CONSOLE_API is enabled for the STM32MP1 platform,
we can remove the non MULTI_CONSOLE_API parts in the driver.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-11-15 11:52:32 +01:00
Yann Gautier 6d264afc9e drivers: st: update console driver to support MULTI_CONSOLE_API
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-11-15 11:30:01 +01:00
Yann Gautier 8244d2260d stm32mp1: add a new file for UART registers definition
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-11-15 11:30:01 +01:00
Antonio Nino Diaz a6febeab81
Merge pull request #1676 from Yann-lms/static_analysis
Correct some issues found with static analysis tools
2018-11-13 13:29:03 +00:00
Alexei Colin 23b6fa4ee1 cadence: uart: comply to console_register prototype
Signed-off-by: Alexei Colin <acolin@isi.edu>
2018-11-12 09:35:49 -05:00
Yann Gautier 3e6fab4308 stm32mp1: correct some static analysis tools issues
These issues wer found by sparse:

drivers/st/clk/stm32mp1_clk.c:1524:19:
 warning: incorrect type in assignment (different base types)
    expected restricted fdt32_t const [usertype] *pkcs_cell
    got unsigned int const [usertype] *

plat/st/stm32mp1/plat_image_load.c:13:6:
 warning: symbol 'plat_flush_next_bl_params' was not declared.
 Should it be static?
plat/st/stm32mp1/plat_image_load.c:21:16:
 warning: symbol 'plat_get_bl_image_load_info' was not declared.
 Should it be static?
plat/st/stm32mp1/plat_image_load.c:29:13:
 warning: symbol 'plat_get_next_bl_params' was not declared.
 Should it be static?

plat/st/stm32mp1/bl2_io_storage.c:40:10:
 warning: symbol 'block_buffer' was not declared. Should it be static?

Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-11-09 18:22:08 +01:00
Yann Gautier 4cb17707b5 drivers: partition: correct some static analysis tools issues
cppcheck:
[drivers/partition/gpt.c:19] -> [drivers/partition/gpt.c:19]:
 (warning) Either the condition 'str_in!=((void*)0)' is redundant
 or there is possible null pointer dereference: name.

sparse:
drivers/partition/gpt.c:39:9:
 warning: Using plain integer as NULL pointer

Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-11-09 18:22:01 +01:00
Antonio Nino Diaz c3cf06f1a3 Standardise header guards across codebase
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-08 10:20:19 +00:00
Soby Mathew 7558e85fdb
Merge pull request #1668 from ldts/rcar_gen3/e3_build
rcar_gen3: E3 target: fix compilation issues
2018-11-07 17:00:49 +00:00
Sandrine Bailleux b56ec68080 Remove _tzc_get_max_top_addr() function
This function was needed at the time where we didn't have the
compiler_rt lib. An AArch32-specific variant was provided to handle
the 64-bit shift operation in 32-bit. This is no longer needed.

Change-Id: Ibab709a95e3a723ae2eeaddf873dba70ff2012b3
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2018-11-06 17:28:20 +01:00
ldts 04d1f8dd49 rcar_gen3: E3 target: fix compilation issues
Target builds but has not been tested.

Signed-off-by: ldts <jorge.ramirez.ortiz@gmail.com>
2018-11-06 11:13:03 +01:00
Antonio Niño Díaz eb47f14d73
Merge pull request #1623 from MISL-EBU-System-SW/a3700-support
Add support for Armada 3700 and COMPHY porting layer
2018-11-01 12:44:24 +01:00
Antonio Niño Díaz 318c2f9760
Merge pull request #1646 from Andre-ARM/allwinner/pmic-v2
Allwinner/pmic v2
2018-10-31 12:02:22 +01:00
Antonio Nino Diaz 9c8d913dae meson: console: Add missing define to fix build
It isn't possible to build this driver without adding this define.

Change-Id: Iba2ced411cd8ce438787871fa01b414d32b9aa42
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-10-29 11:35:34 +00:00
Antonio Nino Diaz 9b6483c880 meson: console: Introduce console driver
It has only been tested with a system clock of 24 MHz.

It has only been implemented for the multi console API.

Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-10-26 11:53:14 +01:00
Antonio Niño Díaz 583cb003b3
Merge pull request #1640 from soby-mathew/sm/fin_con_reg
Multi-console: Deprecate the `finish_console_register` macro
2018-10-25 11:54:22 +02:00
Antonio Nino Diaz af6491f85c tzc: Fix MISRA defects
The definitions FAIL_CONTROL_*_SHIFT were incorrect, they have been
fixed.

The types tzc_region_attributes_t and tzc_action_t have been removed and
replaced by unsigned int because it is not allowed to do logical
operations on enums.

Also, fix some address definitions in arm_def.h.

Change-Id: Id37941d76883f9fe5045a5f0a4224c133c504d8b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-10-23 12:12:03 +01:00
Konstantin Porotchkin 19112b795e drivers: marvell Add support for Armada-37xx UART
Introduce driver for Marvell Armada-37xx UART console

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-10-22 18:18:39 +03:00
Konstantin Porotchkin 6f8de19fba drivers: marvell Add Armada-37xx COMPHY driver
Add support for Marvell Armada-3700 COMPHY driver

Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-10-22 18:18:18 +03:00
Andre Przywara 103f19f055 allwinner: Add RSB driver
The "Reduced Serial Bus" is an Allwinner specific bus, bearing many
similarities with I2C. It sports a much higher bus frequency, though,
(typically 3 MHz) and requires much less handholding for the typical
task of manipulating slave registers (fire-and-forget).
On most A64 boards this bus is used to connect the PMIC to the SoC.

This driver provides basic primitives to read and write slave registers,
it will be later used by the PMIC code.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2018-10-20 16:23:59 +01:00
Soby Mathew cc5859ca19 Multi-console: Deprecate the `finish_console_register` macro
The `finish_console_register` macro is used by the multi console
framework to register the `console_t` driver callbacks. It relied
on weak references to the `ldr` instruction to populate 0 to the
callback in case the driver has not defined the appropriate
function. Use of `ldr` instruction to load absolute address to a
reference makes the binary position dependant. These instructions
should be replaced with adrp/adr instruction for position independant
executable(PIE). But adrp/adr instructions don't work well with weak
references as described in GNU ld bugzilla issue 22589.

This patch defines a new version of `finish_console_register` macro
which can spcify which driver callbacks are valid and deprecates the
old one. If any of the argument is not specified, then the macro
populates 0 for that callback. Hence the functionality of the previous
deprecated macro is preserved. The USE_FINISH_CONSOLE_REG_2 define
is used to select the new variant of the macro and will be removed
once the deprecated variant is removed.

All the upstream console drivers have been migrated to use the new
macro in this patch.

NOTE: Platforms be aware that the new variant of the
`finish_console_register` should be used and the old variant is
deprecated.

Change-Id: Ia6a67aaf2aa3ba93932992d683587bbd0ad25259
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
2018-10-19 17:34:52 +01:00
Soby Mathew 0595abceba
Merge pull request #1632 from Yann-lms/stm32mp1_mmc
Add MMC support for STM32MP1
2018-10-18 10:44:53 +01:00
Grzegorz Jaszczyk 42a293379e mvebu: cp110: introduce COMPHY porting layer
Some of COMPHY parameters depends on the hw connection between the SoC
and the PHY, which can vary on different boards e.g. due to different
wires length. Define the "porting layer" with some defaults
parameters. It ease updating static values which needs to be updated due
to board differences, which are now grouped in one place.

Example porting layer for a8k-db is under:
plat/marvell/a8k/a80x0/board/phy-porting-layer.h

If for some boards parameters are not defined (missing
phy-porting-layer.h), the default values are used
(drivers/marvell/comphy/phy-default-porting-layer.h)
and the following compilation warning is show:
"Using default comphy params - you may need to suit them to your board".

The common COMPHY driver code is extracted in order to be shared with
future COMPHY driver for A3700 SoC platforms

Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Signed-off-by: Igal Liberman <igall@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
2018-10-18 12:13:11 +03:00
Jorge Ramirez-Ortiz 84433c5096 rcar_gen3: drivers: watchdog
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:42:31 +02:00
Jorge Ramirez-Ortiz 33947f2e4f rcar_gen3: drivers: serial controller interface
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:42:17 +02:00
Jorge Ramirez-Ortiz b3bd0731fd rcar_gen3: drivers: spi multio bus controller
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:42:03 +02:00
Jorge Ramirez-Ortiz 0709efbef5 rcar_gen3: drivers: rom api
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:42:00 +02:00
Jorge Ramirez-Ortiz 32c70e4046 rcar_gen3: drivers: power controller
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:41:57 +02:00
Jorge Ramirez-Ortiz 0a106e2869 rcar_gen3: drivers: console
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:41:53 +02:00
Jorge Ramirez-Ortiz c2f2868204 rcar_gen3: drivers: io [emmc/mem]
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:41:49 +02:00
Jorge Ramirez-Ortiz da963e3164 rcar_gen3: drivers: i2c dvfs
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:41:34 +02:00
Jorge Ramirez-Ortiz 3bfe202af6 rcar_gen3: drivers: emmc
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:41:17 +02:00
Jorge Ramirez-Ortiz 2f7de7271f rcar_gen3: drivers: dma
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:41:13 +02:00
Jorge Ramirez-Ortiz d427fc9711 rcar_gen3: drivers: micro delay generator
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:40:56 +02:00
Jorge Ramirez-Ortiz 3a81abb607 rcar_gen3: drivers: cpld
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:40:36 +02:00
Jorge Ramirez-Ortiz 070b0f0821 rcar_gen3: drivers: board identification
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:40:30 +02:00
Jorge Ramirez-Ortiz 0cdb86d41d rcar_gen3: drivers: avs [adaptive voltage scaling]
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:40:12 +02:00
Jorge Ramirez-Ortiz 2f473cc96a rcar_gen3: drivers: authentication
Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:39:49 +02:00
Jorge Ramirez-Ortiz 6ac2892a17 rcar_gen3: drivers: staging
- ddr
 - pfc [pin function controller]
 - qos [bandwidth]

checkpatch.pl is generating too many errors.
2018-10-17 18:39:43 +02:00
Jorge Ramirez-Ortiz 7e532c4bf7 rcar-gen3: initial commit for the rcar-gen3 boards
Reference code:
==============

rar_gen3: IPL and Secure Monitor Rev1.0.22
https://github.com/renesas-rcar/arm-trusted-firmware [rcar_gen3]

Author: Takuya Sakata <takuya.sakata.wz@bp.renesas.com>
Date:   Thu Aug 30 21:26:41 2018 +0900
	Update IPL and Secure Monitor Rev1.0.22

General Information:
===================

This port has been tested on the Salvator-X Soc_id r8a7795 revision
ES1.1 (uses an SPD).

Build Tested:
-------------
ATFW_OPT="LSI=H3 RCAR_DRAM_SPLIT=1 RCAR_LOSSY_ENABLE=1"
MBEDTLS_DIR=$mbedtls

$ make clean bl2 bl31 rcar PLAT=rcar ${ATFW_OPT} SPD=opteed

Other dependencies:
------------------
* mbed_tls:
  git@github.com:ARMmbed/mbedtls.git [devel]

  Merge: 68dbc94 f34a4c1
  Author: Simon Butcher <simon.butcher@arm.com>
  Date:   Thu Aug 30 00:57:28 2018 +0100

* optee_os:
  https://github.com/BayLibre/optee_os

  Until it gets merged into OP-TEE, the port requires Renesas' Trusted
  Environment with a modification to support power management.

  Author: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
  Date:   Thu Aug 30 16:49:49 2018 +0200
    plat-rcar: cpu-suspend: handle the power level
    Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>

* u-boot:
  The port has beent tested using mainline uboot.

  Author: Fabio Estevam <festevam@gmail.com>
  Date:   Tue Sep 4 10:23:12 2018 -0300

*linux:
  The port has beent tested using mainline kernel.

  Author: Linus Torvalds <torvalds@linux-foundation.org>
  Date:   Sun Sep 16 11:52:37 2018 -0700
      Linux 4.19-rc4

Overview
---------

BOOTROM starts the cpu at EL3; In this port BL2 will therefore be entered
at this exception level (the Renesas' ATF reference tree [1] resets into
EL1 before entering BL2 - see its bl2.ld.S)

BL2 initializes DDR (and i2c to talk to the PMIC on some platforms)
before determining the boot reason (cold or warm).

During suspend all CPUs are switched off and the DDR is put in
backup mode (some kind of self-refresh mode). This means that BL2 is
always entered in a cold boot scenario.

Once BL2 boots, it determines the boot reason, writes it to shared
memory (BOOT_KIND_BASE) together with the BL31 parameters
(PARAMS_BASE) and jumps to BL31.

To all effects, BL31 is as if it is being entered in reset mode since
it still needs to initialize the rest of the cores; this is the reason
behind using direct shared memory access to  BOOT_KIND_BASE and
PARAMS_BASE instead of using registers to get to those locations (see
el3_common_macros.S and bl31_entrypoint.S for the RESET_TO_BL31 use
case).

Depending on the boot reason BL31 initializes the rest of the cores:
in case of suspend, it uses a MBOX memory region to recover the
program counters.

[1] https://github.com/renesas-rcar/arm-trusted-firmware
Tests
-----

* cpuidle
  -------
   enable kernel's cpuidle arm_idle driver and boot

* system suspend
  --------------
  $ cat suspend.sh
    #!/bin/bash
    i2cset -f -y 7 0x30 0x20 0x0F
    read -p "Switch off SW23 and press return " foo
    echo mem > /sys/power/state

* cpu hotplug:
  ------------
  $ cat offline.sh
    #!/bin/bash
    nbr=$1
    echo 0 > /sys/devices/system/cpu/cpu$nbr/online
    printf "ONLINE:  " && cat /sys/devices/system/cpu/online
    printf "OFFLINE: " && cat /sys/devices/system/cpu/offline

  $ cat online.sh
    #!/bin/bash
    nbr=$1
    echo 1 > /sys/devices/system/cpu/cpu$nbr/online
    printf "ONLINE:  " && cat /sys/devices/system/cpu/online
    printf "OFFLINE: " && cat /sys/devices/system/cpu/offline

Signed-off-by: ldts <jramirez@baylibre.com>
2018-10-17 18:38:33 +02:00
Yann Gautier a3d39cc763 stm32mp1: add an IO to read MMC devices
Whereas the GPT table is read with io_block, the binaries to be loaded
(e.g. BL33) cannot use it, as it is not suitable to read them block by
block, or the boot time would be very bad.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-10-15 09:36:44 +02:00
Yann Gautier ceaff75c9f stm32mp1: add an IO to read STM32IMAGE binaries
This IO is required to read binaries with STM32 header.
This header is added with the stm32image tool.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-10-15 09:36:32 +02:00
Yann Gautier 8e2e5e8b18 stm32mp1: add sdmmc2 driver
This driver is for the STMicroelectronics sdmmc2 IP
which is in STM32MP1 SoC.
It uses the MMC framework, and can address either eMMC or SD-card.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-10-15 09:36:04 +02:00
Dimitris Papastamos 0a09313ec7
Merge pull request #1626 from Yann-lms/partition_verbose
drivers: partition: correct compilation error in VERBOSE mode
2018-10-12 17:45:56 +01:00
Dimitris Papastamos 776bd2b618
Merge pull request #1630 from antonio-nino-diaz-arm/an/fix-console
pl011: cnds: cbmem: 16550: Fix comments
2018-10-12 17:45:09 +01:00
Antonio Nino Diaz 65199dc844 pl011: cnds: cbmem: 16550: Fix comments
The comments with the prototypes of the register functions of the
console drivers are incorrect. The arguments are wrong. This patch fixes
them.

Change-Id: I38c4b481ee69e840780111c42f03c0752eb6315c
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-10-12 14:47:41 +01:00
Soby Mathew a3f92142e2
Merge pull request #1622 from bryanodonoghue/master+imx7-mmc_fix
drivers: imx: mxc_usdhc: Do not set MMC_RSP_48 for MMC_RESPONSE_R2
2018-10-12 14:17:59 +01:00
Yann Gautier e7f9ab4e5a drivers: partition: correct compilation error in VERBOSE mode
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-10-11 14:39:49 +02:00
Bryan O'Donoghue a21da47806 drivers: imx: mxc_usdhc: Do not set MMC_RSP_48 for MMC_RESPONSE_R2
commit 97d5db8c5c reverts an update to the
MMC layer that accompanied the original submission of this MMC driver this
is the right-thing-to-do in terms of the MMC spec.

Unfortunately the reversion also breaks this driver. The issue is the i.MX
controller doesn't want MMC_RSP_48 set for MMC_RESPONSE_R2.

The appropriate place to place that constraint is obviously in
drivers/imx/usdhc/imx_usdhc.c not in the shared MMC codebase. This patch
restores the logic the i.MX controller requires without breaking it for
everyone else.

Fixes: 97d5db8c5c
Fixes: 2a82a9c95f

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Jun Nie <jun.nie@linaro.org>
2018-10-10 12:15:33 +01:00
Antonio Nino Diaz aa7877c4bf plat/arm: Move norflash driver to drivers/ folder
This way it can be reused by other platforms if needed.

Note that this driver is designed to work with the Versatile Express NOR
flash of Juno and FVP. In said platforms, the memory is organized as an
interleaved memory of two chips with a 16 bit word.

Any platform that wishes to reuse it with a different configuration will
need to modify the driver so that it is more generic.

Change-Id: Ic721758425864e0cf42b7b9b04bf0d9513b6022e
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-10-10 11:14:44 +01:00