|
17 | 17 | LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL);
|
18 | 18 |
|
19 | 19 | #include <fmac_main.h>
|
20 |
| - |
21 |
| -/* INCBIN macro Taken from https://gist.github.com/mmozeiko/ed9655cf50341553d282 */ |
22 |
| -#define STR2(x) #x |
23 |
| -#define STR(x) STR2(x) |
24 |
| - |
25 |
| -#ifdef __APPLE__ |
26 |
| -#define USTR(x) "_" STR(x) |
27 |
| -#else |
28 |
| -#define USTR(x) STR(x) |
29 |
| -#endif |
30 |
| - |
31 |
| -#ifdef _WIN32 |
32 |
| -#define INCBIN_SECTION ".rdata, \"dr\"" |
33 |
| -#elif defined __APPLE__ |
34 |
| -#define INCBIN_SECTION "__TEXT,__const" |
35 |
| -#else |
36 |
| -#define INCBIN_SECTION ".rodata.*" |
37 |
| -#endif |
38 |
| - |
39 |
| -/* this aligns start address to 16 and terminates byte array with explicit 0 |
40 |
| - * which is not really needed, feel free to change it to whatever you want/need |
41 |
| - */ |
42 |
| -#define INCBIN(prefix, name, file) \ |
43 |
| - __asm__(".section " INCBIN_SECTION "\n" \ |
44 |
| - ".global " USTR(prefix) "_" STR(name) "_start\n" \ |
45 |
| - ".balign 16\n" \ |
46 |
| - USTR(prefix) "_" STR(name) "_start:\n" \ |
47 |
| - ".incbin \"" file "\"\n" \ |
48 |
| - \ |
49 |
| - ".global " STR(prefix) "_" STR(name) "_end\n" \ |
50 |
| - ".balign 1\n" \ |
51 |
| - USTR(prefix) "_" STR(name) "_end:\n" \ |
52 |
| - ".byte 0\n" \ |
53 |
| - ); \ |
54 |
| - extern __aligned(16) const char prefix ## _ ## name ## _start[]; \ |
55 |
| - extern const char prefix ## _ ## name ## _end[]; |
56 |
| - |
57 |
| -INCBIN(_bin, nrf70_fw, STR(CONFIG_NRF_WIFI_FW_BIN)); |
| 20 | +static const char fw_patch[] = { |
| 21 | + #include <nrf70_fw_patch/nrf70.bin.inc> |
| 22 | +}; |
58 | 23 |
|
59 | 24 | enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx)
|
60 | 25 | {
|
61 | 26 | enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
|
62 | 27 | struct nrf_wifi_fmac_fw_info fw_info = { 0 };
|
63 |
| - uint8_t *fw_start; |
64 |
| - uint8_t *fw_end; |
65 |
| - |
66 |
| - fw_start = (uint8_t *)_bin_nrf70_fw_start; |
67 |
| - fw_end = (uint8_t *)_bin_nrf70_fw_end; |
68 | 28 |
|
69 |
| - status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_start, fw_end - fw_start, |
70 |
| - &fw_info); |
| 29 | + status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_patch, sizeof(fw_patch), &fw_info); |
71 | 30 | if (status != NRF_WIFI_STATUS_SUCCESS) {
|
72 | 31 | LOG_ERR("%s: nrf_wifi_fmac_fw_parse failed", __func__);
|
73 | 32 | return status;
|
|
0 commit comments