ricardgb commented on code in PR #19250:
URL: https://github.com/apache/nuttx/pull/19250#discussion_r3568918263


##########
boards/arm/rp23xx/raspberrypi-pico-2-w/src/rp23xx_firmware.c:
##########
@@ -0,0 +1,160 @@
+/****************************************************************************
+ * boards/arm/rp23xx/raspberrypi-pico-2-w/src/rp23xx_firmware.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define _STR(x) #x
+#define STR(x) _STR(x)

Review Comment:
   Done — dropped the local `_STR/STR` and switched to `STRINGIFY()` from 
`nuttx/macro.h` (added the include). Behaviour is identical, one less 
duplicated macro.



##########
boards/arm/rp23xx/raspberrypi-pico-2-w/Kconfig:
##########
@@ -0,0 +1,42 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+if ARCH_BOARD_RASPBERRYPI_PICO_2_W
+
+menuconfig RP23XX_INFINEON_CYW43439
+       bool "Has Infineon cyw43439 WiFi chip"
+       depends on IEEE80211_INFINEON_CYW43439
+       default y
+       ---help---
+               The Raspberry Pi Pico 2 W has an onboard Infineon CYW43439 WiFi 
chip
+               connected to the RP2350 via a PIO-based gSPI interface.
+
+endif
+
+if RP23XX_INFINEON_CYW43439
+
+config CYW43439_FIRMWARE_BIN_PATH
+       string "Path to Infineon 43439 firmware file"
+       default 
"${PICO_SDK_PATH}/lib/cyw43-driver/firmware/43439A0-7.95.49.00.combined"
+       ---help---
+               This should be a path to a file containing both the cyw43439 
firmware and
+               the CLB blob.  The firmware should be padded to a 256 byte 
boundary and
+               then the CLM blob should be appended.
+
+               If this file is updated, check the CYW43439_FIRMWARE_LEN below 
to make sure
+               it reflects the un-padded length of the firmware part.
+
+config CYW43439_FIRMWARE_LEN
+       int "Infineon 43439 firmware length (bytes)"
+       default 224190

Review Comment:
   The combined firmware file (`43439A0-*.combined` from the pico-sdk) is the 
raw WiFi firmware padded up to a 256-byte boundary with the CLM blob appended 
after it. The file has no header recording where the firmware ends and the CLM 
blob begins, so that boundary can't be derived from the file contents at build 
time — it has to be supplied, which is what `CYW43439_FIRMWARE_LEN` is for.
   
   This mirrors the existing `raspberrypi-pico-w` board 
(`boards/arm/rp2040/common/src/rp2040_firmware.c` + `CYW43439_FIRMWARE_LEN` in 
its Kconfig), which loads the same blob the same way. Deriving the split 
automatically (e.g. scanning for the CLM magic) would be a nice cleanup but 
would touch both boards, so I'd suggest it as a follow-up rather than in this 
PR — happy to do it either way if you prefer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to