diff mbox series

[v2,04/11] Convert CONFIG_PHYSMEM to Kconfig

Message ID 20211124162649.846156-5-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show
Series Kconfig: Drop some sandbox-related items | expand

Commit Message

Simon Glass Nov. 24, 2021, 4:26 p.m. UTC
This converts the following to Kconfig:
   CONFIG_PHYSMEM

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Sean Anderson <seanga2@gmail.com>
---

Changes in v2:
- Use G instead of GB

 README                       |  8 --------
 arch/Kconfig                 |  2 ++
 include/configs/edison.h     |  3 ---
 include/configs/sandbox.h    |  2 --
 include/configs/x86-common.h |  2 --
 lib/Kconfig                  | 10 ++++++++++
 scripts/config_whitelist.txt |  1 -
 7 files changed, 12 insertions(+), 16 deletions(-)

Comments

Andy Shevchenko Nov. 24, 2021, 4:32 p.m. UTC | #1
On Wed, Nov 24, 2021 at 6:28 PM Simon Glass <sjg@chromium.org> wrote:
>
> This converts the following to Kconfig:
>    CONFIG_PHYSMEM

Why?

And why my message [1] left unanswered?

[1]: https://lore.kernel.org/u-boot/CAHp75VcVpvuPWKjcuFwjcs0rOq7Woiz_CUD57vpzD5HF6SEzrg@mail.gmail.com/T/#u
Simon Glass Nov. 25, 2021, 12:12 a.m. UTC | #2
Hi Andy,

On Wed, 24 Nov 2021 at 09:33, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>
> On Wed, Nov 24, 2021 at 6:28 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > This converts the following to Kconfig:
> >    CONFIG_PHYSMEM
>
> Why?

Because we want to avoid ad-hoc CONFIG options.

>
> And why my message [1] left unanswered?
>
> [1]: https://lore.kernel.org/u-boot/CAHp75VcVpvuPWKjcuFwjcs0rOq7Woiz_CUD57vpzD5HF6SEzrg@mail.gmail.com/T/#u

Because I have not got to it yet. It can take me a week or more to
catch up on email. I do it in batches.

We could enable this option always, but it is a bit risky as it
doesn't work on 32-bit machines unless there is an implementation
available.

Regards,
Simon
Andy Shevchenko Nov. 26, 2021, 4:07 p.m. UTC | #3
On Thu, Nov 25, 2021 at 2:12 AM Simon Glass <sjg@chromium.org> wrote:
> On Wed, 24 Nov 2021 at 09:33, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> >
> > On Wed, Nov 24, 2021 at 6:28 PM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > This converts the following to Kconfig:
> > >    CONFIG_PHYSMEM
> >
> > Why?
>
> Because we want to avoid ad-hoc CONFIG options.

I mean why to do this effort if it can be simply removed for good.

> > And why my message [1] left unanswered?
> >
> > [1]: https://lore.kernel.org/u-boot/CAHp75VcVpvuPWKjcuFwjcs0rOq7Woiz_CUD57vpzD5HF6SEzrg@mail.gmail.com/T/#u
>
> Because I have not got to it yet. It can take me a week or more to
> catch up on email. I do it in batches.
>
> We could enable this option always, but it is a bit risky as it
> doesn't work on 32-bit machines unless there is an implementation
> available.

I haven't got this. It's always enabled on x86. And it seems the only
user of it. I don't see any benefit of keeping this option.
Simon Glass Dec. 6, 2021, 3:22 p.m. UTC | #4
Hi Andy,

On Fri, 26 Nov 2021 at 09:08, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>
> On Thu, Nov 25, 2021 at 2:12 AM Simon Glass <sjg@chromium.org> wrote:
> > On Wed, 24 Nov 2021 at 09:33, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > >
> > > On Wed, Nov 24, 2021 at 6:28 PM Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > This converts the following to Kconfig:
> > > >    CONFIG_PHYSMEM
> > >
> > > Why?
> >
> > Because we want to avoid ad-hoc CONFIG options.
>
> I mean why to do this effort if it can be simply removed for good.
>
> > > And why my message [1] left unanswered?
> > >
> > > [1]: https://lore.kernel.org/u-boot/CAHp75VcVpvuPWKjcuFwjcs0rOq7Woiz_CUD57vpzD5HF6SEzrg@mail.gmail.com/T/#u
> >
> > Because I have not got to it yet. It can take me a week or more to
> > catch up on email. I do it in batches.
> >
> > We could enable this option always, but it is a bit risky as it
> > doesn't work on 32-bit machines unless there is an implementation
> > available.
>
> I haven't got this. It's always enabled on x86. And it seems the only
> user of it. I don't see any benefit of keeping this option.

If it is only always enabled on x86 that means it is not on anything
else. So the option (at present) compiles the physmem.c file only on
x86 and sandbox. That is the purpose of the option.

I am not sure it would cause any harm to enable it for everything, but
I'd rather just do the conversion. It's fine to look at things in a
new light when we convert options, but that sort of change can easily
be done later. The CONFIG conversion has been going on for 6 years,
partly because people don't like touching old things, partly because
people want them cleaned up...

Regards,
Simon
Simon Glass Dec. 15, 2021, 12:33 a.m. UTC | #5
Hi Andy,

On Fri, 26 Nov 2021 at 09:08, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>
> On Thu, Nov 25, 2021 at 2:12 AM Simon Glass <sjg@chromium.org> wrote:
> > On Wed, 24 Nov 2021 at 09:33, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > >
> > > On Wed, Nov 24, 2021 at 6:28 PM Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > This converts the following to Kconfig:
> > > >    CONFIG_PHYSMEM
> > >
> > > Why?
> >
> > Because we want to avoid ad-hoc CONFIG options.
>
> I mean why to do this effort if it can be simply removed for good.
>
> > > And why my message [1] left unanswered?
> > >
> > > [1]: https://lore.kernel.org/u-boot/CAHp75VcVpvuPWKjcuFwjcs0rOq7Woiz_CUD57vpzD5HF6SEzrg@mail.gmail.com/T/#u
> >
> > Because I have not got to it yet. It can take me a week or more to
> > catch up on email. I do it in batches.
> >
> > We could enable this option always, but it is a bit risky as it
> > doesn't work on 32-bit machines unless there is an implementation
> > available.
>
> I haven't got this. It's always enabled on x86. And it seems the only
> user of it. I don't see any benefit of keeping this option.

If it is only always enabled on x86 that means it is not on anything
else. So the option (at present) compiles the physmem.c file only on
x86 and sandbox. That is the purpose of the option.

I am not sure it would cause any harm to enable it for everything, but
I'd rather just do the conversion. It's fine to look at things in a
new light when we convert options, but that sort of change can easily
be done later. The CONFIG conversion has been going on for 6 years,
partly because people don't like touching old things, partly because
people want them cleaned up...

Regards,
Simon

Applied to u-boot-dm/next, thanks!
diff mbox series

Patch

diff --git a/README b/README
index 0e37358af1c..a324f82c44c 100644
--- a/README
+++ b/README
@@ -1716,14 +1716,6 @@  The following options need to be configured:
 			HERMES, IP860, RPXlite, LWMON,
 			FLAGADM
 
-- Access to physical memory region (> 4GB)
-		Some basic support is provided for operations on memory not
-		normally accessible to U-Boot - e.g. some architectures
-		support access to more than 4GB of memory on 32-bit
-		machines using physical address extension or similar.
-		Define CONFIG_PHYSMEM to access this basic support, which
-		currently only supports clearing the memory.
-
 - Error Recovery:
 		CONFIG_NET_RETRY_COUNT
 
diff --git a/arch/Kconfig b/arch/Kconfig
index 3e2cc84ab2c..1e0e6118139 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -194,6 +194,7 @@  config SANDBOX
 	imply PHY_FIXED
 	imply DM_DSA
 	imply CMD_EXTENSION
+	imply PHYSMEM
 
 config SH
 	bool "SuperH architecture"
@@ -245,6 +246,7 @@  config X86
 	imply USB_ETHER_SMSC95XX
 	imply USB_HOST_ETHER
 	imply PCH
+	imply PHYSMEM
 	imply RTC_MC146818
 	imply ACPIGEN if !QEMU
 	imply SYSINFO if GENERATE_SMBIOS_TABLE
diff --git a/include/configs/edison.h b/include/configs/edison.h
index 3ec35db4bcf..02f33f3c29f 100644
--- a/include/configs/edison.h
+++ b/include/configs/edison.h
@@ -14,9 +14,6 @@ 
 #define CONFIG_SYS_MAXARGS	128
 #define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE
 
-/* Memory */
-#define CONFIG_PHYSMEM
-
 #define CONFIG_SYS_STACK_SIZE			(32 * 1024)
 
 #define CONFIG_SYS_MONITOR_BASE			CONFIG_SYS_TEXT_BASE
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index fd972b8c46d..d1e47ed0b61 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -18,8 +18,6 @@ 
 
 #define CONFIG_SYS_CBSIZE		1024	/* Console I/O Buffer Size */
 
-#define CONFIG_PHYSMEM
-
 /* Size of our emulated memory */
 #define SB_CONCAT(x, y) x ## y
 #define SB_TO_UL(s) SB_CONCAT(s, UL)
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 486b5ca7765..33209fad4fc 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -14,8 +14,6 @@ 
  * High Level Configuration Options
  * (easy to change)
  */
-#define CONFIG_PHYSMEM
-
 #define CONFIG_SYS_BOOTM_LEN		(16 << 20)
 
 /* SATA AHCI storage */
diff --git a/lib/Kconfig b/lib/Kconfig
index 70bf8e7a464..ccbf2e143c1 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -15,6 +15,16 @@  config SYS_NUM_ADDR_MAP
 	help
 	  Sets the number of entries in the virtual-physical mapping table.
 
+config PHYSMEM
+	bool "Access to physical memory region (> 4G)"
+	help
+	  Some basic support is provided for operations on memory not
+	  normally accessible to 32-bit U-Boot - e.g. some architectures
+	  support access to more than 4G of memory on 32-bit
+	  machines using physical address extension or similar.
+	  Enable this to access this basic support, which only supports clearing
+	  the memory.
+
 config BCH
 	bool "Enable Software based BCH ECC"
 	help
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 82a69a6c5f7..72391d4c456 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -916,7 +916,6 @@  CONFIG_PCI_SYS_BUS
 CONFIG_PCI_SYS_PHYS
 CONFIG_PCI_SYS_SIZE
 CONFIG_PEN_ADDR_BIG_ENDIAN
-CONFIG_PHYSMEM
 CONFIG_PHY_BASE_ADR
 CONFIG_PHY_ET1011C_TX_CLK_FIX
 CONFIG_PHY_ID