Commit Graph

724 Commits

Author SHA1 Message Date
Marek Vasut 99b7aa88f4 rcar_gen3: drivers: pfc: M3W: Switch to common register header file
Drop local copy of register macros and switch to common header.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I8374340961d5465698183fdbc30143a70ebcbde4
2019-06-22 17:32:45 +02:00
Marek Vasut 99d5431b11 rcar_gen3: drivers: pfc: H3: Drop pfc_reg_write() forward declaration
There's no point in having forward declaration just before the function
itself, drop it. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I56125389fa6fe3ae169cacdb0e4b60376f0a6489
2019-06-22 17:32:44 +02:00
Marek Vasut 7cfdefd57d rcar_gen3: drivers: pfc: H3: Switch to BIT() macro
Utilise existing BIT() macro. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I339dbd8c8579dffc9bf454d34e3ba9f142a07fa7
2019-06-22 17:32:23 +02:00
Marek Vasut e6da392fb2 rcar_gen3: drivers: pfc: H3: Drop unused macros
Remove unused and irrelevant macros. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I0f251cd838f1d5879ccfd0738dc8ead355b3b74f
2019-06-20 23:53:06 +02:00
Marek Vasut 0aeef2792c rcar_gen3: drivers: pfc: H3: Checkpatch cleanup
Checkpatch cleanups of the PFC init code and remaining SoC specific macros.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I31293e70a362f713261ac588f563c687449c5f6c
2019-06-20 23:53:06 +02:00
Marek Vasut 54d884cba6 rcar_gen3: drivers: pfc: H3: Switch to common register header file
Drop local copy of register macros and switch to common header.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I85d6855f329771f698d84348ce11ce31548512db
2019-06-20 23:53:06 +02:00
Marek Vasut 7604528d4d rcar_gen3: drivers: pfc: Introduce common register header file
Introduce header file which contains the shared registers and bits
between the different SoCs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I5f41d39347b9d57e3efdea24ae61a16d5c7efb80
2019-06-20 23:53:03 +02:00
Marek Vasut e99dc7e9d8 rcar_gen3: drivers: pfc: D3: Drop unused M3W check
Drop check for SoC being M3W ES1.0 , this check is clearly bogus,
as this code can never be executed on M3W ES 1.0.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: If6087f1c217393dc65d20f6591eca40188563710
2019-06-20 23:23:09 +02:00
John Tsichritzis fc3c382f2c Merge changes from topic "yg/clk_syscfg_dt" into integration
* changes:
  fdts: stm32mp1: realign device tree files with internal devs
  stm32mp1: increase device tree size to 20kB
  stm32mp1: make dt_get_stdout_node_offset() static
  stm32mp1: use unsigned values for SDMMC defines
  stm32mp1: remove useless LIBFDT_SRCS from PLAT_BL_COMMON_SOURCES
  stm32mp1: update doc for U-Boot compilation
  stm32mp1: add general SYSCFG management
  stm32mp1: move stm32_get_gpio_bank_clock() to private file
  clk: stm32mp1: correctly handle Clock Spreading Generator
  clk: stm32mp1: use defines for mask values in stm32mp1_clk_sel array
  clk: stm32mp1: move oscillator functions to generic file
  arch: add some defines for generic timer registers
2019-06-19 15:06:00 +00:00
John Tsichritzis de3ad4f096 Merge changes If61ab215,I3e8b0251,I1757eee9,I81b48475,I46b445a7, ... into integration
* changes:
  rcar_gen3: drivers: qos: Move QoS drivers out of staging
  rcar_gen3: drivers: qos: V3M: Configure DBSC QoS from a table
  rcar_gen3: drivers: qos: E3: Configure DBSC QoS from a table
  rcar_gen3: drivers: qos: D3: Configure DBSC QoS from a table
  rcar_gen3: drivers: qos: M3N: Configure DBSC QoS from a table
  rcar_gen3: drivers: qos: M3W: Configure DBSC QoS from a table
  rcar_gen3: drivers: qos: H3: Configure DBSC QoS from a table
  rcar_gen3: drivers: qos: Add function to configure DBSC QoS settings from a table
  rcar_gen3: drivers: qos: Fix checkpatch issues
  rcar_gen3: drivers: qos: V3M: Drop useless comments
  rcar_gen3: drivers: qos: V3M: Convert mstat table to uint64_t
  rcar_gen3: drivers: qos: V3M: Factor out mstat fix into separate file
  rcar_gen3: drivers: qos: V3M: Use common register definition
  rcar_gen3: drivers: qos: E3: Drop extra level of nesting
  rcar_gen3: drivers: qos: E3: Use common register definition
  rcar_gen3: drivers: qos: D3: Replace ad-hoc register addresses with macros
  rcar_gen3: drivers: qos: D3: Drop MD pin check
  rcar_gen3: drivers: qos: D3: Make DBSC settings local to dbsc_setting()
  rcar_gen3: drivers: qos: D3: Drop useless comments
  rcar_gen3: drivers: qos: D3: Convert mstat table to uint64_t
  rcar_gen3: drivers: qos: D3: Factor out mstat fix into separate file
  rcar_gen3: drivers: qos: D3: Use common register definition
  rcar_gen3: drivers: qos: M3N: Fix checkpatch issues
  rcar_gen3: drivers: qos: M3N: Drop MD pin check
  rcar_gen3: drivers: qos: M3N: Drop useless comments
  rcar_gen3: drivers: qos: M3N: Drop extra level of nesting
  rcar_gen3: drivers: qos: M3N: Use common register definition
  rcar_gen3: drivers: qos: M3W: Fix checkpatch issues
  rcar_gen3: drivers: qos: M3W: Drop MD pin check
  rcar_gen3: drivers: qos: M3W: Drop useless comments
  rcar_gen3: drivers: qos: M3W: Drop extra level of nesting
  rcar_gen3: drivers: qos: M3W: Convert mstat table to uint64_t
  rcar_gen3: drivers: qos: M3W: Factor out mstat fix into separate file
  rcar_gen3: drivers: qos: M3W: Use common register definition
  rcar_gen3: drivers: qos: H3: Fix checkpatch issues
  rcar_gen3: drivers: qos: H3: Drop MD pin check
  rcar_gen3: drivers: qos: H3: Drop useless comments
  rcar_gen3: drivers: qos: H3: Drop extra level of nesting
  rcar_gen3: drivers: qos: H3: Convert mstat table to uint64_t
  rcar_gen3: drivers: qos: H3: Factor out mstat fix into separate file
  rcar_gen3: drivers: qos: H3: Use common register definition
  rcar_gen3: console: Convert to multi-console API
2019-06-17 13:40:05 +00:00
Marek Vasut c67703ebaa rcar_gen3: drivers: qos: Move QoS drivers out of staging
Now that QoS drivers are cleaned up , move them out of staging.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: If61ab2157c30b8f5a6b91d2c56ddbb9098ef99e8
2019-06-17 15:13:22 +02:00
Marek Vasut b5a506abcd rcar_gen3: drivers: qos: V3M: Configure DBSC QoS from a table
Convert the DBSC QoS setting function to a simple table of register-value
pairs and pass it to common rcar_qos_dbsc_setting() to write those values
to matching registers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I3e8b0251099b57581ebdcfce5670bff5579dc505
2019-06-17 15:13:22 +02:00
Marek Vasut efb2c83759 rcar_gen3: drivers: qos: E3: Configure DBSC QoS from a table
Convert the DBSC QoS setting function to a simple table of register-value
pairs and pass it to common rcar_qos_dbsc_setting() to write those values
to matching registers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I1757eee9a209c368d0e8fba9809e56b8090ee43f
2019-06-17 15:13:22 +02:00
Marek Vasut 2d1393ef3e rcar_gen3: drivers: qos: D3: Configure DBSC QoS from a table
Convert the DBSC QoS setting function to a simple table of register-value
pairs and pass it to common rcar_qos_dbsc_setting() to write those values
to matching registers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I81b48475114fc293766a6d7f2b46f8e913a51b06
2019-06-17 15:13:22 +02:00
Marek Vasut be5d6079c8 rcar_gen3: drivers: qos: M3N: Configure DBSC QoS from a table
Convert the DBSC QoS setting function to a simple table of register-value
pairs and pass it to common rcar_qos_dbsc_setting() to write those values
to matching registers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I46b445a77b39412e7a41ae0e0e087a409d0c22e3
2019-06-17 15:13:22 +02:00
Marek Vasut f28f092fd8 rcar_gen3: drivers: qos: M3W: Configure DBSC QoS from a table
Convert the DBSC QoS setting function to a simple table of register-value
pairs and pass it to common rcar_qos_dbsc_setting() to write those values
to matching registers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ie2cbfdacf6d1c7eca4498ab7787b866a83660485
2019-06-17 15:13:22 +02:00
Marek Vasut ed46cdb4b7 rcar_gen3: drivers: qos: H3: Configure DBSC QoS from a table
Convert the DBSC QoS setting function to a simple table of register-value
pairs and pass it to common rcar_qos_dbsc_setting() to write those values
to matching registers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I62b133ea4f4129a641b779a782938976ad52fbfe
2019-06-17 15:13:22 +02:00
Marek Vasut d875f93642 rcar_gen3: drivers: qos: Add function to configure DBSC QoS settings from a table
The DBSC QoS settings can be programmed by iterating over a table with
register-value pairs and writing those to the registers, add function
to do just that. Subsequent patches will convert the DBSC QoS setting
functions for each SoC to this new function.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I949c46a0f032661a58000cb5f7829349e973438c
2019-06-17 15:13:22 +02:00
Marek Vasut b784916485 rcar_gen3: drivers: qos: Fix checkpatch issues
Fix checkpatch issues, clean up macro indentation. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Id0f1e322b44562f9863e885583d89fbf47cab91b
2019-06-17 15:13:20 +02:00
Marek Vasut 5ea5c2b24d rcar_gen3: drivers: qos: V3M: Drop useless comments
Drop useless comments in dbsc_setting(). No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I8a113d253f39e5b6a61e16b1740f9a66b2540753
2019-06-17 15:12:59 +02:00
Marek Vasut c90b11990e rcar_gen3: drivers: qos: V3M: 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: If1917605e5540a38cbd763c56fc1e677573e7066
2019-06-17 15:12:59 +02:00
Marek Vasut 344797db32 rcar_gen3: drivers: qos: V3M: 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: Ifb6644063d8f463e2eb20bdadc5b69ab74ac591d
2019-06-17 15:12:59 +02:00
Marek Vasut acf223bdda rcar_gen3: drivers: qos: V3M: Use common register definition
Use common qos_regs.h instead of a local copy in the V3M QoS init.
Fill missing registers into qos_regs.h . No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I9aabff54abc05781ef606b0d09e4e9fbf7ec3968
2019-06-17 15:12:58 +02:00
Marek Vasut 874be1b2be rcar_gen3: drivers: qos: E3: 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: I49df37734cd6016373a5850d3b9cf4a6569c36d6
2019-06-17 15:11:57 +02:00
Marek Vasut 0292fe18b4 rcar_gen3: drivers: qos: E3: Use common register definition
Use common qos_regs.h instead of a local copy in the E3 QoS init.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ia4336d4b6173e1dbb671a003d904dbc5dc0c196d
2019-06-17 15:11:56 +02:00
Marek Vasut 83314d087a rcar_gen3: drivers: qos: D3: Replace ad-hoc register addresses with macros
Replace the remaining ad-hoc register addresses with proper macros.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: If125f0c8ef77ed280107324edaa05f21979a2c27
2019-06-17 15:11:28 +02:00
Marek Vasut 377ccb7fb5 rcar_gen3: drivers: qos: D3: 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: I44d48ad59293562539a0c1d8ffd66333714e041e
2019-06-17 15:11:28 +02:00
Marek Vasut 37a1f24287 rcar_gen3: drivers: qos: D3: Make DBSC settings local to dbsc_setting()
Move the DBSC write enabling and disabling to dbsc_setting() function,
to make it local, instead of having it all over the code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: If8e5657c3230b5d82b551cb89b11c4d13a2d096b
2019-06-17 15:11:28 +02:00
Marek Vasut 7b24603bc1 rcar_gen3: drivers: qos: D3: Drop useless comments
Drop useless comments in dbsc_setting(). No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: If54e770ce81c9a6610cd89c3d5f01ea9b96af521
2019-06-17 15:11:28 +02:00
Marek Vasut 0008870374 rcar_gen3: drivers: qos: D3: 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: I5f797024c76f2c18b160ac50ede9e1eac24e6652
2019-06-17 15:11:28 +02:00
Marek Vasut e182c7cc95 rcar_gen3: drivers: qos: D3: 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: I2559c5ceb06505361d026ebc1b762bebe17d920b
2019-06-17 15:11:28 +02:00
Marek Vasut 37173b342d rcar_gen3: drivers: qos: D3: Use common register definition
Use common qos_regs.h instead of a local copy in the D3 QoS init.
Fill missing registers into qos_regs.h . No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ie22a81bf5cbf3f8970c6e3fbb43ef52c26fb7168
2019-06-17 15:11:27 +02:00
Marek Vasut 2041b0b850 rcar_gen3: drivers: qos: M3N: Fix checkpatch issues
Fix checkpatch issues, clean up macro indentation. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I08c033b317685bef7537eb49de160e827b7791ad
2019-06-17 15:05:49 +02:00
Marek Vasut 126cb4f54a rcar_gen3: drivers: qos: M3N: 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: Icd3e12f814d4fdcddaec2d1415f0bbf92169284b
2019-06-17 15:05:49 +02:00
Marek Vasut 91a7cdf3de rcar_gen3: drivers: qos: M3N: Drop useless comments
Drop useless comments in dbsc_setting(). No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I6fe03e16c63278aa6fc1bbcc72c07a450d3b7638
2019-06-17 15:05:49 +02:00
Marek Vasut 16726bcd5f rcar_gen3: drivers: qos: M3N: 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: I6d268eae8df5794511d5211e5a59a36291adab3e
2019-06-17 15:05:49 +02:00
Marek Vasut 51a687931c rcar_gen3: drivers: qos: M3N: Use common register definition
Use common qos_regs.h instead of a local copy in the M3N QoS init.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I9670c9cdb320d6724175c22210d048af54490b47
2019-06-17 15:05:49 +02:00
Marek Vasut 22c401abe0 rcar_gen3: drivers: qos: M3W: Fix checkpatch issues
Fix checkpatch issues, clean up macro indentation. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ifd397962c40d174c3af31cb440241cc8bd9335d3
2019-06-17 15:05:49 +02:00
Marek Vasut 3b9d06008c rcar_gen3: drivers: qos: M3W: 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: Idf26cf064e99e95f0140dd747183efe6a6d7f0bf
2019-06-17 15:05:49 +02:00
Marek Vasut 3038c4c5fc rcar_gen3: drivers: qos: M3W: Drop useless comments
Drop useless comments in dbsc_setting(). No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I4460c55bf58f33ca72c9bbad99a28b5e4ef7421e
2019-06-17 15:05:49 +02:00
Marek Vasut 203ee2c8ab rcar_gen3: drivers: qos: M3W: 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: I086ab1f457866f0e2c3ccd67609c0be35631f893
2019-06-17 15:05:49 +02:00
Marek Vasut a22a4eda67 rcar_gen3: drivers: qos: M3W: 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: I41728b30087996edc9799f320bf6a3b4465538bd
2019-06-17 15:05:49 +02:00
Marek Vasut a956a0d7aa rcar_gen3: drivers: qos: M3W: 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: I21c18e80ab9225837e5553dadcf196605e878143
2019-06-17 15:05:49 +02:00
Marek Vasut 1f49a943e2 rcar_gen3: drivers: qos: M3W: Use common register definition
Use common qos_regs.h instead of a local copy in the M3W QoS init.
Fill missing registers into qos_regs.h . No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I91175c86cdb94b9271c880df2cb65949f15f1bad
2019-06-17 15:05:48 +02:00
Yann Gautier f33b2433f5 stm32mp1: add general SYSCFG management
The system configuration controller is mainly used to manage
the compensation cell and other IOs and system related settings.

The SYSCFG driver is in charge of configuring masters on the interconnect,
IO compensation, low voltage boards, or pull-ups for boot pins.
All other configurations should be handled in Linux drivers requiring it.

Device tree files are also updated to manage vdd-supply regulator.

Change-Id: I10fb513761a7d1f2b7afedca9c723ad9d1bccf42
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-06-17 14:03:51 +02:00
Yann Gautier dd98aec87c clk: stm32mp1: correctly handle Clock Spreading Generator
To activate the CSG option, the driver needs to set the bit2
of PLLNCR register = SSCG_CTRL: Spread Spectrum Clock Generator.
This bit should not be cleared when starting the PLL.

Change-Id: Ie5c720ff03655f27a7e7e9e7ccf8295dd046112f
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-06-17 14:03:51 +02:00
Yann Gautier d4151d2ff9 clk: stm32mp1: use defines for mask values in stm32mp1_clk_sel array
Rework the macro that eases the table definition: the src and msk fields
are now using MASK and SHIFT defines of each source register.
Some macros had then to be modified: _USART1_SEL, _ASS_SEL and _MSS_SEL to
_UART1_SEL, _AXIS_SEL, and _MCUS_SEL to match register fields.

Note: the mask for RCC_ASSCKSELR_AXISSRC is changed from 0x3 to 0x7
to reflect the size of the register field, even if there are only
3 possible clock sources.

The mask value is also corrected for QSPI and FMC clock selection.

Change-Id: I44114e3c1dd37b9fa1be1ba519611abd9a07764c
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2019-06-17 14:03:51 +02:00
Yann Gautier f66358afee clk: stm32mp1: move oscillator functions to generic file
Those functions are generic for parsing nodes from device tree
hence could be located in generic source file.

The oscillators description structure is also moved to STM32MP1 clock
driver, as it is no more used in stm32mp1_clkfunc and cannot be in a
generic file.

Change-Id: I93ba74f4eea916440fef9b160d306af1b39f17c6
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-06-17 14:03:51 +02:00
Yann Gautier e1abd5600b arch: add some defines for generic timer registers
Those defines are used in STM32MP1 clock driver.
It is better to put them altogether with already defined registers.

Change-Id: I6f8ad8c2477b947af6f76283a4ef5c40212d0027
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2019-06-17 14:03:16 +02:00
Marek Vasut fbcdc4ebe7 rcar_gen3: drivers: qos: H3: Fix checkpatch issues
Fix checkpatch issues, clean up macro indentation. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: I605109b5e41219473a4cbc4a1929b84377ba0b67
2019-06-17 13:25:06 +02:00
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