Skip to content

Commit ea14174

Browse files
committed
Merge: CNB96: phy update to v6.12
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5341 JIRA: https://issues.redhat.com/browse/RHEL-57766 JIRA: https://issues.redhat.com/browse/RHEL-66298 JIRA: https://issues.redhat.com/browse/RHEL-63771 CVE: CVE-2024-50023 Signed-off-by: Izabela Bakollari <ibakolla@redhat.com> Dependencies of gpiolib will be applied in a different MR. Approved-by: Radu Rendec <rrendec@redhat.com> Approved-by: Petr Oros <poros@redhat.com> Approved-by: Ivan Vecera <ivecera@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents a62d67b + e6d009e commit ea14174

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+7936
-419
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/airoha,en8811h.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Airoha EN8811H PHY
8+
9+
maintainers:
10+
- Eric Woudstra <ericwouds@gmail.com>
11+
12+
description:
13+
The Airoha EN8811H PHY has the ability to reverse polarity
14+
on the lines to and/or from the MAC. It is reversed by
15+
the booleans in the devicetree node of the phy.
16+
17+
allOf:
18+
- $ref: ethernet-phy.yaml#
19+
20+
properties:
21+
compatible:
22+
enum:
23+
- ethernet-phy-id03a2.a411
24+
25+
reg:
26+
maxItems: 1
27+
28+
airoha,pnswap-rx:
29+
type: boolean
30+
description:
31+
Reverse rx polarity of the SERDES. This is the receiving
32+
side of the lines from the MAC towards the EN881H.
33+
34+
airoha,pnswap-tx:
35+
type: boolean
36+
description:
37+
Reverse tx polarity of SERDES. This is the transmitting
38+
side of the lines from EN8811H towards the MAC.
39+
40+
required:
41+
- reg
42+
43+
unevaluatedProperties: false
44+
45+
examples:
46+
- |
47+
mdio {
48+
#address-cells = <1>;
49+
#size-cells = <0>;
50+
51+
ethernet-phy@1 {
52+
compatible = "ethernet-phy-id03a2.a411";
53+
reg = <1>;
54+
airoha,pnswap-rx;
55+
};
56+
};

Documentation/devicetree/bindings/net/ti,dp83822.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,40 @@ properties:
6262
for the PHY. The internal delay for the PHY is fixed to 3.5ns relative
6363
to transmit data.
6464
65+
ti,cfg-dac-minus-one-bp:
66+
description: |
67+
DP83826 PHY only.
68+
Sets the voltage ratio (with respect to the nominal value)
69+
of the logical level -1 for the MLT-3 encoded TX data.
70+
enum: [5000, 5625, 6250, 6875, 7500, 8125, 8750, 9375, 10000,
71+
10625, 11250, 11875, 12500, 13125, 13750, 14375, 15000]
72+
default: 10000
73+
74+
ti,cfg-dac-plus-one-bp:
75+
description: |
76+
DP83826 PHY only.
77+
Sets the voltage ratio (with respect to the nominal value)
78+
of the logical level +1 for the MLT-3 encoded TX data.
79+
enum: [5000, 5625, 6250, 6875, 7500, 8125, 8750, 9375, 10000,
80+
10625, 11250, 11875, 12500, 13125, 13750, 14375, 15000]
81+
default: 10000
82+
83+
ti,rmii-mode:
84+
description: |
85+
If present, select the RMII operation mode. Two modes are
86+
available:
87+
- RMII master, where the PHY operates from a 25MHz clock reference,
88+
provided by a crystal or a CMOS-level oscillator
89+
- RMII slave, where the PHY operates from a 50MHz clock reference,
90+
provided by a CMOS-level oscillator
91+
The RMII operation mode can also be configured by its straps.
92+
If the strap pin is not set correctly or not set at all, then this can be
93+
used to configure it.
94+
$ref: /schemas/types.yaml#/definitions/string
95+
enum:
96+
- master
97+
- slave
98+
6599
required:
66100
- reg
67101

Documentation/networking/phy.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ Some of the interface modes are described below:
327327
This is the Penta SGMII mode, it is similar to QSGMII but it combines 5
328328
SGMII lines into a single link compared to 4 on QSGMII.
329329

330+
``PHY_INTERFACE_MODE_10G_QXGMII``
331+
Represents the 10G-QXGMII PHY-MAC interface as defined by the Cisco USXGMII
332+
Multiport Copper Interface document. It supports 4 ports over a 10.3125 GHz
333+
SerDes lane, each port having speeds of 2.5G / 1G / 100M / 10M achieved
334+
through symbol replication. The PCS expects the standard USXGMII code word.
335+
330336
Pause frames / flow control
331337
===========================
332338

drivers/gpio/gpiolib-acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,
984984
int i;
985985

986986
/* Try first from _DSD */
987-
for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) {
987+
for (i = 0; i < gpio_suffix_count; i++) {
988988
if (con_id) {
989989
snprintf(propname, sizeof(propname), "%s-%s",
990990
con_id, gpio_suffixes[i]);
@@ -1444,7 +1444,7 @@ int acpi_gpio_count(struct device *dev, const char *con_id)
14441444
unsigned int i;
14451445

14461446
/* Try first from _DSD */
1447-
for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) {
1447+
for (i = 0; i < gpio_suffix_count; i++) {
14481448
if (con_id)
14491449
snprintf(propname, sizeof(propname), "%s-%s",
14501450
con_id, gpio_suffixes[i]);

drivers/gpio/gpiolib-devres.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
158158
if (!dr)
159159
return ERR_PTR(-ENOMEM);
160160

161-
desc = fwnode_gpiod_get_index(fwnode, con_id, index, flags, label);
161+
desc = gpiod_find_and_request(dev, fwnode, con_id, index, flags, label, false);
162162
if (IS_ERR(desc)) {
163163
devres_free(dr);
164164
return desc;

drivers/gpio/gpiolib-of.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int of_gpio_get_count(struct device *dev, const char *con_id)
103103
if (ret > 0)
104104
return ret;
105105

106-
for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) {
106+
for (i = 0; i < gpio_suffix_count; i++) {
107107
if (con_id)
108108
snprintf(propname, sizeof(propname), "%s-%s",
109109
con_id, gpio_suffixes[i]);
@@ -631,7 +631,7 @@ struct gpio_desc *of_find_gpio(struct device_node *np, const char *con_id,
631631
unsigned int i;
632632

633633
/* Try GPIO property "foo-gpios" and "foo-gpio" */
634-
for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) {
634+
for (i = 0; i < gpio_suffix_count; i++) {
635635
if (con_id)
636636
snprintf(prop_name, sizeof(prop_name), "%s-%s", con_id,
637637
gpio_suffixes[i]);

drivers/gpio/gpiolib.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22

33
#include <linux/acpi.h>
4+
#include <linux/array_size.h>
45
#include <linux/bitmap.h>
56
#include <linux/compat.h>
67
#include <linux/debugfs.h>
@@ -99,6 +100,9 @@ LIST_HEAD(gpio_devices);
99100
static DEFINE_MUTEX(gpio_machine_hogs_mutex);
100101
static LIST_HEAD(gpio_machine_hogs);
101102

103+
const char *const gpio_suffixes[] = { "gpios", "gpio" };
104+
const size_t gpio_suffix_count = ARRAY_SIZE(gpio_suffixes);
105+
102106
static void gpiochip_free_hogs(struct gpio_chip *gc);
103107
static int gpiochip_add_irqchip(struct gpio_chip *gc,
104108
struct lock_class_key *lock_key,
@@ -2783,7 +2787,6 @@ int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
27832787
PIN_CONFIG_PERSIST_STATE,
27842788
!transitory);
27852789
}
2786-
EXPORT_SYMBOL_GPL(gpiod_set_transitory);
27872790

27882791
/**
27892792
* gpiod_is_active_low - test whether a GPIO is active-low or not
@@ -4045,13 +4048,13 @@ static struct gpio_desc *gpiod_find_by_fwnode(struct fwnode_handle *fwnode,
40454048
return desc;
40464049
}
40474050

4048-
static struct gpio_desc *gpiod_find_and_request(struct device *consumer,
4049-
struct fwnode_handle *fwnode,
4050-
const char *con_id,
4051-
unsigned int idx,
4052-
enum gpiod_flags flags,
4053-
const char *label,
4054-
bool platform_lookup_allowed)
4051+
struct gpio_desc *gpiod_find_and_request(struct device *consumer,
4052+
struct fwnode_handle *fwnode,
4053+
const char *con_id,
4054+
unsigned int idx,
4055+
enum gpiod_flags flags,
4056+
const char *label,
4057+
bool platform_lookup_allowed)
40554058
{
40564059
unsigned long lookupflags = GPIO_LOOKUP_FLAGS_DEFAULT;
40574060
struct gpio_desc *desc;

drivers/gpio/gpiolib.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ static inline struct gpio_device *to_gpio_device(struct device *dev)
8787
}
8888

8989
/* gpio suffixes used for ACPI and device tree lookup */
90-
static __maybe_unused const char * const gpio_suffixes[] = { "gpios", "gpio" };
90+
extern const char *const gpio_suffixes[];
91+
extern const size_t gpio_suffix_count;
9192

9293
/**
9394
* struct gpio_array - Opaque descriptor for a structure of GPIO array attributes
@@ -112,8 +113,6 @@ struct gpio_array {
112113
unsigned long invert_mask[];
113114
};
114115

115-
struct gpio_desc *gpiochip_get_desc(struct gpio_chip *gc, unsigned int hwnum);
116-
117116
#define for_each_gpio_desc(gc, desc) \
118117
for (unsigned int __i = 0; \
119118
__i < gc->ngpio && (desc = gpiochip_get_desc(gc, __i)); \
@@ -134,6 +133,8 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep,
134133
struct gpio_array *array_info,
135134
unsigned long *value_bitmap);
136135

136+
int gpiod_set_transitory(struct gpio_desc *desc, bool transitory);
137+
137138
extern spinlock_t gpio_lock;
138139
extern struct list_head gpio_devices;
139140

@@ -207,6 +208,14 @@ static inline int gpiod_request_user(struct gpio_desc *desc, const char *label)
207208
return ret;
208209
}
209210

211+
struct gpio_desc *gpiod_find_and_request(struct device *consumer,
212+
struct fwnode_handle *fwnode,
213+
const char *con_id,
214+
unsigned int idx,
215+
enum gpiod_flags flags,
216+
const char *label,
217+
bool platform_lookup_allowed);
218+
210219
int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
211220
unsigned long lflags, enum gpiod_flags dflags);
212221
int gpio_set_debounce_timeout(struct gpio_desc *desc, unsigned int debounce);

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,12 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
12081208
priv->phylink_config.type = PHYLINK_NETDEV;
12091209
priv->phylink_config.mac_managed_pm = true;
12101210

1211+
/* Stmmac always requires an RX clock for hardware initialization */
1212+
priv->phylink_config.mac_requires_rxc = true;
1213+
12111214
mdio_bus_data = priv->plat->mdio_bus_data;
12121215
if (mdio_bus_data)
1213-
priv->phylink_config.ovr_an_inband =
1216+
priv->phylink_config.default_an_inband =
12141217
mdio_bus_data->xpcs_an_inband;
12151218

12161219
/* Set the platform/firmware specified interface mode. Note, phylink
@@ -3394,6 +3397,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
33943397
u32 chan;
33953398
int ret;
33963399

3400+
/* Make sure RX clock is enabled */
3401+
if (priv->hw->phylink_pcs)
3402+
phylink_pcs_pre_init(priv->phylink, priv->hw->phylink_pcs);
3403+
33973404
/* DMA initialization and SW reset */
33983405
ret = stmmac_init_dma_engine(priv);
33993406
if (ret < 0) {

drivers/net/phy/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ config LED_TRIGGER_PHY
4444
<Speed in megabits>Mbps OR <Speed in gigabits>Gbps OR link
4545
for any speed known to the PHY.
4646

47+
config OPEN_ALLIANCE_HELPERS
48+
bool
49+
4750
config PHYLIB_LEDS
4851
def_bool OF
4952
depends on LEDS_CLASS=y || LEDS_CLASS=PHYLIB
@@ -68,6 +71,11 @@ config SFP
6871

6972
comment "MII PHY device drivers"
7073

74+
config AIR_EN8811H_PHY
75+
tristate "Airoha EN8811H 2.5 Gigabit PHY"
76+
help
77+
Currently supports the Airoha EN8811H PHY.
78+
7179
config AMD_PHY
7280
tristate "AMD and Altima PHYs"
7381
help
@@ -216,6 +224,7 @@ config MARVELL_10G_PHY
216224

217225
config MARVELL_88Q2XXX_PHY
218226
tristate "Marvell 88Q2XXX PHY"
227+
depends on HWMON || HWMON=n
219228
help
220229
Support for the Marvell 88Q2XXX 100/1000BASE-T1 Automotive Ethernet
221230
PHYs.
@@ -392,6 +401,7 @@ config DP83TD510_PHY
392401

393402
config DP83TG720_PHY
394403
tristate "Texas Instruments DP83TG720 Ethernet 1000Base-T1 PHY"
404+
select OPEN_ALLIANCE_HELPERS
395405
help
396406
The DP83TG720S-Q1 is an automotive Ethernet physical layer
397407
transceiver compliant with IEEE 802.3bp and Open Alliance

0 commit comments

Comments
 (0)