From fa5f66c9387033e9d600df91040b35f0691dc058 Mon Sep 17 00:00:00 2001 From: Marco Franchi Date: Mon, 25 Sep 2017 15:55:56 -0300 Subject: ARM: imx: imx31moboard: Include "board-mx31moboard.h" header file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following build warnings are seen with W=1: warning: no previous prototype for ‘mx31moboard_devboard_init’ [-Wmissing-prototypes] void __init mx31moboard_devboard_init(void) warning: no previous prototype for ‘mx31moboard_marxbot_init’ [-Wmissing-prototypes] void __init mx31moboard_marxbot_init(void) Fix these warnings by including "board-mx31moboard.h". Signed-off-by: Marco Franchi Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mx31moboard-devboard.c | 1 + arch/arm/mach-imx/mx31moboard-marxbot.c | 1 + 2 files changed, 2 insertions(+) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c index 1e91a09..3c224f4 100644 --- a/arch/arm/mach-imx/mx31moboard-devboard.c +++ b/arch/arm/mach-imx/mx31moboard-devboard.c @@ -22,6 +22,7 @@ #include +#include "board-mx31moboard.h" #include "common.h" #include "devices-imx31.h" #include "ehci.h" diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c index 922d491..9a5a869 100644 --- a/arch/arm/mach-imx/mx31moboard-marxbot.c +++ b/arch/arm/mach-imx/mx31moboard-marxbot.c @@ -24,6 +24,7 @@ #include +#include "board-mx31moboard.h" #include "common.h" #include "devices-imx31.h" #include "ehci.h" -- cgit v1.1 From 07294a7e6eda86997e323cfb3a215d2bcbdbf453 Mon Sep 17 00:00:00 2001 From: Marco Franchi Date: Mon, 25 Sep 2017 15:55:57 -0300 Subject: ARM: imx: 3ds-debugboard: Include "3ds_debugboard.h" header file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following build warning is seen with W=1: warning: no previous prototype for ‘mxc_expio_init’ [-Wmissing-prototypes] int __init mxc_expio_init(u32 base, u32 intr_gpio) Fix this warning by including "3ds_debugboard.h". Signed-off-by: Marco Franchi Signed-off-by: Shawn Guo --- arch/arm/mach-imx/3ds_debugboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/3ds_debugboard.c b/arch/arm/mach-imx/3ds_debugboard.c index cda330c..0015abe 100644 --- a/arch/arm/mach-imx/3ds_debugboard.c +++ b/arch/arm/mach-imx/3ds_debugboard.c @@ -20,7 +20,7 @@ #include #include #include - +#include "3ds_debugboard.h" #include "hardware.h" /* LAN9217 ethernet base address */ -- cgit v1.1 From 5ea2e8ad00eeba25cf7bd656293567226bec9b67 Mon Sep 17 00:00:00 2001 From: Marco Franchi Date: Mon, 25 Sep 2017 15:55:58 -0300 Subject: ARM: imx: cpuidle-imx5: Include "cpuidle.h" header file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following build warning is seen with W=1: warning: no previous prototype for ‘imx5_cpuidle_init’ [-Wmissing-prototypes] int __init imx5_cpuidle_init(void) Fix this warning by including "cpuidle.h". Signed-off-by: Marco Franchi Signed-off-by: Shawn Guo --- arch/arm/mach-imx/cpuidle-imx5.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/cpuidle-imx5.c b/arch/arm/mach-imx/cpuidle-imx5.c index 3feca52..db01276 100644 --- a/arch/arm/mach-imx/cpuidle-imx5.c +++ b/arch/arm/mach-imx/cpuidle-imx5.c @@ -9,6 +9,7 @@ #include #include #include +#include "cpuidle.h" static int imx5_cpuidle_enter(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) -- cgit v1.1 From 2e845e5f736fb724edcb258edd0d6d6684a77de8 Mon Sep 17 00:00:00 2001 From: Marco Franchi Date: Mon, 25 Sep 2017 15:55:59 -0300 Subject: ARM: imx: mach-mx31lite: Make mx31lite_map_io static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The following build warning is seen with W=1: warning: no previous prototype for ‘mx31lite_map_io’ [-Wmissing-prototypes] void __init mx31lite_map_io(void) This function is only used in this file so make it "static". Signed-off-by: Marco Franchi Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mach-mx31lite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c index f033a57..a3250bc 100644 --- a/arch/arm/mach-imx/mach-mx31lite.c +++ b/arch/arm/mach-imx/mach-mx31lite.c @@ -245,7 +245,7 @@ static struct map_desc mx31lite_io_desc[] __initdata = { /* * Set up static virtual mappings. */ -void __init mx31lite_map_io(void) +static void __init mx31lite_map_io(void) { mx31_map_io(); iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc)); -- cgit v1.1 From 6879452a883bc985ef9a8f70eb55e870cfb0bb79 Mon Sep 17 00:00:00 2001 From: Leonard Crestez Date: Wed, 11 Oct 2017 15:08:23 +0300 Subject: ARM: imx: Enable cpuidle for i.MX6DL starting at 1.1 Enable cpuidle support on i.MX6DL starting from IMX_CHIP_REVISION_1_1. This also makes the code cleaner because 6q and 6dl actually have different revision histories. Signed-off-by: Bai Ping Signed-off-by: Leonard Crestez Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mach-imx6q.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 45801b2..5707113 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -371,10 +371,13 @@ static struct platform_device imx6q_cpufreq_pdev = { static void __init imx6q_init_late(void) { /* - * WAIT mode is broken on TO 1.0 and 1.1, so there is no point - * to run cpuidle on them. + * WAIT mode is broken on imx6 Dual/Quad revision 1.0 and 1.1 so + * there is no point to run cpuidle on them. + * + * It does work on imx6 Solo/DualLite starting from 1.1 */ - if (imx_get_soc_revision() > IMX_CHIP_REVISION_1_1) + if ((cpu_is_imx6q() && imx_get_soc_revision() > IMX_CHIP_REVISION_1_1) || + (cpu_is_imx6dl() && imx_get_soc_revision() > IMX_CHIP_REVISION_1_0)) imx6q_cpuidle_init(); if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { -- cgit v1.1 From 8e2b04b019c824186548eadd70243dbb97a1675b Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Sat, 30 Sep 2017 12:16:46 -0300 Subject: cpufreq: imx6q: Move speed grading check to cpufreq driver On some i.MX6 SoCs (like i.MX6SL, i.MX6SX and i.MX6UL) that do not have speed grading check, opp table will not be created in platform code, so cpufreq driver prints the following error message: cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19) However, this is not really an error in this case because the imx6q-cpufreq driver first calls dev_pm_opp_get_opp_count() and if it fails, it means that platform code does not provide OPP and then dev_pm_opp_of_add_table() will be called. In order to avoid such confusing error message, move the speed grading check from platform code to the imx6q-cpufreq driver. This way the imx6q-cpufreq no longer has to check whether OPP table is supplied by platform code. Tested on a i.MX6Q and i.MX6UL based boards. Signed-off-by: Fabio Estevam Acked-by: Viresh Kumar Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mach-imx6q.c | 88 +----------------------------------------- 1 file changed, 2 insertions(+), 86 deletions(-) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 5707113..7d80a0a 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -286,88 +286,6 @@ static void __init imx6q_init_machine(void) imx6q_axi_init(); } -#define OCOTP_CFG3 0x440 -#define OCOTP_CFG3_SPEED_SHIFT 16 -#define OCOTP_CFG3_SPEED_1P2GHZ 0x3 -#define OCOTP_CFG3_SPEED_996MHZ 0x2 -#define OCOTP_CFG3_SPEED_852MHZ 0x1 - -static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev) -{ - struct device_node *np; - void __iomem *base; - u32 val; - - np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ocotp"); - if (!np) { - pr_warn("failed to find ocotp node\n"); - return; - } - - base = of_iomap(np, 0); - if (!base) { - pr_warn("failed to map ocotp\n"); - goto put_node; - } - - /* - * SPEED_GRADING[1:0] defines the max speed of ARM: - * 2b'11: 1200000000Hz; - * 2b'10: 996000000Hz; - * 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz. - * 2b'00: 792000000Hz; - * We need to set the max speed of ARM according to fuse map. - */ - val = readl_relaxed(base + OCOTP_CFG3); - val >>= OCOTP_CFG3_SPEED_SHIFT; - val &= 0x3; - - if ((val != OCOTP_CFG3_SPEED_1P2GHZ) && cpu_is_imx6q()) - if (dev_pm_opp_disable(cpu_dev, 1200000000)) - pr_warn("failed to disable 1.2 GHz OPP\n"); - if (val < OCOTP_CFG3_SPEED_996MHZ) - if (dev_pm_opp_disable(cpu_dev, 996000000)) - pr_warn("failed to disable 996 MHz OPP\n"); - if (cpu_is_imx6q()) { - if (val != OCOTP_CFG3_SPEED_852MHZ) - if (dev_pm_opp_disable(cpu_dev, 852000000)) - pr_warn("failed to disable 852 MHz OPP\n"); - } - iounmap(base); -put_node: - of_node_put(np); -} - -static void __init imx6q_opp_init(void) -{ - struct device_node *np; - struct device *cpu_dev = get_cpu_device(0); - - if (!cpu_dev) { - pr_warn("failed to get cpu0 device\n"); - return; - } - np = of_node_get(cpu_dev->of_node); - if (!np) { - pr_warn("failed to find cpu0 node\n"); - return; - } - - if (dev_pm_opp_of_add_table(cpu_dev)) { - pr_warn("failed to init OPP table\n"); - goto put_node; - } - - imx6q_opp_check_speed_grading(cpu_dev); - -put_node: - of_node_put(np); -} - -static struct platform_device imx6q_cpufreq_pdev = { - .name = "imx6q-cpufreq", -}; - static void __init imx6q_init_late(void) { /* @@ -380,10 +298,8 @@ static void __init imx6q_init_late(void) (cpu_is_imx6dl() && imx_get_soc_revision() > IMX_CHIP_REVISION_1_0)) imx6q_cpuidle_init(); - if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) { - imx6q_opp_init(); - platform_device_register(&imx6q_cpufreq_pdev); - } + if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) + platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); } static void __init imx6q_map_io(void) -- cgit v1.1