diff mbox

[1/6] ARM: dts: hix5hd2: add gmac node

Message ID 1409143114-23311-2-git-send-email-zhangfei.gao@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Zhangfei Gao Aug. 27, 2014, 12:38 p.m. UTC
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
 arch/arm/boot/dts/hisi-x5hd2-dkb.dts |   26 ++++++++++++++++++++++++++
 arch/arm/boot/dts/hisi-x5hd2.dtsi    |   16 ++++++++++++++++
 2 files changed, 42 insertions(+)

Comments

Mark Rutland Aug. 27, 2014, 2:54 p.m. UTC | #1
On Wed, Aug 27, 2014 at 01:38:29PM +0100, Zhangfei Gao wrote:
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> ---
>  arch/arm/boot/dts/hisi-x5hd2-dkb.dts |   26 ++++++++++++++++++++++++++
>  arch/arm/boot/dts/hisi-x5hd2.dtsi    |   16 ++++++++++++++++
>  2 files changed, 42 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
> index 05b44c2..0344de0 100644
> --- a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
> +++ b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
> @@ -51,3 +51,29 @@
>  &uart0 {
>  	status = "okay";
>  };
> +
> +&gmac0 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	phy-handle = <&phy2>;
> +	phy-mode = "mii";
> +	mac-address = [00 00 00 00 00 00];

If this is just so space is pre-allocated for the bootloader to patch
this, please place a comment to that effect.

Otherwise that doesn't look right.

Mark.
Zhangfei Gao Aug. 27, 2014, 3:01 p.m. UTC | #2
On 08/27/2014 10:54 PM, Mark Rutland wrote:
> On Wed, Aug 27, 2014 at 01:38:29PM +0100, Zhangfei Gao wrote:
>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>> ---
>>   arch/arm/boot/dts/hisi-x5hd2-dkb.dts |   26 ++++++++++++++++++++++++++
>>   arch/arm/boot/dts/hisi-x5hd2.dtsi    |   16 ++++++++++++++++
>>   2 files changed, 42 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
>> index 05b44c2..0344de0 100644
>> --- a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
>> +++ b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
>> @@ -51,3 +51,29 @@
>>   &uart0 {
>>   	status = "okay";
>>   };
>> +
>> +&gmac0 {
>> +	#address-cells = <1>;
>> +	#size-cells = <0>;
>> +	phy-handle = <&phy2>;
>> +	phy-mode = "mii";
>> +	mac-address = [00 00 00 00 00 00];
>
> If this is just so space is pre-allocated for the bootloader to patch
> this, please place a comment to that effect.
>
> Otherwise that doesn't look right.

Yes, it is placeholder, bootloader will overwrite field.

Also net driver will use random address if if not valid addr.
if (!is_valid_ether_addr(ndev->dev_addr))
	eth_hw_addr_random(ndev);	

Thanks
Mark Rutland Aug. 27, 2014, 3:04 p.m. UTC | #3
On Wed, Aug 27, 2014 at 04:01:32PM +0100, zhangfei wrote:
> 
> 
> On 08/27/2014 10:54 PM, Mark Rutland wrote:
> > On Wed, Aug 27, 2014 at 01:38:29PM +0100, Zhangfei Gao wrote:
> >> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> >> ---
> >>   arch/arm/boot/dts/hisi-x5hd2-dkb.dts |   26 ++++++++++++++++++++++++++
> >>   arch/arm/boot/dts/hisi-x5hd2.dtsi    |   16 ++++++++++++++++
> >>   2 files changed, 42 insertions(+)
> >>
> >> diff --git a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
> >> index 05b44c2..0344de0 100644
> >> --- a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
> >> +++ b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
> >> @@ -51,3 +51,29 @@
> >>   &uart0 {
> >>   	status = "okay";
> >>   };
> >> +
> >> +&gmac0 {
> >> +	#address-cells = <1>;
> >> +	#size-cells = <0>;
> >> +	phy-handle = <&phy2>;
> >> +	phy-mode = "mii";
> >> +	mac-address = [00 00 00 00 00 00];
> >
> > If this is just so space is pre-allocated for the bootloader to patch
> > this, please place a comment to that effect.
> >
> > Otherwise that doesn't look right.
> 
> Yes, it is placeholder, bootloader will overwrite field.
> 
> Also net driver will use random address if if not valid addr.
> if (!is_valid_ether_addr(ndev->dev_addr))
> 	eth_hw_addr_random(ndev);	

Sure. All I'm asking for is to have something like:

/* Placeholder, overwritten by bootloader */
mac-address = [00 00 00 00 00 00];

Cheers,
Mark.
Zhangfei Gao Aug. 27, 2014, 3:08 p.m. UTC | #4
On 08/27/2014 11:04 PM, Mark Rutland wrote:
> On Wed, Aug 27, 2014 at 04:01:32PM +0100, zhangfei wrote:
>>
>>
>> On 08/27/2014 10:54 PM, Mark Rutland wrote:
>>> On Wed, Aug 27, 2014 at 01:38:29PM +0100, Zhangfei Gao wrote:
>>>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>>>> ---
>>>>    arch/arm/boot/dts/hisi-x5hd2-dkb.dts |   26 ++++++++++++++++++++++++++
>>>>    arch/arm/boot/dts/hisi-x5hd2.dtsi    |   16 ++++++++++++++++
>>>>    2 files changed, 42 insertions(+)
>>>>
>>>> diff --git a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
>>>> index 05b44c2..0344de0 100644
>>>> --- a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
>>>> +++ b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
>>>> @@ -51,3 +51,29 @@
>>>>    &uart0 {
>>>>    	status = "okay";
>>>>    };
>>>> +
>>>> +&gmac0 {
>>>> +	#address-cells = <1>;
>>>> +	#size-cells = <0>;
>>>> +	phy-handle = <&phy2>;
>>>> +	phy-mode = "mii";
>>>> +	mac-address = [00 00 00 00 00 00];
>>>
>>> If this is just so space is pre-allocated for the bootloader to patch
>>> this, please place a comment to that effect.
>>>
>>> Otherwise that doesn't look right.
>>
>> Yes, it is placeholder, bootloader will overwrite field.
>>
>> Also net driver will use random address if if not valid addr.
>> if (!is_valid_ether_addr(ndev->dev_addr))
>> 	eth_hw_addr_random(ndev);	
>
> Sure. All I'm asking for is to have something like:
>
> /* Placeholder, overwritten by bootloader */
> mac-address = [00 00 00 00 00 00];

Got it, will update.
Thanks Mark.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
index 05b44c2..0344de0 100644
--- a/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
+++ b/arch/arm/boot/dts/hisi-x5hd2-dkb.dts
@@ -51,3 +51,29 @@ 
 &uart0 {
 	status = "okay";
 };
+
+&gmac0 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	phy-handle = <&phy2>;
+	phy-mode = "mii";
+	mac-address = [00 00 00 00 00 00];
+	status = "okay";
+
+	phy2: ethernet-phy@2 {
+		reg = <2>;
+	};
+};
+
+&gmac1 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	phy-handle = <&phy1>;
+	phy-mode = "rgmii";
+	mac-address = [00 00 00 00 00 00];
+	status = "okay";
+
+	phy1: ethernet-phy@1 {
+		reg = <1>;
+	};
+};
diff --git a/arch/arm/boot/dts/hisi-x5hd2.dtsi b/arch/arm/boot/dts/hisi-x5hd2.dtsi
index f85ba29..012525c 100644
--- a/arch/arm/boot/dts/hisi-x5hd2.dtsi
+++ b/arch/arm/boot/dts/hisi-x5hd2.dtsi
@@ -166,5 +166,21 @@ 
 				#clock-cells = <1>;
 			};
 		};
+
+		gmac0: ethernet@1840000 {
+			compatible = "hisilicon,hix5hd2-gmac";
+			reg = <0x1840000 0x1000>,<0x184300c 0x4>;
+			interrupts = <0 71 4>;
+			clocks = <&clock HIX5HD2_MAC0_CLK>;
+			status = "disabled";
+		};
+
+		gmac1: ethernet@1841000 {
+			compatible = "hisilicon,hix5hd2-gmac";
+			reg = <0x1841000 0x1000>,<0x1843010 0x4>;
+			interrupts = <0 72 4>;
+			clocks = <&clock HIX5HD2_MAC1_CLK>;
+			status = "disabled";
+		};
 	};
 };