From: Sunil V L Date: Mon, 27 Mar 2023 14:17:27 +0530 Subject: [RFC PATCH v2 1/4] include: Add defines for SBI CPPC extension In-Reply-To: <8037327ce19153d57194d8dcf36a5a071831b23d.camel@126.com> References: <20230323090320.2489167-1-sunilvl@ventanamicro.com> <20230323090320.2489167-2-sunilvl@ventanamicro.com> <4781219a856c519185ad0113ec75bf4b2fe6d9c9.camel@126.com> <8037327ce19153d57194d8dcf36a5a071831b23d.camel@126.com> Message-ID: List-Id: To: opensbi@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, Mar 27, 2023 at 04:40:17PM +0800, Xiang W wrote: > ? 2023-03-27???? 16:27 +0800?Xiang W??? > > ? 2023-03-23???? 14:33 +0530?Sunil V L??? > > > Add SBI CPPC extension related defines to the > > > SBI ecall interface header. > > > > > > Signed-off-by: Sunil V L > > > Reviewed-by: Andrew Jones > > > --- > > > ?include/sbi/sbi_ecall_interface.h | 34 +++++++++++++++++++++++++++++++ > > > ?1 file changed, 34 insertions(+) > > > > > > diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h > > > index 4597358..dee2dd9 100644 > > > --- a/include/sbi/sbi_ecall_interface.h > > > +++ b/include/sbi/sbi_ecall_interface.h > > > @@ -31,6 +31,7 @@ > > > ?#define SBI_EXT_PMU????????????????????????????0x504D55 > > > ?#define SBI_EXT_DBCN???????????????????????????0x4442434E > > > ?#define SBI_EXT_SUSP???????????????????????????0x53555350 > > > +#define SBI_EXT_CPPC???????????????????????????0x43505043 > > > ? > > > ?/* SBI function IDs for BASE extension*/ > > > ?#define SBI_EXT_BASE_GET_SPEC_VERSION??????????0x0 > > > @@ -256,6 +257,39 @@ enum sbi_pmu_ctr_type { > > > ?#define SBI_SUSP_SLEEP_TYPE_LAST???????????????SBI_SUSP_SLEEP_TYPE_SUSPEND > > > ?#define SBI_SUSP_PLATFORM_SLEEP_START??????????0x80000000 > > > ? > > > +/* SBI function IDs for CPPC extension */ > > > +#define SBI_EXT_CPPC_PROBE?????????????????????0x0 > > > +#define SBI_EXT_CPPC_READ??????????????????????0x1 > > > +#define SBI_EXT_CPPC_READ_HI???????????????????0x2 > > > +#define SBI_EXT_CPPC_WRITE?????????????????????0x3 > > > > The FID is specified in the documentation: > > https://docs.google.com/document/d/16FLCZtW_JVrN7fnTivHRLH2E7hGdRjMfzDWzsvPRLEc > > > > sbi_cppc_read??? 0 > > sbi_cppc_read_hi 1 > > sbi_cppc_write?? 2 > > > > We need to modify SBI_EXT_CPPC_PROBE to 0x3 > Maybe it's better to change it to 0x8000 to leave space for extending the FID > > Hi Xiang!, The gdoc is outdated and have stopped updating it since the review is happening now via regular adoc patch. Please refer to https://lists.riscv.org/g/tech-prs/message/301 for the latest proposal. Thanks! Sunil > > Regards, > > Xiang W > > > + > > > +enum sbi_cppc_reg_id { > > > +???????SBI_CPPC_HIGHEST_PERF???????????= 0x00000000, > > > +???????SBI_CPPC_NOMINAL_PERF???????????= 0x00000001, > > > +???????SBI_CPPC_LOW_NON_LINEAR_PERF????= 0x00000002, > > > +???????SBI_CPPC_LOWEST_PERF????????????= 0x00000003, > > > +???????SBI_CPPC_GUARANTEED_PERF????????= 0x00000004, > > > +???????SBI_CPPC_DESIRED_PERF???????????= 0x00000005, > > > +???????SBI_CPPC_MIN_PERF???????????????= 0x00000006, > > > +???????SBI_CPPC_MAX_PERF???????????????= 0x00000007, > > > +???????SBI_CPPC_PERF_REDUC_TOLERANCE???= 0x00000008, > > > +???????SBI_CPPC_TIME_WINDOW????????????= 0x00000009, > > > +???????SBI_CPPC_CTR_WRAP_TIME??????????= 0x0000000A, > > > +???????SBI_CPPC_REFERENCE_CTR??????????= 0x0000000B, > > > +???????SBI_CPPC_DELIVERED_CTR??????????= 0x0000000C, > > > +???????SBI_CPPC_PERF_LIMITED???????????= 0x0000000D, > > > +???????SBI_CPPC_ENABLE?????????????????= 0x0000000E, > > > +???????SBI_CPPC_AUTO_SEL_ENABLE????????= 0x0000000F, > > > +???????SBI_CPPC_AUTO_ACT_WINDOW????????= 0x00000010, > > > +???????SBI_CPPC_ENERGY_PERF_PREFERENCE?= 0x00000011, > > > +???????SBI_CPPC_REFERENCE_PERF?????????= 0x00000012, > > > +???????SBI_CPPC_LOWEST_FREQ????????????= 0x00000013, > > > +???????SBI_CPPC_NOMINAL_FREQ???????????= 0x00000014, > > > +???????SBI_CPPC_ACPI_LAST??????????????= SBI_CPPC_NOMINAL_FREQ, > > > +???????SBI_CPPC_TRANSITION_LATENCY?????= 0x80000000, > > > +???????SBI_CPPC_NON_ACPI_LAST??????????= SBI_CPPC_TRANSITION_LATENCY, > > > +}; > > > + > > > ?/* SBI base specification related macros */ > > > ?#define SBI_SPEC_VERSION_MAJOR_OFFSET??????????24 > > > ?#define SBI_SPEC_VERSION_MAJOR_MASK????????????0x7f > > > -- > > > 2.34.1 > > > > > > > > >