Skip to content

Commit

Permalink
drivers: sdma: Add sdma script code in header file
Browse files Browse the repository at this point in the history
For ease of use add sdma script code directly in the sdma
header file.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
  • Loading branch information
dbaluta authored and lgirdwood committed Oct 17, 2023
1 parent aadbfa0 commit 93c63bd
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/drivers/imx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ endif()

if(CONFIG_IMX_SDMA)
add_local_sources(sof sdma.c)

if (CONFIG_HAVE_SDMA_FIRMWARE)
target_include_directories(sof PRIVATE ${CONFIG_SDMA_SCRIPT_CODE})
endif()
endif()

if(CONFIG_IMX_MICFIL)
Expand Down
8 changes: 0 additions & 8 deletions src/drivers/imx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,3 @@ config HAVE_SDMA_FIRMWARE
help
Select this to load SDMA firmware to enable additional functionality
for SDMA controller.

if HAVE_SDMA_FIRMWARE
config SDMA_SCRIPT_CODE
string "SDMA script code path"
help
This option is a string and provides the path where to find the sdma script
code header.
endif
178 changes: 177 additions & 1 deletion src/include/sof/drivers/sdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,183 @@
#define SDMA_SCRIPT_SAI2MCU_OFF 6710

#if CONFIG_HAVE_SDMA_FIRMWARE
#include "sdma_script_code_imx7d_4_5.h"

/*
* From "sdma_script_code_imx7d_4_5.h"
*/

/* SDMA RAM image start address and size */
#define RAM_CODE_START_ADDR 6144
#define RAM_CODE_SIZE 1315

/* buffer that holds the SDMA RAM image */
static const short sdma_code[] = {
0xc1e5, 0x57db, 0x52f3, 0x6a01, 0x52fb, 0x6ad3, 0x52fb, 0x1a1c,
0x6ac3, 0x62e8, 0x0211, 0x3aff, 0x0830, 0x02d0, 0x7c3f, 0x008f,
0x003f, 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5deb, 0x0478, 0x7d03,
0x0479, 0x7d1c, 0x7c20, 0x0479, 0x7c15, 0x56ee, 0x0660, 0x7d05,
0x6509, 0x7e33, 0x620a, 0x7e31, 0x9829, 0x620a, 0x7e2e, 0x6509,
0x7e2c, 0x0512, 0x0512, 0x02ad, 0x6ac8, 0x7f27, 0x2003, 0x4800,
0x7ced, 0x9841, 0x7802, 0x6209, 0x6ac8, 0x9840, 0x0015, 0x7802,
0x620a, 0x6ac8, 0x9840, 0x0015, 0x0015, 0x7802, 0x620b, 0x6ac8,
0x7c14, 0x6ddf, 0x7f12, 0x077f, 0x7d09, 0x52fb, 0x1a04, 0x6ac3,
0x6ad3, 0x62c8, 0x2a04, 0x6ac8, 0x52fb, 0x6ad3, 0x0000, 0x55eb,
0x4d00, 0x7d07, 0xc1fc, 0x57db, 0x9806, 0x0007, 0x68cc, 0x680c,
0xc215, 0xc20c, 0x9801, 0xc1d9, 0xc1e5, 0x57db, 0x52f3, 0x6a01,
0x080f, 0x0011, 0x18ff, 0x00bf, 0x5ce3, 0x00d5, 0x7d01, 0x008d,
0x05a0, 0x5deb, 0x56fb, 0x0478, 0x7d03, 0x0479, 0x7d28, 0x7c33,
0x0479, 0x7c1a, 0x0b70, 0x0311, 0x53eb, 0x0360, 0x7d05, 0x6509,
0x7e5f, 0x620a, 0x7e5d, 0x9880, 0x620a, 0x7e5a, 0x6509, 0x7e58,
0x0512, 0x0512, 0x02ad, 0x5a06, 0x7f53, 0x2003, 0x4800, 0x7ced,
0x0b70, 0x0311, 0x5313, 0x98b0, 0xd8c8, 0x6209, 0x5a06, 0x069c,
0x2701, 0x2001, 0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x98af, 0x0015,
0xd8c8, 0x620a, 0x5a06, 0x069c, 0x2701, 0x2001, 0x4f00, 0x7cf9,
0x4800, 0x7cf6, 0x98af, 0x0015, 0x0015, 0xd8c8, 0x620b, 0x5a06,
0x069c, 0x2701, 0x2001, 0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x7c28,
0x57db, 0x0777, 0x7c0c, 0x0710, 0x3f0f, 0x0717, 0x0717, 0x0e70,
0x0611, 0x0c70, 0x0411, 0x069c, 0x069f, 0x0c01, 0x5c06, 0x0000,
0x54e3, 0x57db, 0x55eb, 0x4d00, 0x7d16, 0xc1fc, 0x57db, 0x9860,
0x56fb, 0x57db, 0x048f, 0x0711, 0x3ff0, 0x0715, 0x0715, 0x0715,
0x0715, 0x0410, 0x0411, 0x3c0f, 0x1c01, 0x0417, 0x0417, 0x0006,
0x0007, 0x680c, 0xc215, 0xc20c, 0x985d, 0xc1d9, 0xc1e5, 0x57db,
0x5fe3, 0x57e3, 0x52f3, 0x6a21, 0x008f, 0x00d5, 0x7d01, 0x008d,
0x05a0, 0x5deb, 0x56fb, 0x0478, 0x7d03, 0x0479, 0x7d2a, 0x7c31,
0x0479, 0x7c20, 0x0b70, 0x0311, 0x53eb, 0x0f00, 0x0360, 0x7d05,
0x6509, 0x7e37, 0x620a, 0x7e35, 0x9901, 0x620a, 0x7e32, 0x6509,
0x7e30, 0x0512, 0x0512, 0x02ad, 0x0760, 0x7c02, 0x5a06, 0x9909,
0x5a26, 0x7f27, 0x1f01, 0x2003, 0x4800, 0x7ce8, 0x0b70, 0x0311,
0x5313, 0x992a, 0x0015, 0x7804, 0x6209, 0x5a06, 0x6209, 0x5a26,
0x9929, 0x0015, 0x0015, 0x7804, 0x620a, 0x5a06, 0x620a, 0x5a26,
0x9929, 0x0015, 0x0015, 0x0015, 0x7804, 0x620b, 0x5a06, 0x620b,
0x5a26, 0x7c07, 0x0000, 0x55eb, 0x4d00, 0x7d06, 0xc1fc, 0x57e3,
0x98e4, 0x0007, 0x680c, 0xc215, 0xc20c, 0x98e1, 0x0b70, 0x0311,
0x5313, 0x076c, 0x7c01, 0xc1d9, 0x5efb, 0x068a, 0x076b, 0x7c01,
0xc1d9, 0x5ef3, 0x59db, 0x58d3, 0x018f, 0x0110, 0x390f, 0x008b,
0xc13c, 0x7d2b, 0x5ac0, 0x5bc8, 0xc14e, 0x7c27, 0x0388, 0x0689,
0x5ce3, 0x0dff, 0x0511, 0x1dff, 0x05bc, 0x073e, 0x4d00, 0x7d18,
0x0870, 0x0011, 0x077e, 0x7d09, 0x077d, 0x7d02, 0x5228, 0x9961,
0x52f8, 0x54db, 0x02bc, 0x02cc, 0x7c09, 0x077c, 0x7d02, 0x5228,
0x996a, 0x52f8, 0x54d3, 0x02bc, 0x02cc, 0x7d09, 0x0400, 0x9958,
0x008b, 0x52c0, 0x53c8, 0xc159, 0x7dd6, 0x0200, 0x9948, 0x08ff,
0x00bf, 0x077f, 0x7d15, 0x0488, 0x00d5, 0x7d01, 0x008d, 0x05a0,
0x5deb, 0x028f, 0x0212, 0x0212, 0x3aff, 0x05da, 0x7c02, 0x073e,
0x9995, 0x02a4, 0x02dd, 0x7d02, 0x073e, 0x9995, 0x075e, 0x9995,
0x55eb, 0x4d00, 0x7c02, 0x0598, 0x5deb, 0x52f3, 0x54fb, 0x076a,
0x7d26, 0x076c, 0x7d01, 0x99d2, 0x076b, 0x7c57, 0x0769, 0x7d04,
0x0768, 0x7d02, 0x0e01, 0x99ac, 0x5893, 0x00d6, 0x7d01, 0x008e,
0x5593, 0x05a0, 0x5d93, 0x06a0, 0x7802, 0x5502, 0x5d04, 0x7c1d,
0x4e00, 0x7c08, 0x0769, 0x7d03, 0x5502, 0x7e17, 0x99b9, 0x5d04,
0x7f14, 0x0689, 0x5093, 0x4800, 0x7d01, 0x99a4, 0x9a1d, 0x0015,
0x7806, 0x5502, 0x5d04, 0x074f, 0x5502, 0x5d24, 0x072f, 0x7c01,
0x9a1d, 0x0017, 0x076f, 0x7c01, 0x2001, 0x5593, 0x009d, 0x0007,
0xda24, 0x9970, 0x6cd3, 0x0769, 0x7d04, 0x0768, 0x7d02, 0x0e01,
0x99e1, 0x5893, 0x00d6, 0x7d01, 0x008e, 0x5593, 0x05a0, 0x5d93,
0x06a0, 0x7802, 0x5502, 0x6dc8, 0x7c0f, 0x4e00, 0x7c08, 0x0769,
0x7d03, 0x5502, 0x7e09, 0x99ee, 0x6dc8, 0x7f06, 0x0689, 0x5093,
0x4800, 0x7d01, 0x99d9, 0x9a1d, 0x9a17, 0x6ac3, 0x0769, 0x7d04,
0x0768, 0x7d02, 0x0e01, 0x9a04, 0x5893, 0x00d6, 0x7d01, 0x008e,
0x5593, 0x05a0, 0x5d93, 0x06a0, 0x7802, 0x65c8, 0x5d04, 0x7c0f,
0x4e00, 0x7c08, 0x0769, 0x7d03, 0x65c8, 0x7e09, 0x9a11, 0x5d04,
0x7f06, 0x0689, 0x5093, 0x4800, 0x7d01, 0x99fc, 0x9a1d, 0x5593,
0x009d, 0x0007, 0x6cff, 0xda24, 0x9970, 0x0000, 0x54e3, 0x55eb,
0x4d00, 0x7c01, 0x9970, 0x9958, 0x54e3, 0x55eb, 0x0aff, 0x0211,
0x1aff, 0x077f, 0x7c02, 0x05a0, 0x9a31, 0x009d, 0x058c, 0x05ba,
0x05a0, 0x0210, 0x04ba, 0x04ad, 0x0454, 0x0006, 0xc1d9, 0xc1e5,
0x57db, 0x52f3, 0x6a05, 0x5ce3, 0x080f, 0x0011, 0x18ff, 0x00bf,
0x00d5, 0x7d01, 0x008d, 0x05a0, 0x56fb, 0x0478, 0x7d03, 0x0479,
0x7d28, 0x7c1a, 0x0479, 0x7c31, 0x0b70, 0x0311, 0x53eb, 0x5206,
0x7e60, 0x0360, 0x7d02, 0x0210, 0x0212, 0x6a09, 0x7f5a, 0x0212,
0x6a09, 0x7f57, 0x0212, 0x6a09, 0x7f54, 0x2003, 0x4800, 0x7cef,
0x0b70, 0x0311, 0x5313, 0x9a88, 0x0015, 0x0015, 0xdaa1, 0x5206,
0x6a0b, 0x069c, 0x2001, 0x2701, 0x4f00, 0x7cf9, 0x4800, 0x7cf6,
0x9a87, 0x0015, 0xdaa1, 0x5206, 0x6a0a, 0x069c, 0x2001, 0x2701,
0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x9a87, 0xdaa1, 0x5206, 0x6a09,
0x069c, 0x2001, 0x2701, 0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x7c29,
0x6a28, 0x7f27, 0x57db, 0x0777, 0x7c0c, 0x0710, 0x3f0f, 0x0717,
0x0717, 0x0e70, 0x0611, 0x0c70, 0x0411, 0x069c, 0x069f, 0x0c01,
0x5c06, 0x0000, 0x54e3, 0x57db, 0x4d00, 0x7d15, 0xc1fc, 0x57db,
0x9a3b, 0x56fb, 0x57db, 0x048f, 0x0711, 0x3ff0, 0x0715, 0x0715,
0x0715, 0x0715, 0x0410, 0x0411, 0x3c0f, 0x1c01, 0x0417, 0x0417,
0x0006, 0xc279, 0x0454, 0xc20c, 0x9a38, 0xc1d9, 0xc1e5, 0x57db,
0x52f3, 0x6a05, 0x008f, 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x56fb,
0x0478, 0x7d03, 0x0479, 0x7d29, 0x7c1f, 0x0479, 0x7c2e, 0x5de3,
0x0d70, 0x0511, 0x55ed, 0x0f00, 0x0760, 0x7d02, 0x5206, 0x9ad1,
0x5226, 0x7e33, 0x0560, 0x7d02, 0x0210, 0x0212, 0x6a09, 0x7f2d,
0x0212, 0x6a09, 0x7f2a, 0x0212, 0x6a09, 0x7f27, 0x1f01, 0x2003,
0x4800, 0x7cea, 0x55e3, 0x9afc, 0x0015, 0x0015, 0x0015, 0x7804,
0x5206, 0x6a0b, 0x5226, 0x6a0b, 0x9afb, 0x0015, 0x0015, 0x7804,
0x5206, 0x6a0a, 0x5226, 0x6a0a, 0x9afb, 0x0015, 0x7804, 0x5206,
0x6a09, 0x5226, 0x6a09, 0x7c09, 0x6a28, 0x7f07, 0x0000, 0x57db,
0x4d00, 0x7d05, 0xc1fc, 0x57db, 0x9aba, 0xc279, 0x0454, 0xc20c,
0x9ab7, 0xc1e5, 0x57db, 0x52f3, 0x6a05, 0x56fb, 0x028e, 0x1a94,
0x6ac3, 0x62c8, 0x0269, 0x7d26, 0x1e94, 0x6ec3, 0x6ed3, 0x62c8,
0x0a01, 0x0211, 0x6ac8, 0x2694, 0x1e98, 0x6ec3, 0x62c8, 0x2698,
0x6ec3, 0x0260, 0x7d0f, 0x1e98, 0x6ec3, 0x62c8, 0x026c, 0x7d03,
0x2698, 0x6ec3, 0x9b48, 0x0a10, 0x0211, 0x6ed3, 0x6ac8, 0x2698,
0x6ec3, 0x9b58, 0x62c8, 0x9b34, 0x6a09, 0x7f18, 0x2501, 0x4d00,
0x7d1f, 0x9b1c, 0x6ee3, 0x008f, 0x05d8, 0x7d01, 0x008d, 0x62c8,
0x6a09, 0x7f0c, 0x2501, 0x2001, 0x7cfa, 0x57db, 0x4d00, 0x7d10,
0x6a28, 0x7f04, 0x0000, 0xc1fc, 0x57db, 0x9b0d, 0x0007, 0x6204,
0x6a0c, 0x9b55, 0x6a28, 0x7ffa, 0x6204, 0xc27c, 0x0458, 0x0454,
0x08ff, 0x0011, 0x18ff, 0x00bc, 0x00cd, 0x7c01, 0x9b48, 0x6a28,
0x7fed, 0x6204, 0xc27c, 0xc20c, 0x9b0a, 0xc1d9, 0xc1e5, 0x57db,
0x52f3, 0x6a05, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d1d,
0x1e94, 0x5206, 0x0248, 0x5a06, 0x2694, 0x1e98, 0x5206, 0x024c,
0x5a06, 0x2698, 0x1e98, 0x5206, 0x0260, 0x7c0a, 0x2698, 0x5206,
0x026e, 0x7d23, 0x6a09, 0x7f1d, 0x2501, 0x4d00, 0x7d24, 0x9b7a,
0x6a28, 0x7f17, 0x6204, 0xc27c, 0x9bab, 0x008f, 0x05d8, 0x7d01,
0x008d, 0x05a0, 0x5206, 0x026e, 0x7d10, 0x6a09, 0x7f0a, 0x2001,
0x7cf9, 0x6a28, 0x7f06, 0x0000, 0x4d00, 0x7d0d, 0xc1fc, 0x57db,
0x9b6a, 0x0007, 0x6204, 0x6a0c, 0x9ba8, 0x6a28, 0x7ffa, 0x6204,
0xc27c, 0x0458, 0x0454, 0x6a28, 0x7ff4, 0xc20c, 0x9b67, 0xdbf3,
0x57db, 0x52f3, 0x6a05, 0x69c7, 0x008f, 0x00d5, 0x7d01, 0x008d,
0x05a0, 0x0478, 0x7d03, 0x0479, 0x7d1c, 0x7c15, 0x0479, 0x7c1e,
0x56ee, 0x62c8, 0x7e28, 0x0660, 0x7d02, 0x0210, 0x0212, 0x6a09,
0x7f22, 0x0212, 0x6a09, 0x7f1f, 0x0212, 0x6a09, 0x7f1c, 0x2003,
0x4800, 0x7cef, 0x9be2, 0x0015, 0x0015, 0x7802, 0x62c8, 0x6a0b,
0x9be1, 0x0015, 0x7802, 0x62c8, 0x6a0a, 0x9be1, 0x7802, 0x62c8,
0x6a09, 0x7c09, 0x6a28, 0x7f07, 0x4d00, 0x7d07, 0x52d3, 0x0801,
0x5802, 0x0400, 0x9bb3, 0xc279, 0x0454, 0x52d3, 0x0801, 0x5802,
0x0401, 0xdc0b, 0x9bb0, 0x0b70, 0x0311, 0x5313, 0x5fdb, 0x070a,
0x58d3, 0x008b, 0x5efb, 0xc13c, 0x7d15, 0x5ac0, 0x5bc8, 0xc14e,
0x7c11, 0x0388, 0x5df0, 0x0dff, 0x0511, 0x1dff, 0x05bc, 0x4d00,
0x7d04, 0x9c0a, 0x0708, 0x5fdb, 0x070a, 0x008b, 0x52c3, 0x53cb,
0xc159, 0x7dec, 0x0200, 0x9bfb, 0x6e01, 0x610b, 0x7e2f, 0x620b,
0x7e2d, 0x630b, 0x7e2b, 0x0d0c, 0x0417, 0x0417, 0x0417, 0x049d,
0x1d08, 0x05cc, 0x7c01, 0x0d0c, 0x6ad1, 0x0f00, 0x0742, 0x6fc8,
0x6fdd, 0x7f1c, 0x008e, 0x009d, 0x6801, 0x670b, 0x7e17, 0x6bd5,
0x0804, 0x7802, 0x6fc8, 0x0712, 0x7c11, 0x670b, 0x7e0f, 0x0804,
0x7802, 0x6fc8, 0x0712, 0x7c0a, 0x6fdd, 0x7f08, 0x69d1, 0x0f01,
0x6fc8, 0x6fdd, 0x7f03, 0x0101, 0x0400, 0x9c20, 0x0007, 0x68ff,
0x680c, 0x0200, 0x9c20, 0xdc90, 0x57db, 0x52f3, 0x6a05, 0x52fb,
0x6ac7, 0x008f, 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x0478, 0x7d03,
0x0479, 0x7d1c, 0x7c15, 0x0479, 0x7c1e, 0x56ee, 0x62c8, 0x7e28,
0x0660, 0x7d02, 0x0210, 0x0212, 0x6a09, 0x7f22, 0x0212, 0x6a09,
0x7f1f, 0x0212, 0x6a09, 0x7f1c, 0x2003, 0x4800, 0x7cef, 0x9c7f,
0x0015, 0x0015, 0x7802, 0x62c8, 0x6a0b, 0x9c7e, 0x0015, 0x7802,
0x62c8, 0x6a0a, 0x9c7e, 0x7802, 0x62c8, 0x6a09, 0x7c09, 0x6a28,
0x7f07, 0x4d00, 0x7d07, 0x52d3, 0x0801, 0x5802, 0x0400, 0x9c4f,
0xc279, 0x0454, 0x52d3, 0x0801, 0x5802, 0x0401, 0xdca8, 0x9c4c,
0x0b70, 0x0311, 0x5313, 0x5fdb, 0x070a, 0x58d3, 0x008b, 0x5efb,
0xc13c, 0x7d15, 0x5ac0, 0x5bc8, 0xc14e, 0x7c11, 0x0388, 0x5df0,
0x0dff, 0x0511, 0x1dff, 0x05bc, 0x4d00, 0x7d04, 0x9ca7, 0x0708,
0x5fdb, 0x070a, 0x008b, 0x52c3, 0x53cb, 0xc159, 0x7dec, 0x0200,
0x9c98, 0xdd02, 0x52f3, 0x6a01, 0x57db, 0x52fb, 0x077f, 0x7d02,
0x6ad3, 0x9cbb, 0x6ad7, 0x008f, 0x38ff, 0x00d5, 0x7d01, 0x008d,
0x05a0, 0x5deb, 0x0478, 0x7d03, 0x0479, 0x7d1c, 0x7c20, 0x0479,
0x7c15, 0x56ee, 0x0660, 0x7d05, 0x6509, 0x7e2a, 0x620a, 0x7e28,
0x9cd5, 0x620a, 0x7e25, 0x6509, 0x7e23, 0x0512, 0x0512, 0x02ad,
0x6ac8, 0x7f1e, 0x2003, 0x4800, 0x7ced, 0x9ced, 0x7802, 0x6209,
0x6ac8, 0x9cec, 0x0015, 0x7802, 0x620a, 0x6ac8, 0x9cec, 0x0015,
0x0015, 0x7802, 0x620b, 0x6ac8, 0x7c0b, 0x6ddf, 0x7f09, 0x0000,
0x55eb, 0x4d00, 0x7d09, 0x52d3, 0x0801, 0x5802, 0x0400, 0x9cb4,
0x0007, 0x68cc, 0x680c, 0xc215, 0x52d3, 0x0801, 0x5802, 0x0401,
0xdd1a, 0x9cb2, 0x0b70, 0x0311, 0x5313, 0x5fdb, 0x070a, 0x58d3,
0x008b, 0x5efb, 0xc13c, 0x7d15, 0x5ac0, 0x5bc8, 0xc14e, 0x7c11,
0x0388, 0x5df0, 0x0dff, 0x0511, 0x1dff, 0x05bc, 0x4d00, 0x7d04,
0x9d19, 0x0708, 0x5fdb, 0x070a, 0x008b, 0x52c3, 0x53cb, 0xc159,
0x7dec, 0x0200, 0x9d0a
};
#endif

#endif /* __SOF_DRIVERS_SDMA_H__ */

0 comments on commit 93c63bd

Please sign in to comment.