All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
To: Michael Walle <michael@walle.cc>
Cc: linux-mtd@lists.infradead.org,
	Tudor Ambarus <tudor.ambarus@microchip.com>,
	Pratyush Yadav <p.yadav@ti.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mtd: spi-nor: macronix: Add support for mx66l2g45g
Date: Mon, 23 May 2022 20:18:32 +0800	[thread overview]
Message-ID: <2b859cff-2403-0526-f3ae-749920b3fd8b@linux.intel.com> (raw)
In-Reply-To: <24cf182693a522ed1f7afd61c7c37029@walle.cc>

Okay I've found this was a driver issue. After switching to the new aspeed
spi-mem driver[1], the sysfs interface works.

# xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
53464450060102ff00060110300000ffc2000104100100ff84000102c000
00ffffffffffffffffffffffffffffffffffe520fbffffffff7f44eb086b
083b04bbfeffffffffff00ffffff44eb0c200f5210d800ff8749bd0084d2
04e24403673830b030b0f7bdff5c4a9e29fff050f985ffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffff7f8fffff215cdcffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffff003600279df9c06485cbffffffffffff
# md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
bc3c1443db0c6359432c3cccb6f97943  /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
# cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
c2201c
# cat /sys/bus/spi/devices/spi0.0/spi-nor/partname
mx66l2g45g
# cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer
macronix

Since I'm using kernel 5.15, I copied the /drivers/mtd/spi-nor from 5.18-rc7
(I know this it not a clean way, but it works), and applied the SNOR_ID3()
patch. Verified using SNOR_ID3() macro works with this mx66l2g45g and the
values dumped from sysfs are the same.

[    1.696350] spi spi0.0: setup: ignoring unsupported mode bits 200
[    1.703786] spi-nor spi0.0: mx66l2g45g (262144 Kbytes)
[    1.764440] spi-aspeed-smc 1e620000.spi: CE0 read buswidth:2 [0x203c0641]

Due to the lockdown in Shanghai, I am unable to test my 2nd patch at this
time, please temporarily ignore it.

I will perform more tests and update the patch later.

[1] https://lore.kernel.org/linux-mtd/a17b2446-f5a6-d606-8ef4-3931b8bc94da@kaod.org/

Thanks,
Jiaqing

On 2022-05-23 19:59, Michael Walle wrote:
> Hi,
> 
> Am 2022-05-23 12:12, schrieb Jiaqing Zhao:
>>> Am 2022-05-23 10:50, schrieb Jiaqing Zhao:
>>>> Yes this one supports SFDP according to its spec.
>>>>
>>>> On my setup, I cannot see the sysfs object. Do I need to enable some specific
>>>> kernel config or it's SPI controller related? My setup is running kernel 5.15.
>>>
>>> No, it should be there since v5.14. See commit 36ac02286265. And you shouldn't
>>> need to enable any special configuration option.
>>>
>>> Did you do a "find /sys -name sfdp"?
>>>
>>> -michael
>>
>> I tried, it give empty result. The system I'm working on disables kernel module,
>> and the SPI controller driver calls spi_nor_probe() directly, will this be the
>> issue?
>>
>> And is it possible to manually load the spi-nor driver via the bind interface?
>> If it is possible, what should the parameters be?
> 
> Is your spi flash probed at all?
> 
> -michael

WARNING: multiple messages have this Message-ID (diff)
From: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
To: Michael Walle <michael@walle.cc>
Cc: linux-mtd@lists.infradead.org,
	Tudor Ambarus <tudor.ambarus@microchip.com>,
	Pratyush Yadav <p.yadav@ti.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mtd: spi-nor: macronix: Add support for mx66l2g45g
Date: Mon, 23 May 2022 20:18:32 +0800	[thread overview]
Message-ID: <2b859cff-2403-0526-f3ae-749920b3fd8b@linux.intel.com> (raw)
In-Reply-To: <24cf182693a522ed1f7afd61c7c37029@walle.cc>

Okay I've found this was a driver issue. After switching to the new aspeed
spi-mem driver[1], the sysfs interface works.

# xxd -p /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
53464450060102ff00060110300000ffc2000104100100ff84000102c000
00ffffffffffffffffffffffffffffffffffe520fbffffffff7f44eb086b
083b04bbfeffffffffff00ffffff44eb0c200f5210d800ff8749bd0084d2
04e24403673830b030b0f7bdff5c4a9e29fff050f985ffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffff7f8fffff215cdcffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffff003600279df9c06485cbffffffffffff
# md5sum /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
bc3c1443db0c6359432c3cccb6f97943  /sys/bus/spi/devices/spi0.0/spi-nor/sfdp
# cat /sys/bus/spi/devices/spi0.0/spi-nor/jedec_id
c2201c
# cat /sys/bus/spi/devices/spi0.0/spi-nor/partname
mx66l2g45g
# cat /sys/bus/spi/devices/spi0.0/spi-nor/manufacturer
macronix

Since I'm using kernel 5.15, I copied the /drivers/mtd/spi-nor from 5.18-rc7
(I know this it not a clean way, but it works), and applied the SNOR_ID3()
patch. Verified using SNOR_ID3() macro works with this mx66l2g45g and the
values dumped from sysfs are the same.

[    1.696350] spi spi0.0: setup: ignoring unsupported mode bits 200
[    1.703786] spi-nor spi0.0: mx66l2g45g (262144 Kbytes)
[    1.764440] spi-aspeed-smc 1e620000.spi: CE0 read buswidth:2 [0x203c0641]

Due to the lockdown in Shanghai, I am unable to test my 2nd patch at this
time, please temporarily ignore it.

I will perform more tests and update the patch later.

[1] https://lore.kernel.org/linux-mtd/a17b2446-f5a6-d606-8ef4-3931b8bc94da@kaod.org/

Thanks,
Jiaqing

On 2022-05-23 19:59, Michael Walle wrote:
> Hi,
> 
> Am 2022-05-23 12:12, schrieb Jiaqing Zhao:
>>> Am 2022-05-23 10:50, schrieb Jiaqing Zhao:
>>>> Yes this one supports SFDP according to its spec.
>>>>
>>>> On my setup, I cannot see the sysfs object. Do I need to enable some specific
>>>> kernel config or it's SPI controller related? My setup is running kernel 5.15.
>>>
>>> No, it should be there since v5.14. See commit 36ac02286265. And you shouldn't
>>> need to enable any special configuration option.
>>>
>>> Did you do a "find /sys -name sfdp"?
>>>
>>> -michael
>>
>> I tried, it give empty result. The system I'm working on disables kernel module,
>> and the SPI controller driver calls spi_nor_probe() directly, will this be the
>> issue?
>>
>> And is it possible to manually load the spi-nor driver via the bind interface?
>> If it is possible, what should the parameters be?
> 
> Is your spi flash probed at all?
> 
> -michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-05-23 12:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22  5:48 [PATCH 1/2] mtd: spi-nor: macronix: Add support for mx66l2g45g Jiaqing Zhao
2022-05-22  5:48 ` Jiaqing Zhao
2022-05-22  5:48 ` [PATCH 2/2] mtd: spi-nor: micron: Add SPI_NOR_DUAL_READ flag on mt25ql02g Jiaqing Zhao
2022-05-22  5:48   ` Jiaqing Zhao
2022-07-21  7:59   ` Tudor.Ambarus
2022-07-21  7:59     ` Tudor.Ambarus
2022-05-23  7:54 ` [PATCH 1/2] mtd: spi-nor: macronix: Add support for mx66l2g45g Michael Walle
2022-05-23  7:54   ` Michael Walle
2022-05-23  8:50   ` Jiaqing Zhao
2022-05-23  8:56     ` Michael Walle
2022-05-23 10:12       ` Jiaqing Zhao
2022-05-23 11:59         ` Michael Walle
2022-05-23 12:18           ` Jiaqing Zhao [this message]
2022-05-23 12:18             ` Jiaqing Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b859cff-2403-0526-f3ae-749920b3fd8b@linux.intel.com \
    --to=jiaqing.zhao@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=p.yadav@ti.com \
    --cc=tudor.ambarus@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.