From 1814c4cf0cbe57d561f71ffca04759b4169da402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 23 May 2026 17:18:09 +0200 Subject: [PATCH] doc: explain what a JEDEC ID is The bscan_jedec command and tutorial referenced the JEDEC ID without defining it. Describe the 0x9F RDID command and the manufacturer + device byte layout, in the tutorial and the command help. --- doc/tutorial.md | 22 ++++++++++++++++++---- modules/script/script.c | 2 ++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 22bee78..57e25f0 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -233,10 +233,24 @@ part is wiped and replaced by the proxy. This is undone by a power-cycle (the configuration flash reloads the original design at the next boot), but be aware the board stops doing whatever it was doing. -`bscan_jedec` issues `0x9F` + 3 read bytes through the proxy. A sane -answer (here `0x20` = Micron, the KCU105's config flash) confirms the -whole proxy path end to end: the `bscan_spi_xfer()` framing, the -MSB-first bit order, and the TDO read-latency skew. +`bscan_jedec` issues the SPI **Read Identification** command (`0x9F`, +also called RDID) and reads back 3 bytes — the chip's *JEDEC ID*. JEDEC +is the standards body (JESD216 / JEP106) that defines this identifier; +every serial flash answers `0x9F` the same way: + +- **byte 0** — manufacturer, a code assigned by JEDEC (`0x20` Micron, + `0xEF` Winbond, `0xC2` Macronix, `0x01` Cypress/Infineon, `0x9D` + ISSI, …); +- **bytes 1–2** — device ID (memory type + capacity), vendor-specific. + +So the JEDEC ID is how you discover *which* flash is wired up without +prior knowledge — Phase 3 will use it to look the part up in a chip +database and pull its page/sector sizes and command set. + +A sane answer here (manufacturer `0x20` = Micron, the KCU105's config +flash) also confirms the whole proxy path end to end: the +`bscan_spi_xfer()` framing, the MSB-first bit order, and the TDO +read-latency skew. ### The transfer primitive diff --git a/modules/script/script.c b/modules/script/script.c index b47a1c8..882e87e 100644 --- a/modules/script/script.c +++ b/modules/script/script.c @@ -2954,6 +2954,8 @@ static int cmd_bscan_load_bitstream(script_ctx *ctx, char *line) const char *cmd_bscan_jedec_help[] = { "", "Read the SPI flash JEDEC ID (0x9F) through the loaded BSCAN proxy.", + "JEDEC ID = 1 manufacturer byte (e.g. 0x20 Micron) + 2 device bytes;", + "identifies which flash chip is wired to the FPGA.", "Requires a proxy bitstream already loaded (bscan_load_bitstream).", ""}; static int cmd_bscan_jedec(script_ctx *ctx, char *line)