mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] net: cpsw: Fix gmii_sel config
@ 2013-12-10 14:30 y
  2013-12-10 14:30 ` [PATCH 2/3] pcm051: ethernet and dts fixes y
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: y @ 2013-12-10 14:30 UTC (permalink / raw)
  To: barebox

From: Jan Weitzel <j.weitzel@phytec.de>

Prober slave_num is needed by cpsw_gmii_sel_am335x to calc reg value.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 drivers/net/cpsw.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 5e68e1b..52adf50 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1074,6 +1074,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
 
 			slave->phy_id = phy_id[1];
 			slave->phy_if = of_get_phy_mode(child);
+			slave->slave_num = i;
 
 			i++;
 		}
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/3] pcm051: ethernet and dts fixes
  2013-12-10 14:30 [PATCH 1/3] net: cpsw: Fix gmii_sel config y
@ 2013-12-10 14:30 ` y
  2013-12-10 14:30 ` [PATCH 3/3] ARM: OMAP: early call am33xx_register_ethaddr y
  2013-12-12  8:09 ` [PATCH 1/3] net: cpsw: Fix gmii_sel config Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: y @ 2013-12-10 14:30 UTC (permalink / raw)
  To: barebox

From: Jan Weitzel <j.weitzel@phytec.de>

add compatible phytec,pcm051
clean up pinmux_emac_rmii1_pins
introduce davinci_mdio_default pin group
set AM33XX_MAC_MII_SEL via dts rmii-clock-ext
use bch8 as ecc mode
add pagesize to 24c32@52

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 arch/arm/boards/pcm051/board.c         |    3 +-
 arch/arm/dts/am335x-phytec-phycore.dts |   40 ++++++++++++++++++++++---------
 2 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
index a64d219..91e8208 100644
--- a/arch/arm/boards/pcm051/board.c
+++ b/arch/arm/boards/pcm051/board.c
@@ -39,11 +39,10 @@ static struct omap_barebox_part pcm051_barebox_part = {
 
 static int pcm051_devices_init(void)
 {
-	if (!of_machine_is_compatible("phytec,phycore-am335x"))
+	if (!of_machine_is_compatible("phytec,pcm051"))
 		return 0;
 
 	am33xx_register_ethaddr(0, 0);
-	writel(0x69, AM33XX_MAC_MII_SEL);
 
 	switch (bootsource_get()) {
 	case BOOTSOURCE_SPI:
diff --git a/arch/arm/dts/am335x-phytec-phycore.dts b/arch/arm/dts/am335x-phytec-phycore.dts
index 81c08fd..6196eb3 100644
--- a/arch/arm/dts/am335x-phytec-phycore.dts
+++ b/arch/arm/dts/am335x-phytec-phycore.dts
@@ -4,7 +4,7 @@
 
 / {
 	model = "Phytec phyCORE AM335x";
-	compatible = "phytec,phycore-am335x", "ti,am33xx";
+	compatible = "phytec,phycore-am335x", "phytec,pcm051", "ti,am33xx";
 
 	chosen {
 		linux,stdout-path = &uart0;
@@ -83,16 +83,14 @@
 
 	emac_rmii1_pins: pinmux_emac_rmii1_pins {
 		pinctrl-single,pins = <
-			0x10c (INPUT_EN | MUX_MODE1)
-			0x110 (INPUT_EN | MUX_MODE1)
-			0x114 MUX_MODE1
-			0x124 MUX_MODE1
-			0x128 MUX_MODE1
-			0x13c (INPUT_EN | MUX_MODE1)
-			0x140 (INPUT_EN | MUX_MODE1)
-			0x148 (PULL_UP | INPUT_EN | MUX_MODE0)
-			0x14c (PULL_UP | MUX_MODE0)
-			0x144 (INPUT_EN | MUX_MODE0)
+			0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_crs.rmii1_crs_dv */
+			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_rxerr.rmii1_rxerr */
+			0x114 (PIN_OUTPUT | MUX_MODE1)		/* mii1_txen.rmii1_txen */
+			0x124 (PIN_OUTPUT | MUX_MODE1)		/* mii1_txd1.rmii1_txd1 */
+			0x128 (PIN_OUTPUT | MUX_MODE1)		/* mii1_txd0.rmii1_txd0 */
+			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_rxd1.rmii1_rxd1 */
+			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1)	/* mii1_rxd0.rmii1_rxd0 */
+			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0)	/* rmii1_refclk.rmii1_refclk */
 
 			/* Slave 2 */
 			0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE2)  /* gpmc_a0.rgmii2_tctl */
@@ -130,6 +128,14 @@
 		>;
 	};
 
+	davinci_mdio_default: davinci_mdio_default {
+		pinctrl-single,pins = <
+			/* MDIO */
+			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
+			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
+		>;
+	};
+
 	pcm051_led_pins: pinmux_pcm051_led_pins {
 		pinctrl-single,pins = <
 			0x80 (MUX_MODE7)
@@ -154,6 +160,7 @@
 
 	eeprom: 24c32@52 {
 		compatible = "atmel,24c32";
+		pagesize = <32>;
 		reg = <0x52>;
 	};
 };
@@ -204,6 +211,15 @@
 	status = "okay";
 };
 
+&davinci_mdio {
+	pinctrl-names = "default";
+	pinctrl-0 = <&davinci_mdio_default>;
+};
+
+&phy_sel {
+	rmii-clock-ext;
+};
+
 &cpsw_emac0 {
 	phy_id = <&davinci_mdio>, <0>;
 	phy-mode = "rmii";
@@ -230,7 +246,7 @@
 	nand: nand@0,0 {
 		reg = <0 0 0>; /* CS0, offset 0 */
 		nand-bus-width = <8>;
-		ti,nand-ecc-opt = "bch8-romcode";
+		ti,nand-ecc-opt = "bch8";
 		gpmc,device-nand = "true";
 		gpmc,device-width = <1>;
 		gpmc,sync-clk-ps = <0>;
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/3] ARM: OMAP: early call am33xx_register_ethaddr
  2013-12-10 14:30 [PATCH 1/3] net: cpsw: Fix gmii_sel config y
  2013-12-10 14:30 ` [PATCH 2/3] pcm051: ethernet and dts fixes y
@ 2013-12-10 14:30 ` y
  2013-12-12  8:09 ` [PATCH 1/3] net: cpsw: Fix gmii_sel config Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: y @ 2013-12-10 14:30 UTC (permalink / raw)
  To: barebox

From: Jan Weitzel <j.weitzel@phytec.de>

am33xx_register_ethaddr must be called before cpsw driver start.
Move it from devices_initcall to coredevice_initcall.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 arch/arm/boards/beaglebone/board.c |   12 ++++++++++--
 arch/arm/boards/pcm051/board.c     |   13 +++++++++++--
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c
index 439c4c2..6445d81 100644
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -40,6 +40,16 @@
 
 #include "beaglebone.h"
 
+static int beaglebone_coredevice_init(void)
+{
+	if (!of_machine_is_compatible("ti,am335x-bone"))
+		return 0;
+
+	am33xx_register_ethaddr(0, 0);
+	return 0;
+}
+coredevice_initcall(beaglebone_coredevice_init);
+
 static int beaglebone_devices_init(void)
 {
 	int black;
@@ -54,8 +64,6 @@ static int beaglebone_devices_init(void)
 			omap_set_bootmmc_devname("mmc1");
 	}
 
-	am33xx_register_ethaddr(0, 0);
-
 	black = is_beaglebone_black();
 
 	globalvar_add_simple("board.variant", black ? "boneblack" : "bone");
diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
index 91e8208..60f00bb 100644
--- a/arch/arm/boards/pcm051/board.c
+++ b/arch/arm/boards/pcm051/board.c
@@ -30,6 +30,17 @@
 #include <mach/am33xx-silicon.h>
 #include <mach/bbu.h>
 
+
+static int pcm051_coredevice_init(void)
+{
+	if (!of_machine_is_compatible("phytec,pcm051"))
+		return 0;
+
+	am33xx_register_ethaddr(0, 0);
+	return 0;
+}
+coredevice_initcall(pcm051_coredevice_init);
+
 static struct omap_barebox_part pcm051_barebox_part = {
 	.nand_offset = SZ_512K,
 	.nand_size = SZ_512K,
@@ -42,8 +53,6 @@ static int pcm051_devices_init(void)
 	if (!of_machine_is_compatible("phytec,pcm051"))
 		return 0;
 
-	am33xx_register_ethaddr(0, 0);
-
 	switch (bootsource_get()) {
 	case BOOTSOURCE_SPI:
 		of_device_enable_path("/chosen/environment-spi");
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] net: cpsw: Fix gmii_sel config
  2013-12-10 14:30 [PATCH 1/3] net: cpsw: Fix gmii_sel config y
  2013-12-10 14:30 ` [PATCH 2/3] pcm051: ethernet and dts fixes y
  2013-12-10 14:30 ` [PATCH 3/3] ARM: OMAP: early call am33xx_register_ethaddr y
@ 2013-12-12  8:09 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-12-12  8:09 UTC (permalink / raw)
  To: y; +Cc: barebox

On Tue, Dec 10, 2013 at 03:30:07PM +0100, y@numalfix.phytec.de wrote:
> From: Jan Weitzel <j.weitzel@phytec.de>
> 
> Prober slave_num is needed by cpsw_gmii_sel_am335x to calc reg value.
> 
> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>

Applied, thanks

Sascha

> ---
>  drivers/net/cpsw.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
> index 5e68e1b..52adf50 100644
> --- a/drivers/net/cpsw.c
> +++ b/drivers/net/cpsw.c
> @@ -1074,6 +1074,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
>  
>  			slave->phy_id = phy_id[1];
>  			slave->phy_if = of_get_phy_mode(child);
> +			slave->slave_num = i;
>  
>  			i++;
>  		}
> -- 
> 1.7.0.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-12  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-10 14:30 [PATCH 1/3] net: cpsw: Fix gmii_sel config y
2013-12-10 14:30 ` [PATCH 2/3] pcm051: ethernet and dts fixes y
2013-12-10 14:30 ` [PATCH 3/3] ARM: OMAP: early call am33xx_register_ethaddr y
2013-12-12  8:09 ` [PATCH 1/3] net: cpsw: Fix gmii_sel config Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox