]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ti: keystone: dma: Migrate to Kconfig
authorTom Rini <trini@konsulko.com>
Mon, 13 Sep 2021 00:32:25 +0000 (20:32 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 28 Sep 2021 01:38:34 +0000 (21:38 -0400)
Move the main option for handling drivers/dma/keystone_nav* to Kconfig,
and enable it by default.  All of the sub-symbols are not configurable,
so remove them from the CONFIG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
drivers/dma/Kconfig
drivers/dma/keystone_nav.c
drivers/dma/keystone_nav_cfg.c
include/configs/ti_armv7_keystone2.h

index bbeec794df962d2d07e6cd907935ae15fe51873b..9cacea88d0cb9ebfd94a63fb967ebbcbd5744b6d 100644 (file)
@@ -53,6 +53,14 @@ config TI_EDMA3
          This driver support data transfer between memory
          regions.
 
+config TI_KSNAV
+       bool "TI Keystone Navigator DMA driver"
+       depends on ARCH_KEYSTONE
+       default y
+       select DMA_LEGACY
+       help
+         Enable the Keystone Navigator driver for Keystone 2 platforms.
+
 config APBH_DMA
        bool "Support APBH DMA"
        depends on MX23 || MX28 || MX6 || MX7 || IMX8 || IMX8M
index 443e4b23669a2b0ae2fd4e87a7d70fe226718257..9a5ba79f3fe523d404dbe3d7b72021c58548785a 100644 (file)
 #include <linux/delay.h>
 
 struct qm_config qm_memmap = {
-       .stat_cfg       = CONFIG_KSNAV_QM_QUEUE_STATUS_BASE,
-       .queue          = (void *)CONFIG_KSNAV_QM_MANAGER_QUEUES_BASE,
-       .mngr_vbusm     = CONFIG_KSNAV_QM_BASE_ADDRESS,
-       .i_lram         = CONFIG_KSNAV_QM_LINK_RAM_BASE,
-       .proxy          = (void *)CONFIG_KSNAV_QM_MANAGER_Q_PROXY_BASE,
-       .status_ram     = CONFIG_KSNAV_QM_STATUS_RAM_BASE,
-       .mngr_cfg       = (void *)CONFIG_KSNAV_QM_CONF_BASE,
-       .intd_cfg       = CONFIG_KSNAV_QM_INTD_CONF_BASE,
-       .desc_mem       = (void *)CONFIG_KSNAV_QM_DESC_SETUP_BASE,
-       .region_num     = CONFIG_KSNAV_QM_REGION_NUM,
-       .pdsp_cmd       = CONFIG_KSNAV_QM_PDSP1_CMD_BASE,
-       .pdsp_ctl       = CONFIG_KSNAV_QM_PDSP1_CTRL_BASE,
-       .pdsp_iram      = CONFIG_KSNAV_QM_PDSP1_IRAM_BASE,
-       .qpool_num      = CONFIG_KSNAV_QM_QPOOL_NUM,
+       .stat_cfg       = KS2_QM_QUEUE_STATUS_BASE,
+       .queue          = (void *)KS2_QM_MANAGER_QUEUES_BASE,
+       .mngr_vbusm     = KS2_QM_BASE_ADDRESS,
+       .i_lram         = KS2_QM_LINK_RAM_BASE,
+       .proxy          = (void *)KS2_QM_MANAGER_Q_PROXY_BASE,
+       .status_ram     = KS2_QM_STATUS_RAM_BASE,
+       .mngr_cfg       = (void *)KS2_QM_CONF_BASE,
+       .intd_cfg       = KS2_QM_INTD_CONF_BASE,
+       .desc_mem       = (void *)KS2_QM_DESC_SETUP_BASE,
+       .region_num     = KS2_QM_REGION_NUM,
+       .pdsp_cmd       = KS2_QM_PDSP1_CMD_BASE,
+       .pdsp_ctl       = KS2_QM_PDSP1_CTRL_BASE,
+       .pdsp_iram      = KS2_QM_PDSP1_IRAM_BASE,
+       .qpool_num      = KS2_QM_QPOOL_NUM,
 };
 
 /*
@@ -252,7 +252,7 @@ int ksnav_init(struct pktdma_cfg *pktdma, struct rx_buff_desc *rx_buffers)
        writel(0, &pktdma->global->emulation_control);
 
        /* Set QM base address, only for K2x devices */
-       writel(CONFIG_KSNAV_QM_BASE_ADDRESS, &pktdma->global->qm_base_addr[0]);
+       writel(KS2_QM_BASE_ADDRESS, &pktdma->global->qm_base_addr[0]);
 
        /* Enable all channels. The current state isn't important */
        for (j = 0; j < pktdma->tx_ch_num; j++)  {
index 9a64801cf9b277d06109f783a5f2e1faac8c8220..301419b6fdac8f00ca5ad4315687b3e9ce6a119c 100644 (file)
@@ -8,19 +8,17 @@
 
 #include <asm/ti-common/keystone_nav.h>
 
-#ifdef CONFIG_KSNAV_PKTDMA_NETCP
 /* NETCP Pktdma */
 struct pktdma_cfg netcp_pktdma = {
-       .global         = (void *)CONFIG_KSNAV_NETCP_PDMA_CTRL_BASE,
-       .tx_ch          = (void *)CONFIG_KSNAV_NETCP_PDMA_TX_BASE,
-       .tx_ch_num      = CONFIG_KSNAV_NETCP_PDMA_TX_CH_NUM,
-       .rx_ch          = (void *)CONFIG_KSNAV_NETCP_PDMA_RX_BASE,
-       .rx_ch_num      = CONFIG_KSNAV_NETCP_PDMA_RX_CH_NUM,
-       .tx_sched       = (u32 *)CONFIG_KSNAV_NETCP_PDMA_SCHED_BASE,
-       .rx_flows       = (void *)CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_BASE,
-       .rx_flow_num    = CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_NUM,
-       .rx_free_q      = CONFIG_KSNAV_NETCP_PDMA_RX_FREE_QUEUE,
-       .rx_rcv_q       = CONFIG_KSNAV_NETCP_PDMA_RX_RCV_QUEUE,
-       .tx_snd_q       = CONFIG_KSNAV_NETCP_PDMA_TX_SND_QUEUE,
+       .global         = (void *)KS2_NETCP_PDMA_CTRL_BASE,
+       .tx_ch          = (void *)KS2_NETCP_PDMA_TX_BASE,
+       .tx_ch_num      = KS2_NETCP_PDMA_TX_CH_NUM,
+       .rx_ch          = (void *)KS2_NETCP_PDMA_RX_BASE,
+       .rx_ch_num      = KS2_NETCP_PDMA_RX_CH_NUM,
+       .tx_sched       = (u32 *)KS2_NETCP_PDMA_SCHED_BASE,
+       .rx_flows       = (void *)KS2_NETCP_PDMA_RX_FLOW_BASE,
+       .rx_flow_num    = KS2_NETCP_PDMA_RX_FLOW_NUM,
+       .rx_free_q      = KS2_NETCP_PDMA_RX_FREE_QUEUE,
+       .rx_rcv_q       = KS2_NETCP_PDMA_RX_RCV_QUEUE,
+       .tx_snd_q       = KS2_NETCP_PDMA_TX_SND_QUEUE,
 };
-#endif
index 512be7d328eab98d5f3b511a9a4d1eb568faf04d..e8d99600def02190ea53b86ddcc6160e8946e3dc 100644 (file)
 #define CONFIG_SYS_SGMII_LINERATE_MHZ  1250
 #define CONFIG_SYS_SGMII_RATESCALE     2
 
-/* Keyston Navigator Configuration */
-#define CONFIG_TI_KSNAV
-#define CONFIG_KSNAV_QM_BASE_ADDRESS           KS2_QM_BASE_ADDRESS
-#define CONFIG_KSNAV_QM_CONF_BASE              KS2_QM_CONF_BASE
-#define CONFIG_KSNAV_QM_DESC_SETUP_BASE                KS2_QM_DESC_SETUP_BASE
-#define CONFIG_KSNAV_QM_STATUS_RAM_BASE                KS2_QM_STATUS_RAM_BASE
-#define CONFIG_KSNAV_QM_INTD_CONF_BASE         KS2_QM_INTD_CONF_BASE
-#define CONFIG_KSNAV_QM_PDSP1_CMD_BASE         KS2_QM_PDSP1_CMD_BASE
-#define CONFIG_KSNAV_QM_PDSP1_CTRL_BASE                KS2_QM_PDSP1_CTRL_BASE
-#define CONFIG_KSNAV_QM_PDSP1_IRAM_BASE                KS2_QM_PDSP1_IRAM_BASE
-#define CONFIG_KSNAV_QM_MANAGER_QUEUES_BASE    KS2_QM_MANAGER_QUEUES_BASE
-#define CONFIG_KSNAV_QM_MANAGER_Q_PROXY_BASE   KS2_QM_MANAGER_Q_PROXY_BASE
-#define CONFIG_KSNAV_QM_QUEUE_STATUS_BASE      KS2_QM_QUEUE_STATUS_BASE
-#define CONFIG_KSNAV_QM_LINK_RAM_BASE          KS2_QM_LINK_RAM_BASE
-#define CONFIG_KSNAV_QM_REGION_NUM             KS2_QM_REGION_NUM
-#define CONFIG_KSNAV_QM_QPOOL_NUM              KS2_QM_QPOOL_NUM
-
-/* NETCP pktdma */
-#define CONFIG_KSNAV_PKTDMA_NETCP
-#define CONFIG_KSNAV_NETCP_PDMA_CTRL_BASE      KS2_NETCP_PDMA_CTRL_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_TX_BASE                KS2_NETCP_PDMA_TX_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_TX_CH_NUM      KS2_NETCP_PDMA_TX_CH_NUM
-#define CONFIG_KSNAV_NETCP_PDMA_RX_BASE                KS2_NETCP_PDMA_RX_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_CH_NUM      KS2_NETCP_PDMA_RX_CH_NUM
-#define CONFIG_KSNAV_NETCP_PDMA_SCHED_BASE     KS2_NETCP_PDMA_SCHED_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_BASE   KS2_NETCP_PDMA_RX_FLOW_BASE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_FLOW_NUM    KS2_NETCP_PDMA_RX_FLOW_NUM
-#define CONFIG_KSNAV_NETCP_PDMA_RX_FREE_QUEUE  KS2_NETCP_PDMA_RX_FREE_QUEUE
-#define CONFIG_KSNAV_NETCP_PDMA_RX_RCV_QUEUE   KS2_NETCP_PDMA_RX_RCV_QUEUE
-#define CONFIG_KSNAV_NETCP_PDMA_TX_SND_QUEUE   KS2_NETCP_PDMA_TX_SND_QUEUE
-
 /* Keystone net */
 #define CONFIG_KSNET_MAC_ID_BASE               KS2_MAC_ID_BASE_ADDR
 #define CONFIG_KSNET_NETCP_BASE                        KS2_NETCP_BASE