08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

24 Feb, 2020

2 commits

  • [ Upstream commit 9011f92622e5ef2d075f45e5fa818776d4feb8c0 ]

    Sometimes clk drivers are attached to devices which are children of a
    parent device that is connected to a node in DT. This happens when
    devices are MFD-ish and the parent device driver mostly registers child
    devices to match against drivers placed in their respective subsystem
    directories like drivers/clk, drivers/regulator, etc. When the clk
    driver calls clk_register() with a device pointer, that struct device
    pointer won't have a device_node associated with it because it was
    created purely in software as a way to partition logic to a subsystem.

    This causes problems for the way we find parent clks for the clks
    registered by these child devices because we look at the registering
    device's device_node pointer to lookup 'clocks' and 'clock-names'
    properties. Let's use the parent device's device_node pointer if the
    registering device doesn't have a device_node but the parent does. This
    simplifies clk registration code by avoiding the need to assign some
    device_node to the device registering the clk.

    Cc: Bjorn Andersson
    Reported-by: Niklas Cassel
    Signed-off-by: Stephen Boyd
    Link: https://lkml.kernel.org/r/20191230190455.141339-1-sboyd@kernel.org
    [sboyd@kernel.org: Fixup kernel-doc notation]
    Reviewed-by: Niklas Cassel
    Reviewed-by: Bjorn Andersson
    Tested-by: Bjorn Andersson
    Signed-off-by: Sasha Levin

    Stephen Boyd
     
  • [ Upstream commit f6fa75ca912be6021335de63a32aa4d295f3c524 ]

    __clk_init_parent() will call the .get_parent() callback of the clock
    so .init() must run before.

    Fixes: 541debae0adf ("clk: call the clock init() callback before any other ops callback")
    Signed-off-by: Jerome Brunet
    Link: https://lkml.kernel.org/r/20190924123954.31561-2-jbrunet@baylibre.com
    Signed-off-by: Stephen Boyd
    Signed-off-by: Sasha Levin

    Jerome Brunet
     

23 Jan, 2020

1 commit

  • commit 12ead77432f2ce32dea797742316d15c5800cb32 upstream.

    The following traceback is seen if a critical clock fails to prepare.

    bcm2835-clk 3f101000.cprman: plld: couldn't lock PLL
    ------------[ cut here ]------------
    Enabling unprepared plld_per
    WARNING: CPU: 1 PID: 1 at drivers/clk/clk.c:1014 clk_core_enable+0xcc/0x2c0
    ...
    Call trace:
    clk_core_enable+0xcc/0x2c0
    __clk_register+0x5c4/0x788
    devm_clk_hw_register+0x4c/0xb0
    bcm2835_register_pll_divider+0xc0/0x150
    bcm2835_clk_probe+0x134/0x1e8
    platform_drv_probe+0x50/0xa0
    really_probe+0xd4/0x308
    driver_probe_device+0x54/0xe8
    device_driver_attach+0x6c/0x78
    __driver_attach+0x54/0xd8
    ...

    Check return values from clk_core_prepare() and clk_core_enable() and
    bail out if any of those functions returns an error.

    Cc: Jerome Brunet
    Fixes: 99652a469df1 ("clk: migrate the count of orphaned clocks at init")
    Signed-off-by: Guenter Roeck
    Link: https://lkml.kernel.org/r/20191225163429.29694-1-linux@roeck-us.net
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     

18 Jan, 2020

1 commit

  • commit 8247470772beb38822f226c99a2ed8c195f6b438 upstream.

    Memory allocated in alloc_clk() for 'struct clk' and
    'const char *con_id' while invoking clk_register() is never freed
    in clk_unregister(), resulting in kmemleak showing the following
    backtrace.

    backtrace:
    [] kmem_cache_alloc+0x18c/0x270
    [] alloc_clk+0x30/0x70
    [] __clk_register+0xc8/0x760
    [] devm_clk_register+0x54/0xb0
    [] 0xffff800008c60950
    [] platform_drv_probe+0x50/0xa0
    [] really_probe+0x108/0x348
    [] driver_probe_device+0x58/0x100
    [] device_driver_attach+0x6c/0x90
    [] __driver_attach+0x84/0xc8
    [] bus_for_each_dev+0x74/0xc8
    [] driver_attach+0x20/0x28
    [] bus_add_driver+0x148/0x1f0
    [] driver_register+0x60/0x110
    [] __platform_driver_register+0x40/0x48
    [] 0xffff800008c66020

    Fix it here.

    Cc: Tomi Valkeinen
    Cc: Tero Kristo
    Signed-off-by: Kishon Vijay Abraham I
    Link: https://lkml.kernel.org/r/20191022071153.21118-1-kishon@ti.com
    Fixes: 1df4046a93e0 ("clk: Combine __clk_get() and __clk_create_clk()")
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Kishon Vijay Abraham I
     

12 Jan, 2020

2 commits

  • [ Upstream commit c771256ee7a03d3fb3c0443319ae6249c455849d ]

    A recent addition exposed a helper that is only used for CONFIG_OF. Move
    it into the CONFIG_OF zone in this file to make the compiler stop
    warning about an unused function.

    Fixes: 66d9506440bb ("clk: walk orphan list on clock provider registration")
    Signed-off-by: Olof Johansson
    Link: https://lkml.kernel.org/r/20191217082501.424892072D@mail.kernel.org
    [sboyd@kernel.org: "Simply" move the function instead]
    Signed-off-by: Stephen Boyd
    Signed-off-by: Sasha Levin

    Olof Johansson
     
  • [ Upstream commit 66d9506440bb05289eb4867059e7b8c6ed209717 ]

    So far, we walked the orphan list every time a new clock was registered
    in CCF. This was fine since the clocks were only referenced by name.

    Now that the clock can be referenced through DT, it is not enough:
    * Controller A register first a reference clocks from controller B
    through DT.
    * Controller B register all its clocks then register the provider.

    Each time controller B registers a new clock, the orphan list is walked
    but it can't match since the provider is registered yet. When the
    provider is finally registered, the orphan list is not walked unless
    another clock is registered afterward.

    This can lead to situation where some clocks remain orphaned even if
    the parent is available.

    Walking the orphan list on provider registration solves the problem.

    Reported-by: Jian Hu
    Fixes: fc0c209c147f ("clk: Allow parents to be specified without string names")
    Signed-off-by: Jerome Brunet
    Link: https://lkml.kernel.org/r/20191203080805.104628-1-jbrunet@baylibre.com
    Signed-off-by: Stephen Boyd
    Signed-off-by: Sasha Levin

    Jerome Brunet
     

25 Nov, 2019

1 commit

  • Implement a CLK_SET_PARENT_NOCACHE flag in clk core for imx8 clk
    implementation where the parent needs to be restore after PM domain is
    up.

    Reviewed-by: Anson Huang
    Signed-off-by: Dong Aisheng
    Signed-off-by: Ranjani Vaidyanathan
    (cherry picked from commit 87e997822c050fc7dc027a863c92f1f0b4816515)
    [Leonard: split clk core part]
    Signed-off-by: Leonard Crestez

    Ranjani Vaidyanathan
     

21 Sep, 2019

1 commit

  • Pull clk updates from Stephen Boyd:
    "We have a small collection of core framework updates this time, mostly
    around clk registration by clk providers and debugfs "nice to haves"
    for rate constraints. I'll highlight that we're now setting the
    clk_init_data pointer inside struct clk_hw to NULL during
    clk_register(), which may break some drivers that thought they could
    use that pointer during normal operations. That change has been
    sitting in next for a while now but maybe something is still broken.
    We'l see. Other than that the core framework changes aren't invasive
    and they're fixing bugs, simplifying, and making things better.

    On the clk driver side we got the usual addition of new SoC support,
    new features for existing drivers, and bug fixes scattered throughout.
    The biggest diffstat is the Amlogic driver that gained CPU clk support
    in addition to migrating to the new way of specifying clk parents.
    After that the Qualcomm, i.MX, Mediatek, and Rockchip clk drivers got
    support for various new SoCs and clock controllers from those vendors.

    Core:
    - Drop NULL checks in clk debugfs
    - Add min/max rates to clk debugfs
    - Set clk_init_data pointer inside clk_hw to NULL after registration
    - Make clk_bulk_get_all() return an 'id' corresponding to clock-names
    - Evict parents from parent cache when they're unregistered

    New Drivers:
    - Add clock driver for i.MX8MN SoCs
    - Support aspeed AST2600 SoCs
    - Support for Mediatek MT6779 SoCs
    - Support qcom SM8150 GCC and RPMh clks
    - Support qcom QCS404 WCSS clks
    - Add CPU clock support for Armada 7K/8K (specifically AP806 and AP807)
    - Addition of clock driver for Rockchip rk3308 SoCs

    Updates:
    - Add regulator support to the cdce925 clk driver
    - Add support for Raspberry Pi 4 bcm2711 SoCs
    - Add SDIO gate support to aspeed driver
    - Add missing of_node_put() calls in various clk drivers
    - Migrate Amlogic driver to new clock parent description method
    - Add DVFS support to Amlogic Meson g12
    - Add Amlogic Meson g12a reset support to the axg audio clock controller
    - Add sm1 support to the Amlogic Meson g12a clock controller
    - Switch i.MX8MM clock driver to platform driver
    - Add Hifi4 DSP related clocks for i.MX8QXP SoC
    - Fix Audio PLL setting and parent clock for USB
    - Misc i.MX8 clock driver improvements and corrections
    - Set floor ops for Qualcomm SD clks so that rounding works
    - Fix "always-on" Clock Domains on Renesas R-Car M1A, RZ/A1, RZ/A2, and RZ/N1
    - Enable the Allwinner V3 SoC and fix the i2s clock for H6"

    * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (137 commits)
    clk: Drop !clk checks in debugfs dumping
    clk: imx: imx8mn: fix pll mux bit
    clk: imx: imx8mm: fix pll mux bit
    clk: imx: clk-pll14xx: unbypass PLL by default
    clk: imx: pll14xx: avoid glitch when set rate
    clk: mvebu: ap80x: add AP807 clock support
    clk: mvebu: ap806: Prepare the introduction of AP807 clock support
    clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver
    clk: mvebu: ap806: be more explicit on what SaR is
    clk: mvebu: ap80x-cpu: add AP807 CPU clock support
    clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock
    dt-bindings: ap806: Document AP807 clock compatible
    dt-bindings: ap80x: Document AP807 CPU clock compatible
    clk: sprd: add missing kfree
    clk: at91: allow 24 Mhz clock as input for PLL
    clk: Make clk_bulk_get_all() return a valid "id"
    clk: actions: Fix factor clk struct member access
    clk: qcom: rcg: Return failure for RCG update
    clk: remove extra ---help--- tags in Kconfig
    clk: add include guard to clk-conf.h
    ...

    Linus Torvalds
     

20 Sep, 2019

4 commits

  • …k-actions' into clk-next

    - Add regulator support to the cdce925 clk driver
    - Add support for Raspberry Pi 4 bcm2711 SoCs
    - Evict parents from parent cache when they're unregistered

    * clk-cdce-regulator:
    clk: clk-cdce925: Add regulator support
    dt-bindings: clock: cdce925: Add regulator documentation

    * clk-bcm:
    clk: bcm2835: Mark PLLD_PER as CRITICAL
    clk: bcm2835: Add BCM2711_CLOCK_EMMC2 support
    clk: bcm2835: Introduce SoC specific clock registration
    dt-bindings: bcm2835-cprman: Add bcm2711 support

    * clk-evict-parent-cache:
    clk: Evict unregistered clks from parent caches

    * clk-actions:
    clk: actions: Fix factor clk struct member access

    Stephen Boyd
     
  • - Set clk_init_data pointer inside clk_hw to NULL after registration

    * clk-init-destroy:
    clk: Overwrite clk_hw::init with NULL during clk_register()
    clk: sunxi: Don't call clk_hw_get_name() on a hw that isn't registered
    clk: ti: Don't reference clk_init_data after registration
    clk: qcom: Remove error prints from DFS registration
    rtc: sun6i: Don't reference clk_init_data after registration
    clk: zx296718: Don't reference clk_init_data after registration
    clk: milbeaut: Don't reference clk_init_data after registration
    clk: socfpga: deindent code to proper indentation
    phy: ti: am654-serdes: Don't reference clk_init_data after registration
    clk: sprd: Don't reference clk_init_data after registration
    clk: socfpga: Don't reference clk_init_data after registration
    clk: sirf: Don't reference clk_init_data after registration
    clk: qcom: Don't reference clk_init_data after registration
    clk: meson: axg-audio: Don't reference clk_init_data after registration
    clk: lochnagar: Don't reference clk_init_data after registration
    clk: actions: Don't reference clk_init_data after registration

    * clk-doc:
    clk: remove extra ---help--- tags in Kconfig
    clk: add include guard to clk-conf.h
    clk: Document of_parse_clkspec() some more
    clk: Remove extraneous 'for' word in comments

    * clk-imx: (32 commits)
    clk: imx: imx8mn: fix pll mux bit
    clk: imx: imx8mm: fix pll mux bit
    clk: imx: clk-pll14xx: unbypass PLL by default
    clk: imx: pll14xx: avoid glitch when set rate
    clk: imx: imx8mn: fix audio pll setting
    clk: imx8mn: Add necessary frequency support for ARM PLL table
    clk: imx8mn: Add missing rate_count assignment for each PLL structure
    clk: imx8mn: fix int pll clk gate
    clk: imx8mn: Add GIC clock
    clk: imx8mn: Fix incorrect parents
    clk: imx8mm: Fix incorrect parents
    clk: imx8mq: Fix sys3 pll references
    clk: imx8mq: Unregister clks when of_clk_add_provider failed
    clk: imx8mm: Unregister clks when of_clk_add_provider failed
    clk: imx8mq: Mark AHB clock as critical
    clk: imx8mn: Keep uart clocks on for early console
    clk: imx: Remove unused function statement
    clk: imx7ulp: Make sure earlycon's clock is enabled
    clk: imx8mm: Switch to platform driver
    clk: imx: imx8mm: fix audio pll setting
    ...

    * clk-allwinner:
    clk: sunxi-ng: h6: Allow I2S to change parent rate
    clk: sunxi-ng: v3s: add Allwinner V3 support
    clk: sunxi-ng: v3s: add missing clock slices for MMC2 module clocks
    dt-bindings: clk: sunxi-ccu: add compatible string for V3 CCU
    clk: sunxi-ng: v3s: add the missing PLL_DDR1

    Stephen Boyd
     
  • - Support qcom SM8150 RPMh clks
    - Set floor ops for qcom sd clks
    - Support qcom QCS404 WCSS clks
    - Support for Mediatek MT6779 SoCs
    - Add CPU clock support for Armada 7K/8K (specifically AP806 and AP807)

    * clk-qcom:
    clk: qcom: rcg: Return failure for RCG update
    clk: qcom: fix QCS404 TuringCC regmap
    clk: qcom: clk-rpmh: Add support for SM8150
    dt-bindings: clock: Document SM8150 rpmh-clock compatible
    clk: qcom: clk-rpmh: Convert to parent data scheme
    dt-bindings: clock: Document the parent clocks
    clk: qcom: gcc: Use floor ops for SDCC clocks
    clk: qcom: gcc-qcs404: Use floor ops for sdcc clks
    clk: qcom: gcc-sdm845: Use floor ops for sdcc clks
    clk: qcom: define probe by index API as common API
    clk: qcom: Add WCSS gcc clock control for QCS404
    clk: qcom: msm8916: Don't build by default
    clk: qcom: gcc: Add global clock controller driver for SM8150
    dt-bindings: clock: Document gcc bindings for SM8150
    clk: qcom: clk-alpha-pll: Add support for Trion PLLs
    clk: qcom: clk-alpha-pll: Remove post_div_table checks
    clk: qcom: clk-alpha-pll: Remove unnecessary cast

    * clk-mtk:
    clk: mediatek: Runtime PM support for MT8183 mcucfg clock provider
    clk: mediatek: Register clock gate with device
    clk: mediatek: add pericfg clocks for MT8183
    dt-bindings: clock: mediatek: add pericfg for MT8183
    clk: mediatek: Add MT6779 clock support
    clk: mediatek: Add dt-bindings for MT6779 clocks
    dt-bindings: mediatek: bindings for MT6779 clk
    clk: reset: Modify reset-controller driver

    * clk-armada:
    clk: mvebu: ap80x: add AP807 clock support
    clk: mvebu: ap806: Prepare the introduction of AP807 clock support
    clk: mvebu: ap806: add AP-DCLK (hclk) to system controller driver
    clk: mvebu: ap806: be more explicit on what SaR is
    clk: mvebu: ap80x-cpu: add AP807 CPU clock support
    clk: mvebu: ap806-cpu: prepare mapping of AP807 CPU clock
    dt-bindings: ap806: Document AP807 clock compatible
    dt-bindings: ap80x: Document AP807 CPU clock compatible
    clk: mvebu: ap806: Fix clock name for the cluster
    clk: mvebu: add CPU clock driver for Armada 7K/8K
    clk: mvebu: add helper file for Armada AP and CP clocks
    dt-bindings: ap806: add the cluster clock node in the syscon file

    * clk-ingenic:
    clk: ingenic: Use CLK_OF_DECLARE_DRIVER macro
    clk: ingenic/jz4740: Fix "pll half" divider not read/written properly

    * clk-meson: (23 commits)
    clk: meson: g12a: add support for SM1 CPU 1, 2 & 3 clocks
    clk: meson: g12a: add support for SM1 DynamIQ Shared Unit clock
    clk: meson: g12a: add support for SM1 GP1 PLL
    dt-bindings: clk: meson: add sm1 periph clock controller bindings
    clk: meson: axg-audio: add g12a reset support
    dt-bindings: clock: meson: add resets to the audio clock controller
    clk: meson: g12a: expose CPUB clock ID for G12B
    clk: meson: g12a: add notifiers to handle cpu clock change
    clk: meson: add g12a cpu dynamic divider driver
    clk: core: introduce clk_hw_set_parent()
    clk: meson: remove clk input helper
    clk: meson: remove ee input bypass clocks
    clk: meson: clk-regmap: migrate to new parent description method
    clk: meson: meson8b: migrate to the new parent description method
    clk: meson: axg: migrate to the new parent description method
    clk: meson: gxbb: migrate to the new parent description method
    clk: meson: g12a: migrate to the new parent description method
    clk: meson: remove ao input bypass clocks
    clk: meson: axg-aoclk: migrate to the new parent description method
    clk: meson: gxbb-aoclk: migrate to the new parent description method
    ...

    Stephen Boyd
     
  • These recursive functions have checks for !clk being passed in, but the
    callers are always looping through lists and therefore the pointers
    can't be NULL. Drop the checks to simplify the code.

    Signed-off-by: Stephen Boyd
    Link: https://lkml.kernel.org/r/20190826234729.145593-1-sboyd@kernel.org

    Stephen Boyd
     

18 Sep, 2019

1 commit

  • We leave a dangling pointer in each clk_core::parents array that has an
    unregistered clk as a potential parent when that clk_core pointer is
    freed by clk{_hw}_unregister(). It is impossible for the true parent of
    a clk to be set with clk_set_parent() once the dangling pointer is left
    in the cache because we compare parent pointers in
    clk_fetch_parent_index() instead of checking for a matching clk name or
    clk_hw pointer.

    Before commit ede77858473a ("clk: Remove global clk traversal on fetch
    parent index"), we would check clk_hw pointers, which has a higher
    chance of being the same between registration and unregistration, but it
    can still be allocated and freed by the clk provider. In fact, this has
    been a long standing problem since commit da0f0b2c3ad2 ("clk: Correct
    lookup logic in clk_fetch_parent_index()") where we stopped trying to
    compare clk names and skipped over entries in the cache that weren't
    NULL.

    There are good (performance) reasons to not do the global tree lookup in
    cases where the cache holds dangling pointers to parents that have been
    unregistered. Let's take the performance hit on the uncommon
    registration path instead. Loop through all the clk_core::parents arrays
    when a clk is unregistered and set the entry to NULL when the parent
    cache entry and clk being unregistered are the same pointer. This will
    fix this problem and avoid the overhead for the "normal" case.

    Based on a patch by Bjorn Andersson.

    Fixes: da0f0b2c3ad2 ("clk: Correct lookup logic in clk_fetch_parent_index()")
    Reviewed-by: Bjorn Andersson
    Tested-by: Sai Prakash Ranjan
    Signed-off-by: Stephen Boyd
    Link: https://lkml.kernel.org/r/20190828181959.204401-1-sboyd@kernel.org

    Stephen Boyd
     

17 Sep, 2019

1 commit

  • Pull ARM DT updates from Arnd Bergmann:
    "This is another huge branch with close to 450 changessets related to
    devicetree files, roughly half of this for 32-bit and 64-bit
    respectively. There are lots of cleanups and additional hardware
    support for platforms we already support based on SoCs from Renesas,
    ST-Microelectronics, Intel/Altera, Rockchips, Allwinner, Broadcom and
    other manufacturers.

    A total of 6 new SoCs and 37 new boards gets added this time, one more
    SoC will come in a follow-up branch. Most of the new boards are for
    64-bit ARM SoCs, the others are typically for the 32-bit Cortex-A7.

    Going more into details for SoC platforms with new hardware support:

    - The Snapdragon 855 (SM8150) is Qualcomm's current high-end phone
    platform, usually paired with an external 5G modem. So far we only
    support the Qualcomm SM8150 MTP reference platform, but no actual
    products.

    - For the slightly older Qualcomm platforms, support for several
    interesting products is getting added: Three laptops based on
    Snapdragon 835/MSM8998 (Asus NovaGo, HP Envy X2 and Lenovo Miix
    630), one laptop based on Snapdragon 850/sdm850 (Lenovo Yoga C630)
    and several phones based on the older Snapdragon 410/MSM8916
    (Samsung A3 and A5, Longcheer L8150 aka Android One 2nd gen "seed"
    aka Wileyfox Swift).

    - Mediatek MT7629 is a new wireless network router chip, similar to
    the older MT7623. It gets added together with the reference board
    implementation.

    - Allwinner V3 is a repackaged version of the existing low-end V3s
    chip, and is used in the tiny Lichee Pi Zero plus, also added here.
    There is also a new TV set-top box based on Allwinner H6, the Tanix
    TX6, and the eMMC variant of the Olimex A64-Olinuxino development
    board.

    - NXP i.MX8M Nano is a new member of the ever-expanding i.MX SoC
    family, similar to the i.MX8M Mini. As usual, there is a large
    number of new boards for i.MX SoCs: Einfochips i.MX8QXP AI_ML,
    SolidRun Hummingboard Pulse baseboard and System-on-Module,
    Boundary Devices i.MX8MQ Nitrogen8M, and TechNexion
    PICO-PI-IMX8M-DEV for the 64-bit i.MX8 line. For 32-bit, we get the
    Kontron i.MX6UL N6310 SoM with two baseboards, the PHYTEC
    phyBOARD-Segin SoM with three baseboards, and the Zodiac Inflight
    Innovations i.MX7 RMU2 board.

    - In a different NXP product line, the Layerscape LS1046A "Freeway"
    reference board gets added.

    - Amlogic SM1 (S905X3) and G12B (S922X, A311D) are updated chips from
    their set-top-box line and smart speaker with newer CPU and GPU
    cores compared to their predecessors. Both are now also supported
    by the Khadas VIM3 development board series, and the dts files for
    that get reorganized a bit to better deal with all variants.
    Another board based on SM1 that gets added is the SEI Robotics
    SEI610.

    - There are a handful of new x86 and Power9 server boards using
    Aspeed BMC chips that are gaining support for running Linux on the
    BMC through the OpenBMC project: Facebook
    Minipack/Wedge100/Wedge40, Lenovo Hr855xg2, and Mihawk. Notably
    these are still new machines using SoCs based on the ARM9 and ARM11
    CPU cores, as support for the new Cortex-A7 based AST2600 is still
    ramping up.

    - There are three new end-user products using 32-bit Rockchips SoCs:
    Mecer Xtreme Mini S6 is an Android "mini PC" box based on the
    low-end RK3229 chip, while the two AOpen products Chromebox Mini
    (Fievel) and Chromebase Mini (Tiger) run ChromeOS and are meant for
    commercial settings(digital signage, PoS, ...).

    - One more single-board computer based on the popular 64-bit RK3399
    is added: the Leez RK3399 P710"

    * tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (467 commits)
    arm64: dts: qcom: Add Lenovo Yoga C630
    ARM: dts: aspeed-g5: Fixe gpio-ranges upper limit
    ARM; dts: aspeed: mihawk: File should not be executable
    ARM: dts: aspeed: swift: Change power supplies to version 2
    ARM: dts: aspeed: vesnin: Add secondary SPI flash chip
    ARM: dts: aspeed: vesnin: Add wdt2 with alt-boot option
    ARM: dts: aspeed-g4: Add all flash chips
    ARM: dts: exynos: Enable GPU/Mali T604 on Arndale board
    ARM: dts: exynos: Enable GPU/Mali T604 on Chromebook Snow
    ARM: dts: exynos: Add GPU/Mali T604 node to Exynos5250
    ARM: dts: exynos: Fix min/max buck4 for GPU on Arndale board
    ARM: dts: exynos: Mark LDO10 as always-on on Peach Pit/Pi Chromebooks
    ARM: dts: exynos: Remove not accurate secondary ADC compatible
    arm64: dts: rockchip: limit clock rate of MMC controllers for RK3328
    arm64: dts: meson-sm1-sei610: add stdout-path property back
    arm64: dts: meson-sm1-sei610: enable DVFS
    arm64: dts: khadas-vim3: add support for the SM1 based VIM3L
    dt-bindings: arm: amlogic: add Amlogic SM1 based Khadas VIM3L bindings
    arm64: dts: khadas-vim3: move common nodes into meson-khadas-vim3.dtsi
    arm64: dts: meson: g12a: add reset to tdm formatters
    ...

    Linus Torvalds
     

06 Sep, 2019

1 commit

  • The return value of of_parse_clkspec() is peculiar. If the function is
    called with a NULL argument for 'name' it will return -ENOENT, but if
    it's called with a non-NULL argument for 'name' it will return -EINVAL.
    This peculiarity is documented by commit 5c56dfe63b6e ("clk: Add comment
    about __of_clk_get_by_name() error values").

    Let's further document this function so that it's clear what the return
    value is and how to use the arguments to parse clk specifiers.

    Cc: Phil Edworthy
    Signed-off-by: Stephen Boyd
    Link: https://lkml.kernel.org/r/20190826212042.48642-1-sboyd@kernel.org
    Reviewed-by: Phil Edworthy

    Stephen Boyd
     

18 Aug, 2019

1 commit

  • An extra 'for' word is grammatically incorrect in the comment
    'verifying ops for multi-parent clks'. This commit removes
    this extra for word.

    Signed-off-by: Rishi Gupta
    Link: https://lkml.kernel.org/r/1566023759-7880-1-git-send-email-gupt21@gmail.com
    Signed-off-by: Stephen Boyd

    Rishi Gupta
     

17 Aug, 2019

3 commits

  • Don't compare the parent clock name with a NULL name in the
    clk_parent_map. This prevents a kernel crash when passing NULL
    core->parents[i].name to strcmp().

    An example which triggered this is a mux clock with four parents when
    each of them is referenced in the clock driver using
    clk_parent_data.fw_name and then calling clk_set_parent(clk, 3rd_parent)
    on this mux.
    In this case the first parent is also the HW default so
    core->parents[i].hw is populated when the clock is registered. Calling
    clk_set_parent(clk, 3rd_parent) will then go through all parents and
    skip the first parent because it's hw pointer doesn't match. For the
    second parent no hw pointer is cached yet and clk_core_get(core, 1)
    returns a non-matching pointer (which is correct because we are comparing
    the second with the third parent). Comparing the result of
    clk_core_get(core, 2) with the requested parent gives a match. However
    we don't reach this point because right after the clk_core_get(core, 1)
    mismatch the old code tried to !strcmp(parent->name, NULL) (where the
    second argument is actually core->parents[i].name, but that was never
    populated by the clock driver).

    Signed-off-by: Martin Blumenstingl
    Link: https://lkml.kernel.org/r/20190815223155.21384-1-martin.blumenstingl@googlemail.com
    Fixes: fc0c209c147f ("clk: Allow parents to be specified without string names")
    Signed-off-by: Stephen Boyd

    Martin Blumenstingl
     
  • Calls to clk_core_get() will return ERR_PTR(-EINVAL) if we've started
    migrating a clk driver to use the DT based style of specifying parents
    but we haven't made any DT updates yet. This happens when we pass a
    non-NULL value as the 'name' argument of of_parse_clkspec(). That
    function returns -EINVAL in such a situation, instead of -ENOENT like we
    expected. The return value comes back up to clk_core_fill_parent_index()
    which proceeds to skip calling clk_core_lookup() because the error
    pointer isn't equal to -ENOENT, it's -EINVAL.

    Furthermore, we blindly overwrite the error pointer returned by
    clk_core_get() with NULL when there isn't a legacy .name member
    specified in the parent map. This isn't too bad right now because we
    don't really care to differentiate NULL from an error, but in the future
    we should only try to do a legacy lookup if we know we might find
    something. This way DT lookups that fail don't try to lookup based on
    strings when there isn't any string to match, hiding the error from DT
    parsing.

    Fix both these problems so that clk provider drivers can use the new
    style of parent mapping without having to also update their DT at the
    same time. This patch is based on an earlier patch from Taniya Das which
    checked for -EINVAL in addition to -ENOENT return values from
    clk_core_get().

    Fixes: 601b6e93304a ("clk: Allow parents to be specified via clkspec index")
    Cc: Taniya Das
    Cc: Jerome Brunet
    Cc: Chen-Yu Tsai
    Reported-by: Taniya Das
    Signed-off-by: Stephen Boyd
    Link: https://lkml.kernel.org/r/20190813214147.34394-1-sboyd@kernel.org
    Tested-by: Taniya Das

    Stephen Boyd
     
  • We don't want clk provider drivers to use the init structure after clk
    registration time, but we leave a dangling reference to it by means of
    clk_hw::init. Let's overwrite the member with NULL during clk_register()
    so that this can't be used anymore after registration time.

    Cc: Bjorn Andersson
    Cc: Doug Anderson
    Signed-off-by: Stephen Boyd
    Link: https://lkml.kernel.org/r/20190731193517.237136-10-sboyd@kernel.org
    Reviewed-by: Sylwester Nawrocki

    Stephen Boyd
     

09 Aug, 2019

1 commit

  • Introduce the clk_hw_set_parent() provider call to change parent of
    a clock by using the clk_hw pointers.

    This eases the clock reparenting from clock rate notifiers and
    implementing DVFS with simpler code avoiding the boilerplates
    functions as __clk_lookup(clk_hw_get_name()) then clk_set_parent().

    Signed-off-by: Neil Armstrong
    Acked-by: Martin Blumenstingl
    Acked-by: Stephen Boyd
    Signed-off-by: Jerome Brunet

    Neil Armstrong
     

08 Aug, 2019

3 commits

  • A string which did not contain a data format specification should be put
    into a sequence. Thus use the corresponding function “seq_puts”.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Signed-off-by: Stephen Boyd

    Markus Elfring
     
  • This function iterates the clk consumer list on clk_core so it must be
    called under prepare_lock. This is already done by all callers but add a
    lockdep assert to check anyway.

    Signed-off-by: Leonard Crestez
    Link: https://lkml.kernel.org/r/29453ee8e820457d87a8faf9d496390e59c6826f.1562073871.git.leonard.crestez@nxp.com
    Signed-off-by: Stephen Boyd

    Leonard Crestez
     
  • Add two files to expose min/max clk rates as determined by
    clk_core_get_boundaries, taking all consumer requests into account.

    This information does not appear to be otherwise exposed to userspace.

    Signed-off-by: Leonard Crestez
    Link: https://lkml.kernel.org/r/68e96af2df96512300604d797ade2088d7e6e496.1562073871.git.leonard.crestez@nxp.com
    [sboyd@kernel.org: Drop if statements for JSON printing]
    Signed-off-by: Stephen Boyd

    Leonard Crestez
     

18 Jul, 2019

1 commit

  • Pull clk updates from Stephen Boyd:
    "This round of clk driver and framework updates is heavy on the driver
    update side. The two main highlights in the core framework are the
    addition of an bulk clk_get API that handles optional clks and an
    extra debugfs file that tells the developer about the current parent
    of a clk.

    The driver updates are dominated by i.MX in the diffstat, but that is
    mostly because that SoC has started converting to the clk_hw style of
    clk registration. The next big update is in the Amlogic meson clk
    driver that gained some support for audio, cpu, and temperature clks
    while fixing some PLL issues. Finally, the biggest thing that stands
    out is the conversion of a large part of the Allwinner sunxi-ng driver
    to the new clk parent scheme that uses less strings and more pointer
    comparisons to match clk parents and children up.

    In general, it looks like we have a lot of little fixes and tweaks
    here and there to clk data along with the normal addition of a handful
    of new drivers and a couple new core framework features.

    Core:
    - Add a 'clk_parent' file in clk debugfs
    - Add a clk_bulk_get_optional() API (with devm too)

    New Drivers:
    - Support gated clk controller on MIPS based BCM63XX SoCs
    - Support SiLabs Si5341 and Si5340 chips
    - Support for CPU clks on Raspberry Pi devices
    - Audsys clock driver for MediaTek MT8516 SoCs

    Updates:
    - Convert a large portion of the Allwinner sunxi-ng driver to new clk parent scheme
    - Small frequency support for SiLabs Si544 chips
    - Slow clk support for AT91 SAM9X60 SoCs
    - Remove dead code in various clk drivers (-Wunused)
    - Support for Marvell 98DX1135 SoCs
    - Get duty cycle of generic pwm clks
    - Improvement in mmc phase calculation and cleanup of some rate defintions
    - Switch i.MX6 and i.MX7 clock drivers to clk_hw based APIs
    - Add GPIO, SNVS and GIC clocks for i.MX8 drivers
    - Mark imx6sx/ul/ull/sll MMDC_P1_IPG and imx8mm DRAM_APB as critical clock
    - Correct imx7ulp nic1_bus_clk and imx8mm audio_pll2_clk clock setting
    - Add clks for new Exynos5422 Dynamic Memory Controller driver
    - Clock definition for Exynos4412 Mali
    - Add CMM (Color Management Module) clocks on Renesas R-Car H3, M3-N, E3, and D3
    - Add TPU (Timer Pulse Unit / PWM) clocks on Renesas RZ/G2M
    - Support for 32 bit clock IDs in TI's sci-clks for J721e SoCs
    - TI clock probing done from DT by default instead of firmware
    - Fix Amlogic Meson mpll fractional part and spread sprectrum issues
    - Add Amlogic meson8 audio clocks
    - Add Amlogic g12a temperature sensors clocks
    - Add Amlogic g12a and g12b cpu clocks
    - Add TPU (Timer Pulse Unit / PWM) clocks on Renesas R-Car H3, M3-W, and M3-N
    - Add CMM (Color Management Module) clocks on Renesas R-Car M3-W
    - Add Clock Domain support on Renesas RZ/N1"

    * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (190 commits)
    clk: consoldiate the __clk_get_hw() declarations
    clk: sprd: Add check for return value of sprd_clk_regmap_init()
    clk: lochnagar: Update DT binding doc to include the primary SPDIF MCLK
    clk: Add Si5341/Si5340 driver
    dt-bindings: clock: Add silabs,si5341
    clk: clk-si544: Implement small frequency change support
    clk: add BCM63XX gated clock controller driver
    devicetree: document the BCM63XX gated clock bindings
    clk: at91: sckc: use dedicated functions to unregister clock
    clk: at91: sckc: improve error path for sama5d4 sck registration
    clk: at91: sckc: remove unnecessary line
    clk: at91: sckc: improve error path for sam9x5 sck register
    clk: at91: sckc: add support to free slow clock osclillator
    clk: at91: sckc: add support to free slow rc oscillator
    clk: at91: sckc: add support to free slow oscillator
    clk: rockchip: export HDMIPHY clock on rk3228
    clk: rockchip: add watchdog pclk on rk3328
    clk: rockchip: add clock id for hdmi_phy special clock on rk3228
    clk: rockchip: add clock id for watchdog pclk on rk3328
    clk: at91: sckc: add support for SAM9X60
    ...

    Linus Torvalds
     

13 Jul, 2019

3 commits

  • …prd' and 'clk-at91' into clk-next

    - Support for CPU clks on Raspberry Pi devices
    - Slow clk support for AT91 SAM9X60 SoCs

    * clk-rpi-cpufreq:
    clk: raspberrypi: register platform device for raspberrypi-cpufreq
    firmware: raspberrypi: register clk device
    clk: bcm283x: add driver interfacing with Raspberry Pi's firmware
    clk: bcm2835: remove pllb

    * clk-tegra:
    clk: tegra: Do not enable PLL_RE_VCO on Tegra210
    clk: tegra: Warn if an enabled PLL is in IDDQ
    clk: tegra: Do not warn unnecessarily
    clk: tegra210: fix PLLU and PLLU_OUT1

    * clk-simplify-provider.h:
    clk: consoldiate the __clk_get_hw() declarations
    clk: Unexport __clk_of_table
    clk: Remove ifdef for COMMON_CLK in clk-provider.h

    * clk-sprd:
    clk: sprd: Add check for return value of sprd_clk_regmap_init()
    clk: sprd: Check error only for devm_regmap_init_mmio()
    clk: sprd: Switch from of_iomap() to devm_ioremap_resource()

    * clk-at91:
    clk: at91: sckc: use dedicated functions to unregister clock
    clk: at91: sckc: improve error path for sama5d4 sck registration
    clk: at91: sckc: remove unnecessary line
    clk: at91: sckc: improve error path for sam9x5 sck register
    clk: at91: sckc: add support to free slow clock osclillator
    clk: at91: sckc: add support to free slow rc oscillator
    clk: at91: sckc: add support to free slow oscillator
    clk: at91: sckc: add support for SAM9X60
    dt-bindings: clk: at91: add bindings for SAM9X60's slow clock controller
    clk: at91: sckc: add support to specify registers bit offsets
    clk: at91: sckc: sama5d4 has no bypass support

    Stephen Boyd
     
  • - Add a 'clk_parent' file in clk debugfs
    - Remove dead code in various clk drivers

    * clk-debugfs:
    clk: Add clk_parent entry in debugfs

    * clk-unused:
    clk: qcom: Fix -Wunused-const-variable
    clk: mmp: frac: Remove set but not used variable 'prev_rate'
    clk: ti: Remove unused functions
    clk: mediatek: mt8516: Remove unused variable

    * clk-refactor:
    clk: clk-cdce706: simplify getting the adapter of a client
    clk: Simplify clk_core_can_round()

    * clk-qoriq:
    clk: qoriq: add support for lx2160a

    Stephen Boyd
     
  • - Add a clk_bulk_get_optional() API (with devm too)
    - Support for Marvell 98DX1135 SoCs

    * clk-bulk-optional:
    clk: Document some devm_clk_bulk*() APIs
    clk: Add devm_clk_bulk_get_optional() function
    clk: Add clk_bulk_get_optional() function

    * clk-kirkwood:
    clk: kirkwood: Add support for MV98DX1135
    dt-bindings: clock: mvebu: Add compatible string for 98dx1135 core clock

    * clk-socfpga:
    clk: socfpga: stratix10: fix divider entry for the emac clocks
    clk: socfpga: stratix10: add additional clocks needed for the NAND IP

    * clk-docs:
    clk: Grammar missing "and", Spelling s/statisfied/satisfied/

    Stephen Boyd
     

26 Jun, 2019

4 commits


18 Jun, 2019

1 commit

  • Following the commit fc0c209c147f ("clk: Allow parents to be specified
    without string names"), the parent name string is not always populated.

    Instead, fetch the parents clk_core struct using the appropriate helper,
    and read its name directly. If that fails, go through the possible
    sources of parent names. The order in which they are used is different
    from how parents are looked up, with the global name having precedence
    over local fw_name and indices. This makes more sense as a) the
    parent_maps structure does not differentiate between legacy global names
    and fallback global names, and b) global names likely provide more
    information than local fw_names.

    Fixes: fc0c209c147f ("clk: Allow parents to be specified without string names")
    Signed-off-by: Chen-Yu Tsai

    Chen-Yu Tsai
     

17 Jun, 2019

1 commit

  • We want to allow the parent lookup to happen even if the index is some
    value less than 0. This may be the case if a clk provider only specifies
    the .name member to match a string in the "clock-names" DT property. We
    shouldn't require that the index be >= 0 to make this use case work.

    Fixes: 601b6e93304a ("clk: Allow parents to be specified via clkspec index")
    Reported-by: Alexandre Mergnat
    Cc: Jerome Brunet
    Cc: Chen-Yu Tsai
    Reviewed-by: Chen-Yu Tsai
    Signed-off-by: Stephen Boyd

    Stephen Boyd
     

24 May, 2019

1 commit

  • This symbol doesn't need to be exported to clk providers anymore.
    Originally, it was hidden inside clk.c, but then OMAP needed to get
    access to it in commit 819b4861c18d ("CLK: ti: add init support for
    clock IP blocks"), but eventually that code also changed in commit
    c08ee14cc663 ("clk: ti: change clock init to use generic of_clk_init")
    and we were left with this exported. Move this back into clk.c so that
    it isn't exposed anymore.

    Signed-off-by: Stephen Boyd

    Stephen Boyd
     

08 May, 2019

3 commits

  • - Rewrite how clk parents can be specified to be DT/clkdev based instead
    of just string based

    * clk-parent-rewrite-1:
    clk: Cache core in clk_fetch_parent_index() without names
    clk: fixed-factor: Initialize clk_init_data on stack
    clk: fixed-factor: Let clk framework find parent
    clk: Allow parents to be specified via clkspec index
    clk: Look for parents with clkdev based clk_lookups
    clk: Allow parents to be specified without string names
    clk: Add of_clk_hw_register() API for early clk drivers
    driver core: Let dev_of_node() accept a NULL dev
    clk: Prepare for clk registration API that uses DT nodes
    clkdev: Move clk creation outside of 'clocks_mutex'

    Stephen Boyd
     
  • * clk-ti:
    clk: Remove CLK_IS_BASIC clk flag
    clk: ti: dra7: disable the RNG and TIMER12 clkctrl clocks on HS devices
    clk: ti: dra7x: prevent non-existing clkctrl clocks from registering
    ARM: omap2+: hwmod: drop CLK_IS_BASIC flag usage
    clk: ti: export the omap2_clk_is_hw_omap call

    Stephen Boyd
     
  • - Remove clk_readl() and introduce BE versions of basic clk types

    * clk-doc:
    clk: Drop duplicate clk_register() documentation
    clk: Document and simplify clk_core_get_rate_nolock()
    clk: Remove 'flags' member of struct clk_fixed_rate
    clk: nxp: Drop 'flags' on fixed_rate clk macro
    clk: Document __clk_mux_determine_rate()
    clk: Document CLK_MUX_READ_ONLY mux flag
    clk: Document deprecated things
    clk: Collapse gpio clk kerneldoc

    * clk-more-critical:
    clk: highbank: Convert to CLK_IS_CRITICAL

    * clk-meson: (21 commits)
    clk: meson: axg-audio: add g12a support
    clk: meson: axg-audio: don't register inputs in the onecell data
    clk: meson: axg_audio: replace prefix axg by aud
    dt-bindings: clk: axg-audio: add g12a support
    clk: meson: meson8b: add the video decoder clock trees
    clk: meson: meson8b: add the VPU clock trees
    clk: meson: meson8b: add support for the GP_PLL clock on Meson8m2
    clk: meson: meson8b: use a separate clock table for Meson8m2
    dt-bindings: clock: meson8b: export the video decoder clocks
    clk: meson-g12a: add video decoder clocks
    dt-bindings: clock: meson8b: export the VPU clock
    clk: meson-g12a: add PCIE PLL clocks
    dt-bindings: clock: g12a-aoclk: expose CLKID_AO_CTS_OSCIN
    clk: meson-pll: add reduced specific clk_ops for G12A PCIe PLL
    dt-bindings: clock: meson8b: drop the "ABP" clock definition
    clk: meson: g12a: add cpu clocks
    dt-bindings: clk: g12a-clkc: add VDEC clock IDs
    dt-bindings: clock: axg-audio: unexpose controller inputs
    dt-bindings: clk: g12a-clkc: add PCIE PLL clock ID
    clk: g12a-aoclk: re-export CLKID_AO_SAR_ADC_SEL clock id
    ...

    * clk-basic-be:
    clk: core: replace clk_{readl,writel} with {readl,writel}
    clk: core: remove powerpc special handling
    powerpc/512x: mark clocks as big endian
    clk: mux: add explicit big endian support
    clk: multiplier: add explicit big endian support
    clk: gate: add explicit big endian support
    clk: fractional-divider: add explicit big endian support
    clk: divider: add explicit big endian support

    Stephen Boyd
     

04 May, 2019

1 commit

  • If a clk has specified parents via clk_hw pointers it won't specify the
    globally unique names for the parents. Without the unique names, we
    can't fallback to comparing them against the name of the 'parent'
    pointer here. Therefore, do a pointer comparison against the clk_hw
    pointers too and cache the clk_core structure if they match. This fixes
    parent lookup code for clks that only specify clk_hw pointers and
    nothing else, like muxes that are purely inside a clk controller.

    Similarly, if the parent pointer isn't cached after trying to match
    clk_core or clk_hw pointers, lookup the pointer from DT or via clkdev
    lookups instead of relying purely on the globally unique clk name match.
    This should allow us to move away from having to specify global names
    for clk parents entirely.

    While we're in the area, add some comments so it's clearer what's going
    on. The if statements don't lend themselves to much clarity in their raw
    form.

    Fixes: fc0c209c147f ("clk: Allow parents to be specified without string names")
    Reported-by: Charles Keepax
    Signed-off-by: Stephen Boyd

    Stephen Boyd
     

27 Apr, 2019

1 commit

  • This flag was historically used to indicate that a clk is a "basic" type
    of clk like a mux, divider, gate, etc. This never turned out to be very
    useful though because it was hard to cleanly split "basic" clks from
    other clks in a system. This one flag was a way for type introspection
    and it just didn't scale. If anything, it was used by the TI clk driver
    to indicate that a clk_hw wasn't contained in the SoC specific clk
    structure. We can get rid of this define now that TI is finding those
    clks a different way.

    Cc: Tero Kristo
    Cc: Ralf Baechle
    Cc: Paul Burton
    Cc: James Hogan
    Cc:
    Cc: Thierry Reding
    Cc: Kevin Hilman
    Cc:
    Cc:
    Acked-by: Thierry Reding
    Signed-off-by: Stephen Boyd

    Stephen Boyd