Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spi: qspi: Add Phytium spi/qspi controller support #136

Merged
merged 9 commits into from
May 24, 2024
Merged

spi: qspi: Add Phytium spi/qspi controller support #136

merged 9 commits into from
May 24, 2024

Conversation

yuanxia0927
Copy link
Contributor

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

Add binding documentation for Phytium SPI controller.

Signed-off-by: yuanxia <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
Add support for the Phytium SPI controller driver.

Signed-off-by: yuanxia <[email protected]>
Signed-off-by: Zhang Yiqun <[email protected]>
Signed-off-by: Peng Min <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
Add the device tree binding documentation for Phytium QuadSPI controller.

Signed-off-by: yuanxia <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
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 <[email protected]>
Signed-off-by: Zhou Yulin <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
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 <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
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 <[email protected]>
Reported-by: Zhou Yulin <[email protected]>
Signed-off-by: Chen Baozi <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
The mask of sck_sel should be 0x7 instead of 0x3, otherwise the split
is set differently than expected.

Signed-off-by: yuanxia <[email protected]>
Signed-off-by: Liu Tianyu <[email protected]>
Signed-off-by: Li Mingzhe <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
Code has been modified and added in the SPI driver section
to adapt to the DDMA controller.

Signed-off-by: yuanxia <[email protected]>
Signed-off-by: Liu Tianyu <[email protected]>
Signed-off-by: Wang Hanmo <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
@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.

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.

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

drivers/mtd/mtdcore.c Outdated Show resolved Hide resolved
drivers/mtd/mtdcore.c Outdated Show resolved Hide resolved
drivers/mtd/mtdcore.c Outdated Show resolved Hide resolved
drivers/mtd/mtdpart.c Outdated Show resolved Hide resolved
drivers/mtd/mtdpart.c Outdated Show resolved Hide resolved
drivers/mtd/mtdpart.c Outdated Show resolved Hide resolved
drivers/mtd/mtdpart.c Outdated Show resolved Hide resolved
drivers/spi/Makefile Show resolved Hide resolved
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.

好的,这个我会更改一下

@@ -3636,6 +3639,10 @@ static int spi_nor_probe(struct spi_mem *spimem)
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
Contributor 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

drivers/spi/Kconfig Outdated Show resolved Hide resolved
Add acpi table support for qspi/spi driver, supporting
parsing of ACPI tables.

Signed-off-by: yuanxia <[email protected]>
Signed-off-by: Wang Hanmo <[email protected]>
Signed-off-by: Wang Yinfeng <[email protected]>
@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
2 checks passed
@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 中展示。

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