config MS_GMAC
select NET
select NET_ETHERNET
select MII
select PACKET
select USE_POLICY_FWD
select INET
select NETDEVICES

tristate "GMAC"
default n

---help---
Enable compilation option for driver GMAC

if MS_GMAC
menu "MStar GMAC Driver"


choice
    prompt "Default Select PadMux"
    default GMAC_TO_RMII
    depends on MSTAR_KANO || ARCH_INFINITY2

#config KANO_GMAC1_EPHY
#bool "GMAC1 + Internal EPHY"
#help
#    GMAC1 + Internal EPHY

config KANO_GMAC0_GPHY
bool "GMAC0 + RGMII GPHY"
help
    GMAC0 + RGMII GPHY

config GMAC_TO_RMII
bool "GMAC0 + RMII EPHY"
help
    GMAC0 + RMII EPHY

config KANO_GMAC1_GPHY
bool "GMAC1 + RGMII GPHY"
help
    GMAC1 + RGMII GPHY

config GMAC1_TO_RMII
bool "GMAC1 + RMII EPHY"
help
    GMAC1 + RMII EPHY
endchoice

choice
    prompt "Force MAC mode"
    default GMAC_DETECT_FROM_PHY

config GMAC_DETECT_FROM_PHY
bool "Auto-polling speed&duplex from phy"

config GMAC_FORCE_MAC_SPEED_100
bool "Force MAC speed to 100M"
depends on GMAC1_TO_RMII || GMAC_TO_RMII
endchoice

config  GMAC_EXT_PHY_ADDR
    hex "Phy Address"
    default 0x1

config GMAC_RX_Memory_Copy
bool "Memory_Copy"

choice
    prompt "Select RX Method"
    default GMAC_Memory_Copy

config GMAC_RX_Memory_Copy
bool "Memory_Copy"
help
    Use memcpy and additional RX buffer for RX callback function

config GMAC_RX_DMA
bool "DMA"
help
    GMAC Direct access Kernel Memory in RX callback function.
    K6, K6lite, k7 can only use one MIU for kernel Memory.

endchoice

config GMAC_RX_NAPI
bool "Enable RX_NAPI"
default y
help
    Enable NAPI Method. Disable interrupt during heavy tracffic.


config GMAC_RX_NAPI_WEIGHT
int "RX_NAPI_WEIGHT"
depends on GMAC_RX_NAPI
default 64
help
    NAPI Weight


config GMAC_RX_GRO
bool "Enable RX_GRO"
default y
help
    Enable Generic receive offload. Merge packet with same destination and source


config GMAC_RX_DELAY_INTERRUPT
bool "Enable RX Delay Interrupt"
default y
help
    Enable RX Delay Interrupt. Reduce interrupt number.


config GMAC_DELAY_INTERRUPT_NUMBER
int "Packet Threshold"
depends on GMAC_RX_DELAY_INTERRUPT
default 64
help
    MAX 255

config GMAC_DELAY_INTERRUPT_TIMEOUT
int "Timeout"
depends on GMAC_RX_DELAY_INTERRUPT
default 6
help
    MAX 255

choice
    prompt "Select TX Queue"
    default GMAC_TX_DESC_MODE if MSTAR_K6Lite
    default GMAC_NEW_TX_QUEUE_V3 if MSTAR_K6
    default GMAC_TX_4_QUEUE

config GMAC_TX_4_QUEUE
bool "Default TX Queue"
help
    Use default TX Queue 4.

config GMAC_NEW_TX_QUEUE_V3
bool "Enable Additional New TX Queue"
depends on MSTAR_K6Lite || MSTAR_K6 || ARCH_INFINITY2
help
    Enable New TX Queue. Larger TX Queue. Kayla support

config GMAC_TX_DESC_MODE
bool "Enable TX dexcriptor Mode"
depends on MSTAR_K6Lite || ARCH_INFINITY2
help
    Enable TX dexcriptor Mode. Use DRAM for TX QUEUE.
endchoice

config GMAC_NEW_TX_QUEUE_THRESHOLD_V3
int "New TX Queue Threshold"
depends on GMAC_NEW_TX_QUEUE_V3
default 60
help
    MAX 63

config GMAC_SUPPLY_RNG
bool "Supply to random number generator device"
default n
help
    Supply to random number generator device


config MSTAR_GMAC_HW_TX_CHECKSUM
bool "Supply to hardware TX checksum"
default n
help
    Supply to hardware TX checksum

config MSTAR_GMAC_JUMBO_PACKET
bool "Supply to jumbo packet"
default n
help
    Supply to jumbo packet

endmenu #"MStar GMAC Driver"

endif
