This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

M2-CC3351: cc33xx driver bringup

Part Number: M2-CC3351

Hi,

I'm trying to bring up the out-of-tree cc33xx driver with the M2-CC3351 EVK.
Our host is the RK3588 on the ROCK-5B SBC. Since the features we need are available in mainline Linux I've been using the 6.12 kernel for the bringup.
As the driver patches in
    https://github.com/TexasInstruments-Sandbox/cc33xx-linux-mpu-ports
wouldn't apply to virtually anything cleanly, driver sources are taken from
    https://github.com/TexasInstruments/ti-linux-kernel.git
    Branch: ti-linux-6.12.y
    Tag: cicd.scarthgap.202601300920

This driver will build after a trivial debugfs fix:
    diff --git a/drivers/net/wireless/ti/cc33xx/debugfs.c b/drivers/net/wireless/ti/cc33xx/debugfs.c
    index c9fb8c05148c..7615ca106fc3 100644
    --- a/drivers/net/wireless/ti/cc33xx/debugfs.c
    +++ b/drivers/net/wireless/ti/cc33xx/debugfs.c
    @@ -221,8 +221,8 @@ static ssize_t radar_debug_mode_write(struct file *file,
                    goto out;

            cc33xx_for_each_wlvif_ap(wl, wlvif) {
    -               wlcore_cmd_generic_cfg(wl, wlvif,
    -                                      WLCORE_CFG_FEATURE_RADAR_DEBUG,
    +               cc33xx_cmd_generic_cfg(wl, wlvif,
    +                                      CC33XX_CFG_FEATURE_RADAR_DEBUG,
                                           wl->radar_debug_mode, 0);
            }

    @@ -248,12 +248,14 @@ static const struct file_operations radar_debug_mode_ops = {
            .llseek = default_llseek,
     };

    -static void cc33xx_debugfs_add_files_helper(struct dentry *moddir)
    +static void cc33xx_debugfs_add_files_helper(struct cc33xx *wl,
    +                                           struct dentry *moddir)
     {
            DEBUGFS_ADD(radar_debug_mode, moddir);
     }
     #else
    -static void cc33xx_debugfs_add_files_helper(struct dentry *moddir) {}
    +static void cc33xx_debugfs_add_files_helper(struct cc33xx *wl,
    +                                           struct dentry *moddir) {}
     #endif /* CFG80211_CERTIFICATION_ONUS */


    @@ -1935,7 +1937,7 @@ static int cc33xx_debugfs_add_files(struct cc33xx *wl,

            DEBUGFS_ADD(conf, moddir);
            DEBUGFS_ADD(radar_detection, moddir);
    -       cc33xx_debugfs_add_files_helper(moddir);
    +       cc33xx_debugfs_add_files_helper(wl, moddir);
            DEBUGFS_ADD(dynamic_fw_traces, moddir);

            return 0;
    -- 

Firmware files are taken from ti-processor-sdk-linux-am335x-evm-09.01.00.001, namely
    root@rock-5b:~# ls -1 /lib/firmware/ti-connectivity/
    cc33xx-conf.bin
    cc33xx_2nd_loader.bin
    cc33xx_fw.bin

Our device is recognized:
    clock:          25000000 Hz
    actual clock:   25000000 Hz
    vdd:            21 (3.3 ~ 3.4 V)
    bus mode:       2 (push-pull)
    chip select:    0 (don't care)
    power mode:     2 (on)
    bus width:      2 (4 bits)
    timing spec:    0 (legacy)
    signal voltage: 1 (1.80 V)
    driver type:    0 (driver type B)

However, I've found it interesting that despite modalias matching (sdio:c*v0097d4077*), cc33xx_sdio will only load automatically if "ti,cc33xx" compatibility is explicitly provided in a host controller sub-node.

And then... silence.
I've tried to increase cc33xx verbosity with debug_level=0xffffffff, to no avail.

Could you confirm that SDIO-only (no host-wake GPIO) operation works?
If not, would it be possible to provide a working RK3588 DTS snippet that this specific device requires?

The host controller node for the M.2 Key E socket is by default as follows:
    &sdio {
            max-frequency = <200000000>;
            no-sd;
            no-mmc;
            non-removable;
            bus-width = <4>;
            cap-sdio-irq;
            disable-wp;
            keep-power-in-suspend;
            wakeup-source;
            sd-uhs-sdr12;
            sd-uhs-sdr25;
            sd-uhs-sdr50;
            sd-uhs-sdr104;
            vmmc-supply = <&vcc3v3_pcie2x1l0>;
            vqmmc-supply = <&vcc_1v8_s3>;
            pinctrl-names = "default";
            pinctrl-0 = <&sdiom0_pins>;
            status = "okay";
    };

Thank you for your help, it is very much appreciated!

Kind regards,

  • Hi Tamas,

    Thanks for all the details, but let's first start with your requirements.

    You mentioned you require to use mainline kernel, is that correct? Please don't use the ti-linux-kernel if your host isn't from TI.

    In the rockchip case, our path is to first apply the patches from the cc33xx SDK: https://www.ti.com/tool/download/CC33XX-LINUX-MPU 

    The patches in the SDK are for kernel 6.1. Once that is applied, (cleanly or not), then please do apply the patch for the corresponding kernel as you linked in the GitHub:     https://github.com/TexasInstruments-Sandbox/cc33xx-linux-mpu-ports

    The reason we ask to start from the SDK is because the driver requires matching and accompanying cc33xx firmware binaries.

    Regarding the fixes, thanks for sharing those. I will implement them on my side.

  • Could you confirm that SDIO-only (no host-wake GPIO) operation works?
    If not, would it be possible to provide a working RK3588 DTS snippet that this specific device requires?

    I don't have an example DTS for the RK3588 specifically. And i'm not sure what you mean by host-wake GPIO. COuld you please provide a dmesg log of what you're describing?

  • Hi Sabeeh,

    Thank you for your response!

    In the cc33xx_linux_package_1_0_2_10 both build_kernel and patch_kernel options fail. However, it turns out the build would normally go for ti-linux-kernel-6.1.46+gitAUTOINC+1d4b5da681-g1d4b5da681. The key patch for us in the SDK is cc33xx_kernel.patch, which does apply on top of ti-linux-kernel 1d4b5da681ea4d617c01a72ad18b228d7438db7a. This much is clear.

    You mentioned to apply the corresponding patch from cc33xx-linux-mpu-ports. I assume that would be 6.12.y/0001-drivers-cc33xx-forward-port-cc33xx-1.0.2.10-SDK-to-6.patch, but this patch does not apply cleanly. Could you please clarify which patch file(s) are required to cc33xx from cc33xx-linux-mpu-ports to be able to move and get the driver working with linux 6.12?

  • Hi Tamas,

    Sorry for the delayed response.

    You need to take 'cc33xx_kernel.patch' from the CC33xx SDK, and apply it to linux-6.12.y. Then take the patch from here and apply it.

    If you have errors applying these patches, then please provide the log of both.