Skip to content
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

SPI device bootstrap support #20669

Open
wants to merge 11 commits into
base: integrated_dev
Choose a base branch
from

Conversation

dbeitel-opentitan
Copy link
Contributor

@dbeitel-opentitan dbeitel-opentitan commented Dec 15, 2023

Bootstrap support downloading images into CTN SRAM has been added back into test rom in this PR. Waiting on merge of base/second rom implementation to add bootstrap support into production rom. Also added bootstrap protocol support back into verilator model. List of changes below:

[opentitantool/console] Fix transition from log to console data.
Add carriage return to transitions from log info to console data from uart.
[dv/dpi] Support DPI over TCP sockets
Add TCP socket server to UART, GPIO, and SPI device interfaces.
Add reset support in GPIO DPI.
Support Socket Proxy protocol over SPI device DPI.
Add mutex to manage data transfer in tcp server.
[rom/bootstrap] Add bootstrap support to OT integrated.
Support split ingress/egress buffers in SPI device driver.
Reenable bootstrap in rom and test rom (WIP).
Enable verilator in openocd_test.
[opentitantool/verilator] Support TCP socket connectivity.
Add support for second rom in opentitanlib.
Add TCP socket support to Verilator DPI interfaces.
Support SPI device interface. Use Proxy Socket protocol.
[dv/dpi] Fix SPI device transactions
Write/Read transactions should not deassert CSB in between.
Change protocol generation to unsigned values.
Add delay between transactions.
[rom/spi_device] Bootstrap to Shared SRAM
Fix SPI device driver to initialize writable egress buffer.
Change Bootstrap interface to write to Shared SRAM instead of Flash.
Add verilator support to some bootstrap tests.
On verilator build, ensure the async resets trigger at time 0.
[dv/dpi] Fix CI issues
Format and trailing whitespace.
Fix offsets for Shared SRAM.
Optimize verify to compare 4k blocks.
Fix SPI device unittest.
[rom/bootstrap] CTN SRAM driver
Implemented CTN SRAM driver that mimics Flash functionality for bootstrap.
[verilator/jtag] Update jtag support for verilator
Update dmi dpi for configurable id.
Add jtag interface into opentitanlib verilator transport.
Update verilator jtag configuration files.

@@ -30,12 +33,13 @@ module gpiodpi
int gpiodpi_host_to_device_tick(input chandle ctx,
input [N_GPIO-1:0] gpio_en_d2p,
input [N_GPIO-1:0] gpio_pull_en,
input [N_GPIO-1:0] gpio_pull_sel);
input [N_GPIO-1:0] gpio_pull_sel,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [verible-verilog-lint] reported by reviewdog 🐶
Explicitly define a storage type for every function parameter. [Style: function-task-argument-types] [explicit-function-task-parameter-type]

@@ -30,12 +33,13 @@ module gpiodpi
int gpiodpi_host_to_device_tick(input chandle ctx,
input [N_GPIO-1:0] gpio_en_d2p,
input [N_GPIO-1:0] gpio_pull_en,
input [N_GPIO-1:0] gpio_pull_sel);
input [N_GPIO-1:0] gpio_pull_sel,
output gpio_rst_n);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [verible-verilog-lint] reported by reviewdog 🐶
Explicitly define a storage type for every function parameter. [Style: function-task-argument-types] [explicit-function-task-parameter-type]

@@ -55,8 +59,9 @@ module gpiodpi
always_ff @(posedge clk_i or negedge rst_ni) begin
if (!rst_ni) begin
gpio_p2d <= '0; // default value
gpio_rst_n = rst_ni;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [verible-verilog-lint] reported by reviewdog 🐶
Use blocking assignments, at most, for locals inside 'always_ff' sequential blocks. [Style: sequential-logic] [always-ff-non-blocking]

end else begin
gpio_p2d <= gpiodpi_host_to_device_tick(ctx, gpio_en_d2p, gpio_pull_en, gpio_pull_sel);
gpio_p2d <= gpiodpi_host_to_device_tick(ctx, gpio_en_d2p, gpio_pull_en, gpio_pull_sel, gpio_rst_n);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [verible-verilog-lint] reported by reviewdog 🐶
Line length exceeds max: 100; is: 106 [Style: line-length] [line-length]

@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch 10 times, most recently from 17a3a4a to c9e336f Compare January 11, 2024 22:05
@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch 3 times, most recently from 81f7b9d to f10f666 Compare January 25, 2024 00:14
@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch 5 times, most recently from 05a83eb to 636cde4 Compare February 3, 2024 02:59
@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch from 249fc14 to a269a55 Compare February 6, 2024 01:54
@dbeitel-opentitan dbeitel-opentitan self-assigned this Feb 8, 2024
@dbeitel-opentitan dbeitel-opentitan marked this pull request as ready for review February 8, 2024 08:46
@dbeitel-opentitan dbeitel-opentitan requested review from a team and cfrantz as code owners February 8, 2024 08:46
@dbeitel-opentitan dbeitel-opentitan requested review from jdonjdon and removed request for a team February 8, 2024 08:46
@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch 4 times, most recently from 916c9a5 to 31274bb Compare February 9, 2024 07:00
@rsahita rsahita self-requested a review February 26, 2024 00:52
@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch 2 times, most recently from 4914852 to 418583c Compare March 1, 2024 04:35
@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch from 418583c to 044e31e Compare March 11, 2024 03:12
Add carriage return to transitions from log info to console data from
uart.

Signed-off-by: Daniel Beitel <[email protected]>
Add TCP socket server to UART, GPIO, and SPI device interfaces.
Add reset support in GPIO DPI.
Support Socket Proxy protocol over SPI device DPI.
Add mutex to manage data transfer in tcp server.

Signed-off-by: Daniel Beitel <[email protected]>
Support split ingress/egress buffers in SPI device driver.
Reenable bootstrap in rom and test rom (WIP).
Enable verilator in openocd_test.

Signed-off-by: Daniel Beitel <[email protected]>
Add support for second rom in opentitanlib
Add TCP socket support to Verilator DPI interfaces.
Support SPI device interface.  Use Proxy Socket protocol

Signed-off-by: Daniel Beitel <[email protected]>
Write/Read transactions should not deassert CSB in between.
Change protocol generation to unsigned values
Add delay between transactions

Signed-off-by: Daniel Beitel <[email protected]>
Fix SPI device driver to initialize writable egress buffer.
Change Bootstrap interface to write to Shared SRAM instead of Flash.
Add verilator support to some bootstrap tests.
On verilator build, ensure the async resets trigger at time 0.

Signed-off-by: Daniel Beitel <[email protected]>
Format and trailing whitespace.
Fix offsets for Shared SRAM.
Optimize verify to compare 4k blocks.
Fix SPI device unittest

Signed-off-by: Daniel Beitel <[email protected]>
Implemented CTN SRAM driver that mimics Flash functionality for
bootstrap.

Signed-off-by: Daniel Beitel <[email protected]>
Update dmi dpi for configurable id.
Add jtag interface into opentitanlib verilator transport.
Update verilator jtag configuration files.

Signed-off-by: Daniel Beitel <[email protected]>
Fix some SPI dpi corner cases.
Fix Uart drain error.

Signed-off-by: Daniel Beitel <[email protected]>
Fix some SPI dpi corner cases.
Fix Uart drain error.

Signed-off-by: Daniel Beitel <[email protected]>
@dbeitel-opentitan dbeitel-opentitan force-pushed the dev/dbeitel/upstream/spi_device_bootstrap_support branch from 044e31e to f97efeb Compare March 13, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants