Re: [PATCH 02/25] devicetree: bindings: scsi: HiSi SAS

zhangfei
2015-10-19T14:51:22Z

On 10/19/2015 06:48 PM, John Garry wrote:
> On 16/10/2015 14:47, Rob Herring wrote:

>>> + - reg : Address and length of the register sets for the device
>>> + - SAS controller registers
>>> + - SAS controller control registers
>>> +
>>> + - reset-reg : offset to reset, status, and clock registers in
>>> control registers
>>
>> Within the above register range? If so and if this varies, then that
>> implies there is more than 1 version of IP. In that case you should
>> have a more specific compatible string.
>>
> The registers in the second region are for syscon register offsets. See
> last note, below.
>
>> How long is this property I count 3 cells here, but the example has 5.
>> Define what each cell corresponds to specifically.
>>
> We will add all the cells to the decription, which are:
> Reset assert, clock disable, reset status, reset de-assert, and clock
> enable.
>>> +

We have switch to using syscon,
The dts has been changed to

sas_ctrl0: sas_ctrl@c0000000 {
compatible = "hisilicon,sas-ctrl", "syscon";
reg = <0x0 0xc0000000 0x0 0x10000>;
};

sas0: sas@c1000000 {
compatible = "hisilicon,sas-controller-v1";
reg = <0x0 0xc1000000 0x0 0x10000>;
hisilicon,sas-syscon = <&sas_ctrl0>;
ctrl-reg = <0xa60 0x33c 0x5a30 0xa64 0x338>;

ctrl-reg contains several regs in sas-ctrl, which need to be accessed
since some complicated requirement of the silicon.

Have considered using
hisilicon,sas-syscon = <&sas_ctrl0 0xa60 0x33c 0x5a30 0xa64 0x338>;
But of_property_read_u32_array cat not get array from index 1.
Then we have to use of_property_read_u32_index one by one.

So instead we add additional ctrl-reg, and get the array one time via
of_property_read_u32_array.

Thanks