public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/11] net: macb: Fix clk API usage for RISC-V systems
Date: Fri, 18 Jan 2019 14:35:00 +0100	[thread overview]
Message-ID: <b6f3e5e8-db64-0957-8228-efcf7bca5ce4@suse.de> (raw)
In-Reply-To: <BYAPR04MB530354553AB718C4C58B65728D9C0@BYAPR04MB5303.namprd04.prod.outlook.com>



On 18.01.19 14:28, Anup Patel wrote:
> 
> 
>> -----Original Message-----
>> From: Alexander Graf [mailto:agraf at suse.de]
>> Sent: Friday, January 18, 2019 5:05 PM
>> To: Anup Patel <Anup.Patel@wdc.com>
>> Cc: Rick Chen <rick@andestech.com>; Bin Meng <bmeng.cn@gmail.com>;
>> Joe Hershberger <joe.hershberger@ni.com>; Lukas Auer
>> <lukas.auer@aisec.fraunhofer.de>; Masahiro Yamada
>> <yamada.masahiro@socionext.com>; Simon Glass <sjg@chromium.org>;
>> Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
>> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>;
>> Christoph Hellwig <hch@infradead.org>; U-Boot Mailing List <u-
>> boot at lists.denx.de>
>> Subject: Re: [PATCH 04/11] net: macb: Fix clk API usage for RISC-V systems
>>
>>
>>
>>> Am 18.01.2019 um 07:05 schrieb Anup Patel <Anup.Patel@wdc.com>:
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: Alexander Graf [mailto:agraf at suse.de]
>>>> Sent: Thursday, January 17, 2019 11:37 PM
>>>> To: Anup Patel <Anup.Patel@wdc.com>; Rick Chen
>> <rick@andestech.com>;
>>>> Bin Meng <bmeng.cn@gmail.com>; Joe Hershberger
>>>> <joe.hershberger@ni.com>; Lukas Auer
>>>> <lukas.auer@aisec.fraunhofer.de>; Masahiro Yamada
>>>> <yamada.masahiro@socionext.com>; Simon Glass <sjg@chromium.org>
>>>> Cc: Palmer Dabbelt <palmer@sifive.com>; Paul Walmsley
>>>> <paul.walmsley@sifive.com>; Atish Patra <Atish.Patra@wdc.com>;
>>>> Christoph Hellwig <hch@infradead.org>; U-Boot Mailing List <u-
>>>> boot at lists.denx.de>
>>>> Subject: Re: [PATCH 04/11] net: macb: Fix clk API usage for RISC-V
>>>> systems
>>>>
>>>>> On 01/17/2019 11:38 AM, Anup Patel wrote:
>>>>> This patch does following fixes in MACB ethernet driver for using it
>>>>> on RISC-V systems (particularly QEMU sifive_u
>>>>> machine):
>>>>> 1. asm/arch/clk.h is not available on RISC-V port so include
>>>>>    it only for non-RISC-V systems.
>>>>> 2. Don't fail in macb_enable_clk() if clk_enable() returns
>>>>>    -ENOSYS because we get -ENOSYS for fixed-rate clocks.
>>>>>
>>>>> Signed-off-by: Anup Patel <anup.patel@wdc.com>
>>>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>>>> ---
>>>>>  drivers/net/macb.c | 4 +++-
>>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/net/macb.c b/drivers/net/macb.c index
>>>>> 94c89c762b..9a06b523cc 100644
>>>>> --- a/drivers/net/macb.c
>>>>> +++ b/drivers/net/macb.c
>>>>> @@ -38,7 +38,9 @@
>>>>>  #include <linux/mii.h>
>>>>>  #include <asm/io.h>
>>>>>  #include <asm/dma-mapping.h>
>>>>> +#ifndef CONFIG_RISCV
>>>>>  #include <asm/arch/clk.h>
>>>>> +#endif
>>>>>  #include <linux/errno.h>
>>>>>
>>>>>  #include "macb.h"
>>>>> @@ -1066,7 +1068,7 @@ static int macb_enable_clk(struct udevice
>> *dev)
>>>>>       */
>>>>>  #ifndef CONFIG_MACB_ZYNQ
>>>>>      ret = clk_enable(&clk);
>>>>
>>>> If clk.h is not available, who exports clk_enable() then; and why is
>>>> the included needed in the first place?
>>>
>>> For some of the ARM boards, clk instances are provided directly by
>>> arch/arm/mach-xyz sources. For such boards, asm/arch/clk.h is
>>> required. I think these boards should move to DT based clk drivers.
>>
>> Can you at least make this a positive #ifdef then rather than ifndef? We want
>> to isolate the odd case, not the normal one.
>>
>> Maybe you can even find a config option that isolates it further?
> 
> With the additional check "ret != -ENOSYS", we don't require the #ifndef but
> someone with Zynq SOC board need to confirm that removing #ifndef won't
> hurt.

In that case let's CC Michal :).


Alex

  reply	other threads:[~2019-01-18 13:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 10:38 [U-Boot] [PATCH 00/11] SiFive FU540 Support Anup Patel
2019-01-17 10:38 ` [U-Boot] [PATCH 01/11] riscv: Rename cpu/qemu to cpu/generic Anup Patel
2019-01-17 18:04   ` Alexander Graf
2019-01-17 10:38 ` [U-Boot] [PATCH 02/11] riscv: Add asm/dma-mapping.h for DMA mappings Anup Patel
2019-01-17 18:05   ` Alexander Graf
2019-01-17 10:38 ` [U-Boot] [PATCH 03/11] riscv: generic: Ensure that U-Boot runs within 4GB for 64bit systems Anup Patel
2019-01-17 18:06   ` Alexander Graf
2019-01-17 10:38 ` [U-Boot] [PATCH 04/11] net: macb: Fix clk API usage for RISC-V systems Anup Patel
2019-01-17 18:07   ` Alexander Graf
2019-01-18  6:05     ` Anup Patel
2019-01-18 11:35       ` Alexander Graf
2019-01-18 13:28         ` Anup Patel
2019-01-18 13:35           ` Alexander Graf [this message]
2019-01-31 10:04             ` Simon Glass
2019-02-05 11:17               ` Anup Patel
2019-01-17 10:38 ` [U-Boot] [PATCH 05/11] net: macb: Fix GEM hardware detection Anup Patel
2019-01-17 18:12   ` Alexander Graf
2019-01-17 10:39 ` [U-Boot] [PATCH 06/11] clk: Add SiFive FU540 PRCI clock driver Anup Patel
2019-01-17 18:17   ` Alexander Graf
2019-01-17 10:39 ` [U-Boot] [PATCH 07/11] clk: Add fixed-factor " Anup Patel
2019-01-17 18:20   ` Alexander Graf
2019-01-18  6:14     ` Anup Patel
2019-01-21 14:19       ` Alexander Graf
2019-01-22 12:35         ` Anup Patel
2019-01-17 10:39 ` [U-Boot] [PATCH 08/11] drivers: serial_sifive: Fix baud rate calculation Anup Patel
2019-01-17 18:22   ` Alexander Graf
2019-01-17 10:39 ` [U-Boot] [PATCH 09/11] drivers: serial: serial_sifive: Skip baudrate config if no input clock Anup Patel
2019-01-17 18:25   ` Alexander Graf
2019-01-17 10:39 ` [U-Boot] [PATCH 10/11] cpu: Bind timer driver for boot hart Anup Patel
2019-01-17 18:26   ` Alexander Graf
2019-01-17 10:39 ` [U-Boot] [PATCH 11/11] riscv: Add SiFive FU540 board support Anup Patel
2019-01-17 16:55   ` Troy Benjegerdes
2019-01-17 18:20     ` Atish Patra
2019-01-17 23:05   ` Alexander Graf
2019-01-17 23:09 ` [U-Boot] [PATCH 00/11] SiFive FU540 Support Alexander Graf
2019-01-18  5:53   ` Anup Patel
  -- strict thread matches above, loose matches on Subject: below --
2019-01-17 11:03 Anup Patel
2019-01-17 11:03 ` [U-Boot] [PATCH 04/11] net: macb: Fix clk API usage for RISC-V systems Anup Patel
2019-01-17 10:34 [U-Boot] [PATCH 00/11] SiFive FU540 Support Anup Patel
2019-01-17 10:35 ` [U-Boot] [PATCH 04/11] net: macb: Fix clk API usage for RISC-V systems Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b6f3e5e8-db64-0957-8228-efcf7bca5ce4@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox