|
| 1 | +if(CONFIG_NXP_MONOLITHIC_WIFI OR CONFIG_BT_H4_NXP_CTLR) |
| 2 | + set(hal_blobs_dir ${ZEPHYR_HAL_NXP_MODULE_DIR}/zephyr/blobs) |
| 3 | + set(wifi_bt_binary_blobs_list) |
| 4 | + set(binary_blobs_list) |
| 5 | + set(output_includes_list) |
| 6 | + |
| 7 | + if(CONFIG_WIFI_NXP) |
| 8 | + if(CONFIG_NXP_IW61X) |
| 9 | + list(APPEND output_includes_list ${ZEPHYR_BINARY_DIR}/include/generated/nw61x_wifi_fw.bin.se.inc) |
| 10 | + set(wifi_binary_blob_name sduart_nw61x.bin.se) |
| 11 | + zephyr_library_sources(${CMAKE_CURRENT_LIST_DIR}/nw61x/nw61x_cpu1.c) |
| 12 | + list(APPEND wifi_bt_binary_blobs_list ${hal_blobs_dir}/nw61x/${wifi_binary_blob_name}) |
| 13 | + elseif(CONFIG_NXP_88W8987) |
| 14 | + list(APPEND output_includes_list ${ZEPHYR_BINARY_DIR}/include/generated/8987_wifi_fw.bin.inc) |
| 15 | + set(wifi_binary_blob_name sd8987_wlan.bin) |
| 16 | + zephyr_library_sources(${CMAKE_CURRENT_LIST_DIR}/8987/8987_cpu1.c) |
| 17 | + list(APPEND wifi_bt_binary_blobs_list ${hal_blobs_dir}/8987/${wifi_binary_blob_name}) |
| 18 | + elseif(CONFIG_NXP_IW416) |
| 19 | + list(APPEND output_includes_list ${ZEPHYR_BINARY_DIR}/include/generated/iw416_wifi_fw.bin.inc) |
| 20 | + set(wifi_binary_blob_name sdIW416_wlan.bin) |
| 21 | + zephyr_library_sources(${CMAKE_CURRENT_LIST_DIR}/IW416/IW416_cpu1.c) |
| 22 | + list(APPEND wifi_bt_binary_blobs_list ${hal_blobs_dir}/IW416/${wifi_binary_blob_name}) |
| 23 | + elseif(CONFIG_NXP_88W8801) |
| 24 | + list(APPEND output_includes_list ${ZEPHYR_BINARY_DIR}/include/generated/8801_wifi_fw.bin.inc) |
| 25 | + set(wifi_binary_blob_name sd8801_wlan.bin) |
| 26 | + zephyr_library_sources(${CMAKE_CURRENT_LIST_DIR}/8801/8801_cpu1.c) |
| 27 | + list(APPEND wifi_bt_binary_blobs_list ${hal_blobs_dir}/8801/${wifi_binary_blob_name}) |
| 28 | + else() |
| 29 | + message(FATAL_ERROR "Couldn't determine soc revision") |
| 30 | + endif() |
| 31 | + endif() |
| 32 | + |
| 33 | + if (CONFIG_BT_H4_NXP_CTLR) |
| 34 | + if(CONFIG_BT_NXP_NW612) |
| 35 | + list(APPEND output_includes_list ${ZEPHYR_BINARY_DIR}/include/generated/nw61x_bt_fw.bin.inc) |
| 36 | + set(bt_binary_blob_name uart_nw61x.bin.se) |
| 37 | + zephyr_library_sources(${CMAKE_CURRENT_LIST_DIR}/nw61x/nw61x_cpu2.c) |
| 38 | + list(APPEND wifi_bt_binary_blobs_list ${hal_blobs_dir}/nw61x/${bt_binary_blob_name}) |
| 39 | + elseif(CONFIG_BT_NXP_IW416) |
| 40 | + list(APPEND output_includes_list ${ZEPHYR_BINARY_DIR}/include/generated/iw416_bt_fw.bin.inc) |
| 41 | + set(bt_binary_blob_name uartIW416_bt.bin) |
| 42 | + zephyr_library_sources(${CMAKE_CURRENT_LIST_DIR}/IW416/IW416_cpu2.c) |
| 43 | + list(APPEND wifi_bt_binary_blobs_list ${hal_blobs_dir}/IW416/${bt_binary_blob_name}) |
| 44 | + else() |
| 45 | + message(FATAL_ERROR "Unsupported controller. Please select a BT conntroller, refer to ./driver/bluetooth/hci/Kconfig.nxp") |
| 46 | + endif() |
| 47 | + endif() |
| 48 | + |
| 49 | + if(NOT CONFIG_BUILD_ONLY_NO_BLOBS) |
| 50 | + list(LENGTH wifi_bt_binary_blobs_list count) |
| 51 | + math(EXPR count "${count}-1") |
| 52 | + foreach(i RANGE ${count}) |
| 53 | + list(GET wifi_bt_binary_blobs_list ${i} wifi_bt_binary_blob) |
| 54 | + if(EXISTS ${wifi_bt_binary_blob}) |
| 55 | + set(binary_blob ${wifi_bt_binary_blob}) |
| 56 | + else() |
| 57 | + message(FATAL_ERROR "Couldn't find wifi/bt firmware ! ${wifi_bt_binary_blob}") |
| 58 | + endif() |
| 59 | + |
| 60 | + list(APPEND binary_blobs_list ${binary_blob}) |
| 61 | + endforeach() |
| 62 | + |
| 63 | + list(LENGTH binary_blobs_list count) |
| 64 | + math(EXPR count "${count}-1") |
| 65 | + foreach(i RANGE ${count}) |
| 66 | + list(GET binary_blobs_list ${i} binary_blob) |
| 67 | + list(GET output_includes_list ${i} output_include) |
| 68 | + zephyr_blobs_verify(FILES ${binary_blob} REQUIRED) |
| 69 | + message(STATUS " generate include of binary blob: ${binary_blob}") |
| 70 | + generate_inc_file_for_target(app ${binary_blob} ${output_include}) |
| 71 | + endforeach() |
| 72 | + endif() |
| 73 | + |
| 74 | +endif() |
0 commit comments