Skip to contentSkip to conversation

imx27: dt: only map 1 Kbyte for fec registers

PATCH Superseded Philippe Reynes 3 participants 5 messages May 9, 2015 – May 12, 2015

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx27: dt: only map 1 Kbyte for fec registers

According to the imx27 documentation, fec has a 1 Kbyte memory space map, spitted in two regions of 512 bytes. The first one for control/status registers, and the second one for event/statistic registers. So, we don't need to map 16 Kbyte for registers, 1 Kbyte is enough.

---
 arch/arm/boot/dts/imx27.dtsi |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/boot/dts/imx27.dtsi +1 -1
index 6951b66..56bb917 100644
@@ -533,7 +533,7 @@
 
 			fec: ethernet at 1002b000 {
 				compatible = "fsl,imx27-fec";
-				reg = <0x1002b000 0x4000>;
+				reg = <0x1002b000 0x400>;
 				interrupts = <50>;
 				clocks = <&clks IMX27_CLK_FEC_IPG_GATE>,
 					 <&clks IMX27_CLK_FEC_AHB_GATE>;
Signature · 1 line
1.7.4.4
#1 lore raw
Quoted 16 lines · Philippe Reynes

According to the imx27 documentation, fec has a 1 Kbyte memory space map, spitted in two regions of 512 bytes. The first one for control/status registers, and the second one for event/statistic registers. So, we don't need to map 16 Kbyte for registers, 1 Kbyte is enough.

---
 arch/arm/boot/dts/imx27.dtsi |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/boot/dts/imx27.dtsi +0 -0
index 6951b66..56bb917 100644

arch/arm/boot/dts/imx27.dtsi line 536

Quoted 5 lines
arch/arm/boot/dts/imx27.dtsi +1 -1
@@ -533,7 +533,7 @@
 
 			fec: ethernet at 1002b000 {
 				compatible = "fsl,imx27-fec";
-				reg = <0x1002b000 0x4000>;
+				reg = <0x1002b000 0x400>;

No. Per MCIMX27RM.pdf, Table 2-7. AIPI2 Memory Map, it should be 4KiB.

Shawn

Quoted 11 lines
arch/arm/boot/dts/imx27.dtsi +0 -0
 				interrupts = <50>;
 				clocks = <&clks IMX27_CLK_FEC_IPG_GATE>,
 					 <&clks IMX27_CLK_FEC_AHB_GATE>;
Signature · 7 lines
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#2 lore raw

Hi Shawn,

Quoted 18 lines · Shawn Guo
Quoted 17 lines · Philippe Reynes

According to the imx27 documentation, fec has a 1 Kbyte memory space map, spitted in two regions of 512 bytes. The first one for control/status registers, and the second one for event/statistic registers. So, we don't need to map 16 Kbyte for registers, 1 Kbyte is enough.

---
  arch/arm/boot/dts/imx27.dtsi |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/boot/dts/imx27.dtsi +0 -0
index 6951b66..56bb917 100644
@@ -533,7 +533,7 @@
 
Quoted 6 lines

arch/arm/boot/dts/imx27.dtsi

Quoted 4 lines
arch/arm/boot/dts/imx27.dtsi +1 -1
  			fec: ethernet at 1002b000 {
  				compatible = "fsl,imx27-fec";
-				reg =<0x1002b000 0x4000>;
+				reg =<0x1002b000 0x400>;

No. Per MCIMX27RM.pdf, Table 2-7. AIPI2 Memory Map, it should be 4KiB.

I agree, this table show that 4KiB is reserved for fec registers. But, in paragraph 29.6.1, there is :
"The FEC implementation requires a 1-Kbyte memory map space" So I've thought that 1 Kbye is enough for the register memory space.

I'm pleased to understand that we're both agree that 16 Kbyte is too large.

If you prefer 4 Kbyte, I'll send a v2 of this patch with this value.

Quoted 1 line

Shawn

Regards,
Philippe

#3 lore raw

Hello,

Quoted 26 lines · Philippe Reynes
Quoted 18 lines · Shawn Guo
Quoted 17 lines · Philippe Reynes

According to the imx27 documentation, fec has a 1 Kbyte memory space map, spitted in two regions of 512 bytes. The first one for control/status registers, and the second one for event/statistic registers. So, we don't need to map 16 Kbyte for registers, 1 Kbyte is enough.

---
 arch/arm/boot/dts/imx27.dtsi |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/boot/dts/imx27.dtsi +0 -0
index 6951b66..56bb917 100644
@@ -533,7 +533,7 @@
 
Quoted 6 lines

arch/arm/boot/dts/imx27.dtsi

Quoted 4 lines
arch/arm/boot/dts/imx27.dtsi +1 -1
 			fec: ethernet at 1002b000 {
 				compatible = "fsl,imx27-fec";
-				reg =<0x1002b000 0x4000>;
+				reg =<0x1002b000 0x400>;

No. Per MCIMX27RM.pdf, Table 2-7. AIPI2 Memory Map, it should be 4KiB.

Quoted 4 lines

I agree, this table show that 4KiB is reserved for fec registers. But, in paragraph 29.6.1, there is :
"The FEC implementation requires a 1-Kbyte memory map space" So I've thought that 1 Kbye is enough for the register memory space.

The table 2-7 suggests that 4 KiB are routed to the fec even though the fec module might only make use of the first 1 KiB. That's no contradiction. The convention used in the device trees is that the first amount is used.

Quoted 3 lines

I'm pleased to understand that we're both agree that 16 Kbyte is too large.

If you prefer 4 Kbyte, I'll send a v2 of this patch with this value.

Yes please. In the commit log you might want to point out that a length of 16 KiB overlaps with the (currently unused?) Security Controller (SCC) of the i.MX27.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#4 lore raw

Hi Uwe,

Quoted 29 lines · Uwe Kleine-K?nig

Hello,

Quoted 26 lines · Philippe Reynes
Quoted 24 lines · Shawn Guo
Quoted 16 lines · Philippe Reynes

According to the imx27 documentation, fec has a 1 Kbyte memory space map, spitted in two regions of 512 bytes. The first one for control/status registers, and the second one for event/statistic registers. So, we don't need to map 16 Kbyte for registers, 1 Kbyte is enough.

---
  arch/arm/boot/dts/imx27.dtsi |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/boot/dts/imx27.dtsi +0 -0
index 6951b66..56bb917 100644

arch/arm/boot/dts/imx27.dtsi line 536

Quoted 5 lines
arch/arm/boot/dts/imx27.dtsi +1 -1
@@ -533,7 +533,7 @@
 
  			fec: ethernet at 1002b000 {
  				compatible = "fsl,imx27-fec";
-				reg =<0x1002b000 0x4000>;
+				reg =<0x1002b000 0x400>;

No. Per MCIMX27RM.pdf, Table 2-7. AIPI2 Memory Map, it should be 4KiB.

Quoted 8 lines
Quoted 4 lines

I agree, this table show that 4KiB is reserved for fec registers. But, in paragraph 29.6.1, there is :
"The FEC implementation requires a 1-Kbyte memory map space" So I've thought that 1 Kbye is enough for the register memory space.

The table 2-7 suggests that 4 KiB are routed to the fec even though the fec module might only make use of the first 1 KiB. That's no contradiction. The convention used in the device trees is that the first amount is used.

Ok, I understand, thanks for this explaination.

Quoted 6 lines
Quoted 3 lines

I'm pleased to understand that we're both agree that 16 Kbyte is too large.

If you prefer 4 Kbyte, I'll send a v2 of this patch with this value.

Yes please. In the commit log you might want to point out that a length of 16 KiB overlaps with the (currently unused?) Security Controller (SCC) of the i.MX27.

I've send a new patch (v2 and v3) that map 4 Kbyte for fec registers on imx27.

Quoted 2 lines

Best regards
Uwe

Best regards,
Philippe