Skip to contentSkip to conversation

powerpc/T1040EMU: Add T1040 emulator support

PATCH Superseded Priyanka Jain 2 participants 2 messages Oct 28, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/T1040EMU: Add T1040 emulator support

Add emulator support for T1040. Emulator has limited peripherals and interfaces.
Difference between T1040QDS and emulator includes:
-ECC for DDR is disabled due to procedure to load images -Depends on raw timing for DDR initialization
-No board FPGA (Qixis)
-No PCI
-No SPI
-No flash support

---
Based on u-boot-mpc85xx/next branch.
This patch depends upon following patches:
1)[U-Boot] powerpc/t1040qds: Add DDR Raw Timing support

	http://patchwork.ozlabs.org/patch/286112/
 2)[U-Boot] powerpc/t1040qds: Correct Maintainer name in boards.cfg
	http://patchwork.ozlabs.org/patch/286113/
 board/freescale/t1040qds/Makefile   |    3 +-
 board/freescale/t1040qds/ddr.c      |    3 +
 board/freescale/t1040qds/ddr.h      |   13 ++
 board/freescale/t1040qds/t1040emu.c |   75 +++++++
 board/freescale/t1040qds/tlb.c      |    4 +
 boards.cfg                          |    1 +
 include/configs/T1040EMU.h          |  408 +++++++++++++++++++++++++++++++++++
 7 files changed, 506 insertions(+), 1 deletions(-)
 create mode 100644 board/freescale/t1040qds/t1040emu.c
 create mode 100644 include/configs/T1040EMU.h
board/freescale/t1040qds/Makefile +2 -1
index 8f0057b..4bd7103 100644
@@ -8,7 +8,8 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS-y	+= $(BOARD).o
+COBJS-$(CONFIG_T1040QDS) += t1040qds.o
+COBJS-$(CONFIG_T1040EMU) += t1040emu.o
 COBJS-y	+= ddr.o
 COBJS-$(CONFIG_PCI)     += pci.o
 COBJS-y	+= law.o
board/freescale/t1040qds/ddr.c +3 -0
index 16ab829..d46021b 100644
@@ -123,6 +123,9 @@ phys_size_t initdram(int board_type)
 	puts("Initializing....using SPD\n");
 
 	dram_size = fsl_ddr_sdram();
+#ifdef CONFIG_T1040EMU
+	dram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
+#endif
 
 	dram_size = setup_ddr_tlbs(dram_size / 0x100000);
 	dram_size *= 0x100000;
board/freescale/t1040qds/ddr.h +13 -0
index 4a4f76a..5e0a078 100644
@@ -54,6 +54,18 @@ struct board_specific_parameters {
  * for each n_ranks group.
  */
 
+#ifdef CONFIG_T1040EMU
+static const struct board_specific_parameters udimm0[] = {
+	/*
+	 * memory controller 0
+	 *   num|  hi| rank|  clk| wrlvl |   wrlvl   |  wrlvl | cpo  |wrdata|2T
+	 * ranks| mhz| GB  |adjst| start |   ctl2    |  ctl3  |      |delay |
+	 */
+	{2,  2140,  4,  4,   8, 0x0, 0x0,   0xff,    2,  0},
+	{1,  2140,  4,  4,   8, 0x0, 0x0,   0xff,    2,  0},
+	{}
+};
+#else
 static const struct board_specific_parameters udimm0[] = {
 	/*
 	 * memory controller 0
@@ -72,6 +84,7 @@ static const struct board_specific_parameters udimm0[] = {
 	{1,  2140, 0, 4,     8, 0x090a0b0c, 0x0e0f100b,   0xff,    2,  0},
 	{}
 };
+#endif
 
 static const struct board_specific_parameters *udimms[] = {
 	udimm0,
board/freescale/t1040qds/t1040emu.c new file +75 -0

75 lines not on this page · raw message

board/freescale/t1040qds/tlb.c +4 -0
index 412c591..0bc3960 100644
@@ -53,15 +53,19 @@ struct fsl_e_tlb_entry tlb_table[] = {
 		      MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
 		      0, 2, BOOKE_PAGESZ_256M, 1),
 
+#ifdef CONFIG_SYS_PCIE1_MEM_PHYS
 	/* *I*G* - PCI */
 	SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_MEM_VIRT, CONFIG_SYS_PCIE1_MEM_PHYS,
 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
 		      0, 3, BOOKE_PAGESZ_1G, 1),
+#endif
 
+#ifdef CONFIG_SYS_PCIE1_IO_PHYS
 	/* *I*G* - PCI I/O */
 	SET_TLB_ENTRY(1, CONFIG_SYS_PCIE1_IO_VIRT, CONFIG_SYS_PCIE1_IO_PHYS,
 		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
 		      0, 4, BOOKE_PAGESZ_256K, 1),
+#endif
 
 	/* Bman/Qman */
 #ifdef CONFIG_SYS_BMAN_MEM_PHYS
boards.cfg +1 -0
index dfe1c59..11efdd4 100644
@@ -962,6 +962,7 @@ Active  powerpc     mpc85xx        -           freescale       t4qds
 Active  powerpc     mpc85xx        -           freescale       t4qds               T4240QDS_SDCARD                      T4240QDS:PPC_T4240,RAMBOOT_PBL,SDCARD,SYS_TEXT_BASE=0xFFF80000                                                                    -
 Active  powerpc     mpc85xx        -           freescale       t4qds               T4240QDS_SPIFLASH                    T4240QDS:PPC_T4240,RAMBOOT_PBL,SPIFLASH,SYS_TEXT_BASE=0xFFF80000                                                                  -
 Active  powerpc     mpc85xx        -           freescale       t4qds               T4240QDS_SRIO_PCIE_BOOT              T4240QDS:PPC_T4240,SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF80000                                                                  -
+Active  powerpc     mpc85xx        -           freescale       t1040qds            T1040EMU                             T1040EMU:PPC_T1040                                                                                                                Poonam Aggrwal <[email protected]>
 Active  powerpc     mpc85xx        -           freescale       t1040qds            T1040QDS                             T1040QDS:PPC_T1040                                                                                                                Poonam Aggrwal <[email protected]>
 Active  powerpc     mpc85xx        -           gdsys           p1022               controlcenterd_36BIT_SDCARD          controlcenterd:36BIT,SDCARD                                                                                                       Dirk Eibach <[email protected]>
 Active  powerpc     mpc85xx        -           gdsys           p1022               controlcenterd_36BIT_SDCARD_DEVELOP  controlcenterd:36BIT,SDCARD,DEVELOP                                                                                               Dirk Eibach <[email protected]>
include/configs/T1040EMU.h new file +408 -0

408 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 powerpc/T1040EMU: Add T1040 emulator support

Dear Priyanka Jain,

Quoted 9 lines · In message <[email protected]> you…

Add emulator support for T1040. Emulator has limited peripherals and interfaces.
Difference between T1040QDS and emulator includes:

(quoted diff) +0 -6
-ECC for DDR is disabled due to procedure to load images
-Depends on raw timing for DDR initialization
-No board FPGA (Qixis)
-No PCI
-No SPI
-No flash support

...

Quoted 17 lines
include/configs/T1040EMU.h new file +11 -0
new file mode 100644
index 0000000..7005cb1
@@ -0,0 +1,408 @@
+/*
+ * Copyright 2013 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.
+ *

include/configs/T1040EMU.h line 21

Quoted 10 lines
include/configs/T1040EMU.h new file +10 -0
+ * 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
+ */

Please convert to SPDX ID.

include/configs/T1040EMU.h line 101

Quoted 2 lines
include/configs/T1040EMU.h new file +2 -0
+#define CONFIG_SYS_MEMTEST_START	0x00200000	/* memtest works on */
+#define CONFIG_SYS_MEMTEST_END		0x00400000

Does this really make sense?

include/configs/T1040EMU.h line 205

Quoted 4 lines
include/configs/T1040EMU.h new file +4 -0
+/* Serial Port - controlled on board with jumper J8
+ * open - index 2
+ * shorted - index 1
+ */

Incorrect multiline comment style.

include/configs/T1040EMU.h line 233

Quoted 3 lines
include/configs/T1040EMU.h new file +3 -0
+/* new uImage format support */
+#define CONFIG_FIT
+#define CONFIG_FIT_VERBOSE	/* enable fit_format_{error,warning}() */

Strictly speaking, FIT image and uImage are completely different things. FIT is _not_ "new uImage".

include/configs/T1040EMU.h line 287

Quoted 1 line
include/configs/T1040EMU.h new file +1 -0
+#define CONFIG_SYS_PROMPT	"=> "		/* Monitor Command Prompt */

No need to redefine the default.

include/configs/T1040EMU.h line 327

Quoted 3 lines
include/configs/T1040EMU.h new file +3 -0
+#define	CONFIG_EXTRA_ENV_SETTINGS				\
+	"hwconfig=fsl_ddr:ctlr_intlv=cacheline,"		\
+	"bank_intlv=cs0_cs1;"					\

It appears hwconfig is not NUL terminated?

include/configs/T1040EMU.h line 336

Quoted 9 lines
include/configs/T1040EMU.h new file +9 -0
+	"netdev=eth0\0"						\
+	"uboot=" __stringify(CONFIG_UBOOTPATH) "\0"		\
+	"ubootaddr=" __stringify(CONFIG_SYS_TEXT_BASE) "\0"	\
+	"tftpflash=tftpboot $loadaddr $uboot && "		\
+	"protect off $ubootaddr +$filesize && "			\
+	"erase $ubootaddr +$filesize && "			\
+	"cp.b $loadaddr $ubootaddr $filesize && "		\
+	"protect on $ubootaddr +$filesize && "			\
+	"cmp.b $loadaddr $ubootaddr $filesize\0"		\

I'd recommend to use indentation to show where the next command starts.

include/configs/T1040EMU.h line 343

Quoted 1 line
include/configs/T1040EMU.h new file +1 -0
+	"c=ffe\0"

I sthis intentional? What's the sense?

include/configs/T1040EMU.h line 358

Quoted 11 lines
include/configs/T1040EMU.h new file +11 -0
+#define CONFIG_PROOF_POINTS			\
+	"setenv bootargs root=/dev/$bdev rw "		\
+	"console=$consoledev,$baudrate $othbootargs;"	\
+	"cpu 1 release 0x29000000 - - -;"              \
+	"cpu 2 release 0x29000000 - - -;"              \
+	"cpu 3 release 0x29000000 - - -;"              \
+	"cpu 4 release 0x29000000 - - -;"              \
+	"cpu 5 release 0x29000000 - - -;"              \
+	"cpu 6 release 0x29000000 - - -;"              \
+	"cpu 7 release 0x29000000 - - -;"              \
+	"go 0x29000000"					\

Not NUL terminated?

include/configs/T1040EMU.h line 368

Quoted 10 lines
include/configs/T1040EMU.h new file +10 -0
+	"setenv bootargs root=/dev/$bdev rw "		\
+	"console=$consoledev,$baudrate $othbootargs;"	\
+	"cpu 1 release 0x29000000 - - -;"		\
+	"cpu 2 release 0x29000000 - - -;"		\
+	"cpu 3 release 0x29000000 - - -;"		\
+	"cpu 4 release 0x29000000 - - -;"		\
+	"cpu 5 release 0x29000000 - - -;"		\
+	"cpu 6 release 0x29000000 - - -;"		\
+	"cpu 7 release 0x29000000 - - -;"		\
+	"go 0x29000000"

Intentionally duplicated?

include/configs/T1040EMU.h line 376

Quoted 7 lines
include/configs/T1040EMU.h new file +7 -0
+#define CONFIG_LINUX                       \
+	"setenv bootargs root=/dev/ram rw "            \
+	"console=$consoledev,$baudrate $othbootargs;"  \
+	"setenv ramdiskaddr 0x02000000;"               \
+	"setenv fdtaddr 0x00c00000;"		       \
+	"setenv loadaddr 0x1000000;"		       \
+	"bootm $loadaddr $ramdiskaddr $fdtaddr"

Not NUL terminated?

include/configs/T1040EMU.h line 383

Quoted 6 lines
include/configs/T1040EMU.h new file +6 -0
+#define CONFIG_HDBOOT					\
+	"setenv bootargs root=/dev/$bdev rw "		\
+	"console=$consoledev,$baudrate $othbootargs;"	\
+	"tftp $loadaddr $bootfile;"			\
+	"tftp $fdtaddr $fdtfile;"			\
+	"bootm $loadaddr - $fdtaddr"

Not NUL terminated?

include/configs/T1040EMU.h line 392

Quoted 8 lines
include/configs/T1040EMU.h new file +8 -0
+#define CONFIG_NFSBOOTCOMMAND			\
+	"setenv bootargs root=/dev/nfs rw "	\
+	"nfsroot=$serverip:$rootpath "		\
+	"ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off " \
+	"console=$consoledev,$baudrate $othbootargs;"	\
+	"tftp $loadaddr $bootfile;"		\
+	"tftp $fdtaddr $fdtfile;"		\
+	"bootm $loadaddr - $fdtaddr"

Not NUL terminated?

include/configs/T1040EMU.h line 400

Quoted 7 lines
include/configs/T1040EMU.h new file +7 -0
+#define CONFIG_RAMBOOTCOMMAND				\
+	"setenv bootargs root=/dev/ram rw "		\
+	"console=$consoledev,$baudrate $othbootargs;"	\
+	"tftp $ramdiskaddr $ramdiskfile;"		\
+	"tftp $loadaddr $bootfile;"			\
+	"tftp $fdtaddr $fdtfile;"			\
+	"bootm $loadaddr $ramdiskaddr $fdtaddr"

Not NUL terminated?

In general, this is a pretty mess of env settings, that could greatly be simplified if you'd restructure things, like factoring out stuff that repeats again and again.

Best regards,

Wolfgang Denk

Signature · 7 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 shortest unit of time in the multiverse is the News York  Second,
defined  as  the  period  of  time between the traffic lights turning
green and the cab behind you honking.
                                - Terry Pratchett, _Lords and Ladies_