Commit 7b0e4d5
committed
[ot] hw/riscv: ot_earlgrey: create flash & bus for spi passthrough mode
This commit creates a new internal SPI bus and CS GPIO for
`ot-spi_device` to communicate with a downstream flash device in
passthrough mode. This commits adds no passthrough functionality yet,
just command line functionality.
This is done by creating and adding a new flash device with an
associated drive to the board, similar to how the other flash devices
are added. The next available drive bus index was 3.
The downstream flash for passthrough mode can be created like this on
the command line:
- `-global ot-earlgrey-board.spiflash_passthrough=<type>`, where `type`
is a type of flash device from the M25P80 family, e.g `w25q256` (see
`hw/block/m25p80.c` for a list)
- `-drive if=mtd,file=<file>,format=raw,bus=3` to assign backing storage
to the flash. Bus 3 indicates the SPI flash for OT SPI Device
passthrough mode.
Signed-off-by: Alice Ziuziakowska <[email protected]>1 parent 1f3601f commit 7b0e4d5
3 files changed
+72
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
| |||
2176 | 2180 | | |
2177 | 2181 | | |
2178 | 2182 | | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
2179 | 2186 | | |
2180 | 2187 | | |
2181 | 2188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| |||
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
1481 | 1483 | | |
1482 | 1484 | | |
1483 | 1485 | | |
1484 | | - | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
1485 | 1493 | | |
1486 | 1494 | | |
1487 | 1495 | | |
| |||
1834 | 1842 | | |
1835 | 1843 | | |
1836 | 1844 | | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
1837 | 1855 | | |
1838 | 1856 | | |
1839 | 1857 | | |
| |||
1857 | 1875 | | |
1858 | 1876 | | |
1859 | 1877 | | |
1860 | | - | |
| 1878 | + | |
1861 | 1879 | | |
1862 | 1880 | | |
1863 | 1881 | | |
| |||
1914 | 1932 | | |
1915 | 1933 | | |
1916 | 1934 | | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
1917 | 1972 | | |
1918 | 1973 | | |
1919 | 1974 | | |
| |||
1924 | 1979 | | |
1925 | 1980 | | |
1926 | 1981 | | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
1927 | 1987 | | |
1928 | 1988 | | |
1929 | 1989 | | |
| |||
0 commit comments