2016-12-24 10:58:38 +08:00
|
|
|
# Kconfig - Atmel SAM Ethernet (GMAC) driver configuration options
|
|
|
|
#
|
|
|
|
# Copyright (c) 2016 Piotr Mienkowski
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
|
|
|
|
|
|
|
menuconfig ETH_SAM_GMAC
|
2018-08-14 22:19:20 +08:00
|
|
|
bool "Atmel SAM Ethernet driver"
|
2018-12-28 02:10:14 +08:00
|
|
|
depends on SOC_FAMILY_SAM
|
2018-12-08 08:49:12 +08:00
|
|
|
select NOCACHE_MEMORY
|
2016-12-24 10:58:38 +08:00
|
|
|
help
|
|
|
|
Enable Atmel SAM MCU Family Ethernet driver.
|
|
|
|
|
|
|
|
if ETH_SAM_GMAC
|
2017-04-23 03:47:58 +08:00
|
|
|
|
2016-12-24 10:58:38 +08:00
|
|
|
config ETH_SAM_GMAC_NAME
|
|
|
|
string "Device name"
|
|
|
|
default "ETH_0"
|
|
|
|
help
|
|
|
|
Device name allows user to obtain a handle to the device object
|
|
|
|
required by all driver API functions. Device name has to be unique.
|
|
|
|
|
2018-06-19 16:01:16 +08:00
|
|
|
config ETH_SAM_GMAC_QUEUES
|
|
|
|
int "Number of hardware TX and RX queues"
|
|
|
|
default 1
|
|
|
|
range 1 3
|
|
|
|
help
|
|
|
|
Select the number of hardware queues used by the driver. Packets will be
|
|
|
|
routed to appropriate queues based on their priority.
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_TX_TIMEOUT_MSEC
|
|
|
|
int "TX timeout"
|
|
|
|
default 5000
|
|
|
|
range 1000 10000
|
|
|
|
help
|
|
|
|
The maximum time in msec that the driver will wait for a TX interrupt
|
|
|
|
after scheduling a packet to be sent. If no interrupt is reported during
|
|
|
|
that period, all TX packets in the queue will be discarded.
|
|
|
|
|
2017-04-03 23:14:35 +08:00
|
|
|
config ETH_SAM_GMAC_BUF_RX_COUNT
|
2017-04-22 01:29:51 +08:00
|
|
|
int "Network RX buffers preallocated by the SAM ETH driver"
|
2017-03-15 08:30:35 +08:00
|
|
|
default 18
|
2016-12-24 10:58:38 +08:00
|
|
|
help
|
2017-04-03 23:14:35 +08:00
|
|
|
Number of network buffers that will be permanently allocated by the
|
|
|
|
Ethernet driver. These buffers are used in receive path. They are
|
2017-04-22 01:29:51 +08:00
|
|
|
preallocated by the driver and made available to the GMAC module to be
|
2016-12-24 10:58:38 +08:00
|
|
|
filled in with incoming data. Their number has to be large enough to fit
|
|
|
|
at least one complete Ethernet frame. SAM ETH driver will always allocate
|
2017-04-03 23:14:35 +08:00
|
|
|
that amount of buffers for itself thus reducing the NET_BUF_RX_COUNT
|
2017-03-15 08:30:35 +08:00
|
|
|
which is a total amount of RX data buffers used by the whole networking
|
2017-04-03 23:14:35 +08:00
|
|
|
stack. One has to ensure that NET_PKT_RX_COUNT is large enough to
|
2017-04-22 01:29:51 +08:00
|
|
|
fit at least two Ethernet frames: one being received by the GMAC module
|
|
|
|
and the other being processed by the higher layer networking stack.
|
2016-12-24 10:58:38 +08:00
|
|
|
|
|
|
|
config ETH_SAM_GMAC_IRQ_PRI
|
|
|
|
int "Interrupt priority"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
IRQ priority of Ethernet device
|
|
|
|
|
2017-04-23 03:47:58 +08:00
|
|
|
choice ETH_SAM_GMAC_MAC_SELECT
|
|
|
|
prompt "MAC address"
|
|
|
|
help
|
|
|
|
Choose how to configure MAC address.
|
|
|
|
|
2017-07-02 20:42:44 +08:00
|
|
|
config ETH_SAM_GMAC_MAC_MANUAL
|
|
|
|
bool "Manual"
|
|
|
|
help
|
|
|
|
Assign an arbitrary MAC address.
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC_I2C_EEPROM
|
|
|
|
bool "Read from an I2C EEPROM"
|
|
|
|
help
|
|
|
|
Read MAC address from an I2C EEPROM.
|
2017-04-23 03:47:58 +08:00
|
|
|
|
2018-09-27 16:51:49 +08:00
|
|
|
config ETH_SAM_GMAC_RANDOM_MAC
|
|
|
|
bool "Random MAC address"
|
|
|
|
help
|
|
|
|
Generate a random MAC address dynamically.
|
|
|
|
|
2017-04-23 03:47:58 +08:00
|
|
|
endchoice
|
|
|
|
|
|
|
|
if ETH_SAM_GMAC_MAC_MANUAL
|
|
|
|
|
2016-12-24 10:58:38 +08:00
|
|
|
config ETH_SAM_GMAC_MAC0
|
|
|
|
hex "MAC Address Byte 0"
|
|
|
|
default 0
|
|
|
|
range 0 0xff
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC1
|
|
|
|
hex "MAC Address Byte 1"
|
|
|
|
default 0
|
|
|
|
range 0 0xff
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC2
|
|
|
|
hex "MAC Address Byte 2"
|
|
|
|
default 0
|
|
|
|
range 0 0xff
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC3
|
|
|
|
hex "MAC Address Byte 3"
|
|
|
|
default 0
|
|
|
|
range 0 0xff
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC4
|
|
|
|
hex "MAC Address Byte 4"
|
|
|
|
default 0
|
|
|
|
range 0 0xff
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC5
|
|
|
|
hex "MAC Address Byte 5"
|
|
|
|
default 0
|
|
|
|
range 0 0xff
|
2017-04-23 03:47:58 +08:00
|
|
|
|
|
|
|
endif # ETH_SAM_GMAC_MAC_MANUAL
|
|
|
|
|
|
|
|
if ETH_SAM_GMAC_MAC_I2C_EEPROM
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC_I2C_SLAVE_ADDRESS
|
|
|
|
hex "I2C 7-bit EEPROM chip address"
|
|
|
|
range 0 0xff
|
|
|
|
help
|
|
|
|
I2C 7-bit address of the EEPROM chip.
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC_I2C_INT_ADDRESS
|
|
|
|
hex "I2C EEPROM internal address"
|
|
|
|
range 0 0xffffffff
|
|
|
|
help
|
|
|
|
Internal address of the EEPROM chip where the MAC address is stored.
|
|
|
|
Chips with 1 to 4 byte internal address size are supported. Address
|
|
|
|
size has to be configured in a separate Kconfig option.
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC_I2C_INT_ADDRESS_SIZE
|
|
|
|
int "I2C EEPROM internal address size"
|
|
|
|
default 1
|
|
|
|
range 1 4
|
2016-12-24 10:58:38 +08:00
|
|
|
help
|
2017-04-23 03:47:58 +08:00
|
|
|
Size (in bytes) of the internal EEPROM address.
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MAC_I2C_DEV_NAME
|
|
|
|
string "I2C bus driver device name"
|
|
|
|
help
|
2017-05-06 06:37:53 +08:00
|
|
|
Device name, e.g. I2C_0, of an I2C bus driver device. It is required to
|
2017-04-23 03:47:58 +08:00
|
|
|
obtain handle to the I2C device object.
|
|
|
|
|
|
|
|
endif # ETH_SAM_GMAC_MAC_I2C_EEPROM
|
2016-12-24 10:58:38 +08:00
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "MII/RMII Interface to the Physical Layer"
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_RMII
|
|
|
|
bool "RMII"
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_MII
|
|
|
|
bool "MII"
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
config ETH_SAM_GMAC_PHY_ADDR
|
|
|
|
int "GMAC PHY Address"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
GMAC PHY Address as used by IEEE 802.3, Section 2 MII compatible PHY
|
|
|
|
transceivers. If you have a single PHY on board it is safe to leave it
|
|
|
|
at 0 which is the broadcast address.
|
|
|
|
|
2018-04-18 22:13:05 +08:00
|
|
|
config PTP_CLOCK_SAM_GMAC
|
|
|
|
bool "SAM GMAC PTP clock driver support"
|
Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.
There are at least three problems with the patch:
1. It's inconsistent with how Kconfig works in other projects, which
might confuse newcomers.
2. Due to oversights, earlier 'range' properties are still preferred,
as well as earlier 'default' properties on choices.
In addition to being inconsistent, this makes it impossible to
override 'range' properties and choice 'default' properties if the
base definition of the symbol/choice already has 'range'/'default'
properties.
I've seen errors caused by the inconsistency, and I suspect there
are more.
3. A fork of Kconfiglib that adds the patch needs to be maintained.
Get rid of the patch and go back to standard Kconfig behavior, as
follows:
1. Include the Kconfig.defconfig files first instead of last in
Kconfig.zephyr.
2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
last in arch/Kconfig.
3. Include arch/<arch>/soc/*/Kconfig first instead of last in
arch/<arch>/Kconfig.
4. Swap a few other 'source's to preserve behavior for some scattered
symbols with multiple definitions.
Swap 'source's in some no-op cases too, where it might match the
intent.
5. Reverse the defaults on symbol definitions that have more than one
default.
Skip defaults that are mutually exclusive, e.g. where each default
has an 'if <some board>' condition. They are already safe.
6. Remove the prefer-later-defaults patch from Kconfiglib.
Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions
As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).
This commit includes some default-related cleanups as well:
- Simplify some symbol definitions, e.g. where a default has 'if FOO'
when the symbol already has 'depends on FOO'.
- Remove some redundant 'default ""' for string symbols. This is the
implicit default.
Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).
Piggyback some fixes for style nits too, e.g. unindented help texts.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-07-30 16:57:47 +08:00
|
|
|
default y
|
2018-04-18 22:13:05 +08:00
|
|
|
select PTP_CLOCK
|
|
|
|
depends on NET_GPTP
|
|
|
|
help
|
|
|
|
Enable SAM GMAC PTP Clock support.
|
|
|
|
|
2016-12-24 10:58:38 +08:00
|
|
|
endif # ETH_SAM_GMAC
|