diff options
| -rw-r--r-- | drivers/net/ethernet/ti/Kconfig | 12 | ||||
| -rw-r--r-- | drivers/net/ethernet/ti/Makefile | 6 | ||||
| -rw-r--r-- | drivers/net/ethernet/ti/davinci_cpdma.c | 28 |
3 files changed, 3 insertions, 43 deletions
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig index 8b21b40a9fe5..46f253aadcdd 100644 --- a/drivers/net/ethernet/ti/Kconfig +++ b/drivers/net/ethernet/ti/Kconfig | |||
| @@ -20,7 +20,6 @@ config TI_DAVINCI_EMAC | |||
| 20 | tristate "TI DaVinci EMAC Support" | 20 | tristate "TI DaVinci EMAC Support" |
| 21 | depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 ) || COMPILE_TEST | 21 | depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 ) || COMPILE_TEST |
| 22 | select TI_DAVINCI_MDIO | 22 | select TI_DAVINCI_MDIO |
| 23 | select TI_DAVINCI_CPDMA | ||
| 24 | select PHYLIB | 23 | select PHYLIB |
| 25 | ---help--- | 24 | ---help--- |
| 26 | This driver supports TI's DaVinci Ethernet . | 25 | This driver supports TI's DaVinci Ethernet . |
| @@ -38,16 +37,6 @@ config TI_DAVINCI_MDIO | |||
| 38 | To compile this driver as a module, choose M here: the module | 37 | To compile this driver as a module, choose M here: the module |
| 39 | will be called davinci_mdio. This is recommended. | 38 | will be called davinci_mdio. This is recommended. |
| 40 | 39 | ||
| 41 | config TI_DAVINCI_CPDMA | ||
| 42 | tristate "TI DaVinci CPDMA Support" | ||
| 43 | depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST | ||
| 44 | select GENERIC_ALLOCATOR | ||
| 45 | ---help--- | ||
| 46 | This driver supports TI's DaVinci CPDMA dma engine. | ||
| 47 | |||
| 48 | To compile this driver as a module, choose M here: the module | ||
| 49 | will be called davinci_cpdma. This is recommended. | ||
| 50 | |||
| 51 | config TI_CPSW_PHY_SEL | 40 | config TI_CPSW_PHY_SEL |
| 52 | bool "TI CPSW Phy mode Selection (DEPRECATED)" | 41 | bool "TI CPSW Phy mode Selection (DEPRECATED)" |
| 53 | default n | 42 | default n |
| @@ -63,7 +52,6 @@ config TI_CPSW_ALE | |||
| 63 | config TI_CPSW | 52 | config TI_CPSW |
| 64 | tristate "TI CPSW Switch Support" | 53 | tristate "TI CPSW Switch Support" |
| 65 | depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST | 54 | depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST |
| 66 | select TI_DAVINCI_CPDMA | ||
| 67 | select TI_DAVINCI_MDIO | 55 | select TI_DAVINCI_MDIO |
| 68 | select TI_CPSW_ALE | 56 | select TI_CPSW_ALE |
| 69 | select MFD_SYSCON | 57 | select MFD_SYSCON |
diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile index 0be551de821c..a763e1b27304 100644 --- a/drivers/net/ethernet/ti/Makefile +++ b/drivers/net/ethernet/ti/Makefile | |||
| @@ -8,14 +8,14 @@ obj-$(CONFIG_TI_DAVINCI_EMAC) += cpsw-common.o | |||
| 8 | 8 | ||
| 9 | obj-$(CONFIG_TLAN) += tlan.o | 9 | obj-$(CONFIG_TLAN) += tlan.o |
| 10 | obj-$(CONFIG_CPMAC) += cpmac.o | 10 | obj-$(CONFIG_CPMAC) += cpmac.o |
| 11 | obj-$(CONFIG_TI_DAVINCI_EMAC) += davinci_emac.o | 11 | obj-$(CONFIG_TI_DAVINCI_EMAC) += ti_davinci_emac.o |
| 12 | ti_davinci_emac-y := davinci_emac.o davinci_cpdma.o | ||
| 12 | obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o | 13 | obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o |
| 13 | obj-$(CONFIG_TI_DAVINCI_CPDMA) += davinci_cpdma.o | ||
| 14 | obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o | 14 | obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o |
| 15 | obj-$(CONFIG_TI_CPSW_ALE) += cpsw_ale.o | 15 | obj-$(CONFIG_TI_CPSW_ALE) += cpsw_ale.o |
| 16 | obj-$(CONFIG_TI_CPTS_MOD) += cpts.o | 16 | obj-$(CONFIG_TI_CPTS_MOD) += cpts.o |
| 17 | obj-$(CONFIG_TI_CPSW) += ti_cpsw.o | 17 | obj-$(CONFIG_TI_CPSW) += ti_cpsw.o |
| 18 | ti_cpsw-y := cpsw.o | 18 | ti_cpsw-y := cpsw.o davinci_cpdma.o |
| 19 | 19 | ||
| 20 | obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o | 20 | obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o |
| 21 | keystone_netcp-y := netcp_core.o | 21 | keystone_netcp-y := netcp_core.o |
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c index 41203714eda4..35bf14d8e7af 100644 --- a/drivers/net/ethernet/ti/davinci_cpdma.c +++ b/drivers/net/ethernet/ti/davinci_cpdma.c | |||
| @@ -520,7 +520,6 @@ struct cpdma_ctlr *cpdma_ctlr_create(struct cpdma_params *params) | |||
| 520 | ctlr->num_chan = CPDMA_MAX_CHANNELS; | 520 | ctlr->num_chan = CPDMA_MAX_CHANNELS; |
| 521 | return ctlr; | 521 | return ctlr; |
| 522 | } | 522 | } |
| 523 | EXPORT_SYMBOL_GPL(cpdma_ctlr_create); | ||
| 524 | 523 | ||
| 525 | int cpdma_ctlr_start(struct cpdma_ctlr *ctlr) | 524 | int cpdma_ctlr_start(struct cpdma_ctlr *ctlr) |
| 526 | { | 525 | { |
| @@ -581,7 +580,6 @@ int cpdma_ctlr_start(struct cpdma_ctlr *ctlr) | |||
| 581 | spin_unlock_irqrestore(&ctlr->lock, flags); | 580 | spin_unlock_irqrestore(&ctlr->lock, flags); |
| 582 | return 0; | 581 | return 0; |
| 583 | } | 582 | } |
| 584 | EXPORT_SYMBOL_GPL(cpdma_ctlr_start); | ||
| 585 | 583 | ||
| 586 | int cpdma_ctlr_stop(struct cpdma_ctlr *ctlr) | 584 | int cpdma_ctlr_stop(struct cpdma_ctlr *ctlr) |
| 587 | { | 585 | { |
| @@ -614,7 +612,6 @@ int cpdma_ctlr_stop(struct cpdma_ctlr *ctlr) | |||
| 614 | spin_unlock_irqrestore(&ctlr->lock, flags); | 612 | spin_unlock_irqrestore(&ctlr->lock, flags); |
| 615 | return 0; | 613 | return 0; |
| 616 | } | 614 | } |
| 617 | EXPORT_SYMBOL_GPL(cpdma_ctlr_stop); | ||
| 618 | 615 | ||
| 619 | int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr) | 616 | int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr) |
| 620 | { | 617 | { |
| @@ -632,7 +629,6 @@ int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr) | |||
| 632 | cpdma_desc_pool_destroy(ctlr); | 629 | cpdma_desc_pool_destroy(ctlr); |
| 633 | return ret; | 630 | return ret; |
| 634 | } | 631 | } |
| 635 | EXPORT_SYMBOL_GPL(cpdma_ctlr_destroy); | ||
| 636 | 632 | ||
| 637 | int cpdma_ctlr_int_ctrl(struct cpdma_ctlr *ctlr, bool enable) | 633 | int cpdma_ctlr_int_ctrl(struct cpdma_ctlr *ctlr, bool enable) |
| 638 | { | 634 | { |
| @@ -653,25 +649,21 @@ int cpdma_ctlr_int_ctrl(struct cpdma_ctlr *ctlr, bool enable) | |||
| 653 | spin_unlock_irqrestore(&ctlr->lock, flags); | 649 | spin_unlock_irqrestore(&ctlr->lock, flags); |
| 654 | return 0; | 650 | return 0; |
| 655 | } | 651 | } |
| 656 | EXPORT_SYMBOL_GPL(cpdma_ctlr_int_ctrl); | ||
| 657 | 652 | ||
| 658 | void cpdma_ctlr_eoi(struct cpdma_ctlr *ctlr, u32 value) | 653 | void cpdma_ctlr_eoi(struct cpdma_ctlr *ctlr, u32 value) |
| 659 | { | 654 | { |
| 660 | dma_reg_write(ctlr, CPDMA_MACEOIVECTOR, value); | 655 | dma_reg_write(ctlr, CPDMA_MACEOIVECTOR, value); |
| 661 | } | 656 | } |
| 662 | EXPORT_SYMBOL_GPL(cpdma_ctlr_eoi); | ||
| 663 | 657 | ||
| 664 | u32 cpdma_ctrl_rxchs_state(struct cpdma_ctlr *ctlr) | 658 | u32 cpdma_ctrl_rxchs_state(struct cpdma_ctlr *ctlr) |
| 665 | { | 659 | { |
| 666 | return dma_reg_read(ctlr, CPDMA_RXINTSTATMASKED); | 660 | return dma_reg_read(ctlr, CPDMA_RXINTSTATMASKED); |
| 667 | } | 661 | } |
| 668 | EXPORT_SYMBOL_GPL(cpdma_ctrl_rxchs_state); | ||
| 669 | 662 | ||
| 670 | u32 cpdma_ctrl_txchs_state(struct cpdma_ctlr *ctlr) | 663 | u32 cpdma_ctrl_txchs_state(struct cpdma_ctlr *ctlr) |
| 671 | { | 664 | { |
| 672 | return dma_reg_read(ctlr, CPDMA_TXINTSTATMASKED); | 665 | return dma_reg_read(ctlr, CPDMA_TXINTSTATMASKED); |
| 673 | } | 666 | } |
| 674 | EXPORT_SYMBOL_GPL(cpdma_ctrl_txchs_state); | ||
| 675 | 667 | ||
| 676 | static void cpdma_chan_set_descs(struct cpdma_ctlr *ctlr, | 668 | static void cpdma_chan_set_descs(struct cpdma_ctlr *ctlr, |
| 677 | int rx, int desc_num, | 669 | int rx, int desc_num, |
| @@ -767,7 +759,6 @@ int cpdma_chan_split_pool(struct cpdma_ctlr *ctlr) | |||
| 767 | 759 | ||
| 768 | return 0; | 760 | return 0; |
| 769 | } | 761 | } |
| 770 | EXPORT_SYMBOL_GPL(cpdma_chan_split_pool); | ||
| 771 | 762 | ||
| 772 | 763 | ||
| 773 | /* cpdma_chan_set_weight - set weight of a channel in percentage. | 764 | /* cpdma_chan_set_weight - set weight of a channel in percentage. |
| @@ -800,7 +791,6 @@ int cpdma_chan_set_weight(struct cpdma_chan *ch, int weight) | |||
| 800 | spin_unlock_irqrestore(&ctlr->lock, flags); | 791 | spin_unlock_irqrestore(&ctlr->lock, flags); |
| 801 | return ret; | 792 | return ret; |
| 802 | } | 793 | } |
| 803 | EXPORT_SYMBOL_GPL(cpdma_chan_set_weight); | ||
| 804 | 794 | ||
| 805 | /* cpdma_chan_get_min_rate - get minimum allowed rate for channel | 795 | /* cpdma_chan_get_min_rate - get minimum allowed rate for channel |
| 806 | * Should be called before cpdma_chan_set_rate. | 796 | * Should be called before cpdma_chan_set_rate. |
| @@ -815,7 +805,6 @@ u32 cpdma_chan_get_min_rate(struct cpdma_ctlr *ctlr) | |||
| 815 | 805 | ||
| 816 | return DIV_ROUND_UP(divident, divisor); | 806 | return DIV_ROUND_UP(divident, divisor); |
| 817 | } | 807 | } |
| 818 | EXPORT_SYMBOL_GPL(cpdma_chan_get_min_rate); | ||
| 819 | 808 | ||
| 820 | /* cpdma_chan_set_rate - limits bandwidth for transmit channel. | 809 | /* cpdma_chan_set_rate - limits bandwidth for transmit channel. |
| 821 | * The bandwidth * limited channels have to be in order beginning from lowest. | 810 | * The bandwidth * limited channels have to be in order beginning from lowest. |
| @@ -860,7 +849,6 @@ err: | |||
| 860 | spin_unlock_irqrestore(&ctlr->lock, flags); | 849 | spin_unlock_irqrestore(&ctlr->lock, flags); |
| 861 | return ret; | 850 | return ret; |
| 862 | } | 851 | } |
| 863 | EXPORT_SYMBOL_GPL(cpdma_chan_set_rate); | ||
| 864 | 852 | ||
| 865 | u32 cpdma_chan_get_rate(struct cpdma_chan *ch) | 853 | u32 cpdma_chan_get_rate(struct cpdma_chan *ch) |
| 866 | { | 854 | { |
| @@ -873,7 +861,6 @@ u32 cpdma_chan_get_rate(struct cpdma_chan *ch) | |||
| 873 | 861 | ||
| 874 | return rate; | 862 | return rate; |
| 875 | } | 863 | } |
| 876 | EXPORT_SYMBOL_GPL(cpdma_chan_get_rate); | ||
| 877 | 864 | ||
| 878 | struct cpdma_chan *cpdma_chan_create(struct cpdma_ctlr *ctlr, int chan_num, | 865 | struct cpdma_chan *cpdma_chan_create(struct cpdma_ctlr *ctlr, int chan_num, |
| 879 | cpdma_handler_fn handler, int rx_type) | 866 | cpdma_handler_fn handler, int rx_type) |
| @@ -933,7 +920,6 @@ struct cpdma_chan *cpdma_chan_create(struct cpdma_ctlr *ctlr, int chan_num, | |||
| 933 | spin_unlock_irqrestore(&ctlr->lock, flags); | 920 | spin_unlock_irqrestore(&ctlr->lock, flags); |
| 934 | return chan; | 921 | return chan; |
| 935 | } | 922 | } |
| 936 | EXPORT_SYMBOL_GPL(cpdma_chan_create); | ||
| 937 | 923 | ||
| 938 | int cpdma_chan_get_rx_buf_num(struct cpdma_chan *chan) | 924 | int cpdma_chan_get_rx_buf_num(struct cpdma_chan *chan) |
| 939 | { | 925 | { |
| @@ -946,7 +932,6 @@ int cpdma_chan_get_rx_buf_num(struct cpdma_chan *chan) | |||
| 946 | 932 | ||
| 947 | return desc_num; | 933 | return desc_num; |
| 948 | } | 934 | } |
| 949 | EXPORT_SYMBOL_GPL(cpdma_chan_get_rx_buf_num); | ||
| 950 | 935 | ||
| 951 | int cpdma_chan_destroy(struct cpdma_chan *chan) | 936 | int cpdma_chan_destroy(struct cpdma_chan *chan) |
| 952 | { | 937 | { |
| @@ -968,7 +953,6 @@ int cpdma_chan_destroy(struct cpdma_chan *chan) | |||
| 968 | spin_unlock_irqrestore(&ctlr->lock, flags); | 953 | spin_unlock_irqrestore(&ctlr->lock, flags); |
| 969 | return 0; | 954 | return 0; |
| 970 | } | 955 | } |
| 971 | EXPORT_SYMBOL_GPL(cpdma_chan_destroy); | ||
| 972 | 956 | ||
| 973 | int cpdma_chan_get_stats(struct cpdma_chan *chan, | 957 | int cpdma_chan_get_stats(struct cpdma_chan *chan, |
| 974 | struct cpdma_chan_stats *stats) | 958 | struct cpdma_chan_stats *stats) |
| @@ -981,7 +965,6 @@ int cpdma_chan_get_stats(struct cpdma_chan *chan, | |||
| 981 | spin_unlock_irqrestore(&chan->lock, flags); | 965 | spin_unlock_irqrestore(&chan->lock, flags); |
| 982 | return 0; | 966 | return 0; |
| 983 | } | 967 | } |
| 984 | EXPORT_SYMBOL_GPL(cpdma_chan_get_stats); | ||
| 985 | 968 | ||
| 986 | static void __cpdma_chan_submit(struct cpdma_chan *chan, | 969 | static void __cpdma_chan_submit(struct cpdma_chan *chan, |
| 987 | struct cpdma_desc __iomem *desc) | 970 | struct cpdma_desc __iomem *desc) |
| @@ -1088,7 +1071,6 @@ unlock_ret: | |||
| 1088 | spin_unlock_irqrestore(&chan->lock, flags); | 1071 | spin_unlock_irqrestore(&chan->lock, flags); |
| 1089 | return ret; | 1072 | return ret; |
| 1090 | } | 1073 | } |
| 1091 | EXPORT_SYMBOL_GPL(cpdma_chan_submit); | ||
| 1092 | 1074 | ||
| 1093 | bool cpdma_check_free_tx_desc(struct cpdma_chan *chan) | 1075 | bool cpdma_check_free_tx_desc(struct cpdma_chan *chan) |
| 1094 | { | 1076 | { |
| @@ -1103,7 +1085,6 @@ bool cpdma_check_free_tx_desc(struct cpdma_chan *chan) | |||
| 1103 | spin_unlock_irqrestore(&chan->lock, flags); | 1085 | spin_unlock_irqrestore(&chan->lock, flags); |
| 1104 | return free_tx_desc; | 1086 | return free_tx_desc; |
| 1105 | } | 1087 | } |
| 1106 | EXPORT_SYMBOL_GPL(cpdma_check_free_tx_desc); | ||
| 1107 | 1088 | ||
| 1108 | static void __cpdma_chan_free(struct cpdma_chan *chan, | 1089 | static void __cpdma_chan_free(struct cpdma_chan *chan, |
| 1109 | struct cpdma_desc __iomem *desc, | 1090 | struct cpdma_desc __iomem *desc, |
| @@ -1197,7 +1178,6 @@ int cpdma_chan_process(struct cpdma_chan *chan, int quota) | |||
| 1197 | } | 1178 | } |
| 1198 | return used; | 1179 | return used; |
| 1199 | } | 1180 | } |
| 1200 | EXPORT_SYMBOL_GPL(cpdma_chan_process); | ||
| 1201 | 1181 | ||
| 1202 | int cpdma_chan_start(struct cpdma_chan *chan) | 1182 | int cpdma_chan_start(struct cpdma_chan *chan) |
| 1203 | { | 1183 | { |
| @@ -1217,7 +1197,6 @@ int cpdma_chan_start(struct cpdma_chan *chan) | |||
| 1217 | 1197 | ||
| 1218 | return 0; | 1198 | return 0; |
| 1219 | } | 1199 | } |
| 1220 | EXPORT_SYMBOL_GPL(cpdma_chan_start); | ||
| 1221 | 1200 | ||
| 1222 | int cpdma_chan_stop(struct cpdma_chan *chan) | 1201 | int cpdma_chan_stop(struct cpdma_chan *chan) |
| 1223 | { | 1202 | { |
| @@ -1280,7 +1259,6 @@ int cpdma_chan_stop(struct cpdma_chan *chan) | |||
| 1280 | spin_unlock_irqrestore(&chan->lock, flags); | 1259 | spin_unlock_irqrestore(&chan->lock, flags); |
| 1281 | return 0; | 1260 | return 0; |
| 1282 | } | 1261 | } |
| 1283 | EXPORT_SYMBOL_GPL(cpdma_chan_stop); | ||
| 1284 | 1262 | ||
| 1285 | int cpdma_chan_int_ctrl(struct cpdma_chan *chan, bool enable) | 1263 | int cpdma_chan_int_ctrl(struct cpdma_chan *chan, bool enable) |
| 1286 | { | 1264 | { |
| @@ -1322,25 +1300,19 @@ int cpdma_control_set(struct cpdma_ctlr *ctlr, int control, int value) | |||
| 1322 | 1300 | ||
| 1323 | return ret; | 1301 | return ret; |
| 1324 | } | 1302 | } |
| 1325 | EXPORT_SYMBOL_GPL(cpdma_control_set); | ||
| 1326 | 1303 | ||
| 1327 | int cpdma_get_num_rx_descs(struct cpdma_ctlr *ctlr) | 1304 | int cpdma_get_num_rx_descs(struct cpdma_ctlr *ctlr) |
| 1328 | { | 1305 | { |
| 1329 | return ctlr->num_rx_desc; | 1306 | return ctlr->num_rx_desc; |
| 1330 | } | 1307 | } |
| 1331 | EXPORT_SYMBOL_GPL(cpdma_get_num_rx_descs); | ||
| 1332 | 1308 | ||
| 1333 | int cpdma_get_num_tx_descs(struct cpdma_ctlr *ctlr) | 1309 | int cpdma_get_num_tx_descs(struct cpdma_ctlr *ctlr) |
| 1334 | { | 1310 | { |
| 1335 | return ctlr->num_tx_desc; | 1311 | return ctlr->num_tx_desc; |
| 1336 | } | 1312 | } |
| 1337 | EXPORT_SYMBOL_GPL(cpdma_get_num_tx_descs); | ||
| 1338 | 1313 | ||
| 1339 | void cpdma_set_num_rx_descs(struct cpdma_ctlr *ctlr, int num_rx_desc) | 1314 | void cpdma_set_num_rx_descs(struct cpdma_ctlr *ctlr, int num_rx_desc) |
| 1340 | { | 1315 | { |
| 1341 | ctlr->num_rx_desc = num_rx_desc; | 1316 | ctlr->num_rx_desc = num_rx_desc; |
| 1342 | ctlr->num_tx_desc = ctlr->pool->num_desc - ctlr->num_rx_desc; | 1317 | ctlr->num_tx_desc = ctlr->pool->num_desc - ctlr->num_rx_desc; |
| 1343 | } | 1318 | } |
| 1344 | EXPORT_SYMBOL_GPL(cpdma_set_num_rx_descs); | ||
| 1345 | |||
| 1346 | MODULE_LICENSE("GPL"); | ||
