Skip to contentSkip to conversation

i meet some surprising things,when i modify the dts file

DISCUSSION hacklu 2 participants 2 messages Jul 29, 2010

lore
Share & tools
lore

hacklu

author
#0 lore raw
 localbus@f0010100 {
                ....
                ranges = <
                                 0 0 FC000000 1000000   
                                 2 0 FA000000 1000000   
                                 1 0 70000000 1000000
                               >;
                flash@0,0{

.....
}

flash@2,0{

....
}

         board-control@1,0{
                .....
}

}

this is part of my dts files. I don't kown what each field means in the config rangs. for instance, 2 0 FA000000 1000000 .
I only konw this:
"2" is means chip selects.
"0" is what?
"Fa00000" means the start address.
"1000000" means the range of the device

but ,I got some puzzled.
when I set the two flash in the 0,1 chips select or 0,2 chips select my linux works well. and, the board-control only can be set at 1 chis select,otherwise the pci doesn't be detected.

so , what is the chips select? is it based on hardware? but my flash can use 0,1,2 chips select. or it is just set by software? but my pci devece can only work in 1 chips select.

BTW:
I also want to know how to write the dts file. I want to understand each node in the dts files. but I can't get enough documents. I have readed the linux/document/...
could you privode me some useful information?

thank you ver much~

2010-07-29

hacklu

#1 lore raw
Quoted 4 lines · hacklu

=A0localbus@f0010100=A0{ =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0.... =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0ranges=A0=3D=A0< =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0=A0=A0=A0=A0=A0=A0=A0=A00=A00=A0FC000000=A01000000

Quoted 1 line

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0=A0=A0=A0=A0=A0=A0=A0=A02=A00=A0FA000000=A01000000

Quoted 1 line

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0=A0=A0=A0=A0=A0=A0=A0=A01=A00=A070000000=A01000000

Quoted 1 line

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=

=A0=A0=A0=A0=A0=A0=A0>;

Quoted 16 lines

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0flash@0,0{

.....
}

flash@2,0{

....
}

=A0=A0=A0=A0=A0=A0=A0=A0=A0board-control@1,0{ =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ..... }

}

Quoted 8 lines

this is part of my dts files. I don't kown what each field means in the config rangs.
for instance, 2=A00=A0FA000000=A01000000=A0.
I only konw this:
"2" is means chip selects.
"0" is what?
"Fa00000" means the start address.
"1000000" means the range of the device

Ranges translates from the child address domain to the parent address domain. It consists of 3 fields; The child base address, the parent base address, and the size. In this case:

child base address :=3D 2 0 (#address-cells =3D <2> in this node) parent base address :=3D 0xfa000000 (#address-cells =3D <1> in parent node) and length =3D 0x1000000 (16MB)

For the child address, #address-cells is set to 2, meaning 1 cell for the chip select #, and 1 cell for an offset into the chip select range. In most cases the offset will be zero in a ranges property.

So in this case, the ranges property states that chip select 2 is a 16MB region mapped to base address 0xfa000000.

Quoted 6 lines

but ,I got some puzzled.
when I set the two flash in the 0,1 chips select or 0,2 chips select my linux works well.
and, the board-control only can be set at 1 chis select,otherwise the pci doesn't be detected.

Unless the bus controller hardware needs to know the chip select number for another purpose (ie. setting up a local bus DMA transfer), you could really use any number for the chip select as long as it is consistent between the child node and the ranges property.

Quoted 2 lines

so , what is the chips select? is it based on hardware?

Yes, it is based on hardware. The .dts file is describing which CS line each external device is attached to.

but my flash can use

Quoted 10 lines

0,1,2 chips select.
or it is just set by software? but my pci devece can only work in 1 chips select.

BTW:
I also want to know how to write the dts file. I want to understand each node in the dts files.
but I can't get enough documents. I have readed the linux/document/... could you privode me some useful information?

See here:

http://www.devicetree.org/Device_Tree_Usage

g.