Skip to contentSkip to conversation

powerpc/85xx: Add basic support for P1010RDB

PATCH New Poonam Aggrwal 6 participants 9 messages May 4, 2011 – May 5, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

Boot methods supported: NOR Flash, NAND Flash, SPI Flash and SDCARD This patch adds the following basic interfaces:
DDR3, eTSEC, DUART, I2C, SD/MMC, USB, SATA, PCIe, NOR Flash, NAND Flash SPI Flash.

P1010RDB Overview
-----------------
1Gbyte DDR3 (on board DDR)
Local Bus (IFC):
32Mbyte 16bit NOR flash
32Mbyte SLC NAND Flash
64KB CPLD device(GPCM interface)
SPI Flash:
128 Mbit SPI Flash memory
SD/MMC:
connector to interface with the SD memory card
SATA:
1 internal SATA connect to 2.5. 160G SATA2 HDD
1 eSATA connector to rear panel
USB 2.0:
x1 USB 2.0 port: connected via a UTMI PHY to Mini-AB interface. x1 USB 2.0 port: directly connected to Mini-AB interface Ethernet
eTSEC:
eTSEC1: Connected to RGMII PHY VSC8641XKO
eTSEC2: Connected to SGMII PHY VSC8221
eTSEC3: Connected to SGMII PHY VSC8221
eCAN:
Two DB-9 female connectors for Field bus interface
UART:
supports two UARTs up to 115200 bps for console
TDM:
2 FXS ports connected via an external SLIC to the TDM interface.
SLIC:
SPI SLIC
I2C:

	Serial EEprom
	Real time clock
	256 Kbit M24256 I2C EEPROM

PCIe:
PCIe and mPCIe connectors.

---
 board/freescale/p1010rdb/Makefile             |   52 ++
 board/freescale/p1010rdb/ddr.c                |  168 ++++++
 board/freescale/p1010rdb/law.c                |   35 ++
 board/freescale/p1010rdb/p1010rdb.c           |  334 +++++++++++
 board/freescale/p1010rdb/tlb.c                |   98 ++++
 boards.cfg                                    |    8 +
 doc/README.p1010rdb                           |  259 +++++++++
 include/configs/P1010RDB.h                    |  767 +++++++++++++++++++++++++
 nand_spl/board/freescale/p1010rdb/Makefile    |  142 +++++
 nand_spl/board/freescale/p1010rdb/nand_boot.c |  119 ++++
 10 files changed, 1982 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/p1010rdb/Makefile
 create mode 100644 board/freescale/p1010rdb/ddr.c
 create mode 100644 board/freescale/p1010rdb/law.c
 create mode 100644 board/freescale/p1010rdb/p1010rdb.c
 create mode 100644 board/freescale/p1010rdb/tlb.c
 create mode 100644 doc/README.p1010rdb
 create mode 100644 include/configs/P1010RDB.h
 create mode 100644 nand_spl/board/freescale/p1010rdb/Makefile
 create mode 100644 nand_spl/board/freescale/p1010rdb/nand_boot.c
board/freescale/p1010rdb/Makefile new file +52 -0
new file mode 100644
index 0000000..1dcd490
@@ -0,0 +1,52 @@
+#
+# Copyright 2010-2011 Freescale Semiconductor, Inc.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS-y	+= $(BOARD).o
+COBJS-y	+= ddr.o
+COBJS-y	+= law.o
+COBJS-y	+= tlb.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+clean:
+	rm -f $(OBJS) $(SOBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/freescale/p1010rdb/ddr.c new file +168 -0

168 lines not on this page · raw message

board/freescale/p1010rdb/law.c new file +35 -0
new file mode 100644
index 0000000..3ed77fc
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/fsl_law.h>
+#include <asm/mmu.h>
+
+struct law_entry law_table[] = {
+#ifndef CONFIG_SDCARD
+	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_32M, LAW_TRGT_IF_IFC),
+	SET_LAW(CONFIG_SYS_CPLD_BASE_PHYS, LAW_SIZE_128K, LAW_TRGT_IF_IFC),
+	SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_IFC),
+#endif
+};
+
+int num_law_entries = ARRAY_SIZE(law_table);
board/freescale/p1010rdb/p1010rdb.c new file +334 -0

334 lines not on this page · raw message

board/freescale/p1010rdb/tlb.c new file +98 -0

98 lines not on this page · raw message

boards.cfg +8 -0
index fde9913..4ca3142 100644
@@ -510,6 +510,14 @@ MPC8569MDS_NAND              powerpc     mpc85xx     mpc8569mds          freesca
 MPC8572DS                    powerpc     mpc85xx     mpc8572ds           freescale      -           MPC8572DS
 MPC8572DS_36BIT              powerpc     mpc85xx     mpc8572ds           freescale      -           MPC8572DS:36BIT
 MPC8572DS_NAND               powerpc     mpc85xx     mpc8572ds           freescale      -           MPC8572DS:NAND
+P1010RDB_NOR                 powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB
+P1010RDB_36BIT_NOR           powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB,36BIT
+P1010RDB_NAND                powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB,NAND
+P1010RDB_36BIT_NAND          powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB,36BIT,NAND
+P1010RDB_SDCARD              powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB,SDCARD
+P1010RDB_SPIFLASH            powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB,SPIFLASH
+P1010RDB_36BIT_SDCARD        powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB,36BIT,SDCARD
+P1010RDB_36BIT_SPIFLASH      powerpc     mpc85xx     p1010rdb            freescale      -           P1010RDB:P1010RDB,36BIT,SPIFLASH
 P1011RDB                     powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB
 P1011RDB_36BIT               powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,36BIT
 P1011RDB_36BIT_SDCARD        powerpc     mpc85xx     p1_p2_rdb           freescale      -           P1_P2_RDB:P1011RDB,36BIT,SDCARD
doc/README.p1010rdb new file +259 -0

259 lines not on this page · raw message

include/configs/P1010RDB.h new file +767 -0

767 lines not on this page · raw message

nand_spl/board/freescale/p1010rdb/Makefile new file +142 -0

142 lines not on this page · raw message

nand_spl/board/freescale/p1010rdb/nand_boot.c new file +119 -0

119 lines not on this page · raw message

Signature · 1 line
1.6.5.6
#1 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

Quoted 30 lines · Poonam Aggrwal
board/freescale/p1010rdb/Makefile new file +3 -0
+sinclude $(obj).depend
+
+#########################################################################
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +21 -0
new file mode 100644
index 0000000..f0de279
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>

nand_spl/board/freescale/p1010rdb/nand_boot.c line 31

Quoted 10 lines
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +10 -0
+#include <mpc85xx.h>
+#include <asm/io.h>
+#include <ns16550.h>
+#include <nand.h>
+#include <asm/mmu.h>
+#include <asm/immap_85xx.h>
+#include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_law.h>
+
+#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }

There were many comments on this udelay before, we should not use this define, but use the udelay() which u-boot provides.

#2 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

Quoted 35 lines · Haiying Wang
Quoted 34 lines · Poonam Aggrwal
board/freescale/p1010rdb/Makefile new file +3 -0
+sinclude $(obj).depend
+
+#########################################################################
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +25 -0
new file mode 100644
index 0000000..f0de279
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>
+#include <mpc85xx.h>
+#include <asm/io.h>
+#include <ns16550.h>
+#include <nand.h>
Quoted 9 lines

nand_spl/board/freescale/p1010rdb/nand_boot.c line 31

Quoted 6 lines
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +6 -0
+#include <asm/mmu.h>
+#include <asm/immap_85xx.h>
+#include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_law.h>
+
+#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }

There were many comments on this udelay before, we should not use this define, but use the udelay() which u-boot provides.

Is there a udelay that is defined for the nand_spl build? The problem is doing proper time based delay in nand_spl would require a lot more code.

- k

#3 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

Quoted 8 lines · Kumar Gala
Quoted 5 lines

nand_spl/board/freescale/p1010rdb/nand_boot.c line 31

Quoted 2 lines
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +2 -0
+
+#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }

There were many comments on this udelay before, we should not use this define, but use the udelay() which u-boot provides.

Is there a udelay that is defined for the nand_spl build? The problem is doing proper time based delay in nand_spl would require a lot more code.

No special udelay defined for nand_spl. I only saw the comments on not to define a extra udelay like that. I understood the reason but that was one of the reasons for TPL support.

Haiying

#4 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

In reply to Kumar Gala
Quoted 48 lines · On Wed, 4 May 2011 12:34:20 -0500 Kumar Gala <[email protected]> wrote:
Quoted 35 lines · Haiying Wang
Quoted 34 lines · Poonam Aggrwal
board/freescale/p1010rdb/Makefile new file +3 -0
+sinclude $(obj).depend
+
+#########################################################################
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +25 -0
new file mode 100644
index 0000000..f0de279
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>
+#include <mpc85xx.h>
+#include <asm/io.h>
+#include <ns16550.h>
+#include <nand.h>
Quoted 9 lines

nand_spl/board/freescale/p1010rdb/nand_boot.c line 31

Quoted 6 lines
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +6 -0
+#include <asm/mmu.h>
+#include <asm/immap_85xx.h>
+#include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_law.h>
+
+#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }

There were many comments on this udelay before, we should not use this define, but use the udelay() which u-boot provides.

Quoted 1 line

Is there a udelay that is defined for the nand_spl build? The problem is doing proper time based delay in nand_spl would require a lot more code.

This loop is similar to what nand_spl/nand_boot.c is using. It's ugly, but the goal here is small code rather than cleanliness. Is the timebase running at this point? How much code is required to get the timebase frequency?

-Scott

#5 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

nand_spl/board/freescale/p1010rdb/nand_boot.c line 31

Quoted 2 lines
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +2 -0
+
+#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }

There were many comments on this udelay before, we should not use this define, but use the udelay() which u-boot provides.

Quoted 6 lines
Quoted 1 line

Is there a udelay that is defined for the nand_spl build? ?The problem is doing proper time based delay in nand_spl would require a lot more code.

This loop is similar to what nand_spl/nand_boot.c is using. ?It's ugly, but the goal here is small code rather than cleanliness. ?Is the timebase running at this point? ?How much code is required to get the timebase frequency?

Is it possible to compromise and not call it udelay? udelay(x) is supposed to delay for x microseconds, but clearly this delays for x*10000 iterations through a loop. Also, are we sure that such a macro works at all? It looks like the sort of thing compilers optimize away all the time.

Andy

#6 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

Quoted 14 lines · On Wed, 4 May 2011 14:15:58 -0500 Andy Fleming <[email protected]> wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

nand_spl/board/freescale/p1010rdb/nand_boot.c line 31

Quoted 2 lines
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +2 -0
+
+#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }

There were many comments on this udelay before, we should not use this define, but use the udelay() which u-boot provides.

Quoted 6 lines
Quoted 1 line

Is there a udelay that is defined for the nand_spl build? ?The problem is doing proper time based delay in nand_spl would require a lot more code.

This loop is similar to what nand_spl/nand_boot.c is using. ?It's ugly, but the goal here is small code rather than cleanliness. ?Is the timebase running at this point? ?How much code is required to get the timebase frequency?

Quoted 5 lines

Is it possible to compromise and not call it udelay? udelay(x) is supposed to delay for x microseconds, but clearly this delays for x*10000 iterations through a loop. Also, are we sure that such a macro works at all? It looks like the sort of thing compilers optimize away all the time.

I think it used to special-case such empty-body loops, but apparently not anymore. I did some test-compiles and such constructs are optimized away.

-Scott

#7 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

In reply to Scott Wood
Quoted 51 lines · Scott Wood
Quoted 48 lines · On Wed, 4 May 2011 12:34:20 -0500 Kumar Gala <[email protected]> wrote:
Quoted 44 lines · Haiying Wang
Quoted 30 lines · Poonam Aggrwal
board/freescale/p1010rdb/Makefile new file +3 -0
+sinclude $(obj).depend
+
+#########################################################################
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +21 -0
new file mode 100644
index 0000000..f0de279
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>

nand_spl/board/freescale/p1010rdb/nand_boot.c line 31

Quoted 10 lines
nand_spl/board/freescale/p1010rdb/nand_boot.c new file +10 -0
+#include <mpc85xx.h>
+#include <asm/io.h>
+#include <ns16550.h>
+#include <nand.h>
+#include <asm/mmu.h>
+#include <asm/immap_85xx.h>
+#include <asm/fsl_ddr_sdram.h>
+#include <asm/fsl_law.h>
+
+#define udelay(x) {int i, j; for (i = 0; i < x; i++) for (j = 0; j < 10000; j++); }

There were many comments on this udelay before, we should not use this define, but use the udelay() which u-boot provides.

Quoted 6 lines
Quoted 1 line

Is there a udelay that is defined for the nand_spl build? The problem is doing proper time based delay in nand_spl would require a lot more code.

This loop is similar to what nand_spl/nand_boot.c is using. It's ugly, but the goal here is small code rather than cleanliness. Is the timebase running at this point? How much code is required to get the timebase frequency?

TB isn't running so you have to turn it on in the SoC (so a few CCSRBAR read/writes), than you have to calculate freq on some boards its a #define constant, on other its calculated reading I2C which would add a bunch of code for accessing I2C. I'm pretty sure we aren't going to be able to do that in 4k.

- k

#8 lore raw

PATCH 1/1 powerpc/85xx: Add basic support for P1010RDB

Dear Kumar Gala,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 5 lines

This loop is similar to what nand_spl/nand_boot.c is using. It's ugly, but the goal here is small code rather than cleanliness. Is the timebase running at this point? How much code is required to get the timebase frequency?

TB isn't running so you have to turn it on in the SoC (so a few CCSRBAR read/writes), than you have to calculate freq on some boards its a #define constant, on other its calculated reading I2C which would add a bunch of code for accessing I2C. I'm pret ty sure we aren't going to be able to do that in 4k.

No matter what exactly you do, the loop we have now cannot be used as it is completley dependent on the tool chain if there is any delay at all, and it's pretty much nondeterministic how long it will be using different tool chains.

This code is simply broken and needs fixing.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
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 human mind ordinarily operates at only ten percent of its capaci-
ty - the rest is overhead for the operating system.