summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-11-09 10:55:05 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-11-09 10:55:05 +0100
commit227426f16163d3721fee82650980aae0eef01375 (patch)
treea64101906c15b814ec942468e88875ce8160e45d /arch
parentc024f90f5dd5604d3f82dbbc055fd88a69d59187 (diff)
parentac7324a0ed12a67fc836b383388f2562d32e55ed (diff)
downloadbarebox-227426f16163d3721fee82650980aae0eef01375.tar.gz
barebox-227426f16163d3721fee82650980aae0eef01375.tar.xz
Merge branch 'for-next/net-switch-mv88e6xxx'
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/system.h2
-rw-r--r--arch/arm/mach-imx/Kconfig12
-rw-r--r--arch/arm/mach-imx/Makefile1
-rw-r--r--arch/arm/mach-imx/clocksource.c192
-rw-r--r--arch/arm/mach-imx/iim.c2
-rw-r--r--arch/arm/mach-imx/include/mach/devices-imx51.h2
-rw-r--r--arch/arm/mach-imx/include/mach/devices-imx53.h2
-rw-r--r--arch/arm/mach-mxs/include/mach/devices.h2
-rw-r--r--arch/arm/mach-mxs/ocotp.c2
-rw-r--r--arch/sandbox/board/console.c2
10 files changed, 19 insertions, 200 deletions
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 5cf828ea36..2f13e2b98d 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -61,7 +61,7 @@
#define CR_TE (1 << 30) /* Thumb exception enable */
#ifndef __ASSEMBLY__
-#if __LINUX_ARM_ARCH__ >= 7
+#if __LINUX_ARM_ARCH__ > 7
static inline unsigned int current_el(void)
{
unsigned int el;
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index b2b250f3eb..edfc851138 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -84,58 +84,68 @@ comment "Freescale i.MX System-on-Chip"
config ARCH_IMX1
bool
select CPU_ARM920T
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V1
config ARCH_IMX21
bool
select CPU_ARM926T
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V1
config ARCH_IMX25
bool
select CPU_ARM926T
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V3
config ARCH_IMX27
bool
select CPU_ARM926T
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V1
config ARCH_IMX31
select CPU_V6
bool
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V2
config ARCH_IMX35
bool
select CPU_V6
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V3
config ARCH_IMX50
bool
select CPU_V7
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V3
config ARCH_IMX51
bool
select CPU_V7
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V3
config ARCH_IMX53
bool
select CPU_V7
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
select PINCTRL_IMX_IOMUX_V3
config ARCH_IMX6
bool
select ARCH_HAS_L2X0
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
select CPU_V7
select PINCTRL_IMX_IOMUX_V3
select OFTREE
@@ -163,6 +173,7 @@ config ARCH_IMX7
select OFTREE
select COMMON_CLK_OF_PROVIDER
select ARCH_HAS_FEC_IMX
+ select ARCH_HAS_IMX_GPT
config ARCH_IMX8MQ
bool
@@ -184,6 +195,7 @@ config ARCH_VF610
select COMMON_CLK_OF_PROVIDER
select NVMEM
select IMX_OCOTP # Needed for clock adjustement
+ select CLOCKSOURCE_ARM_GLOBAL_TIMER
config IMX_MULTI_BOARDS
bool "Allow multiple boards to be selected"
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 5a01dd57e8..97c54406e6 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -1,4 +1,3 @@
-obj-y += clocksource.o
obj-$(CONFIG_ARCH_IMX1) += imx1.o
obj-$(CONFIG_ARCH_IMX25) += imx25.o
obj-$(CONFIG_ARCH_IMX21) += imx21.o
diff --git a/arch/arm/mach-imx/clocksource.c b/arch/arm/mach-imx/clocksource.c
deleted file mode 100644
index 4d6c6c2b0b..0000000000
--- a/arch/arm/mach-imx/clocksource.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Alex Zuepke <azu@sysgo.de>
- *
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * 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 <common.h>
-#include <init.h>
-#include <clock.h>
-#include <errno.h>
-#include <of.h>
-#include <linux/clk.h>
-#include <linux/err.h>
-#include <notifier.h>
-#include <io.h>
-
-/* Part 1: Registers */
-# define GPT_TCTL 0x00
-# define GPT_TPRER 0x04
-
-/* Part 2: Bitfields */
-#define TCTL_SWR (1 << 15) /* Software reset */
-#define IMX1_TCTL_FRR (1 << 8) /* Freerun / restart */
-#define IMX31_TCTL_FRR (1 << 9) /* Freerun / restart */
-#define IMX1_TCTL_CLKSOURCE_PER (1 << 1) /* Clock source bit position */
-#define IMX31_TCTL_CLKSOURCE_IPG (1 << 6) /* Clock source bit position */
-#define IMX31_TCTL_CLKSOURCE_PER (2 << 6) /* Clock source bit position */
-#define TCTL_TEN (1 << 0) /* Timer enable */
-
-static struct clk *clk_gpt;
-
-struct imx_gpt_regs {
- unsigned int tcn;
- uint32_t tctl_val;
-};
-
-static struct imx_gpt_regs regs_imx1 = {
- .tcn = 0x10,
- .tctl_val = IMX1_TCTL_FRR | IMX1_TCTL_CLKSOURCE_PER | TCTL_TEN,
-};
-
-static struct imx_gpt_regs regs_imx31 = {
- .tcn = 0x24,
- .tctl_val = IMX31_TCTL_FRR | IMX31_TCTL_CLKSOURCE_PER | TCTL_TEN,
-};
-
-static struct imx_gpt_regs *regs;
-static void __iomem *timer_base;
-
-static uint64_t imx_clocksource_read(void)
-{
- return readl(timer_base + regs->tcn);
-}
-
-static struct clocksource cs = {
- .read = imx_clocksource_read,
- .mask = CLOCKSOURCE_MASK(32),
- .shift = 10,
-};
-
-static int imx_clocksource_clock_change(struct notifier_block *nb, unsigned long event, void *data)
-{
- cs.mult = clocksource_hz2mult(clk_get_rate(clk_gpt), cs.shift);
- return 0;
-}
-
-static struct notifier_block imx_clock_notifier = {
- .notifier_call = imx_clocksource_clock_change,
-};
-
-static int imx_gpt_probe(struct device_d *dev)
-{
- struct resource *iores;
- int i;
- int ret;
- unsigned long rate;
-
- /* one timer is enough */
- if (timer_base)
- return 0;
-
- ret = dev_get_drvdata(dev, (const void **)&regs);
- if (ret)
- return ret;
-
- iores = dev_request_mem_resource(dev, 0);
- if (IS_ERR(iores))
- return PTR_ERR(iores);
- timer_base = IOMEM(iores->start);
-
- /* setup GP Timer 1 */
- writel(TCTL_SWR, timer_base + GPT_TCTL);
-
- for (i = 0; i < 100; i++)
- writel(0, timer_base + GPT_TCTL); /* We have no udelay by now */
-
- clk_gpt = clk_get(dev, "per");
- if (IS_ERR(clk_gpt)) {
- rate = 20000000;
- dev_err(dev, "failed to get clock, assume %lu Hz\n", rate);
- } else {
- rate = clk_get_rate(clk_gpt);
- if (!rate) {
- dev_err(dev, "clock reports rate == 0\n");
- return -EIO;
- }
- }
-
- writel(0, timer_base + GPT_TPRER);
- writel(regs->tctl_val, timer_base + GPT_TCTL);
-
- cs.mult = clocksource_hz2mult(rate, cs.shift);
-
- init_clock(&cs);
-
- clock_register_client(&imx_clock_notifier);
-
- return 0;
-}
-
-static __maybe_unused struct of_device_id imx_gpt_dt_ids[] = {
- {
- .compatible = "fsl,imx1-gpt",
- .data = &regs_imx1,
- }, {
- .compatible = "fsl,imx21-gpt",
- .data = &regs_imx1,
- }, {
- .compatible = "fsl,imx31-gpt",
- .data = &regs_imx31,
- }, {
- .compatible = "fsl,imx6q-gpt",
- .data = &regs_imx31,
- }, {
- .compatible = "fsl,imx6dl-gpt",
- .data = &regs_imx31,
- }, {
- .compatible = "fsl,imx6ul-gpt",
- .data = &regs_imx31,
- }, {
- .compatible = "fsl,imx7d-gpt",
- .data = &regs_imx31,
- }, {
- /* sentinel */
- }
-};
-
-static struct platform_device_id imx_gpt_ids[] = {
- {
- .name = "imx1-gpt",
- .driver_data = (unsigned long)&regs_imx1,
- }, {
- .name = "imx31-gpt",
- .driver_data = (unsigned long)&regs_imx31,
- }, {
- /* sentinel */
- },
-};
-
-static struct driver_d imx_gpt_driver = {
- .name = "imx-gpt",
- .probe = imx_gpt_probe,
- .of_compatible = DRV_OF_COMPAT(imx_gpt_dt_ids),
- .id_table = imx_gpt_ids,
-};
-
-static int imx_gpt_init(void)
-{
- return platform_driver_register(&imx_gpt_driver);
-}
-postcore_initcall(imx_gpt_init);
diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index d4794cbac8..207e1879c3 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -474,7 +474,7 @@ static int imx_iim_probe(struct device_d *dev)
imx_iim = iim;
- strcpy(iim->dev.name, "iim");
+ dev_set_name(&iim->dev, "iim");
iim->dev.parent = dev;
iim->dev.id = DEVICE_ID_SINGLE;
ret = register_device(&iim->dev);
diff --git a/arch/arm/mach-imx/include/mach/devices-imx51.h b/arch/arm/mach-imx/include/mach/devices-imx51.h
index cccd8f4610..66fe643f82 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx51.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx51.h
@@ -81,7 +81,7 @@ static inline struct device_d *imx51_add_nand(struct imx_nand_platform_data *pda
dev->resource = xzalloc(sizeof(struct resource) * ARRAY_SIZE(res));
memcpy(dev->resource, res, sizeof(struct resource) * ARRAY_SIZE(res));
dev->num_resources = ARRAY_SIZE(res);
- strcpy(dev->name, "imx_nand");
+ dev_set_name(dev, "imx_nand");
dev->id = DEVICE_ID_DYNAMIC;
dev->platform_data = pdata;
diff --git a/arch/arm/mach-imx/include/mach/devices-imx53.h b/arch/arm/mach-imx/include/mach/devices-imx53.h
index 10caae8c93..27200a26d0 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx53.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx53.h
@@ -95,7 +95,7 @@ static inline struct device_d *imx53_add_nand(struct imx_nand_platform_data *pda
dev->resource = xzalloc(sizeof(struct resource) * ARRAY_SIZE(res));
memcpy(dev->resource, res, sizeof(struct resource) * ARRAY_SIZE(res));
dev->num_resources = ARRAY_SIZE(res);
- strcpy(dev->name, "imx_nand");
+ dev_set_name(dev, "imx_nand");
dev->id = DEVICE_ID_DYNAMIC;
dev->platform_data = pdata;
diff --git a/arch/arm/mach-mxs/include/mach/devices.h b/arch/arm/mach-mxs/include/mach/devices.h
index 5680d61c9e..b212aa783e 100644
--- a/arch/arm/mach-mxs/include/mach/devices.h
+++ b/arch/arm/mach-mxs/include/mach/devices.h
@@ -26,7 +26,7 @@ static inline struct device_d *mxs_add_nand(unsigned long gpmi_base, unsigned lo
dev->resource = xzalloc(sizeof(struct resource) * ARRAY_SIZE(res));
memcpy(dev->resource, res, sizeof(struct resource) * ARRAY_SIZE(res));
dev->num_resources = ARRAY_SIZE(res);
- strcpy(dev->name, "mxs_nand");
+ dev_set_name(dev, "mxs_nand");
dev->id = DEVICE_ID_DYNAMIC;
platform_device_register(dev);
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
index b41fde9919..01db731166 100644
--- a/arch/arm/mach-mxs/ocotp.c
+++ b/arch/arm/mach-mxs/ocotp.c
@@ -197,7 +197,7 @@ static int mxs_ocotp_probe(struct device_d *dev)
priv->cdev.size = cpu_is_mx23() ? 128 : 160;
priv->cdev.name = DRIVERNAME;
- strcpy(priv->dev.name, "ocotp");
+ dev_set_name(&priv->dev, "ocotp");
priv->dev.parent = dev;
err = register_device(&priv->dev);
if (err)
diff --git a/arch/sandbox/board/console.c b/arch/sandbox/board/console.c
index cf1781d156..006bbd1a6e 100644
--- a/arch/sandbox/board/console.c
+++ b/arch/sandbox/board/console.c
@@ -32,7 +32,7 @@ int barebox_register_console(int stdinfd, int stdoutfd)
data = (struct linux_console_data *)(dev + 1);
dev->platform_data = data;
- strcpy(dev->name, "console");
+ dev_set_name(dev, "console");
dev->id = DEVICE_ID_DYNAMIC;
data->stdoutfd = stdoutfd;