of device trees and powerpcs and low memory

Robert P. J. Day rpjday at crashcourse.ca
Mon Apr 18 06:20:40 EDT 2016


  a question about device trees for those (probably numerous) members
of this list that know more about them than i do.

  recently, was given the following patch to be applied to a device
tree source file for a fairly elderly (MPC83xx-based) powerpc platform
that has 1G of RAM:

        memory {
                device_type = "memory";
                linux,phandle = <300>;
-               reg = <0x00000000 0x40000000>;
+               reg = <0x00000000 0x20000000>;
        };


i was puzzled by the change that now seemed to define 512M of RAM
instead of the full 1G. the explanation i was given is that that is
how one defines where kernel low memory ends, thereby leaving the
remaining 512M for high memory in kernel space.

  that's the first i ever heard of that. is it true? and if it is,
where in the kernel source code can i see that information being
processed and low memory being established based on reading that node
from the DTB?

  in any event, i'd never heard this before -- if i was going to
define low memory on a powerpc, i would think the proper way is to use
this snippet from arch/powerpc/Kconfig:

  menu "Advanced setup"
        depends on PPC32

  config ADVANCED_OPTIONS
        bool "Prompt for advanced kernel configuration options"
        help
          This option will enable prompting for a variety of advanced kernel
          configuration options.  These options can cause the kernel to not
          work if they are set incorrectly, but can be used to optimize certain
          aspects of kernel memory management.

          Unless you know what you are doing, say N here.

  comment "Default settings for advanced configuration options are used"
        depends on !ADVANCED_OPTIONS

  config LOWMEM_SIZE_BOOL
        bool "Set maximum low memory"
        depends on ADVANCED_OPTIONS
        help
          This option allows you to set the maximum amount of memory which
          will be used as "low memory", that is, memory which the kernel can
          access directly, without having to set up a kernel virtual mapping.
          This can be useful in optimizing the layout of kernel virtual
          memory.

          Say N here unless you know what you are doing.

  config LOWMEM_SIZE
        hex "Maximum low memory size (in bytes)" if LOWMEM_SIZE_BOOL
        default "0x30000000"


thoughts? i thought i understood device trees reasonably well, but i
had never heard of this alleged configuration.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the Kernelnewbies mailing list