All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: "Joel Stanley" <joel@jms.id.au>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Linux Samsung SOC" <linux-samsung-soc@vger.kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Nicolas Pitre" <nico@fluxnic.net>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [PATCH v2 2/2] ARM: move device tree mapping out of linear region
Date: Wed, 28 Oct 2020 14:04:41 +0100	[thread overview]
Message-ID: <CAMj1kXFWAr+-fnThgtY_jTg1_=kmhHRS5+X6jXAG9K7GegCchg@mail.gmail.com> (raw)
In-Reply-To: <20201028130050.GL1551@shell.armlinux.org.uk>

On Wed, 28 Oct 2020 at 14:01, Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
>
> On Wed, Oct 28, 2020 at 01:52:48PM +0100, Ard Biesheuvel wrote:
> > Does this help?
> >
> > diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> > index bb79e52aeb90..4f355bda872a 100644
> > --- a/arch/arm/include/asm/memory.h
> > +++ b/arch/arm/include/asm/memory.h
> > @@ -68,8 +68,8 @@
> >  #define XIP_VIRT_ADDR(physaddr)  (MODULES_VADDR + ((physaddr) & 0x000fffff))
> >
> >  #define FDT_FIXED_BASE         UL(0xff800000)
> > -#define FDT_FIXED_SIZE         (2 * PMD_SIZE)
> > -#define FDT_VIRT_ADDR(physaddr)        ((void *)(FDT_FIXED_BASE |
> > (physaddr) % PMD_SIZE))
> > +#define FDT_FIXED_SIZE         (2 * SECTION_SIZE)
> > +#define FDT_VIRT_ADDR(physaddr)        ((void *)(FDT_FIXED_BASE |
> > (physaddr) % SECTION_SIZE))
>
> Is this correct? If the FDT fixed size is 2x, why does FDT_VIRT_ADDR()
> only work for half of it?
>

Perhaps the naming is confusing. This is only used to obtain the start
of the virtually mapped DT, which amounts to the virtual address of
the section plus the physical address modulo the section size.

I will rename physaddr to physbase when I respin this as a patch.
Shall I rename FDT_VIRT_ADDR to FDT_VIRT_BASE as well?

WARNING: multiple messages have this Message-ID (diff)
From: Ard Biesheuvel <ardb@kernel.org>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: "Linux Samsung SOC" <linux-samsung-soc@vger.kernel.org>,
	"Nicolas Pitre" <nico@fluxnic.net>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Joel Stanley" <joel@jms.id.au>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>
Subject: Re: [PATCH v2 2/2] ARM: move device tree mapping out of linear region
Date: Wed, 28 Oct 2020 14:04:41 +0100	[thread overview]
Message-ID: <CAMj1kXFWAr+-fnThgtY_jTg1_=kmhHRS5+X6jXAG9K7GegCchg@mail.gmail.com> (raw)
In-Reply-To: <20201028130050.GL1551@shell.armlinux.org.uk>

On Wed, 28 Oct 2020 at 14:01, Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
>
> On Wed, Oct 28, 2020 at 01:52:48PM +0100, Ard Biesheuvel wrote:
> > Does this help?
> >
> > diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> > index bb79e52aeb90..4f355bda872a 100644
> > --- a/arch/arm/include/asm/memory.h
> > +++ b/arch/arm/include/asm/memory.h
> > @@ -68,8 +68,8 @@
> >  #define XIP_VIRT_ADDR(physaddr)  (MODULES_VADDR + ((physaddr) & 0x000fffff))
> >
> >  #define FDT_FIXED_BASE         UL(0xff800000)
> > -#define FDT_FIXED_SIZE         (2 * PMD_SIZE)
> > -#define FDT_VIRT_ADDR(physaddr)        ((void *)(FDT_FIXED_BASE |
> > (physaddr) % PMD_SIZE))
> > +#define FDT_FIXED_SIZE         (2 * SECTION_SIZE)
> > +#define FDT_VIRT_ADDR(physaddr)        ((void *)(FDT_FIXED_BASE |
> > (physaddr) % SECTION_SIZE))
>
> Is this correct? If the FDT fixed size is 2x, why does FDT_VIRT_ADDR()
> only work for half of it?
>

Perhaps the naming is confusing. This is only used to obtain the start
of the virtually mapped DT, which amounts to the virtual address of
the section plus the physical address modulo the section size.

I will rename physaddr to physbase when I respin this as a patch.
Shall I rename FDT_VIRT_ADDR to FDT_VIRT_BASE as well?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-10-29  0:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07  8:39 [PATCH v2 0/2] ARM: move FDT mapping out of linear region Ard Biesheuvel
2020-10-07  8:39 ` [PATCH v2 1/2] ARM: centralize phys-to-virt conversion of DT/ATAGS address Ard Biesheuvel
2020-10-07 15:28   ` Nicolas Pitre
2020-10-07  8:39 ` [PATCH v2 2/2] ARM: move device tree mapping out of linear region Ard Biesheuvel
2020-10-07 15:28   ` Nicolas Pitre
2020-10-07 15:32     ` Ard Biesheuvel
2020-10-07 16:38       ` Nicolas Pitre
2020-10-07 16:40       ` Nicolas Pitre
2020-10-07 21:32     ` Russell King - ARM Linux admin
2020-10-07 22:05       ` Nicolas Pitre
     [not found]   ` <CGME20201028091912eucas1p13fb9cd947faa6bfd79199ea79648b6af@eucas1p1.samsung.com>
2020-10-28  9:19     ` Marek Szyprowski
2020-10-28  9:19       ` Marek Szyprowski
2020-10-28  9:22       ` Ard Biesheuvel
2020-10-28  9:22         ` Ard Biesheuvel
2020-10-28  9:24         ` Ard Biesheuvel
2020-10-28  9:24           ` Ard Biesheuvel
2020-10-28  9:43           ` Marek Szyprowski
2020-10-28  9:43             ` Marek Szyprowski
2020-10-28 12:05       ` Joel Stanley
2020-10-28 12:05         ` Joel Stanley
2020-10-28 12:52         ` Ard Biesheuvel
2020-10-28 12:52           ` Ard Biesheuvel
2020-10-28 12:59           ` Joel Stanley
2020-10-28 12:59             ` Joel Stanley
2020-10-28 13:00             ` Ard Biesheuvel
2020-10-28 13:00               ` Ard Biesheuvel
2020-10-28 13:06               ` Joel Stanley
2020-10-28 13:06                 ` Joel Stanley
2020-10-28 13:00           ` Russell King - ARM Linux admin
2020-10-28 13:00             ` Russell King - ARM Linux admin
2020-10-28 13:04             ` Ard Biesheuvel [this message]
2020-10-28 13:04               ` Ard Biesheuvel
2020-10-28 13:09               ` Russell King - ARM Linux admin
2020-10-28 13:09                 ` Russell King - ARM Linux admin
2020-10-28 13:16           ` Marek Szyprowski
2020-10-28 13:16             ` Marek Szyprowski
2020-10-11 16:39 ` [PATCH v2 0/2] ARM: move FDT " Ard Biesheuvel

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='CAMj1kXFWAr+-fnThgtY_jTg1_=kmhHRS5+X6jXAG9K7GegCchg@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=clg@kaod.org \
    --cc=f.fainelli@gmail.com \
    --cc=joel@jms.id.au \
    --cc=krzk@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=nico@fluxnic.net \
    --cc=robh+dt@kernel.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 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.