diff mbox

[RFC,02/17] powerpc: Split up PHYS_64BIT config option to fix "select" issues

Message ID 1320883635-17194-3-git-send-email-Kyle.D.Moffett@boeing.com (mailing list archive)
State RFC
Headers show

Commit Message

Kyle Moffett Nov. 10, 2011, 12:07 a.m. UTC
The "CONFIG_PHYS_64BIT" option violates the Kconfig best-practices in
various colorful ways.  It has explicit dependencies, but it is also
"select"ed by various CPUs and platforms.  It is not set on 64-bit
systems, but it is used by a number of pieces of powerpc code to enable
or disable 64-bit physical address support.

To resolve these issues, the option has now been split into 3:

  CONFIG_PHYS_64BIT_SUPPORTED:
    This hidden option should be selected by any CPU type which supports
    64-bit physical addresses.  This will enable the PHYS_64BIT option
    to be selected.  It is (obviously) always set on PPC64.

  CONFIG_PHYS_64BIT_DT_REQUIRED:
    This hidden option should be selected by any board or platform which
    has >32-bit physical devices present in hardware.  If this is set
    then the CONFIG_PHYS_64BIT option will be forcibly enabled and
    hidden from the user.  It is (obviously) always set on PPC64.

  CONFIG_PHYS_64BIT:
    This option is user-controllable, where allowed by CPU and platform
    settings, and should never be pointed at with a "select" statement.
    Due to the values of the above two options, this is never visible on
    PPC64.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
 arch/powerpc/Kconfig                   |    4 ++--
 arch/powerpc/platforms/82xx/Kconfig    |    2 +-
 arch/powerpc/platforms/83xx/Kconfig    |    2 +-
 arch/powerpc/platforms/85xx/Kconfig    |   12 ++++++------
 arch/powerpc/platforms/86xx/Kconfig    |    1 +
 arch/powerpc/platforms/Kconfig.cputype |   25 ++++++++++++++++++-------
 6 files changed, 29 insertions(+), 17 deletions(-)

Comments

Kumar Gala Nov. 10, 2011, 1:36 p.m. UTC | #1
On Nov 9, 2011, at 6:07 PM, Kyle Moffett wrote:

> The "CONFIG_PHYS_64BIT" option violates the Kconfig best-practices in
> various colorful ways.  It has explicit dependencies, but it is also
> "select"ed by various CPUs and platforms.  It is not set on 64-bit
> systems, but it is used by a number of pieces of powerpc code to enable
> or disable 64-bit physical address support.
> 
> To resolve these issues, the option has now been split into 3:
> 
>  CONFIG_PHYS_64BIT_SUPPORTED:
>    This hidden option should be selected by any CPU type which supports
>    64-bit physical addresses.  This will enable the PHYS_64BIT option
>    to be selected.  It is (obviously) always set on PPC64.
> 
>  CONFIG_PHYS_64BIT_DT_REQUIRED:
>    This hidden option should be selected by any board or platform which
>    has >32-bit physical devices present in hardware.  If this is set
>    then the CONFIG_PHYS_64BIT option will be forcibly enabled and
>    hidden from the user.  It is (obviously) always set on PPC64.
> 
>  CONFIG_PHYS_64BIT:
>    This option is user-controllable, where allowed by CPU and platform
>    settings, and should never be pointed at with a "select" statement.
>    Due to the values of the above two options, this is never visible on
>    PPC64.
> 
> Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
> ---
> arch/powerpc/Kconfig                   |    4 ++--
> arch/powerpc/platforms/82xx/Kconfig    |    2 +-
> arch/powerpc/platforms/83xx/Kconfig    |    2 +-
> arch/powerpc/platforms/85xx/Kconfig    |   12 ++++++------
> arch/powerpc/platforms/86xx/Kconfig    |    1 +
> arch/powerpc/platforms/Kconfig.cputype |   25 ++++++++++++++++++-------
> 6 files changed, 29 insertions(+), 17 deletions(-)

I don't really see what this gets us and don't think we should make this change.

- k

> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index b177caa..27e31c5 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -18,10 +18,10 @@ config WORD_SIZE
> 	default 32 if !PPC64
> 
> config ARCH_PHYS_ADDR_T_64BIT
> -       def_bool PPC64 || PHYS_64BIT
> +	def_bool PHYS_64BIT
> 
> config ARCH_DMA_ADDR_T_64BIT
> -	def_bool ARCH_PHYS_ADDR_T_64BIT
> +	def_bool PHYS_64BIT
> 
> config MMU
> 	bool
> diff --git a/arch/powerpc/platforms/82xx/Kconfig b/arch/powerpc/platforms/82xx/Kconfig
> index 7c7df40..849d403 100644
> --- a/arch/powerpc/platforms/82xx/Kconfig
> +++ b/arch/powerpc/platforms/82xx/Kconfig
> @@ -1,6 +1,6 @@
> menuconfig PPC_82xx
> 	bool "82xx-based boards (PQ II)"
> -	depends on 6xx
> +	depends on 6xx && !PHYS_64BIT
> 
> if PPC_82xx
> 
> diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig
> index 670a033..1ed8877 100644
> --- a/arch/powerpc/platforms/83xx/Kconfig
> +++ b/arch/powerpc/platforms/83xx/Kconfig
> @@ -1,6 +1,6 @@
> menuconfig PPC_83xx
> 	bool "83xx-based boards"
> -	depends on 6xx
> +	depends on 6xx && !PHYS_64BIT
> 	select PPC_UDBG_16550
> 	select PPC_PCI_CHOICE
> 	select FSL_PCI if PCI
> diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
> index 9088381..37f9de7 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -80,7 +80,7 @@ config P1010_RDB
> config P1022_DS
> 	bool "Freescale P1022 DS"
> 	select DEFAULT_UIMAGE
> -	select PHYS_64BIT	# The DTS has 36-bit addresses
> +	select PHYS_64BIT_DT_REQUIRED # The DTS has 36-bit addresses
> 	select SWIOTLB
> 	help
> 	  This option enables support for the Freescale P1022DS reference board.
> @@ -175,7 +175,7 @@ config P2041_RDB
> 	bool "Freescale P2041 RDB"
> 	select DEFAULT_UIMAGE
> 	select PPC_E500MC
> -	select PHYS_64BIT
> +	select PHYS_64BIT_DT_REQUIRED
> 	select SWIOTLB
> 	select ARCH_REQUIRE_GPIOLIB
> 	select GPIO_MPC8XXX
> @@ -189,7 +189,7 @@ config P3041_DS
> 	bool "Freescale P3041 DS"
> 	select DEFAULT_UIMAGE
> 	select PPC_E500MC
> -	select PHYS_64BIT
> +	select PHYS_64BIT_DT_REQUIRED
> 	select SWIOTLB
> 	select ARCH_REQUIRE_GPIOLIB
> 	select GPIO_MPC8XXX
> @@ -203,7 +203,7 @@ config P3060_QDS
> 	bool "Freescale P3060 QDS"
> 	select DEFAULT_UIMAGE
> 	select PPC_E500MC
> -	select PHYS_64BIT
> +	select PHYS_64BIT_DT_REQUIRED
> 	select SWIOTLB
> 	select MPC8xxx_GPIO
> 	select HAS_RAPIDIO
> @@ -216,7 +216,7 @@ config P4080_DS
> 	bool "Freescale P4080 DS"
> 	select DEFAULT_UIMAGE
> 	select PPC_E500MC
> -	select PHYS_64BIT
> +	select PHYS_64BIT_DT_REQUIRED
> 	select SWIOTLB
> 	select ARCH_REQUIRE_GPIOLIB
> 	select GPIO_MPC8XXX
> @@ -233,7 +233,7 @@ config P5020_DS
> 	select DEFAULT_UIMAGE
> 	select E500
> 	select PPC_E500MC
> -	select PHYS_64BIT
> +	select PHYS_64BIT_DT_REQUIRED
> 	select SWIOTLB
> 	select ARCH_REQUIRE_GPIOLIB
> 	select GPIO_MPC8XXX
> diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
> index 8d6599d..576eb43 100644
> --- a/arch/powerpc/platforms/86xx/Kconfig
> +++ b/arch/powerpc/platforms/86xx/Kconfig
> @@ -5,6 +5,7 @@ menuconfig PPC_86xx
> 	select FSL_SOC
> 	select ALTIVEC
> 	select ARCH_WANT_OPTIONAL_GPIOLIB
> +	select PHYS_64BIT_SUPPORTED
> 	help
> 	  The Freescale E600 SoCs have 74xx cores.
> 
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index 9210e94..0ab01b0 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -26,6 +26,7 @@ config PPC_BOOK3S_32
> 
> config PPC_85xx
> 	bool "Freescale 85xx"
> +	select PHYS_64BIT_SUPPORTED
> 	select E500
> 
> config PPC_8xx
> @@ -47,7 +48,8 @@ config 44x
> 	select PPC_UDBG_16550
> 	select 4xx_SOC
> 	select PPC_PCI_CHOICE
> -	select PHYS_64BIT
> +	select PHYS_64BIT_SUPPORTED
> +	select PHYS_64BIT_DT_REQUIRED
> 
> config E200
> 	bool "Freescale e200"
> @@ -187,14 +189,20 @@ config PPC_FSL_BOOK3E
> 	select PPC_SMP_MUXED_IPI
> 	default y if FSL_BOOKE
> 
> -config PTE_64BIT
> -	bool
> -	depends on 44x || E500 || PPC_86xx
> -	default y if PHYS_64BIT
> +## Only some 32-bit CPUs support 64-bit physical addresses
> +config PHYS_64BIT_SUPPORTED
> +	def_bool PPC64
> +
> +## Some 32-bit system device trees have >32-bit physical addresses, and so
> +## the kernel won't boot unless those are supported.
> +config PHYS_64BIT_DT_REQUIRED
> +	def_bool PPC64
> 
> +## DO NOT "select" this user-visible symbol, select the two above instead!
> config PHYS_64BIT
> -	bool 'Large physical address support' if E500 || PPC_86xx
> -	depends on (44x || E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx
> +	def_bool PHYS_64BIT_DT_REQUIRED
> +	prompt 'Large physical address support' if !PHYS_64BIT_DT_REQUIRED
> +	depends on PHYS_64BIT_SUPPORTED
> 	---help---
> 	  This option enables kernel support for larger than 32-bit physical
> 	  addresses.  This feature may not be available on all cores.
> @@ -205,6 +213,9 @@ config PHYS_64BIT
> 
> 	  If in doubt, say N here.
> 
> +config PTE_64BIT
> +	def_bool PHYS_64BIT
> +
> config ALTIVEC
> 	bool "AltiVec Support"
> 	depends on 6xx || POWER4
> -- 
> 1.7.2.5
Timur Tabi Nov. 10, 2011, 2:04 p.m. UTC | #2
Kyle Moffett wrote:
>   CONFIG_PHYS_64BIT_SUPPORTED:
>     This hidden option should be selected by any CPU type which supports
>     64-bit physical addresses.  This will enable the PHYS_64BIT option
>     to be selected.  It is (obviously) always set on PPC64.
> 
>   CONFIG_PHYS_64BIT_DT_REQUIRED:
>     This hidden option should be selected by any board or platform which
>     has >32-bit physical devices present in hardware.  If this is set
>     then the CONFIG_PHYS_64BIT option will be forcibly enabled and
>     hidden from the user.  It is (obviously) always set on PPC64.
> 
>   CONFIG_PHYS_64BIT:
>     This option is user-controllable, where allowed by CPU and platform
>     settings, and should never be pointed at with a "select" statement.
>     Due to the values of the above two options, this is never visible on
>     PPC64.

I'm with Kumar on this.  I don't see the point of making it so complicated.  No kernel should ever have to care with a DT is 64-bit or 32-bit.  If you build a kernel with 64-bit phys support, then it will work with any DT.

U-Boot already warns you if the DT and the actual physical addresses of the devices don't match.

There are only two reasons to create a 32-bit kernel:

1) A small performance improvement on systems with 2GB or less.
2) Some SOC devices only support 32-bit physical addresses, so the easiest way to ensure a compatible address is to prohibit memory above 4GB.

Item #2 is not something that we really worry about.  It's only a real problem on true 64-bit kernels, and in those cases, we cannot build a kernel with 32-bit phys support, so the driver needs to handle it internally.
Kyle Moffett Nov. 10, 2011, 4:31 p.m. UTC | #3
On Nov 10, 2011, at 09:04, Timur Tabi wrote:
> Kyle Moffett wrote:
>>  CONFIG_PHYS_64BIT_SUPPORTED:
>>    This hidden option should be selected by any CPU type which supports
>>    64-bit physical addresses.  This will enable the PHYS_64BIT option
>>    to be selected.  It is (obviously) always set on PPC64.
>> 
>>  CONFIG_PHYS_64BIT_DT_REQUIRED:
>>    This hidden option should be selected by any board or platform which
>>    has >32-bit physical devices present in hardware.  If this is set
>>    then the CONFIG_PHYS_64BIT option will be forcibly enabled and
>>    hidden from the user.  It is (obviously) always set on PPC64.
>> 
>>  CONFIG_PHYS_64BIT:
>>    This option is user-controllable, where allowed by CPU and platform
>>    settings, and should never be pointed at with a "select" statement.
>>    Due to the values of the above two options, this is never visible on
>>    PPC64.
> 
> I'm with Kumar on this.  I don't see the point of making it so complicated.

Did you look at the existing code?  It's already that complicated:

config ARCH_PHYS_ADDR_T_64BIT
	def_bool PPC64 || PHYS_64BIT

config ARCH_DMA_ADDR_T_64BIT
	def_bool ARCH_PHYS_ADDR_T_64BIT

config {P1022_DS,P2041_RDB,P3041_DS,P3060_QDS,P4080_DS,P5020_DS}
	select PHYS_64BIT

config 44x
	select PHYS_64BIT

config PTE_64BIT
	bool
	depends on 44x || E500 || PPC_86xx
	default y if PHYS_64BIT

config PHYS_64BIT
	bool 'Large physical address support' if E500 || PPC_86xx
	depends on (44x || E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx

Even worse, PHYS_64BIT is not set on 64-bit processors, but there is
a lot of driver code that seems to assume PHYS_64BIT indicates the
size of "phys_addr_t".

> No kernel should ever have to care with a DT is 64-bit or 32-bit.  If
> you build a kernel with 64-bit phys support, then it will work with
> any DT.
> 

> U-Boot already warns you if the DT and the actual physical addresses
> of the devices don't match.

The big issue is that the Kconfig docs are very clear that "select"
should not be used on user-visible options (AKA: PHYS_64BIT), and yet
half the PPC_85xx boards have this tidbit:
	select PHYS_64BIT # The DTS has 36-bit addresses

I'm totally OK with removing that from all those boards, but to preserve
the existing behavior (also used by the entire 44x platform) I added the
new config symbol PHYS_64BIT_DT_REQUIRED, which is used to control
whether or not the "PHYS_64BIT" option is even visible to the user.

I originally called it "PHYS_64BIT_REQUIRED", but since all of the
board comments talked about 36-bit DTS addresses, I added the _DT_.


> There are only two reasons to create a 32-bit kernel:
> 
> 1) A small performance improvement on systems with 2GB or less.
> 2) Some SOC devices only support 32-bit physical addresses, so the
> easiest way to ensure a compatible address is to prohibit memory above
> 4GB.

If this is true, then why does PHYS_64BIT have that big ugly list of
dependencies right now?  I don't know about the other platforms well
enough to tell what would break by enabling PHYS_64BIT, but I assume
that something in the past caused that dependency list.

Cheers,
Kyle Moffett

--
Curious about my work on the Debian powerpcspe port?
I'm keeping a blog here: http://pureperl.blogspot.com/
Timur Tabi Nov. 10, 2011, 4:50 p.m. UTC | #4
Moffett, Kyle D wrote:

> Did you look at the existing code?  It's already that complicated:
> 
> config ARCH_PHYS_ADDR_T_64BIT
> 	def_bool PPC64 || PHYS_64BIT

I never understood why we have PHYS_64BIT and ARCH_PHYS_ADDR_T_64BIT, since they mean the same thing.  

> config ARCH_DMA_ADDR_T_64BIT
> 	def_bool ARCH_PHYS_ADDR_T_64BIT
> 
> config {P1022_DS,P2041_RDB,P3041_DS,P3060_QDS,P4080_DS,P5020_DS}
> 	select PHYS_64BIT

I posted a patch to remove the P1022_DS version of this.  I'm in favor of removing it from the other boards and letting the defconfig define it, but Kumar nak'd that idea.

> config PTE_64BIT
> 	bool
> 	depends on 44x || E500 || PPC_86xx
> 	default y if PHYS_64BIT

I think this one is about how our TLB registers look, and it's not related to anything else.

> Even worse, PHYS_64BIT is not set on 64-bit processors, but there is
> a lot of driver code that seems to assume PHYS_64BIT indicates the
> size of "phys_addr_t".

There's a Kconfig option somewhere that takes care of this.

> The big issue is that the Kconfig docs are very clear that "select"
> should not be used on user-visible options (AKA: PHYS_64BIT), and yet
> half the PPC_85xx boards have this tidbit:
> 	select PHYS_64BIT # The DTS has 36-bit addresses

I'm not sure that Kconfig rule is enforceable.  We use 'select' all the time to make sure that our boards enable the options that need to be enabled.  I'd rather see this:

config X
	select A

config Y
	select A

config Z
	select A

than this:

config A
	default y if X | Y | Z

The former is more maintainable and does not allow the option of disabling "A" if someone wants "X".

> I'm totally OK with removing that from all those boards, but to preserve
> the existing behavior (also used by the entire 44x platform) I added the
> new config symbol PHYS_64BIT_DT_REQUIRED, which is used to control
> whether or not the "PHYS_64BIT" option is even visible to the user.
> 
> I originally called it "PHYS_64BIT_REQUIRED", but since all of the
> board comments talked about 36-bit DTS addresses, I added the _DT_.

They're really 64-bit DTS addresses.  The 36 bit is just a hardware quirk of our SOCs.  From the kernel's perspective, there's no difference between 36-bit and 64-bit physical address.

>> There are only two reasons to create a 32-bit kernel:
>>
>> 1) A small performance improvement on systems with 2GB or less.
>> 2) Some SOC devices only support 32-bit physical addresses, so the
>> easiest way to ensure a compatible address is to prohibit memory above
>> 4GB.
> 
> If this is true, then why does PHYS_64BIT have that big ugly list of
> dependencies right now? 

Because Kumar doesn't want to allow 32-bit kernels on our high-end parts.  Like I said, I'm not a fan of that decision.

> I don't know about the other platforms well
> enough to tell what would break by enabling PHYS_64BIT, but I assume
> that something in the past caused that dependency list.

It's just an arbitrary decision.  We don't ship 32-bit DTs for the P4080-class parts, and we don't have a U-Boot configuration option for building a 32-bit compatible U-Boot.
Benjamin Herrenschmidt Nov. 11, 2011, 4:50 a.m. UTC | #5
On Thu, 2011-11-10 at 10:50 -0600, Timur Tabi wrote:

> I'm not sure that Kconfig rule is enforceable.  We use 'select' all the time to make sure that our boards enable the options that need to be enabled.  I'd rather see this:
> 
> config X
> 	select A
> 
> config Y
> 	select A
> 
> config Z
> 	select A
> 
> than this:
> 
> config A
> 	default y if X | Y | Z
> 
> The former is more maintainable and does not allow the option of disabling "A" if someone wants "X".

This is fine as long as config A is not a user selectable option.

We do the wrong thing in a few places (i2c comes to mind) and we should
most certainly consider fixing it. Some of the solution is to move some
select's to defconfigs, some is to do things the way Kyle proposed.

For PHYS_64BIT, I'm not 100% certain at this point what the best
approach it. It should clearly be fixed and hidden for real 64-bit. As
for the rest, should it be user selectable ? I tend to think it should
be fixed & selected by the board config and keep it that way, avoiding
the user question entirely... but you may have good reasons to want to
keep it around.

Cheers,
Ben.
Tabi Timur-B04825 Nov. 11, 2011, 1:12 p.m. UTC | #6
Benjamin Herrenschmidt wrote:

> For PHYS_64BIT, I'm not 100% certain at this point what the best
> approach it. It should clearly be fixed and hidden for real 64-bit. As
> for the rest, should it be user selectable ?

I have been unable to convince our BSP teams that the minor performance 
improvement of a 32-bit kernel vs 36-bit is not worth the hassle.  We ship 
a lot of lower-end e500 systems that will never have more than 2GB of memory.

The P1022DS is an example.  We ship 32-bit and 36-bit versions of U-Boot, 
the kernel, and the device tree.  I recently added code to U-boot to 
detect if you have a mismatched U-Boot and device tree, because it is so 
easy to mess that up.  I would like nothing more than to abandon 32-bit 
for all e500, but I don't see Freescale allowing that any time soon.
diff mbox

Patch

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b177caa..27e31c5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -18,10 +18,10 @@  config WORD_SIZE
 	default 32 if !PPC64
 
 config ARCH_PHYS_ADDR_T_64BIT
-       def_bool PPC64 || PHYS_64BIT
+	def_bool PHYS_64BIT
 
 config ARCH_DMA_ADDR_T_64BIT
-	def_bool ARCH_PHYS_ADDR_T_64BIT
+	def_bool PHYS_64BIT
 
 config MMU
 	bool
diff --git a/arch/powerpc/platforms/82xx/Kconfig b/arch/powerpc/platforms/82xx/Kconfig
index 7c7df40..849d403 100644
--- a/arch/powerpc/platforms/82xx/Kconfig
+++ b/arch/powerpc/platforms/82xx/Kconfig
@@ -1,6 +1,6 @@ 
 menuconfig PPC_82xx
 	bool "82xx-based boards (PQ II)"
-	depends on 6xx
+	depends on 6xx && !PHYS_64BIT
 
 if PPC_82xx
 
diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig
index 670a033..1ed8877 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -1,6 +1,6 @@ 
 menuconfig PPC_83xx
 	bool "83xx-based boards"
-	depends on 6xx
+	depends on 6xx && !PHYS_64BIT
 	select PPC_UDBG_16550
 	select PPC_PCI_CHOICE
 	select FSL_PCI if PCI
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 9088381..37f9de7 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -80,7 +80,7 @@  config P1010_RDB
 config P1022_DS
 	bool "Freescale P1022 DS"
 	select DEFAULT_UIMAGE
-	select PHYS_64BIT	# The DTS has 36-bit addresses
+	select PHYS_64BIT_DT_REQUIRED # The DTS has 36-bit addresses
 	select SWIOTLB
 	help
 	  This option enables support for the Freescale P1022DS reference board.
@@ -175,7 +175,7 @@  config P2041_RDB
 	bool "Freescale P2041 RDB"
 	select DEFAULT_UIMAGE
 	select PPC_E500MC
-	select PHYS_64BIT
+	select PHYS_64BIT_DT_REQUIRED
 	select SWIOTLB
 	select ARCH_REQUIRE_GPIOLIB
 	select GPIO_MPC8XXX
@@ -189,7 +189,7 @@  config P3041_DS
 	bool "Freescale P3041 DS"
 	select DEFAULT_UIMAGE
 	select PPC_E500MC
-	select PHYS_64BIT
+	select PHYS_64BIT_DT_REQUIRED
 	select SWIOTLB
 	select ARCH_REQUIRE_GPIOLIB
 	select GPIO_MPC8XXX
@@ -203,7 +203,7 @@  config P3060_QDS
 	bool "Freescale P3060 QDS"
 	select DEFAULT_UIMAGE
 	select PPC_E500MC
-	select PHYS_64BIT
+	select PHYS_64BIT_DT_REQUIRED
 	select SWIOTLB
 	select MPC8xxx_GPIO
 	select HAS_RAPIDIO
@@ -216,7 +216,7 @@  config P4080_DS
 	bool "Freescale P4080 DS"
 	select DEFAULT_UIMAGE
 	select PPC_E500MC
-	select PHYS_64BIT
+	select PHYS_64BIT_DT_REQUIRED
 	select SWIOTLB
 	select ARCH_REQUIRE_GPIOLIB
 	select GPIO_MPC8XXX
@@ -233,7 +233,7 @@  config P5020_DS
 	select DEFAULT_UIMAGE
 	select E500
 	select PPC_E500MC
-	select PHYS_64BIT
+	select PHYS_64BIT_DT_REQUIRED
 	select SWIOTLB
 	select ARCH_REQUIRE_GPIOLIB
 	select GPIO_MPC8XXX
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 8d6599d..576eb43 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -5,6 +5,7 @@  menuconfig PPC_86xx
 	select FSL_SOC
 	select ALTIVEC
 	select ARCH_WANT_OPTIONAL_GPIOLIB
+	select PHYS_64BIT_SUPPORTED
 	help
 	  The Freescale E600 SoCs have 74xx cores.
 
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 9210e94..0ab01b0 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -26,6 +26,7 @@  config PPC_BOOK3S_32
 
 config PPC_85xx
 	bool "Freescale 85xx"
+	select PHYS_64BIT_SUPPORTED
 	select E500
 
 config PPC_8xx
@@ -47,7 +48,8 @@  config 44x
 	select PPC_UDBG_16550
 	select 4xx_SOC
 	select PPC_PCI_CHOICE
-	select PHYS_64BIT
+	select PHYS_64BIT_SUPPORTED
+	select PHYS_64BIT_DT_REQUIRED
 
 config E200
 	bool "Freescale e200"
@@ -187,14 +189,20 @@  config PPC_FSL_BOOK3E
 	select PPC_SMP_MUXED_IPI
 	default y if FSL_BOOKE
 
-config PTE_64BIT
-	bool
-	depends on 44x || E500 || PPC_86xx
-	default y if PHYS_64BIT
+## Only some 32-bit CPUs support 64-bit physical addresses
+config PHYS_64BIT_SUPPORTED
+	def_bool PPC64
+
+## Some 32-bit system device trees have >32-bit physical addresses, and so
+## the kernel won't boot unless those are supported.
+config PHYS_64BIT_DT_REQUIRED
+	def_bool PPC64
 
+## DO NOT "select" this user-visible symbol, select the two above instead!
 config PHYS_64BIT
-	bool 'Large physical address support' if E500 || PPC_86xx
-	depends on (44x || E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx
+	def_bool PHYS_64BIT_DT_REQUIRED
+	prompt 'Large physical address support' if !PHYS_64BIT_DT_REQUIRED
+	depends on PHYS_64BIT_SUPPORTED
 	---help---
 	  This option enables kernel support for larger than 32-bit physical
 	  addresses.  This feature may not be available on all cores.
@@ -205,6 +213,9 @@  config PHYS_64BIT
 
 	  If in doubt, say N here.
 
+config PTE_64BIT
+	def_bool PHYS_64BIT
+
 config ALTIVEC
 	bool "AltiVec Support"
 	depends on 6xx || POWER4