| commit | 787367be6448566c4948424c5d23a8ad2d0c9eae | [log] [tgz] |
|---|---|---|
| author | Eunchan Kim <eunchan@opentitan.org> | Tue May 17 10:07:21 2022 -0700 |
| committer | Eli Kim <github@elikim.dev> | Tue May 17 17:50:21 2022 -0700 |
| tree | 722a3cb3b2d9ac9c21216a5654651b797ce29aa7 | |
| parent | ac635cc09becb1d184b34541d712f3e38de129f8 [diff] |
fix(spi_device): Missed Command Upload
This commit fixes one of the issue #11871
Problem:
SW read incorrect opcode for Page Program.
Analysis
--------
The Page Program (0x02) opcode is adjacent to other commands that
SPI_DEVICE processes. So, the Datapath is fixed when the exact last beat
of the command opcode arrives. It is the second half of the 7th SCK.
The command parser activates Upload module at that time. However, the
top module switches the SRAM mux to the Upload module when the datapath
is latched by inverted SCK, which is right after the 8th posedge of SCK.
The Upload module, however, pushes the CMDFIFO entry (0x02 Page Program)
prior to 8th posedge of SCK to safely update the FIFO content as SCK
may not have 9th posedge if the SPI command is opcode only commands.
Examples are CHIP ERASE (0xC7), SECTOR ERASE, etc.
Resolution
----------
This commit revises the Mux design. Rather than using
`cmd_dp_sel_outclk`, it uses `cmd_dp_sel` (SCK clock) directly for the
SRAM mux. Other signals must be in inverted SCK clock domain to match
the output data phase.
Signed-off-by: Eunchan Kim <eunchan@opentitan.org>

OpenTitan is an open source silicon Root of Trust (RoT) project. OpenTitan will make the silicon RoT design and implementation more transparent, trustworthy, and secure for enterprises, platform providers, and chip manufacturers. OpenTitan is administered by lowRISC CIC as a collaborative project to produce high quality, open IP for instantiation as a full-featured product. See the OpenTitan site and OpenTitan docs for more information about the project.
This repository contains hardware, software and utilities written as part of the OpenTitan project. It is structured as monolithic repository, or “monorepo”, where all components live in one repository. It exists to enable collaboration across partners participating in the OpenTitan project.
The project contains comprehensive documentation of all IPs and tools. You can access it online at docs.opentitan.org.
Have a look at [CONTRIBUTING]({{< relref “CONTRIBUTING.md” >}}) and our documentation on project organization and processes for guidelines on how to contribute code to this repository.
Unless otherwise noted, everything in this repository is covered by the Apache License, Version 2.0 (see LICENSE for full text).