Skip to contentSkip to conversation

83xx: serdes setup routines

PATCH New Anton Vorontsov 2 participants 4 messages Mar 7, 2008 – Mar 13, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 83xx: serdes setup routines

This patch adds few routines to configure serdes on 837x targets.

---
 cpu/mpc83xx/Makefile |    2 +-
 cpu/mpc83xx/serdes.c |  161 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/fsl_serdes.h |   25 ++++++++
 3 files changed, 187 insertions(+), 1 deletions(-)
 create mode 100644 cpu/mpc83xx/serdes.c
 create mode 100644 include/fsl_serdes.h
cpu/mpc83xx/Makefile +1 -1
index 94a3cb8..678be29 100644
@@ -29,7 +29,7 @@ LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
 COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o \
-	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o
+	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o serdes.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
cpu/mpc83xx/serdes.c new file +161 -0

161 lines not on this page · raw message

include/fsl_serdes.h new file +25 -0
new file mode 100644
index 0000000..4c9a766
@@ -0,0 +1,25 @@
+#ifndef __FSL_SERDES_H
+#define __FSL_SERDES_H
+
+#include <config.h>
+
+#ifdef CONFIG_FSL_SERDES
+
+#define FSL_SERDES_CLK_100		0
+#define FSL_SERDES_CLK_125		1
+#define FSL_SERDES_CLK_150		3
+#define FSL_SERDES_PROTO_SATA		0
+#define FSL_SERDES_PROTO_PEX		1
+#define FSL_SERDES_PROTO_PEX_X2		2
+#define FSL_SERDES_PROTO_SGMII		3
+#define FSL_SERDES_VDD1V		1
+
+extern void fsl_setup_serdes(void);
+
+#else
+
+static inline void fsl_setup_serdes(void) {}
+
+#endif
+
+#endif /* __FSL_SERDES_H */
Signature · 1 line
1.5.2.2
#1 lore raw

PATCH 2/3 83xx: serdes setup routines

Quoted 16 lines · Anton Vorontsov

This patch adds few routines to configure serdes on 837x targets.

---
 cpu/mpc83xx/Makefile |    2 +-
 cpu/mpc83xx/serdes.c |  161 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/fsl_serdes.h |   25 ++++++++
 3 files changed, 187 insertions(+), 1 deletions(-)
 create mode 100644 cpu/mpc83xx/serdes.c
 create mode 100644 include/fsl_serdes.h
cpu/mpc83xx/Makefile +0 -0
index 94a3cb8..678be29 100644

cpu/mpc83xx/Makefile LIB = $(obj)lib$(CPU).a · line 32

Quoted 5 lines
cpu/mpc83xx/Makefile +1 -1
@@ -29,7 +29,7 @@ LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
 COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o \
-	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o
+	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o serdes.o

Please split it with on line for one file

Quoted 16 lines
cpu/mpc83xx/Makefile +0 -0
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
cpu/mpc83xx/serdes.c new file +7 -0
new file mode 100644
index 0000000..666bffd
@@ -0,0 +1,161 @@
+/*
+ * Freescale SerDes initialization routine
+ *
+ * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved.
+ * Copyright (C) 2008 MontaVista Software, Inc. All rights reserved.
+ *
+ * Author: Li Yang <[email protected]>

cpu/mpc83xx/serdes.c line 17

Quoted 10 lines
cpu/mpc83xx/serdes.c new file +10 -0
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <config.h>
+
+#ifdef CONFIG_FSL_SERDES

Please move it to the Makefile

cpu/mpc83xx/serdes.c line 22

Quoted 5 lines
cpu/mpc83xx/serdes.c new file +5 -0
+
+#include <common.h>
+#include <asm/io.h>
+#include <fsl_serdes.h>
+

Best Regards,
J.

#2 lore raw

PATCH 2/3 83xx: serdes setup routines

Quoted 18 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 17 lines · Anton Vorontsov

This patch adds few routines to configure serdes on 837x targets.

---
 cpu/mpc83xx/Makefile |    2 +-
 cpu/mpc83xx/serdes.c |  161 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/fsl_serdes.h |   25 ++++++++
 3 files changed, 187 insertions(+), 1 deletions(-)
 create mode 100644 cpu/mpc83xx/serdes.c
 create mode 100644 include/fsl_serdes.h
cpu/mpc83xx/Makefile +0 -0
index 94a3cb8..678be29 100644
@@ -29,7 +29,7 @@ LIB	= $(obj)lib$(CPU).a
 
Quoted 5 lines

cpu/mpc83xx/Makefile LIB = $(obj)lib$(CPU).a · line 32

Quoted 4 lines
cpu/mpc83xx/Makefile +1 -1
 START	= start.o
 COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o \
-	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o
+	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o serdes.o

Please split it with on line for one file

Not sure if just splitting COBJS in separate lines is any better. In long term we should start using $(CONFIG_ symbols. I can start doing it for serdes...

Quoted 1 line
Quoted 1 line

[...]

Quoted 2 lines
Quoted 1 line

+#ifdef CONFIG_FSL_SERDES

Please move it to the Makefile

- - - -
From: Anton Vorontsov <[email protected]>
Subject: 83xx: serdes setup routines

This patch adds few routines to configure serdes on 837x targets.

---
 cpu/mpc83xx/Makefile |    6 +-
 cpu/mpc83xx/serdes.c |  156 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/fsl_serdes.h |   25 ++++++++
 3 files changed, 185 insertions(+), 2 deletions(-)
 create mode 100644 cpu/mpc83xx/serdes.c
 create mode 100644 include/fsl_serdes.h
cpu/mpc83xx/Makefile +4 -2
index 94a3cb8..27e1567 100644
@@ -28,8 +28,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o \
-	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o
+COBJS-y	+= traps.o cpu.o cpu_init.o speed.o interrupts.o \
+	   spd_sdram.o ecc.o qe_io.o pci.o
+COBJS-$(CONFIG_FSL_SERDES) += serdes.o
+COBJS = $(COBJS-y)
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
cpu/mpc83xx/serdes.c new file +156 -0

156 lines not on this page · raw message

include/fsl_serdes.h new file +25 -0
new file mode 100644
index 0000000..4c9a766
@@ -0,0 +1,25 @@
+#ifndef __FSL_SERDES_H
+#define __FSL_SERDES_H
+
+#include <config.h>
+
+#ifdef CONFIG_FSL_SERDES
+
+#define FSL_SERDES_CLK_100		0
+#define FSL_SERDES_CLK_125		1
+#define FSL_SERDES_CLK_150		3
+#define FSL_SERDES_PROTO_SATA		0
+#define FSL_SERDES_PROTO_PEX		1
+#define FSL_SERDES_PROTO_PEX_X2		2
+#define FSL_SERDES_PROTO_SGMII		3
+#define FSL_SERDES_VDD1V		1
+
+extern void fsl_setup_serdes(void);
+
+#else
+
+static inline void fsl_setup_serdes(void) {}
+
+#endif
+
+#endif /* __FSL_SERDES_H */
Signature · 1 line
1.5.2.2
#3 lore raw

PATCH 2/3 83xx: serdes setup routines

Quoted 54 lines · Anton Vorontsov
Quoted 18 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 17 lines · Anton Vorontsov

This patch adds few routines to configure serdes on 837x targets.

---
 cpu/mpc83xx/Makefile |    2 +-
 cpu/mpc83xx/serdes.c |  161 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/fsl_serdes.h |   25 ++++++++
 3 files changed, 187 insertions(+), 1 deletions(-)
 create mode 100644 cpu/mpc83xx/serdes.c
 create mode 100644 include/fsl_serdes.h
cpu/mpc83xx/Makefile +0 -0
index 94a3cb8..678be29 100644
@@ -29,7 +29,7 @@ LIB	= $(obj)lib$(CPU).a
 
Quoted 5 lines

cpu/mpc83xx/Makefile include $(TOPDIR)/config.mk

Quoted 4 lines
cpu/mpc83xx/Makefile +1 -1
 START	= start.o
 COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o \
-	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o
+	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o serdes.o

Please split it with on line for one file

Not sure if just splitting COBJS in separate lines is any better. In long term we should start using $(CONFIG_ symbols. I can start doing it for serdes...

Quoted 1 line
Quoted 1 line

[...]

Quoted 2 lines
Quoted 1 line

+#ifdef CONFIG_FSL_SERDES

Please move it to the Makefile

- - - -
From: Anton Vorontsov <[email protected]>
Subject: 83xx: serdes setup routines

This patch adds few routines to configure serdes on 837x targets.

---
 cpu/mpc83xx/Makefile |    6 +-
 cpu/mpc83xx/serdes.c |  156 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/fsl_serdes.h |   25 ++++++++
 3 files changed, 185 insertions(+), 2 deletions(-)
 create mode 100644 cpu/mpc83xx/serdes.c
 create mode 100644 include/fsl_serdes.h
cpu/mpc83xx/Makefile +0 -0
index 94a3cb8..27e1567 100644

cpu/mpc83xx/Makefile include $(TOPDIR)/config.mk · line 34

Quoted 9 lines
cpu/mpc83xx/Makefile +4 -2
@@ -28,8 +28,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= traps.o cpu.o cpu_init.o speed.o interrupts.o \
-	  spd_sdram.o ecc.o qe_io.o pci.o fdt.o
+COBJS-y	+= traps.o cpu.o cpu_init.o speed.o interrupts.o \
+	   spd_sdram.o ecc.o qe_io.o pci.o
+COBJS-$(CONFIG_FSL_SERDES) += serdes.o
+COBJS = $(COBJS-y)

I really insist please split it on line for one file.

See the anwsers on Stefano Patch

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

It will be nice to split one line for each file

Why? IMHO the could will not become more readble that way, on contrary...

Right. The readability will suffer a little by changing this into the one-object-per-line version.

Quoted 2 lines

When you have mutltiple patch for a makefile, ex : add 2 new file in 2 patch, it could be applied without rebase it the second patch

Correct. Even though the likelyhood of multiple patches in this specific directory is very low. But nevertheless I'm tempted to change it to the one-object-per-line version. This makes it also easier to add one object in
alphabetical order and not having to reorder the lines. Here an example of
adding "ccccccccccccc.o":

For the multiple-objects-per-line:

-COBJS = aaaaaaaaaaaa.o bbbbbbbbbbbb.o eeeeeeeeeeee.o -COBJS += ffffffffffff.o hhhhhhhhhhhh.o xxxxxxxxxxxx.o +COBJS = aaaaaaaaaaaa.o bbbbbbbbbbbb.o cccccccccccc.0 +COBJS += eeeeeeeeeeee.o ffffffffffff.o hhhhhhhhhhhh.o +COBJS += xxxxxxxxxxxx.o

For the one-object-per-line:

COBJS = aaaaaaaaaaaa.o
COBJS += bbbbbbbbbbbb.o
+COBJS += cccccccccccc.o
COBJS += eeeeeeeeeeee.o
COBJS += ffffffffffff.o

Best regards,
Stefan

----

Best Regards,
J.