mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixes
@ 2012-12-08 16:58 Sascha Hauer
  2012-12-08 16:58 ` [PATCH 1/4] ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6 Sascha Hauer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-12-08 16:58 UTC (permalink / raw)
  To: barebox


Some fixes, two omap3 related for toolchains which produce unaligned
accesses, two phylib fixes.

Sascha

----------------------------------------------------------------
Sascha Hauer (4):
      ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6
      ARM omap3: Call common_reset
      net phylib: Clear BMCR_PDOWN bit
      net phylib: Call phy_update_status when no link is present

 arch/arm/include/asm/barebox-arm-head.h |    2 ++
 arch/arm/mach-omap/omap3_core.S         |    1 +
 drivers/net/phy/phy.c                   |    3 +++
 net/eth.c                               |    3 ++-
 4 files changed, 8 insertions(+), 1 deletion(-)

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

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

* [PATCH 1/4] ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6
  2012-12-08 16:58 [PATCH] fixes Sascha Hauer
@ 2012-12-08 16:58 ` Sascha Hauer
  2012-12-08 16:58 ` [PATCH 2/4] ARM omap3: Call common_reset Sascha Hauer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-12-08 16:58 UTC (permalink / raw)
  To: barebox

We allow unaligned accesses on ARMv6 onwards, make sure the CR_A
flag is cleared so that unaligned accesses do not trap.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/include/asm/barebox-arm-head.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/include/asm/barebox-arm-head.h b/arch/arm/include/asm/barebox-arm-head.h
index eafad4e..bf00ff0 100644
--- a/arch/arm/include/asm/barebox-arm-head.h
+++ b/arch/arm/include/asm/barebox-arm-head.h
@@ -22,6 +22,7 @@ static inline void common_reset(void)
 
 #if __LINUX_ARM_ARCH__ >= 6
 	r |= CR_U;
+	r &= CR_A;
 #else
 	r |= CR_A;
 #endif
@@ -91,6 +92,7 @@ static inline void barebox_arm_head(void)
 
 #if __LINUX_ARM_ARCH__ >= 6
 	orr	\scratch, \scratch, #CR_U
+	bic	\scratch, \scratch, #CR_A
 #else
 	orr	\scratch, \scratch, #CR_A
 #endif
-- 
1.7.10.4


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

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

* [PATCH 2/4] ARM omap3: Call common_reset
  2012-12-08 16:58 [PATCH] fixes Sascha Hauer
  2012-12-08 16:58 ` [PATCH 1/4] ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6 Sascha Hauer
@ 2012-12-08 16:58 ` Sascha Hauer
  2012-12-08 16:58 ` [PATCH 3/4] net phylib: Clear BMCR_PDOWN bit Sascha Hauer
  2012-12-08 16:58 ` [PATCH 4/4] net phylib: Call phy_update_status when no link is present Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-12-08 16:58 UTC (permalink / raw)
  To: barebox

omap3 has a soc specific reset function, make sure it calls common_reset
so that the proper CPU flags are set.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-omap/omap3_core.S |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap/omap3_core.S b/arch/arm/mach-omap/omap3_core.S
index ea55efd..38a8cb4 100644
--- a/arch/arm/mach-omap/omap3_core.S
+++ b/arch/arm/mach-omap/omap3_core.S
@@ -83,6 +83,7 @@ finished_inval:
 	mcr	p15, 2, r10, c0, c0, 0	/* select current cache level in cssr */
 	isb
 #endif /* CONFIG_CPU_V7_DCACHE_SKIP */
+	common_reset r0
 	/* back to arch calling code */
 	b board_init_lowlevel_return
 ENDPROC(reset)
-- 
1.7.10.4


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

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

* [PATCH 3/4] net phylib: Clear BMCR_PDOWN bit
  2012-12-08 16:58 [PATCH] fixes Sascha Hauer
  2012-12-08 16:58 ` [PATCH 1/4] ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6 Sascha Hauer
  2012-12-08 16:58 ` [PATCH 2/4] ARM omap3: Call common_reset Sascha Hauer
@ 2012-12-08 16:58 ` Sascha Hauer
  2012-12-08 16:58 ` [PATCH 4/4] net phylib: Call phy_update_status when no link is present Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-12-08 16:58 UTC (permalink / raw)
  To: barebox

Some phys come up with this bit set, clear it so that these phys
can work. This has been observed with a ASIX compatible USB ethernet
adapter.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/phy/phy.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ed185e1..58546f8 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -443,6 +443,9 @@ int genphy_restart_aneg(struct phy_device *phydev)
 	/* Don't isolate the PHY if we're negotiating */
 	ctl &= ~(BMCR_ISOLATE);
 
+	/* Clear powerdown bit which eventually is set on some phys */
+	ctl &= ~BMCR_PDOWN;
+
 	ctl = phy_write(phydev, MII_BMCR, ctl);
 
 	if (ctl < 0)
-- 
1.7.10.4


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

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

* [PATCH 4/4] net phylib: Call phy_update_status when no link is present
  2012-12-08 16:58 [PATCH] fixes Sascha Hauer
                   ` (2 preceding siblings ...)
  2012-12-08 16:58 ` [PATCH 3/4] net phylib: Clear BMCR_PDOWN bit Sascha Hauer
@ 2012-12-08 16:58 ` Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-12-08 16:58 UTC (permalink / raw)
  To: barebox

We call phy_update_status only once in 5 seconds. This makes
sure we do not have great overhead when using ethernet devices.
However, if phylib tells us the link is down anyway, there won't
be ethernet transfers, so it doesn't hurt to call phy_update_status
in this case. This makes sure we can use the ethernet device when
the link comes up and do not have an additional 5 second penalty
in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 net/eth.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/eth.c b/net/eth.c
index 0a1850f..101fc10 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -138,7 +138,8 @@ static int eth_carrier_check(int force)
 	if (!eth_current->phydev)
 		return 0;
 
-	if (force || is_timeout(last_link_check, 5 * SECOND)) {
+	if (force || is_timeout(last_link_check, 5 * SECOND) ||
+			!eth_current->phydev->link) {
 		ret = phy_update_status(eth_current->phydev);
 		if (ret)
 			return ret;
-- 
1.7.10.4


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

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

end of thread, other threads:[~2012-12-08 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-08 16:58 [PATCH] fixes Sascha Hauer
2012-12-08 16:58 ` [PATCH 1/4] ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6 Sascha Hauer
2012-12-08 16:58 ` [PATCH 2/4] ARM omap3: Call common_reset Sascha Hauer
2012-12-08 16:58 ` [PATCH 3/4] net phylib: Clear BMCR_PDOWN bit Sascha Hauer
2012-12-08 16:58 ` [PATCH 4/4] net phylib: Call phy_update_status when no link is present Sascha Hauer

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