Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firmware: cs_dsp: Handle long-offset data blocks

Handle a new type of data block that has a 32-bit offset. These are
identical to the normal blocks except that the offset is now in the
32-bit field that was previously 'sr'.

A new file version of 3 indicates that it is mandatory to process
the long-offset blocks, so that older code without that support will
reject the file.

The original 'sr' field was never used by the driver so it has been
renamed offset32.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20251231172711.450024-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
bc0305cb 25abdc15

+21 -5
+15 -4
drivers/firmware/cirrus/cs_dsp.c
··· 2138 2138 const struct cs_dsp_region *mem; 2139 2139 struct cs_dsp_alg_region *alg_region; 2140 2140 const char *region_name; 2141 - int ret, pos, blocks, type, offset, reg, version; 2141 + int ret, pos, blocks, type, version; 2142 + unsigned int offset, reg; 2142 2143 u8 *buf = NULL; 2143 2144 size_t buf_len = 0; 2144 2145 size_t region_len; ··· 2164 2163 switch (be32_to_cpu(hdr->rev) & 0xff) { 2165 2164 case 1: 2166 2165 case 2: 2166 + case 3: 2167 2167 break; 2168 2168 default: 2169 2169 cs_dsp_err(dsp, "%s: Unsupported coefficient file format %d\n", ··· 2173 2171 goto out_fw; 2174 2172 } 2175 2173 2176 - cs_dsp_info(dsp, "%s: v%d.%d.%d\n", file, 2174 + cs_dsp_info(dsp, "%s (v%d): v%d.%d.%d\n", file, 2175 + be32_to_cpu(hdr->rev) & 0xff, 2177 2176 (le32_to_cpu(hdr->ver) >> 16) & 0xff, 2178 2177 (le32_to_cpu(hdr->ver) >> 8) & 0xff, 2179 2178 le32_to_cpu(hdr->ver) & 0xff); ··· 2205 2202 (le32_to_cpu(blk->ver) >> 16) & 0xff, 2206 2203 (le32_to_cpu(blk->ver) >> 8) & 0xff, 2207 2204 le32_to_cpu(blk->ver) & 0xff); 2208 - cs_dsp_dbg(dsp, "%s.%d: %d bytes at 0x%x in %x\n", 2209 - file, blocks, le32_to_cpu(blk->len), offset, type); 2205 + cs_dsp_dbg(dsp, "%s.%d: %d bytes off:%#x off32:%#x in %#x\n", 2206 + file, blocks, le32_to_cpu(blk->len), offset, 2207 + le32_to_cpu(blk->offset32), type); 2210 2208 2211 2209 reg = 0; 2212 2210 region_name = "Unknown"; ··· 2240 2236 } 2241 2237 break; 2242 2238 2239 + case WMFW_ADSP2_XM_LONG: 2240 + case WMFW_ADSP2_YM_LONG: 2241 + case WMFW_HALO_XM_PACKED_LONG: 2242 + case WMFW_HALO_YM_PACKED_LONG: 2243 + offset = le32_to_cpu(blk->offset32); 2244 + type &= 0xff; /* strip extended block type flags */ 2245 + fallthrough; 2243 2246 case WMFW_ADSP1_DM: 2244 2247 case WMFW_ADSP1_ZM: 2245 2248 case WMFW_ADSP2_XM:
+6 -1
include/linux/firmware/cirrus/wmfw.h
··· 172 172 __le16 type; 173 173 __le32 id; 174 174 __le32 ver; 175 - __le32 sr; 175 + __le32 offset32; 176 176 __le32 len; 177 177 u8 data[]; 178 178 } __packed; ··· 199 199 #define WMFW_HALO_PM_PACKED 0x10 200 200 #define WMFW_HALO_XM_PACKED 0x11 201 201 #define WMFW_HALO_YM_PACKED 0x12 202 + 203 + #define WMFW_ADSP2_XM_LONG 0xf405 204 + #define WMFW_ADSP2_YM_LONG 0xf406 205 + #define WMFW_HALO_XM_PACKED_LONG 0xf411 206 + #define WMFW_HALO_YM_PACKED_LONG 0xf412 202 207 203 208 #endif