From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 385654A2E13 for ; Fri, 5 Jun 2026 08:50:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780649455; cv=none; b=BE2LTk+HjtKlm3g4bU2OMlYiirQbappS7euCbSVT4URnwPDUoSGLx/vNryq7o0o42d6IxyrLLwuM/AW8P6C3PVx6gXcZkrTd6snq2zKlmTa8D0/Iz768WAoDan9db0xNg18a7dZH1WSqlz88xuwu2PV/T6yp8UoRlNDJdN0Q9iM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780649455; c=relaxed/simple; bh=hP/9BvpvTmBwrUOSm9nEWmYuQz+/MFXoCW4A5bzFkrw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=AeKrL9PLMBU3hOW0N6qPAT/EOR8CufsfCoLNr79alsPAyJegwCTgHPiHz0EtPIRcNXZc6jzKycw20O0FfAzCXIjzlWrZ+d4nbJGXSw7hkfJEcSdn76sGDzBlJ0fmX7nRPYq5IXVeVZYajHJVyKB0nSM22SwU9+fNydr2DELOBY4= 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=R1238L9W; arc=none smtp.client-ip=209.85.214.180 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="R1238L9W" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2c0a5354da1so13602455ad.0 for ; Fri, 05 Jun 2026 01:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780649452; x=1781254252; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Hwnf/A0XxdhpusoY3ScWn8gJQmptVFR3j+BHQ5Mrdb0=; b=R1238L9WpbRZTplME5KCQnDFf+4/PcSUeCUwhIAADtBZrkA9r34HwlvPKbukZIAq/X +YeVccSVBtxmllMzyqfoXUJJp5bWalakn6KmL1H+CgsvpAm/CIJGVn/j2BvZhhXlOzTu zRqlyK/v8RJJKjEkjAqkhjgbbyYOwdQbF5Q7Oo9psKvVl2Feu8JoepERRveWkBTfPezd hhlGmiU6ZPFsSx9V8060Fuu5ZASOohJBxjlseo/3P1FM+tTn61klB9hqWXNOQT+Y3378 tMhv/ylByQdE4ocGNxLue7N+WeXxoFFIctVl6s0aI4SHlR5udtwLY6gQYapnl97DV3Os JqRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780649452; x=1781254252; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Hwnf/A0XxdhpusoY3ScWn8gJQmptVFR3j+BHQ5Mrdb0=; b=OuZdbXsdSzR+EcX+u9WuU2+2c5rofOowxSF3arR7YRaOdX1NjIHvrQrr9gIvLeuzDQ F6UVALWQAC4hL6lDxFm38i9p5PqXX225+HKUYlpOsguSQe/qq+3QO03jKaOOE4x9T10e JZ5V85OCiT71QqAizfVdpDn9kn+8851dk6I7wHothtwhRNvaO4gWs5AUiuJyS4q68X9m 2ppvG9qeVOSdhGNKbe28raRFz7MAU0VdpS/+FP/oGHs4HlQ/tkIGcTP1HhCF+ZpTVnMX FHu8IAyn92caxI1ZXTt3g9nltBGfGyKU4oKojqkz+Hdsy8croLZvG24Q07jWDhWBGT+h 0JLQ== X-Forwarded-Encrypted: i=1; AFNElJ+qRuZgB1L/65Gc6lZcO7l9A8FxGVqnPS1UWZdvN2c8g3dAn4b6KnLOtwxUv0GiqTn4qgMi+ho7G6fqrJ8=@vger.kernel.org X-Gm-Message-State: AOJu0Yze460lLwuRCckjXfIFvEsIDPZbi5I5sILa06zPkzlJshEiwjBG Dq1MOLxdsT/6jc2ZYA27jQHpv8FQpsmTFIMDPuujz06XK1XZhv1eVmWP X-Gm-Gg: Acq92OG1i+Q2G1CBPYpMQxMDcgpyGJvPMS4dkK3pUbGWAJpl9GoAgj/ZfItdOE8JSMA 711iH5DG7aV1i6c6M2CwIT8PYhAcTZA3XYNL5Jp4NKV9gv3G47Wds89SQtM1ijU4GV3IHlpToII 9gdNEfwthnU1FMs9+COzD1PB65YFC2gO10SG5/9tZjhoXR1RODkeNn48W02d6EPasehUBb8RbkZ KZm9IR9BQTp0781vT2OYY2fogHqoX7stld9iLVOoi8svWfB7h/gSY0LWORsXZsVwlehbOI+FYii m+s+JJCxOa6JBoj1Af50zRpSLasNIRe7+Fjnnf9NQMK+173PdEFV+4lMpmcZMtVp+j9ZPeAFBGy sz+dIjrPcficUCpYu20NqOiamAltKtEDS1/RipOEKLqZzxD4TTzvtVVnT+ZgmLwz2wjVyx1ClMO GyVSmTlnJYcKbkUDkt7+3jtSOz0R6qMjYFMoV2U6XCg0lcYsRyhoQzWIuz X-Received: by 2002:a17:903:2985:b0:2bf:22ac:a7d8 with SMTP id d9443c01a7336-2c1ec3f40d3mr17323985ad.5.1780649452362; Fri, 05 Jun 2026 01:50:52 -0700 (PDT) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c16649c01asm86760605ad.74.2026.06.05.01.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2026 01:50:51 -0700 (PDT) Received: from hqs-appsw-a2o.mp600.macronix.com (unknown [172.17.236.67]) by twhmp6px (Postfix) with ESMTPS id AA35F4163B71; Fri, 5 Jun 2026 16:50:49 +0800 (CST) From: Cheng Ming Lin To: Pratyush Yadav , Michael Walle , Takahiro Kuwano , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, alvinzhou@mxic.com.tw, Cheng Ming Lin Subject: [PATCH v3 0/2] mtd: spi-nor: macronix: Add support for MX25L12833F and MX25L12845G Date: Fri, 5 Jun 2026 16:48:35 +0800 Message-Id: <20260605084837.1875896-1-linchengming884@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Cheng Ming Lin This is v3 of the patch series adding support for Macronix MX25L12833F and MX25L12845G, and restoring fallback parameters for MX25L12805D. I would like to sincerely apologize for the build errors in v2 reported by the kernel test robot. I had made further modifications and fixed the issues during my local testing, but I accidentally submitted an older, incorrect version of the patches. In this v3, I have corrected the mistake and changed the fixup hook to use `post_sfdp` instead of `post_bfpt`. Changes in v3: - Changed the fixup hook from `post_bfpt` to `post_sfdp` for MX25L12805D. - Fixed the build error caused by the incompatible pointer type in v2. Changes in v2: - Patch 1: Changed the fixup hook from late_init to post_bfpt. Since the legacy MX25L12805D lacks SFDP, it will not execute post_bfpt. This safely isolates the newer MX25L12833F/45G (which support SFDP) and enables 4PP for them without breaking the legacy part. - Patch 1: Added detailed comments inside the fixup function explaining the ID collision and the rationale behind the hook choice, as suggested by reviewers. - Patch 2 (New): Added a separate patch to restore the missing .size and .no_sfdp_flags fallback parameters for the legacy MX25L12805D. This fixes a probe failure caused by a previous commit and includes the appropriate Fixes and Cc: stable tags. Below are the test results after applying the patch provided by Michael: - mx25l12833f 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-4S-4S opcode 0x38 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 0x38 8D extension none protocols read 1S-4S-4S write 1S-4S-4S 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=/dev/urandom of=/tmp/spi_test bs=1M count=2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.083756 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* 07bc3ccaac03ebf2b46c78f0be620bb22ce431ed39044d89af9e57481dcdea82 /tmp/spi_read 07bc3ccaac03ebf2b46c78f0be620bb22ce431ed39044d89af9e57481dcdea82 /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 07bc3ccaac03ebf2b46c78f0be620bb22ce431ed39044d89af9e57481dcdea82 /tmp/spi_test zynq> mtd_debug info /dev/mtd0 mtd.type = MTD_NORFLASH mtd.flags = MTD_CAP_NORFLASH mtd.size = 16777216 (16M) mtd.erasesize = 65536 (64K) mtd.writesize = 1 mtd.oobsize = 0 regions = 0 -mx25l12845g 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-4S-4S opcode 0x38 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 0x38 8D extension none protocols read 1S-4S-4S write 1S-4S-4S 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=/dev/urandom of=/tmp/spi_test bs=1M count=2 2+0 records in 2+0 records out 2097152 bytes (2.0MB) copied, 0.084527 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* 926c0e33670888d2c0d9d602a502ccc0aacb52afe58b9d430ebcb88137a8e3bf /tmp/spi_read 926c0e33670888d2c0d9d602a502ccc0aacb52afe58b9d430ebcb88137a8e3bf /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 926c0e33670888d2c0d9d602a502ccc0aacb52afe58b9d430ebcb88137a8e3bf /tmp/spi_test zynq> mtd_debug info /dev/mtd0 mtd.type = MTD_NORFLASH mtd.flags = MTD_CAP_NORFLASH mtd.size = 16777216 (16M) mtd.erasesize = 65536 (64K) mtd.writesize = 1 mtd.oobsize = 0 regions = 0 Cheng Ming Lin (2): mtd: spi-nor: Add support for MX25L12833F and MX25L12845G mtd: spi-nor: macronix: Restore fallback parameters for MX25L12805D drivers/mtd/spi-nor/macronix.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) -- 2.25.1