[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH v3 0/2] Proposing custom CSR handling logic

From: Ruinland Chuan-Tzu Tsai
Subject: [RFC PATCH v3 0/2] Proposing custom CSR handling logic
Date: Thu, 10 Jun 2021 22:44:22 +0800

From: Ruinaldn ChuanTzu Tsai <ruinland@andestech.com>

The changes from V2 :
* Making custom CSR operation table become registerable.
* Re-use the riscv_csrrw() code instead of ducplication.
* Splitting custom CPU bits into seperated files.
* Splitting the AX25 CPU from the feature patch
* Adding custom/vendor value "holder."
    In previous patche

- - - -

Sorry for the late update. COVID really hit us hard lately.

I really appreciate the comments and suggestions from Bin and Alistair, and I
am very willing to answer the doubts.

For the questions regarding the hash table for CSR operations, that is because
we might have heterogeneous architecture with harts having diffrent CSR
For instance, there are FLUSH32 and FLUSH64 CSR on the application cores
on the U54-MC and U74-MC series from SiFive, yet for the monitor cores (S51 and
S7), there are no such custom/vendor CSRs. Though I cannot disclose too much
for the time being, we Andes Technology have similar design choice on our
platforms; and thus, a mechanism for dynamically registering CSR operation
functions will become a substrate for further extension.

And one day if those CSRs become standardized, ones can easily pull-and-plug
the structures into `csr_ops` table.

The write_stub() is useful and necessary if such a CSR conducts some hardware 
behaviors which are hard to implement in QEMU's world view, such as cache
policies or something would fail-over in user's code, for instance, the
I/O feature probing code. And that's why we keep it inside our toolbox.

Adding TINFO is a bit in the twilight zone. It's officially documented in the
RISC-V Debug Spec, yet we Andes has our own customization (which might
come out of the shadow one day) on it and thus we decice to add the csrno in
the general parts (cpu_bits.h) and add the handling function in csr_andes.inc.c
for our further development.

For now, this patch with previously submitted Andes AE350 board support 
could execute mainline U-boot (proper) and OpenSBI (with test payload)

Cordially yours,
Ruinland ChuanTzu Tsai

Ruinaldn ChuanTzu Tsai (2):
  Adding Andes AX25 CPU model
  Adding preliminary custom/vendor CSR handling mechanism

 target/riscv/andes_cpu_bits.h  | 113 ++++++++++++++++++++++++
 target/riscv/cpu.c             |  37 ++++++++
 target/riscv/cpu.h             |  29 ++++++-
 target/riscv/cpu_bits.h        |   3 +
 target/riscv/csr.c             |  46 ++++++++--
 target/riscv/csr_andes.inc.c   | 153 +++++++++++++++++++++++++++++++++
 target/riscv/custom_cpu_bits.h |   3 +
 7 files changed, 375 insertions(+), 9 deletions(-)
 create mode 100644 target/riscv/andes_cpu_bits.h
 create mode 100644 target/riscv/csr_andes.inc.c
 create mode 100644 target/riscv/custom_cpu_bits.h


reply via email to

[Prev in Thread] Current Thread [Next in Thread]