Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 68 additions & 3 deletions Documentation/devicetree/bindings/net/cdns,macb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,23 @@ properties:

cdns,refclk-ext:
type: boolean
deprecated: true
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.

This property has been replaced by cdns,refclk-source, as it only works
for devices that use an internal reference clock by default.

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 +150,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 +205,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 +224,43 @@ allOf:
required:
- phys

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

- if:
not:
properties:
compatible:
contains:
const: microchip,sama7g5-gem
then:
properties:
cdns,refclk-ext: 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
8 changes: 8 additions & 0 deletions drivers/net/ethernet/cadence/macb.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@
#define GEM_IRQCOR_SIZE 1
#define GEM_DBWDEF_OFFSET 25
#define GEM_DBWDEF_SIZE 3
#define GEM_USERIO_OFFSET 9
#define GEM_USERIO_SIZE 1
#define GEM_NO_PCS_OFFSET 0
#define GEM_NO_PCS_SIZE 1

Expand Down Expand Up @@ -779,6 +781,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 +1215,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