Vignesh Radhakrishnan [Fri, 20 Apr 2018 21:31:41 +0000 (14:31 -0700)]
Tegra: Enable irq as wake-up event for cpu_standby
As per ARM ARM D1.17.2, any physical IRQ interrupt received by the PE
will be treated as a wake-up event, if SCR_EL3.IRQ is set to '1',
irrespective of the value of the PSTATE.I bit value.
This patch programs the SCR_EL3.IRQ bit before entering CPU standby
state, to allow an IRQ to wake the PE. On waking up, the previous
SCR_EL3 value is restored.
Change-Id: Ie81cf3a7668f5ac35f4bf2ecc461b91b9b60650c
Signed-off-by: Vignesh Radhakrishnan <vigneshr@nvidia.com>
Anthony Zhou [Mon, 2 Apr 2018 11:34:59 +0000 (19:34 +0800)]
Tegra: remove unused libc files from makefile
This patch redefines the variable LIBC_SRCS for Tegra platforms,
to remove unused libc files from the list. This patch is a building
block to eventually use other libc implementations in the future.
Change-Id: Iccde5a75f5e2d6f4e2dbc6274beb423b80e846fd
Signed-off-by: Anthony Zhou <anzhou@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Thu, 31 Jan 2019 17:22:30 +0000 (09:22 -0800)]
Introduce build option to override libc
This patch introduces a build option 'OVERRIDE_LIBC' that platforms
can set to override libc from the BL image. The default value is '0'
to keep the library.
Change-Id: I10a0b247f6a782eeea4a0359e30a8d79b1e9e4e1
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Mon, 12 Mar 2018 22:11:55 +0000 (15:11 -0700)]
Tegra: restrict non-secure PMC accesses
Platforms that do not support bpmp firmware, do not need access
to the PMC block from outside of the CPU complex. The agents
running on the CPU can always access the PMC through the EL3
exception space.
This patch restricts non-secure world access to the PMC block on
such platforms.
Change-Id: I2c4318dc07ddf6407c1700595e0f4aac377ba258
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Krishna Reddy [Thu, 7 Dec 2017 21:52:39 +0000 (13:52 -0800)]
Tegra186: memctrl: disable stream id writes for MC clients
As per the latest recommendations from the hardware team, write access
needs to be disabled for APE, BPMP, NvDec and SCE clients. This patch
disables stream id register writes for these MC clients to implement
those recommendations.
Change-Id: I8887c0f2cc5bc3fc5bba42074810ba5c1d3f121f
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Varun Wadekar [Mon, 23 Apr 2018 20:25:42 +0000 (13:25 -0700)]
Tegra: bpmp: mark device "not present" on boot timeout
This patch updates the state machine to "not present" if the bpmp
firmware is not found in the system during boot. The suspend
handler also checks now if the interface exists, before updating
the internal state machine.
Reported by: Kalyani Chidambaram Vaidyanathan <kalyanic@nvidia.com>
Change-Id: If8fd7f8e412bb603944555c24826855226e7f48c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Fri, 20 Apr 2018 00:50:31 +0000 (17:50 -0700)]
Tegra210: toggle ring oscillator across cluster idle
This patch toggles the ring oscillator state across cluster idle
as DFLL loses its state. We dont want garbage values being written
to the pmic when we enter cluster idle state, so enable "open loop"
when we enter CC6 and restore the state to "closed loop" on exit.
Change-Id: I56f4649f57bcc651d6c415a6dcdc978e9444c97b
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
kalyani chidambaram [Mon, 9 Apr 2018 21:40:02 +0000 (14:40 -0700)]
Tegra210: clear PMC_DPD registers on resume
This patch clears the PMC's DPD registers on resuming from System
Suspend, for all Tegra210 platforms that support the sc7entry-fw.
Change-Id: I7881ef0a5f609ed28b158bc2f4016abea3c7f305
Signed-off-by: kalyani chidambaram <kalyanic@nvidia.com>
Varun Wadekar [Wed, 4 Apr 2018 18:14:05 +0000 (11:14 -0700)]
Tegra210: suspend/resume bpmp interface across System Suspend
The BPMP firmware takes some time to initialise its state on exiting
System Suspend state. The CPU needs to synchronize with the BPMP during
this process to avoid any race conditions. This patch suspends and resumes
the BPMP interface across a System Suspend cycle, to fix this race.
Change-Id: I82a61d12ef3eee267bdd8d4386bed23397fbfd2d
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 4 Apr 2018 18:09:41 +0000 (11:09 -0700)]
Tegra: bpmp: suspend/resume handlers
This patch adds suspend and resume handlers for the BPMP
interface. Mark the interface as "suspended" before entering
System Suspend and verify that BPMP is alive on exit.
Change-Id: I74ccbc86125079b46d06360fc4c7e8a5acfbdfb2
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Stephen Wolfe [Thu, 29 Mar 2018 19:32:08 +0000 (12:32 -0700)]
spd: trusty: pass max affinity level to Trusty
During System Suspend, the entire system loses its state. To allow Trusty
to save/restore its context and allow its TAs to participate in the suspend
process, it needs to look at the max affinity level being suspended. This
patch passes the max affinity level to Trusty to enable to do so.
Change-Id: If7838dae10c3f5a694baedb15ec56fbad41f2b36
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Mon, 19 Mar 2018 22:19:28 +0000 (15:19 -0700)]
Tegra210: skip past sc7entry-fw signature header
This patch skips past the signature header added to the sc7entry-fw
binary by the previous level bootloader. Currently, the size of
the header is 1KB, so adjust the start address and the binary size
at the time of copy.
Change-Id: Id0494548009749035846d54df417a960c640c8f9
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 7 Mar 2018 19:13:58 +0000 (11:13 -0800)]
Tegra210: move sc7entry-fw inside the TZDRAM fence
This patch uses the sc7entry-fw base/size values to calculate the
TZDRAM fence, so as to move sc7entry-fw inside the TZDRAM fence.
Change-Id: I91aeeeece857076c478cdc4c18a6ad70dc265031
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
kalyani chidambaram [Wed, 7 Mar 2018 00:36:57 +0000 (16:36 -0800)]
Tegra210: SiP handlers to allow PMC access
This patch adds SiP handler for Tegra210 platforms to service
read/write requests for PMC block. None of the secure registers
are accessible to the NS world though.
Change-Id: I7dc1f10c6a6ee6efc642ddcfb1170fb36d3accff
Signed-off-by: kalyani chidambaram <kalyanic@nvidia.com>
Varun Wadekar [Mon, 5 Mar 2018 18:19:37 +0000 (10:19 -0800)]
Tegra210: power off all DMA masters before System Suspend entry
This patch puts all the DMA masters in reset before starting the System
Suspend sequence. This helps us make sure that there are no rogue agents
in the system trying to over-write the SC7 Entry Firmware with their own.
Change-Id: I7eb39999d229951e612fbfeb9f86c4efb8f98b5a
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Mihir Joshi [Thu, 1 Mar 2018 22:36:24 +0000 (14:36 -0800)]
spd: tlkd: remove unwanted assert on System Suspend entry
c_rt_ctx is used to store current SP before the system goes
into suspend. The assert for its value being zero is not
really necessary as the value gets over-written eventually.
This patch removes assert(tlk_ctx->c_rt_ctx == 0) from the
System Suspend path, as a result.
Change-Id: If41f15e74ebbbfd82958d8e179114899b2ffb0a7
Signed-off-by: Mihir Joshi <mihirj@nvidia.com>
Varun Wadekar [Tue, 27 Feb 2018 22:33:57 +0000 (14:33 -0800)]
Tegra: support for System Suspend using sc7entry-fw binary
This patch adds support to enter System Suspend on Tegra210 platforms
without the traditional BPMP firmware. The BPMP firmware will no longer
be supported on Tegra210 platforms and its functionality will be
divided across the CPU and sc7entry-fw.
The sc7entry-fw takes care of performing the hardware sequence required
to enter System Suspend (SC7 power state) from the COP. The CPU is required
to load this firmware to the internal RAM of the COP and start the sequence.
The CPU also make sure that the COP is off after cold boot and is only
powered on when we want to start the actual System Suspend sequence.
The previous bootloader loads the firmware to TZDRAM and passes its base and
size as part of the boot parameters. The EL3 layer is supposed to sanitize
the parameters before touching the firmware blob.
To assist the warmboot code with the PMIC discovery, EL3 is also supposed to
program PMC's scratch register #210, with appropriate values. Without these
settings the warmboot code wont be able to get the device out of System
Suspend.
Change-Id: I5a7b868512dbfd6cfefd55acf3978a1fd7ebf1e2
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 14 Feb 2018 19:06:05 +0000 (11:06 -0800)]
Tegra210: remove support for cluster power down
This patch removes support for powering down a CPU cluster on
Tegra210 platforms as none of them actually use it.
Change-Id: I9665634cf2b5b7b8a1b5a2700cae152dc9165fe3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 14 Feb 2018 04:31:12 +0000 (20:31 -0800)]
Tegra210: support for cluster idle from the CPU
This patch adds support to enter/exit to/from cluster idle power
state on Tegra210 platforms that do not load BPMP firmware.
The CPU initates the cluster idle sequence on the last standing
CPU, by following these steps:
Entry
-----
* stop other CPUs from waking up
* program the PWM pinmux to tristate for OVR PMIC
* program the flow controller to enter CC6 state
* skip L1 $ flush during cluster power down, as L2 $ is inclusive
of L1 $ on Cortex-A57 CPUs
Exit
----
* program the PWM pinmux to un-tristate for OVR PMIC
* allow other CPUs to wake up
This patch also makes sure that cluster idle state entry is not
enabled until CL-DVFS is ready.
Change-Id: I54cf31bf72b4a09d9bf9d2baaed6ee5a963c7808
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 14 Feb 2018 04:22:19 +0000 (20:22 -0800)]
Tegra: pmc: helper function to find last ON CPU
This patch adds a helper function to find the last standing CPU
in a cluster.
Change-Id: Id018f1958f458c772c7b0c52af8ddf7532b1cec5
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Steven Kao [Fri, 9 Feb 2018 12:50:02 +0000 (20:50 +0800)]
Tegra: platform dependent address space sizes
This patch moves the PLAT_PHY_ADDR_SPACE_SIZE & PLAT_VIRT_ADDR_SPACE
macros to tegra_def.h, to define the virtual/physical address space
size on the platform.
Change-Id: I1c5d264c7ffc1af0e7b14cc16ae2c0416efc76f6
Signed-off-by: Steven Kao <skao@nvidia.com>
Varun Wadekar [Tue, 23 Jan 2018 22:38:51 +0000 (14:38 -0800)]
Tegra: organize memory/mmio apertures to decrease memmap latency
This patch organizes the memory and mmio maps linearly, to make the
mmap_add_region process faster. The microsecond timer has been moved
to individual platforms instead of making it a common step, as it
further speeds up the memory map creation process.
Change-Id: I6fdaee392f7ac5d99daa182380ca9116a001f5d6
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Thu, 3 Jan 2019 01:53:15 +0000 (17:53 -0800)]
Tegra210: Enable WDT_CPU interrupt for FIQ Debugger
This patch enables the watchdog timer's interrupt as an FIQ
interrupt to the CPU. The interrupt generated by the watchdog
is connected to the flow controller for power management reasons,
and needs to be routed to the GICD for it to reach the CPU.
Change-Id: I9437b516da2c5d763eca72694ed7f3c7389b3d9e
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 14 Feb 2018 16:38:27 +0000 (08:38 -0800)]
Tegra: flowctrl: helper functions to assist with cluster power states
This patch adds helper functions to help platforms with cluster state entry
and exit decisions.
* tegra_fc_ccplex_pgexit_lock(): lock CPU power ungate
* tegra_fc_ccplex_pgexit_unlock(): unlock CPU power ungate
* tegra_fc_is_ccx_allowed(): CCx state entry allowed on this CPU?
Change-Id: I6490d34bf380dc03ae203eb3028f61984f06931c
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 14 Feb 2018 04:08:24 +0000 (20:08 -0800)]
Tegra: bpmp: remove bpmp init failed error print
This patch removes the error print displayed when bpmp init
fails. On platforms that do not load the bpmp firmware, this
print is seen on every cluster idle and powerdown request,
cluttering the logs.
Change-Id: I9e30007a913080406052fc32d5360ff70a019d75
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Mihir Joshi [Mon, 22 Jan 2018 22:02:16 +0000 (14:02 -0800)]
tlkd: support new TLK SMCs
This patch adds support to handle following TLK SMCs:
{TLK_SS_REGISTER_HANDLER, TLK_REGISTER_NS_DRAM_RANGES, TLK_SET_ROOT_OF_TRUST}
These SMCs need to be supported in ATF in order to forward them to
TLK. Otherwise, these functionalities won't work.
Brief:
TLK_SS_REGISTER_HANDLER: This SMC is issued by TLK Linux Driver to
set up secure storage buffers.
TLK_REGISTER_NS_DRAM_RANGES: Cboot performs this SMC during boot to
pass NS memory ranges to TLK.
TLK_SET_ROOT_OF_TRUST: Cboot performs this SMC during boot to pass
Verified Boot parameters to TLK.
Change-Id: I18af35f6dd6f510dfc22c1d1d1d07f643c7b82bc
Reviewed-on: https://git-master.nvidia.com/r/
1643851
Signed-off-by: Mihir Joshi <mihirj@nvidia.com>
Varun Wadekar [Fri, 26 Jan 2018 18:33:42 +0000 (10:33 -0800)]
Tegra: fiq_glue: support to handle LEGACY_FIQ PPIs for Tegra SoCs
This patch adds support to handle secure PPIs for Tegra watchdog timers. This
functionality is currently protected by the ENABLE_WDT_LEGACY_FIQ_HANDLING
configuration variable and is only enabled for Tegra210 platforms, for now.
Change-Id: I0752ef54a986c58305e1bc8ad9be71d4a8bbd394
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Fri, 26 Jan 2018 18:05:02 +0000 (10:05 -0800)]
Tegra: flowctrl: support to enable/disable WDT's legacy FIQ routing
On earlier Tegra platforms, e.g. Tegra210, the watchdog timer's FIQ interrupt
is not direclty wired to the GICD. It goes to the flow controller instead, for
power state management. But the flow controller can route the FIQ to the GICD,
as a PPI, which can then get routed to the target CPU.
This patch adds routines to enable/disable routing the legacy FIQ used by
the watchdog timers, to the GICD.
Change-Id: Idd07c88c8d730b5f0e93e3a6e4fdc59bdcb2161b
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Jeetesh Burman [Mon, 22 Jan 2018 10:10:08 +0000 (15:40 +0530)]
Tegra: SiP: set GPU in reset after vpr resize
Whenever the VPR memory is resized, the GPU is put into reset first
and then the new VPR parameters are programmed to the memory controller
block. There exists a scenario, where the GPU might be out before we
program the new VPR parameters. This means, the GPU would still be
using older settings and leak secrets.
This patch puts the GPU back into reset, if it is out of reset after
resizing VPR, to mitigate this hole.
Change-Id: I38a1000e3803f80909efcb02e27da4bd46909931
Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
Varun Wadekar [Thu, 4 Jan 2018 21:41:27 +0000 (13:41 -0800)]
Tegra: handle FIQ interrupts when NS handler is not registered
This patch updates the secure interrupt handler to mark the interrupt
as complete in case the NS world has not registered a handler.
Change-Id: Iebe952305f7db46375303699b6150611439475df
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
steven kao [Wed, 3 Jan 2018 03:07:00 +0000 (19:07 -0800)]
Tegra: bpmp_ipc: support to enable/disable module clocks
This patch adds support to the bpmp_ipc driver to allow clients to
enable/disable clocks to hardware blocks. Currently, the API only
supports SE devices.
Change-Id: I9a361e380c0bcda59f5a92ca51c86a46555b2e90
Signed-off-by: steven kao <skao@nvidia.com>
Varun Wadekar [Tue, 2 Jan 2018 22:10:18 +0000 (14:10 -0800)]
Tegra: fix offset used to dump GICD registers from crash handler
The GICD registers are 32-bits wide whereas the crash handler was reading
them as 64-bit ones. This patch fixes the code to read the GICD registers,
32-bits at a time, from the paltform's crash handler.
Change-Id: If3d6608529684ecc02be6a1b715012310813b2a4
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Thu, 28 Dec 2017 02:10:12 +0000 (18:10 -0800)]
Tegra: default platform handler for the CPU_STANDBY state
This patch adds a default implementation for the platform specific
CPU standby power handler. Tegra SoCs can override this handler
with their own implementations.
Change-Id: I91e513842f194b1e2b1defa2d833bb4d9df5f06b
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Pritesh Raithatha [Thu, 26 Oct 2017 11:29:58 +0000 (16:59 +0530)]
Tegra186: smmu: add support for backup multiple smmu regs
Modifying smmu macros to pass base address of smmu so that it can be
used with multiple smmus.
Added macro for combining smmu backup regs that can be used for multiple
smmus.
Change-Id: I4f3bb83d66d5df14a3b91bc82f7fc26ec8e4592e
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Antonio Niño Díaz [Thu, 31 Jan 2019 13:32:31 +0000 (13:32 +0000)]
Merge pull request #1798 from pbeesley-arm/pb/fix-code-style
doc: Fix broken code blocks in coding guidelines
Paul Beesley [Thu, 31 Jan 2019 11:39:01 +0000 (11:39 +0000)]
doc: Fix broken code blocks in coding guidelines
Sections 2.2, 2.3 and 2.4 contained example code blocks that were not
being formatted properly due to missing newlines.
Change-Id: I0dbce90c931cf69e4f47d2ccbcc8bc0e20f8fd66
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Antonio Niño Díaz [Thu, 31 Jan 2019 10:23:06 +0000 (10:23 +0000)]
Merge pull request #1797 from antonio-nino-diaz-arm/an/remove-smccc-v2
Remove support for the SMC Calling Convention 2.0
Antonio Niño Díaz [Thu, 31 Jan 2019 10:22:50 +0000 (10:22 +0000)]
Merge pull request #1745 from svenauhagen/bugfix/a8k
Armada8k GPIO Register macro fix
Antonio Niño Díaz [Thu, 31 Jan 2019 10:22:36 +0000 (10:22 +0000)]
Merge pull request #1793 from marex/arm/master/fixes-v2.0.0
Arm/master/fixes v2.0.0
Antonio Niño Díaz [Thu, 31 Jan 2019 09:24:08 +0000 (09:24 +0000)]
Merge pull request #1792 from satheesbalya-arm/sb1/sb1_2159_v84_xlat
lib/xlat_tables: Add support for ARMv8.4-TTST
Antonio Niño Díaz [Thu, 31 Jan 2019 09:23:40 +0000 (09:23 +0000)]
Merge pull request #1795 from pbeesley-arm/pb/code-style
Move coding guidelines into docs directory
Antonio Niño Díaz [Thu, 31 Jan 2019 09:20:45 +0000 (09:20 +0000)]
Merge pull request #1753 from Yann-lms/emmc_ret
mmc: correctly check ret in mmc_fill_device_info
Antonio Nino Diaz [Wed, 30 Jan 2019 16:01:49 +0000 (16:01 +0000)]
Remove support for the SMC Calling Convention 2.0
This reverts commit
2f370465241c ("Add support for the SMC Calling
Convention 2.0").
SMCCC v2.0 is no longer required for SPM, and won't be needed in the
future. Removing it makes the SMC handling code less complicated.
The SPM implementation based on SPCI and SPRT was using it, but it has
been adapted to SMCCC v1.0.
Change-Id: I36795b91857b2b9c00437cfbfed04b3c1627f578
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Sathees Balya [Fri, 25 Jan 2019 11:36:01 +0000 (11:36 +0000)]
lib/xlat_tables: Add support for ARMv8.4-TTST
ARMv8.4-TTST (Small Translation tables) relaxes the lower limit on the
size of translation tables by increasing the maximum permitted value
of the T1SZ and T0SZ fields in TCR_EL1, TCR_EL2, TCR_EL3, VTCR_EL2 and
VSTCR_EL2.
This feature is supported in AArch64 state only.
This patch adds support for this feature to both versions of the
translation tables library. It also removes the static build time
checks for virtual address space size checks to runtime assertions.
Change-Id: I4e8cebc197ec1c2092dc7d307486616786e6c093
Signed-off-by: Sathees Balya <sathees.balya@arm.com>
Antonio Niño Díaz [Wed, 30 Jan 2019 09:53:07 +0000 (09:53 +0000)]
Merge pull request #1791 from antonio-nino-diaz-arm/an/rk-gic
rockchip: Fix GICv2 interrupts
Antonio Niño Díaz [Wed, 30 Jan 2019 09:52:48 +0000 (09:52 +0000)]
Merge pull request #1789 from Anson-Huang/lpm
Add power optimization for i.MX8QM/i.MX8QX
Antonio Niño Díaz [Tue, 29 Jan 2019 13:44:10 +0000 (13:44 +0000)]
Merge pull request #1788 from laroche/rpi3_duplicate_initialization
rpi3: Remove duplicate initialization for BL32_IMAGE_ID and mark one more function as static.
Antonio Niño Díaz [Tue, 29 Jan 2019 13:43:46 +0000 (13:43 +0000)]
Merge pull request #1786 from laroche/static_vars_functions
Change some vars and functions to be static.
Antonio Niño Díaz [Tue, 29 Jan 2019 13:43:29 +0000 (13:43 +0000)]
Merge pull request #1794 from Andre-ARM/fiptool-fix
tools/fiptool: Fix UUID parsing in blob handling
Paul Beesley [Tue, 22 Jan 2019 11:36:41 +0000 (11:36 +0000)]
doc: Add details on #include ordering
This patch adds more details on #include directive use, including (pun
not intended) the desired ordering, grouping and variants (<> or "").
Change-Id: Ib024ffc4d3577c63179e1bbc408f0d0462026312
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Paul Beesley [Mon, 21 Jan 2019 16:11:28 +0000 (16:11 +0000)]
doc: Reorder coding guidelines document
This patch attempts to make the guidelines clearer by reordering
the sections and grouping similar topics.
Change-Id: I1418d6fc060d6403fe3e1978f32fd54b8793ad5b
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Paul Beesley [Mon, 21 Jan 2019 12:06:24 +0000 (12:06 +0000)]
doc: Link coding guidelines to user guide
Adds a link from user-guide.rst to coding-guidelines.rst and merges
the information about using checkpatch from both files into the user
guide document.
Change-Id: Iffbb4225836a042d20024faf28b8bdd6b2c4043e
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Paul Beesley [Mon, 21 Jan 2019 12:02:09 +0000 (12:02 +0000)]
doc: Clarify ssize_t use in coding guidelines
Change-Id: I083f673f37495d2e53c704a43a0892231b6eb281
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Paul Beesley [Mon, 21 Jan 2019 11:57:42 +0000 (11:57 +0000)]
doc: Add AAPCS link to coding guidelines
Change-Id: Id0e6d272b6d3d37eab785273f9c12c093191f3fc
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Paul Beesley [Thu, 17 Jan 2019 15:44:37 +0000 (15:44 +0000)]
doc: Add Coding Guidelines document
This content has been imported and adapted from the TF GitHub wiki
article 'ARM-Trusted-Firmware-Coding-Guidelines'.
The aim is to increase the visibility of the coding guidelines by
including them as part of the documentation that is within the TF
repository.
Additionally, the documentation can then be linked to by other
documents in the docs/ directory without worrying about broken links
to, for example, the external wiki.
Change-Id: I9d8cd6b5117b707c1a113baeba7fc5e1b4bf33bc
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Andre Przywara [Tue, 29 Jan 2019 09:25:14 +0000 (09:25 +0000)]
tools/fiptool: Fix UUID parsing in blob handling
Commit
033648652f ("Make TF UUID RFC 4122 compliant") changed the scanf
parsing string to handle endianness correctly.
However that changed the number of items sscanf handles, without
adjusting the sanity check just below.
Increase the expected return value from 11 to 16 to let fiptool handle
UUIDs given as blob parameters correctly again.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Marek Vasut [Mon, 21 Jan 2019 22:11:33 +0000 (23:11 +0100)]
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>
Sergii Boryshchenko [Thu, 30 Nov 2017 12:53:52 +0000 (14:53 +0200)]
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>
Marek Vasut [Sat, 5 Jan 2019 15:21:14 +0000 (16:21 +0100)]
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>
Marek Vasut [Sat, 5 Jan 2019 12:57:16 +0000 (13:57 +0100)]
rcar_gen3: plat: Allow E3 auto-detection
Allow auto-detecting E3 when RCAR_LSI is set to RCAR_AUTO.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Mon, 21 Jan 2019 22:12:13 +0000 (23:12 +0100)]
rcar_gen3: plat: Drop unused macro
The macro is not used, drop it.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Tue, 29 Jan 2019 05:06:08 +0000 (06:06 +0100)]
Revert "rcar_gen3: plat: Enable programmable CPU reset address"
This reverts commit
d48536e2f92d47ebb92cf12b35133c3be2d0e459,
which misbehaves on R-Car H3 ES2.0. Until the reason for that
misbehavior is understood, revert the commit.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Anson Huang [Thu, 24 Jan 2019 08:50:02 +0000 (16:50 +0800)]
imx: power optimization for i.mx8qx
Current implementation of i.MX8QX power management related
features does NOT optimize power number, all system resources
like CCI, DDR, and A cluster etc. are kept in STBY mode (powered
ON) when system suspend or CPU hotplug.
To lower the power number, OFF mode should be adopted for those
system resources whenever they can be OFF, A cluster will be OFF
if the CPUs in the cluster are all off line, DDR/MU/DB can be OFF
if system suspend, IRQ steer can be OFF if the wakeup source is
belonged to system controller partition, so wakeup source runtime
check is used to determine if IRQ steer can be OFF before system
suspend.
If resources are powered off for suspend, they should be restored
properly after system resume.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 24 Jan 2019 08:09:52 +0000 (16:09 +0800)]
imx: power optimization for i.mx8qm
Current implementation of i.MX8QM power management related
features does NOT optimize power number, all system resources
like CCI, DDR, and A cluster etc. are kept in STBY mode (powered
ON) when system suspend or CPU hotplug.
To lower the power number, OFF mode should be adopted for those
system resources whenever they can be OFF, A cluster will be OFF
if the CPUs in the cluster are all off line, DDR/MU/DB can be OFF
if system suspend, IRQ steer can be OFF if the wakeup source is
belonged to system controller partition, so wakeup source runtime
check is used to determine if IRQ steer can be OFF before system
suspend.
If resources are powered off for suspend, they should be restored
properly after system resume.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Florian La Roche [Mon, 28 Jan 2019 19:39:51 +0000 (20:39 +0100)]
rpi3: mark one more function as static
Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Florian La Roche [Mon, 28 Jan 2019 19:27:46 +0000 (20:27 +0100)]
rpi3: remove duplicate initialization for BL32_IMAGE_ID
Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Antonio Nino Diaz [Mon, 28 Jan 2019 14:35:40 +0000 (14:35 +0000)]
rockchip: Fix GICv2 interrupts
After the removal of deprecated interfaces in TF 2.0 the migration to
the new GIC driver interfaces was done incorrectly in rk3328 and rk3368:
2d6f1f01b141 ("rockchip: Migrate to new interfaces").
In the GICv2 driver it is mandated that all interrupts are Group 0
interrupts. This patch simply moves all Group 1 interrupts to Group 0.
Change-Id: I224c0135603eb5b81bd512976361500c0d129a91
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Mon, 28 Jan 2019 12:04:28 +0000 (12:04 +0000)]
Merge pull request #1780 from pmanish87/master
Make device tree pre-processing similar to U-boot/Linux
Antonio Niño Díaz [Mon, 28 Jan 2019 12:04:13 +0000 (12:04 +0000)]
Merge pull request #1773 from grandpaul/rpi3-gpio-driver
Rpi3 gpio driver
Antonio Niño Díaz [Mon, 28 Jan 2019 10:53:29 +0000 (10:53 +0000)]
Merge pull request #1784 from antonio-nino-diaz-arm/an/includes-arm
plat/arm: Cleanup of includes and drivers
Antonio Niño Díaz [Mon, 28 Jan 2019 09:21:53 +0000 (09:21 +0000)]
Merge pull request #1778 from JoelHutton/jh/multiconsole
multi_console: Check functions are not NULL
Florian La Roche [Sun, 27 Jan 2019 13:30:12 +0000 (14:30 +0100)]
Change some vars and functions to be static.
Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Joel Hutton [Tue, 15 Jan 2019 15:40:18 +0000 (15:40 +0000)]
multi_console: Check functions are not NULL
Change-Id: I2d67bb1bebd15e6a7d69ea5e7b6fda9c972f9d86
Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
Ying-Chun Liu (PaulLiu) [Mon, 21 Jan 2019 19:27:55 +0000 (03:27 +0800)]
rpi3: Enable GPIO in BL2
This patch inits the GPIO in BL2 earlysetup. So BL2 can start operating
GPIO pins.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Ying-Chun Liu (PaulLiu) [Thu, 20 Dec 2018 19:32:10 +0000 (03:32 +0800)]
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>
Antonio Nino Diaz [Wed, 23 Jan 2019 21:50:09 +0000 (21:50 +0000)]
fvp: pwrc: Move to drivers/ folder
Change-Id: I670ea80e0331c2d4b2ccfa563a45469a43f6902d
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 23 Jan 2019 19:06:55 +0000 (19:06 +0000)]
plat/arm: sds: Move to drivers/ folder
Change-Id: Ia601d5ad65ab199e747fb60af4979b7db477d249
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 23 Jan 2019 18:55:03 +0000 (18:55 +0000)]
plat/arm: scp: Move to drivers/ folder
Change-Id: Ida5dae39478654405d0ee31a6cbddb4579e76a7f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 25 Jan 2019 14:23:49 +0000 (14:23 +0000)]
plat/arm: scpi: Move to drivers/ folder
Change-Id: Icc59cdaf2b56f6936e9847f1894594c671db2e94
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 23 Jan 2019 21:08:43 +0000 (21:08 +0000)]
plat/arm: mhu: Move to drivers/ folder
Change-Id: I656753a1825ea7340a3708b950fa6b57455e9056
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 23 Jan 2019 20:37:32 +0000 (20:37 +0000)]
plat/arm: scmi: Move to drivers/ folder
Change-Id: I8989d2aa0258bf3b50a856c5b81532d578600124
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Wed, 23 Jan 2019 16:23:07 +0000 (16:23 +0000)]
plat/arm: Move dynamic xlat enable logic to makefile
The PLAT_XLAT_TABLES_DYNAMIC build option, defined in platform_def.h
in Arm platforms, is checked by several headers, affecting their
behaviour. To avoid issues around the include ordering of the headers,
the definition should be moved to the platform's makefile.
Change-Id: I0e12365c8d66309122e8a20790e1641a4f480a10
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Nino Diaz [Fri, 25 Jan 2019 14:30:04 +0000 (14:30 +0000)]
plat/arm: Sanitise includes
Use full include paths like it is done for common includes.
This cleanup was started in commit
d40e0e08283a ("Sanitise includes
across codebase"), but it only cleaned common files and drivers. This
patch does the same to Arm platforms.
Change-Id: If982e6450bbe84dceb56d464e282bcf5d6d9ab9b
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Antonio Niño Díaz [Fri, 25 Jan 2019 11:24:40 +0000 (11:24 +0000)]
Merge pull request #1761 from satheesbalya-arm/sb1/sb1_2661_bl31_overlay
plat/arm: Save BL2 descriptors to reserved memory.
Antonio Niño Díaz [Fri, 25 Jan 2019 10:30:36 +0000 (10:30 +0000)]
Merge pull request #1781 from dtwlin/m2
spd: trusty: trusty_setup should bail on unknown image
Antonio Niño Díaz [Fri, 25 Jan 2019 10:29:52 +0000 (10:29 +0000)]
Merge pull request #1766 from Anson-Huang/master
Add more SIP runtime service for i.MX8
Antonio Niño Díaz [Fri, 25 Jan 2019 09:21:42 +0000 (09:21 +0000)]
Merge pull request #1777 from glneo/runtime-gicr
ti: k3: common: Add support for runtime detection of GICR base address
Antonio Niño Díaz [Fri, 25 Jan 2019 09:21:19 +0000 (09:21 +0000)]
Merge pull request #1779 from Anson-Huang/a53_errata
Enable necessary A53 erratas for i.MX8QM and i.MX8MQ
Antonio Niño Díaz [Fri, 25 Jan 2019 09:20:32 +0000 (09:20 +0000)]
Merge pull request #1776 from vwadekar/tf2.0-tegra-downstream-rebase-1.22.19
Tf2.0 tegra downstream rebase 1.22.19
David Lin [Thu, 24 Jan 2019 22:15:57 +0000 (14:15 -0800)]
spd: trusty: trusty_setup should bail on unknown image
When an unknown Trusty image is found, there's no point of still trying
to register the BL32 init handler. Instead, we just should bail out of
the trusty_setup() and allow the system to continue to boot.
Signed-off-by: David Lin <dtwlin@google.com>
Manish Pandey [Mon, 21 Jan 2019 14:50:10 +0000 (14:50 +0000)]
Make device tree pre-processing similar to U-boot/Linux
Following changes are done to make DT pre-processing similar to that of
U-boot/Linux kernel.
1. Creating seperate CPPFLAGS for DT preprocessing so that compiler
options specific to it can be accommodated.
e.g: "-undef" compiler option avoids replacing "linux" string(used in
device trees) with "1" as "linux" is a pre-defined macro in gnu99
standard.
2. Replace CPP with PP for DT pre-processing, as CPP in U-boot/Linux is
exported as "${CROSS_COMPILE}gcc -E" while in TF-A it is exported as
"${CROSS_COMPILE}cpp".
Change-Id: If4c61a249d51614d9f53ae30b602036d50c02349
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Anson Huang [Thu, 24 Jan 2019 02:58:58 +0000 (10:58 +0800)]
imx: enable necessary errata for i.mx8qm
NXP's i.MX8QM uses Cortex-A53 r0p4, enable necessary
erratas for it.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Anson Huang [Thu, 24 Jan 2019 03:00:14 +0000 (11:00 +0800)]
imx: enable necessary errata for i.mx8mq
NXP's i.MX8MQ uses Cortex-A53 r0p4, enable necessary
erratas for it.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Varun Wadekar [Thu, 30 Nov 2017 01:16:48 +0000 (17:16 -0800)]
Tegra186: remove RELOCATE_TO_BL31_BASE config
This patch removes this unused config option from the Tegra186
platform makefiles.
Change-Id: Idcdf6854332a26599323a247289c2d3ce19f475f
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Thu, 30 Nov 2017 01:14:24 +0000 (17:14 -0800)]
Tegra: memctrl_v2: remove usage of ENABLE_SMMU_DEVICE config
This patch removes the usage of this platform config, as it is always
enabled by all the supported platforms.
Change-Id: Ie7adb641adeb3604b177b6960b797722d60addfa
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Dilan Lee [Fri, 27 Oct 2017 01:51:09 +0000 (09:51 +0800)]
Tegra: add 'late' platform setup handler
This patch adds a platform setup handler that gets called after
the MMU is enabled. Platforms wanting to make use of this handler
should declare 'plat_late_platform_setup' handler in their platform
files, to override the default weakly defined handler.
Change-Id: Ibc97a2e5a24608ddea856d0bd543a9d5876f604c
Signed-off-by: Dilan Lee <dilee@nvidia.com>
Varun Wadekar [Wed, 15 Nov 2017 23:48:51 +0000 (15:48 -0800)]
Tegra: spe: shared console for Tegra platforms
There are Tegra platforms which have limited UART ports and so
all the components have to share the console. The SPE helps out
by collecting all the logs in such cases and prints them on the
shared UART port.
This patch adds a driver to communicate with the SPE driver, which
in turn provides the console.
Change-Id: Ie750520b936b8bed0ab1d876f03fc0a3490a85a3
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 15 Nov 2017 23:46:38 +0000 (15:46 -0800)]
Tegra: console driver compilation from platform makefiles
This patch includes the console driver from individual platform
makefiles and removes it from tegra_common.mk. This allows future
platforms to include consoles of their choice.
Change-Id: I7506562bfac78421a80fb6782ac8472fbef6cfb0
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Varun Wadekar [Wed, 8 Nov 2017 22:03:16 +0000 (14:03 -0800)]
Tegra: smmu: change exit criteria for context size calculation
Tegra SoCs currently do not have a SMMU register at address 0xFFFFFFFF.
This patch changes the search criteria, to look for this marker, to
calculate the size of the saved context.
Change-Id: I15d91945ecb78267f91c45f37985dbb2327ca3ae
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Steven Kao [Tue, 14 Nov 2017 10:52:05 +0000 (18:52 +0800)]
Tegra: memctrl_v2: platform handler for TZDRAM setup
The Tegra memctrl driver sets up the TZDRAM fence during boot and
system suspend exit. This patch provides individual platforms with
handlers to perform custom steps during TZDRAM setup.
Change-Id: Iee094d6ca189c6dd24f1147003c33c99ff3a953b
Signed-off-by: Steven Kao <skao@nvidia.com>