Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions drivers/net/wireless/ath/ath12k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ int ath12k_core_fetch_board_data_api_1(struct ath12k_base *ab,
int ath12k_core_fetch_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd)
{
char boardname[BOARD_NAME_SIZE], fallback_boardname[BOARD_NAME_SIZE];
char *filename, filepath[100];
char *filename, default_filename[100], filepath[100];
int bd_api;
int ret;

Expand Down Expand Up @@ -553,7 +553,19 @@ int ath12k_core_fetch_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd)
goto success;

bd_api = 1;
ret = ath12k_core_fetch_board_data_api_1(ab, bd, ATH12K_DEFAULT_BOARD_FILE);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a better idea to use the same method as we did for the TG brd file:
make board.bin a symbolic link, and then link it to the correct file in boot time, and then load the driver.
This will allow us more flexibility (e.g. we might have 10s of board files in the future) and also is more flexible since we don't do change in the kernel.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filesystem is read-only, I cannot create a link after boot, need to do it from Yocto and there's no differentiation for machines there.

Copy link
Collaborator

@shmuelhazan shmuelhazan Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the TG project,
/lib/firmware/wil6210.brd is a symlink to /run/selected_board_file.brd (or something similar).
When the system boots, we create /run/selected_board_file.brd as a symlink to /lib/firmware/xyz.brd (based on the machine's JSON file).
When the driver starts, it loads /lib/firmware/wil6210.brd which redirects to -> /run/selected_board_file.brd -> /lib/firmware/xyz.brd.
/run/ is a temporary file system and is RW.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh understood, two levels of symlinks, closing this PR.

if (of_machine_is_compatible("siklu,n366")) {
strscpy(default_filename, "board-n366.bin",
sizeof(default_filename));
} else if (of_machine_is_compatible("siklu,ipq6018-ctu")) {
strscpy(default_filename, "board-fr2.bin",
sizeof(default_filename));
} else {
strscpy(default_filename, ATH12K_DEFAULT_BOARD_FILE,
sizeof(default_filename));
}

ret = ath12k_core_fetch_board_data_api_1(ab, bd, default_filename);
if (ret) {
ath12k_core_create_firmware_path(ab, filename,
filepath, sizeof(filepath));
Expand All @@ -563,13 +575,14 @@ int ath12k_core_fetch_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd)
ath12k_err(ab, "failed to fetch board data for %s from %s\n",
fallback_boardname, filepath);

ath12k_err(ab, "failed to fetch board.bin from %s\n",
ath12k_err(ab, "failed to fetch %s from %s\n", default_filename,
ab->hw_params->fw.dir);
return ret;
}

success:
ath12k_dbg(ab, ATH12K_DBG_BOOT, "using board api %d\n", bd_api);
ath12k_info(ab, "using board firmware %s\n", default_filename);
return 0;
}

Expand Down