-
-
- Posts: 2
- Joined: 2024-05-27 0:26
如题,目前测试只有sfc速度高一点,能达到71MHz,但是只用于nand。
Code: Select all
spi0: spi@ff500000 {
compatible = "rockchip,rv1106-spi", "rockchip,rk3066-spi";
reg = <0xff500000 0x1000>;
interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&cru CLK_SPI0>, <&cru PCLK_SPI0>, <&cru SCLK_IN_SPI0>;
clock-names = "spiclk", "apb_pclk", "sclk_in";
dmas = <&dmac 1>, <&dmac 0>;
dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&spi0m0_cs0 &spi0m0_cs1 &spi0m0_pins>;
status = "disabled";
};
Code: Select all
sfc: spi@ffac0000 {
compatible = "rockchip,sfc";
reg = <0xffac0000 0x4000>;
interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
clock-names = "clk_sfc", "hclk_sfc";
assigned-clocks = <&cru SCLK_SFC>;
assigned-clock-rates = <75000000>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
-
- Posts: 1492
- Joined: 2024-01-23 7:21
iotahydrae wrote: ↑2024-05-27 1:03
如题,目前测试只有sfc速度高一点,能达到71MHz,但是只用于nand。
Code: Select all
spi0: spi@ff500000 {
compatible = "rockchip,rv1106-spi", "rockchip,rk3066-spi";
reg = <0xff500000 0x1000>;
interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&cru CLK_SPI0>, <&cru PCLK_SPI0>, <&cru SCLK_IN_SPI0>;
clock-names = "spiclk", "apb_pclk", "sclk_in";
dmas = <&dmac 1>, <&dmac 0>;
dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&spi0m0_cs0 &spi0m0_cs1 &spi0m0_pins>;
status = "disabled";
};
Code: Select all
sfc: spi@ffac0000 {
compatible = "rockchip,sfc";
reg = <0xffac0000 0x4000>;
interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>;
clock-names = "clk_sfc", "hclk_sfc";
assigned-clocks = <&cru SCLK_SFC>;
assigned-clock-rates = <75000000>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};
DS1Z_QuickPrint7.png
DS1Z_QuickPrint5.png
您好,目前Rockchip并没有提供内核版本5.10的SDK关于spi的配置方法,您可以参考Rockchip公开文档Rockchip_Developer_Guide_Linux_SPI_CN.md 进行配置。
-
- Posts: 2
- Joined: 2024-05-27 0:26
查阅spi驱动源码得知,rk3x的SPI最大速率为50MHz,这可能是由于pclk被限制在100MHz导致的。
drivers/spi/spi-rockchip.c
Code: Select all
/* sclk_out: spi master internal logic in rk3x can support 50Mhz */
#define MAX_SCLK_OUT 50000000U