OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yu-Chien Peter Lin <peterlin@andestech.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v3 10/15] lib: utils: fdt_fixup: Allow preserving PMU properties
Date: Tue, 28 Nov 2023 17:57:57 +0800	[thread overview]
Message-ID: <ZWW5pev4P_JxWWyQ@APC323> (raw)
In-Reply-To: <CAAhSdy2iMgXBJcN_OOju3cHTLa6n2hF58YnDK-X5iLAs6NWQKg@mail.gmail.com>

Hi Anup,

On Sat, Nov 25, 2023 at 10:12:06AM +0530, Anup Patel wrote:
> On Wed, Nov 22, 2023 at 1:10?PM Yu Chien Peter Lin
> <peterlin@andestech.com> wrote:
> >
> > Add a scratch option to control PMU fixup, so the next
> > stage software can dump the PMU node including event
> > mapping information for debugging purposes.
> >
> > Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
> > Reviewed-by: Anup Patel <anup@brainfault.org>
> > ---
> > Changes v1 -> v2:
> >   - New patch
> > Changes v2 -> v3:
> >   - Rename to SBI_SCRATCH_PRESERVE_PMU_NODE (suggested by Anup)
> >   - Include Anup's RB tag
> > ---
> >  include/sbi/sbi_scratch.h | 2 ++
> >  lib/utils/fdt/fdt_fixup.c | 6 +++++-
> >  2 files changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h
> > index e6a33ba..0f67cde 100644
> > --- a/include/sbi/sbi_scratch.h
> > +++ b/include/sbi/sbi_scratch.h
> > @@ -151,6 +151,8 @@ enum sbi_scratch_options {
> >         SBI_SCRATCH_NO_BOOT_PRINTS = (1 << 0),
> >         /** Enable runtime debug prints */
> >         SBI_SCRATCH_DEBUG_PRINTS = (1 << 1),
> > +       /** Preserve PMU node properties */
> > +       SBI_SCRATCH_PRESERVE_PMU_NODE = (1 << 2),
> 
> I have second thoughts about using the scratch option for this.
> 
> Let's not waste a bit in the scratch option just for debugging the PMU node.
> 
> I suggest adding the kconfig option FDT_FIXUPS_PRESERVE_PMU_NODE
> in <opensbi>lib/utils/fdt/Kconfig and use it in fdt_fixups() function.

OK, will do.

Best regards,
Peter Lin

> Regards,
> Anup
> 
> >  };
> >
> >  /** Get pointer to sbi_scratch for current HART */
> > diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c
> > index e213ded..cf20edf 100644
> > --- a/lib/utils/fdt/fdt_fixup.c
> > +++ b/lib/utils/fdt/fdt_fixup.c
> > @@ -387,6 +387,8 @@ int fdt_reserved_memory_fixup(void *fdt)
> >
> >  void fdt_fixups(void *fdt)
> >  {
> > +       struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
> > +
> >         fdt_aplic_fixup(fdt);
> >
> >         fdt_imsic_fixup(fdt);
> > @@ -394,5 +396,7 @@ void fdt_fixups(void *fdt)
> >         fdt_plic_fixup(fdt);
> >
> >         fdt_reserved_memory_fixup(fdt);
> > -       fdt_pmu_fixup(fdt);
> > +
> > +       if (!(scratch->options & SBI_SCRATCH_PRESERVE_PMU_NODE))
> > +               fdt_pmu_fixup(fdt);
> >  }
> > --
> > 2.34.1
> >


  reply	other threads:[~2023-11-28  9:57 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  7:36 [PATCH v3 00/15] Add Andes PMU extension support Yu Chien Peter Lin
2023-11-22  7:36 ` [PATCH v3 01/15] lib: ipi: Adjust Andes PLICSW to single-bit-per-hart scheme Yu Chien Peter Lin
2023-11-24 14:43   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 02/15] sbi: sbi_pmu: Improve sbi_pmu_init() error handling Yu Chien Peter Lin
2023-11-22 23:47   ` Atish Patra
2023-11-28  5:33     ` Yu-Chien Peter Lin
2023-11-24 14:45   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 03/15] lib: sbi: Add Xandespmu in hart extensions Yu Chien Peter Lin
2023-11-23  0:02   ` Atish Patra
2023-11-24 14:45   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 04/15] sbi: sbi_pmu: Add hw_counter_filter_mode() to pmu device Yu Chien Peter Lin
2023-11-23  0:24   ` Atish Patra
2023-11-28  6:10     ` Yu-Chien Peter Lin
2023-11-22  7:36 ` [PATCH v3 05/15] platform: include: andes45: Add PMU related CSR defines Yu Chien Peter Lin
2023-11-23 16:53   ` Atish Patra
2023-11-24 14:47   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 06/15] platform: generic: Introduce pmu_init() platform override Yu Chien Peter Lin
2023-11-23  0:25   ` Atish Patra
2023-11-24 14:49   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 07/15] platform: andes: Add Andes custom PMU support Yu Chien Peter Lin
2023-11-23  2:24   ` Samuel Holland
2023-11-28 11:02     ` Yu-Chien Peter Lin
2023-11-22  7:36 ` [PATCH v3 08/15] platform: andes: Enable Andes PMU for AE350 Yu Chien Peter Lin
2023-11-23 16:55   ` Atish Patra
2023-11-24 14:52   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 09/15] platform: rzfive: Enable Andes PMU for RZ/Five Yu Chien Peter Lin
2023-11-23 16:56   ` Atish Patra
2023-11-24 14:53   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 10/15] lib: utils: fdt_fixup: Allow preserving PMU properties Yu Chien Peter Lin
2023-11-22 23:41   ` Atish Patra
2023-11-24 14:54   ` Lad, Prabhakar
2023-11-25  4:42   ` Anup Patel
2023-11-28  9:57     ` Yu-Chien Peter Lin [this message]
2023-11-22  7:36 ` [PATCH v3 11/15] platform: andes: Factor out is_andes() helper Yu Chien Peter Lin
2023-11-22  7:36 ` [PATCH v3 12/15] lib: utils: fdt_pmu: Make the fdt_pmu_evt_select table global variable Yu Chien Peter Lin
2023-11-22  7:36 ` [PATCH v3 13/15] lib: utils: fdt_pmu: Do not iterate over the fdt_pmu_evt_select table Yu Chien Peter Lin
2023-11-22  7:36 ` [PATCH v3 14/15] platform: andes: Add Andes default PMU mapping support Yu Chien Peter Lin
2023-11-24 14:55   ` Lad, Prabhakar
2023-11-22  7:36 ` [PATCH v3 15/15] docs: pmu: Add Andes PMU node example Yu Chien Peter Lin
2023-11-24 14:56   ` Lad, Prabhakar
2023-11-23  0:07 ` [PATCH v3 00/15] Add Andes PMU extension support Atish Patra
2023-11-23  0:27   ` Atish Patra
2023-11-28  5:23     ` Yu-Chien Peter Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWW5pev4P_JxWWyQ@APC323 \
    --to=peterlin@andestech.com \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox