device tree with variable number of cpu

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

device tree with variable number of cpu

3,685 Views
niklasmolin
Senior Contributor I

Hi.

If I have an image I want to be able to run in either IMX6Q (4 cores) or IMX6D (2 cores).

Is there a way for the Linux kernel to adjust after number of cores the CPU has or do I need to compile to different images?

In the device tree (for SabreSD there is some configurations for the CPUs, imx6q.dtsi):

cpus {

  #address-cells = <1>;

  #size-cells = <0>;

  cpu0: cpu@0 {

  compatible = "arm,cortex-a9";

  device_type = "cpu";

  reg = <0>;

  next-level-cache = <&L2>;

  operating-points = <

  /* kHz    uV */

  1200000 1275000

  996000  1250000

  852000  1250000

  792000  1150000

  396000  975000

  >;

  fsl,soc-operating-points = <

  /* ARM kHz  SOC-PU uV */

  1200000       1275000

  996000        1250000

  852000        1250000

  792000        1175000

  396000        1175000

  >;

  clock-latency = <61036>; /* two CLK32 periods */

  clocks = <&clks 104>, <&clks 6>, <&clks 16>,

  <&clks 17>, <&clks 170>;

  clock-names = "arm", "pll2_pfd2_396m", "step",

       "pll1_sw", "pll1_sys";

  arm-supply = <&reg_arm>;

  pu-supply = <&reg_pu>;

  soc-supply = <&reg_soc>;

  };

  cpu@1 {

  compatible = "arm,cortex-a9";

  device_type = "cpu";

  reg = <1>;

  next-level-cache = <&L2>;

  };

  cpu@2 {

  compatible = "arm,cortex-a9";

  device_type = "cpu";

  reg = <2>;

  next-level-cache = <&L2>;

  };

  cpu@3 {

  compatible = "arm,cortex-a9";

  device_type = "cpu";

  reg = <3>;

  next-level-cache = <&L2>;

  };

};

Thanks,

Niklas

Labels (3)
0 Kudos
Reply
5 Replies

3,224 Views
SergioSolis
NXP Employee
NXP Employee

Hello Niklas,

Are you referring to have the ability to disable/enable cores "on the fly"?

0 Kudos
Reply

3,224 Views
niklasmolin
Senior Contributor I

Hi Sergio.

It's more to not have to recompile the linux image if I want to run it on a both a IMX6Q and IMX6D.

I haven't tried to see what happens if I compile it for 4 CPUs and run it on a IMX6D.

0 Kudos
Reply

3,224 Views
gfine
NXP Employee
NXP Employee

Hi Niklas,

You'd be better off adding 'maxcpus=' to the kernel command line in u-boot.  No recompiling necessary.

Cheers,

Glen

0 Kudos
Reply

3,224 Views
niklasmolin
Senior Contributor I

Hi Glen.

Thanks for the information.

I should have a check in the u-boot which type of CPU it is and then just set the maxcpus= when I start kernel.

0 Kudos
Reply

3,224 Views
gfine
NXP Employee
NXP Employee

Hi Niklas,

I think the code isalready there as u-boot.imx is usable across most of the i.MX6 series (except 6Solo).  So there may not even be a need to use maxcpus.  Only use maxcpus if you need a 6Q to act like a 6D.

Your initial question was if there was a way to do this without recompiling the kernel or the device tree, and that is what the 'maxcpus' kernel command is usually used for. Otherwise u-boot.imx should suffice.

Cheers,

Glen

0 Kudos
Reply