Commit graph

28 commits

Author SHA1 Message Date
Lukas Bulwahn
cbfa6f33e3 clk: staging: correct reference to config IOMEM to config HAS_IOMEM
Commit 0a0a66c984 ("clk: staging: Specify IOMEM dependency for Xilinx
Clocking Wizard driver") introduces a dependency on the non-existing config
IOMEM, which basically makes it impossible to include this driver into any
build. Fortunately, ./scripts/checkkconfigsymbols.py warns:

IOMEM
Referencing files: drivers/staging/clocking-wizard/Kconfig

The config for IOMEM support is called HAS_IOMEM. Correct this reference to
the intended config.

Fixes: 0a0a66c984 ("clk: staging: Specify IOMEM dependency for Xilinx Clocking Wizard driver")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20210817105404.13146-1-lukas.bulwahn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-17 20:03:00 +02:00
Shubhrajyoti Datta
a0d1a3864c staging: clocking-wizard: Remove the hardcoding of the clock outputs
The number of output clocks are configurable in the hardware.
Currently the driver registers the maximum number of outputs.
Fix the same by registering only the outputs that are there.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1614172241-17326-8-git-send-email-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:30 +01:00
Shubhrajyoti Datta
91d695d718 staging: clocking-wizard: Add support for fractional support
Currently the set rate granularity is to integral divisors.
Add support for the fractional divisors.
Only the first output0 is fractional in the hardware.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1614172241-17326-7-git-send-email-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:30 +01:00
Shubhrajyoti Datta
5a853722eb staging: clocking-wizard: Add support for dynamic reconfiguration
The patch adds support for dynamic reconfiguration of clock output rate.
Output clocks are registered as dividers and set rate callback function
is used for dynamic reconfiguration.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Co-developed-by: Chirag Parekh <chirag.parekh@xilinx.com>
Link: https://lore.kernel.org/r/1614172241-17326-6-git-send-email-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:30 +01:00
Shubhrajyoti Datta
92a7590427 staging: clocking-wizard: Allow changing of parent rate for single output
If there is only one output then allow changing of the parent rate.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1614172241-17326-5-git-send-email-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:30 +01:00
Shubhrajyoti Datta
87a40bfb09 staging: clocking-wizard: Update the fixed factor divisors
Update the fixed factor clock registration to register the divisors.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1614172241-17326-4-git-send-email-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:30 +01:00
Shubhrajyoti Datta
17aa33ff56 staging: clocking-wizard: Rename speed-grade to xlnx,speed-grade
Rename speed-grade to xlnx,speed-grade

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1614172241-17326-3-git-send-email-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:30 +01:00
Shubhrajyoti Datta
b03dea2593 staging: clocking-wizard: Fix kernel-doc warning
Fix the clocking wizard main structure kernel documentation.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1614172241-17326-2-git-send-email-shubhrajyoti.datta@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:25:30 +01:00
Kees Cook
f20be1bc5c staging: Replace lkml.org links with lore
As started by commit 05a5f51ca5 ("Documentation: Replace lkml.org
links with lore"), replace lkml.org links with lore to better use a
single source that's more likely to stay available long-term.

Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210210233231.1664896-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-11 12:13:53 +01:00
Alexander A. Klimov
809a930864 staging: Replace HTTP links with HTTPS ones
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
    For each line:
      If doesn't contain `\bxmlns\b`:
        For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
            If both the HTTP and HTTPS versions
            return 200 OK and serve the same content:
              Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Link: https://lore.kernel.org/r/20200719123244.58718-1-grandmaster@al2klimov.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-20 10:22:47 +02:00
David Gow
0a0a66c984 clk: staging: Specify IOMEM dependency for Xilinx Clocking Wizard driver
The Xilinx Clocking Wizard driver uses the devm_ioremap_resource
function, but does not specify a dependency on IOMEM in Kconfig. This
causes a build failure on architectures without IOMEM, for example, UML
(notably with make allyesconfig).

Fix this by making CONFIG_COMMON_CLK_XLNX_CLKWZRD depend on CONFIG_IOMEM.

Signed-off-by: David Gow <davidgow@google.com>
Link: https://lore.kernel.org/r/20200630044518.1084468-1-davidgow@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-01 15:43:05 +02:00
YueHaibing
f595f03bfd staging: clocking-wizard: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191009150427.10852-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-10 11:00:59 +02:00
Greg Kroah-Hartman
97ed8eab2a staging: add missing SPDX lines to Makefile files
There are a few remaining drivers/staging/*/Makefile files that do not
have SPDX identifiers in them.  Add the correct GPL-2.0 identifier to
them to make scanning tools happy.

Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03 11:10:15 +02:00
Greg Kroah-Hartman
99b75a4e32 staging: add missing SPDX lines to Kconfig files
There are a few remaining drivers/staging/*/Kconfig files that do not
have SPDX identifiers in them.  Add the correct GPL-2.0 identifier to
them to make scanning tools happy.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03 11:10:15 +02:00
Ioannis Valasakis
d521323615 staging: clocking-wizard: match parenthesis indentation
Match parenthesis indentation after line end, and fixed alignment
to conform to the coding style guidelines.
Reported by checkpatch.

Signed-off-by: Ioannis Valasakis <code@wizofe.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-09 14:57:33 +02:00
Kyle Buzby
3a29f43cc3 staging: clocking-wizard: prefer 'help' in Kconfig
Fixes the checkpatch warning:

WARNING: prefer 'help' over '---help---' for new help texts
+config COMMON_CLK_XLNX_CLKWZRD

Signed-off-by: Kyle Buzby <kyle.buzby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-17 09:05:13 +02:00
Greg Kroah-Hartman
09956d59ba staging: clocking-wizard: remove redundant license text
Now that the SPDX tag is in the clocking-wizard driver files, that
identifies the license in a specific and legally-defined manner.  So the
extra GPL text wording can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:45 +01:00
Greg Kroah-Hartman
1dbb3344d9 staging: clocking-wizard: add SPDX identifier.
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the staging clocking-wizard driver to have a proper SPDX
identifier, based on the license text in the file itself.  The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:45 +01:00
Xavier Roumegue
a95cd6deeb staging: clocking-wizard: Fix incorrect type of speed grade
The speed grade type is unsigned according to the dt-bindings.

Fix sparse issue (-Wtypesign):
CHECK   drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c
drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c:162:56: warning: incorrect type in argument 3 (different signedness)
drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c:162:56:    expected unsigned int [usertype] *out_value
drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c:162:56:    got int *<noident>

Signed-off-by: Xavier Roumegue <xroumegue@gmail.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-25 09:54:32 +02:00
SirnamSwetha
6e0906c72f Staging: clocking-wizard: CHECK:Please use a blank line
This patch fixes the checkpatch.pl issue:

CHECK: Please use a blank line after function/struct/union/enum declarations

Signed-off-by: SirnamSwetha <theonly.ultimate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 20:05:31 -08:00
SirnamSwetha
82293995e8 Staging: clocking-wizard: Avoid CamelCase
This patch fixes the checkpatch.pl issue:

CHECK: Avoid CamelCase: <WZRD_CLkOUT0_FRAC_EN>

CHECK: Avoid CamelCase: <WZRD_CLkFBOUT_FRAC_EN>

Signed-off-by: SirnamSwetha <theonly.ultimate@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 20:05:31 -08:00
Stephen Boyd
10a3402415 staging: clocking-wizard: Include clk.h
This clock provider uses the consumer API, so include clk.h
explicitly.

Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2015-07-20 10:52:41 -07:00
Soren Brinkmann
19f15a3000 staging: clocking-wizard: Handle invalid clk in notifier
Even though it should never happen, handle the case that the clock
notifier is called with an unexpected clock handle. This avoids the
compiler warning:
   drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c: In function 'clk_wzrd_clk_notifier':
>> drivers/staging/clocking-wizard/clk-xlnx-clock-wizard.c:99:6: warning: 'max' may be used uninitialized in this function [-Wmaybe-uninitialized]
      if (ndata->new_rate > max)
         ^

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 16:06:20 -08:00
Athira Lekshmi
b6461b53e7 Clocking-wizard: Fixed missing blank line warning
Added a new line after declaration to remove the warning
'Missing a blank line after declarations'

Signed-off-by: Athira Lekshmi <andnlnbn18@gmail.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 16:06:20 -08:00
Athira Sharikkal
e66f7a2752 Drivers:staging:clocking-wizard: Added a newline
Fixed checkpatch warning:
Missing a newline after declarations

Signed-off-by: Athira Sharikkal <athirasnamby@gmail.com>
Acked-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:45:24 -08:00
Devendra Naga
5f18611038 staging: clocking-wizard: check for a valid clk_name pointer
The clk_name gets the return value from kasprintf (part of which does the
allocation of the returned buffer). So check the return pointer
before using it for clk_register_fixed_factor.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Reviewed-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:45:24 -08:00
Soren Brinkmann
4baa70f69d staging: clocking-wizard: Contain macro argument in parenthesis
A macro doing some arithmetic to calculate a register offset, did not
contain an argument to the macro in parentheses, potentially leading to
unexpected results when using that macro with arithmetic expressions as
argument.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:25:53 +08:00
Soren Brinkmann
812283cd54 staging: Add Xilinx Clocking Wizard driver
Add a driver for the Xilinx Clocking Wizard soft IP. The clocking wizard
provides an AXI interface to dynamically reconfigure the clocking
resources of Xilinx FPGAs.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:26 +08:00