From nobody Sun Feb 8 12:31:34 2026 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F8B22356B4 for ; Wed, 2 Apr 2025 08:57:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743584229; cv=none; b=FPy+dVzbYigWcchT/JKKG1jaQFtvViimI4RxfKi5QDAqt6PbX85tE75hDbeQ4O++sQ8YIwcmtsJW0Rg1EzzgQoe3C72oJo8sCqI1QxuCBYA8a/bZwKro4fI4OFQX8aI6/Z7W5sI/FRvfLjNVyiRTBHdVGwBwwKeec0/r6adpnzw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743584229; c=relaxed/simple; bh=J17KQUAM1UFEkPNdLI3YGj21IY194ZTnRhYG21HH2uM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jyGuQbcbEy8n7bRju1IiH784pZGaOvZd5dDhIYEbBmj/8bPHpvX3I6HJQX7sedorGYnu/hSyExf/6kH2mVqYCNtpA/AM5OoqqZQ8lalVJoIwPwxUJKlQwWWpSg2qt9F97PgrykNWpwuUTdmtgRLka4Dvfuug2xrHOVL0L8xlp/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hyQD6zSz; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hyQD6zSz" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-22438c356c8so124578015ad.1 for ; Wed, 02 Apr 2025 01:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743584226; x=1744189026; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+4XJSflMgjyjzi+qNJEGdLwxClIxHg4Ygzp0rQjBYsY=; b=hyQD6zSzD6wuDkj1SGaqFmKcH88H8hRaHOQ3yyxFpC/1tIJe3iTywsdGmqlC7liJZF 1D2jG8SF1pc0qTQtPOqERDzxdtyl2Rk1mJupqCUGZlMN8mAqg6xFNRiEFWg+Pvw45v6x fnd1FEPZisS+gzM/2Q/pu6OILX9g9LbjMNx87wCN30VSJAgZ8c15BP/XyyLMxc2u5ADH rsoTXf8nVrpO4VrCKo7gm4KLQIZqRWpwstCnRFWcg0v5JJ8hIOYUaUubpnnd5wq8wq5B VuPSv8hNJqcWw5Z51WSbhqRrWmko0i+jtyicyk5S2ZahIT+lCYe0JawzWkac4wV13D/S JLMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743584226; x=1744189026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+4XJSflMgjyjzi+qNJEGdLwxClIxHg4Ygzp0rQjBYsY=; b=mBiOAkyR4vLpAzCOF9Kw/odVqhwid+YL2fDGDbIaON24AB5pfJYJvuUTvTL3HHGXcU yCV2zDgBj2RudFl+waih2FiiV1EtAB2V9+pbGBr7Z5FJbT2NpZkk3xvditpfbHDKWoUs AJNY63x1mHkpgriHi8W4yi0rPx5bv0Aee36QKfRUHsO3MelPdSklbjJbsta55YPtN0Al HfEY9daivS2WkhhpiWDN3BAMSKDAGv6pio42egq+qfHBCQiA8TsBBYfbY7G6iPjMZUf0 Gay651oXCLOVfxmysD3LJ+0JC6h5NRI6eQb4b6Yp94+84lXZtyoVRCw6Z8n16vm5xBCA iBBw== X-Forwarded-Encrypted: i=1; AJvYcCVTqLJ8+dsbAG6BEgL9N17LfzRYpM1axFrbcPxyrlqP5Alybb1j2SolaxvClwQFXvguDf3+P8ikqFPebxg=@vger.kernel.org X-Gm-Message-State: AOJu0YwwYzCYlRnvPl/Yj/1SK7aNjRmdoeLCeixgUYdp4P+BuOCEx2Io eviVkpgfgnELfYLZTo7sVDNAO6siZs8WGQBf60xplDcMi47f3coUkaHW9zWQ0mo= X-Gm-Gg: ASbGnctE6yd6pNWHfWMP4JePvazaHFBmQBERTIbzv1EHZKsjLkF2un/zDLM7HR2xEZi TnZ65BZ5fHzn2vXmkt8H88fWciJau1/8ai9pyw2Mxd5ynK9EcM1djzC8be7tXe+cYKX1z4ntvUt jPstsw7N0CnpHAAor93KgW2Uij6ywIZeAAe5/N+CNePVVyWshPFsuyNYGlcLOF8MttY1hTugod0 ALQ8/83q5eWZRNfPckoYJW4gtTKPG15VgxznW10rSwFbBtTkmZ5BFhhYHJdDvKeA5Vtes0lS8ME bOeXArJqY0LKImJxut5Tp7WfxsJIhQfV2cacJn7FujWNn11pHpAE3K/ToA0MX9VLMEy8 X-Google-Smtp-Source: AGHT+IHwQPrOaNhtlYiwAS4XhB+tYwg3EASzgu0dw0IADcCjm0bGuGF5TGg+UMtsF7o//7yupE9vjQ== X-Received: by 2002:aa7:88c1:0:b0:736:3d7c:2368 with SMTP id d2e1a72fcca58-7398036fc34mr19960413b3a.7.1743584226080; Wed, 02 Apr 2025 01:57:06 -0700 (PDT) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-739710b38d5sm10741865b3a.139.2025.04.02.01.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Apr 2025 01:57:05 -0700 (PDT) Received: from hqs-appsw-a2o.mp600.macronix.com (linux-patcher [172.17.236.67]) by twhmp6px (Postfix) with ESMTPS id EED478058E; Wed, 2 Apr 2025 17:06:09 +0800 (CST) From: Cheng Ming Lin To: tudor.ambarus@linaro.org, pratyush@kernel.org, mwalle@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: alvinzhou@mxic.com.tw, leoyu@mxic.com.tw, Cheng Ming Lin Subject: [PATCH 1/3] mtd: spi-nor: macronix: Drop the redundant flash info fields Date: Wed, 2 Apr 2025 16:51:27 +0800 Message-Id: <20250402085129.1027670-2-linchengming884@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250402085129.1027670-1-linchengming884@gmail.com> References: <20250402085129.1027670-1-linchengming884@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cheng Ming Lin Many flash devices share the same ID but have different part numbers. To avoid confusion, the part number field is removed. Additionally, since SFDP already provides size information and functionality covered by no_sfdp_flags, these fields are also removed. Furthermore, when 4-byte address instruction table is available, the SPI_NOR_4B_OPCODES flag is no longer needed and is removed. Signed-off-by: Cheng Ming Lin Acked-by: Tudor Ambarus --- zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c22015 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 00 01 01 ff 00 00 01 09 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 60 00 00 ff ff ff ff ff ff ff ff ff |....`.........= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 81 ff ff ff ff 00 00 ff 00 ff 08 3b 00 ff |. ...........;= ..| 00000040 ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 10 d8 |............. = ..| 00000050 00 ff 00 ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000060 00 36 00 27 f6 4f ff ff fe cf ff ff ff ff ff ff |.6.'.O........= ..| 00000070 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 08935e50e96c5981966dfbf2d495a13072270e372db36734e8cfd73f872912f9 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 Supported page program modes by the flash 1S-1S-1S opcode 0x02 zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 20 15 c2 20 15 size 2.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_16BIT_SR opcodes read 0x3b dummy cycles 8 erase 0xd8 program 0x02 8D extension none protocols read 1S-1S-2S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [2] d8 (64.0 KiB) [3] c7 (2.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-001fffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.085111 seconds, 23.5MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* e27a5ff67d79d89711cd564f46f383b0517cc2456acebaed136edefb27451742 /tmp/spi_= read e27a5ff67d79d89711cd564f46f383b0517cc2456acebaed136edefb27451742 /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read e27a5ff67d79d89711cd564f46f383b0517cc2456acebaed136edefb27451742 /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 2097152 (2M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c22018 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 06 01 02 ff 00 06 01 10 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 10 01 00 ff 84 00 01 02 c0 00 00 ff |..............= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 f1 ff ff ff ff 07 44 eb 08 6b 08 3b 04 bb |. ......D..k.;= ..| 00000040 fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 |..........D.. = .R| 00000050 10 d8 00 ff 82 41 bd 00 81 e5 7b c6 44 03 67 38 |.....A....{.D.= g8| 00000060 30 b0 30 b0 f7 bd d5 5c 4a be 29 ff e1 d0 ff ff |0.0....\J.)...= ..| 00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000c0 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000110 00 36 00 27 9d f9 c0 64 85 cb ff ff ff ff ff ff |.6.'...d......= ..| 00000120 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp c7c4287a584fa23f4f5037a90ab0ee6ddc6ff3f0cee89889e54465e86542c85e /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 Supported page program modes by the flash 1S-1S-1S opcode 0x02 zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 20 18 c2 20 18 size 16.0 MiB write size 1 page size 256 address nbytes 3 flags HAS_LOCK | HAS_4BIT_BP | SOFT_RESET opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (16.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-00ffffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.084103 seconds, 23.8MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 8efea8e5af575b4fa5097eb68c30c313d2c232daf6a7c0ecd6940cbefbd937b7 /tmp/spi_= read 8efea8e5af575b4fa5097eb68c30c313d2c232daf6a7c0ecd6940cbefbd937b7 /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read 8efea8e5af575b4fa5097eb68c30c313d2c232daf6a7c0ecd6940cbefbd937b7 /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 16777216 (16M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c22019 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 06 01 02 ff 00 06 01 10 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 10 01 00 ff 84 00 01 02 c0 00 00 ff |..............= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 fb ff ff ff ff 0f 44 eb 08 6b 08 3b 04 bb |. ......D..k.;= ..| 00000040 fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 |..........D.. = .R| 00000050 10 d8 00 ff d6 59 dd 00 82 9f 03 db 44 03 67 38 |.....Y......D.= g8| 00000060 30 b0 30 b0 f7 bd d5 5c 4a 9e 29 ff f0 50 f9 85 |0.0....\J.)..P= ..| 00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000c0 7f 8f ff ff 21 5c dc ff ff ff ff ff ff ff ff ff |....!\........= ..| 000000d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000110 00 36 00 27 9d f9 c0 64 85 cb ff ff ff ff ff ff |.6.'...d......= ..| 00000120 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 70fa5d53fd09472e3af67d32d82f01ffcbfac31241b2aa81dfaba08527125123 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 1S-4S-4S opcode 0x3e zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 20 19 c2 20 19 size 32.0 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | SOFT_RESET opcodes read 0xec dummy cycles 6 erase 0xdc program 0x3e 8D extension none protocols read 1S-4S-4S write 1S-4S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] 5c (32.0 KiB) [2] dc (64.0 KiB) [3] c7 (32.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-01ffffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.083873 seconds, 23.8MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 13695582843c76df744571844a323ba75d6c4c71f4fe27315e78ce8944cf6c2a /tmp/spi_= read 13695582843c76df744571844a323ba75d6c4c71f4fe27315e78ce8944cf6c2a /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read 13695582843c76df744571844a323ba75d6c4c71f4fe27315e78ce8944cf6c2a /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 33554432 (32M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c2201a zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 00 01 01 ff 00 00 01 09 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 60 00 00 ff ff ff ff ff ff ff ff ff |....`.........= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 f3 ff ff ff ff 1f 44 eb 08 6b 08 3b 04 bb |. ......D..k.;= ..| 00000040 fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 |..........D.. = .R| 00000050 10 d8 00 ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000060 00 36 00 27 9d f9 c0 64 85 cb ff ff ff ff ff ff |.6.'...d......= ..| 00000070 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 373bf7251146d12849dbfa877f84f66a46ed3bf7079f2b369cc215a4f077254c /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 Supported page program modes by the flash 1S-1S-1S opcode 0x02 1S-1S-4S opcode 0x34 zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 20 1a c2 20 1a size 64.0 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_16BIT_SR opcodes read 0xec dummy cycles 6 erase 0xdc program 0x34 8D extension none protocols read 1S-4S-4S write 1S-1S-4S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (64.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-03ffffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.083717 seconds, 23.9MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 9e4550acef4209bb5e51c80dff2b228c42970b5ae2c23a1afd2fdc749594b484 /tmp/spi_= read 9e4550acef4209bb5e51c80dff2b228c42970b5ae2c23a1afd2fdc749594b484 /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read 9e4550acef4209bb5e51c80dff2b228c42970b5ae2c23a1afd2fdc749594b484 /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 67108864 (64M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c2201b zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 06 01 02 ff 00 06 01 10 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 10 01 00 ff 84 00 01 02 c0 00 00 ff |..............= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 fb ff ff ff ff 3f 44 eb 08 6b 08 3b 04 bb |. .....?D..k.;= ..| 00000040 fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 |..........D.. = .R| 00000050 10 d8 00 ff d6 49 c5 00 85 df 04 e3 44 03 67 38 |.....I......D.= g8| 00000060 30 b0 30 b0 f7 bd d5 5c 4a 9e 29 ff f0 50 f9 85 |0.0....\J.)..P= ..| 00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000c0 7f ef ff ff 21 5c dc ff ff ff ff ff ff ff ff ff |....!\........= ..| 000000d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000110 00 36 00 27 9d f9 c0 64 85 cb ff ff ff ff ff ff |.6.'...d......= ..| 00000120 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp bec91ac20c9f7c63a00992fd2f779f8c5378d8f9afc699a2c741be5bdf268e35 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 1S-4S-4S opcode 0x3e zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 20 1b c2 20 1b size 128 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | SOFT_RESET opcodes read 0xec dummy cycles 6 erase 0xdc program 0x3e 8D extension none protocols read 1S-4S-4S write 1S-4S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] 5c (32.0 KiB) [2] dc (64.0 KiB) [3] c7 (128 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-07ffffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.084372 seconds, 23.7MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 6238ab82a1364a95b63bdff6040c640f8224b111c672a3a75530d862dbace7de /tmp/spi_= read 6238ab82a1364a95b63bdff6040c640f8224b111c672a3a75530d862dbace7de /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read 6238ab82a1364a95b63bdff6040c640f8224b111c672a3a75530d862dbace7de /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 134217728 (128M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c2253a zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 06 01 02 ff 00 06 01 10 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 10 01 00 ff 84 00 01 02 c0 00 00 ff |..............= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 fb ff ff ff ff 1f 44 eb 08 6b 08 3b 04 bb |. ......D..k.;= ..| 00000040 fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 |..........D.. = .R| 00000050 10 d8 00 ff 87 49 b5 00 82 df 04 e2 44 03 67 38 |.....I......D.= g8| 00000060 30 b0 30 b0 f7 bd d5 5c 4a 9e 29 ff f0 50 f9 85 |0.0....\J.)..P= ..| 00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000c0 7f 8f ff ff 21 5c dc ff ff ff ff ff ff ff ff ff |....!\........= ..| 000000d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000110 00 20 50 16 9d f9 c0 64 85 cb ff ff ff ff ff ff |. P....d......= ..| 00000120 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp faa50d0c2c8f26dbdfb400c995bd19a4a492404336588a72c596088c5641164f /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 1S-4S-4S opcode 0x3e zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 25 3a c2 25 3a size 64.0 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | SOFT_RESET opcodes read 0xec dummy cycles 6 erase 0xdc program 0x3e 8D extension none protocols read 1S-4S-4S write 1S-4S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] 5c (32.0 KiB) [2] dc (64.0 KiB) [3] c7 (64.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-03ffffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.084626 seconds, 23.6MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 41a0ed8ab44ff2005767e66f5afd4e1fc0b8be4fb84df4ce6bc0adeb6a327565 /tmp/spi_= read 41a0ed8ab44ff2005767e66f5afd4e1fc0b8be4fb84df4ce6bc0adeb6a327565 /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read 41a0ed8ab44ff2005767e66f5afd4e1fc0b8be4fb84df4ce6bc0adeb6a327565 /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 67108864 (64M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c2253c zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 06 01 02 ff 00 06 01 10 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 10 01 00 ff 84 00 01 02 c0 00 00 ff |..............= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 fb ff ff ff ff 7f 44 eb 08 6b 08 3b 04 bb |. ......D..k.;= ..| 00000040 fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 |..........D.. = .R| 00000050 10 d8 00 ff 89 49 bd 00 8d 12 00 e2 44 03 67 44 |.....I......D.= gD| 00000060 30 b0 30 b0 f7 bd d5 5c 4a 9e 29 ff f0 50 f9 85 |0.0....\J.)..P= ..| 00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000b0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000c0 7f 8f ff ff 21 5c dc ff ff ff ff ff ff ff ff ff |....!\........= ..| 000000d0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000e0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 000000f0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000110 00 20 00 17 9d f9 c0 64 85 cb ff ff ff ff ff ff |. .....d......= ..| 00000120 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp cc502e1eba91c51e5758d7c41b19e77bfe5a403c2145e4572777c41f9bd48ae1 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3c mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbc mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6c mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 4S-4S-4S opcode 0xec mode cycles 2 dummy cycles 4 Supported page program modes by the flash 1S-1S-1S opcode 0x12 1S-1S-4S opcode 0x34 1S-4S-4S opcode 0x3e zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 25 3c c2 25 3c size 256 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | SOFT_RESET opcodes read 0xec dummy cycles 6 erase 0xdc program 0x3e 8D extension none protocols read 1S-4S-4S write 1S-4S-4S register 1S-1S-1S erase commands 21 (4.00 KiB) [1] 5c (32.0 KiB) [2] dc (64.0 KiB) [3] c7 (256 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-0fffffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.084135 seconds, 23.8MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* ab0d96ddd3bfa96c2fc6e8ab466f82d0ac9b1b54ae04331a46388790407c1a0d /tmp/spi_= read ab0d96ddd3bfa96c2fc6e8ab466f82d0ac9b1b54ae04331a46388790407c1a0d /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read ab0d96ddd3bfa96c2fc6e8ab466f82d0ac9b1b54ae04331a46388790407c1a0d /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 268435456 (256M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c2813a zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 08 01 04 fd 00 07 01 14 40 00 00 ff |SFDP........@.= ..| 00000010 87 01 01 1c 90 00 00 ff 0a 00 01 08 00 01 00 ff |..............= ..| 00000020 05 00 01 05 20 01 00 ff 84 00 01 02 34 01 00 ff |.... .......4.= ..| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |..............= ..| 00000040 e5 20 8a ff ff ff ff 1f 00 ff 00 ff 00 ff 00 ff |. ............= ..| 00000050 ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 10 d8 |............. = ..| 00000060 00 ff 00 ff 8b 79 01 00 8f 12 00 e2 cc 04 67 46 |.....y........= gF| 00000070 30 b0 30 b0 f4 bd d5 5c 00 00 00 ff 10 10 00 20 |0.0....\......= . | 00000080 00 00 00 00 00 00 7c a3 48 00 00 00 00 00 77 77 |......|.H.....= ww| 00000090 00 00 00 00 00 00 00 40 0f d1 ff f3 0f d1 ff f3 |.......@......= ..| 000000a0 00 05 00 90 00 05 00 b1 00 2b 00 95 00 2b 00 96 |.........+...+= ..| 000000b0 72 71 03 b8 72 71 03 b8 00 00 00 00 90 a3 18 82 |rq..rq........= ..| 000000c0 00 c0 69 96 00 00 00 00 00 00 00 00 72 71 00 98 |..i.........rq= ..| 000000d0 72 71 00 b8 72 71 00 99 00 00 00 00 72 71 00 98 |rq..rq......rq= ..| 000000e0 72 71 00 f8 72 71 00 99 72 71 00 f9 00 00 00 00 |rq..rq..rq....= ..| 000000f0 00 00 00 00 01 15 01 d0 72 71 06 d8 00 00 86 50 |........rq....= .P| 00000100 00 00 06 01 00 00 00 00 02 00 01 03 00 02 00 00 |..............= ..| 00000110 00 00 06 01 00 00 00 00 00 00 72 06 00 02 00 00 |..........r...= ..| 00000120 00 ee c0 69 72 72 71 71 00 d8 f7 f6 00 00 00 00 |...irrqq......= ..| 00000130 14 45 98 80 43 06 0f 00 21 dc ff ff |.E..C...!...| 0000013c zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 492e48f9266779b75fd21c689b8fb651a03881d72d241f4db9edecf9d493fc1b /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x13 mode cycles 0 dummy cycles 0 8D-8D-8D opcode 0xee mode cycles 0 dummy cycles 16 Supported page program modes by the flash 1S-1S-1S opcode 0x12 8D-8D-8D opcode 0x12 zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 81 3a c2 81 3a size 64.0 MiB write size 1 page size 256 address nbytes 4 flags 4B_OPCODES | HAS_4BAIT | HAS_16BIT_SR | IO_MODE_EN_VOLATILE= | SOFT_RESET | RWW | 1<<17 opcodes read 0xee dummy cycles 16 erase 0xdc program 0x12 8D extension invert protocols read 8D-8D-8D write 8D-8D-8D register 8D-8D-8D erase commands 21 (4.00 KiB) [2] dc (64.0 KiB) [3] c7 (64.0 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-03ffffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.085986 seconds, 23.3MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 92f3075bebc368c9675ea8019fb3b175576fd8fcef45f32126b1e0f961bcbf29 /tmp/spi_= read 92f3075bebc368c9675ea8019fb3b175576fd8fcef45f32126b1e0f961bcbf29 /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read 92f3075bebc368c9675ea8019fb3b175576fd8fcef45f32126b1e0f961bcbf29 /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 67108864 (64M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id c29e16 zynq> cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer macronix zynq> hexdump -Cv /sys/bus/spi/devices/spi0.0/spi-nor/sfdp 00000000 53 46 44 50 00 01 01 ff 00 00 01 09 30 00 00 ff |SFDP........0.= ..| 00000010 c2 00 01 04 60 00 00 ff ff ff ff ff ff ff ff ff |....`.........= ..| 00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000030 e5 20 f1 ff ff ff ff 01 44 eb 08 6b 08 3b 04 bb |. ......D..k.;= ..| 00000040 ee ff ff ff ff ff 00 ff ff ff 00 ff 0c 20 0f 52 |............. = .R| 00000050 10 d8 00 ff ff ff ff ff ff ff ff ff ff ff ff ff |..............= ..| 00000060 00 36 00 27 9e 49 ff ff d9 f8 ff ff ff ff ff ff |.6.'.I........= ..| 00000070 zynq> sha256sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp cf7b2e5b00388040786877de15f7594fcc064a1b7dbe34393a06d462cc1da9b0 /sys/bus/= spi/devices/spi0.0/spi-nor/sfdp zynq> cat /sys/kernel/debug/spi-nor/spi0.0/capabilities Supported read modes by the flash 1S-1S-1S opcode 0x03 mode cycles 0 dummy cycles 0 1S-1S-2S opcode 0x3b mode cycles 0 dummy cycles 8 1S-2S-2S opcode 0xbb mode cycles 0 dummy cycles 4 1S-1S-4S opcode 0x6b mode cycles 0 dummy cycles 8 1S-4S-4S opcode 0xeb mode cycles 2 dummy cycles 4 Supported page program modes by the flash 1S-1S-1S opcode 0x02 zynq> cat /sys/kernel/debug/spi-nor/spi0.0/params name (null) id c2 9e 16 c2 9e 16 size 4.00 MiB write size 1 page size 256 address nbytes 3 flags HAS_16BIT_SR opcodes read 0xeb dummy cycles 6 erase 0xd8 program 0x02 8D extension none protocols read 1S-4S-4S write 1S-1S-1S register 1S-1S-1S erase commands 20 (4.00 KiB) [1] 52 (32.0 KiB) [2] d8 (64.0 KiB) [3] c7 (4.00 MiB) sector map region (in hex) | erase mask | overlaid ------------------+------------+---------- 00000000-003fffff | [ 3] | no zynq> dd if=3D/dev/urandom of=3D/tmp/spi_test bs=3D1M count=3D2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.084090 seconds, 23.8MB/s zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> hexdump /tmp/spi_read 0000000 ffff ffff ffff ffff ffff ffff ffff ffff * 0200000 zynq> sha256sum /tmp/spi_read 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read zynq> mtd_debug write /dev/mtd0 0 2097152 /tmp/spi_test Copied 2097152 bytes from /tmp/spi_test to address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4f28908b56bf0242163de2bb1f52295ed45b98d16fdbfdc9fd30d1dfcdc540cb /tmp/spi_= read 4f28908b56bf0242163de2bb1f52295ed45b98d16fdbfdc9fd30d1dfcdc540cb /tmp/spi_= test zynq> mtd_debug erase /dev/mtd0 0 2097152 Erased 2097152 bytes from address 0x00000000 in flash zynq> mtd_debug read /dev/mtd0 0 2097152 /tmp/spi_read Copied 2097152 bytes from address 0x00000000 in flash to /tmp/spi_read zynq> sha256sum /tmp/spi* 4bda3a28f4ffe603c0ec1258c0034d65a1a0d35ab7bd523a834608adabf03cc5 /tmp/spi_= read 4f28908b56bf0242163de2bb1f52295ed45b98d16fdbfdc9fd30d1dfcdc540cb /tmp/spi_= test zynq> mtd_debug info /dev/mtd0 mtd.type =3D MTD_NORFLASH mtd.flags =3D MTD_CAP_NORFLASH mtd.size =3D 4194304 (4M) mtd.erasesize =3D 65536 (64K) mtd.writesize =3D 1 mtd.oobsize =3D 0 regions =3D 0 drivers/mtd/spi-nor/macronix.c | 36 +++++++++------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c index 4b09e5add630..2acd8e28d1c4 100644 --- a/drivers/mtd/spi-nor/macronix.c +++ b/drivers/mtd/spi-nor/macronix.c @@ -88,10 +88,8 @@ static const struct flash_info macronix_nor_parts[] =3D { .name =3D "mx25l8005", .size =3D SZ_1M, }, { + /* MX25L1606E */ .id =3D SNOR_ID(0xc2, 0x20, 0x15), - .name =3D "mx25l1606e", - .size =3D SZ_2M, - .no_sfdp_flags =3D SECT_4K, }, { .id =3D SNOR_ID(0xc2, 0x20, 0x16), .name =3D "mx25l3205d", @@ -103,29 +101,21 @@ static const struct flash_info macronix_nor_parts[] = =3D { .size =3D SZ_8M, .no_sfdp_flags =3D SECT_4K, }, { + /* MX25L12805D */ .id =3D SNOR_ID(0xc2, 0x20, 0x18), - .name =3D "mx25l12805d", - .size =3D SZ_16M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP, - .no_sfdp_flags =3D SECT_4K, }, { + /* MX25L25635E, MX25L25645G */ .id =3D SNOR_ID(0xc2, 0x20, 0x19), - .name =3D "mx25l25635e", - .size =3D SZ_32M, - .no_sfdp_flags =3D SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixups =3D &mx25l25635_fixups }, { + /* MX66L51235F */ .id =3D SNOR_ID(0xc2, 0x20, 0x1a), - .name =3D "mx66l51235f", - .size =3D SZ_64M, - .no_sfdp_flags =3D SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixup_flags =3D SPI_NOR_4B_OPCODES, .fixups =3D ¯onix_qpp4b_fixups, }, { + /* MX66L1G45G */ .id =3D SNOR_ID(0xc2, 0x20, 0x1b), - .name =3D "mx66l1g45g", - .size =3D SZ_128M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, .fixups =3D ¯onix_qpp4b_fixups, }, { /* MX66L2G45G */ @@ -167,11 +157,8 @@ static const struct flash_info macronix_nor_parts[] = =3D { .size =3D SZ_16M, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* MX25U51245G */ .id =3D SNOR_ID(0xc2, 0x25, 0x3a), - .name =3D "mx25u51245g", - .size =3D SZ_64M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, - .fixup_flags =3D SPI_NOR_4B_OPCODES, .fixups =3D ¯onix_qpp4b_fixups, }, { .id =3D SNOR_ID(0xc2, 0x25, 0x3a), @@ -185,11 +172,8 @@ static const struct flash_info macronix_nor_parts[] = =3D { .id =3D SNOR_ID(0xc2, 0x25, 0x3b), .fixups =3D ¯onix_qpp4b_fixups, }, { + /* MX66U2G45G */ .id =3D SNOR_ID(0xc2, 0x25, 0x3c), - .name =3D "mx66u2g45g", - .size =3D SZ_256M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, - .fixup_flags =3D SPI_NOR_4B_OPCODES, .fixups =3D ¯onix_qpp4b_fixups, }, { .id =3D SNOR_ID(0xc2, 0x26, 0x18), @@ -215,15 +199,13 @@ static const struct flash_info macronix_nor_parts[] = =3D { .size =3D SZ_4M, .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { + /* MX25UW51245G */ .id =3D SNOR_ID(0xc2, 0x81, 0x3a), - .name =3D "mx25uw51245g", .n_banks =3D 4, .flags =3D SPI_NOR_RWW, }, { + /* MX25L3255E */ .id =3D SNOR_ID(0xc2, 0x9e, 0x16), - .name =3D "mx25l3255e", - .size =3D SZ_4M, - .no_sfdp_flags =3D SECT_4K, }, /* * This spares us of adding new flash entries for flashes that can be --=20 2.25.1 From nobody Sun Feb 8 12:31:34 2026 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA3D7231CAE for ; Wed, 2 Apr 2025 08:57:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743584227; cv=none; b=shS3HKGcTTs6hHQMt2icFtQcH1vLQkk2eBku1gX2EPWe5PhlE5sLKe4ocEO2bkGAa1RX0aBHtFs8otTFj+ulltnR+hr3lPj4QT1kocuNP0MU1qvtASPNg3GtumKGbH5pPztbFjN5LztYBL1gOk9ARzUY4u/bZ0fUzmj12YIUELE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743584227; c=relaxed/simple; bh=EDLEgtEdlcFXO9FrxUMsvd2X/o5lf0PxVMZuhrerVdQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DZlVy3kl2OtGFR50fR7q/X6xPhv7drRjo16zukYziSiKHK9462pmVFx7yoNe6BNJV/Lc93sDHynzNJsOIbDIrEGZHKA/HXH+VwusN6PqLuiW20Rb5bbFt+PxIXG4Ts1/9OIikEnl4HwJbpxFoNCOzaL7Hpj4Baw5mJ1ivSOMY7M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RWmzGZjW; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RWmzGZjW" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-224171d6826so104978865ad.3 for ; Wed, 02 Apr 2025 01:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743584225; x=1744189025; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WWAPszpWlvrmrWFqRVfzalTuSm2t7m4HZ4+y2asZ5jM=; b=RWmzGZjWuCRc0AR3uuNDHmpK32S0A/JgpDczKzhfKpqg5U7zMkKXImA+JyoM5idzKX yVStGt5EA3AL+XuTH55MJhueQQdpZ3b4M0XF2UZ36D5mVkE7qz2uUV+OtuJX4Z7XAGA3 BAgIQ6pbVLEBMxfbc5aGV+CfjH5pTFrsCJ5+f+uF+kYajFshm/gHEhtcVHcR6yfwXapM iIN8Xot+iDoTNmI7c1kZqoqq3K965OvwaoK5Yx1LS5oQ87UUiqCHApgA3XtY0skfgwX8 2negglIN0EV6+ZkAHOm2+kpPoCG315tbLBLWZEpsWFwyIbJHu31T07lrp0RuvfonMmyv ZxEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743584225; x=1744189025; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WWAPszpWlvrmrWFqRVfzalTuSm2t7m4HZ4+y2asZ5jM=; b=o9JFPzz7OXE2NhCGTUoeSP4Dac7iz57AFOEXZ/Q/0M7z9PSd0dgTw7I/Bb5JVkIQEh oXoNO7Af1cmZK6naciqkJKGElHozS4vXp//X7HA1Xx//35+LBYmpgAtQdrWs36gn7F6p MgQTTQc8lDCQ7vne2JfDV1ybyl/bLupV4bktNHf1cECkSfdRAaSG+kScQoXdwTxsRNXZ CC45ZZEFA8kHKm5+YXaHGXNCA6d04AiNbsl/0d6MnISRU862Qq2sS1Fv++TBUA6RKCas ZY5TZErSTSmH9UScXXYGFHgPV6gbaAwckl1vn29Zk61wMZLn1YLi1M2CQRmRN5y2rxiP omxg== X-Forwarded-Encrypted: i=1; AJvYcCXaGXb5c0GdmcHqmu/i3YbvuCiEJHxIiSOPdJDjy78Pc21tKDtwpIH7hpxLbrW0GNGKB6VRBH/dt7ulKR0=@vger.kernel.org X-Gm-Message-State: AOJu0Yzkodf4IAzWJISGAjNYH8N8SjnVpljf7/UXqPOWALzAF6Ft1h44 5YDBB05T1Z8f4G/+jVF3Iil+orxcSOtJ3PkoE3jk2zkJ2bbd5R+GpZimgxu+7r8= X-Gm-Gg: ASbGncswrNaRLxuY3x+0ac80qsGjdXeLefUDlCbZkpFyyXr+5u6v9uuhol3wPagPkLB uAlyMG5MKUscTSzko6hNlK+7sC9XTW90ke7qrDTIgESXawtt2KHQMmOEYVElvpdmbXGxBLqft2u Kw50R0icKL+9hU7x17Q6/CzLXzFFn+5Drm53RoegMCwHDGvi/o2YSmczKl3jbA3PpeQ3M7Z8qWx GjNZE87oXiguCM9SfM2v+LM/vSmmgiuFhnzVxEv2Ud9bHhBCpMB6hlbtSFBdIWvs71nLnQhVuTm vynJOCSR6Us/+UetZv4iQ5+DP+KMdAIGKl5BT3ZFEa1+qPXV27YdQ/ebX0KQ1WgV9sJ6 X-Google-Smtp-Source: AGHT+IEB11GBk+GAE4+ZVetVY/CYu/AG8QyTGlgekDHi/jvsC7njBUNP5H6KE5bwxY7hZlGb8lzR/g== X-Received: by 2002:a17:903:1c7:b0:224:c46:d166 with SMTP id d9443c01a7336-2292f9e53camr256175075ad.40.1743584225005; Wed, 02 Apr 2025 01:57:05 -0700 (PDT) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291f1de7d7sm102753925ad.173.2025.04.02.01.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Apr 2025 01:57:04 -0700 (PDT) Received: from hqs-appsw-a2o.mp600.macronix.com (linux-patcher [172.17.236.67]) by twhmp6px (Postfix) with ESMTPS id 0103E80605; Wed, 2 Apr 2025 17:06:10 +0800 (CST) From: Cheng Ming Lin To: tudor.ambarus@linaro.org, pratyush@kernel.org, mwalle@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: alvinzhou@mxic.com.tw, leoyu@mxic.com.tw, Cheng Ming Lin Subject: [PATCH 2/3] mtd: spi-nor: macronix: Remove duplicate flash info entries Date: Wed, 2 Apr 2025 16:51:28 +0800 Message-Id: <20250402085129.1027670-3-linchengming884@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250402085129.1027670-1-linchengming884@gmail.com> References: <20250402085129.1027670-1-linchengming884@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cheng Ming Lin To clean up the code and reduce duplication, this entry is removed. Signed-off-by: Cheng Ming Lin Reviewed-by: Tudor Ambarus --- drivers/mtd/spi-nor/macronix.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c index 2acd8e28d1c4..07e0bd0b70a0 100644 --- a/drivers/mtd/spi-nor/macronix.c +++ b/drivers/mtd/spi-nor/macronix.c @@ -160,13 +160,6 @@ static const struct flash_info macronix_nor_parts[] = =3D { /* MX25U51245G */ .id =3D SNOR_ID(0xc2, 0x25, 0x3a), .fixups =3D ¯onix_qpp4b_fixups, - }, { - .id =3D SNOR_ID(0xc2, 0x25, 0x3a), - .name =3D "mx66u51235f", - .size =3D SZ_64M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, - .fixup_flags =3D SPI_NOR_4B_OPCODES, - .fixups =3D ¯onix_qpp4b_fixups, }, { /* MX66U1G45G */ .id =3D SNOR_ID(0xc2, 0x25, 0x3b), --=20 2.25.1 From nobody Sun Feb 8 12:31:34 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A91C82356BF for ; Wed, 2 Apr 2025 08:57:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743584229; cv=none; b=djySpvQ8wvjyP1/F+9wJrGTvM9ZWtwkmuaI6TmV2m6p7Ykv1ZnlhkbbCsGmJy4kstja7cbfPdl2cjQ1ZFV+Vxf25CnXgVWg+DEhhM+nqsz+BkO4nUvCHko+ud0A9WyDOavPu9pkcA6DgB6FSRiutGrY7qob6YPszQ+/1ZNoq4fY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743584229; c=relaxed/simple; bh=gJiKCmOVGHHXuA+rW+U1+1ikV/iMBetNjbldM/AKP2U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ECoeYS6xBprEWH1vrANLr6Fa9MoX1qQySrV7WAcRD+FZnEdT1iYE38ztseh8Z208OADgbx3BmlErXjp51vCu7jxBHQCU68plvAp+XXCGo1adwI6LHGUWHC1WIojUHaBznIoP1M1pXLFLieH7GrwK2C9m9/NzIBCZSSFYNBPdtHE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GTdK5wJo; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GTdK5wJo" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-227b828de00so112919885ad.1 for ; Wed, 02 Apr 2025 01:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743584227; x=1744189027; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2L6fD6nlIa393DR0GjOYRfyiTfAg8gVxKRvxkE78qM8=; b=GTdK5wJoilLJecuT7t9n5EoAG8ecvNkdFPLxqehYlSLPDLLcISHEYtlw48WsFVZYuS joy7AT6m1R43Cwekwwt0iIgBzzih+Q9Oj+BjW6nr79GpwjPWU+6UqtjnTgZ+omfyEpXo 71VsDxu3CjNcyDIabnBvOj+mT6YL8RVpWXa2nGwAhKg5iIC9cCAST+TJFwhhWL1zlz8F +UkA62Fjz0L3pWUOhEh8KmvAjzAwoEMVX3p5forK1vn1ClDiNYPycenUXTwtJQyZXVc/ GyBfnhfaPmVWXLCTmiP5XwfgO3mQ6N4VJf45fr6c8KwesfG4YdKeP82VydWKng9y35dB wntQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743584227; x=1744189027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2L6fD6nlIa393DR0GjOYRfyiTfAg8gVxKRvxkE78qM8=; b=pUZkGvh6GoyCTpgB87c+Vf1KeAgsmEMv7aoPOZ/MNloC4FUoYZoHp1HUvuM06ABLtQ GSDE5oHRURakbpCfvV0sIGxvKC4FsSx2+/gVVBTl8T5DZs7mE6XD7p0INT5EFrLd73Ch FLF2JkTejcnYkicRHK3FnV9/xiqLyZksdLTJ6d/cUdhzuapdBe4zX+CxYx9dBdVyZBjb YARhNELaUZ5P7CD4TMhRomxfnRsg9hTw5+c+12DpnOqAL0MiAaWWaPS2Ppcx2BfZkJwW 10FJ28UE19y8mJYVHT+n0m6ixrxl4TXbpzoT0clQEjcs5ZX1XZUK9ySttZ61eQBbjvDa RlUw== X-Forwarded-Encrypted: i=1; AJvYcCWhjTCJeWhuGz5OMvqJeFM0BpBDYOEd+9amLMd0+RofEYRaCERBrOfOvt59jSQqVBUY4Hfm6xVrZoX7eGs=@vger.kernel.org X-Gm-Message-State: AOJu0YwucEr2NHbQGzQFHbEP3hARkwaw4Zz2tomrj1xyuZ2vIY4uDyD8 vQVt1c5KjDEIvbOVZwHjRwj/vpGV2m0B17u5NcrjW4iN5n6n6q7L X-Gm-Gg: ASbGncuqv1nZh6pnGxJtBwBwmnQ9jdx0x/qEFtuH6R1QP/K2hLDprger5xrWrEvXB6y Dpert65OxI8KKkzWYqUTCGIX8DyGQ+GhiiBiilic7caYL87tlrZds8KK3dhFbRiZGpxG91McFX8 n7GDIf6g+BCT4RYMj188JCEB6MW9BjY+1Tre4DbgYCeXda6OBrxbQx28BpuqI8J4ndPfgPExBvB C/fjE5BAR+weAgaPMAemkYFYcMsE7gmHjbB6BeDt45ElKiYHziGaUtuMKvUHn5g7DxpRYrtT+v9 QLH1iJVqnBTub0Q+H/VkbrazcUIBV8Jz0HVMhlefLsobXy+gnqDyI97mnC15YIw4UufatA/XbJq xB1g= X-Google-Smtp-Source: AGHT+IGZgi69Abih38Lloz1v9kLCgGQu6o9alyyOKDi5TM595XFdyW5Z+Sc4LA3KYAlvCBtd3nkQfQ== X-Received: by 2002:a17:902:e549:b0:223:325c:89f6 with SMTP id d9443c01a7336-2296c605374mr25463065ad.10.1743584226867; Wed, 02 Apr 2025 01:57:06 -0700 (PDT) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291f1dedb5sm103221535ad.176.2025.04.02.01.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Apr 2025 01:57:05 -0700 (PDT) Received: from hqs-appsw-a2o.mp600.macronix.com (linux-patcher [172.17.236.67]) by twhmp6px (Postfix) with ESMTPS id 0368E80642; Wed, 2 Apr 2025 17:06:10 +0800 (CST) From: Cheng Ming Lin To: tudor.ambarus@linaro.org, pratyush@kernel.org, mwalle@kernel.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: alvinzhou@mxic.com.tw, leoyu@mxic.com.tw, Cheng Ming Lin Subject: [PATCH 3/3] mtd: spi-nor: macronix: Move macronix_nor_default_init logic to macronix_nor_late_init Date: Wed, 2 Apr 2025 16:51:29 +0800 Message-Id: <20250402085129.1027670-4-linchengming884@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250402085129.1027670-1-linchengming884@gmail.com> References: <20250402085129.1027670-1-linchengming884@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cheng Ming Lin Remove macronix_nor_default_init and move its functionality to macronix_nor_late_init to ensure proper quad_enable initialization. For MX25L3255E, SFDP follows JESD216, which does not include the Quad Enable bit Requirements field in its version. When the size field is removed, manufacturer->fixups->default_init hook is not executed, causing params->quad_enable not being overwritten with the intended function. Consequently, it remains as the default spi_nor_sr2_bit1_quad_enable. By moving quad_enable setup from default_init to late_init, quad_enable is correctly assigned after spi_nor_init_params, regardless of the size field removal. Additionally, according to spi-nor/core.h, quad_enable is more appropriately placed in late_init, as older SFDP versions did not define the Quad Enable bit Requirements. This change removes default_init and moves quad_enable handling to late_init accordingly. Signed-off-by: Cheng Ming Lin --- drivers/mtd/spi-nor/macronix.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c index 07e0bd0b70a0..216c02b92bfe 100644 --- a/drivers/mtd/spi-nor/macronix.c +++ b/drivers/mtd/spi-nor/macronix.c @@ -282,22 +282,17 @@ static int macronix_nor_set_octal_dtr(struct spi_nor = *nor, bool enable) return enable ? macronix_nor_octal_dtr_en(nor) : macronix_nor_octal_dtr_d= is(nor); } =20 -static void macronix_nor_default_init(struct spi_nor *nor) -{ - nor->params->quad_enable =3D spi_nor_sr1_bit6_quad_enable; -} - static int macronix_nor_late_init(struct spi_nor *nor) { if (!nor->params->set_4byte_addr_mode) nor->params->set_4byte_addr_mode =3D spi_nor_set_4byte_addr_mode_en4b_ex= 4b; + nor->params->quad_enable =3D spi_nor_sr1_bit6_quad_enable; nor->params->set_octal_dtr =3D macronix_nor_set_octal_dtr; =20 return 0; } =20 static const struct spi_nor_fixups macronix_nor_fixups =3D { - .default_init =3D macronix_nor_default_init, .late_init =3D macronix_nor_late_init, }; =20 --=20 2.25.1