Skip to content

Conversation

@yuanxia0927
Copy link

These patches have added support for Phytium spi/qspi controllers and their related functions.

yuanxia added 8 commits May 13, 2024 18:01
Add binding documentation for Phytium SPI controller.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Add support for the Phytium SPI controller driver.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Zhang Yiqun <zhangyiqun@phytium.com.cn>
Signed-off-by: Peng Min <pengmin1540@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Add the device tree binding documentation for Phytium QuadSPI controller.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
This patch adds a new driver for Phytium QuadSPI (QSPI) controller,
which is used to access NOR Flash memory slaves. The driver implements
spi-mem framework and does not support generic SPI operations.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Zhou Yulin <zhouyulin1283@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
The driver used devm_spi_register_controller() on bind. Therefore,
__device_release_driver() first invokes phytium_spi_remove_host()
before unregistering the SPI controller via devres_release_all() when
unbinding.

Since phytium_spi_remove_host() shuts down the chip, rendering the SPI
bus inaccessible even through the SPI controller is still registered.
When the SPI controller is subsequently unregistered, it unbinds all
its slave devices. Because their drivers cannot access the SPI bus,
the slave devices may be left in an improper state.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Since the platform driver wraps the core phytium_spi into
phytium_spi_clk struct to include a platform clock, the pointer
extract from driver_data should also be 'struct phytium_spi_clk *'.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Reported-by: Zhou Yulin <zhouyulin1283@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
The mask of sck_sel should be 0x7 instead of 0x3, otherwise the split
is set differently than expected.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Liu Tianyu <liutianyu1250@phytium.com.cn>
Signed-off-by: Li Mingzhe <limingzhe1839@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Code has been modified and added in the SPI driver section
to adapt to the DDMA controller.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Liu Tianyu <liutianyu1250@phytium.com.cn>
Signed-off-by: Wang Hanmo <wanghanmo2242@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
@deepin-ci-robot
Copy link

Hi @yuanxia0927. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tsic404 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

config MTD_ACPI_PARTS
tristate "ACPI partitioning parser"
default y
depends on ACPI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default y?
这个在非飞腾架构上有用么? 建议添加上depends on ARCH_PHYTIUM || COMPILE_TEST

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,这个我会更改一下

nor->spimem = spimem;
nor->dev = &spi->dev;
spi_nor_set_flash_node(nor, spi->dev.of_node);
adev = ACPI_COMPANION(nor->dev);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个adev有什么用? 其后也未使用adev。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里加入adev是为了方便后续在acpi模式进行开发,能方便使用acpi函数操作adev结构体。但是该补丁里面没使用acpi的函数

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个为了后续开发方便,还是进行保留

struct device *dev = &master->dev;

if (has_acpi_companion(dev))
adev = ACPI_COMPANION(dev);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个adev也没用吧?

@opsiff
Copy link
Member

opsiff commented May 14, 2024

/ok-to-test

Add acpi table support for qspi/spi driver, supporting
parsing of ACPI tables.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Wang Hanmo <wanghanmo2242@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
@deepin-ci-robot
Copy link

deepin pr auto review

Make the patch apply cleanly.

@opsiff opsiff merged commit 1b5f3e9 into deepin-community:linux-6.6.y May 24, 2024
@zccrs
Copy link

zccrs commented Jun 4, 2024

@yuanxia0927 请问您是 Phytium 的员工吗?我看您没有在 https://github.com/deepin-community/SIG/blob/master/corporation/Phytium/metadata.yml 人员列表里,麻烦联系 chenbaozi-ft 提交一个 PR,把您加到 https://github.com/deepin-community/SIG/blob/master/corporation/Phytium/metadata.yml 中,这样您的贡献才能在 https://www.deepin.org/index/datastat/t/Phytium?id=corporate-contributor-phytium 中展示。

lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
Add binding documentation for Phytium SPI controller.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
(cherry picked from commit 23b8ee8)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
Add support for the Phytium SPI controller driver.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Zhang Yiqun <zhangyiqun@phytium.com.cn>
Signed-off-by: Peng Min <pengmin1540@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
[ Wentao Guan: rename spi_controller_get_devdata from spi_master_get_devdata,struct spi_controller from struct spi_master ]
[ Wentao Guan: XXXX ]
(cherry picked from commit 27b76db)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
Add the device tree binding documentation for Phytium QuadSPI controller.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
(cherry picked from commit 9d11018)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
This patch adds a new driver for Phytium QuadSPI (QSPI) controller,
which is used to access NOR Flash memory slaves. The driver implements
spi-mem framework and does not support generic SPI operations.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Zhou Yulin <zhouyulin1283@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
[ Wentao Guan: for v6.18 ]
[ Wentao Guan: XXXX ]
(cherry picked from commit 68716d1)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
The driver used devm_spi_register_controller() on bind. Therefore,
__device_release_driver() first invokes phytium_spi_remove_host()
before unregistering the SPI controller via devres_release_all() when
unbinding.

Since phytium_spi_remove_host() shuts down the chip, rendering the SPI
bus inaccessible even through the SPI controller is still registered.
When the SPI controller is subsequently unregistered, it unbinds all
its slave devices. Because their drivers cannot access the SPI bus,
the slave devices may be left in an improper state.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
(cherry picked from commit d4126ea)
Link: #136
[ Wentao Guan: XXXX ]
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

Conflicts:
	drivers/spi/spi-phytium.c
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
Since the platform driver wraps the core phytium_spi into
phytium_spi_clk struct to include a platform clock, the pointer
extract from driver_data should also be 'struct phytium_spi_clk *'.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Reported-by: Zhou Yulin <zhouyulin1283@phytium.com.cn>
Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
[ Wentao Guan: XXXX ]
(cherry picked from commit 7587a36)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

Conflicts:
	drivers/spi/spi-phytium-plat.c
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
The mask of sck_sel should be 0x7 instead of 0x3, otherwise the split
is set differently than expected.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Liu Tianyu <liutianyu1250@phytium.com.cn>
Signed-off-by: Li Mingzhe <limingzhe1839@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
(cherry picked from commit a5a55d4)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
Code has been modified and added in the SPI driver section
to adapt to the DDMA controller.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Liu Tianyu <liutianyu1250@phytium.com.cn>
Signed-off-by: Wang Hanmo <wanghanmo2242@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
[ Wentao Guan: by e289df8 ("spi: Rework per message DMA mapped flag to be per transfer") ]
(cherry picked from commit de1e289)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lanlanxiyiji pushed a commit that referenced this pull request Dec 22, 2025
Add acpi table support for qspi/spi driver, supporting
parsing of ACPI tables.

Signed-off-by: yuanxia <yuanxia2073@phytium.com.cn>
Signed-off-by: Wang Hanmo <wanghanmo2242@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
Link: #136
(cherry picked from commit 8b02928)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

Conflicts:
	drivers/mtd/spi-nor/core.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants