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.

Merge tag 'mtd/for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux

Pull MTD updates from Miquel Raynal:
"MTD:

- Simon Glass wanted to support binman's output properties in order
to check their validity using the binding checks and proposed
changes with the missing properties as well as a binman compatible.

- Krzysztof Kozlowski on his side shared a new yaml for describing
Samsung's OneNAND interface.

- The interface with NVMEM has also been slightly improved/fixed,
especially now that OTP are also supported in the NAND subsystem.

- Along with these changes, small cleanups have also been contributed
around ID tables, structure sizes, arithmetic checks and comments.

Raw NAND subsystem:

- Two small fixes, one in the Hynix vendor code for properly
returning an error which might have been ignored and another in the
Davinci driver to properly synchronize the controller with the gpio
domain.

SPI NOR subsystem:

- SPI NOR now uses div_u64() instead of div64_u64() in places where
the divisor is 32 bits. Many 32 bit architectures can optimize this
variant better than a full 64 bit divide"

* tag 'mtd/for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
mtd: spi-nor: replace unnecessary div64_u64() with div_u64()
mtd: mchp23k256: drop unneeded MODULE_ALIAS
dt-bindings: mtd: fixed-partition: Add binman compatibles
dt-bindings: mtd: fixed-partitions: Add alignment properties
mtd: maps: sa1100-flash: Prefer struct_size over open coded arithmetic
mtd: core: Align comment with an action in mtd_otp_nvmem_add()
mtd: rawnand: hynix: fixed typo
mtd: rawnand: davinci: Add dummy read after sending command
mtd: partitions: redboot: Added conversion of operands to a larger type
dt-bindings: mtd: Add Samsung S5Pv210 OneNAND
mtd: core: Don't fail mtd_otp_nvmem_add() if OTP is unsupported
mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add()

+212 -12
+53
Documentation/devicetree/bindings/mtd/partitions/binman.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mtd/partitions/binman.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Binman entries 8 + 9 + description: | 10 + This corresponds to a binman 'entry'. It is a single partition which holds 11 + data of a defined type. 12 + 13 + Binman uses the type to indicate what data file / type to place in the 14 + partition. There are quite a number of binman-specific entry types, such as 15 + section, fill and files, to be added later. 16 + 17 + maintainers: 18 + - Simon Glass <sjg@chromium.org> 19 + 20 + allOf: 21 + - $ref: /schemas/mtd/partitions/partition.yaml# 22 + 23 + properties: 24 + compatible: 25 + enum: 26 + - u-boot # u-boot.bin from U-Boot project 27 + - tfa-bl31 # bl31.bin or bl31.elf from TF-A project 28 + 29 + required: 30 + - compatible 31 + 32 + unevaluatedProperties: false 33 + 34 + examples: 35 + - | 36 + partitions { 37 + compatible = "fixed-partitions"; 38 + #address-cells = <1>; 39 + #size-cells = <1>; 40 + 41 + partition@100000 { 42 + compatible = "u-boot"; 43 + reg = <0x100000 0xf00000>; 44 + align-size = <0x1000>; 45 + align-end = <0x10000>; 46 + }; 47 + 48 + partition@200000 { 49 + compatible = "tfa-bl31"; 50 + reg = <0x200000 0x100000>; 51 + align = <0x4000>; 52 + }; 53 + };
+72
Documentation/devicetree/bindings/mtd/partitions/partition.yaml
··· 57 57 user space from 58 58 type: boolean 59 59 60 + align: 61 + $ref: /schemas/types.yaml#/definitions/uint32 62 + minimum: 2 63 + maximum: 0x80000000 64 + multipleOf: 2 65 + description: 66 + This sets the alignment of the entry in bytes. 67 + 68 + The entry offset is adjusted so that the entry starts on an aligned 69 + boundary within the containing section or image. For example ‘align = 70 + <16>’ means that the entry will start on a 16-byte boundary. This may 71 + mean that padding is added before the entry. The padding is part of 72 + the containing section but is not included in the entry, meaning that 73 + an empty space may be created before the entry starts. Alignment 74 + must be a power of 2. If ‘align’ is not provided, no alignment is 75 + performed. 76 + 77 + align-size: 78 + $ref: /schemas/types.yaml#/definitions/uint32 79 + minimum: 2 80 + maximum: 0x80000000 81 + multipleOf: 2 82 + description: 83 + This sets the alignment of the entry size in bytes. It must be a power 84 + of 2. 85 + 86 + For example, to ensure that the size of an entry is a multiple of 64 87 + bytes, set this to 64. While this does not affect the content of the 88 + entry itself (the padding is performed only when its parent section is 89 + assembled), the end result is that the entry ends with the padding 90 + bytes, so may grow. If ‘align-size’ is not provided, no alignment is 91 + performed. 92 + 93 + align-end: 94 + $ref: /schemas/types.yaml#/definitions/uint32 95 + minimum: 2 96 + maximum: 0x80000000 97 + multipleOf: 2 98 + description: 99 + This sets the alignment (in bytes) of the end of an entry with respect 100 + to the containing section. It must be a power of 2. 101 + 102 + Some entries require that they end on an alignment boundary, 103 + regardless of where they start. This does not move the start of the 104 + entry, so the content of the entry will still start at the beginning. 105 + But there may be padding at the end. While this does not affect the 106 + content of the entry itself (the padding is performed only when its 107 + parent section is assembled), the end result is that the entry ends 108 + with the padding bytes, so may grow. If ‘align-end’ is not provided, 109 + no alignment is performed. 110 + 60 111 if: 61 112 not: 62 113 required: [ reg ] ··· 118 67 119 68 # This is a generic file other binding inherit from and extend 120 69 additionalProperties: true 70 + 71 + examples: 72 + - | 73 + partitions { 74 + compatible = "fixed-partitions"; 75 + #address-cells = <1>; 76 + #size-cells = <1>; 77 + 78 + partition@100000 { 79 + compatible = "u-boot"; 80 + reg = <0x100000 0xf00000>; 81 + align-size = <0x1000>; 82 + align-end = <0x10000>; 83 + }; 84 + 85 + partition@200000 { 86 + compatible = "tfa-bl31"; 87 + reg = <0x200000 0x100000>; 88 + align = <0x4000>; 89 + }; 90 + };
+65
Documentation/devicetree/bindings/mtd/samsung,s5pv210-onenand.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mtd/samsung,s5pv210-onenand.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Samsung S5Pv210 SoC OneNAND Controller 8 + 9 + maintainers: 10 + - Krzysztof Kozlowski <krzk@kernel.org> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - samsung,s5pv210-onenand 16 + 17 + reg: 18 + items: 19 + - description: Control registers 20 + - description: OneNAND interface nCE[0] 21 + - description: OneNAND interface nCE[1] 22 + 23 + clocks: 24 + maxItems: 2 25 + 26 + clock-names: 27 + items: 28 + - const: bus 29 + - const: onenand 30 + 31 + interrupts: 32 + maxItems: 1 33 + 34 + required: 35 + - compatible 36 + - reg 37 + - clocks 38 + - clock-names 39 + - interrupts 40 + 41 + allOf: 42 + - $ref: nand-controller.yaml 43 + 44 + unevaluatedProperties: false 45 + 46 + examples: 47 + - | 48 + #include <dt-bindings/clock/s5pv210.h> 49 + 50 + nand-controller@b0600000 { 51 + compatible = "samsung,s5pv210-onenand"; 52 + reg = <0xb0600000 0x2000>, 53 + <0xb0000000 0x20000>, 54 + <0xb0040000 0x20000>; 55 + clocks = <&clocks CLK_NANDXL>, <&clocks DOUT_FLASH>; 56 + clock-names = "bus", "onenand"; 57 + interrupt-parent = <&vic1>; 58 + interrupts = <31>; 59 + #address-cells = <1>; 60 + #size-cells = <0>; 61 + 62 + nand@0 { 63 + reg = <0>; 64 + }; 65 + };
+5
MAINTAINERS
··· 3671 3671 F: fs/bfs/ 3672 3672 F: include/uapi/linux/bfs_fs.h 3673 3673 3674 + BINMAN 3675 + M: Simon Glass <sjg@chromium.org> 3676 + S: Supported 3677 + F: Documentation/devicetree/bindings/mtd/partitions/binman* 3678 + 3674 3679 BITMAP API 3675 3680 M: Yury Norov <yury.norov@gmail.com> 3676 3681 R: Rasmus Villemoes <linux@rasmusvillemoes.dk>
-1
drivers/mtd/devices/mchp23k256.c
··· 257 257 MODULE_DESCRIPTION("MTD SPI driver for MCHP23K256 RAM chips"); 258 258 MODULE_AUTHOR("Andrew Lunn <andre@lunn.ch>"); 259 259 MODULE_LICENSE("GPL v2"); 260 - MODULE_ALIAS("spi:mchp23k256");
+2 -4
drivers/mtd/maps/sa1100-flash.c
··· 153 153 struct flash_platform_data *plat) 154 154 { 155 155 struct sa_info *info; 156 - int nr, size, i, ret = 0; 156 + int nr, i, ret = 0; 157 157 158 158 /* 159 159 * Count number of devices. ··· 167 167 goto out; 168 168 } 169 169 170 - size = sizeof(struct sa_info) + sizeof(struct sa_subdev_info) * nr; 171 - 172 170 /* 173 171 * Allocate the map_info structs in one go. 174 172 */ 175 - info = kzalloc(size, GFP_KERNEL); 173 + info = kzalloc(struct_size(info, subdev, nr), GFP_KERNEL); 176 174 if (!info) { 177 175 ret = -ENOMEM; 178 176 goto out;
+7 -2
drivers/mtd/mtdcore.c
··· 956 956 957 957 if (mtd->_get_user_prot_info && mtd->_read_user_prot_reg) { 958 958 size = mtd_otp_size(mtd, true); 959 - if (size < 0) 960 - return size; 959 + if (size < 0) { 960 + err = size; 961 + goto err; 962 + } 961 963 962 964 if (size > 0) { 963 965 nvmem = mtd_otp_nvmem_register(mtd, "user-otp", size, ··· 1014 1012 1015 1013 err: 1016 1014 nvmem_unregister(mtd->otp_user_nvmem); 1015 + /* Don't report error if OTP is not supported. */ 1016 + if (err == -EOPNOTSUPP) 1017 + return 0; 1017 1018 return dev_err_probe(dev, err, "Failed to register OTP NVMEM device\n"); 1018 1019 } 1019 1020
+4 -1
drivers/mtd/nand/raw/davinci_nand.c
··· 671 671 break; 672 672 } 673 673 674 - if (instr->delay_ns) 674 + if (instr->delay_ns) { 675 + /* Dummy read to be sure that command is sent before ndelay starts */ 676 + davinci_nand_readl(info, 0); 675 677 ndelay(instr->delay_ns); 678 + } 676 679 677 680 return 0; 678 681 }
+1 -1
drivers/mtd/nand/raw/nand_hynix.c
··· 401 401 if (ret) 402 402 pr_warn("failed to initialize read-retry infrastructure"); 403 403 404 - return 0; 404 + return ret; 405 405 } 406 406 407 407 static void hynix_nand_extract_oobsize(struct nand_chip *chip,
+1 -1
drivers/mtd/parsers/redboot.c
··· 102 102 offset -= master->erasesize; 103 103 } 104 104 } else { 105 - offset = directory * master->erasesize; 105 + offset = (unsigned long) directory * master->erasesize; 106 106 while (mtd_block_isbad(master, offset)) { 107 107 offset += master->erasesize; 108 108 if (offset == master->size)
+2 -2
drivers/mtd/spi-nor/core.c
··· 2893 2893 spi_nor_init_default_locking_ops(nor); 2894 2894 2895 2895 if (params->n_banks > 1) 2896 - params->bank_size = div64_u64(params->size, params->n_banks); 2896 + params->bank_size = div_u64(params->size, params->n_banks); 2897 2897 2898 2898 return 0; 2899 2899 } ··· 3406 3406 return -EINVAL; 3407 3407 3408 3408 mtd_region[i].erasesize = erasesize; 3409 - mtd_region[i].numblocks = div64_ul(region[i].size, erasesize); 3409 + mtd_region[i].numblocks = div_u64(region[i].size, erasesize); 3410 3410 mtd_region[i].offset = region[i].offset; 3411 3411 } 3412 3412