Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'arm-soc/for-4.15/drivers-part2' of http://github.com/Broadcom/stblinux into next/drivers

Pull "Broadcom drivers changes for 4.15 (part 2)" from Florian Fainelli:

This pull request contains Broadcom ARM/ARM64/MIPS SoCs changes for 4.15
(second part), please pull the following:

- Markus updates the Broadcom STB DPFE driver to avoid loading the firmware when
unnecessary to accomodate for specific platform restrictions

- Florian adds support for the Broadcom Hurricane 2 SoC iProc PLL clock needed
to get the proper CPU clock frequency

* tag 'arm-soc/for-4.15/drivers-part2' of http://github.com/Broadcom/stblinux:
clk: bcm: Add Broadcom Hurricane 2 clock support
memory: brcmstb: dpfe: skip downloading firmware when possible
memory: brcmstb: dpfe: introduce is_dcpu_enabled()

+66 -8
+9
drivers/clk/bcm/Kconfig
··· 30 30 help 31 31 Enable common clock framework support for the Broadcom Cygnus SoC 32 32 33 + config CLK_BCM_HR2 34 + bool "Broadcom Hurricane 2 clock support" 35 + depends on ARCH_BCM_HR2 || COMPILE_TEST 36 + select COMMON_CLK_IPROC 37 + default ARCH_BCM_HR2 38 + help 39 + Enable common clock framework support for the Broadcom Hurricane 2 40 + SoC 41 + 33 42 config CLK_BCM_NSP 34 43 bool "Broadcom Northstar/Northstar Plus clock support" 35 44 depends on ARCH_BCM_5301X || ARCH_BCM_NSP || COMPILE_TEST
+1
drivers/clk/bcm/Makefile
··· 8 8 obj-$(CONFIG_ARCH_BCM2835) += clk-bcm2835-aux.o 9 9 obj-$(CONFIG_ARCH_BCM_53573) += clk-bcm53573-ilp.o 10 10 obj-$(CONFIG_CLK_BCM_CYGNUS) += clk-cygnus.o 11 + obj-$(CONFIG_CLK_BCM_HR2) += clk-hr2.o 11 12 obj-$(CONFIG_CLK_BCM_NSP) += clk-nsp.o 12 13 obj-$(CONFIG_CLK_BCM_NS2) += clk-ns2.o 13 14 obj-$(CONFIG_CLK_BCM_SR) += clk-sr.o
+27
drivers/clk/bcm/clk-hr2.c
··· 1 + /* 2 + * Copyright (C) 2017 Broadcom 3 + * 4 + * This program is free software; you can redistribute it and/or 5 + * modify it under the terms of the GNU General Public License as 6 + * published by the Free Software Foundation version 2. 7 + * 8 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any 9 + * kind, whether express or implied; without even the implied warranty 10 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 + * GNU General Public License for more details. 12 + */ 13 + 14 + #include <linux/kernel.h> 15 + #include <linux/err.h> 16 + #include <linux/clk-provider.h> 17 + #include <linux/io.h> 18 + #include <linux/of.h> 19 + #include <linux/of_address.h> 20 + 21 + #include "clk-iproc.h" 22 + 23 + static void __init hr2_armpll_init(struct device_node *node) 24 + { 25 + iproc_armpll_setup(node); 26 + } 27 + CLK_OF_DECLARE(hr2_armpll, "brcm,hr2-armpll", hr2_armpll_init);
+29 -8
drivers/memory/brcmstb_dpfe.c
··· 202 202 }, 203 203 }; 204 204 205 + static bool is_dcpu_enabled(void __iomem *regs) 206 + { 207 + u32 val; 208 + 209 + val = readl_relaxed(regs + REG_DCPU_RESET); 210 + 211 + return !(val & DCPU_RESET_MASK); 212 + } 213 + 205 214 static void __disable_dcpu(void __iomem *regs) 206 215 { 207 216 u32 val; 208 217 209 - /* Check if DCPU is running */ 218 + if (!is_dcpu_enabled(regs)) 219 + return; 220 + 221 + /* Put DCPU in reset if it's running. */ 210 222 val = readl_relaxed(regs + REG_DCPU_RESET); 211 - if (!(val & DCPU_RESET_MASK)) { 212 - /* Put DCPU in reset */ 213 - val |= (1 << DCPU_RESET_SHIFT); 214 - writel_relaxed(val, regs + REG_DCPU_RESET); 215 - } 223 + val |= (1 << DCPU_RESET_SHIFT); 224 + writel_relaxed(val, regs + REG_DCPU_RESET); 216 225 } 217 226 218 227 static void __enable_dcpu(void __iomem *regs) ··· 431 422 const void *fw_blob; 432 423 int ret; 433 424 425 + priv = platform_get_drvdata(pdev); 426 + 427 + /* 428 + * Skip downloading the firmware if the DCPU is already running and 429 + * responding to commands. 430 + */ 431 + if (is_dcpu_enabled(priv->regs)) { 432 + u32 response[MSG_FIELD_MAX]; 433 + 434 + ret = __send_command(priv, DPFE_CMD_GET_INFO, response); 435 + if (!ret) 436 + return 0; 437 + } 438 + 434 439 ret = request_firmware(&fw, FIRMWARE_NAME, dev); 435 440 /* request_firmware() prints its own error messages. */ 436 441 if (ret) 437 442 return ret; 438 - 439 - priv = platform_get_drvdata(pdev); 440 443 441 444 ret = __verify_firmware(init, fw); 442 445 if (ret)