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.

mtd: rawnand: sunxi: introduce sram_size in sunxi_nfc_caps

The H6/H616 the SRAM is bigger than the A10/A23 one, so move its size
into sunxi_nfc_caps.

No functional change

Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

authored by

Richard Genoud and committed by
Miquel Raynal
5ddfbc68 97d13bce

+7 -5
+7 -5
drivers/mtd/nand/raw/sunxi_nand.c
··· 167 167 168 168 #define NFC_DEFAULT_TIMEOUT_MS 1000 169 169 170 - #define NFC_SRAM_SIZE 1024 171 - 172 170 #define NFC_MAX_CS 7 173 171 174 172 /* ··· 249 251 * @dma_maxburst: DMA maxburst 250 252 * @ecc_strengths: Available ECC strengths array 251 253 * @nstrengths: Size of @ecc_strengths 254 + * @sram_size: Size of the NAND controller SRAM 252 255 */ 253 256 struct sunxi_nfc_caps { 254 257 bool has_mdma; ··· 268 269 unsigned int dma_maxburst; 269 270 const u8 *ecc_strengths; 270 271 unsigned int nstrengths; 272 + int sram_size; 271 273 }; 272 274 273 275 /** ··· 506 506 while (len > offs) { 507 507 bool poll = false; 508 508 509 - cnt = min(len - offs, NFC_SRAM_SIZE); 509 + cnt = min(len - offs, nfc->caps->sram_size); 510 510 511 511 ret = sunxi_nfc_wait_cmd_fifo_empty(nfc); 512 512 if (ret) ··· 544 544 while (len > offs) { 545 545 bool poll = false; 546 546 547 - cnt = min(len - offs, NFC_SRAM_SIZE); 547 + cnt = min(len - offs, nfc->caps->sram_size); 548 548 549 549 ret = sunxi_nfc_wait_cmd_fifo_empty(nfc); 550 550 if (ret) ··· 1871 1871 case NAND_OP_DATA_OUT_INSTR: 1872 1872 start = nand_subop_get_data_start_off(subop, i); 1873 1873 remaining = nand_subop_get_data_len(subop, i); 1874 - cnt = min_t(u32, remaining, NFC_SRAM_SIZE); 1874 + cnt = min_t(u32, remaining, nfc->caps->sram_size); 1875 1875 cmd |= NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD; 1876 1876 1877 1877 if (instr->type == NAND_OP_DATA_OUT_INSTR) { ··· 2252 2252 .dma_maxburst = 4, 2253 2253 .ecc_strengths = sunxi_ecc_strengths_a10, 2254 2254 .nstrengths = ARRAY_SIZE(sunxi_ecc_strengths_a10), 2255 + .sram_size = 1024, 2255 2256 }; 2256 2257 2257 2258 static const struct sunxi_nfc_caps sunxi_nfc_a23_caps = { ··· 2272 2271 .dma_maxburst = 8, 2273 2272 .ecc_strengths = sunxi_ecc_strengths_a10, 2274 2273 .nstrengths = ARRAY_SIZE(sunxi_ecc_strengths_a10), 2274 + .sram_size = 1024, 2275 2275 }; 2276 2276 2277 2277 static const struct of_device_id sunxi_nfc_ids[] = {