1. 01 Jun, 2020 3 commits
    • Stephen Boyd's avatar
      Merge branches 'clk-unisoc', 'clk-trivial', 'clk-bcm', 'clk-st' and 'clk-ast2600' into clk-next · b6f3162d
      Stephen Boyd authored
      * clk-unisoc:
        clk: sprd: add mipi_csi_xx gate clocks
        clk: sprd: add dt-bindings include for mipi_csi_xx clocks
        dt-bindings: clk: sprd: add mipi_csi_xx clocks for SC9863A
        clk: sprd: check its parent status before reading gate clock
        clk: sprd: return correct type of value for _sprd_pll_recalc_rate
        clk: sprd: mark the local clock symbols static
      
      * clk-trivial:
        clk: versatile: remove redundant assignment to pointer clk
        clk: clk-xgene: Fix a typo in Kconfig
        clk: Remove unused inline function clk_debug_reparent
      
      * clk-bcm:
        clk: bcm2835: Constify struct debugfs_reg32
        clk: bcm2835: Remove casting to bcm2835_clk_register
        clk: bcm2835: Fix return type of bcm2835_register_gate
      
      * clk-st:
        clk: clk-flexgen: fix clock-critical handling
      
      * clk-ast2600:
        clk: ast2600: Fix AHB clock divider for A1
      b6f3162d
    • Stephen Boyd's avatar
      Merge branches 'clk-tegra', 'clk-imx', 'clk-zynq', 'clk-socfpga', 'clk-at91'... · 8c88e568
      Stephen Boyd authored
      Merge branches 'clk-tegra', 'clk-imx', 'clk-zynq', 'clk-socfpga', 'clk-at91' and 'clk-ti' into clk-next
      
       - Support custom flags in Xilinx zynq firmware
       - Various small fixes to the Xilinx clk driver
       - Support for Intel Agilex clks
      
      * clk-tegra:
        clk: tegra: Add Tegra210 CSI TPG clock gate
        clk: tegra30: Use custom CCLK implementation
        clk: tegra20: Use custom CCLK implementation
        clk: tegra: cclk: Add helpers for handling PLLX rate changes
        clk: tegra: pll: Add pre/post rate-change hooks
        clk: tegra: Add custom CCLK implementation
        clk: tegra: Remove the old emc_mux clock for Tegra210
        clk: tegra: Implement Tegra210 EMC clock
        clk: tegra: Export functions for EMC clock scaling
        clk: tegra: Add PLLP_UD and PLLMB_UD for Tegra210
        clk: tegra: Rename Tegra124 EMC clock source file
        dt-bindings: clock: tegra: Add clock ID for CSI TPG clock
      
      * clk-imx:
        clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice
        clk: imx: add imx8m_clk_hw_composite_bus
        clk: imx: add mux ops for i.MX8M composite clk
        clk: imx8m: migrate A53 clk root to use composite core
        clk: imx8mp: use imx8m_clk_hw_composite_core to simplify code
        clk: imx8mp: Define gates for pll1/2 fixed dividers
        clk: imx: imx8mp: fix pll mux bit
        clk: imx8m: drop clk_hw_set_parent for A53
        dt-bindings: clocks: imx8mp: Add ids for audiomix clocks
        clk: imx: Add helpers for passing the device as argument
        clk: imx: pll14xx: Add the device as argument when registering
        clk: imx: gate2: Allow single bit gating clock
        clk: imx: clk-pllv3: Use readl_relaxed_poll_timeout() for PLL lock wait
        clk: imx: clk-sscg-pll: Remove unnecessary blank lines
        clk: imx: drop the dependency on ARM64 for i.MX8M
        clk: imx7ulp: make it easy to change ARM core clk
        clk: imx: imx6ul: change flexcan clock to support CiA bitrates
      
      * clk-zynq:
        clk: zynqmp: Make zynqmp_clk_get_max_divisor static
        clk: zynqmp: Update fraction clock check from custom type flags
        clk: zynqmp: Add support for custom type flags
        clk: zynqmp: fix memory leak in zynqmp_register_clocks
        clk: zynqmp: Fix invalid clock name queries
        clk: zynqmp: Fix divider2 calculation
        clk: zynqmp: Limit bestdiv with maxdiv
      
      * clk-socfpga:
        clk: socfpga: agilex: add clock driver for the Agilex platform
        dt-bindings: documentation: add clock bindings information for Agilex
        clk: socfpga: add const to _ops data structures
        clk: socfpga: remove clk_ops enable/disable methods
        clk: socfpga: stratix10: use new parent data scheme
      
      * clk-at91:
        clk: at91: allow setting all PMC clock parents via DT
        clk: at91: allow setting PCKx parent via DT
        clk: at91: optimize pmc data allocation
        clk: at91: pmc: decrement node's refcount
        clk: at91: pmc: do not continue if compatible not located
        clk: at91: Add peripheral clock for PTC
      
      * clk-ti:
        clk: ti: dra7: remove two unused symbols
        clk: ti: dra7xx: fix RNG clock parent
        clk: ti: dra7xx: mark MCAN clock as DRA76x only
        clk: ti: dra7xx: fix gpu clkctrl parent
        clk: ti: omap5: Add proper parent clocks for l4-secure clocks
        clk: ti: omap4: Add proper parent clocks for l4-secure clocks
        clk: ti: composite: fix memory leak
      8c88e568
    • Stephen Boyd's avatar
      Merge branches 'clk-selectable', 'clk-amlogic', 'clk-renesas', 'clk-samsung'... · 3a57530b
      Stephen Boyd authored
      Merge branches 'clk-selectable', 'clk-amlogic', 'clk-renesas', 'clk-samsung' and 'clk-allwinner' into clk-next
      
       - Allow the COMMON_CLK config to be selectable
      
      * clk-selectable:
        clk: Move HAVE_CLK config out of architecture layer
        MIPS: Loongson64: Drop asm/clock.h include
        ARM: mmp: Remove legacy clk code
        clk: Allow the common clk framework to be selectable
        mmc: meson-mx-sdio: Depend on OF_ADDRESS and not just OF
        MIPS: Remove redundant CLKDEV_LOOKUP selects
        h8300: Remove redundant CLKDEV_LOOKUP selects
        arm64: tegra: Remove redundant CLKDEV_LOOKUP selects
        ARM: Remove redundant CLKDEV_LOOKUP selects
        ARM: Remove redundant COMMON_CLK selects
      
      * clk-amlogic:
        clk: meson: meson8b: Don't rely on u-boot to init all GP_PLL registers
        clk: meson: meson8b: Make the CCF use the glitch-free VPU mux
        clk: meson: meson8b: Fix the vclk_div{1, 2, 4, 6, 12}_en gate bits
        clk: meson: meson8b: Fix the polarity of the RESET_N lines
        clk: meson: meson8b: Fix the first parent of vid_pll_in_sel
        clk: meson: g12a: Prepare the GPU clock tree to change at runtime
        clk: meson: gxbb: Prepare the GPU clock tree to change at runtime
        clk: meson: meson8b: make the hdmi_sys clock tree mutable
        clk: meson8b: export the HDMI system clock
      
      * clk-renesas:
        dt-bindings: clock: renesas: mstp: Convert to json-schema
        dt-bindings: clock: renesas: div6: Convert to json-schema
        clk: renesas: cpg-mssr: Fix STBCR suspend/resume handling
        clk: renesas: rcar-gen2: Remove superfluous CLK_RENESAS_DIV6 selects
        clk: renesas: cpg-mssr: Add R8A7742 support
        dt-bindings: clock: renesas: cpg-mssr: Document r8a7742 binding
        clk: renesas: Add r8a7742 CPG Core Clock Definitions
        dt-bindings: power: rcar-sysc: Add r8a7742 power domain index macros
        MAINTAINERS: Add DT Bindings for Renesas Clock Generators
        clk: renesas: r9a06g032: Fix some typo in comments
        dt-bindings: clock: renesas: rcar-usb2-clock-sel: Add r8a77961 support
      
      * clk-samsung:
        clk: samsung: exynos5433: Add IGNORE_UNUSED flag to sclk_i2s1
        ARM/SAMSUNG EXYNOS ARM ARCHITECTURES: Use fallthrough;
        clk: samsung: Fix CLK_SMMU_FIMCL3 clock name on Exynos542x
        clk: samsung: Mark top ISP and CAM clocks on Exynos542x as critical
      
      * clk-allwinner:
        clk: sunxi: Fix incorrect usage of round_down()
      3a57530b
  2. 27 May, 2020 29 commits
  3. 26 May, 2020 3 commits
    • Nathan Chancellor's avatar
      clk: bcm2835: Remove casting to bcm2835_clk_register · 99a1ae29
      Nathan Chancellor authored
      There are four different callback functions that are used for the
      clk_register callback that all have different second parameter types.
      
      bcm2835_register_pll -> struct bcm2835_pll_data
      bcm2835_register_pll_divider -> struct bcm2835_pll_divider_data
      bcm2835_register_clock -> struct bcm2835_clock_data
      bcm2835_register_date -> struct bcm2835_gate_data
      
      These callbacks are cast to bcm2835_clk_register so that there is no
      error about incompatible pointer types. Unfortunately, this is a control
      flow integrity violation, which verifies that the callback function's
      types match the prototypes exactly before jumping.
      
      [    0.857913] CFI failure (target: 0xffffff9334a81820):
      [    0.857977] WARNING: CPU: 3 PID: 35 at kernel/cfi.c:29 __cfi_check_fail+0x50/0x58
      [    0.857985] Modules linked in:
      [    0.858007] CPU: 3 PID: 35 Comm: kworker/3:1 Not tainted 4.19.123-v8-01301-gdbb48f16956e4-dirty #1
      [    0.858015] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
      [    0.858031] Workqueue: events 0xffffff9334a925c8
      [    0.858046] pstate: 60000005 (nZCv daif -PAN -UAO)
      [    0.858058] pc : __cfi_check_fail+0x50/0x58
      [    0.858070] lr : __cfi_check_fail+0x50/0x58
      [    0.858078] sp : ffffff800814ba90
      [    0.858086] x29: ffffff800814ba90 x28: 000fffffffdfff3d
      [    0.858101] x27: 00000000002000c2 x26: ffffff93355fdb18
      [    0.858116] x25: 0000000000000000 x24: ffffff9334a81820
      [    0.858131] x23: ffffff93357f3580 x22: ffffff9334af1000
      [    0.858146] x21: a79b57e88f8ebc81 x20: ffffff93357f3580
      [    0.858161] x19: ffffff9334a81820 x18: fffffff679769070
      [    0.858175] x17: 0000000000000000 x16: 0000000000000000
      [    0.858190] x15: 0000000000000004 x14: 000000000000003c
      [    0.858205] x13: 0000000000003044 x12: 0000000000000000
      [    0.858220] x11: b57e91cd641bae00 x10: b57e91cd641bae00
      [    0.858235] x9 : b57e91cd641bae00 x8 : b57e91cd641bae00
      [    0.858250] x7 : 0000000000000000 x6 : ffffff933591d4e5
      [    0.858264] x5 : 0000000000000000 x4 : 0000000000000000
      [    0.858279] x3 : ffffff800814b718 x2 : ffffff9334a84818
      [    0.858293] x1 : ffffff9334bba66c x0 : 0000000000000029
      [    0.858308] Call trace:
      [    0.858321]  __cfi_check_fail+0x50/0x58
      [    0.858337]  __cfi_check+0x3ab3c/0x4467c
      [    0.858351]  bcm2835_clk_probe+0x210/0x2dc
      [    0.858369]  platform_drv_probe+0xb0/0xfc
      [    0.858380]  really_probe+0x4a0/0x5a8
      [    0.858391]  driver_probe_device+0x68/0x104
      [    0.858403]  __device_attach_driver+0x100/0x148
      [    0.858418]  bus_for_each_drv+0xb0/0x12c
      [    0.858431]  __device_attach.llvm.17225159516306086099+0xc0/0x168
      [    0.858443]  bus_probe_device+0x44/0xfc
      [    0.858455]  deferred_probe_work_func+0xa0/0xe0
      [    0.858472]  process_one_work+0x210/0x538
      [    0.858485]  worker_thread+0x2e8/0x478
      [    0.858500]  kthread+0x154/0x164
      [    0.858515]  ret_from_fork+0x10/0x18
      
      To fix this, change the second parameter of all functions void * and use
      a local variable with the correct type so that everything works
      properly. With this, the only use of bcm2835_clk_register is in struct
      bcm2835_clk_desc so we can just remove it and use the type directly.
      
      Fixes: 56eb3a2e ("clk: bcm2835: remove use of BCM2835_CLOCK_COUNT in driver")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1028Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Link: https://lkml.kernel.org/r/20200516080806.1459784-2-natechancellor@gmail.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      99a1ae29
    • Nathan Chancellor's avatar
      clk: bcm2835: Fix return type of bcm2835_register_gate · f376c43b
      Nathan Chancellor authored
      bcm2835_register_gate is used as a callback for the clk_register member
      of bcm2835_clk_desc, which expects a struct clk_hw * return type but
      bcm2835_register_gate returns a struct clk *.
      
      This discrepancy is hidden by the fact that bcm2835_register_gate is
      cast to the typedef bcm2835_clk_register by the _REGISTER macro. This
      turns out to be a control flow integrity violation, which is how this
      was noticed.
      
      Change the return type of bcm2835_register_gate to be struct clk_hw *
      and use clk_hw_register_gate to do so. This should be a non-functional
      change as clk_register_gate calls clk_hw_register_gate anyways but this
      is needed to avoid issues with further changes.
      
      Fixes: b19f009d ("clk: bcm2835: Migrate to clk_hw based registration and OF APIs")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1028Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Link: https://lkml.kernel.org/r/20200516080806.1459784-1-natechancellor@gmail.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      f376c43b
    • Stephen Boyd's avatar
      Merge tag 'clk-imx-5.8' of... · 5484bb83
      Stephen Boyd authored
      Merge tag 'clk-imx-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into clk-imx
      
      Pull i.MX clk driver updates from Shawn Guo:
      
      - A few patches from Abel Vesa as preparation of adding audiomix clock
        support
      - A couple of cleanups from Anson Huang on clk-sscg-pll and clk-pllv3
        driver
      - Update imx7ulp clock driver to use imx_clk_hw_cpu() for making the
        change of ARM core clock easier
      - Drop dependency on ARM64 for i.MX8M clock driver, as there is a move
        to support aarch32 mode on aarch64 hardware
      - A series from Peng Fan to improve i.MX8M clock drivers, using
        composite clock for core and bus clk slice
      - Set a better parent clock for flexcan on i.MX6UL to support CiA102
        defined bit rates
      
      * tag 'clk-imx-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
        clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice
        clk: imx: add imx8m_clk_hw_composite_bus
        clk: imx: add mux ops for i.MX8M composite clk
        clk: imx8m: migrate A53 clk root to use composite core
        clk: imx8mp: use imx8m_clk_hw_composite_core to simplify code
        clk: imx8mp: Define gates for pll1/2 fixed dividers
        clk: imx: imx8mp: fix pll mux bit
        clk: imx8m: drop clk_hw_set_parent for A53
        dt-bindings: clocks: imx8mp: Add ids for audiomix clocks
        clk: imx: Add helpers for passing the device as argument
        clk: imx: pll14xx: Add the device as argument when registering
        clk: imx: gate2: Allow single bit gating clock
        clk: imx: clk-pllv3: Use readl_relaxed_poll_timeout() for PLL lock wait
        clk: imx: clk-sscg-pll: Remove unnecessary blank lines
        clk: imx: drop the dependency on ARM64 for i.MX8M
        clk: imx7ulp: make it easy to change ARM core clk
        clk: imx: imx6ul: change flexcan clock to support CiA bitrates
      5484bb83
  4. 21 May, 2020 5 commits