]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/hwspinlock.git/log
rpmsg/hwspinlock.git
5 years agoarm64: dts: ti: am654-base-board: Add gpio_keys node
Keerthy [Mon, 26 Nov 2018 07:40:55 +0000 (13:10 +0530)]
arm64: dts: ti: am654-base-board: Add gpio_keys node

There are 2 push buttons: SW5 and SW6 that are basically connected to
WKUP_GPIO0_24 and WKUP_GPIO0_27 respectively. Add the respective
nodes and the pinctrl data to set the mode to GPIO and Input.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoarm64: configs: Enable GPIO_DAVINCI
Keerthy [Mon, 26 Nov 2018 07:40:54 +0000 (13:10 +0530)]
arm64: configs: Enable GPIO_DAVINCI

Enable GPIO_DAVINCI for K3 platforms.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoarm64: dts: ti: am6: Add gpio nodes
Keerthy [Mon, 26 Nov 2018 07:40:53 +0000 (13:10 +0530)]
arm64: dts: ti: am6: Add gpio nodes

Add gpio0 and gpio1 nodes under MAIN domain and gpio0
under WAKEUP domain.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agogpio: Davinci: Add K3 Specific dependencies
Keerthy [Mon, 26 Nov 2018 07:40:52 +0000 (13:10 +0530)]
gpio: Davinci: Add K3 Specific dependencies

Add K3 Specific dependencies

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agogpio: davinci: Fix the compiler warning with ARM64 config enabled
Keerthy [Mon, 26 Nov 2018 07:40:51 +0000 (13:10 +0530)]
gpio: davinci: Fix the compiler warning with ARM64 config enabled

Fix the compiler warning with ARM64 config enabled

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoarm64: dts: ti: k3-am654-base-board: Add I2C nodes
Vignesh R [Mon, 26 Nov 2018 07:40:50 +0000 (13:10 +0530)]
arm64: dts: ti: k3-am654-base-board: Add I2C nodes

commit e5f4b4ba3d223426cdab582f5a67a841f2b01081 upstream

Add DT entries for I2C instances present in AM654 SoC.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoarm64: dts: ti: am654-base-board: Add pinmux for main uart0
Vignesh R [Mon, 26 Nov 2018 07:40:49 +0000 (13:10 +0530)]
arm64: dts: ti: am654-base-board: Add pinmux for main uart0

commit 27e0e5f65dd05167283cf707ae89e19630b0289d upstream

Add pinmux for main uart0 that is serves as console on AM654 EVM

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agoarm64: dts: ti: k3-am65: Add pinctrl regions
Tero Kristo [Mon, 26 Nov 2018 07:40:48 +0000 (13:10 +0530)]
arm64: dts: ti: k3-am65: Add pinctrl regions

commit ffff31e50509eaeea12df0ea2513fc648359b6bd upstream

Add pinctrl regions for the main and wkup mmr.

The range for main pinctrl region contains a gap
at offset 0x2e4, and because of this, the pinctrl
range is split into two sections.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
5 years agodt-bindings: pinctrl: k3: Introduce pinmux definitions
Vignesh R [Mon, 26 Nov 2018 07:40:47 +0000 (13:10 +0530)]
dt-bindings: pinctrl: k3: Introduce pinmux definitions

commit 4d82c9ec96fd25cb4c126df2e14862df434ee185 upstream

The dt-bindings header for TI K3 AM6 SoCs define a set of macros for
defining pinmux configs in human readable form, instead of raw-coded
hex values.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
5 years agoarm64: dts: ti: am654: Add interrupt controller nodes
Lokesh Vutla [Fri, 23 Nov 2018 09:38:05 +0000 (15:08 +0530)]
arm64: dts: ti: am654: Add interrupt controller nodes

Add DT nodes for the interrupt routers and aggregators in the AM65x SoC.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agoarm64: dts: ti: am654: Update compatible for dmsc
Lokesh Vutla [Fri, 23 Nov 2018 09:38:04 +0000 (15:08 +0530)]
arm64: dts: ti: am654: Update compatible for dmsc

Use the am654 specific compatible for dmsc. This allows to use
the am654 specific RM mapping table.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agosoc: ti: am6: Enable interrupt controller drivers
Lokesh Vutla [Fri, 23 Nov 2018 09:38:03 +0000 (15:08 +0530)]
soc: ti: am6: Enable interrupt controller drivers

Select all the TISCI dependent interrupt controller drivers
for AM6 SoC.

Suggested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoirqchip: ti-sci-inta: Add support for Interrupt Aggregator driver
Lokesh Vutla [Fri, 23 Nov 2018 09:38:02 +0000 (15:08 +0530)]
irqchip: ti-sci-inta: Add support for Interrupt Aggregator driver

Texas Instruments' K3 generation SoCs has an IP Interrupt Aggregator
which is an interrupt controller that does the following:
- Converts events to interrupts that can be understood by
  an interrupt router.
- Allows for multiplexing of events to interrupts.
- Allows for grouping of multiple events to a single interrupt.

Configuration of the interrupt aggregator registers can only be done by
a system co-processor and the driver needs to send a message to this
co processor over TISCI protocol.

Add support for Interrupt Aggregator driver over TISCI protocol.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agodt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings
Lokesh Vutla [Fri, 23 Nov 2018 09:38:01 +0000 (15:08 +0530)]
dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings

Add the DT binding documentation for Interrupt Aggregator driver.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoirqchip: ti-sci-intr: Add support for Interrupt Router driver
Lokesh Vutla [Fri, 23 Nov 2018 09:38:00 +0000 (15:08 +0530)]
irqchip: ti-sci-intr: Add support for Interrupt Router driver

Texas Instruments' K3 generation SoCs has an IP Interrupt Router
that does allows for multiplexing of input interrupts to host
interrupt controller. Interrupt Router inputs are either from a
peripheral or from an Interrupt Aggregator which is another
interrupt controller.

Configuration of the interrupt router registers can only be done by
a system co-processor and the driver needs to send a message to this
co processor over TISCI protocol.

Add support for Interrupt Router driver over TISCI protocol.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agodt-bindings: irqchip: Introduce TISCI Interrupt router bindings
Lokesh Vutla [Fri, 23 Nov 2018 09:37:59 +0000 (15:07 +0530)]
dt-bindings: irqchip: Introduce TISCI Interrupt router bindings

Add the DT binding documentation for Interrupt router driver.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agofirmware: ti_sci: Add helper apis to manage resources
Lokesh Vutla [Fri, 23 Nov 2018 09:37:58 +0000 (15:07 +0530)]
firmware: ti_sci: Add helper apis to manage resources

Each resource with in the device can be uniquely identified
by a type and subtype as defined by TISCI. Since this is generic
across the devices, resource allocation also can be made generic
instead of each client driver handling the resource. So add helper
apis to manage the resource.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agofirmware: ti_sci: Add RM mapping table for am654
Peter Ujfalusi [Fri, 23 Nov 2018 09:37:57 +0000 (15:07 +0530)]
firmware: ti_sci: Add RM mapping table for am654

Add the resource mapping table for AM654 SoC as defined
in http://downloads.ti.com/tisci/esd/latest/5_soc_doc/am6x/resasg_types.html
Introduce a new compatible for AM654 "ti,am654-sci" for using
this resource map table.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agofirmware: ti_sci: Add support for IRQ management
Lokesh Vutla [Fri, 23 Nov 2018 09:37:56 +0000 (15:07 +0530)]
firmware: ti_sci: Add support for IRQ management

TISCI abstracts the handling of IRQ routes where interrupt sources
are not directly connected to interrupt controller. Add support for
the set of TISCI commands for requesting and releasing IRQs.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agofirmware: ti_sci: Add support for RM core ops
Lokesh Vutla [Fri, 23 Nov 2018 09:37:55 +0000 (15:07 +0530)]
firmware: ti_sci: Add support for RM core ops

TISCI provides support for getting the resources(IRQ, RING etc..)
assigned to a specific device. These resources can be handled by
the client and in turn sends TISCI cmd to configure the resources.

It is very important that client should keep track on usage of these
resources.

Add support for TISCI commands to get resource ranges.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agofirmware: ti_sci: Add support to get TISCI handle using of_phandle
Grygorii Strashko [Fri, 23 Nov 2018 09:37:54 +0000 (15:07 +0530)]
firmware: ti_sci: Add support to get TISCI handle using of_phandle

TISCI has been updated to have support for Resource management(likes
interrupts etc..). And there can be multiple device instances of a
resource type in a SoC. So every driver corresponding to a resource type
should get a TISCI handle so that it can make TISCI calls. And each
DT node corresponding to a device should exist under its corresponding
bus node as per the SoC architecture.

But existing apis in TISCI library assumes that all TISCI users are
child nodes of TISCI. Which is not true in the above case. So introduce
(devm_)ti_sci_get_by_phandle() apis that can be used by TISCI users
to get TISCI handle using of phandle property.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoarm64: enable dtb overlay merging support based on configs provided
Tero Kristo [Sun, 17 Jun 2018 19:30:40 +0000 (22:30 +0300)]
arm64: enable dtb overlay merging support based on configs provided

Add dtb-merger tool support to arm64 TI build. The merged configs are
defined by providing proper .its files.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoarm64: enable .dtbo file building for TI arm64 SoCs
Tero Kristo [Sun, 17 Jun 2018 19:30:39 +0000 (22:30 +0300)]
arm64: enable .dtbo file building for TI arm64 SoCs

Add support for building .dtso files into .dtbo binaries. Also change
the base .dtb files to contain symbols for overlay applying purposes.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoARM: dts: dt-overlays: add support for am57xx-evm
Tero Kristo [Mon, 27 Nov 2017 09:24:15 +0000 (11:24 +0200)]
ARM: dts: dt-overlays: add support for am57xx-evm

Add support for building FIT image for am57xx-evm. This FIT image
includes support for base am57xx-beagle boards (rev A2 and C) and
AM57xx-evm overlay.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoscripts/dtb-merge: add tool for merging DTB overlays
Tero Kristo [Fri, 2 Mar 2018 09:09:16 +0000 (11:09 +0200)]
scripts/dtb-merge: add tool for merging DTB overlays

Add tool for merging DT overlays into single DTB file. This parses
all the available .its files to find out the configuration needed
for the DTB. Once matching config is found, passes the data
to fdtoverlay tool to merge everything into a single .dtb.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoscripts/dtc: Bring in upstream version of fdtoverlay tool
Tero Kristo [Fri, 2 Mar 2018 07:21:18 +0000 (09:21 +0200)]
scripts/dtc: Bring in upstream version of fdtoverlay tool

Bring in upstream version v1.4.5.6-gc1e55a5513e9 of the fdtoverlay tool.
Copied over the fdtoverlay.c source as such, and updated the Makefile
to build the tool.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoARM: dts: dt-overlays: Add base support for DT overlay building
Tero Kristo [Thu, 22 Nov 2018 15:54:34 +0000 (17:54 +0200)]
ARM: dts: dt-overlays: Add base support for DT overlay building

Add base support for DT overlay building for TI SoCs. Adds support
for building .dtso files into .dtbo, and building .its files into
.itb for FIT image support. Also, add new kernel build target for
building all available FIT images (make itbs.)

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoARM: dts: dra76x: add support for OPP_PLUS
Tero Kristo [Thu, 29 Mar 2018 05:53:29 +0000 (08:53 +0300)]
ARM: dts: dra76x: add support for OPP_PLUS

Add support for the OPP_PLUS (1.8GHz) for MPU.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agocpufreq: ti-cpufreq: Add support for OPP_PLUS
Lokesh Vutla [Mon, 31 Jul 2017 05:52:32 +0000 (11:22 +0530)]
cpufreq: ti-cpufreq: Add support for OPP_PLUS

DRA762 SoC introduces OPP_PLUS which runs at 1.8GHz. Add
support for this OPP in ti-cpufreq driver.

Acked-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoti_config_fragments: omap_soc: enable RAS
Tero Kristo [Tue, 20 Nov 2018 10:06:01 +0000 (12:06 +0200)]
ti_config_fragments: omap_soc: enable RAS

Enable reliability, availability and serviceability kernel features.
This is needed as a dependency for EDAC.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoARM: dts: am574x-idk: add support for EMIF1 ECC
Tero Kristo [Thu, 5 Oct 2017 12:10:38 +0000 (15:10 +0300)]
ARM: dts: am574x-idk: add support for EMIF1 ECC

EMIF1 has ECC support, so add the DT node with address and interrupt
details to handle this.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoarm64: defconfig: Enable SERIAL_8250_OMAP
Lokesh Vutla [Thu, 8 Nov 2018 00:22:36 +0000 (18:22 -0600)]
arm64: defconfig: Enable SERIAL_8250_OMAP

commit d59c774496a2ee824836aaee1975ed23577edfd1 upstream

Enabling CONFIG_SERIAL_8250_OMAP that is used by TI's
AM6 SoC.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoarm64: defconfig: Enable TI_SCI related configs
Lokesh Vutla [Thu, 8 Nov 2018 00:22:35 +0000 (18:22 -0600)]
arm64: defconfig: Enable TI_SCI related configs

commit 41925a21cdb58d07d6cad4f30539d1cee7a25d7b upstream

Enable TI System Control Interface (TI_SCI) Message Protocol library
and it's relevant power management drivers using this library.

TI's AM6 SoC uses this TI_SCI library to communicate to its system
controller(DMSC). While at it, enable TI_MESSAGE_MANAGER mailbox driver
using which this communication happens.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoarm64: dts: ti: k3-am65-wakeup: Fix wakeup_uart reg address
Vignesh R [Thu, 8 Nov 2018 00:22:34 +0000 (18:22 -0600)]
arm64: dts: ti: k3-am65-wakeup: Fix wakeup_uart reg address

Upstream post: https://patchwork.kernel.org/patch/10617217/

cbass_wakeup interconnect which is the parent of wakeup_uart node
defines address-cells=1 and size-cells=1, therefore fix up reg property
of wakeup_uart node accordingly. Otherwise, this UART instance fails to
probe if enabled.

Fixes: 4201af2544b3 ("arm64: dts: ti: am654: Add uart nodes")
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoarm64: dts: ti: k3-am6: Add Device Management Security Controller support
Nishanth Menon [Thu, 8 Nov 2018 00:22:33 +0000 (18:22 -0600)]
arm64: dts: ti: k3-am6: Add Device Management Security Controller support

commit 42e54f6467ecc25f464d74c0fcea0c9fab1c2e3b upstream

Add TISCI compatible System controller for AM6 SoCs.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoarm64: dts: ti: am654: Add secure proxy instance for main domain
Nishanth Menon [Thu, 8 Nov 2018 00:22:32 +0000 (18:22 -0600)]
arm64: dts: ti: am654: Add secure proxy instance for main domain

commit 77ccbae4f9c8a14d41cb741f1d0a99dee68539fc upstream

Add secure proxy instance for Main domain

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoarm64: dts: ti: am654: Add uart nodes
Nishanth Menon [Thu, 8 Nov 2018 00:22:31 +0000 (18:22 -0600)]
arm64: dts: ti: am654: Add uart nodes

commit 4201af2544b39782d78ca1d4d59908e3b2502333 upstream

Add uart nodes for AM654 device tree components.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoarm64: dts: ti: k3-am65: Change #address-cells and #size-cells of interconnect to 2
Kishon Vijay Abraham I [Thu, 8 Nov 2018 00:22:30 +0000 (18:22 -0600)]
arm64: dts: ti: k3-am65: Change #address-cells and #size-cells of interconnect to 2

commit 3bc1572068e3896b60d86f9c0fb56d1cef28201c upstream

AM65 has two PCIe controllers and each PCIe controller has '2' address
spaces one within the 4GB address space of the SoC and the other above
the 4GB address space of the SoC (cbass_main) in addition to the
register space. The size of the address space above the 4GB SoC address
space is 4GB. These address ranges will be used by CPU/DMA to access
the PCIe address space. In order to represent the address space above
the 4GB SoC address space and to represent the size of this address
space as 4GB, change address-cells and size-cells of interconnect to 2.

Since OSPI has similar need in MCU Domain Memory Map, change
address-cells and size-cells of cbass_mcu interconnect also to 2.

Fixes: ea47eed33a3fe3d919 ("arm64: dts: ti: Add Support for AM654 SoC")
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Vignesh R <vigneshr@ti.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoserial: 8250_omap: Make 8250_omap driver driver depend on ARCH_K3
Lokesh Vutla [Thu, 8 Nov 2018 00:22:29 +0000 (18:22 -0600)]
serial: 8250_omap: Make 8250_omap driver driver depend on ARCH_K3

commit c886751465b8e312389d91446b76a00f45a79276 upstream

Allow 8250 omap serial driver to be used for K3 platforms.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoclk: keystone: Enable TISCI clocks if K3_ARCH
Nishanth Menon [Thu, 8 Nov 2018 00:22:28 +0000 (18:22 -0600)]
clk: keystone: Enable TISCI clocks if K3_ARCH

commit 2f149e6e14bcb5e581e49307b54aafcd6f74a74f upstream

K3_ARCH uses TISCI for clocks as well. Enable the same
for the driver support.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
5 years agodrivers: mailbox: Make ti-msgmr driver depend on ARCH_K3
Nishanth Menon [Thu, 8 Nov 2018 00:22:27 +0000 (18:22 -0600)]
drivers: mailbox: Make ti-msgmr driver depend on ARCH_K3

commit cfc0f7a8ea807bf318a1aa755a6a03d469e02725 upstream

ti-msgmr driver can support K3 platforms as well.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
5 years agofirmware: ti_sci: Provide host-id as an optional dt parameter
Nishanth Menon [Thu, 8 Nov 2018 00:22:26 +0000 (18:22 -0600)]
firmware: ti_sci: Provide host-id as an optional dt parameter

commit e69a35531589a2d3c746b0491d5ad3f77b6a0125 upstream

Texas Instrument's System Control Interface (TISCI) permits the
ability for Operating Systems to running in virtual machines to be
able to independently communicate with the firmware without the need
going through an hypervisor.

The "host-id" in effect is the hardware representation of the
host (example: VMs locked to a core) as identified to the System
Controller.

Provide support as an optional parameter implementation and use the
compatible data as default if one is not provided by device tree.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
5 years agoDocumentation: dt: keystone: ti-sci: Add optional host-id parameter
Nishanth Menon [Thu, 8 Nov 2018 00:22:25 +0000 (18:22 -0600)]
Documentation: dt: keystone: ti-sci: Add optional host-id parameter

commit 79a79c3a0ec2043711577750d4499abf4155d216 upstream

Texas Instrument's System Control Interface (TISCI) permits
the ability for OSs running in virtual machines to be able to
independently communicate with the firmware without the need going
through an hypervisor.

The "host-id" in effect is the hardware representation of the
host (example: VMs locked to a core) as identified to the System
Controller. Hypervisors can either fill in appropriate host-ids in dt
used for each VM instance OR may use prebuilt blobs where the host-ids
are pre-populated, as appropriate for the OS running in the VMs.

This is introduced as an optional parameter to maintain consistency
with legacy device tree blobs.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
5 years agoMAINTAINERS: Drop dt-bindings/genpd/k2g.h
Nishanth Menon [Thu, 8 Nov 2018 00:22:24 +0000 (18:22 -0600)]
MAINTAINERS: Drop dt-bindings/genpd/k2g.h

commit 8abac18fecbd3e6694583227d9b5f337e397f942 upstream.

Drop include/dt-bindings/genpd/k2g.h which disappeared from kernel tree
some time back, however MAINTAINERS file was missed to be updated.

Fixes: d16645054d2f ("dt-bindings: Drop k2g genpd device ID macros")
Cc: Rob Herring <robh@kernel.org>
Cc: Dave Gerlach <d-gerlach@ti.com>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Cc: Tero Kristo <t-kristo@ti.com>
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
5 years agoHACK: clocksource: kconfig: allow to select arm global timer manually
Grygorii Strashko [Wed, 7 Nov 2018 05:55:17 +0000 (11:25 +0530)]
HACK: clocksource: kconfig: allow to select arm global timer manually

This patch changes definition of ARM_GLOBAL_TIMER so it can be
enabled manually. This is required because ARM Global timer
has some limitations:
 - It is not always-on timer on am437x and it can't be
   used as clocksource device if CPU_IDLE=y
 - It doesn't support CPUfreq now
which can't be resolved properly by using kconfig dependencies
in case of multiplatform build.
For example, ARM_GLOBAL_TIMER can't be selected by default
for TI AM437x SOC, because it expected to support cpuidle
and cpufreq in multiplatform build from one side. From
another side - will cpuidle and cpufreq really work depends
not only from kconfig options, but also from PM driver
which has to be loaded.

LKML version:
 https://patchwork.ozlabs.org/patch/579071/

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
5 years agoarm: dts: dra72-evm: Add interrupt parent for pcf_lcd
Nikhil Devshatwar [Wed, 7 Nov 2018 05:55:16 +0000 (11:25 +0530)]
arm: dts: dra72-evm: Add interrupt parent for pcf_lcd

On dra72-evm boards, pcf_lcd GPIO expander's interrupt lines
are connected to SoC GPIO as following

GPIO3_30 for dra72-evm
GPIO6_11 for dra72-evm-revc

Add the interrupt-parent property to correctly describe this.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
5 years agoARM: OMAP2+: sleep43xx: Call secure suspend/resume handlers
Andrew F. Davis [Wed, 7 Nov 2018 05:55:15 +0000 (11:25 +0530)]
ARM: OMAP2+: sleep43xx: Call secure suspend/resume handlers

During suspend CPU context may be lost in both non-secure and secure CPU
states. The kernel can handle saving and restoring the non-secure context
but must call into the secure side to allow it to save any context it may
lose. Add these calls here.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoregulator: palmas: Disable bypass for ldo1 and ldo2
Kishon Vijay Abraham I [Wed, 7 Nov 2018 05:55:14 +0000 (11:25 +0530)]
regulator: palmas: Disable bypass for ldo1 and ldo2

ldo1 and ldo2 have bypass capability. The regulator framework starts
with assuming that bypass is disabled by default. In this particular
case the bypass OTP is 1. So one cannot disable without first enabling
due to the use count going negative. Hence doing a one time disable at
boot.

Any consumer which wants bypass to be enabled/disabled can use the
bypass_enable/bypass_disable functions to turn on or turn off bypass
subsequently.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agopower: opp: ti-opp-supply: Correct the supply in _get_optimal_vdd_voltage call
Keerthy [Wed, 7 Nov 2018 05:55:13 +0000 (11:25 +0530)]
power: opp: ti-opp-supply: Correct the supply in _get_optimal_vdd_voltage call

_get_optimal_vdd_voltage call provides new_supply_vbb->u_volt
as the reference voltage while it should be really new_supply_vdd->u_volt.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Dave Gerlach <d-gerlach@ti.com>
5 years agopower: opp: ti-opp-supply: Dynamically update u_volt_min
Keerthy [Wed, 7 Nov 2018 05:55:12 +0000 (11:25 +0530)]
power: opp: ti-opp-supply: Dynamically update u_volt_min

The voltage range (min, max) provided in the device tree is from
the data manual and is pretty big, catering to a wide range of devices.
On a i2c read/write failure the regulator_set_voltage_triplet function
falls back to set voltage between min and max. The min value from Device
Tree can be lesser than the optimal value and in that case that can lead
to a hang or crash. Hence set the u_volt_min dynamically to the optimal
voltage value.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoarm: dts: am57xx-idk-common: Hook smps12 regulator as cpu vdd-supply
Keerthy [Wed, 7 Nov 2018 05:55:11 +0000 (11:25 +0530)]
arm: dts: am57xx-idk-common: Hook smps12 regulator as cpu vdd-supply

commit 5c8a6b9db5e95ea7702ef8d4bb1438537ef63594 upstream

am574x-idk has no cpu vdd-supply at the moment. Hence hook smps12
regulator as cpu vdd-supply in am57xx-idk-common as the same regulator
feeds on to cpu on am571/2/4-idks. So remove all the individual
instances and place that in common place.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: dts: am437x-gp-evm: Add sleep state for beeper pins
Keerthy [Wed, 7 Nov 2018 05:55:10 +0000 (11:25 +0530)]
ARM: dts: am437x-gp-evm: Add sleep state for beeper pins

Add sleep state for beeper pins. Without this there was a power
increase during the suspend and standby states on V3_3D domain.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: dts: am335x: Add rtc node as system-power-controller
Keerthy [Wed, 7 Nov 2018 05:55:09 +0000 (11:25 +0530)]
ARM: dts: am335x: Add rtc node as system-power-controller

PMIC_PWR_EN pin of RTC on am335x-evm, bone, and boneblack is connected to
PMIC on board, so flag rtc node as system-power-controller to allow
software to poweroff boards.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoHACK: arm: keystone: add outer shareable attribute for pages/sections
Murali Karicheri [Wed, 7 Nov 2018 05:55:08 +0000 (11:25 +0530)]
HACK: arm: keystone: add outer shareable attribute for pages/sections

On KS2 devices pages/sections to be used for DMA must have "outer
shareable" attribute. In the upstream kernel, ARM v7 supports only
"inner shareable attribute". This means all memory requests for pages
that are marked inner shareable in the page tables and are writeback
cacheable will be coherent in all caches at the inner domain. However
in Keystone, these are to be marked as "outer shareable" as the keystone
dma coherency hardware implementation use this feature to listen to
maintenance snoop messages to make it coherent with DMA masters. For more
details, please refer to the ARM TRM and Keystone device user guides [1].

[1] MSMC user guide, document id spruhj6

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
5 years agoARM: dts: keystone-k2g: add timer1 as clocksource
Keerthy [Wed, 7 Nov 2018 05:55:07 +0000 (11:25 +0530)]
ARM: dts: keystone-k2g: add timer1 as clocksource

Add timer1 node as the clocksource.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoclocksource: timer-keystone: Add platform probe support to existing code
Keerthy [Wed, 7 Nov 2018 05:55:06 +0000 (11:25 +0530)]
clocksource: timer-keystone: Add platform probe support to existing code

This patch fixes the case for k2g where in clocks are not
available at the time of keystone_timer_init function call.
K2HK/K2L/K2E devices are left untouched and the old way of
keystone_timer_init is preserved since it is init order sensitive.

On top of the existing code a platform driver is introduced so that
if clock is not yet ready probe can be deferred. This enables hres
timers for k2g.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoHACK: ARM: smccc-call: Use r12 to route secure monitor calls
Harinarayan Bhatta [Mon, 5 Nov 2018 20:54:53 +0000 (14:54 -0600)]
HACK: ARM: smccc-call: Use r12 to route secure monitor calls

Our ROM Secure Monitor(SM) uses the value in r12 to determine which
service is being requested by an SMC call. This goes against he ARM
recommended SMC Calling Convention(SMCCC), which partitions the values
in R0 for this task, OP-TEE's SM follows the ARM recommended convention.

We need a way to signal that a call is for our new SM and not for
the ROM SM in a way that is safe for the ROM SM, in case OP-TEE is
not installed. We do this by putting a value of 0x200 in r12 when the
call is for OP-TEE by modifying the SMCCC caller function.

There are four combinations of events:

If the ROM SM is present and we make a legacy style SMC call, as we
do in early boot, the call will not have r12 set to 0x200 as these
calls go through existing mach-omap2/ SMC handlers, so all is well.

If the ROM SM is present and we make an SMCCC style call, r12 will be
set to 0x200 and ROM SM will see this as an invalid service call and
safely return to the normal world. This should not happen.

If OP-TEE is present and we make a legacy style SMC call, r12 will
not be set to 0x200, and OP-TEE will emulate the functionality that
the call is requesting.

If OP-TEE is present and we make an SMCCC style call, r12 is checked
and as it will be 0x200 we can ignore it and treat the rest of the
registers in the standard SMCCC way.

Using a TI specific calling convention was rejected upstream[0], the
suggested solution was to change all legacy calls to perform runtime
switching based on the DT OP-TEE, this is not a reasonable solution
given how many platforms would be affected, so we will have to keep
this non-upstreamable HACK for now.

[0] https://patchwork.kernel.org/patch/9957687/

Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
5 years agoARM: dts: am437x-gp-evm: Add pinmux for gpio0 wake
Dave Gerlach [Fri, 2 Nov 2018 10:31:27 +0000 (16:01 +0530)]
ARM: dts: am437x-gp-evm: Add pinmux for gpio0 wake

Add pinctrl settings so that gpio0 wake from suspend will be supported
using buttons SW4 and SW7. Also, add pinctrl configuration for 0x954,
spi0_d0, which is an unused pin brought out to a header on the board
that in it's default state also connects to the gpio used for wakeup,
gpio0_3, which affects the state of the pin and prevents a working
wakeup unless we set the mux to a different state.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: dts: am437x-gp-evm: Add uart0 pinctrl default and sleep states
Dave Gerlach [Fri, 2 Nov 2018 10:31:26 +0000 (16:01 +0530)]
ARM: dts: am437x-gp-evm: Add uart0 pinctrl default and sleep states

Currently uart0 uses pinctrl config set by bootloader so
create default state that can be restored after a suspend
event.

Also, modify uart0 pinctrl to include RTS and CTS pins as by
default these are not in a mode for optimal power savings.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: dts: am437x-gp-evm: Add pinctrl for debugss pins
Dave Gerlach [Fri, 2 Nov 2018 10:31:25 +0000 (16:01 +0530)]
ARM: dts: am437x-gp-evm: Add pinctrl for debugss pins

The pins used by debugss are not configued by default, place pulldowns
on the pins for maximum power savings during sleep.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
[t-kristo@ti.com: converted to use AM4372_IOPAD macro]
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoARM: dts: am437x-gp-evm: Add pinctrl for unused_pins
Dave Gerlach [Fri, 2 Nov 2018 10:31:24 +0000 (16:01 +0530)]
ARM: dts: am437x-gp-evm: Add pinctrl for unused_pins

There are several pins on this EVM that are not in use but they can
still draw power if misconfigured. Create a pinctrl entry for these pins
and configure each one for optimal power savings.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
[t-kristo@ti.com: converted to use AM4372_IOPAD macro]
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoARM: OMAP2+: am43xx: Add lcdc clockdomain
Dave Gerlach [Fri, 2 Nov 2018 10:30:48 +0000 (16:00 +0530)]
ARM: OMAP2+: am43xx: Add lcdc clockdomain

As described in AM437x TRM, spruhl7f, Revised September 2016, there is
an LCDC clockdomain present in the PER power domain. Although it is
entirely unused on AM437x, it should be defined along with the other
clockdomains so it can be shut off by Linux as there are no users.

Reported-by: Munan Xu <munan@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: OMAP2+: timer: Extend pending interrupt ACK for gic
Dave Gerlach [Fri, 2 Nov 2018 10:30:47 +0000 (16:00 +0530)]
ARM: OMAP2+: timer: Extend pending interrupt ACK for gic

The current implementation for preventing timer interrupts from
breaking suspend fully fixes the issue on am335x but the GIC present on
am437x cannot be directly acked using only the irqchip calls as is done
for am335x but requires an additional step.

Calling irqchip->irq_eoi only writes to the GIC_CPU_EOI register but for
an interrupt to be properly cleared by the GIC, a read from
GIC_CPU_INTACK must come first.  The only place the irq-gic driver reads
this is in the actual interrupt handler so we cannot access it from the
driver.

To get around this, let's map the GIC_CPU_BASE and read the
GIC_CPU_INTACK register ourselves before calling irq_eoi to properly ack
late timer interrupts that show up during suspend on am437x.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: OMAP2+: timer: Ack pending interrupt during suspend
Dave Gerlach [Fri, 2 Nov 2018 10:30:46 +0000 (16:00 +0530)]
ARM: OMAP2+: timer: Ack pending interrupt during suspend

It is possible that when suspending the clock event timer it will generate
an interrupt just before their suspend is completed, but after interrupts have
been disabled. In this case any pending interrupts will prevent suspend, so
ACK the timer interrupt to avoid this.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agosoc: ti: wkup_m3_ipc: Add debug option to halt m3 in suspend
Dave Gerlach [Fri, 2 Nov 2018 10:30:45 +0000 (16:00 +0530)]
soc: ti: wkup_m3_ipc: Add debug option to halt m3 in suspend

Add a debugfs option to allow configurable halting of the wkup_m3
during suspend at the last possible point before low power mode entry.
This condition can only be resolved through JTAG and advancing beyond
the while loop in a8_lp_ds0_handler. Although this hangs the system it
forces the system to remain active once it has been entirely configured
for low power mode entry, allowing for register inspection through JTAG
to help in debugging transition errors.

Halt mode can be set using the enable_off_mode entry under wkup_m3_ipc
in the debugfs.

Suggested-by: Brad Griffis <bgriffis@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agosoc: ti: wkup_m3_ipc: Fix race condition with rproc_boot
Dave Gerlach [Fri, 2 Nov 2018 10:30:43 +0000 (16:00 +0530)]
soc: ti: wkup_m3_ipc: Fix race condition with rproc_boot

Any user of wkup_m3_ipc calls wkup_m3_ipc_get to get a handle and this
checks the value of the static variable m3_ipc_state to see if the
wkup_m3 is ready. Currently this is populated during probe before
rproc_boot has been called, meaning there is a window of time that
wkup_m3_ipc_get can return a valid handle but the wkup_m3 itself is not
ready, leading to invalid IPC calls to the wkup_m3 and system
instability.

To avoid this, move the population of the m3_ipc_state variable until
after rproc_boot has succeeded to guarantee a valid and usable handle
is always returned.

Reported-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: dts: am4372: Add idle_states for cpuidle
Dave Gerlach [Fri, 2 Nov 2018 10:29:52 +0000 (15:59 +0530)]
ARM: dts: am4372: Add idle_states for cpuidle

Add idle_states table for CPU on am437x. Currently just add C1 state
which gates the MPU clock domain.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: dts: am33xx: Add idle_states for cpuidle
Dave Gerlach [Fri, 2 Nov 2018 10:29:51 +0000 (15:59 +0530)]
ARM: dts: am33xx: Add idle_states for cpuidle

Add idle_states table for CPU on am335x. Currently just add C1 state
which gates the MPU clock domain.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agosoc: ti: pm33xx: Add base cpuidle support
Dave Gerlach [Fri, 2 Nov 2018 10:29:50 +0000 (15:59 +0530)]
soc: ti: pm33xx: Add base cpuidle support

Some cpuidle C-states supported on am335x and am437x, like C1 on am335x,
require the use of the wkup_m3_ipc driver, and all C-states beyond C0 on
both platforms require the use of the SRAM sleep code.

Pass am33xx_do_sram_idle as the idle function to the platform pm core to
be used by the cpuidle-arm driver when entering cpuidle states.
am33xx_do_sram_idle will detect when the wkup_m3 is needed and ping it
if necessary before calling the final cpu_suspend op which will execute
the SRAM code to put the cpu into idle.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agosoc: ti: pm33xx: Use cpu_idle_poll_ctrl in suspend path
Dave Gerlach [Fri, 2 Nov 2018 10:29:49 +0000 (15:59 +0530)]
soc: ti: pm33xx: Use cpu_idle_poll_ctrl in suspend path

Call cpu_idle_poll_ctrl at beginning and end of suspend path to avoid
races between cpuidle and suspend trying to communicate with the
wkup_m3, during suspend we only want it configured for entry to suspend.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: OMAP2+: pm33xx-core: Extend platform_data ops for cpuidle
Dave Gerlach [Fri, 2 Nov 2018 10:29:48 +0000 (15:59 +0530)]
ARM: OMAP2+: pm33xx-core: Extend platform_data ops for cpuidle

In order for am335x and am437x to properly enter deeper c-states in
cpuidle they must always call into the sleep33/43xx suspend code and
also sometimes invoke the wkup_m3_ipc driver. These are both controlled
by the pm33xx module so we must provide a method for the platform code
to call back into the module when it is available as the core cpuidle
ops that are invoked by the cpuidle-arm driver must remain as built in.

Extend the init platform op to take an idle function as an argument so
that we can use this to call into the pm33xx module for c-states that
need it. Also add a deinit op so we can unregister this idle function
from the PM core when the pm33xx module gets unloaded.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: OMAP2+: pm33xx-core: Add cpu_suspend to platform_data ops for pm33xx
Dave Gerlach [Fri, 2 Nov 2018 10:29:47 +0000 (15:59 +0530)]
ARM: OMAP2+: pm33xx-core: Add cpu_suspend to platform_data ops for pm33xx

Currently an soc_suspend function is exposed by the pm33xx platform code
but this contains additional operations needed for full SoC suspend
beyond what is needed for a relatively simple CPU suspend needed during
cpuidle. To get around this introduce cpu_suspend ops to be used by the
am335x and am437x PM driver for the last stage of cpuidle path.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: OMAP2+: pm33xx-core: Add cpuidle_ops for am335x/am437x
Dave Gerlach [Fri, 2 Nov 2018 10:29:46 +0000 (15:59 +0530)]
ARM: OMAP2+: pm33xx-core: Add cpuidle_ops for am335x/am437x

am335x and am437x can now make use of the generic cpuidle-arm driver.
This requires that we define init and suspend ops to be passed set as
the cpuidle ops for the SoC. These ops are invoked directly at the last
stage of the cpuidle-arm driver in order to allow low level platform
code to run and bring the CPU the rest of the way into it's desired idle
state. It is required that the CPUIDLE_METHOD_OF_DECLARE be called from
code that is built in so define these ops in pm33xx-core where the
always built-in portion of the PM code for these SoCs lives.

The cpuidle_ops that we define are matched in the DT to the "enable-method"
defined for the SoC, so also define two new enable-method compatible
strings and document them, one for "ti,am3352" and one for "ti,am4372".

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agosched / idle: Export cpu_idle_poll_ctrl
Dave Gerlach [Fri, 2 Nov 2018 10:29:45 +0000 (15:59 +0530)]
sched / idle: Export cpu_idle_poll_ctrl

Export cpu_idle_poll_ctrl so that it can be used in modules.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: dts: am43x-epos-evm: Reduce i2c0 bus speed for tps65218
Dave Gerlach [Fri, 2 Nov 2018 10:29:15 +0000 (15:59 +0530)]
ARM: dts: am43x-epos-evm: Reduce i2c0 bus speed for tps65218

Based on the latest timing specifications for the TPS65218 from the data
sheet, http://www.ti.com/lit/ds/symlink/tps65218.pdf, document SLDS206
from November 2014, we must change the i2c bus speed to better fit within
the minimum high SCL time required for proper i2c transfer.

When running at 400khz, measurements show that SCL spends
0.8125 uS/1.666 uS high/low which violates the requirement for minimum
high period of SCL provided in datasheet Table 7.6 which is 1 uS.
Switching to 100khz gives us 5 uS/5 uS high/low which both fall above
the minimum given values for 100 khz, 4.0 uS/4.7 uS high/low.

Without this patch occasionally a voltage set operation from the kernel
will appear to have worked but the actual voltage reflected on the PMIC
will not have updated, causing problems especially with cpufreq that may
update to a higher OPP without actually raising the voltage on DCDC2,
leading to a hang.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: dts: am43xx: Add scale data fw to wkup_m3_ipc node
Dave Gerlach [Fri, 2 Nov 2018 10:29:14 +0000 (15:59 +0530)]
ARM: dts: am43xx: Add scale data fw to wkup_m3_ipc node

Add appropriate scale-data-fw names for all am43xx platforms.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: dts: am33xx: Add scale data fw to wkup_m3_ipc node
Dave Gerlach [Fri, 2 Nov 2018 10:29:13 +0000 (15:59 +0530)]
ARM: dts: am33xx: Add scale data fw to wkup_m3_ipc node

Add appropriate scale-data-fw names for all am33xx platforms.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: dts: am335x-evmsk: add support for VTT Toggle
Hebbar, Gururaja [Fri, 2 Nov 2018 10:29:12 +0000 (15:59 +0530)]
ARM: dts: am335x-evmsk: add support for VTT Toggle

AM335x EVM-SK EVM provides s/w control via GPIO over the VTT regulator
to reduce power consumption in low power state.

Now that wkup_m3_ipc code provides an option to toggle VTT, add the
relevant DT property.

On AM335x EVM-SK EVM, VTT enable pin is connected to GPIO0 Pin 7.

Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: dts: am437x-gp-evm: Enable wkup_m3 control of IO isolation
Dave Gerlach [Fri, 2 Nov 2018 10:29:11 +0000 (15:59 +0530)]
ARM: dts: am437x-gp-evm: Enable wkup_m3 control of IO isolation

With this flag wkup_m3 is able to control IO isolation during
suspend on the board.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: dts: am437x-gp-evm: Add state for ddr3 vtt toggle pin
Dave Gerlach [Fri, 2 Nov 2018 10:29:10 +0000 (15:59 +0530)]
ARM: dts: am437x-gp-evm: Add state for ddr3 vtt toggle pin

Add pinctrl data for ddr_vtt_toggle pin so that it is configured
for proper state during DeepSleep0. The pin should enter DS0 off mode
and hold the line low so VTT regulator is kept off while suspended.
It is also important for the PULLUP to be set on this pin so that
on removal of isolation, the VTT line is pulled high as a requirement
for bringing the DDR3 out of self-refresh.

This toggling is dependent on the IO isolation controlled by the
wkup_m3. Without placing the IOs into isolation the DS0 states set for
the pin will not be latched into effect during suspend.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agosoc: ti: wkup_m3: Add PRCM int16 as the wake up source
Keerthy [Fri, 2 Nov 2018 10:29:09 +0000 (15:59 +0530)]
soc: ti: wkup_m3: Add PRCM int16 as the wake up source

Add PRCM int16 as the wake up source.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agosoc: ti: wkup_m3_ipc: Add support for i2c voltage scaling
Dave Gerlach [Fri, 2 Nov 2018 10:29:08 +0000 (15:59 +0530)]
soc: ti: wkup_m3_ipc: Add support for i2c voltage scaling

Allow loading of a binary containing i2c scaling sequences to be
provided to the wkup_m3 firmware in order to properly scale voltage
rails on the PMIC during low power modes like DeepSleep0. Proper binary
format is determined by the FW in use.

Code expects firmware to have 0x0C57 present as the first two bytes
followed by one byte defining offset to sleep sequence followed by one
byte defining offset to wake sequence and then lastly both sequences.
Each sequence is a series of I2C transfers in the form:

u8 length | u8 chip address | u8 byte0/reg address | u8 byte1 | u8 byteN
..

The length indicates the number of bytes to transfer, including the
register address. The length of each transfer is limited by the I2C
buffer size of 32 bytes.

Based on previous work by Russ Dill.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agowkup_m3_ipc: Add support for IO Isolation
Dave Gerlach [Fri, 2 Nov 2018 10:29:07 +0000 (15:59 +0530)]
wkup_m3_ipc: Add support for IO Isolation

AM43xx support isolation of the IOs so that control is taken
from the peripheral they are connected to and overridden by values
present in the CTRL_CONF_* registers for the pad in the control module.

The actual toggling happens from the wkup_m3, so use a DT property from
thea wkup_m3_ipc node to allow the PM code to communicate the necessity
for placing the IOs into isolation to the firmware.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agowkup_m3_ipc: Add support for toggling VTT regulator
Dave Gerlach [Fri, 2 Nov 2018 10:29:06 +0000 (15:59 +0530)]
wkup_m3_ipc: Add support for toggling VTT regulator

Some boards (currently AM335x EVM-SK) provides s/w control via
GPIO to toggle VTT regulator to reduce power consumption in low
power state.

The VTT regulator should be disabled after enabling self-refresh on
suspend, and should be enabled before disabling self-refresh on resume.
This is to allow proper self-refresh entry/exit commands to be
transmitted to the memory.

Add support for toggling VTT regulator using DT properties.
Actual toggling happens in CM3 Firmware. The enable option & the GPIO
pin used is collected in A8 Core and then sent to CM3 using IPC
registers.

Note:
Here it is assumed that VTT Toggle will be done using a pin on GPIO-0
Instance. The reason is GPIO-0 is in wakeup domain.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoremoteproc: move rproc_da_to_va declaration to remoteproc.h
Suman Anna [Fri, 2 Nov 2018 10:29:05 +0000 (15:59 +0530)]
remoteproc: move rproc_da_to_va declaration to remoteproc.h

The rproc_da_to_va() API is an exported function, so move its
declaration from the remoteproc local remoteproc_internal.h
to the public remoteproc.h file.

This will allow drivers outside of the remoteproc folder to be
able to use this API. Without this, a build issue is seen when
this API is used from the wkup_m3_ipc driver on TI AM335x/AM437x
SoCs.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoOMAP: AM437X: Add rtc_only with ddr in self-refresh support
Keerthy [Fri, 2 Nov 2018 10:28:10 +0000 (15:58 +0530)]
OMAP: AM437X: Add rtc_only with ddr in self-refresh support

During RTC-only suspend, power is lost to the wkup domain, so we need to
save and restore the state of that domain. We also need to store some
information within the RTC registers so that u-boot can do the right thing
at powerup.

The state is entered by getting the RTC to bring the pmic_power_en line low
which will instruct the PMIC to disable the appropriate power rails after
putting DDR into self-refresh mode. To bring pmic_power_en low, we need to
get an ALARM2 event. Since we are running from SRAM at that point, it means
calculating what the next second is (via ASM) and programming that into the
RTC. This patch also adds support for wake up source detection.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoARM: OMAP2: Drop the concept of certain power domains not being able to lose context.
Russ Dill [Fri, 2 Nov 2018 10:28:09 +0000 (15:58 +0530)]
ARM: OMAP2: Drop the concept of certain power domains not being able to lose context.

It isn't much of a win, and with hibernation, everything loses context.

Signed-off-by: Russ Dill <Russ.Dill@ti.com>
[j-keerthy@ti.com] ported to 4.14
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agogpio: omap: Restore power_mode configuration at resume time
Dave Gerlach [Fri, 2 Nov 2018 10:28:08 +0000 (15:58 +0530)]
gpio: omap: Restore power_mode configuration at resume time

Commit ("gpio/omap: cleanup prepare_for_idle and
resume_after_idle") introduces omap2_gpio_prepare_for_idle and
omap2_gpio_resume_after_idle to properly configure gpios that are used
as wake sources. When entering off mode, omap2_gpio_prepare_for_idle
can set a flag indicating off-mode entry is desired, however once this
flag is set it is never cleared, so any additional calls to this
function, regardless of the mode, have this flag set.

This patch restores the pwr_mode flag to 0 in
omap2_gpio_resume_after_idle to ensure the flag is not misconfigured
during non off-mode operation.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agortc: interface: Add power_off_program to rtc_class_ops
Keerthy [Fri, 2 Nov 2018 10:28:07 +0000 (15:58 +0530)]
rtc: interface: Add power_off_program to rtc_class_ops

Add an interface function to set up the rtc for a power_off
mode.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agortc: OMAP: Add support for rtc-only mode
Keerthy [Fri, 2 Nov 2018 10:28:06 +0000 (15:58 +0530)]
rtc: OMAP: Add support for rtc-only mode

Prepare rtc driver for rtc-only with DDR in self-refresh mode.
omap_rtc_power_off now should cater to two features:

1) RTC plus DDR in self-refresh is power a saving mode where in the
entire system including the different voltage rails from PMIC are
shutdown except the ones feeding on to RTC and DDR. DDR is kept in
self-refresh hence the contents are preserved. RTC ALARM2 is connected
to PMIC_EN line once we the ALARM2 is triggered we enter the mode with
DDR in self-refresh and RTC Ticking. After a predetermined time an RTC
ALARM1 triggers waking up the system[1]. The control goes to bootloader.
The bootloader then checks RTC scratchpad registers to confirm it was an
rtc_only wakeup and follows a different path, configure bare minimal
clocks for ddr and then jumps to the resume address in another RTC
scratchpad registers and transfers the control to Kernel. Kernel then
restores the saved context. omap_rtc_power_off_program does the ALARM2
programming part.

     [1] http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf Page 2884

2) Power-off: This is usual poweroff mode. omap_rtc_power_off calls the
above omap_rtc_power_off_program function and in addition to that
programs the OMAP_RTC_PMIC_REG for any external wake ups for PMIC like
the pushbutton and shuts off the PMIC.

Hence the split in omap_rtc_power_off.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agortc: omap: Cut down the shutdown time from 2 seconds to 1 sec
Keerthy [Fri, 2 Nov 2018 10:28:05 +0000 (15:58 +0530)]
rtc: omap: Cut down the shutdown time from 2 seconds to 1 sec

commit 09058eab4b4f77b721572da5291532e751b63931 upstream

Cut down the shutdown time from 2 seconds to 1 sec. In case of roll
over try again.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agortc: omap: use of_device_is_system_power_controller function
Keerthy [Fri, 2 Nov 2018 10:28:04 +0000 (15:58 +0530)]
rtc: omap: use of_device_is_system_power_controller function

commit 0438002ac52637cef5f5734bab56d8d8750e1f37 upstream

Use of_device_is_system_power_controller instead of manually reading
the system-power-controller property from the device tree node.

Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoclk: ti: Add functions to save/restore clk context
Russ Dill [Fri, 2 Nov 2018 10:28:03 +0000 (15:58 +0530)]
clk: ti: Add functions to save/restore clk context

commit d6e7bbc148f9fbec8a0117b0d0f420c9710e6d81 upstream

SoCs like AM43XX lose clock registers context during RTC-only
suspend. Hence add functions to save/restore the clock registers
context.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoclk: clk: Add clk_gate_restore
Keerthy [Fri, 2 Nov 2018 10:28:02 +0000 (15:58 +0530)]
clk: clk: Add clk_gate_restore

commit 435365485f40cf12747d1daa2253a4f4b46b8148 upstream

The gate clocks restore context function enables or disables
the clock based on the enable_count. This is done in cases
where the clock context is lost and based on the enable_count
the clock either needs to be enabled/disabled. This helps
restore the state of gate clocks.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoclk: clk: Add functions to save/restore clock context en-masse
Russ Dill [Fri, 2 Nov 2018 10:28:01 +0000 (15:58 +0530)]
clk: clk: Add functions to save/restore clock context en-masse

commit 8b95d1ce3300c411728954473316bd04d0ba9883 upstream

Deep enough power saving mode can result into losing context of the clock
registers also, and they need to be restored once coming back from the power
saving mode. Hence add functions to save/restore clock context.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
5 years agoARM: OMAP2: Add functions to save and restore omap hwmod context en-masse.
Russ Dill [Fri, 2 Nov 2018 10:28:00 +0000 (15:58 +0530)]
ARM: OMAP2: Add functions to save and restore omap hwmod context en-masse.

This is used to support suspend modes like RTC-only and hibernate where
the state of these registers is lost.

After the PRCM loses context in the case of an RTC+DDR cycle omap_hwmod
attempts to return all hwmods to their previous state, however certain
hwmods cannot just be disabled when in their default state, which is why
they need the special handling present in that patch when no driver is
present.

In RTC+DDR mode, even if all drivers are present, the modules are all
returned to their previous state before any driver resume happens so we
will still face the issue described above. This can be prevented by
calling _reidle on all hwmods that need it for any module that is being
disabled to return to it's previous state.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: OMAP2+: omap_hwmod: Introduce HWMOD_NEEDS_REIDLE
Dave Gerlach [Fri, 2 Nov 2018 10:27:59 +0000 (15:57 +0530)]
ARM: OMAP2+: omap_hwmod: Introduce HWMOD_NEEDS_REIDLE

Some hwmods will not properly assert signals to the PRCM after a
context loss if no driver is present which leads to issues with suspend.
This can be caused by the SYSCONFIG register not being programmed
correctly by default or a softreset being needed before the module will
idle. omap_hwmod will program the SYSCONFIG, idle and softreset them
properly after boot but after the first context loss they will be in
the wrong state once again so suspend will no longer work as there
is no driver associated with the hwmod.

Introduce a new flag, HWMOD_NEEDS_REIDLE, to allow these modules to be
tracked and properly handled. omap_hwmod maintains a list of these
modules and uses a PM notifier to enable and then idle and softreset the
hwmods immediately after resume. omap_device will remove hwmods from this
list when a driver is bound and add the hwmods back if the driver is
removed to avoid any conflicts and allow the proper pm layer to handle
things when a driver is present.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoti_config_fragments/defconfig_map.txt: add baseport.cfg
Tero Kristo [Fri, 2 Nov 2018 10:27:37 +0000 (15:57 +0530)]
ti_config_fragments/defconfig_map.txt: add baseport.cfg

Add baseport.cfg file to defconfig map, so that it gets included in
by the defconfig builder tool.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoti_config_fragments/baseport.cfg: Add baseport config fragment file
Tero Kristo [Fri, 2 Nov 2018 10:27:36 +0000 (15:57 +0530)]
ti_config_fragments/baseport.cfg: Add baseport config fragment file

Copy over the baseport.cfg file from 4.14 kernel.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoMerge branch 'integration-ti-linux-4.19.y' of git://git.ti.com/ti-linux-kernel/kernel...
LCPD Auto Merger [Tue, 23 Oct 2018 15:40:25 +0000 (10:40 -0500)]
Merge branch 'integration-ti-linux-4.19.y' of git://git.ti.com/ti-linux-kernel/kernel-integration-tree into ti-linux-4.19.y

TI-Feature: integration
TI-Tree: git://git.ti.com/ti-linux-kernel/kernel-integration-tree.git
TI-Branch: integration-ti-linux-4.19.y

* 'integration-ti-linux-4.19.y' of git://git.ti.com/ti-linux-kernel/kernel-integration-tree:
  ti_config_fragments: Add the k3_soc config fragment
  ti_config_fragments: Remove unneeded config fragments and fix map

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>