Commit 213ae902 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'imx-soc-4.8' of...

Merge tag 'imx-soc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc

The i.MX SoC changes for 4.8:
 - A patch series including both cpuidle and FEC driver changes to
   disable deeper idle states when FEC is active while board level
   workaround for ERR006687 is not available
 - A number patches to fix sparse warnings and spell errors
 - A fix for TZIC FIQ translation from VIRQ to HWIRQ
 - Support compatible of i.MX7 Solo SoC which has a subset of i.MX7 Dual

* tag 'imx-soc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  ARM: imx: add support for i.MX 7Solo
  ARM: i.MX: Disable supervisor protect for i.MX51
  ARM: imx6: fix missing <soc/imx/cpuidle.h> in cpuidle-imx6q.c
  ARM: i.MX: Fix FIQ interrupt handling for TZIC
  ARM: imx6: fix static declaration in include/soc/imx/cpuidle.h
  ARM: imx6q: export cpuidle functions needed by fec driver
  ARM: imx: fix missing include of common.h
  ARM: imx: fix missing includes
  ARM: imx6: disable deeper idle states when FEC is active w/o HW workaround
  ARM: mach-imx6q: fix spelling mistake in error message
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents e2bd0d37 18245c24
...@@ -27,6 +27,9 @@ Optional properties: ...@@ -27,6 +27,9 @@ Optional properties:
number to 1. number to 1.
- fsl,magic-packet : If present, indicates that the hardware supports waking - fsl,magic-packet : If present, indicates that the hardware supports waking
up via magic packet. up via magic packet.
- fsl,err006687-workaround-present: If present indicates that the system has
the hardware workaround for ERR006687 applied and does not need a software
workaround.
Optional subnodes: Optional subnodes:
- mdio : specifies the mdio bus in the FEC, used as a container for phy nodes - mdio : specifies the mdio bus in the FEC, used as a container for phy nodes
......
...@@ -55,23 +55,20 @@ static void __iomem *avic_base; ...@@ -55,23 +55,20 @@ static void __iomem *avic_base;
static struct irq_domain *domain; static struct irq_domain *domain;
#ifdef CONFIG_FIQ #ifdef CONFIG_FIQ
static int avic_set_irq_fiq(unsigned int irq, unsigned int type) static int avic_set_irq_fiq(unsigned int hwirq, unsigned int type)
{ {
struct irq_data *d = irq_get_irq_data(irq);
unsigned int irqt; unsigned int irqt;
irq = d->hwirq; if (hwirq >= AVIC_NUM_IRQS)
if (irq >= AVIC_NUM_IRQS)
return -EINVAL; return -EINVAL;
if (irq < AVIC_NUM_IRQS / 2) { if (hwirq < AVIC_NUM_IRQS / 2) {
irqt = imx_readl(avic_base + AVIC_INTTYPEL) & ~(1 << irq); irqt = imx_readl(avic_base + AVIC_INTTYPEL) & ~(1 << hwirq);
imx_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEL); imx_writel(irqt | (!!type << hwirq), avic_base + AVIC_INTTYPEL);
} else { } else {
irq -= AVIC_NUM_IRQS / 2; hwirq -= AVIC_NUM_IRQS / 2;
irqt = imx_readl(avic_base + AVIC_INTTYPEH) & ~(1 << irq); irqt = imx_readl(avic_base + AVIC_INTTYPEH) & ~(1 << hwirq);
imx_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEH); imx_writel(irqt | (!!type << hwirq), avic_base + AVIC_INTTYPEH);
} }
return 0; return 0;
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <linux/module.h> #include <linux/module.h>
#include <asm/cpuidle.h> #include <asm/cpuidle.h>
#include <soc/imx/cpuidle.h>
#include "common.h" #include "common.h"
#include "cpuidle.h" #include "cpuidle.h"
#include "hardware.h" #include "hardware.h"
...@@ -62,6 +64,24 @@ static struct cpuidle_driver imx6q_cpuidle_driver = { ...@@ -62,6 +64,24 @@ static struct cpuidle_driver imx6q_cpuidle_driver = {
.safe_state_index = 0, .safe_state_index = 0,
}; };
/*
* i.MX6 Q/DL has an erratum (ERR006687) that prevents the FEC from waking the
* CPUs when they are in wait(unclocked) state. As the hardware workaround isn't
* applicable to all boards, disable the deeper idle state when the workaround
* isn't present and the FEC is in use.
*/
void imx6q_cpuidle_fec_irqs_used(void)
{
imx6q_cpuidle_driver.states[1].disabled = true;
}
EXPORT_SYMBOL_GPL(imx6q_cpuidle_fec_irqs_used);
void imx6q_cpuidle_fec_irqs_unused(void)
{
imx6q_cpuidle_driver.states[1].disabled = false;
}
EXPORT_SYMBOL_GPL(imx6q_cpuidle_fec_irqs_unused);
int __init imx6q_cpuidle_init(void) int __init imx6q_cpuidle_init(void)
{ {
/* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */ /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include "../common.h"
#include "devices-common.h"
struct device mxc_aips_bus = { struct device mxc_aips_bus = {
.init_name = "mxc_aips", .init_name = "mxc_aips",
}; };
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* Free Software Foundation. * Free Software Foundation.
*/ */
#include "devices-common.h" #include "devices-common.h"
#include "../common.h"
struct platform_device *__init mxc_register_gpio(char *name, int id, struct platform_device *__init mxc_register_gpio(char *name, int id,
resource_size_t iobase, resource_size_t iosize, int irq, int irq_high) resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
......
...@@ -33,8 +33,10 @@ int mxc_set_irq_fiq(unsigned int irq, unsigned int type) ...@@ -33,8 +33,10 @@ int mxc_set_irq_fiq(unsigned int irq, unsigned int type)
gc = irq_get_chip_data(irq); gc = irq_get_chip_data(irq);
if (gc && gc->private) { if (gc && gc->private) {
exirq = gc->private; exirq = gc->private;
if (exirq->set_irq_fiq) if (exirq->set_irq_fiq) {
ret = exirq->set_irq_fiq(irq, type); struct irq_data *d = irq_get_irq_data(irq);
ret = exirq->set_irq_fiq(irqd_to_hwirq(d), type);
}
} }
return ret; return ret;
......
...@@ -54,6 +54,8 @@ static void __init imx51_dt_init(void) ...@@ -54,6 +54,8 @@ static void __init imx51_dt_init(void)
imx_src_init(); imx_src_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
imx_aips_allow_unprivileged_access("fsl,imx51-aipstz");
} }
static void __init imx51_init_late(void) static void __init imx51_init_late(void)
......
...@@ -220,7 +220,7 @@ static void __init imx6q_1588_init(void) ...@@ -220,7 +220,7 @@ static void __init imx6q_1588_init(void)
IMX6Q_GPR1_ENET_CLK_SEL_MASK, IMX6Q_GPR1_ENET_CLK_SEL_MASK,
clksel); clksel);
else else
pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n"); pr_err("failed to find fsl,imx6q-iomuxc-gpr regmap\n");
clk_put(enet_ref); clk_put(enet_ref);
put_ptp_clk: put_ptp_clk:
......
...@@ -107,6 +107,7 @@ static void __init imx7d_init_irq(void) ...@@ -107,6 +107,7 @@ static void __init imx7d_init_irq(void)
static const char *const imx7d_dt_compat[] __initconst = { static const char *const imx7d_dt_compat[] __initconst = {
"fsl,imx7d", "fsl,imx7d",
"fsl,imx7s",
NULL, NULL,
}; };
......
...@@ -56,14 +56,14 @@ static struct irq_domain *domain; ...@@ -56,14 +56,14 @@ static struct irq_domain *domain;
#define TZIC_NUM_IRQS 128 #define TZIC_NUM_IRQS 128
#ifdef CONFIG_FIQ #ifdef CONFIG_FIQ
static int tzic_set_irq_fiq(unsigned int irq, unsigned int type) static int tzic_set_irq_fiq(unsigned int hwirq, unsigned int type)
{ {
unsigned int index, mask, value; unsigned int index, mask, value;
index = irq >> 5; index = hwirq >> 5;
if (unlikely(index >= 4)) if (unlikely(index >= 4))
return -EINVAL; return -EINVAL;
mask = 1U << (irq & 0x1F); mask = 1U << (hwirq & 0x1F);
value = imx_readl(tzic_base + TZIC_INTSEC0(index)) | mask; value = imx_readl(tzic_base + TZIC_INTSEC0(index)) | mask;
if (type) if (type)
......
...@@ -442,6 +442,8 @@ struct bufdesc_ex { ...@@ -442,6 +442,8 @@ struct bufdesc_ex {
#define FEC_QUIRK_SINGLE_MDIO (1 << 11) #define FEC_QUIRK_SINGLE_MDIO (1 << 11)
/* Controller supports RACC register */ /* Controller supports RACC register */
#define FEC_QUIRK_HAS_RACC (1 << 12) #define FEC_QUIRK_HAS_RACC (1 << 12)
/* Interrupt doesn't wake CPU from deep idle */
#define FEC_QUIRK_ERR006687 (1 << 13)
struct bufdesc_prop { struct bufdesc_prop {
int qid; int qid;
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/pinctrl/consumer.h> #include <linux/pinctrl/consumer.h>
#include <linux/prefetch.h> #include <linux/prefetch.h>
#include <soc/imx/cpuidle.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
...@@ -2818,6 +2819,9 @@ fec_enet_open(struct net_device *ndev) ...@@ -2818,6 +2819,9 @@ fec_enet_open(struct net_device *ndev)
if (ret) if (ret)
goto err_enet_mii_probe; goto err_enet_mii_probe;
if (fep->quirks & FEC_QUIRK_ERR006687)
imx6q_cpuidle_fec_irqs_used();
napi_enable(&fep->napi); napi_enable(&fep->napi);
phy_start(ndev->phydev); phy_start(ndev->phydev);
netif_tx_start_all_queues(ndev); netif_tx_start_all_queues(ndev);
...@@ -2853,6 +2857,9 @@ fec_enet_close(struct net_device *ndev) ...@@ -2853,6 +2857,9 @@ fec_enet_close(struct net_device *ndev)
phy_disconnect(ndev->phydev); phy_disconnect(ndev->phydev);
if (fep->quirks & FEC_QUIRK_ERR006687)
imx6q_cpuidle_fec_irqs_unused();
fec_enet_clk_enable(ndev, false); fec_enet_clk_enable(ndev, false);
pinctrl_pm_select_sleep_state(&fep->pdev->dev); pinctrl_pm_select_sleep_state(&fep->pdev->dev);
pm_runtime_mark_last_busy(&fep->pdev->dev); pm_runtime_mark_last_busy(&fep->pdev->dev);
...@@ -3292,6 +3299,11 @@ fec_probe(struct platform_device *pdev) ...@@ -3292,6 +3299,11 @@ fec_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ndev); platform_set_drvdata(pdev, ndev);
if ((of_machine_is_compatible("fsl,imx6q") ||
of_machine_is_compatible("fsl,imx6dl")) &&
!of_property_read_bool(np, "fsl,err006687-workaround-present"))
fep->quirks |= FEC_QUIRK_ERR006687;
if (of_get_property(np, "fsl,magic-packet", NULL)) if (of_get_property(np, "fsl,magic-packet", NULL))
fep->wol_flag |= FEC_WOL_HAS_MAGIC_PACKET; fep->wol_flag |= FEC_WOL_HAS_MAGIC_PACKET;
......
/*
* Copyright 2016 Pengutronix, <kernel@pengutronix.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*/
#ifndef __SOC_IMX_CPUIDLE_H__
#define __SOC_IMX_CPUIDLE_H__
#if defined(CONFIG_CPU_IDLE) && defined(CONFIG_SOC_IMX6Q)
void imx6q_cpuidle_fec_irqs_used(void);
void imx6q_cpuidle_fec_irqs_unused(void);
#else
static inline void imx6q_cpuidle_fec_irqs_used(void) { }
static inline void imx6q_cpuidle_fec_irqs_unused(void) { }
#endif
#endif /* __SOC_IMX_CPUIDLE_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment