diff mbox series

[v2,06/38] ppc: mpc85xx: Wrap LAW related codes with CONFIG_FSL_LAW

Message ID 1613663886-83811-7-git-send-email-bmeng.cn@gmail.com
State Superseded
Delegated to: Priyanka Jain
Headers show
Series ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support | expand

Commit Message

Bin Meng Feb. 18, 2021, 3:57 p.m. UTC
LAW related codes should be wrapped with CONFIG_FSL_LAW.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

(no changes since v1)

 arch/powerpc/cpu/mpc85xx/cpu.c            | 2 ++
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Priyanka Jain Feb. 22, 2021, 8:12 a.m. UTC | #1
>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: Thursday, February 18, 2021 9:28 PM
>To: Simon Glass <sjg@chromium.org>; Alexander Graf <agraf@csgraf.de>;
>Priyanka Jain <priyanka.jain@nxp.com>
>Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Tom Rini <trini@konsulko.com>
>Subject: [PATCH v2 06/38] ppc: mpc85xx: Wrap LAW related codes with
>CONFIG_FSL_LAW
>
>LAW related codes should be wrapped with CONFIG_FSL_LAW.
>
>Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>---
>
>(no changes since v1)
>
> arch/powerpc/cpu/mpc85xx/cpu.c            | 2 ++
> arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 2 ++
> 2 files changed, 4 insertions(+)
>
>diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c
>b/arch/powerpc/cpu/mpc85xx/cpu.c index 5170610..fc25bb2 100644
>--- a/arch/powerpc/cpu/mpc85xx/cpu.c
>+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
>@@ -395,7 +395,9 @@ int cpu_mmc_init(struct bd_info *bis)  void
>print_reginfo(void)  {
> 	print_tlbcam();
>+#ifdef CONFIG_FSL_LAW
> 	print_laws();
>+#endif
> #if defined(CONFIG_FSL_LBC)
> 	print_lbc_regs();
> #endif
>diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>index 4195ecc..5a0d33b 100644
>--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>@@ -123,7 +123,9 @@ void cpu_init_early_f(void *fdt)
> 	setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_LCLK_IFC_CS3);  #endif
>
>+#ifdef CONFIG_FSL_LAW
> 	init_laws();
>+#endif

LAWs are required to be initialized while running on actual boards.
For QEMU, may be you can create config like CONFIG_FSL_BYPASS_LAW

Priyanka
<snip>
Bin Meng Feb. 22, 2021, 8:53 a.m. UTC | #2
Hi Priyanka,

On Mon, Feb 22, 2021 at 4:12 PM Priyanka Jain <priyanka.jain@nxp.com> wrote:
>
>
>
> >-----Original Message-----
> >From: Bin Meng <bmeng.cn@gmail.com>
> >Sent: Thursday, February 18, 2021 9:28 PM
> >To: Simon Glass <sjg@chromium.org>; Alexander Graf <agraf@csgraf.de>;
> >Priyanka Jain <priyanka.jain@nxp.com>
> >Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Tom Rini <trini@konsulko.com>
> >Subject: [PATCH v2 06/38] ppc: mpc85xx: Wrap LAW related codes with
> >CONFIG_FSL_LAW
> >
> >LAW related codes should be wrapped with CONFIG_FSL_LAW.
> >
> >Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> >---
> >
> >(no changes since v1)
> >
> > arch/powerpc/cpu/mpc85xx/cpu.c            | 2 ++
> > arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 2 ++
> > 2 files changed, 4 insertions(+)
> >
> >diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c
> >b/arch/powerpc/cpu/mpc85xx/cpu.c index 5170610..fc25bb2 100644
> >--- a/arch/powerpc/cpu/mpc85xx/cpu.c
> >+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
> >@@ -395,7 +395,9 @@ int cpu_mmc_init(struct bd_info *bis)  void
> >print_reginfo(void)  {
> >       print_tlbcam();
> >+#ifdef CONFIG_FSL_LAW
> >       print_laws();
> >+#endif
> > #if defined(CONFIG_FSL_LBC)
> >       print_lbc_regs();
> > #endif
> >diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
> >b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
> >index 4195ecc..5a0d33b 100644
> >--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
> >+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
> >@@ -123,7 +123,9 @@ void cpu_init_early_f(void *fdt)
> >       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_LCLK_IFC_CS3);  #endif
> >
> >+#ifdef CONFIG_FSL_LAW
> >       init_laws();
> >+#endif
>
> LAWs are required to be initialized while running on actual boards.

Yes, CONFIG_FSL_LAW is selected by all 85xx SoCs in
arch/powerpc/cpu/mpc85xx/Kconfig

> For QEMU, may be you can create config like CONFIG_FSL_BYPASS_LAW

Only QEMU does not select CONFIG_FSL_LAW and hence it's a Kconfig
option all codes that call into functions in FSL_LAW should be wrapped
by CONFIG_FSL_LAW.

I don't think we should introduce another CONFIG_FSL_BYPASS_LAW for this.

Regards,
Bin
Priyanka Jain (OSS) Feb. 23, 2021, 10:43 a.m. UTC | #3
>-----Original Message-----
>From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Bin Meng
>Sent: Monday, February 22, 2021 2:24 PM
>To: Priyanka Jain <priyanka.jain@nxp.com>
>Cc: Simon Glass <sjg@chromium.org>; Alexander Graf <agraf@csgraf.de>; U-
>Boot Mailing List <u-boot@lists.denx.de>; Tom Rini <trini@konsulko.com>
>Subject: Re: [PATCH v2 06/38] ppc: mpc85xx: Wrap LAW related codes with
>CONFIG_FSL_LAW
>
>Hi Priyanka,
>
>On Mon, Feb 22, 2021 at 4:12 PM Priyanka Jain <priyanka.jain@nxp.com> wrote:
>>
>>
>>
>> >-----Original Message-----
>> >From: Bin Meng <bmeng.cn@gmail.com>
>> >Sent: Thursday, February 18, 2021 9:28 PM
>> >To: Simon Glass <sjg@chromium.org>; Alexander Graf <agraf@csgraf.de>;
>> >Priyanka Jain <priyanka.jain@nxp.com>
>> >Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Tom Rini
>> ><trini@konsulko.com>
>> >Subject: [PATCH v2 06/38] ppc: mpc85xx: Wrap LAW related codes with
>> >CONFIG_FSL_LAW
>> >
>> >LAW related codes should be wrapped with CONFIG_FSL_LAW.
>> >
>> >Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
>> >---
>> >
>> >(no changes since v1)
>> >
>> > arch/powerpc/cpu/mpc85xx/cpu.c            | 2 ++
>> > arch/powerpc/cpu/mpc85xx/cpu_init_early.c | 2 ++
>> > 2 files changed, 4 insertions(+)
>> >
>> >diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c
>> >b/arch/powerpc/cpu/mpc85xx/cpu.c index 5170610..fc25bb2 100644
>> >--- a/arch/powerpc/cpu/mpc85xx/cpu.c
>> >+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
>> >@@ -395,7 +395,9 @@ int cpu_mmc_init(struct bd_info *bis)  void
>> >print_reginfo(void)  {
>> >       print_tlbcam();
>> >+#ifdef CONFIG_FSL_LAW
>> >       print_laws();
>> >+#endif
>> > #if defined(CONFIG_FSL_LBC)
>> >       print_lbc_regs();
>> > #endif
>> >diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> >b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> >index 4195ecc..5a0d33b 100644
>> >--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> >+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> >@@ -123,7 +123,9 @@ void cpu_init_early_f(void *fdt)
>> >       setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_LCLK_IFC_CS3);
>> >#endif
>> >
>> >+#ifdef CONFIG_FSL_LAW
>> >       init_laws();
>> >+#endif
>>
>> LAWs are required to be initialized while running on actual boards.
>
>Yes, CONFIG_FSL_LAW is selected by all 85xx SoCs in
>arch/powerpc/cpu/mpc85xx/Kconfig
>
>> For QEMU, may be you can create config like CONFIG_FSL_BYPASS_LAW
>
>Only QEMU does not select CONFIG_FSL_LAW and hence it's a Kconfig option all
>codes that call into functions in FSL_LAW should be wrapped by
>CONFIG_FSL_LAW.
>
>I don't think we should introduce another CONFIG_FSL_BYPASS_LAW for this.
>
>Regards,
>Bin

Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
diff mbox series

Patch

diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 5170610..fc25bb2 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -395,7 +395,9 @@  int cpu_mmc_init(struct bd_info *bis)
 void print_reginfo(void)
 {
 	print_tlbcam();
+#ifdef CONFIG_FSL_LAW
 	print_laws();
+#endif
 #if defined(CONFIG_FSL_LBC)
 	print_lbc_regs();
 #endif
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
index 4195ecc..5a0d33b 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -123,7 +123,9 @@  void cpu_init_early_f(void *fdt)
 	setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_LCLK_IFC_CS3);
 #endif
 
+#ifdef CONFIG_FSL_LAW
 	init_laws();
+#endif
 
 /*
  * Work Around for IFC Erratum A003399, issue will hit only when execution