Skip to content
Closed
54 changes: 49 additions & 5 deletions Documentation/devicetree/bindings/net/cdns,macb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ properties:
power-domains:
maxItems: 1

cdns,refclk-ext:
type: boolean
cdns,refclk-source:
$ref: /schemas/types.yaml#/definitions/string
enum:
- internal
- external
description:
This selects if the REFCLK for RMII is provided by an external source.
For RGMII mode this selects if the 125MHz REF clock is provided by an external
source.
Select whether or not the refclk for RGMII or RMII is provided by an
internal or external source. The default is device specific.

cdns,rx-watermark:
$ref: /schemas/types.yaml#/definitions/uint32
Expand All @@ -137,6 +139,12 @@ properties:
that need to be filled, before the forwarding process is activated.
Width of the SRAM is platform dependent, and can be 4, 8 or 16 bytes.

cdns,timer-adjust:
type: boolean
description:
Set when the hardware is operating in timer-adjust mode, where the timer
is controlled by the gem_tsu_inc_ctrl and gem_tsu_ms inputs.

'#address-cells':
const: 1

Expand Down Expand Up @@ -186,6 +194,15 @@ allOf:
properties:
reg:
maxItems: 1
- if:
not:
properties:
compatible:
contains:
const: microchip,mpfs-macb
then:
properties:
cdns,timer-adjust: false

- if:
properties:
Expand All @@ -196,6 +213,33 @@ allOf:
required:
- phys

- if:
not:
properties:
compatible:
contains:
enum:
- microchip,sama7g5-gem
- microchip,sama7g5-emac
then:
properties:
cdns,refclk-source: false

- if:
properties:
compatible:
contains:
enum:
- microchip,sama7g5-emac
then:
properties:
cdns,refclk-source:
default: external
else:
properties:
cdns,refclk-source:
default: internal

unevaluatedProperties: false

examples:
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/ethernet/cadence/macb.h
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,9 @@
#define MACB_CAPS_DMA_PTP BIT(22)
#define MACB_CAPS_RSC BIT(23)
#define MACB_CAPS_NO_LSO BIT(24)
#define MACB_CAPS_USRIO_HAS_MII BIT(25)
#define MACB_CAPS_USRIO_HAS_REFCLK_SOURCE BIT(26)
#define MACB_CAPS_USRIO_HAS_TSUCLK_SOURCE BIT(27)

/* LSO settings */
#define MACB_LSO_UFO_ENABLE 0x01
Expand Down Expand Up @@ -1210,7 +1213,10 @@ struct macb_usrio_config {
u32 rmii;
u32 rgmii;
u32 refclk;
u32 clken;
u32 hdfctlen;
u32 tsu_source;
bool refclk_default_external;
};

struct macb_config {
Expand Down
Loading
Loading