[U-Boot] [PATCH 01/17] powerpc/83xx/km: add support for kmvect1 p1a hw version

Valentin Longchamp
2015-11-13T14:59:12Z

From: Holger Brunck <holger.brunck@keymile.com>

This first boards have the simple switch connected to a PRST line of the
PRIO3. This is not allowed because it releases the PRIO3 watchdog in
u-boot which causes problems with the bootloader application. This is
fixed in the newer HW releases. To be able to deal with these old
versions we add temporary a further target kmvect1_p1a.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---

board/keymile/km83xx/MAINTAINERS | 1 +
board/keymile/km83xx/km83xx.c | 8 ++++++++
configs/kmvect1_p1a_defconfig | 4 ++++
3 files changed, 13 insertions(+)
create mode 100644 configs/kmvect1_p1a_defconfig

diff --git a/board/keymile/km83xx/MAINTAINERS b/board/keymile/km83xx/MAINTAINERS
index cee7e08..51367b6 100644
--- a/board/keymile/km83xx/MAINTAINERS
+++ b/board/keymile/km83xx/MAINTAINERS
@@ -9,6 +9,7 @@ F: include/configs/tuxx1.h
F: configs/kmopti2_defconfig
F: include/configs/suvd3.h
F: configs/kmvect1_defconfig
+F: configs/kmvect1_p1a_defconfig
F: configs/suvd3_defconfig
F: configs/tuge1_defconfig
F: configs/tuxx1_defconfig
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 89e9e1e..4ebcdbd 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -241,6 +241,13 @@ int last_stage_init(void)
#if defined(CONFIG_KMVECT1)
struct km_bec_fpga __iomem *base =
(struct km_bec_fpga __iomem *)CONFIG_SYS_KMBEC_FPGA_BASE;
+#if defined(CONFIG_HWVERSION_P1A)
+ /* Release mv88e6352 from reset */
+ u8 prst_reg;
+
+ prst_reg = in_8(&base->prst) | 0x80;
+ out_8(&base->prst, prst_reg);
+#else
u8 tmp_reg;

/* Release mv88e6122 from reset */
@@ -248,6 +255,7 @@ int last_stage_init(void)
out_8(&base->res1[0], tmp_reg); /* GP28 as output */
tmp_reg = in_8(&base->gprt3) | 0x10; /* GP28 to high */
out_8(&base->gprt3, tmp_reg);
+#endif

/* configure MV88E6122 switch */
char *name = "UEC2";
diff --git a/configs/kmvect1_p1a_defconfig b/configs/kmvect1_p1a_defconfig
new file mode 100644
index 0000000..cdf50d5
--- /dev/null
+++ b/configs/kmvect1_p1a_defconfig
@@ -0,0 +1,4 @@
+CONFIG_SYS_EXTRA_OPTIONS="KMVECT1,HWVERSION_P1A"
+CONFIG_PPC=y
+CONFIG_MPC83xx=y
+CONFIG_TARGET_SUVD3=y
--
1.8.3.1