diff --git a/Sming/Arch/Rp2040/Components/rp2040/cyw43-driver.patch b/Sming/Arch/Rp2040/Components/rp2040/cyw43-driver.patch index 216cf19f0c..c7edc5b93e 100644 --- a/Sming/Arch/Rp2040/Components/rp2040/cyw43-driver.patch +++ b/Sming/Arch/Rp2040/Components/rp2040/cyw43-driver.patch @@ -1,8 +1,8 @@ diff --git a/src/cyw43_ctrl.c b/src/cyw43_ctrl.c -index c6c2df6..753bfa8 100644 +index edec1f3..de03c73 100644 --- a/src/cyw43_ctrl.c +++ b/src/cyw43_ctrl.c -@@ -296,13 +296,17 @@ STATIC const char *const cyw43_async_event_name_table[89] = { +@@ -296,13 +296,17 @@ static const char *const cyw43_async_event_name_table[89] = { [CYW43_EV_SET_SSID] = "SET_SSID", [CYW43_EV_JOIN] = "JOIN", [CYW43_EV_AUTH] = "AUTH", @@ -21,11 +21,11 @@ index c6c2df6..753bfa8 100644 [CYW43_EV_ASSOC_REQ_IE] = "ASSOC_REQ_IE", [CYW43_EV_ASSOC_RESP_IE] = "ASSOC_RESP_IE", diff --git a/src/cyw43_ll.c b/src/cyw43_ll.c -index 7f4229b..f3bc641 100644 +index 604335c..4aeb629 100644 --- a/src/cyw43_ll.c +++ b/src/cyw43_ll.c -@@ -55,9 +55,6 @@ int sdio_transfer(uint32_t cmd, uint32_t arg, uint32_t *resp); - void sdio_enable_high_speed_4bit(void); +@@ -54,9 +54,6 @@ + #include "cyw43_sdio.h" #endif -#define CYW43_FLASH_BLOCK_SIZE (512) @@ -34,7 +34,7 @@ index 7f4229b..f3bc641 100644 struct pbuf; uint16_t pbuf_copy_partial(const struct pbuf *p, void *dataptr, uint16_t len, uint16_t offset); -@@ -69,10 +66,6 @@ extern bool enable_spi_packet_dumping; +@@ -68,10 +65,6 @@ extern bool enable_spi_packet_dumping; #define CYW43_RAM_SIZE (512 * 1024) @@ -45,9 +45,9 @@ index 7f4229b..f3bc641 100644 #define VERIFY_FIRMWARE_DOWNLOAD (0) #define ALIGN_UINT(val, align) (((val) + (align) - 1) & ~((align) - 1)) -@@ -377,58 +370,31 @@ static int cyw43_read_backplane_mem(cyw43_int_t *self, uint32_t addr, uint32_t l +@@ -357,58 +350,31 @@ static void cyw43_write_backplane(cyw43_int_t *self, uint32_t addr, size_t size, + cyw43_set_backplane_window(self, CHIPCOMMON_BASE_ADDRESS); } - #endif -static int cyw43_download_resource(cyw43_int_t *self, uint32_t addr, size_t raw_len, int from_storage, uintptr_t source) { - // round up len to simplify download @@ -59,7 +59,7 @@ index 7f4229b..f3bc641 100644 - if (from_storage) { - // reused the spid_buf to copy the data (must be larger than 512 storage block size) - block_size = sizeof(self->spid_buf); -- CYW43_DEBUG("data comes from external storage via buffer of size %u\n", (uint)block_size); +- CYW43_DEBUG("data comes from external storage via buffer of size %u\n", (unsigned int)block_size); +static uint32_t storage_get_chunksize() +{ + const uint32_t chunkTag = 0x4b4e4843; // "CHNK" @@ -126,7 +126,7 @@ index 7f4229b..f3bc641 100644 #if VERIFY_FIRMWARE_DOWNLOAD uint32_t t_start = cyw43_hal_ticks_us(); -@@ -446,7 +412,7 @@ static int cyw43_download_resource(cyw43_int_t *self, uint32_t addr, size_t raw_ +@@ -426,7 +392,7 @@ static int cyw43_download_resource(cyw43_int_t *self, uint32_t addr, size_t raw_ cyw43_set_backplane_window(self, dest_addr); const uint8_t *src; if (from_storage) { @@ -135,7 +135,7 @@ index 7f4229b..f3bc641 100644 src = self->spid_buf; } else { src = (const uint8_t *)source + offset; -@@ -459,6 +425,10 @@ static int cyw43_download_resource(cyw43_int_t *self, uint32_t addr, size_t raw_ +@@ -443,6 +409,10 @@ static int cyw43_download_resource(cyw43_int_t *self, uint32_t addr, size_t raw_ } #if VERIFY_FIRMWARE_DOWNLOAD @@ -145,8 +145,8 @@ index 7f4229b..f3bc641 100644 + } uint32_t t_end = cyw43_hal_ticks_us(); uint32_t dt = t_end - t_start; - CYW43_VDEBUG("done dnload; dt = %u us; speed = %u kbytes/sec\n", (uint)dt, (uint)(len * 1000 / dt)); -@@ -480,7 +450,7 @@ static int cyw43_download_resource(cyw43_int_t *self, uint32_t addr, size_t raw_ + CYW43_VDEBUG("done dnload; dt = %u us; speed = %u kbytes/sec\n", (unsigned int)dt, (unsigned int)(len * 1000 / dt)); +@@ -464,7 +434,7 @@ static int cyw43_download_resource(cyw43_int_t *self, uint32_t addr, size_t raw_ cyw43_read_bytes(self, BACKPLANE_FUNCTION, dest_addr & BACKPLANE_ADDR_MASK, sz, buf); const uint8_t *src; if (from_storage) { @@ -155,7 +155,7 @@ index 7f4229b..f3bc641 100644 src = self->spid_buf; } else { src = (const uint8_t *)source + offset; -@@ -1383,8 +1353,8 @@ void cyw43_ll_bus_sleep(cyw43_ll_t *self_in, bool can_sleep) { +@@ -1372,8 +1342,8 @@ void cyw43_ll_bus_sleep(cyw43_ll_t *self_in, bool can_sleep) { #define CLM_CHUNK_LEN 1024 + 512 #endif @@ -166,7 +166,7 @@ index 7f4229b..f3bc641 100644 uint8_t *buf = &self->spid_buf[SDPCM_HEADER_LEN + 16]; const size_t clm_dload_chunk_len = CLM_CHUNK_LEN; -@@ -1409,7 +1379,7 @@ static void cyw43_clm_load(cyw43_int_t *self, const uint8_t *clm_ptr, size_t clm +@@ -1398,7 +1368,7 @@ static void cyw43_clm_load(cyw43_int_t *self, const uint8_t *clm_ptr, size_t clm *(uint32_t *)(buf + 12) = len; *(uint32_t *)(buf + 16) = 0; #pragma GCC diagnostic pop @@ -175,7 +175,7 @@ index 7f4229b..f3bc641 100644 CYW43_VDEBUG("clm data send %lu/%zu\n", off + len, clm_len); -@@ -1665,12 +1635,9 @@ alp_set: +@@ -1654,12 +1624,9 @@ alp_set: cyw43_write_backplane(self, SOCSRAM_BANKX_INDEX, 4, 0x3); cyw43_write_backplane(self, SOCSRAM_BANKX_PDA, 4, 0); @@ -190,7 +190,7 @@ index 7f4229b..f3bc641 100644 size_t wifi_nvram_len = ALIGN_UINT(sizeof(wifi_nvram_4343), 64); const uint8_t *wifi_nvram_data = wifi_nvram_4343; -@@ -1787,9 +1754,11 @@ f2_ready: +@@ -1776,9 +1743,11 @@ f2_ready: // Load the CLM data; it sits just after main firmware CYW43_VDEBUG("cyw43_clm_load start\n"); @@ -203,7 +203,7 @@ index 7f4229b..f3bc641 100644 cyw43_write_iovar_u32(self, "bus:txglom", 0, WWD_STA_INTERFACE); // tx glomming off cyw43_write_iovar_u32(self, "apsta", 1, WWD_STA_INTERFACE); // apsta on -@@ -1893,6 +1862,10 @@ int cyw43_ll_wifi_on(cyw43_ll_t *self_in, uint32_t country) { +@@ -1882,6 +1851,10 @@ int cyw43_ll_wifi_on(cyw43_ll_t *self_in, uint32_t country) { cyw43_delay_ms(50); #ifndef NDEBUG @@ -214,7 +214,7 @@ index 7f4229b..f3bc641 100644 // Get and print CLM version memcpy(buf, "clmver\x00", 7); cyw43_do_ioctl(self, SDPCM_GET, WLC_GET_VAR, 128, buf, WWD_STA_INTERFACE); -@@ -1922,8 +1895,8 @@ int cyw43_ll_wifi_on(cyw43_ll_t *self_in, uint32_t country) { +@@ -1911,8 +1884,8 @@ int cyw43_ll_wifi_on(cyw43_ll_t *self_in, uint32_t country) { CLR_EV(buf, 19); // roam attempt occurred CLR_EV(buf, 20); // tx fail CLR_EV(buf, 40); // radio @@ -225,10 +225,10 @@ index 7f4229b..f3bc641 100644 #undef CLR_EV memcpy(buf, "bsscfg:event_msgs", 18); diff --git a/src/cyw43_ll.h b/src/cyw43_ll.h -index cf442db..a7ad227 100644 +index 2750238..c281093 100644 --- a/src/cyw43_ll.h +++ b/src/cyw43_ll.h -@@ -65,15 +65,19 @@ +@@ -67,15 +67,19 @@ #define CYW43_EV_SET_SSID (0) #define CYW43_EV_JOIN (1) #define CYW43_EV_AUTH (3) @@ -248,7 +248,7 @@ index cf442db..a7ad227 100644 #define CYW43_EV_CSA_COMPLETE_IND (80) #define CYW43_EV_ASSOC_REQ_IE (87) #define CYW43_EV_ASSOC_RESP_IE (88) -@@ -312,6 +316,11 @@ uint32_t cyw43_ll_read_backplane_reg(cyw43_ll_t *self_in, uint32_t addr); +@@ -318,6 +322,11 @@ uint32_t cyw43_ll_read_backplane_reg(cyw43_ll_t *self_in, uint32_t addr); int cyw43_ll_write_backplane_mem(cyw43_ll_t *self_in, uint32_t addr, uint32_t len, const uint8_t *buf); int cyw43_ll_read_backplane_mem(cyw43_ll_t *self_in, uint32_t addr, uint32_t len, uint8_t *buf); diff --git a/Sming/Arch/Rp2040/Components/rp2040/pico-sdk b/Sming/Arch/Rp2040/Components/rp2040/pico-sdk index e87f11bd2b..263a6680aa 160000 --- a/Sming/Arch/Rp2040/Components/rp2040/pico-sdk +++ b/Sming/Arch/Rp2040/Components/rp2040/pico-sdk @@ -1 +1 @@ -Subproject commit e87f11bd2b54654a251d088193fe3b3c5247baa1 +Subproject commit 263a6680aaf590b3c48f55645f30d1b96d168832 diff --git a/Sming/Arch/Rp2040/Components/rp2040/pico-sdk.patch b/Sming/Arch/Rp2040/Components/rp2040/pico-sdk.patch index a707d793c6..f559e5fb88 100644 --- a/Sming/Arch/Rp2040/Components/rp2040/pico-sdk.patch +++ b/Sming/Arch/Rp2040/Components/rp2040/pico-sdk.patch @@ -1,9 +1,3 @@ -diff --git a/lib/cyw43-driver b/lib/cyw43-driver ---- a/lib/cyw43-driver -+++ b/lib/cyw43-driver -@@ -1 +1 @@ --Subproject commit 9bfca61173a94432839cd39210f1d1afdf602c42 -+Subproject commit 9bfca61173a94432839cd39210f1d1afdf602c42-dirty diff --git a/src/common/pico_util/queue.c b/src/common/pico_util/queue.c index a5c8e18..c3b8a91 100644 --- a/src/common/pico_util/queue.c @@ -50,7 +44,7 @@ index 8e92d8b..da5feac 100644 /*! \brief Atomically set the specified bits to 1 in a HW register * \ingroup hardware_base diff --git a/src/rp2_common/pico_standard_link/memmap_default.ld b/src/rp2_common/pico_standard_link/memmap_default.ld -index 638e994..3fb53cd 100644 +index e85b327..cf826c6 100644 --- a/src/rp2_common/pico_standard_link/memmap_default.ld +++ b/src/rp2_common/pico_standard_link/memmap_default.ld @@ -231,7 +231,7 @@ SECTIONS