05 Mar, 2018

1 commit


25 Feb, 2018

3 commits

  • The device-tree node for the PMU clk controller assigns to its parent
    (i.e. PLL_PPLL) even though this clock currently is set up statically
    by an init-function.

    In order to avoid unexpected failures, a simple implementation of
    set_rate (which accepts requests, but notifies the caller of the
    preset frequency in its return value) and get_rate (which always
    returns the preset frequency) are added.

    Note that this is required for the RK808 PMIC to probe successfully on
    the RK3399-Q7, following the support for the assigned-clocks property.

    References: commit f4fcba5c5baa ("clk: implement clk_set_defaults()")
    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger

    Philipp Tomsich
     
  • Since commit ba1f96672522 ("net: designware: add clock support"), the
    designware GMAC driver enables all referenced clocks. While this is a
    no-op for the RK3368 during boot-up (reset behaviour has all the clock
    gates open anyway), we still need to handle the clock-ids passed in
    the enable op of the clock-driver and return a success.

    This change extends the RK3368 clk driver to:
    (a) provide a enable op
    (b) signals success to the caller when the clocks for the GMAC are
    enabled (no actual action is necessary as the gates are open
    after reset)

    References: commit ba1f96672522 ("net: designware: add clock support")
    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger

    Philipp Tomsich
     
  • Since commit ba1f96672522 ("net: designware: add clock support"), the
    designware GMAC driver enables all referenced clocks. While this is a
    no-op for the RK3399 during boot-up (reset behaviour has all the clock
    gates open anyway), we still need to handle the clock-ids passed in
    the enable op of the clock-driver and return a success.

    This change extends the enable-op of the rk3399 clk driver to signal
    success to the caller when the clocks for the GMAC are enabled.

    References: commit ba1f96672522 ("net: designware: add clock support")
    Signed-off-by: Philipp Tomsich
    Tested-by: Klaus Goger

    Philipp Tomsich
     

16 Feb, 2018

1 commit


30 Jan, 2018

1 commit

  • Since 'commit f4fcba5c5baa ("clk: implement clk_set_defaults()")'
    STM32F4 family board can't boot.

    Above patch calls clk_set_rate() for all nodes with assigned-clock-rates
    property. Clock driver for STM32F family doesn't implement .set_rate
    callback which make clk_set_defaults() exit on error and prevent board
    to boot.

    Fixes: f4fcba5c5baa ("clk: implement clk_set_defaults()")
    Signed-off-by: Patrice Chotard

    Patrice Chotard
     

29 Jan, 2018

11 commits

  • Tom Rini
     
  • The set_parent implementations do not make sense when OF_PLATDATA is
    enabled. We guard these against OF_PLATDATA and don't populate the
    set_parent-op when this is the case.

    Signed-off-by: Philipp Tomsich

    Philipp Tomsich
     
  • Implement the setting parent for gmac clock, and add internal
    pll div set for mac clk.

    Signed-off-by: David Wu
    Acked-by: Philipp Tomsich
    Reviewed-by: Philipp Tomsich

    David Wu
     
  • The RK3288 CRU-node assigns rates to a number of clocks that are not
    implemented in the RK3288 clock-driver (but which have been
    sufficiently initialised from rkclk_init()): for these clocks, we
    implement the gmac clock set parent, but simply ignore the
    others' set_rate() operation and return 0 to signal success.

    Signed-off-by: David Wu
    Acked-by: Philipp Tomsich
    Reviewed-by: Philipp Tomsich

    David Wu
     
  • Assuming mac_clk is fed by an external clock, set clk_rmii_src
    clock select control register from IO for rgmii interface.

    Signed-off-by: David Wu
    Acked-by: Philipp Tomsich
    Reviewed-by: Philipp Tomsich

    David Wu
     
  • The rk3328 soc has two gmac controllers, one is gmac2io,
    the other is gmac2phy. We use the gmac2io rgmii interface
    for 1000M phy here.

    Signed-off-by: David Wu
    Acked-by: Philipp Tomsich
    Reviewed-by: Philipp Tomsich

    David Wu
     
  • The RK3399 CRU-node assigns rates to a number of clocks that are not
    implemented in the RK3399 clock-driver (but which have been
    sufficiently initialised from rkclk_init()): for these clocks, we
    simply ignore the set_rate() operation and return 0 to signal success.

    Signed-off-by: Philipp Tomsich
    Tested-by: David Wu

    Series-changes: 2
    - Fixed David's email address.

    Philipp Tomsich
     
  • Linux uses the properties 'assigned-clocks', 'assigned-clock-parents'
    and 'assigned-clock-rates' to configure the clock subsystem for use
    with various peripheral nodes.

    This implements clk_set_defaults() and hooks it up with the general
    device probibin in drivers/core/device.c: when a new device is probed,
    clk_set_defaults() will be called for it and will process the
    properties mentioned above.

    Note that this functionality is designed to fail gracefully (i.e. if a
    clock-driver does not implement set_parent(), we simply accept this
    and ignore the error) as not to break existing board-support.

    Signed-off-by: Philipp Tomsich
    Tested-by: David Wu

    Series-changes: 2
    - Fixed David's email address.

    Series-version: 2

    Cover-letter:
    clk: support assigned-clock, assigned-clock-parents, assigned-clock-rates

    For various peripherals on Rockchip SoCs (e.g. for the Ethernet GMAC),
    the parent-clock needs to be set via the DTS. This adds the required
    plumbing and implements the GMAC case for the RK3399.
    END

    Philipp Tomsich
     
  • This implements the (newly added) set_parent() operation for the
    RK3399 with a focus on allowing the RGMII clock parent to be
    configured via the assigned-clock-parents property of the GMAC node.

    This implementation supports only the GMAC (in fact only the RGMII
    clock parent) and allows to set this clock's parent either to the
    internal SCLK_GMAC or to an external clock input (identifiable by it
    providing a 'clock-output-name' of "gmac_clkin").

    Signed-off-by: Philipp Tomsich
    Tested-by: David Wu

    Series-changes: 2
    - Fixed David's email address.

    Philipp Tomsich
     
  • The logic in clk_get_by_index() may be useful for other properties
    than 'clocks': e.g. 'assigned-clocks' and 'assigned-clock-parents'
    follows the same model.

    This commit refactors clk_get_by_index() by introducing an internal
    function clk_get_by_indexed_prop() that allows to specify the name
    of the property to process. The original clk_get_by_index() call
    is simply directed through this helper function with the property
    name fixed to "clocks".

    Signed-off-by: Philipp Tomsich
    Tested-by: David Wu

    Series-changes: 2
    - Fixed David's email address.

    Philipp Tomsich
     
  • Clocks may support multiple parents: this change introduces an
    optional operation on the clk-uclass to set a clock's parent.

    Signed-off-by: Philipp Tomsich
    Tested-by: David Wu

    Series-changes: 2
    - Fixed David's email address.

    Philipp Tomsich
     

28 Jan, 2018

5 commits


26 Jan, 2018

1 commit


25 Jan, 2018

13 commits


24 Jan, 2018

1 commit


22 Jan, 2018

3 commits