Skip to contentSkip to conversation

powerpc, 8xx: Add support for MCR3000 board from CSSI

PATCH Superseded Christophe Leroy 4 participants 15 messages Jun 23, 2017 – Jul 3, 2017 PowerPC

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover powerpc, 8xx: Add support for MCR3000 board from CSSI

This serie adds MCR3000 board from CS Systemes d'Information.

Christophe Leroy (4):
powerpc, 8xx: add support for LXT973 PHY
powerpc, 8xx: Implement GLL2 ERRATA
powerpc, 8xx: Properly set CPM frequency in the device tree powerpc, 8xx: Add support for MCR3000 board from CSSI

 arch/powerpc/cpu/mpc8xx/Kconfig    |   5 +
 arch/powerpc/cpu/mpc8xx/cpu_init.c |  14 ++
 arch/powerpc/cpu/mpc8xx/fdt.c      |   2 +
 arch/powerpc/cpu/mpc8xx/fec.c      |  24 ++
 board/cssi/MAINTAINERS             |   6 +
 board/cssi/MCR3000/Kconfig         |  15 ++
 board/cssi/MCR3000/MCR3000.c       | 436 +++++++++++++++++++++++++++++++++++++
 board/cssi/MCR3000/Makefile        |   9 +
 board/cssi/MCR3000/nand.c          |  77 +++++++
 board/cssi/MCR3000/u-boot.lds      |  91 ++++++++
 configs/MCR3000_defconfig          |  37 ++++
 include/configs/MCR3000.h          | 293 +++++++++++++++++++++++++
 12 files changed, 1009 insertions(+)
 create mode 100644 board/cssi/MAINTAINERS
 create mode 100644 board/cssi/MCR3000/Kconfig
 create mode 100644 board/cssi/MCR3000/MCR3000.c
 create mode 100644 board/cssi/MCR3000/Makefile
 create mode 100644 board/cssi/MCR3000/nand.c
 create mode 100644 board/cssi/MCR3000/u-boot.lds
 create mode 100644 configs/MCR3000_defconfig
 create mode 100644 include/configs/MCR3000.h
Signature · 1 line
2.12.0
#1 lore raw

PATCH 1/4 powerpc, 8xx: add support for LXT973 PHY

LXT973 PHY is a PHY of the LXT970 family. This patch ensures the fec driver supports it.

---
 arch/powerpc/cpu/mpc8xx/fec.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/powerpc/cpu/mpc8xx/fec.c +4 -0
index b27310fffb..680d286964 100644
@@ -738,6 +738,7 @@ static void fec_halt(struct eth_device* dev)
  */
 #define PHY_ID_LXT970		0x78100000	/* LXT970 */
 #define PHY_ID_LXT971		0x001378e0	/* LXT971 and 972 */
+#define PHY_ID_LXT973		0x00137A10	/* LXT973 */
 #define PHY_ID_82555		0x02a80150	/* Intel 82555 */
 #define PHY_ID_QS6612		0x01814400	/* QS6612 */
 #define PHY_ID_AMD79C784	0x00225610	/* AMD 79C784 */
@@ -814,6 +815,9 @@ static int mii_discover_phy(struct eth_device *dev)
 				case PHY_ID_LXT971:
 					printf("LXT971\n");
 					break;
+				case PHY_ID_LXT973:
+					printf("LXT973\n");
+					break;
 				case PHY_ID_82555:
 					printf("82555\n");
 					break;
Signature · 1 line
2.12.0
#5 lore raw

PATCH 2/4 powerpc, 8xx: Implement GLL2 ERRATA

In reply to Christophe Leroy
---
 arch/powerpc/cpu/mpc8xx/cpu_init.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/powerpc/cpu/mpc8xx/cpu_init.c +12 -0
index f621d6285c..5da12faf21 100644
@@ -64,6 +64,18 @@ void cpu_init_f (volatile immap_t * immr)
 	reg |= CONFIG_SYS_SCCR;
 	immr->im_clkrst.car_sccr = reg;
 
+#ifdef CONFIG_MPC86x
+	/* BUG MPC866 GLL2 consideration */
+	reg = immr->im_clkrst.car_sccr;
+	/* probably we use the mode 1:2:1 */
+	if ((reg & 0x00060000) == 0x00020000) {
+		reg &= ~0x00060000;
+		immr->im_clkrst.car_sccr = reg;
+		reg |= 0x00020000;
+		immr->im_clkrst.car_sccr = reg;
+	}
+#endif
+
 	/* PLL (CPU clock) settings (15-30) */
 
 	immr->im_clkrstk.cark_plprcrk = KAPWR_KEY;
Signature · 1 line
2.12.0
#9 lore raw

PATCH 3/4 powerpc, 8xx: Properly set CPM frequency in the device tree

In reply to Christophe Leroy

For processors whose core runs at twice the bus frequency, the fallback frequency calculation in Linux provides a wrong result. Therefore, U-boot needs to pass the correct value.

---
 arch/powerpc/cpu/mpc8xx/fdt.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/cpu/mpc8xx/fdt.c +2 -0
index 34d36478d3..5688671fba 100644
@@ -20,6 +20,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 		"bus-frequency", bd->bi_busfreq, 1);
 	do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
 		"clock-frequency", bd->bi_intfreq, 1);
+	do_fixup_by_compat_u32(blob, "fsl,pq1-soc", "clock-frequency",
+		bd->bi_intfreq, 1);
 	do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
 		gd->arch.brg_clk, 1);
 
Signature · 1 line
2.12.0
#12 lore raw

PATCH 4/4 powerpc, 8xx: Add support for MCR3000 board from CSSI

In reply to Christophe Leroy

CS Systemes d'Information (CSSI) manufactures two boards, named MCR3000 and CMPC885 which are respectively based on MPC866 and MPC885 processors.

This patch adds support for the first board.

---
 arch/powerpc/cpu/mpc8xx/Kconfig    |   5 +
 arch/powerpc/cpu/mpc8xx/cpu_init.c |   2 +
 arch/powerpc/cpu/mpc8xx/fec.c      |  20 ++
 board/cssi/MAINTAINERS             |   6 +
 board/cssi/MCR3000/Kconfig         |  15 ++
 board/cssi/MCR3000/MCR3000.c       | 436 +++++++++++++++++++++++++++++++++++++
 board/cssi/MCR3000/Makefile        |   9 +
 board/cssi/MCR3000/nand.c          |  77 +++++++
 board/cssi/MCR3000/u-boot.lds      |  91 ++++++++
 configs/MCR3000_defconfig          |  37 ++++
 include/configs/MCR3000.h          | 293 +++++++++++++++++++++++++
 11 files changed, 991 insertions(+)
 create mode 100644 board/cssi/MAINTAINERS
 create mode 100644 board/cssi/MCR3000/Kconfig
 create mode 100644 board/cssi/MCR3000/MCR3000.c
 create mode 100644 board/cssi/MCR3000/Makefile
 create mode 100644 board/cssi/MCR3000/nand.c
 create mode 100644 board/cssi/MCR3000/u-boot.lds
 create mode 100644 configs/MCR3000_defconfig
 create mode 100644 include/configs/MCR3000.h
arch/powerpc/cpu/mpc8xx/Kconfig +5 -0
index a425cba8aa..817c240a8a 100644
@@ -8,6 +8,11 @@ choice
 	prompt "Target select"
 	optional
 
+config TARGET_MCR3000
+	bool "Support MCR3000 board from CSSI"
+
 endchoice
 
+source "board/cssi/MCR3000/Kconfig"
+
 endmenu
arch/powerpc/cpu/mpc8xx/cpu_init.c +2 -0
index 5da12faf21..2f7437f6f5 100644
@@ -37,7 +37,9 @@ void cpu_init_f (volatile immap_t * immr)
 
 	/* SYPCR - contains watchdog control (11-9) */
 
+#ifndef CONFIG_TARGET_MCR3000
 	immr->im_siu_conf.sc_sypcr = CONFIG_SYS_SYPCR;
+#endif
 
 #if defined(CONFIG_WATCHDOG)
 	reset_8xx_watchdog (immr);
arch/powerpc/cpu/mpc8xx/fec.c +20 -0
index 680d286964..bdad8791be 100644
@@ -443,6 +443,26 @@ static void fec_pin_init(int fecidx)
 			immr->im_ioport.iop_pddir = 0x1c58;	/* Pre rev. D */
 		else
 			immr->im_ioport.iop_pddir = 0x1fff;	/* Rev. D and later */
+
+#if defined (CONFIG_TARGET_MCR3000)
+		immr->im_ioport.iop_papar = 0xBBFF;
+		immr->im_ioport.iop_padir = 0x04F0;
+		immr->im_ioport.iop_paodr = 0x0000;
+
+		immr->im_cpm.cp_pbpar = 0x000133FF;
+		immr->im_cpm.cp_pbdir = 0x0003BF0F;
+		immr->im_cpm.cp_pbodr = 0x00000000;
+
+		immr->im_ioport.iop_pcpar = 0x0400;
+		immr->im_ioport.iop_pcdir = 0x0080;
+		immr->im_ioport.iop_pcso  = 0x0D53;
+		immr->im_ioport.iop_pcint = 0x0000;
+
+		immr->im_ioport.iop_pdpar = 0x03FE;
+		immr->im_ioport.iop_pddir = 0x1C09;
+
+		immr->im_ioport.utmode |= 0x80;
+#endif
 #endif
 
 #endif	/* CONFIG_ETHER_ON_FEC1 */
board/cssi/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..cbf1406a54
@@ -0,0 +1,6 @@
+BOARDS from CS Systemes d'Information
+M:	Christophe Leroy <[email protected]>
+S:	Maintained
+F:	board/cssi/
+F:	include/configs/MCR3000.h
+F:	configs/MCR3000_defconfig
board/cssi/MCR3000/Kconfig new file +15 -0
new file mode 100644
index 0000000000..ecfd90fd4c
@@ -0,0 +1,15 @@
+if TARGET_MCR3000
+
+config SYS_BOARD
+	default "MCR3000"
+
+config SYS_VENDOR
+	default "cssi"
+
+config SYS_CONFIG_NAME
+	default "MCR3000"
+
+config SYS_TEXT_BASE
+	default 0x04000000
+
+endif
board/cssi/MCR3000/MCR3000.c new file +436 -0

436 lines not on this page · raw message

board/cssi/MCR3000/Makefile new file +9 -0
new file mode 100644
index 0000000000..4ae57b8bdc
@@ -0,0 +1,9 @@
+#
+# Copyright (C) 2010-2017 CS Systemes d'Information
+# Christophe Leroy <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+#
+
+obj-y = MCR3000.o nand.o
board/cssi/MCR3000/nand.c new file +77 -0

77 lines not on this page · raw message

board/cssi/MCR3000/u-boot.lds new file +91 -0

91 lines not on this page · raw message

configs/MCR3000_defconfig new file +37 -0
new file mode 100644
index 0000000000..61fea2ee09
@@ -0,0 +1,37 @@
+CONFIG_PPC=y
+CONFIG_8xx=y
+CONFIG_TARGET_MCR3000=y
+CONFIG_BOOTDELAY=5
+CONFIG_HUSH_PARSER=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_NET=y
+CONFIG_CMD_DHCP=y
+# CONFIG_LED_STATUS_BOARD_SPECIFIC is not set
+# CONFIG_MMC is not set
+CONFIG_MTD_NOR_FLASH=y
+# CONFIG_PCI is not set
+CONFIG_OF_LIBFDT=y
+CONFIG_SYS_PROMPT="S3K> "
+
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_REGINFO=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_NAND=y
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_ECHO is not set
+# CONFIG_CMD_FPGA is not set
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_ITEST is not set
+# CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_LOADB is not set
+# CONFIG_CMD_LOADS is not set
+# CONFIG_CMD_MD5SUM is not set
+# CONFIG_CMD_MISC is not set
+# CONFIG_CMD_SETGETDCR is not set
+# CONFIG_CMD_SHA1 is not set
+# CONFIG_CMD_SOURCE is not set
include/configs/MCR3000.h new file +293 -0

293 lines not on this page · raw message

Signature · 1 line
2.12.0
#2 lore raw

PATCH 1/4 powerpc, 8xx: add support for LXT973 PHY

In reply to Christophe Leroy
Quoted 4 lines · Christophe Leroy

LXT973 PHY is a PHY of the LXT970 family. This patch ensures the fec driver supports it.

And, please make a note on your TODO list that the driver needs to be updated to use phylib, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170623/5dabb3f7/attachment.sig>
#6 lore raw

PATCH 2/4 powerpc, 8xx: Implement GLL2 ERRATA

In reply to Christophe Leroy
Quoted 1 line · Christophe Leroy
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170623/5bb5bf1d/attachment.sig>
#10 lore raw

PATCH 3/4 powerpc, 8xx: Properly set CPM frequency in the device tree

In reply to Christophe Leroy
Quoted 5 lines · Christophe Leroy

For processors whose core runs at twice the bus frequency, the fallback frequency calculation in Linux provides a wrong result. Therefore, U-boot needs to pass the correct value.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170623/1d60cf84/attachment.sig>
#3 lore raw

PATCH 1/4 powerpc, 8xx: add support for LXT973 PHY

In reply to Christophe Leroy

Dear Christophe,

[adding Joe on Cc:]

Quoted 2 lines · In message <c1a9e6b6347fe9e2c36858f082f3ca452b328fd2.1498132599.git.christophe.…

LXT973 PHY is a PHY of the LXT970 family. This patch ensures the fec driver supports it.

This patch is totally unrelated to 8xx; it should go through the network maintainer [adding Joe on Cc:]

Quoted 4 lines
---
 arch/powerpc/cpu/mpc8xx/fec.c | 4 ++++
 1 file changed, 4 insertions(+)

Otherwise:

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Artificial Intelligence is the study of how to  make  real  computers
act like the ones in movies.
#7 lore raw

PATCH 2/4 powerpc, 8xx: Implement GLL2 ERRATA

In reply to Christophe Leroy

Dear Christophe Leroy,

Quoted 1 line · In message <8be66e1dd57e24e6442e88ec175161f5c819f993.1498132599.git.christophe.…

NAK.

The patch does not even apply as there is no such file in mainline:

CONFLICT (modify/delete): arch/powerpc/cpu/mpc8xx/cpu_init.c deleted in 431c66a3bad13e13c1d44ef4ec3638f95e72e11d and modified in powerpc, 8xx: Implement GLL2 ERRATA. Version powerpc, 8xx: Implement GLL2 ERRATA of arch/powerpc/cpu/mpc8xx/cpu_init.c left in tree.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have a theory that it's impossible to prove anything, but  I  can't
prove it.
#11 lore raw

PATCH 3/4 powerpc, 8xx: Properly set CPM frequency in the device tree

In reply to Christophe Leroy

Dear Christophe Leroy,

Quoted 8 lines · In message <243f0cadb778fb5186d026bf0900fde56487e636.1498132599.git.christophe.…

For processors whose core runs at twice the bus frequency, the fallback frequency calculation in Linux provides a wrong result. Therefore, U-boot needs to pass the correct value.

---
 arch/powerpc/cpu/mpc8xx/fdt.c | 2 ++
 1 file changed, 2 insertions(+)

Does not apply: 'arch/powerpc/cpu/mpc8xx/fdt.c': No such file or directory

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There is a biblical analogy I'd like to draw here.   Casts are to C++
Programmers what the apple was to Eve.         - Scott Douglas Meyers
#13 lore raw

PATCH 4/4 powerpc, 8xx: Add support for MCR3000 board from CSSI

In reply to Christophe Leroy

Dear Christophe Leroy,

Quoted 19 lines · In message <2ffe402f2d7b3c4d2156e6e1e9a871304c551efd.1498132599.git.christophe.…

CS Systemes d'Information (CSSI) manufactures two boards, named MCR3000 and CMPC885 which are respectively based on MPC866 and MPC885 processors.

This patch adds support for the first board.

---
 arch/powerpc/cpu/mpc8xx/Kconfig    |   5 +
 arch/powerpc/cpu/mpc8xx/cpu_init.c |   2 +
 arch/powerpc/cpu/mpc8xx/fec.c      |  20 ++
 board/cssi/MAINTAINERS             |   6 +
 board/cssi/MCR3000/Kconfig         |  15 ++
 board/cssi/MCR3000/MCR3000.c       | 436 +++++++++++++++++++++++++++++++++++++
 board/cssi/MCR3000/Makefile        |   9 +
 board/cssi/MCR3000/nand.c          |  77 +++++++
 board/cssi/MCR3000/u-boot.lds      |  91 ++++++++
 configs/MCR3000_defconfig          |  37 ++++
 include/configs/MCR3000.h          | 293 +++++++++++++++++++++++++
 11 files changed, 991 insertions(+)
Quoted 8 lines
 create mode 100644 board/cssi/MAINTAINERS
 create mode 100644 board/cssi/MCR3000/Kconfig
 create mode 100644 board/cssi/MCR3000/MCR3000.c
 create mode 100644 board/cssi/MCR3000/Makefile
 create mode 100644 board/cssi/MCR3000/nand.c
 create mode 100644 board/cssi/MCR3000/u-boot.lds
 create mode 100644 configs/MCR3000_defconfig
 create mode 100644 include/configs/MCR3000.h

Does not apply.

Christophe: it makes no sense to submit patches based on code that is no longer in the tree. The patches submitted to re-add the old code as is have been and will be NAKed. Sorry.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The right word may be effective, but no word was ever as effective as
a rightly timed pause.                                   - Mark Twain
#8 lore raw

PATCH 2/4 powerpc, 8xx: Implement GLL2 ERRATA

In reply to Wolfgang Denk
Quoted 10 lines · Wolfgang Denk

Dear Christophe Leroy,

Quoted 1 line · In message <8be66e1dd57e24e6442e88ec175161f5c819f993.1498132599.git.christophe.…

NAK.

The patch does not even apply as there is no such file in mainline:

CONFLICT (modify/delete): arch/powerpc/cpu/mpc8xx/cpu_init.c deleted in 431c66a3bad13e13c1d44ef4ec3638f95e72e11d and modified in powerpc, 8xx: Implement GLL2 ERRATA. Version powerpc, 8xx: Implement GLL2 ERRATA of arch/powerpc/cpu/mpc8xx/cpu_init.c left in tree.

Clearly depends on the "bring back mpc8xx" patch. So yes, you can fault Christophe for not stating in the cover letter that of course the series depends on that patch. Please otherwise review the content of the patch with that in mind, thanks.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170623/55e0e5df/attachment.sig>
#4 lore raw

PATCH 1/4 powerpc, 8xx: add support for LXT973 PHY

In reply to Wolfgang Denk

Hi,

Quoted 13 lines · Wolfgang Denk

Dear Christophe,

[adding Joe on Cc:]

Quoted 2 lines · In message <c1a9e6b6347fe9e2c36858f082f3ca452b328fd2.1498132599.git.christophe.…

LXT973 PHY is a PHY of the LXT970 family. This patch ensures the fec driver supports it.

This patch is totally unrelated to 8xx; it should go through the network maintainer [adding Joe on Cc:]

Quoted 3 lines
---
 arch/powerpc/cpu/mpc8xx/fec.c | 4 ++++

This file does not exist. All support for 8xx has been removed.

Quoted 20 lines
Quoted 1 line
 1 file changed, 4 insertions(+)

Otherwise:

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Artificial Intelligence is the study of how to make real computers act like the ones in movies.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#14 lore raw

PATCH 4/4 powerpc, 8xx: Add support for MCR3000 board from CSSI

In reply to Christophe Leroy
Quoted 6 lines · Christophe Leroy

CS Systemes d'Information (CSSI) manufactures two boards, named MCR3000 and CMPC885 which are respectively based on MPC866 and MPC885 processors.

This patch adds support for the first board.

OK, please v2 this series on top of your v5 patch to bring back mpc8xx and v1 of your 7 part series to clean up various parts of mpc8xx, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170703/4c41ae80/attachment.sig>