aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt1
-rw-r--r--drivers/dma/imx-sdma.c28
2 files changed, 28 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
index 175f0e44ed85..3c9a57a8443b 100644
--- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
+++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
@@ -8,6 +8,7 @@ Required properties:
8 "fsl,imx51-sdma" 8 "fsl,imx51-sdma"
9 "fsl,imx53-sdma" 9 "fsl,imx53-sdma"
10 "fsl,imx6q-sdma" 10 "fsl,imx6q-sdma"
11 "fsl,imx7d-sdma"
11 The -to variants should be preferred since they allow to determine the 12 The -to variants should be preferred since they allow to determine the
12 correct ROM script addresses needed for the driver to work without additional 13 correct ROM script addresses needed for the driver to work without additional
13 firmware. 14 firmware.
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 624facb6c8f4..a6bffbc47ee2 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -184,7 +184,7 @@
184struct sdma_mode_count { 184struct sdma_mode_count {
185 u32 count : 16; /* size of the buffer pointed by this BD */ 185 u32 count : 16; /* size of the buffer pointed by this BD */
186 u32 status : 8; /* E,R,I,C,W,D status bits stored here */ 186 u32 status : 8; /* E,R,I,C,W,D status bits stored here */
187 u32 command : 8; /* command mostlky used for channel 0 */ 187 u32 command : 8; /* command mostly used for channel 0 */
188}; 188};
189 189
190/* 190/*
@@ -479,6 +479,24 @@ static struct sdma_driver_data sdma_imx6q = {
479 .script_addrs = &sdma_script_imx6q, 479 .script_addrs = &sdma_script_imx6q,
480}; 480};
481 481
482static struct sdma_script_start_addrs sdma_script_imx7d = {
483 .ap_2_ap_addr = 644,
484 .uart_2_mcu_addr = 819,
485 .mcu_2_app_addr = 749,
486 .uartsh_2_mcu_addr = 1034,
487 .mcu_2_shp_addr = 962,
488 .app_2_mcu_addr = 685,
489 .shp_2_mcu_addr = 893,
490 .spdif_2_mcu_addr = 1102,
491 .mcu_2_spdif_addr = 1136,
492};
493
494static struct sdma_driver_data sdma_imx7d = {
495 .chnenbl0 = SDMA_CHNENBL0_IMX35,
496 .num_events = 48,
497 .script_addrs = &sdma_script_imx7d,
498};
499
482static const struct platform_device_id sdma_devtypes[] = { 500static const struct platform_device_id sdma_devtypes[] = {
483 { 501 {
484 .name = "imx25-sdma", 502 .name = "imx25-sdma",
@@ -499,6 +517,9 @@ static const struct platform_device_id sdma_devtypes[] = {
499 .name = "imx6q-sdma", 517 .name = "imx6q-sdma",
500 .driver_data = (unsigned long)&sdma_imx6q, 518 .driver_data = (unsigned long)&sdma_imx6q,
501 }, { 519 }, {
520 .name = "imx7d-sdma",
521 .driver_data = (unsigned long)&sdma_imx7d,
522 }, {
502 /* sentinel */ 523 /* sentinel */
503 } 524 }
504}; 525};
@@ -511,6 +532,7 @@ static const struct of_device_id sdma_dt_ids[] = {
511 { .compatible = "fsl,imx35-sdma", .data = &sdma_imx35, }, 532 { .compatible = "fsl,imx35-sdma", .data = &sdma_imx35, },
512 { .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, }, 533 { .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, },
513 { .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, }, 534 { .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, },
535 { .compatible = "fsl,imx7d-sdma", .data = &sdma_imx7d, },
514 { /* sentinel */ } 536 { /* sentinel */ }
515}; 537};
516MODULE_DEVICE_TABLE(of, sdma_dt_ids); 538MODULE_DEVICE_TABLE(of, sdma_dt_ids);
@@ -1374,6 +1396,7 @@ static void sdma_issue_pending(struct dma_chan *chan)
1374#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34 1396#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34
1375#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2 38 1397#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2 38
1376#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 41 1398#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 41
1399#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4 42
1377 1400
1378static void sdma_add_scripts(struct sdma_engine *sdma, 1401static void sdma_add_scripts(struct sdma_engine *sdma,
1379 const struct sdma_script_start_addrs *addr) 1402 const struct sdma_script_start_addrs *addr)
@@ -1423,6 +1446,9 @@ static void sdma_load_firmware(const struct firmware *fw, void *context)
1423 case 3: 1446 case 3:
1424 sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3; 1447 sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3;
1425 break; 1448 break;
1449 case 4:
1450 sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4;
1451 break;
1426 default: 1452 default:
1427 dev_err(sdma->dev, "unknown firmware version\n"); 1453 dev_err(sdma->dev, "unknown firmware version\n");
1428 goto err_firmware; 1454 goto err_firmware;