Skip to content

Commit

Permalink
net: hix5hd2_gmac: add generic compatible string
Browse files Browse the repository at this point in the history
The "hix5hd2" is SoC name, add the generic ethernet driver name.
The "hisi-gemac-v1" is the basic version and "hisi-gemac-v2" adds
the SG/TXCSUM/TSO/UFO features.

Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
zephyrbird authored and davem330 committed Dec 6, 2016
1 parent 2bfcfcd commit d0fb6ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
Hisilicon hix5hd2 gmac controller

Required properties:
- compatible: should be "hisilicon,hix5hd2-gmac".
- compatible: should contain one of the following SoC strings:
* "hisilicon,hix5hd2-gemac"
* "hisilicon,hi3798cv200-gemac"
and one of the following version string:
* "hisilicon,hisi-gemac-v1"
* "hisilicon,hisi-gemac-v2"
- reg: specifies base physical address(s) and size of the device registers.
The first region is the MAC register base and size.
The second region is external interface control register.
Expand All @@ -20,7 +25,7 @@ Required properties:

Example:
gmac0: ethernet@f9840000 {
compatible = "hisilicon,hix5hd2-gmac";
compatible = "hisilicon,hix5hd2-gemac", "hisilicon,hisi-gemac-v1";
reg = <0xf9840000 0x1000>,<0xf984300c 0x4>;
interrupts = <0 71 4>;
#address-cells = <1>;
Expand Down
15 changes: 11 additions & 4 deletions drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
#define dma_cnt(n) ((n) >> 5)
#define dma_byte(n) ((n) << 5)

#define HW_CAP_TSO BIT(0)
#define GEMAC_V1 0
#define GEMAC_V2 (GEMAC_V1 | HW_CAP_TSO)

struct hix5hd2_desc {
__le32 buff_addr;
__le32 cmd;
Expand Down Expand Up @@ -1021,15 +1025,18 @@ static int hix5hd2_dev_remove(struct platform_device *pdev)
}

static const struct of_device_id hix5hd2_of_match[] = {
{.compatible = "hisilicon,hix5hd2-gmac",},
{ .compatible = "hisilicon,hisi-gemac-v1", .data = (void *)GEMAC_V1 },
{ .compatible = "hisilicon,hisi-gemac-v2", .data = (void *)GEMAC_V2 },
{ .compatible = "hisilicon,hix5hd2-gemac", .data = (void *)GEMAC_V1 },
{ .compatible = "hisilicon,hi3798cv200-gemac", .data = (void *)GEMAC_V2 },
{},
};

MODULE_DEVICE_TABLE(of, hix5hd2_of_match);

static struct platform_driver hix5hd2_dev_driver = {
.driver = {
.name = "hix5hd2-gmac",
.name = "hisi-gemac",
.of_match_table = hix5hd2_of_match,
},
.probe = hix5hd2_dev_probe,
Expand All @@ -1038,6 +1045,6 @@ static struct platform_driver hix5hd2_dev_driver = {

module_platform_driver(hix5hd2_dev_driver);

MODULE_DESCRIPTION("HISILICON HIX5HD2 Ethernet driver");
MODULE_DESCRIPTION("HISILICON Gigabit Ethernet MAC driver");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:hix5hd2-gmac");
MODULE_ALIAS("platform:hisi-gemac");

0 comments on commit d0fb6ba

Please sign in to comment.