All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/8] riscv: andes_plic: Fix some wrong configurations
Date: Wed, 30 Oct 2019 18:38:00 +0800	[thread overview]
Message-ID: <CAEUhbmX4LBsocbViv8ZnBYk5CmTcrrQvBAWPF7-Xvp-_1KYK6w@mail.gmail.com> (raw)
In-Reply-To: <CAN5B=e+Hi1fQ6mnv=n+n=YKd=tbQMw4L3BAbiRK8K-Uv3F17ZQ@mail.gmail.com>

Hi Rick,

On Wed, Oct 30, 2019 at 10:50 AM Rick Chen <rickchen36@gmail.com> wrote:
>
> Hi Bin
>
> >
> > Hi Rick,
> >
> > On Fri, Oct 25, 2019 at 2:18 PM Andes <uboot@andestech.com> wrote:
> > >
> > > From: Rick Chen <rick@andestech.com>
> > >
> > > It will work fine due to hart 0 always will be main
> > > hart coincidentally. When develop SPL flow, I try to
> > > force other harts to be main hart. And it will go
> > > wrong in sending IPI flow. So fix it.
> >
> > Fix what? Does this commit contain 2 fixes, or just 1 fix?
>
> Yes, it include two fixs. But they will cause one negative result
> that only hart 0 can send ipi to other harts.
>
> >
> > >
> > > Having this fix, any hart can be main hart in U-Boot SPL
> > > theoretically, but it still fail somewhere. After dig in
> > > and found there is an assumption that hart 0 shall be
> > > main hart in OpenSbi.
> >
> > So does this mean there is a bug in OpenSBI too?
>
> I am not sure if it is a bug. Maybe it is a compatible issue.
> There is a limitation that only hart 0 can be main hart in OpenSBI.

I don't think OpenSBI has such limitation.

> But any hart can be main hart in U-Boot.
>
> In general case, hart 0 will be main and it is fine when U-Boot jump ot OpenSBI.
> But if we force hart 1 to be main hart, when hart 0 jump to OPenSBI from U-Boot,
> It will do relocation flow in OpenSBI which willcorrupt U-Boot SPL,
> but hart 0 still in U-Boot SPL.
>
> >
> > >
> > > After some work-arounds, it can pass the verifications
> > > that any hart can be main hart and boots U-Boot SPL ->
> > > OpenSbi -> U-Boot proper -> Linux Kernel successfully.
> > >
> >
> > It's a bit hard for me to understand what was described here in the
> > commit message. Maybe you need rewrite something.
>
> OK. I will rewrite this commit message.
>
> >
> > > Signed-off-by: Rick Chen <rick@andestech.com>
> > > Cc: KC Lin <kclin@andestech.com>
> > > Cc: Alan Kao <alankao@andestech.com>
> > > ---
> > >  arch/riscv/lib/andes_plic.c | 11 +++++++----
> > >  1 file changed, 7 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/arch/riscv/lib/andes_plic.c b/arch/riscv/lib/andes_plic.c
> > > index 28568e4..42394b9 100644
> > > --- a/arch/riscv/lib/andes_plic.c
> > > +++ b/arch/riscv/lib/andes_plic.c
> > > @@ -19,7 +19,7 @@
> > >  #include <cpu.h>
> > >
> > >  /* pending register */
> > > -#define PENDING_REG(base, hart)        ((ulong)(base) + 0x1000 + (hart) * 8)
> > > +#define PENDING_REG(base, hart)        ((ulong)(base) + 0x1000 + ((hart) / 4) * 4)
> > >  /* enable register */
> > >  #define ENABLE_REG(base, hart) ((ulong)(base) + 0x2000 + (hart) * 0x80)
> > >  /* claim register */
> > > @@ -46,7 +46,7 @@ static int init_plic(void);
> > >
> > >  static int enable_ipi(int hart)
> > >  {
> > > -       int en;
> > > +       unsigned int en;
> >
> > Is this for some compiler warning fix?
>
> No, it is not a warning fix. It is a bug fix.
> I hope en can be 0x0000000080808080 instead of 0xffffffff80808080,

But it is int, which is only 32-bit. The example you gave was a 64-bit number.

> or it will cause IPI sending errors.
>

Regards,
Bin

  reply	other threads:[~2019-10-30 10:38 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  6:10 [U-Boot] [PATCH 0/8] RISC-V AX25-AE350 support SPL Andes
2019-10-25  6:10 ` [U-Boot] [PATCH 1/8] riscv: ax25: add SPL support Andes
2019-10-29 14:29   ` Bin Meng
2019-10-30  0:42     ` Rick Chen
2019-10-30 10:06       ` Bin Meng
2019-10-31  2:11         ` Rick Chen
2019-10-25  6:10 ` [U-Boot] [PATCH 2/8] riscv: ax25-ae350: add SPL configuration Andes
2019-10-29 14:39   ` Bin Meng
2019-10-30  2:06     ` Rick Chen
2019-10-25  6:10 ` [U-Boot] [PATCH 3/8] riscv: ax25-ae350: Use generic memory size setup Andes
2019-10-29 14:42   ` Bin Meng
2019-10-30  2:19     ` Rick Chen
2019-10-25  6:10 ` [U-Boot] [PATCH 4/8] riscv: andes_plic: Fix some wrong configurations Andes
2019-10-29 14:51   ` Bin Meng
2019-10-30  2:50     ` Rick Chen
2019-10-30 10:38       ` Bin Meng [this message]
2019-10-31  1:00         ` Alan Kao
2019-10-31  3:36           ` Bin Meng
2019-10-31  7:48             ` Alan Kao
2019-10-31  8:10               ` Bin Meng
2019-10-31  8:12           ` Anup Patel
2019-10-31 10:43             ` Anup Patel
2019-11-01  5:25               ` Rick Chen
2019-11-05  1:50                 ` Rick Chen
2019-11-05  6:34                   ` Anup Patel
2019-11-06  6:44                     ` Rick Chen
2019-11-06  8:48                       ` Anup Patel
2019-11-06  8:58                         ` Anup Patel
2019-11-06  9:21                           ` Rick Chen
2019-11-06 11:11                             ` Anup Patel
2019-11-07  1:34                               ` Rick Chen
2019-11-07  5:15                                 ` Anup Patel
2019-11-07  5:45                                   ` Anup Patel
2019-11-07  6:10                                     ` Rick Chen
2019-11-07  6:18                                       ` Anup Patel
2019-11-07  9:41                                         ` Auer, Lukas
2019-11-07 10:44                                           ` Anup Patel
2019-11-07 11:41                                             ` Rick Chen
2019-11-07 12:22                                               ` Anup Patel
2019-11-08  1:23                                                 ` Rick Chen
2019-11-08 12:14                                                   ` Anup Patel
2019-11-07 18:44                                               ` Atish Patra
2019-11-08  1:13                                                 ` Rick Chen
2019-11-08  7:27                                                   ` Rick Chen
2019-11-08  8:59                                                     ` Auer, Lukas
2019-11-11  7:19                                                       ` Rick Chen
2019-11-12  9:47                                                         ` Auer, Lukas
2019-11-13  3:42                                                           ` Rick Chen
2019-11-14  7:27                                                             ` Anup Patel
2019-11-14 17:10                                                               ` Auer, Lukas
2019-11-07 11:44                                             ` Auer, Lukas
2019-11-07 12:27                                               ` Anup Patel
2019-11-07 13:37                                                 ` Auer, Lukas
2019-10-31  2:23         ` Rick Chen
2019-10-25  6:10 ` [U-Boot] [PATCH 5/8] riscv: ax25: cache: Add SPL_RISCV_MMODE for SPL Andes
2019-10-29 14:59   ` Bin Meng
2019-10-31  2:31     ` Rick Chen
2019-10-31  3:00       ` Bin Meng
2019-10-25  6:10 ` [U-Boot] [PATCH 6/8] spl: cache: Allow cache drivers in SPL Andes
2019-10-29 15:14   ` Bin Meng
2019-10-31  2:52     ` Rick Chen
2019-10-31  3:01       ` Bin Meng
2019-10-31  3:22         ` Rick Chen
2019-10-25  6:10 ` [U-Boot] [PATCH 7/8] riscv: Fix clear bss loop in the start-up code Andes
2019-10-29 15:16   ` Bin Meng
2019-10-31  3:10     ` Rick Chen
2019-10-31 12:55       ` Bin Meng
2019-11-01  5:24         ` Rick Chen
2019-10-25  6:10 ` [U-Boot] [PATCH 8/8] riscv: dts: Support four cores SMP Andes
2019-10-29 15:17   ` Bin Meng
2019-10-31  5:57     ` Rick Chen

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=CAEUhbmX4LBsocbViv8ZnBYk5CmTcrrQvBAWPF7-Xvp-_1KYK6w@mail.gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.