Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4768a7c
[ot] build: bazel: add BUILD.bazel and REPO.bazel for @qemu_opentitan
sasdf Sep 22, 2026
606c2ea
[ot] target/riscv: rvb: add Xdraft093b bitmanip instructions
sasdf Sep 22, 2026
47c4f9d
[ot] target/riscv: pmu: align Ibex mcycle and mhpmcounter3..31 CSRs
sasdf Sep 22, 2026
de67113
[ot] target/riscv: debug: align triggers, scontext, and debug reset
sasdf Sep 22, 2026
0dbfd16
[ot] target/riscv: ibex: support FENCE.I icache key inval in CPUCTRLST
sasdf Sep 22, 2026
09ecc89
[ot] hw/opentitan: otp_if: add late_debug_mb8 and set_lc_dft_en
sasdf Sep 22, 2026
73fe007
[ot] hw/opentitan: ibex_wrapper: implement NMI, RND, alerts, and errs
sasdf Sep 22, 2026
c162a59
[ot] hw/opentitan: common: fix shadow reg phase reset and add mubi32
sasdf Sep 22, 2026
9ea0391
[ot] hw/opentitan: common: add unclocked MMIO and load fault APIs
sasdf Sep 22, 2026
cd96d77
[ot] hw/opentitan: vmapper: align virtual mapper translation rules
sasdf Sep 22, 2026
a3f7148
[ot] hw/jtag: tap_ctrl_rbb: add TAP enable GPIO and property gating
sasdf Sep 22, 2026
afb67cf
[ot] hw/riscv: dm: align Debug Module and DTM with Earlgrey RTL
sasdf Sep 22, 2026
6e23711
[ot] hw/misc: pulp_rv_dm: align debug_rom, late debug, and TL-UL fault
sasdf Sep 22, 2026
7ce8f6b
[ot] hw/opentitan: plic_ext: fix alert pulse, MSIP reset, and permit
sasdf Sep 22, 2026
5a12325
[ot] hw/block: m25p80: add SFDP table and quad/4-byte SPI flash ops
sasdf Sep 22, 2026
1eaa801
[ot] hw/opentitan: otp_eg: align DAI/SW_CFG locks, prim_tl, and PERMIT
sasdf Sep 22, 2026
edd0b90
[ot] hw/opentitan: flash: align MP/INFO perms, RMA wipe, and PERMIT
sasdf Sep 22, 2026
f975084
[ot] hw/opentitan: rom_ctrl: align digest window ECC, alerts, permit
sasdf Sep 22, 2026
7a8b000
[ot] hw/opentitan: aes: align ctrl, status, PRNG reseed, and lc_esc
sasdf Sep 22, 2026
d482e63
[ot] hw/opentitan: hmac: implement SHA-2 256/384/512 and FIFO drain
sasdf Sep 22, 2026
5145f92
[ot] hw/opentitan: kmac: align entropy FSM, errchk, and escalation
sasdf Sep 22, 2026
f9db128
[ot] hw/opentitan: otbn: align ALU, call stack, loop & lock with RTL
sasdf Sep 22, 2026
5709900
[ot] hw/opentitan: entropy_src: implement health test and FW bypass
sasdf Sep 22, 2026
d2c9257
[ot] hw/opentitan: csrng: align alerts, state dump, and ERR_CODE_TEST
sasdf Sep 22, 2026
d97d615
[ot] hw/opentitan: edn: implement boot request mode and auto FSM
sasdf Sep 22, 2026
57f4740
[ot] hw/opentitan: alert: implement escalation FSM, dump, and ping
sasdf Sep 22, 2026
7098ce8
[ot] hw/opentitan: timer: align active CFG0/mtime writes and permits
sasdf Sep 22, 2026
2a58d96
[ot] hw/opentitan: aon_timer: implement bark/bite wakeup and pause
sasdf Sep 22, 2026
f9e334f
[ot] hw/opentitan: ast_eg: align RNG noise rate and CSR access rules
sasdf Sep 22, 2026
c7e0428
[ot] hw/opentitan: sensor_eg: implement alert and wake events
sasdf Sep 22, 2026
a07d5f6
[ot] hw/opentitan: rstmgr: align crash info, sw_reset, and PERMIT
sasdf Sep 22, 2026
6ca61f6
[ot] hw/opentitan: ot_pwrmgr: align FSM, wake_info, and NDM reset
sasdf Sep 22, 2026
6f2ff12
[ot] hw/opentitan: keymgr: align seed checks, sideload, and regwen
sasdf Sep 22, 2026
41f9ea8
[ot] hw/opentitan: lc_ctrl: align mubi8 mutex, RMA/SCRAP, and alerts
sasdf Sep 22, 2026
9d8fb9b
[ot] hw/opentitan: sram_ctrl: align key rotation, mubi4 W1C, and AON
sasdf Sep 22, 2026
9356f6c
[ot] hw/opentitan: clkmgr: implement clk hints, measure, and jitter
sasdf Sep 22, 2026
3e95763
[ot] hw/opentitan: adc_ctrl: implement low-power filter and wakeup
sasdf Sep 22, 2026
2be2088
[ot] hw/opentitan: uart: fix baudrate timing, RX break, and irq
sasdf Sep 22, 2026
ec63e0d
[ot] hw/opentitan: spi_host: implement dummy cycles, CSB, and stall
sasdf Sep 22, 2026
0b1c91b
[ot] hw/opentitan: pad_ring: support runtime qom-set & POR_N deassert
sasdf Sep 22, 2026
ae67538
[ot] hw/opentitan: i2c: implement target mode, 64B FIFOs, and stretch
sasdf Sep 22, 2026
6c01d05
[ot] hw/opentitan: i2c: add pmod-i2c-sensor QOM device and wiring
sasdf Sep 22, 2026
9164895
[ot] hw/opentitan: pwm: implement Earlgrey PWM controller model
sasdf Sep 22, 2026
ef19cb4
[ot] hw/opentitan: pattgen: implement 2-channel pattern generator IP
sasdf Sep 22, 2026
2102db9
[ot] hw/opentitan: sysrst_ctrl: implement combo and pin control
sasdf Sep 22, 2026
2226689
[ot] hw/opentitan: pinmux_eg: implement pad attr and sleep mux
sasdf Sep 22, 2026
86f50c6
[ot] hw/opentitan: gpio_eg: implement 63-pad muxing and pad monitor
sasdf Sep 22, 2026
9ac400b
[ot] hw/opentitan: usbdev: implement setup, bulk/iso, and framing
sasdf Sep 22, 2026
3644a93
[ot] hw/opentitan: i2c_host_proxy: support target stretch and wakeup
sasdf Sep 22, 2026
936353f
[ot] hw/opentitan: spi_device: implement passthru, TPM, and upload
sasdf Sep 22, 2026
9e5b5c0
[ot] hw/riscv: ot_earlgrey: wire PMOD I2C sensors and AT24C on board
sasdf Sep 22, 2026
d4aa9dd
[ot] tests/opentitan: earlgrey-tests: update renamed mldsa test targets
siemen11 Oct 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright lowRISC contributors.
#
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

package(default_visibility = ["//visibility:public"])

exports_files(glob(["**"]))

filegroup(
name = "qemu_src",
srcs = glob(["**"]),
)

filegroup(
name = "ot",
srcs = glob([
"python/qemu/ot/**",
]),
)
4 changes: 4 additions & 0 deletions REPO.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright lowRISC contributors.
#
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
30 changes: 24 additions & 6 deletions hw/block/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ static const FlashPartInfo known_devices[] = {
/* GigaDevice */
{ INFO("gd25q32", 0xc84016, 0, 64 << 10, 64, ER_4K) },
{ INFO("gd25q64", 0xc84017, 0, 64 << 10, 128, ER_4K) },
{ INFO("gd25q256", 0xc84019, 0, 64 << 10, 512, ER_4K | ER_32K),
.sfdp_read = m25p80_sfdp_gd25q256 },
{ INFO("gd25b01g", 0xc8401b, 0, 64 << 10, 2048, ER_4K | ER_32K),
.sfdp_read = m25p80_sfdp_gd25b01g },

/* Intel/Numonyx -- xxxs33b */
{ INFO("160s33b", 0x898911, 0, 64 << 10, 32, 0) },
Expand All @@ -226,7 +230,7 @@ static const FlashPartInfo known_devices[] = {
{ INFO("is25wp064", 0x9d7017, 0, 64 << 10, 128, ER_4K) },
{ INFO("is25wp128", 0x9d7018, 0, 64 << 10, 256, ER_4K),
.sfdp_read = m25p80_sfdp_is25wp128 },
{ INFO("is25wp256", 0x9d7019, 0, 64 << 10, 512, ER_4K),
{ INFO("is25wp256", 0x9d7019, 0, 64 << 10, 512, ER_4K | ER_32K),
.sfdp_read = m25p80_sfdp_is25wp256 },

/* Macronix */
Expand All @@ -237,6 +241,8 @@ static const FlashPartInfo known_devices[] = {
{ INFO("mx25l3205d", 0xc22016, 0, 64 << 10, 64, 0) },
{ INFO("mx25l6405d", 0xc22017, 0, 64 << 10, 128, 0) },
{ INFO("mx25l12805d", 0xc22018, 0, 64 << 10, 256, 0) },
{ INFO("mx25l12835f", 0xc22018, 0, 64 << 10, 256, ER_4K | ER_32K),
.sfdp_read = m25p80_sfdp_mx25l12835f },
{ INFO("mx25l12855e", 0xc22618, 0, 64 << 10, 256, 0) },
{ INFO6("mx25l25635e", 0xc22019, 0xc22019, 64 << 10, 512,
ER_4K | ER_32K), .sfdp_read = m25p80_sfdp_mx25l25635e },
Expand Down Expand Up @@ -267,7 +273,8 @@ static const FlashPartInfo known_devices[] = {
.sfdp_read = m25p80_sfdp_n25q256a },
{ INFO("n25q512a", 0x20ba20, 0, 64 << 10, 1024, ER_4K) },
{ INFO("n25q512ax3", 0x20ba20, 0x1000, 64 << 10, 1024, ER_4K) },
{ INFO("mt25ql512ab", 0x20ba20, 0x1044, 64 << 10, 1024, ER_4K | ER_32K) },
{ INFO("mt25ql512ab", 0x20ba20, 0x1044, 64 << 10, 1024, ER_4K | ER_32K),
.sfdp_read = m25p80_sfdp_mt25ql512ab },
{ INFO_STACKED("mt35xu01g", 0x2c5b1b, 0x104100, 128 << 10, 1024,
ER_4K | ER_32K, 2),
.sfdp_read = m25p80_sfdp_mt35xu01g },
Expand Down Expand Up @@ -363,7 +370,7 @@ static const FlashPartInfo known_devices[] = {
.sfdp_read = m25p80_sfdp_w25q256 },
{ INFO("w25q512jv", 0xef4020, 0, 64 << 10, 1024, ER_4K),
.sfdp_read = m25p80_sfdp_w25q512jv },
{ INFO("w25q01jvq", 0xef4021, 0, 64 << 10, 2048, ER_4K),
{ INFO("w25q01jvq", 0xef4021, 0, 64 << 10, 2048, ER_4K | ER_32K),
.sfdp_read = m25p80_sfdp_w25q01jvq },
{ INFO("w25q512nw", 0xef6020, 0, 64 << 10, 1024, ER_4K | ER_32K),
.sfdp_read = m25p80_sfdp_w25q512nw },
Expand Down Expand Up @@ -407,6 +414,7 @@ typedef enum {
QPP = 0x32,
QPP_4 = 0x34,
PP_4 = 0x38,
QPP_GD = 0xc2,
RDID_90 = 0x90,
RDID_AB = 0xab,
AAI_WP = 0xad,
Expand Down Expand Up @@ -546,6 +554,7 @@ static inline Manufacturer get_man(Flash *s)
case 0x20:
return MAN_NUMONYX;
case 0xEF:
case 0xC8:
return MAN_WINBOND;
case 0x01:
return MAN_SPANSION;
Expand Down Expand Up @@ -768,6 +777,7 @@ static void complete_collecting_data(Flash *s)
case PP4:
case PP4_4:
case PP_4:
case QPP_GD:
s->state = STATE_PAGE_PROGRAM;
break;
case AAI_WP:
Expand Down Expand Up @@ -815,6 +825,7 @@ static void complete_collecting_data(Flash *s)
s->quad_enable = !!(s->data[1] & 0x02);
break;
case MAN_ISSI:
case MAN_NUMONYX:
s->quad_enable = extract32(s->data[0], 6, 1);
break;
case MAN_MACRONIX:
Expand Down Expand Up @@ -1011,7 +1022,7 @@ static void decode_fast_read_cmd(Flash *s)
s->needed_bytes += 1;
break;
case MAN_NUMONYX:
s->needed_bytes += numonyx_extract_cfg_num_dummies(s);
s->needed_bytes += numonyx_extract_cfg_num_dummies(s) / 8;
break;
case MAN_MACRONIX:
s->needed_bytes += 1;
Expand Down Expand Up @@ -1211,6 +1222,7 @@ static void decode_new_cmd(Flash *s, uint32_t value)
case QPP:
case QPP_4:
case PP4_4:
case QPP_GD:
if (get_man(s) != MAN_NUMONYX || numonyx_mode(s) != MODE_DIO) {
s->needed_bytes = get_addr_length(s);
s->pos = 0;
Expand Down Expand Up @@ -1347,15 +1359,21 @@ static void decode_new_cmd(Flash *s, uint32_t value)
s->data[0] |= (!!s->block_protect3) << 6;
}

if (get_man(s) == MAN_MACRONIX || get_man(s) == MAN_ISSI) {
if (get_man(s) == MAN_MACRONIX || get_man(s) == MAN_ISSI ||
get_man(s) == MAN_NUMONYX) {
s->data[0] |= (!!s->quad_enable) << 6;
}
if (get_man(s) == MAN_SST) {
s->data[0] |= (!!s->aai_enable) << 6;
}

s->pos = 0;
s->len = 1;
if (get_man(s) == MAN_WINBOND || get_man(s) == MAN_SPANSION) {
s->data[1] = (!!s->quad_enable) << 1;
s->len = 2;
} else {
s->len = 1;
}
s->data_read_loop = true;
s->state = STATE_READING_DATA;
break;
Expand Down
146 changes: 145 additions & 1 deletion hw/block/m25p80_sfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static const uint8_t sfdp_is25wp256[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xe5, 0x20, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x0f,
0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x80, 0xbb,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
0xff, 0xff, 0x44, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
Expand Down Expand Up @@ -551,3 +551,147 @@ static const uint8_t sfdp_is25wp256[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(is25wp256);

static const uint8_t sfdp_mx25l12835f[256] = {
0x53, 0x46, 0x44, 0x50, 0x06, 0x01, 0x01, 0xff,
0x00, 0x06, 0x01, 0x10, 0x30, 0x00, 0x00, 0xff,
0xc2, 0x00, 0x01, 0x04, 0xb0, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xe5, 0x20, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x07,
0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x04, 0xbb,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
0xff, 0xff, 0x44, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
0x10, 0xd8, 0x00, 0xff, 0xd6, 0x49, 0xc5, 0x00,
0x85, 0xdf, 0x04, 0xe3, 0x44, 0x03, 0x67, 0x38,
0x30, 0xb0, 0x30, 0xb0, 0xf7, 0xbd, 0xd5, 0x5c,
0x4a, 0x9e, 0x29, 0xff, 0xf0, 0x50, 0xf9, 0x85,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xc2, 0xf5, 0x08, 0x0a, 0x08, 0x04, 0x03, 0x06,
0x00, 0x00, 0x07, 0x29, 0x17, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(mx25l12835f);

static const uint8_t sfdp_mt25ql512ab[256] = {
0x53, 0x46, 0x44, 0x50, 0x06, 0x01, 0x00, 0xff,
0x00, 0x06, 0x01, 0x10, 0x30, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x1f,
0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x27, 0xbb,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x27, 0xbb,
0xff, 0xff, 0x44, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
0x10, 0xd8, 0x00, 0x00, 0x24, 0x5a, 0x99, 0x00,
0x8b, 0x8e, 0x03, 0xe1, 0xac, 0x01, 0x27, 0x38,
0x7a, 0x75, 0x7a, 0x75, 0xfb, 0xbd, 0xd5, 0x5c,
0x4a, 0x9e, 0x29, 0xff, 0x81, 0xb0, 0x38, 0x36,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(mt25ql512ab);

static const uint8_t sfdp_gd25q256[256] = {
0x53, 0x46, 0x44, 0x50, 0x06, 0x01, 0x00, 0xff,
0x00, 0x06, 0x01, 0x10, 0x30, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x42, 0xbb,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0xff, 0xff, 0x40, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
0x10, 0xd8, 0x00, 0x00, 0x36, 0x02, 0xa6, 0x00,
0x82, 0xea, 0x14, 0xe2, 0xe9, 0x63, 0x76, 0x33,
0x7a, 0x75, 0x7a, 0x75, 0xf7, 0xa2, 0xd5, 0x5c,
0x19, 0xf7, 0x4d, 0xff, 0xe9, 0x70, 0xf9, 0xa5,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(gd25q256);

static const uint8_t sfdp_gd25b01g[256] = {
0x53, 0x46, 0x44, 0x50, 0x06, 0x01, 0x00, 0xff,
0x00, 0x06, 0x01, 0x10, 0x30, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x44, 0xeb, 0x08, 0x6b, 0x08, 0x3b, 0x42, 0xbb,
0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0xff, 0xff, 0x40, 0xeb, 0x0c, 0x20, 0x0f, 0x52,
0x10, 0xd8, 0x00, 0x00, 0x36, 0x02, 0xa6, 0x00,
0x82, 0xea, 0x14, 0xe2, 0xe9, 0x63, 0x76, 0x33,
0x7a, 0x75, 0x7a, 0x75, 0xf7, 0xa2, 0xd5, 0x5c,
0x19, 0xf7, 0x4d, 0xff, 0xe9, 0x70, 0xf9, 0xa5,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
define_sfdp_read(gd25b01g);
5 changes: 5 additions & 0 deletions hw/block/m25p80_sfdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@
#define M25P80_SFDP_MAX_SIZE (1 << 24)

uint8_t m25p80_sfdp_n25q256a(uint32_t addr);
uint8_t m25p80_sfdp_mt25ql512ab(uint32_t addr);
uint8_t m25p80_sfdp_mt35xu01g(uint32_t addr);
uint8_t m25p80_sfdp_mt35xu02g(uint32_t addr);

uint8_t m25p80_sfdp_mx25l12835f(uint32_t addr);
uint8_t m25p80_sfdp_mx25l25635e(uint32_t addr);
uint8_t m25p80_sfdp_mx25l25635f(uint32_t addr);
uint8_t m25p80_sfdp_mx66l1g45g(uint32_t addr);

uint8_t m25p80_sfdp_gd25q256(uint32_t addr);
uint8_t m25p80_sfdp_gd25b01g(uint32_t addr);

uint8_t m25p80_sfdp_w25q256(uint32_t addr);
uint8_t m25p80_sfdp_w25q512jv(uint32_t addr);
uint8_t m25p80_sfdp_w25q80bl(uint32_t addr);
Expand Down
23 changes: 21 additions & 2 deletions hw/jtag/tap_ctrl_rbb.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ typedef struct TapCtrlRbbState {
TAPState state; /* Current state */

/* signals */
bool enabled; /* TAP enabled */
bool trst; /* TAP controller reset */
bool srst; /* System reset */
bool tck; /* JTAG clock */
Expand Down Expand Up @@ -327,7 +328,7 @@ static void tap_ctrl_rbb_step(TapCtrlRbbState *tap, bool tck, bool tms,
{
trace_tap_ctrl_rbb_step(tck, tms, tdi);

if (tap->trst) {
if (tap->trst || !tap->enabled) {
return;
}

Expand Down Expand Up @@ -497,7 +498,8 @@ static void tap_ctrl_rbb_chr_receive(void *opaque, const uint8_t *buf, int size)

for (unsigned ix = 0; ix < size; ix++) {
if (tap_ctrl_rbb_read_byte(tap, buf[ix])) {
uint8_t outbuf[1] = { '0' + (unsigned)tap->tdo };
uint8_t outbuf[1] = { '0' +
(unsigned)(tap->enabled ? tap->tdo : true) };
qemu_chr_fe_write_all(&tap->chr, outbuf, (int)sizeof(outbuf));
}
}
Expand Down Expand Up @@ -627,6 +629,7 @@ static const Property tap_ctrl_rbb_properties[] = {
DEFINE_PROP_UINT8("ir_length", TapCtrlRbbState, ir_length, 0),
DEFINE_PROP_UINT8("idcode_inst", TapCtrlRbbState, idcode_inst, 1u),
DEFINE_PROP_BOOL("quit", TapCtrlRbbState, enable_quit, true),
DEFINE_PROP_BOOL("enabled", TapCtrlRbbState, enabled, true),
DEFINE_PROP_CHR("chardev", TapCtrlRbbState, chr),
};

Expand Down Expand Up @@ -680,12 +683,28 @@ static void tap_ctrl_rbb_realize(DeviceState *dev, Error **errp)
qemu_chr_fe_accept_input(&tap->chr);
}

static void tap_ctrl_rbb_enable_in(void *opaque, int n, int level)
{
TapCtrlRbbState *tap = opaque;
(void)n;
bool enabled = (bool)level;
if (tap->enabled != enabled) {
tap->enabled = enabled;
if (!enabled) {
tap_ctrl_rbb_tap_reset(tap);
tap->tdo = true;
}
}
}

static void tap_ctrl_rbb_init(Object *obj)
{
TapCtrlRbbState *tap = TAP_CTRL_RBB(obj);

tap->tdhtable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL,
tap_ctrl_rbb_free_data_handler);
qdev_init_gpio_in_named(DEVICE(obj), &tap_ctrl_rbb_enable_in,
TAP_CTRL_RBB_ENABLE, 1);
}

static void tap_ctrl_rbb_class_init(ObjectClass *klass, const void *data)
Expand Down
Loading
Loading