Hello,
we have used intense the U-Boot SSPI command to check our hardware at production test with a T1042 board.
We want to enable SSPI for our new board, based on LS1046, as well.
unfortunately U-Boot moved from eSPI to DSPI driver model,
and we struggle to enable it.
we have enabled all related CONFIG_DM_SPI stuff,
our device tree looks like this:
in .dtsi
dspi0: dspi@2100000 {
compatible = "fsl,vf610-dspi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x0 0x2100000 0x0 0x10000>;
interrupts = <0 64 0x4>;
clock-names = "dspi";
clocks = <&clockgen 4 0>;
num-cs = <4>;
big-endian;
status = "disabled";
};
in .dts:
model = "LS1046A RDB Board";
aliases {
spi0 = &dspi0;
};
};
&dspi0 {
bus-num = <0>;
status = "okay";
spidev@0x00 {
compatible = "spidev";
spi-max-frequency = <20000000>;
reg = <0>;
};
};
but we always get an error:
=> sspi 0:0 8 0
Invalid bus 0 (err=-19)
we assume, because we don't see an entry in DM tree:
=> dm uclass
uclass 0: root
- * root_driver @ fbc42050, seq 0, (req -1)
uclass 10: simple_bus
- * soc @ fbc42160, seq 0, (req -1)
- ifc@1530000 @ fbc42230
uclass 19: efi
uclass 33: usb_mass_storage
uclass 43: pci
- * pcie@3400000 @ fbc42610, seq 0, (req -1)
- * pcie@3500000 @ fbc426c0, seq 2, (req -1)
- * pcie@3600000 @ fbc42770, seq 4, (req -1)
- * pci_0:0.0 @ fbc6d4c0, seq 1, (req -1)
- * pci_2:0.0 @ fbc6d930, seq 3, (req -1)
- * pci_4:0.0 @ fbc6dde0, seq 5, (req -1)
uclass 44: pci_generic
uclass 59: spi
uclass 61: spi_flash
uclass 62: spi_generic
uclass 68: usb
- usb@2f00000 @ fbc42360
- usb@3000000 @ fbc42430
- usb@3100000 @ fbc42500
uclass 69: usb_dev_generic
uclass 70: usb_hub
How we can make it to work ?
Thanks,
Mike
You could refer to LS1046AQDS source code as an example.
RCW: please configure RCW[SPI_EXT]=0
u-boot source code:
Please prefer to the following in configs/ls1046aqds_tfa_defconfig
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_FSL_DSPI=y
Please refer to the following in include/configs/ls1046aqds.h
#ifdef CONFIG_FSL_DSPI
#define CONFIG_SPI_FLASH_STMICRO /* cs0 */
#define CONFIG_SPI_FLASH_SST /* cs1 */
#define CONFIG_SPI_FLASH_EON /* cs2 */
#endif
In dts, please refer to arch/arm/dts/fsl-ls1046a-qds.dtsi
/include/ "fsl-ls1046a.dtsi"
&dspi0 {
bus-num = <0>;
status = "okay";
dflash0: n25q128a {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
spi-max-frequency = <1000000>; /* input clock */
spi-cpol;
spi-cpha;
reg = <0>;
};
...
}
thanks you for the helpful answer,
we did all changes according to your recommendations,
and now we have a dm tree entry and can observe signal activity on SPI pins
=> dm tree
Class Probed Driver Name
----------------------------------------
root [ + ] root_drive root_driver
simple_bus [ + ] generic_si `-- soc
spi [ + ] fsl_dspi |-- dspi@2100000
spi_generi [ + ] spi_generi | `-- generic_0:0
simple_bus [ ] generic_si |-- ifc@1530000
usb [ ] xhci_fsl |-- usb@2f00000
usb [ ] xhci_fsl |-- usb@3000000
usb [ ] xhci_fsl |-- usb@3100000
pci [ + ] pci_layers |-- pcie@3400000
pci [ + ] pci_bridge | `-- pci_0:0.0
pci [ + ] pci_layers |-- pcie@3500000
pci [ + ] pci_bridge | `-- pci_2:0.0
pci [ + ] pci_layers `-- pcie@3600000
pci [ + ] pci_bridge `-- pci_4:0.0
thanks again,
Mike