DESK-RZ-L/Peripherals/xSPI

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2025/12/16 DESK-RZ-L-1.x.x release


Peripheral xSPI[edit | edit source]

There is one Expanded Serial Peripheral Interface (xSPI).

The xSPI protocol defines the interface for memory devices, offering high data throughput, a low signal count, and a limited backward compatibility with legacy SPI devices.

This bus is a boot bus: an SPI NOR flash is connected to it on the carrier board.

This bus can also be used via the bare-metal tool Flash Programmer to program the NOR memory, enabling boot from SCI.

By storing the correct binaries in the proper layout/position in the NOR, it is possible to boot through the xSPI bus.

Configuration[edit | edit source]

These peripheral(s) can only be used with the following ConfigID(s) (see the associated BOM):

ConfigID Note
2002 -
2003 -

Device tree configuration[edit | edit source]

Below is an example of a device tree configuration used on ZERO Evaluation Kit.

From rzt2h-eb23-cb2002.dts:

...

&xspi0 {
	pinctrl-0 = <&xspi0_pins>;
	pinctrl-names = "default";
	status = "okay";

	flash@0 {
		compatible = "sst,w25q256jwm", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <30000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "atf";
				reg = <0x0 0x60000>;
			};

			partition@60000 {
				label = "fip";
				reg = <0x60000 0xC0000>;
			};

			partition@120000 {
				label = "env";
				reg = <0x120000 0x20000>;
			};

			partition@140000 {
				label = "data";
				reg = <0x140000 0x280000>;
			};
		};
	};
};
...
&pinctrl {
...

	xspi0_pins: xspi0 {
		xspi0_clk {
			pinmux =    <RZT2H_PORT_PINMUX(5, 1, 0x1C)>; /* P05_1 XSPI1_CKP */
		};

		xspi0_data {
			pinmux =    <RZT2H_PORT_PINMUX(5, 6, 0x1C)>, /* P05_6 XSPI0_IO0 */
				        <RZT2H_PORT_PINMUX(5, 7, 0x1C)>, /* P05_7 XSPI0_IO1 */
				        <RZT2H_PORT_PINMUX(6, 0, 0x1C)>, /* P06_0 XSPI0_IO2 */
				        <RZT2H_PORT_PINMUX(6, 1, 0x1C)>; /* P06_1 XSPI0_IO3 */
		};

		xspi0_cs {
			pinmux =    <RZT2H_PORT_PINMUX(5, 3, 0x1C)>; /* P05_3 XSPI0_CS0 */
		};
	};
...
};

Accessing the peripheral[edit | edit source]

Linux[edit | edit source]

...
[   62.577410] spi-nor spi1.0: w25q256jwm (32768 Kbytes)
[   62.582516] 4 fixed-partitions partitions found on MTD device spi1.0
[   62.588899] Creating 4 MTD partitions on "spi1.0":
[   62.593720] 0x000000000000-0x000000060000 : "atf"
[   62.603538] 0x000000060000-0x000000120000 : "fip"
[   62.624430] 0x000000120000-0x000000140000 : "env"
[   62.631481] 0x000000140000-0x0000003c0000 : "data"
...
root@desk-t2h-usd-devel:~# mtdinfo -a
Count of MTD devices:           4
Present MTD devices:            mtd0, mtd1, mtd2, mtd3
Sysfs interface supported:      yes

mtd0
Name:                           atf
Type:                           nor
Eraseblock size:                4096 bytes, 4.0 KiB
Amount of eraseblocks:          96 (393216 bytes, 384.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:0
Bad blocks are allowed:         false
Device is writable:             true

mtd1
Name:                           fip
Type:                           nor
Eraseblock size:                4096 bytes, 4.0 KiB
Amount of eraseblocks:          192 (786432 bytes, 768.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:2
Bad blocks are allowed:         false
Device is writable:             true

mtd2
Name:                           env
Type:                           nor
Eraseblock size:                4096 bytes, 4.0 KiB
Amount of eraseblocks:          32 (131072 bytes, 128.0 KiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:4
Bad blocks are allowed:         false
Device is writable:             true

mtd3
Name:                           data
Type:                           nor
Eraseblock size:                4096 bytes, 4.0 KiB
Amount of eraseblocks:          640 (2621440 bytes, 2.5 MiB)
Minimum input/output unit size: 1 byte
Sub-page size:                  1 byte
Character device major/minor:   90:6
Bad blocks are allowed:         false
Device is writable:             true