Skip to content

Commit

Permalink
Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/arm/arm-soc

Pull ARM driver updates from Olof Johansson:
 "Updates of SoC-near drivers and other driver updates that makes more
  sense to take through our tree.

  The largest part of this is a conversion of device registration for
  some renesas shmobile/sh devices over to use resources.  This has
  required coordination with the corresponding arch/sh changes, and
  we've agreed to merge the arch/sh changes through our tree.

  Added in this branch is support for Trusted Foundations secure
  firmware, which is what is used on many of the commercial Nvidia Tegra
  products that are in the market, including the Nvidia Shield.  The
  code is local to arch/arm at this time since it's uncertain whether it
  will be shared with arm64 longer-term, if needed we will refactor
  later.

  A couple of new RTC drivers used on ARM boards, merged through our
  tree on request by the RTC maintainer.

  ... plus a bunch of smaller updates across the board, gpio conversions
  for davinci, etc"

* tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits)
  watchdog: davinci: rename platform driver to davinci-wdt
  tty: serial: Limit msm_serial_hs driver to platforms that use it
  mmc: msm_sdcc: Limit driver to platforms that use it
  usb: phy: msm: Move mach dependent code to platform data
  clk: versatile: fixup IM-PD1 clock implementation
  clk: versatile: pass a name to ICST clock provider
  ARM: integrator: pass parent IRQ to the SIC
  irqchip: versatile FPGA: support cascaded interrupts from DT
  gpio: davinci: don't create irq_domain in case of unbanked irqs
  gpio: davinci: use chained_irq_enter/chained_irq_exit API
  gpio: davinci: add OF support
  gpio: davinci: remove unused variable intc_irq_num
  gpio: davinci: convert to use irqdomain support.
  gpio: introduce GPIO_DAVINCI kconfig option
  gpio: davinci: get rid of DAVINCI_N_GPIO
  gpio: davinci: use {readl|writel}_relaxed() instead of __raw_*
  serial: sh-sci: Add OF support
  serial: sh-sci: Add device tree bindings documentation
  serial: sh-sci: Remove platform data mapbase and irqs fields
  serial: sh-sci: Remove platform data scbrr_algo_id field
  ...
  • Loading branch information
torvalds committed Jan 24, 2014
2 parents 903a9f7 + cd2f43a commit 0ba3307
Show file tree
Hide file tree
Showing 87 changed files with 2,914 additions and 753 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Trusted Foundations
-------------------

Boards that use the Trusted Foundations secure monitor can signal its
presence by declaring a node compatible with "tlm,trusted-foundations"
under the /firmware/ node

Required properties:
- compatible: "tlm,trusted-foundations"
- tlm,version-major: major version number of Trusted Foundations firmware
- tlm,version-minor: minor version number of Trusted Foundations firmware

Example:
firmware {
trusted-foundations {
compatible = "tlm,trusted-foundations";
tlm,version-major = <2>;
tlm,version-minor = <8>;
};
};
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/arm/tegra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ board-specific compatible values:
nvidia,whistler
toradex,colibri_t20-512
toradex,iris

Trusted Foundations
-------------------------------------------
Tegra supports the Trusted Foundation secure monitor. See the
"tlm,trusted-foundations" binding's documentation for more details.
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/arm/versatile-fpga-irq.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ pic: pic@14000000 {
clear-mask = <0xffffffff>;
valid-mask = <0x003fffff>;
};

Optional properties:
- interrupts: if the FPGA IRQ controller is cascaded, i.e. if its IRQ
output is simply connected to the input of another IRQ controller,
then the parent IRQ shall be specified in this property.
68 changes: 68 additions & 0 deletions Documentation/devicetree/bindings/crypto/atmel-crypto.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
* Atmel HW cryptographic accelerators

These are the HW cryptographic accelerators found on some Atmel products.

* Advanced Encryption Standard (AES)

Required properties:
- compatible : Should be "atmel,at91sam9g46-aes".
- reg: Should contain AES registers location and length.
- interrupts: Should contain the IRQ line for the AES.
- dmas: List of two DMA specifiers as described in
atmel-dma.txt and dma.txt files.
- dma-names: Contains one identifier string for each DMA specifier
in the dmas property.

Example:
aes@f8038000 {
compatible = "atmel,at91sam9g46-aes";
reg = <0xf8038000 0x100>;
interrupts = <43 4 0>;
dmas = <&dma1 2 18>,
<&dma1 2 19>;
dma-names = "tx", "rx";

* Triple Data Encryption Standard (Triple DES)

Required properties:
- compatible : Should be "atmel,at91sam9g46-tdes".
- reg: Should contain TDES registers location and length.
- interrupts: Should contain the IRQ line for the TDES.

Optional properties:
- dmas: List of two DMA specifiers as described in
atmel-dma.txt and dma.txt files.
- dma-names: Contains one identifier string for each DMA specifier
in the dmas property.

Example:
tdes@f803c000 {
compatible = "atmel,at91sam9g46-tdes";
reg = <0xf803c000 0x100>;
interrupts = <44 4 0>;
dmas = <&dma1 2 20>,
<&dma1 2 21>;
dma-names = "tx", "rx";
};

* Secure Hash Algorithm (SHA)

Required properties:
- compatible : Should be "atmel,at91sam9g46-sha".
- reg: Should contain SHA registers location and length.
- interrupts: Should contain the IRQ line for the SHA.

Optional properties:
- dmas: One DMA specifiers as described in
atmel-dma.txt and dma.txt files.
- dma-names: Contains one identifier string for each DMA specifier
in the dmas property. Only one "tx" string needed.

Example:
sha@f8034000 {
compatible = "atmel,at91sam9g46-sha";
reg = <0xf8034000 0x100>;
interrupts = <42 4 0>;
dmas = <&dma1 2 17>;
dma-names = "tx";
};
41 changes: 41 additions & 0 deletions Documentation/devicetree/bindings/gpio/gpio-davinci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Davinci GPIO controller bindings

Required Properties:
- compatible: should be "ti,dm6441-gpio"

- reg: Physical base address of the controller and the size of memory mapped
registers.

- gpio-controller : Marks the device node as a gpio controller.

- interrupt-parent: phandle of the parent interrupt controller.

- interrupts: Array of GPIO interrupt number. Only banked or unbanked IRQs are
supported at a time.

- ti,ngpio: The number of GPIO pins supported.

- ti,davinci-gpio-unbanked: The number of GPIOs that have an individual interrupt
line to processor.

The GPIO controller also acts as an interrupt controller. It uses the default
two cells specifier as described in Documentation/devicetree/bindings/
interrupt-controller/interrupts.txt.

Example:

gpio: gpio@1e26000 {
compatible = "ti,dm6441-gpio";
gpio-controller;
reg = <0x226000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <42 IRQ_TYPE_EDGE_BOTH 43 IRQ_TYPE_EDGE_BOTH
44 IRQ_TYPE_EDGE_BOTH 45 IRQ_TYPE_EDGE_BOTH
46 IRQ_TYPE_EDGE_BOTH 47 IRQ_TYPE_EDGE_BOTH
48 IRQ_TYPE_EDGE_BOTH 49 IRQ_TYPE_EDGE_BOTH
50 IRQ_TYPE_EDGE_BOTH>;
ti,ngpio = <144>;
ti,davinci-gpio-unbanked = <0>;
interrupt-controller;
#interrupt-cells = <2>;
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/i2c/trivial-devices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec
gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface
infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz)
isl,isl12057 Intersil ISL12057 I2C RTC Chip
maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface
Expand Down
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/rtc/sunxi-rtc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
* sun4i/sun7i Real Time Clock

RTC controller for the Allwinner A10/A20

Required properties:
- compatible : Should be "allwinner,sun4i-rtc" or "allwinner,sun7i-a20-rtc"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: IRQ line for the RTC.

Example:

rtc: rtc@01c20d00 {
compatible = "allwinner,sun4i-rtc";
reg = <0x01c20d00 0x20>;
interrupts = <24>;
};
46 changes: 46 additions & 0 deletions Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
* Renesas SH-Mobile Serial Communication Interface

Required properties:

- compatible: Must contain one of the following:

- "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
- "renesas,scifa-r8a7790" for R8A7790 (R-Car H2) SCIFA compatible UART.
- "renesas,scifb-r8a7790" for R8A7790 (R-Car H2) SCIFB compatible UART.
- "renesas,hscif-r8a7790" for R8A7790 (R-Car H2) HSCIF compatible UART.
- "renesas,scif-r8a7791" for R8A7791 (R-Car M2) SCIF compatible UART.
- "renesas,scifa-r8a7791" for R8A7791 (R-Car M2) SCIFA compatible UART.
- "renesas,scifb-r8a7791" for R8A7791 (R-Car M2) SCIFB compatible UART.
- "renesas,hscif-r8a7791" for R8A7791 (R-Car M2) HSCIF compatible UART.
- "renesas,scif" for generic SCIF compatible UART.
- "renesas,scifa" for generic SCIFA compatible UART.
- "renesas,scifb" for generic SCIFB compatible UART.
- "renesas,hscif" for generic HSCIF compatible UART.

When compatible with the generic version, nodes must list the
SoC-specific version corresponding to the platform first followed by the
generic version.

- reg: Base address and length of the I/O registers used by the UART.
- interrupts: Must contain an interrupt-specifier for the SCIx interrupt.

- clocks: Must contain a phandle and clock-specifier pair for each entry
in clock-names.
- clock-names: Must contain "sci_ick" for the SCIx UART interface clock.

Note: Each enabled SCIx UART should have an alias correctly numbered in the
"aliases" node.

Example:
aliases {
serial0 = &scifa0;
};

scifa0: serial@e6c40000 {
compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
reg = <0 0xe6c40000 0 64>;
interrupt-parent = <&gic>;
interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp2_clks R8A7790_CLK_SCIFA0>;
clock-names = "sci_ick";
};
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ibm International Business Machines (IBM)
idt Integrated Device Technologies, Inc.
img Imagination Technologies Ltd.
intercontrol Inter Control Group
isl Intersil
lg LG Corporation
linux Linux-specific binding
lsi LSI Corp. (LSI Logic)
Expand Down Expand Up @@ -74,6 +75,7 @@ st STMicroelectronics
ste ST-Ericsson
stericsson ST-Ericsson
ti Texas Instruments
tlm Trusted Logic Mobility
toshiba Toshiba Corporation
toumaz Toumaz
v3 V3 Semiconductor
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ config ARCH_INTEGRATOR
bool "ARM Ltd. Integrator family"
select ARCH_HAS_CPUFREQ
select ARM_AMBA
select ARM_PATCH_PHYS_VIRT
select AUTO_ZRELADDR
select COMMON_CLK
select COMMON_CLK_VERSATILE
select GENERIC_CLOCKEVENTS
Expand Down Expand Up @@ -1084,6 +1086,8 @@ config ARM_TIMER_SP804
select CLKSRC_MMIO
select CLKSRC_OF if OF

source "arch/arm/firmware/Kconfig"

source arch/arm/mm/Kconfig

config ARM_NR_BANKS
Expand Down
1 change: 1 addition & 0 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ core-$(CONFIG_KVM_ARM_HOST) += arch/arm/kvm/
core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
core-y += arch/arm/net/
core-y += arch/arm/crypto/
core-y += arch/arm/firmware/
core-y += $(machdirs) $(platdirs)

drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/boot/dts/integratorcp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@
valid-mask = <0x00000007>;
};

/* The SIC is cascaded off IRQ 26 on the PIC */
sic: sic@ca000000 {
compatible = "arm,versatile-fpga-irq";
interrupt-parent = <&pic>;
interrupts = <26>;
#interrupt-cells = <1>;
interrupt-controller;
reg = <0xca000000 0x100>;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/tegra_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CONFIG_PCI=y
CONFIG_PCI_MSI=y
CONFIG_PCI_TEGRA=y
CONFIG_PCIEPORTBUS=y
CONFIG_TRUSTED_FOUNDATIONS=y
CONFIG_SMP=y
CONFIG_PREEMPT=y
CONFIG_AEABI=y
Expand Down
28 changes: 28 additions & 0 deletions arch/arm/firmware/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
config ARCH_SUPPORTS_FIRMWARE
bool

config ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
bool
select ARCH_SUPPORTS_FIRMWARE

menu "Firmware options"
depends on ARCH_SUPPORTS_FIRMWARE

config TRUSTED_FOUNDATIONS
bool "Trusted Foundations secure monitor support"
depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
help
Some devices (including most Tegra-based consumer devices on the
market) are booted with the Trusted Foundations secure monitor
active, requiring some core operations to be performed by the secure
monitor instead of the kernel.

This option allows the kernel to invoke the secure monitor whenever
required on devices using Trusted Foundations. See
arch/arm/include/asm/trusted_foundations.h or the
tl,trusted-foundations device tree binding documentation for details
on how to use it.

Say n if you don't know what this is about.

endmenu
1 change: 1 addition & 0 deletions arch/arm/firmware/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
81 changes: 81 additions & 0 deletions arch/arm/firmware/trusted_foundations.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Trusted Foundations support for ARM CPUs
*
* Copyright (c) 2013, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/of.h>
#include <asm/firmware.h>
#include <asm/trusted_foundations.h>

#define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200

static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2)
{
asm volatile(
".arch_extension sec\n\t"
"stmfd sp!, {r4 - r11, lr}\n\t"
__asmeq("%0", "r0")
__asmeq("%1", "r1")
__asmeq("%2", "r2")
"mov r3, #0\n\t"
"mov r4, #0\n\t"
"smc #0\n\t"
"ldmfd sp!, {r4 - r11, pc}"
:
: "r" (type), "r" (arg1), "r" (arg2)
: "memory");
}

static int tf_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
{
tf_generic_smc(TF_SET_CPU_BOOT_ADDR_SMC, boot_addr, 0);

return 0;
}

static const struct firmware_ops trusted_foundations_ops = {
.set_cpu_boot_addr = tf_set_cpu_boot_addr,
};

void register_trusted_foundations(struct trusted_foundations_platform_data *pd)
{
/*
* we are not using version information for now since currently
* supported SMCs are compatible with all TF releases
*/
register_firmware_ops(&trusted_foundations_ops);
}

void of_register_trusted_foundations(void)
{
struct device_node *node;
struct trusted_foundations_platform_data pdata;
int err;

node = of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations");
if (!node)
return;

err = of_property_read_u32(node, "tlm,version-major",
&pdata.version_major);
if (err != 0)
panic("Trusted Foundation: missing version-major property\n");
err = of_property_read_u32(node, "tlm,version-minor",
&pdata.version_minor);
if (err != 0)
panic("Trusted Foundation: missing version-minor property\n");
register_trusted_foundations(&pdata);
}
Loading

0 comments on commit 0ba3307

Please sign in to comment.