Hi Stefan,
Cool!  Glad to see that you're on this track now... the SPI driver
changes look really good in general.

That said, I've been working on the common clock bits, too... see:

http://git.openrisc.net/cgit.cgi/jonas/linux/commit/?h=wip&id=913eedad91fe4ad082d7198174a414b436f51482

That's on a branch with the very descriptive name "wip" in my git
repo.  The following commit is relevant, too.

The trouble I've been having is how to get BASE_BAUD to work with
these changes.  Without that, we lose the early serial console.  Not a
big deal for production use, but annoying for development.

As you've probably figured out by my lack of responsiveness, I'm a bit
pressed for time at the moment and don't have time right now to dig
into this in any depth.  It would be great if you could grab those two
patches from my tree, squash them together, and massage your changes
on top of that.  The jist of it is that the CPU frequency is also
driven by the oscillator and the bus frequency is a function thereof,
the details of which come entirely from the device tree description.

The SPI driver is not upstream... once we have the common clk bits in
place, that driver becomes arch independent and it should go upstream
via the SPI maintainer.

Your comments are welcome.  I'll try to comment on your individual
patches if I get a spare moment.

/Jonas


On 1 September 2013 09:12, Stefan Kristiansson
<stefan.kristians...@saunalahti.fi> wrote:
> This set of patches brings the OpenCores simple SPI driver up to date
> with the current practices used in the SPI subsystem.
>
> A special note is required for the last two patches ("use clock framework to
> obtain spi clock" and "remove dependency on OPENRISC for spi-oc-simple").
> When used together with OpenRISC, there are two prerequisite patches.
>
> 1) openrisc: select COMMON_CLK
>    https://patchwork.kernel.org/patch/2852461/
>
> 2) clk: add generic driver for fixed rate clock
>    https://patchwork.kernel.org/patch/2852460/
>
> The first goes without comment, the second is needed since we
> don't have any board specific init code, but only rely on the device
> tree description to setup our boards.
> With those two applied, the clock for the spi driver can be described as
> below in the dts file.
>
>         ...
>         wb_clk: wb_clk {
>                 #clock-cells = <0>;
>                 compatible = "fixed-clock";
>                 clock-frequency = <50000000>;
>                 clock-output-names = "wb_clk";
>         };
>         ...
>         spi0: spi0@b0000000 {
>                 compatible = "opencores,spi-simple";
>                 reg = <0xb0000000 0x5>;
>                 clocks = <&wb_clk>;
>         ...
>         };
>
> The rest of the patches can be applied without concerns.
>
> Stefan Kristiansson (12):
>   spi/spi_opencores: rename to spi-oc-simple
>   spi/spi-oc-simple: update driver names in file header
>   spi/spi-oc-simple: remove __devinit, __devexit, __init and __exit
>   spi/spi-oc-simple: include module.h
>   spi/spi-oc-simple: whitespace and format cleanup
>   spi/spi-oc-simple: remove dead and commented out code
>   spi/spi-oc-simple: remove unused variables
>   spi/spi-oc-simple: use the SPI framework queue
>   spi/spi-oc-simple: use platform_{get,set}_drvdata()
>   spi/spi-oc-simple: use module_platform_driver to register driver
>   spi/spi-oc-simple: use clock framework to obtain spi clock
>   spi: remove dependency on OPENRISC for spi-oc-simple
>
>  drivers/spi/Kconfig         |   1 -
>  drivers/spi/Makefile        |   2 +-
>  drivers/spi/spi-oc-simple.c | 490 ++++++++++++++++++++++++++++++
>  drivers/spi/spi_opencores.c | 707 
> --------------------------------------------
>  4 files changed, 491 insertions(+), 709 deletions(-)
>  create mode 100644 drivers/spi/spi-oc-simple.c
>  delete mode 100644 drivers/spi/spi_opencores.c
>
> --
> 1.8.1.2
>
> _______________________________________________
> Linux mailing list
> Linux@lists.openrisc.net
> http://lists.openrisc.net/listinfo/linux



-- 
Jonas Bonn
Stockholm, Sweden
_______________________________________________
Linux mailing list
Linux@lists.openrisc.net
http://lists.openrisc.net/listinfo/linux

Reply via email to