mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
ARM SoC device tree changes
These changes from 30 individual branches for the most part update device tree files, but there are also a few source code changes that have crept in this time, usually in order to atomically move over a driver from using hardcoded data to DT probing. A number of platforms change their DT files to use the C preprocessor, which is causing a bit of churn, but that is hopefully only this once. There are a few conflicts with the other branches unfortunately: * in exynos5440.dtsi and kirkwood-6281.dtsi, device nodes are added from multiple branches. Need to be careful to have the right set of closing braces as git gets this one wrong. * In kirkwood.dtsi, one 'ranges' line got split into two lines, while another line got added. Order of the lines does not matter. * in sama5d3.dtsi, some cleanup was merged the wrong way, causing a bogus conflict. We want the 'dmas' and 'dma-names' properties to get added here. * Two lines got removed independently in arch/arm/mach-mxs/mach-mxs.c * Contents get added independently in arch/arm/mach-omap2/cclock33xx_data.c -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIVAwUAUdLnpGCrR//JCVInAQI50RAAsXbH1SGvjKJemXhRkFloPDYpCbgdDUFr ChUbjNV1xsY/jaNCfMa5/Qo7lgz/Ot7BpJef9fZn7ret+dc7nchqe/4iIkAokAUh E4ao9D1dP5aAA0ihdbSQHCZtR/0SUR81h6BoOVuo/1mvEiBaFbWAeYe8/6LJd9II OU1w9bDmjfZWYFUXs+j2VF76ueZQ+kz69XDKZUGtkqN76m1AL8lGDurj5jxvyllF VJns8d9q2nr2q9PferfajK6rkOIPaTpwKblxZHUgobCyOitZaiZM0NgF733TsNM6 HXmhDhkcn7T81+SiHVfigJ/nxo9UgU4zNJCODF3WZIwGIj3FbxvCOpdCYi2NhCO8 oLcgDk57tpoKpB3gvAmYVQHP9FIepFa/WAWyPIADA7PkpYrwgc4v+cLEHXpd8SRv viLLIa5QuNdMeaK+Md9OKmKZFd7uFD9jiMtmdm6IpEVDDjMgoteb2XSoEtNebmtY MfbW4okn118a2dFKKaPTKcXVW/a5FRp2JGfB0A58RQHaJWj3JsY1bFn/xWPEpTOA IWB/HHMln0LYTL2AXN9HcaL1jnGI1Wq5eWBurX+cXQ/ij1A6jfoRKYglx7AQqOHj iWcGYtKLLJCgiWFnLSwcljZhfoYr0/z7rhns6yo7/vhN0riy+M84OgN4HbAmUzc1 Bgy9PnJTNo8= =8PtJ -----END PGP SIGNATURE----- Merge tag 'dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC device tree changes from Arnd Bergmann: "These changes from 30 individual branches for the most part update device tree files, but there are also a few source code changes that have crept in this time, usually in order to atomically move over a driver from using hardcoded data to DT probing. A number of platforms change their DT files to use the C preprocessor, which is causing a bit of churn, but that is hopefully only this once" * tag 'dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (372 commits) ARM: at91: dt: rm9200ek: add spi support ARM: at91: dt: rm9200: add spi support ARM: at91/DT: at91sam9n12: add SPI DMA client infos ARM: at91/DT: sama5d3: add SPI DMA client infos ARM: at91/DT: fix SPI compatibility string ARM: Kirkwood: Fix the internal register ranges translation ARM: dts: bcm281xx: change comment to C89 style ARM: mmc: bcm281xx SDHCI driver (dt mods) ARM: nomadik: add the new clocks to the device tree clk: nomadik: implement the Nomadik clocks properly ARM: dts: omap5-uevm: Provide USB Host PHY clock frequency ARM: dts: omap4-panda: Fix DVI EDID reads ARM: dts: omap4-panda: Add USB Host support arm: mvebu: enable mini-PCIe connectors on Armada 370 RD ARM: shmobile: irqpin: add a DT property to enable masking on parent ARM: dts: AM43x EPOS EVM support ARM: dts: OMAP5: Add bandgap DT entry ARM: dts: AM33XX: Add pinmux configuration for CPSW to am335x EVM ARM: dts: AM33XX: Add pinmux configuration for CPSW to EVMsk ARM: dts: AM33XX: Add pinmux configuration for CPSW to beaglebone ...
This commit is contained in:
commit
ee1a8d402e
297 changed files with 15464 additions and 3271 deletions
|
|
@ -4,6 +4,15 @@
|
|||
|
||||
menu "Bus devices"
|
||||
|
||||
config IMX_WEIM
|
||||
bool "Freescale EIM DRIVER"
|
||||
depends on ARCH_MXC
|
||||
help
|
||||
Driver for i.MX6 WEIM controller.
|
||||
The WEIM(Wireless External Interface Module) works like a bus.
|
||||
You can attach many different devices on it, such as NOR, onenand.
|
||||
But now, we only support the Parallel NOR.
|
||||
|
||||
config MVEBU_MBUS
|
||||
bool
|
||||
depends on PLAT_ORION
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
# Makefile for the bus drivers.
|
||||
#
|
||||
|
||||
obj-$(CONFIG_IMX_WEIM) += imx-weim.o
|
||||
obj-$(CONFIG_MVEBU_MBUS) += mvebu-mbus.o
|
||||
obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o
|
||||
|
||||
|
|
|
|||
138
drivers/bus/imx-weim.c
Normal file
138
drivers/bus/imx-weim.c
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* EIM driver for Freescale's i.MX chips
|
||||
*
|
||||
* Copyright (C) 2013 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of_device.h>
|
||||
|
||||
struct imx_weim {
|
||||
void __iomem *base;
|
||||
struct clk *clk;
|
||||
};
|
||||
|
||||
static const struct of_device_id weim_id_table[] = {
|
||||
{ .compatible = "fsl,imx6q-weim", },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, weim_id_table);
|
||||
|
||||
#define CS_TIMING_LEN 6
|
||||
#define CS_REG_RANGE 0x18
|
||||
|
||||
/* Parse and set the timing for this device. */
|
||||
static int
|
||||
weim_timing_setup(struct platform_device *pdev, struct device_node *np)
|
||||
{
|
||||
struct imx_weim *weim = platform_get_drvdata(pdev);
|
||||
u32 value[CS_TIMING_LEN];
|
||||
u32 cs_idx;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
/* get the CS index from this child node's "reg" property. */
|
||||
ret = of_property_read_u32(np, "reg", &cs_idx);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* The weim has four chip selects. */
|
||||
if (cs_idx > 3)
|
||||
return -EINVAL;
|
||||
|
||||
ret = of_property_read_u32_array(np, "fsl,weim-cs-timing",
|
||||
value, CS_TIMING_LEN);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* set the timing for WEIM */
|
||||
for (i = 0; i < CS_TIMING_LEN; i++)
|
||||
writel(value[i], weim->base + cs_idx * CS_REG_RANGE + i * 4);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int weim_parse_dt(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *child;
|
||||
int ret;
|
||||
|
||||
for_each_child_of_node(pdev->dev.of_node, child) {
|
||||
if (!child->name)
|
||||
continue;
|
||||
|
||||
ret = weim_timing_setup(pdev, child);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "%s set timing failed.\n",
|
||||
child->full_name);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "%s fail to create devices.\n",
|
||||
pdev->dev.of_node->full_name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int weim_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct imx_weim *weim;
|
||||
struct resource *res;
|
||||
int ret = -EINVAL;
|
||||
|
||||
weim = devm_kzalloc(&pdev->dev, sizeof(*weim), GFP_KERNEL);
|
||||
if (!weim) {
|
||||
ret = -ENOMEM;
|
||||
goto weim_err;
|
||||
}
|
||||
platform_set_drvdata(pdev, weim);
|
||||
|
||||
/* get the resource */
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
weim->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(weim->base)) {
|
||||
ret = PTR_ERR(weim->base);
|
||||
goto weim_err;
|
||||
}
|
||||
|
||||
/* get the clock */
|
||||
weim->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(weim->clk))
|
||||
goto weim_err;
|
||||
|
||||
ret = clk_prepare_enable(weim->clk);
|
||||
if (ret)
|
||||
goto weim_err;
|
||||
|
||||
/* parse the device node */
|
||||
ret = weim_parse_dt(pdev);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(weim->clk);
|
||||
goto weim_err;
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev, "WEIM driver registered.\n");
|
||||
return 0;
|
||||
|
||||
weim_err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver weim_driver = {
|
||||
.driver = {
|
||||
.name = "imx-weim",
|
||||
.of_match_table = weim_id_table,
|
||||
},
|
||||
.probe = weim_probe,
|
||||
};
|
||||
|
||||
module_platform_driver(weim_driver);
|
||||
MODULE_AUTHOR("Freescale Semiconductor Inc.");
|
||||
MODULE_DESCRIPTION("i.MX EIM Controller Driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
Loading…
Reference in a new issue