-
Notifications
You must be signed in to change notification settings - Fork 105
spi: qspi: Add Phytium spi/qspi controller support #136
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
Conversation
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>
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
drivers/mtd/parsers/Kconfig
Outdated
| config MTD_ACPI_PARTS | ||
| tristate "ACPI partitioning parser" | ||
| default y | ||
| depends on ACPI |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个adev有什么用? 其后也未使用adev。
There was a problem hiding this comment.
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的函数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个为了后续开发方便,还是进行保留
drivers/mtd/mtdpart.c
Outdated
| struct device *dev = &master->dev; | ||
|
|
||
| if (has_acpi_companion(dev)) | ||
| adev = ACPI_COMPANION(dev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个adev也没用吧?
|
/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 pr auto reviewMake the patch apply cleanly. |
|
@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 中展示。 |
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>
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>
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>
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>
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
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
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>
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>
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
These patches have added support for Phytium spi/qspi controllers and their related functions.