* [PATCH 2/5] powerpc/83xx: fix checkpatch warnings for km83xx.c
2012-12-07 15:09 [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c Holger Brunck
@ 2012-12-07 15:09 ` Holger Brunck
2012-12-07 15:09 ` [PATCH 3/5] powerpc/83xx: refactor mpc8360e quirk for kmeter1 Holger Brunck
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Holger Brunck @ 2012-12-07 15:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Holger Brunck
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/83xx/km83xx.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 89923d7..cb6460c 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -28,8 +28,8 @@
#include <linux/of_device.h>
#include <linux/atomic.h>
-#include <asm/time.h>
-#include <asm/io.h>
+#include <linux/time.h>
+#include <linux/io.h>
#include <asm/machdep.h>
#include <asm/ipic.h>
#include <asm/irq.h>
@@ -88,15 +88,13 @@ static void __init mpc83xx_km_setup_arch(void)
np_par = of_find_node_by_name(NULL, "par_io");
if (np_par == NULL) {
- printk(KERN_WARNING "%s couldn;t find par_io node\n",
- __func__);
+ pr_warn("%s couldn;t find par_io node\n", __func__);
return;
}
/* Map Parallel I/O ports registers */
ret = of_address_to_resource(np_par, 0, &res);
if (ret) {
- printk(KERN_WARNING "%s couldn;t map par_io registers\n",
- __func__);
+ pr_warn("%s couldn;t map par_io registers\n", __func__);
return;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/5] powerpc/83xx: refactor mpc8360e quirk for kmeter1
2012-12-07 15:09 [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c Holger Brunck
2012-12-07 15:09 ` [PATCH 2/5] powerpc/83xx: fix checkpatch warnings for km83xx.c Holger Brunck
@ 2012-12-07 15:09 ` Holger Brunck
2012-12-07 15:09 ` [PATCH 4/5] powerpc/83xx: apply mpc8360e quirk for kmeter1 only when par_io is present Holger Brunck
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Holger Brunck @ 2012-12-07 15:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Holger Brunck, Gerlando Falauto
From: Gerlando Falauto <gerlando.falauto@keymile.com>
Move the code for this quirk to a dedicated function.
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/83xx/km83xx.c | 149 +++++++++++++++++----------------
1 files changed, 77 insertions(+), 72 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index cb6460c..88b1af0 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -43,6 +43,82 @@
#include "mpc83xx.h"
#define SVR_REV(svr) (((svr) >> 0) & 0xFFFF) /* Revision field */
+
+static void quirk_mpc8360e_qe_enet10(void)
+{
+ /*
+ * handle mpc8360E Erratum QE_ENET10:
+ * RGMII AC values do not meet the specification
+ */
+ uint svid = mfspr(SPRN_SVR);
+ struct device_node *np_par;
+ struct resource res;
+ void __iomem *base;
+ int ret;
+
+ np_par = of_find_node_by_name(NULL, "par_io");
+ if (np_par == NULL) {
+ pr_warn("%s couldn;t find par_io node\n", __func__);
+ return;
+ }
+ /* Map Parallel I/O ports registers */
+ ret = of_address_to_resource(np_par, 0, &res);
+ if (ret) {
+ pr_warn("%s couldn;t map par_io registers\n", __func__);
+ return;
+ }
+
+ base = ioremap(res.start, res.end - res.start + 1);
+
+ /*
+ * set output delay adjustments to default values according
+ * table 5 in Errata Rev. 5, 9/2011:
+ *
+ * write 0b01 to UCC1 bits 18:19
+ * write 0b01 to UCC2 option 1 bits 4:5
+ * write 0b01 to UCC2 option 2 bits 16:17
+ */
+ clrsetbits_be32((base + 0xa8), 0x0c00f000, 0x04005000);
+
+ /*
+ * set output delay adjustments to default values according
+ * table 3-13 in Reference Manual Rev.3 05/2010:
+ *
+ * write 0b01 to UCC2 option 2 bits 16:17
+ * write 0b0101 to UCC1 bits 20:23
+ * write 0b0101 to UCC2 option 1 bits 24:27
+ */
+ clrsetbits_be32((base + 0xac), 0x0000cff0, 0x00004550);
+
+ if (SVR_REV(svid) == 0x0021) {
+ /*
+ * UCC2 option 1: write 0b1010 to bits 24:27
+ * at address IMMRBAR+0x14AC
+ */
+ clrsetbits_be32((base + 0xac), 0x000000f0, 0x000000a0);
+ } else if (SVR_REV(svid) == 0x0020) {
+ /*
+ * UCC1: write 0b11 to bits 18:19
+ * at address IMMRBAR+0x14A8
+ */
+ setbits32((base + 0xa8), 0x00003000);
+
+ /*
+ * UCC2 option 1: write 0b11 to bits 4:5
+ * at address IMMRBAR+0x14A8
+ */
+ setbits32((base + 0xa8), 0x0c000000);
+
+ /*
+ * UCC2 option 2: write 0b11 to bits 16:17
+ * at address IMMRBAR+0x14AC
+ */
+ setbits32((base + 0xac), 0x0000c000);
+ }
+ iounmap(base);
+ of_node_put(np_par);
+}
+
/* ************************************************************************
*
* Setup the architecture
@@ -73,80 +149,9 @@ static void __init mpc83xx_km_setup_arch(void)
for_each_node_by_name(np, "ucc")
par_io_of_config(np);
}
-
np = of_find_compatible_node(NULL, "network", "ucc_geth");
if (np != NULL) {
- /*
- * handle mpc8360E Erratum QE_ENET10:
- * RGMII AC values do not meet the specification
- */
- uint svid = mfspr(SPRN_SVR);
- struct device_node *np_par;
- struct resource res;
- void __iomem *base;
- int ret;
-
- np_par = of_find_node_by_name(NULL, "par_io");
- if (np_par == NULL) {
- pr_warn("%s couldn;t find par_io node\n", __func__);
- return;
- }
- /* Map Parallel I/O ports registers */
- ret = of_address_to_resource(np_par, 0, &res);
- if (ret) {
- pr_warn("%s couldn;t map par_io registers\n", __func__);
- return;
- }
-
- base = ioremap(res.start, res.end - res.start + 1);
-
- /*
- * set output delay adjustments to default values according
- * table 5 in Errata Rev. 5, 9/2011:
- *
- * write 0b01 to UCC1 bits 18:19
- * write 0b01 to UCC2 option 1 bits 4:5
- * write 0b01 to UCC2 option 2 bits 16:17
- */
- clrsetbits_be32((base + 0xa8), 0x0c00f000, 0x04005000);
-
- /*
- * set output delay adjustments to default values according
- * table 3-13 in Reference Manual Rev.3 05/2010:
- *
- * write 0b01 to UCC2 option 2 bits 16:17
- * write 0b0101 to UCC1 bits 20:23
- * write 0b0101 to UCC2 option 1 bits 24:27
- */
- clrsetbits_be32((base + 0xac), 0x0000cff0, 0x00004550);
-
- if (SVR_REV(svid) == 0x0021) {
- /*
- * UCC2 option 1: write 0b1010 to bits 24:27
- * at address IMMRBAR+0x14AC
- */
- clrsetbits_be32((base + 0xac), 0x000000f0, 0x000000a0);
- } else if (SVR_REV(svid) == 0x0020) {
- /*
- * UCC1: write 0b11 to bits 18:19
- * at address IMMRBAR+0x14A8
- */
- setbits32((base + 0xa8), 0x00003000);
-
- /*
- * UCC2 option 1: write 0b11 to bits 4:5
- * at address IMMRBAR+0x14A8
- */
- setbits32((base + 0xa8), 0x0c000000);
-
- /*
- * UCC2 option 2: write 0b11 to bits 16:17
- * at address IMMRBAR+0x14AC
- */
- setbits32((base + 0xac), 0x0000c000);
- }
- iounmap(base);
- of_node_put(np_par);
+ quirk_mpc8360e_qe_enet10();
of_node_put(np);
}
#endif /* CONFIG_QUICC_ENGINE */
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/5] powerpc/83xx: apply mpc8360e quirk for kmeter1 only when par_io is present
2012-12-07 15:09 [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c Holger Brunck
2012-12-07 15:09 ` [PATCH 2/5] powerpc/83xx: fix checkpatch warnings for km83xx.c Holger Brunck
2012-12-07 15:09 ` [PATCH 3/5] powerpc/83xx: refactor mpc8360e quirk for kmeter1 Holger Brunck
@ 2012-12-07 15:09 ` Holger Brunck
2012-12-07 15:09 ` [PATCH 5/5] powerpc/83xx: update kmeter1_defconfig Holger Brunck
2013-02-12 20:00 ` [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c Kumar Gala
4 siblings, 0 replies; 6+ messages in thread
From: Holger Brunck @ 2012-12-07 15:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Holger Brunck, Gerlando Falauto
From: Gerlando Falauto <gerlando.falauto@keymile.com>
There is no point in applying this quirk when par_io is not present.
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/platforms/83xx/km83xx.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 88b1af0..bf4c447 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -148,11 +148,13 @@ static void __init mpc83xx_km_setup_arch(void)
for_each_node_by_name(np, "ucc")
par_io_of_config(np);
- }
- np = of_find_compatible_node(NULL, "network", "ucc_geth");
- if (np != NULL) {
- quirk_mpc8360e_qe_enet10();
- of_node_put(np);
+
+ /* Only apply this quirk when par_io is available */
+ np = of_find_compatible_node(NULL, "network", "ucc_geth");
+ if (np != NULL) {
+ quirk_mpc8360e_qe_enet10();
+ of_node_put(np);
+ }
}
#endif /* CONFIG_QUICC_ENGINE */
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 5/5] powerpc/83xx: update kmeter1_defconfig
2012-12-07 15:09 [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c Holger Brunck
` (2 preceding siblings ...)
2012-12-07 15:09 ` [PATCH 4/5] powerpc/83xx: apply mpc8360e quirk for kmeter1 only when par_io is present Holger Brunck
@ 2012-12-07 15:09 ` Holger Brunck
2013-02-12 20:00 ` [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c Kumar Gala
4 siblings, 0 replies; 6+ messages in thread
From: Holger Brunck @ 2012-12-07 15:09 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Holger Brunck
Synchronize this defconfig with latest kernel version.
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/configs/83xx/kmeter1_defconfig | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/configs/83xx/kmeter1_defconfig b/arch/powerpc/configs/83xx/kmeter1_defconfig
index a0dfef1..e12e60c 100644
--- a/arch/powerpc/configs/83xx/kmeter1_defconfig
+++ b/arch/powerpc/configs/83xx/kmeter1_defconfig
@@ -2,6 +2,8 @@ CONFIG_EXPERIMENTAL=y
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
CONFIG_LOG_BUF_SHIFT=14
CONFIG_EXPERT=y
CONFIG_SLAB=y
@@ -16,8 +18,6 @@ CONFIG_PARTITION_ADVANCED=y
# CONFIG_PPC_PMAC is not set
CONFIG_PPC_83xx=y
CONFIG_KMETER1=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
CONFIG_PREEMPT=y
# CONFIG_SECCOMP is not set
CONFIG_NET=y
@@ -45,7 +45,6 @@ CONFIG_MTD_PHYSMAP_OF=y
CONFIG_MTD_PHRAM=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_GLUEBI=y
-CONFIG_MTD_UBI_DEBUG=y
CONFIG_PROC_DEVICETREE=y
CONFIG_NETDEVICES=y
CONFIG_DUMMY=y
@@ -76,5 +75,4 @@ CONFIG_TMPFS=y
CONFIG_JFFS2_FS=y
CONFIG_UBIFS_FS=y
CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c
2012-12-07 15:09 [PATCH 1/5] powerpc/82xx: fix checkpatch warnings for km82xx.c Holger Brunck
` (3 preceding siblings ...)
2012-12-07 15:09 ` [PATCH 5/5] powerpc/83xx: update kmeter1_defconfig Holger Brunck
@ 2013-02-12 20:00 ` Kumar Gala
4 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2013-02-12 20:00 UTC (permalink / raw)
To: Holger Brunck; +Cc: linuxppc-dev
On Dec 7, 2012, at 9:09 AM, Holger Brunck wrote:
> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
> cc: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/platforms/82xx/km82xx.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
applied 1-5 to next
- k
^ permalink raw reply [flat|nested] 6+ messages in thread