* [PATCH net-next 1/4] net: hns: remove cpld-ctrl-reg and add cell in the cpld-syscon property
2016-04-28 7:09 [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments Yisen Zhuang
@ 2016-04-28 7:09 ` Yisen Zhuang
2016-04-28 7:09 ` [PATCH net-next 2/4] net: hns: change port-id property to reg property in dsaf port node Yisen Zhuang
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Yisen Zhuang @ 2016-04-28 7:09 UTC (permalink / raw)
To: devicetree, netdev, linux-arm-kernel
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, davem,
will.deacon, catalin.marinas, yankejian, huangdaode, salil.mehta,
lipeng321, liguozhu, xieqianqian, xuwei5, linuxarm
Because cpld-ctrl-reg property is offset base on cpld-syscon property,
we make it as a cell in the cpld-syscon property.
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 26 ++++++++++++-----------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 1c8fdd3..210ba89 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -647,6 +647,7 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
{
struct device_node *np = mac_cb->dev->of_node;
struct regmap *syscon;
+ struct of_phandle_args cpld_args;
u32 ret;
mac_cb->link = false;
@@ -713,22 +714,23 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
mac_cb->mac_id);
}
- syscon = syscon_node_to_regmap(
- of_parse_phandle(to_of_node(mac_cb->fw_port),
- "cpld-syscon", 0));
- if (IS_ERR_OR_NULL(syscon)) {
- dev_dbg(mac_cb->dev, "no cpld-syscon found!\n");
+ ret = of_parse_phandle_with_fixed_args(to_of_node(mac_cb->fw_port),
+ "cpld-syscon", 1, 0, &cpld_args);
+ if (ret) {
+ dev_dbg(mac_cb->dev, "mac%d no cpld-syscon found.\n",
+ mac_cb->mac_id);
mac_cb->cpld_ctrl = NULL;
} else {
- mac_cb->cpld_ctrl = syscon;
- ret = fwnode_property_read_u32(mac_cb->fw_port,
- "cpld-ctrl-reg",
- &mac_cb->cpld_ctrl_reg);
- if (ret) {
- dev_err(mac_cb->dev, "get cpld-ctrl-reg fail!\n");
- return ret;
+ syscon = syscon_node_to_regmap(cpld_args.np);
+ if (IS_ERR_OR_NULL(syscon)) {
+ dev_dbg(mac_cb->dev, "no cpld-syscon found!\n");
+ mac_cb->cpld_ctrl = NULL;
+ } else {
+ mac_cb->cpld_ctrl = syscon;
+ mac_cb->cpld_ctrl_reg = cpld_args.args[0];
}
}
+
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 2/4] net: hns: change port-id property to reg property in dsaf port node
2016-04-28 7:09 [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments Yisen Zhuang
2016-04-28 7:09 ` [PATCH net-next 1/4] net: hns: remove cpld-ctrl-reg and add cell in the cpld-syscon property Yisen Zhuang
@ 2016-04-28 7:09 ` Yisen Zhuang
[not found] ` <1461827344-52230-1-git-send-email-Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-04-29 17:39 ` [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments David Miller
3 siblings, 0 replies; 9+ messages in thread
From: Yisen Zhuang @ 2016-04-28 7:09 UTC (permalink / raw)
To: devicetree, netdev, linux-arm-kernel
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, davem,
will.deacon, catalin.marinas, yankejian, huangdaode, salil.mehta,
lipeng321, liguozhu, xieqianqian, xuwei5, linuxarm
Indexes should generally be avoided. So we use reg rather than port-id to
index ports.
Signed-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 210ba89..611581f 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -834,15 +834,15 @@ int hns_mac_init(struct dsaf_device *dsaf_dev)
struct fwnode_handle *child;
device_for_each_child_node(dsaf_dev->dev, child) {
- ret = fwnode_property_read_u32(child, "port-id", &port_id);
+ ret = fwnode_property_read_u32(child, "reg", &port_id);
if (ret) {
dev_err(dsaf_dev->dev,
- "get port-id fail, ret=%d!\n", ret);
+ "get reg fail, ret=%d!\n", ret);
return ret;
}
if (port_id >= max_port_num) {
dev_err(dsaf_dev->dev,
- "port-id(%u) out of range!\n", port_id);
+ "reg(%u) out of range!\n", port_id);
return -EINVAL;
}
mac_cb = devm_kzalloc(dsaf_dev->dev, sizeof(*mac_cb),
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <1461827344-52230-1-git-send-email-Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>]
* [PATCH net-next 3/4] Documentation: Bindings: Update DT binding for hns dsaf node
[not found] ` <1461827344-52230-1-git-send-email-Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2016-04-28 7:09 ` Yisen Zhuang
2016-04-28 7:09 ` [PATCH net-next 4/4] dts: hisi: update hns dst for changing property port-id to reg Yisen Zhuang
1 sibling, 0 replies; 9+ messages in thread
From: Yisen Zhuang @ 2016-04-28 7:09 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
will.deacon-5wv7dgnIgG8, catalin.marinas-5wv7dgnIgG8,
yankejian-hv44wF8Li93QT0dZR+AlfA,
huangdaode-C8/M+/jPZTeaMJb+Lgu22Q,
salil.mehta-hv44wF8Li93QT0dZR+AlfA,
lipeng321-hv44wF8Li93QT0dZR+AlfA, liguozhu-hv44wF8Li93QT0dZR+AlfA,
xieqianqian-hv44wF8Li93QT0dZR+AlfA, xuwei5-C8/M+/jPZTeaMJb+Lgu22Q,
linuxarm-hv44wF8Li93QT0dZR+AlfA
This patch changes property port-id to reg in dsaf port node,
removes property cpld-ctrl-reg, and fixes some typos.
Signed-off-by: Yisen Zhuang <yisen.zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
.../devicetree/bindings/net/hisilicon-hns-dsaf.txt | 28 ++++++++++------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
index 5ccd4f0..d4b7f2e 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-hns-dsaf.txt
@@ -13,10 +13,10 @@ Required properties:
- interrupts: should contain the DSA Fabric and rcb interrupt.
- reg: specifies base physical address(es) and size of the device registers.
The first region is external interface control register base and size(optional,
- only be used when subctrl-syscon is not exists). It is recommended using
+ only used when subctrl-syscon does not exist). It is recommended using
subctrl-syscon rather than this address.
- The second region is SerDes base register and size(optional, only be used when
- serdes-syscon in port node is not exists. It is recommended using
+ The second region is SerDes base register and size(optional, only used when
+ serdes-syscon in port node does not exist). It is recommended using
serdes-syscon rather than this address.
The third region is the PPE register base and size.
The fourth region is dsa fabric base register and size. It is not required for
@@ -24,8 +24,8 @@ Required properties:
- reg-names: may be ppe-base and(or) dsaf-base. It is used to find the
corresponding reg's index.
-- phy-handle: phy handle of physicl port, 0 if not any phy device. It is optional
- attribute. If port node is exists, phy-handle in each port node will be used.
+- phy-handle: phy handle of physical port, 0 if not any phy device. It is optional
+ attribute. If port node exists, phy-handle in each port node will be used.
see ethernet.txt [1].
- subctrl-syscon: is syscon handle for external interface control register.
- reset-field-offset: is offset of reset field. Its value depends on the hardware
@@ -35,14 +35,12 @@ Required properties:
- port: subnodes of dsaf. A dsaf node may contain several port nodes(Depending
on mode of dsaf). Port node contain some attributes listed below:
-- port-id: is physical port index in one dsaf.
-- phy-handle: phy handle of physicl port. It is not required if there isn't
+- reg: is physical port index in one dsaf.
+- phy-handle: phy handle of physical port. It is not required if there isn't
phy device. see ethernet.txt [1].
- serdes-syscon: is syscon handle for SerDes register.
-- cpld-syscon: is syscon handle for cpld register. It is not required if there
- isn't cpld device.
-- cpld-ctrl-reg: is cpld register offset. It is not required if there isn't
- cpld-syscon.
+- cpld-syscon: is syscon handle + register offset pair for cpld register. It is
+ not required if there isn't cpld device.
- port-rst-offset: is offset of reset field for each port in dsaf. Its value
depends on the hardware user manual.
- port-mode-offset: is offset of port mode field for each port in dsaf. Its
@@ -72,14 +70,14 @@ dsaf0: dsa@c7000000 {
desc-num = <1024>;
dma-coherent;
- prot@0 {
- port-id = 0;
+ port@0 {
+ reg = 0;
phy-handle = <&phy0>;
serdes-syscon = <&serdes>;
};
- prot@1 {
- port-id = 1;
+ port@1 {
+ reg = 1;
serdes-syscon = <&serdes>;
};
};
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net-next 4/4] dts: hisi: update hns dst for changing property port-id to reg
[not found] ` <1461827344-52230-1-git-send-email-Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-04-28 7:09 ` [PATCH net-next 3/4] Documentation: Bindings: Update DT binding for hns dsaf node Yisen Zhuang
@ 2016-04-28 7:09 ` Yisen Zhuang
1 sibling, 0 replies; 9+ messages in thread
From: Yisen Zhuang @ 2016-04-28 7:09 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
will.deacon-5wv7dgnIgG8, catalin.marinas-5wv7dgnIgG8,
yankejian-hv44wF8Li93QT0dZR+AlfA,
huangdaode-C8/M+/jPZTeaMJb+Lgu22Q,
salil.mehta-hv44wF8Li93QT0dZR+AlfA,
lipeng321-hv44wF8Li93QT0dZR+AlfA, liguozhu-hv44wF8Li93QT0dZR+AlfA,
xieqianqian-hv44wF8Li93QT0dZR+AlfA, xuwei5-C8/M+/jPZTeaMJb+Lgu22Q,
linuxarm-hv44wF8Li93QT0dZR+AlfA
Indexes should generally be avoided. This patch changes property port-id
to reg in dsaf port node.
Signed-off-by: Yisen Zhuang <yisen.zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi b/arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi
index 7d62514..b6a130c 100644
--- a/arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hip05_hns.dtsi
@@ -24,6 +24,8 @@ soc0: soc@000000000 {
};
dsaf0: dsa@c7000000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
compatible = "hisilicon,hns-dsaf-v1";
mode = "6port-16rss";
interrupt-parent = <&mbigen_dsa>;
@@ -124,20 +126,20 @@ soc0: soc@000000000 {
dma-coherent;
port@0 {
- port-id = <0>;
+ reg = <0>;
serdes-syscon = <&serdes_ctrl0>;
};
port@1 {
- port-id = <1>;
+ reg = <1>;
serdes-syscon = <&serdes_ctrl0>;
};
port@4 {
- port-id = <4>;
+ reg = <4>;
phy-handle = <&soc0_phy0>;
serdes-syscon = <&serdes_ctrl1>;
};
port@5 {
- port-id = <5>;
+ reg = <5>;
phy-handle = <&soc0_phy1>;
serdes-syscon = <&serdes_ctrl1>;
};
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments
2016-04-28 7:09 [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments Yisen Zhuang
` (2 preceding siblings ...)
[not found] ` <1461827344-52230-1-git-send-email-Yisen.Zhuang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2016-04-29 17:39 ` David Miller
2016-05-03 0:54 ` Yisen Zhuang
2016-05-03 16:24 ` Rob Herring
3 siblings, 2 replies; 9+ messages in thread
From: David Miller @ 2016-04-29 17:39 UTC (permalink / raw)
To: Yisen.Zhuang
Cc: devicetree, netdev, linux-arm-kernel, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, will.deacon, catalin.marinas,
yankejian, huangdaode, salil.mehta, lipeng321, liguozhu,
xieqianqian, xuwei5, linuxarm
From: Yisen Zhuang <Yisen.Zhuang@huawei.com>
Date: Thu, 28 Apr 2016 15:09:00 +0800
> There are some inappropriate properties definition in hns DT. We update the definition
> according to Rob's review comments and fix some typos in binding.
>
> For more details, please see individual patches.
Series applied, thanks.
BTW, you reposted your 10 part series for adding the dsaf-debug device, but I
already applied the series you posted for that nearly a week ago.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments
2016-04-29 17:39 ` [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments David Miller
@ 2016-05-03 0:54 ` Yisen Zhuang
2016-05-03 16:24 ` Rob Herring
1 sibling, 0 replies; 9+ messages in thread
From: Yisen Zhuang @ 2016-05-03 0:54 UTC (permalink / raw)
To: David Miller
Cc: devicetree, netdev, linux-arm-kernel, robh+dt, pawel.moll,
mark.rutland, ijc+devicetree, galak, will.deacon, catalin.marinas,
yankejian, huangdaode, salil.mehta, lipeng321, liguozhu,
xieqianqian, xuwei5, linuxarm
Hi David,
Thanks for applying the patches.
The series which i reposted is my misoperation. Please ignore them.
Thanks,
Yisen
在 2016/4/30 1:39, David Miller 写道:
> From: Yisen Zhuang <Yisen.Zhuang@huawei.com>
> Date: Thu, 28 Apr 2016 15:09:00 +0800
>
>> There are some inappropriate properties definition in hns DT. We update the definition
>> according to Rob's review comments and fix some typos in binding.
>>
>> For more details, please see individual patches.
>
> Series applied, thanks.
>
> BTW, you reposted your 10 part series for adding the dsaf-debug device, but I
> already applied the series you posted for that nearly a week ago.
>
> .
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments
2016-04-29 17:39 ` [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments David Miller
2016-05-03 0:54 ` Yisen Zhuang
@ 2016-05-03 16:24 ` Rob Herring
2016-05-03 16:37 ` David Miller
1 sibling, 1 reply; 9+ messages in thread
From: Rob Herring @ 2016-05-03 16:24 UTC (permalink / raw)
To: David Miller
Cc: Yisen.Zhuang, devicetree, netdev, linux-arm-kernel, pawel.moll,
mark.rutland, ijc+devicetree, galak, will.deacon, catalin.marinas,
yankejian, huangdaode, salil.mehta, lipeng321, liguozhu,
xieqianqian, xuwei5, linuxarm
On Fri, Apr 29, 2016 at 01:39:49PM -0400, David Miller wrote:
> From: Yisen Zhuang <Yisen.Zhuang@huawei.com>
> Date: Thu, 28 Apr 2016 15:09:00 +0800
>
> > There are some inappropriate properties definition in hns DT. We update the definition
> > according to Rob's review comments and fix some typos in binding.
> >
> > For more details, please see individual patches.
>
> Series applied, thanks.
It would be nice to review patches addressing my comments before they
get applied. Can you please give series with DT bindings a few more days
for review before applying.
Rob
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next 0/4] net: hns: update DT properties according to Rob's comments
2016-05-03 16:24 ` Rob Herring
@ 2016-05-03 16:37 ` David Miller
0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2016-05-03 16:37 UTC (permalink / raw)
To: robh
Cc: Yisen.Zhuang, devicetree, netdev, linux-arm-kernel, pawel.moll,
mark.rutland, ijc+devicetree, galak, will.deacon, catalin.marinas,
yankejian, huangdaode, salil.mehta, lipeng321, liguozhu,
xieqianqian, xuwei5, linuxarm
From: Rob Herring <robh@kernel.org>
Date: Tue, 3 May 2016 11:24:44 -0500
> On Fri, Apr 29, 2016 at 01:39:49PM -0400, David Miller wrote:
>> From: Yisen Zhuang <Yisen.Zhuang@huawei.com>
>> Date: Thu, 28 Apr 2016 15:09:00 +0800
>>
>> > There are some inappropriate properties definition in hns DT. We update the definition
>> > according to Rob's review comments and fix some typos in binding.
>> >
>> > For more details, please see individual patches.
>>
>> Series applied, thanks.
>
> It would be nice to review patches addressing my comments before they
> get applied. Can you please give series with DT bindings a few more days
> for review before applying.
I can't go more than a day or so days, I refuse to let patches rot in
my backlog for more than that. I get sometimes a hundred new patch
submissions a day and what you are asking me to do would make maintainence
untenable for everyone, sorry.
Just be quicker on the review, then there are no problems.
^ permalink raw reply [flat|nested] 9+ messages in thread