How to change PCI memory size

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

How to change PCI memory size

Jump to solution
4,028 Views
muaxi8
Contributor V

 1) How to change PCI memory size ? 

2)  How to explain the parameters of the device tree "ranges" node?

pcie@3400000 {
compatible = "fsl,lx2160a-pcie";
reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */
0x80 0x00000000 0x0 0x00001000>; /* configuration space */
.....
interrupt-names = "aer", "pme", "intr";
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
dma-coherent;
apio-wins = <8>;
ppio-wins = <8>;
bus-range = <0x0 0xff>;
ranges = <0x82000000 0x0 0x40000000 0x80 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
 
status = "disabled";
};

0 Kudos
Reply
1 Solution
4,005 Views
yipingwang
NXP TechSupport
NXP TechSupport

The first value is the property bitfield of this memory region, 0x82000000 specify a non-prefetchable 64-bit memory space.

The second and third values 0x0 0x40000000 are the high and low parts of the 64-bit PCI address to be mapped in, since the high part is 0, the actual address is 0x40000000 .

The fourth and fifth values 0x80 0x40000000 are high and low parts of the CPU's bus to map the segment of the PCI bus into. It is 64-bits on a 64-bit processor.

The sixth and seventh values 0x0 0x40000000 specify the size of the segment to map in. In this case a 1G segment.

For example, if you want to change PCI memory size to 2G, you need to do the following modification.

ranges = <0x82000000 0x0 0x40000000 0x80 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */

modify to:

ranges = <0x82000000 0x0 0x80000000 0x80 0x80000000 0x0 0x80000000>; /* non-prefetchable memory */

View solution in original post

0 Kudos
Reply
4 Replies
4,006 Views
yipingwang
NXP TechSupport
NXP TechSupport

The first value is the property bitfield of this memory region, 0x82000000 specify a non-prefetchable 64-bit memory space.

The second and third values 0x0 0x40000000 are the high and low parts of the 64-bit PCI address to be mapped in, since the high part is 0, the actual address is 0x40000000 .

The fourth and fifth values 0x80 0x40000000 are high and low parts of the CPU's bus to map the segment of the PCI bus into. It is 64-bits on a 64-bit processor.

The sixth and seventh values 0x0 0x40000000 specify the size of the segment to map in. In this case a 1G segment.

For example, if you want to change PCI memory size to 2G, you need to do the following modification.

ranges = <0x82000000 0x0 0x40000000 0x80 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */

modify to:

ranges = <0x82000000 0x0 0x80000000 0x80 0x80000000 0x0 0x80000000>; /* non-prefetchable memory */

0 Kudos
Reply
4,003 Views
muaxi8
Contributor V

Does it have to be at least 1G ?

My problem now is that it might allocate too much memory, , and I want to make it smaller,if I want to change it to 256M,

modify to:

ranges = <0x82000000 0x0 0x10000000 0x80 0x10000000 0x0 0x10000000>; /* non-prefetchable memory */

 

it is ok?

0 Kudos
Reply
3,985 Views
yipingwang
NXP TechSupport
NXP TechSupport

It's OK to change it to 256M.

0 Kudos
Reply
3,978 Views
muaxi8
Contributor V

My RC mode is configured as shown below, So my driver should use "/drivers/pci/controller/DWC/pci-layerscapc.c",  But there is no information about "fsl, LX2160A-pcie" in the driver code;

muaxi8_0-1639467961676.png

muaxi8_1-1639468259635.png

 

 

0 Kudos
Reply