mbox series

[U-Boot,v3,0/5] Update SiFive Unleashed Drivers

Message ID 20190619070037.11730-1-anup.patel@wdc.com
Headers show
Series Update SiFive Unleashed Drivers | expand

Message

Anup Patel June 19, 2019, 7:01 a.m. UTC
This series update SiFive Unleashed clock driver so that:
1. It is in sync with upstream Linux driver
2. It uses latest DT bindings as-per upstream Linux driver

With this series, we can now use latest DT bindings with U-Boot. I have
tested SiFive Serial driver and Cadence MACB ethernet driver with this
changes and both work fine.

The legacy FSBL will still pass DTB to U-Boot with older DT bindings
which will break the updated SiFive Unleashed clock driver. To tackle
this, we have embedded DTB in OpenSBI FW_PAYLOAD firmware for SiFive
Unleashed so that OpenSBI will override and pass updated DTB to U-Boot.

In fact, the updated DTB passed by OpenSBI can be used by latest Linux
(i.e. V5.2-rc1 or higher) as well.

The OpenSBI changes to embed SiFive Unleashed DTB can be found in
sifive_unleashed_dtb_fix_v3 branch of:
https://github.com/avpatel/opensbi.git

This series can be found in riscv_unleashed_clk_sync_v3 branch of:
https://github.com/avpatel/u-boot.git

Changes since v2:
- Dropped PATCH6 which adds new compatible string to MACB driver because
  more changes are required in MACB driver for different ethernet speeds

Changes since v1:
- Dropped GEMGXL clock driver
- Added new compatible string for SiFive MACB ethernet

Anup Patel (5):
  clk: sifive: Factor-out PLL library as separate module
  clk: sifive: Sync-up WRPLL library with upstream Linux
  clk: sifive: Sync-up DT bindings header with upstream Linux
  clk: sifive: Sync-up main driver with upstream Linux
  clk: sifive: Drop GEMGXL clock driver

 board/sifive/fu540/Kconfig                    |   1 -
 drivers/clk/Kconfig                           |   1 +
 drivers/clk/Makefile                          |   1 +
 drivers/clk/analogbits/Kconfig                |   4 +
 drivers/clk/analogbits/Makefile               |   3 +
 .../{sifive => analogbits}/wrpll-cln28hpc.c   | 168 ++++++++----------
 drivers/clk/sifive/Kconfig                    |  10 --
 drivers/clk/sifive/Makefile                   |   4 -
 drivers/clk/sifive/fu540-prci.c               | 123 +++++++------
 drivers/clk/sifive/gemgxl-mgmt.c              |  60 -------
 include/dt-bindings/clk/sifive-fu540-prci.h   |  29 ---
 include/dt-bindings/clock/sifive-fu540-prci.h |  18 ++
 .../linux/clk}/analogbits-wrpll-cln28hpc.h    |  70 +++-----
 13 files changed, 195 insertions(+), 297 deletions(-)
 create mode 100644 drivers/clk/analogbits/Kconfig
 create mode 100644 drivers/clk/analogbits/Makefile
 rename drivers/clk/{sifive => analogbits}/wrpll-cln28hpc.c (69%)
 delete mode 100644 drivers/clk/sifive/gemgxl-mgmt.c
 delete mode 100644 include/dt-bindings/clk/sifive-fu540-prci.h
 create mode 100644 include/dt-bindings/clock/sifive-fu540-prci.h
 rename {drivers/clk/sifive => include/linux/clk}/analogbits-wrpll-cln28hpc.h (52%)

--
2.17.1

Comments

Bin Meng June 19, 2019, 7:03 a.m. UTC | #1
Hi Anup,

On Wed, Jun 19, 2019 at 3:01 PM Anup Patel <Anup.Patel@wdc.com> wrote:
>
> This series update SiFive Unleashed clock driver so that:
> 1. It is in sync with upstream Linux driver
> 2. It uses latest DT bindings as-per upstream Linux driver
>
> With this series, we can now use latest DT bindings with U-Boot. I have
> tested SiFive Serial driver and Cadence MACB ethernet driver with this
> changes and both work fine.
>
> The legacy FSBL will still pass DTB to U-Boot with older DT bindings
> which will break the updated SiFive Unleashed clock driver. To tackle
> this, we have embedded DTB in OpenSBI FW_PAYLOAD firmware for SiFive
> Unleashed so that OpenSBI will override and pass updated DTB to U-Boot.
>
> In fact, the updated DTB passed by OpenSBI can be used by latest Linux
> (i.e. V5.2-rc1 or higher) as well.
>
> The OpenSBI changes to embed SiFive Unleashed DTB can be found in
> sifive_unleashed_dtb_fix_v3 branch of:
> https://github.com/avpatel/opensbi.git
>
> This series can be found in riscv_unleashed_clk_sync_v3 branch of:
> https://github.com/avpatel/u-boot.git
>
> Changes since v2:
> - Dropped PATCH6 which adds new compatible string to MACB driver because
>   more changes are required in MACB driver for different ethernet speeds
>

If we drop PATCH6, we should also drop PATCH5, otherwise U-Boot
10/100Mbps is broken.

Regards,
Bin
Anup Patel June 19, 2019, 8:24 a.m. UTC | #2
On Wed, Jun 19, 2019 at 12:37 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Anup,
>
> On Wed, Jun 19, 2019 at 3:01 PM Anup Patel <Anup.Patel@wdc.com> wrote:
> >
> > This series update SiFive Unleashed clock driver so that:
> > 1. It is in sync with upstream Linux driver
> > 2. It uses latest DT bindings as-per upstream Linux driver
> >
> > With this series, we can now use latest DT bindings with U-Boot. I have
> > tested SiFive Serial driver and Cadence MACB ethernet driver with this
> > changes and both work fine.
> >
> > The legacy FSBL will still pass DTB to U-Boot with older DT bindings
> > which will break the updated SiFive Unleashed clock driver. To tackle
> > this, we have embedded DTB in OpenSBI FW_PAYLOAD firmware for SiFive
> > Unleashed so that OpenSBI will override and pass updated DTB to U-Boot.
> >
> > In fact, the updated DTB passed by OpenSBI can be used by latest Linux
> > (i.e. V5.2-rc1 or higher) as well.
> >
> > The OpenSBI changes to embed SiFive Unleashed DTB can be found in
> > sifive_unleashed_dtb_fix_v3 branch of:
> > https://github.com/avpatel/opensbi.git
> >
> > This series can be found in riscv_unleashed_clk_sync_v3 branch of:
> > https://github.com/avpatel/u-boot.git
> >
> > Changes since v2:
> > - Dropped PATCH6 which adds new compatible string to MACB driver because
> >   more changes are required in MACB driver for different ethernet speeds
> >
>
> If we drop PATCH6, we should also drop PATCH5, otherwise U-Boot
> 10/100Mbps is broken.

I think it's easier to just implement TX clock select in MACB driver. I will
send v4 soon.

Regards,
Anup