All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Wahren <wahrenst@gmx.net>
To: Jeremy Linton <jeremy.linton@arm.com>, netdev@vger.kernel.org
Cc: opendmb@gmail.com, f.fainelli@gmail.com, davem@davemloft.net,
	bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, andrew@lunn.ch,
	hkallweit1@gmail.com,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Subject: Re: [PATCH 6/6] net: bcmgenet: reduce severity of missing clock warnings
Date: Sat, 1 Feb 2020 17:44:28 +0100	[thread overview]
Message-ID: <2dfd6cd2-1dd0-c8ff-8d83-aed3b4ea7a79@gmx.net> (raw)
In-Reply-To: <20200201074625.8698-7-jeremy.linton@arm.com>

Hi Jeremy,

[add Nicolas as BCM2835 maintainer]

Am 01.02.20 um 08:46 schrieb Jeremy Linton:
> If one types "failed to get enet clock" or similar into google
> there are ~370k hits. The vast majority are people debugging
> problems unrelated to this adapter, or bragging about their
> rpi's. Given that its not a fatal situation with common DT based
> systems, lets reduce the severity so people aren't seeing failure
> messages in everyday operation.
>
i'm fine with your patch, since the clocks are optional according to the
binding. But instead of hiding of those warning, it would be better to
fix the root cause (missing clocks). Unfortunately i don't have the
necessary documentation, just some answers from the RPi guys.

This is what i got so far:

diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index 961bed8..d4ff370 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -338,6 +338,8 @@
                        reg = <0x0 0x7d580000 0x10000>;
                        #address-cells = <0x1>;
                        #size-cells = <0x1>;
+                       clocks = <&clocks BCM2711_CLOCK_GENET250>;
+                       clock-names = "enet";
                        interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index ded13cc..627f1b1 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -116,6 +116,10 @@
 #define CM_EMMCDIV             0x1c4
 #define CM_EMMC2CTL            0x1d0
 #define CM_EMMC2DIV            0x1d4
+#define CM_GENET250CTL         0x1e8
+#define CM_GENET250DIV         0x1ec
+#define CM_GENET125CTL         0x210
+#define CM_GENET125DIV         0x214
 
 /* General bits for the CM_*CTL regs */
 # define CM_ENABLE                     BIT(4)
@@ -2021,6 +2025,25 @@ static const struct bcm2835_clk_desc
clk_desc_array[] = {
                .frac_bits = 8,
                .tcnt_mux = 42),
 
+       /* GENET clocks (only available for BCM2711) */
+       [BCM2711_CLOCK_GENET250]        = REGISTER_PER_CLK(
+               SOC_BCM2711,
+               .name = "genet250",
+               .ctl_reg = CM_GENET250CTL,
+               .div_reg = CM_GENET250DIV,
+               .int_bits = 4,
+               .frac_bits = 8,
+               .tcnt_mux = 45),
+
+       [BCM2711_CLOCK_GENET125]        = REGISTER_PER_CLK(
+               SOC_BCM2711,
+               .name = "genet125",
+               .ctl_reg = CM_GENET125CTL,
+               .div_reg = CM_GENET125DIV,
+               .int_bits = 4,
+               .frac_bits = 8,
+               .tcnt_mux = 50),
+
        /* General purpose (GPIO) clocks */
        [BCM2835_CLOCK_GP0]     = REGISTER_PER_CLK(
                SOC_ALL,
diff --git a/include/dt-bindings/clock/bcm2835.h
b/include/dt-bindings/clock/bcm2835.h
index b60c0343..fca65ab 100644
--- a/include/dt-bindings/clock/bcm2835.h
+++ b/include/dt-bindings/clock/bcm2835.h
@@ -60,3 +60,5 @@
 #define BCM2835_CLOCK_DSI1P            50
 
 #define BCM2711_CLOCK_EMMC2            51
+#define BCM2711_CLOCK_GENET250         52
+#define BCM2711_CLOCK_GENET125         53



  parent reply	other threads:[~2020-02-01 16:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-01  7:46 [PATCH 0/6] Add ACPI bindings to the genet Jeremy Linton
2020-02-01  7:46 ` [PATCH 1/6] mdio_bus: Add generic mdio_find_bus() Jeremy Linton
2020-02-01  7:46 ` [PATCH 2/6] net: bcmgenet: refactor phy mode configuration Jeremy Linton
2020-02-01 16:24   ` Florian Fainelli
2020-02-01 19:10     ` Jeremy Linton
2020-02-03  1:17     ` Andrew Lunn
2020-02-03  3:24       ` Florian Fainelli
2020-02-03 18:46         ` Jeremy Linton
2020-02-03 18:55           ` Florian Fainelli
2020-02-05 21:05   ` kbuild test robot
2020-02-05 21:05     ` kbuild test robot
2020-02-01  7:46 ` [PATCH 3/6] net: bcmgenet: enable automatic phy discovery Jeremy Linton
2020-02-01 15:25   ` Andrew Lunn
2020-02-01 19:07     ` Jeremy Linton
2020-02-03 20:55       ` Florian Fainelli
2020-02-03 21:21         ` Andrew Lunn
2020-02-01 20:02     ` Jeremy Linton
2020-02-03  1:15       ` Andrew Lunn
2020-02-03 21:10         ` Jeremy Linton
2020-02-01  7:46 ` [PATCH 4/6] net: bcmgenet: Initial bcmgenet ACPI support Jeremy Linton
2020-02-01 15:33   ` Andrew Lunn
2020-02-01 19:09     ` Jeremy Linton
2020-02-01  7:46 ` [PATCH 5/6] net: bcmgenet: Fetch MAC address from the adapter Jeremy Linton
2020-02-01 15:37   ` Andrew Lunn
2020-02-01 19:20     ` Jeremy Linton
2020-02-01  7:46 ` [PATCH 6/6] net: bcmgenet: reduce severity of missing clock warnings Jeremy Linton
2020-02-01 16:18   ` Florian Fainelli
2020-02-01 16:44   ` Stefan Wahren [this message]
2020-02-01 19:27     ` Jeremy Linton
2020-02-03 18:36       ` Nicolas Saenz Julienne
2020-02-03 19:08         ` Stefan Wahren
2020-02-03 21:21           ` Florian Fainelli
2020-02-05 18:42             ` Stefan Wahren

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=2dfd6cd2-1dd0-c8ff-8d83-aed3b4ea7a79@gmx.net \
    --to=wahrenst@gmx.net \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=jeremy.linton@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=opendmb@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.