[PATCH 6/7] lib: sbi: Print platform PMU device at boot-time

Anup Patel anup at brainfault.org
Thu Sep 1 04:29:39 PDT 2022


On Sat, Aug 27, 2022 at 4:56 AM Atish Patra <atishp at atishpatra.org> wrote:
>
>
>
> On Wed, Aug 24, 2022 at 9:52 PM Anup Patel <apatel at ventanamicro.com> wrote:
>>
>> Let us print the platform PMU device name at the boot-time so that users
>> know whether the underlying platform has custom per-HART PMU operations.
>>
>> Signed-off-by: Anup Patel <apatel at ventanamicro.com>
>> Reviewed-by: Andrew Jones <ajones at ventanamicro.com>
>> ---
>>  lib/sbi/sbi_init.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
>> index d57efa7..a8500e5 100644
>> --- a/lib/sbi/sbi_init.c
>> +++ b/lib/sbi/sbi_init.c
>> @@ -63,6 +63,7 @@ static void sbi_boot_print_banner(struct sbi_scratch *scratch)
>>  static void sbi_boot_print_general(struct sbi_scratch *scratch)
>>  {
>>         char str[128];
>> +       const struct sbi_pmu_device *pdev;
>>         const struct sbi_hsm_device *hdev;
>>         const struct sbi_ipi_device *idev;
>>         const struct sbi_timer_device *tdev;
>> @@ -93,6 +94,9 @@ static void sbi_boot_print_general(struct sbi_scratch *scratch)
>>         hdev = sbi_hsm_get_device();
>>         sbi_printf("Platform HSM Device       : %s\n",
>>                    (hdev) ? hdev->name : "---");
>> +       pdev = sbi_pmu_get_device();
>> +       sbi_printf("Platform PMU Device       : %s\n",
>> +                  (pdev) ? pdev->name : "---");
>
>
> Just a nit pick thought ;)
> Should we only print the entire line if pdev is present ?

In general, I agree with your suggestion but for consistency
let us keep it as-is. You can send a separate patch print
device for various things only if xdev != NULL.

>
>>
>>         srdev = sbi_system_reset_get_device(SBI_SRST_RESET_TYPE_COLD_REBOOT, 0);
>>         sbi_printf("Platform Reboot Device    : %s\n",
>>                    (srdev) ? srdev->name : "---");
>> --
>> 2.34.1
>>
>
> Otherwise, LGTM.
>
> Reviewed-by: Atish Patra <atishp at rivosinc.com>
>
> --
> Regards,
> Atish

Regards,
Anup



More information about the opensbi mailing list