Skip to contentSkip to conversation

powerpc/85xx: Add P1023RDB board support

PATCH Superseded Chunhe Lan 6 participants 6 messages Apr 16, 2013 – Apr 17, 2013

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Chunhe Lan

author
#0 lore raw

PATCH 1/1 powerpc/85xx: Add P1023RDB board support

P1023RDB Specification:
-----------------------
Memory subsystem:
512MB DDR3 (Fixed DDR on board)
64MB NOR flash
128MB NAND flash

Ethernet:
eTSEC1: Connected to Atheros AR8035 GETH PHY
eTSEC2: Connected to Atheros AR8035 GETH PHY

PCIe:
Three mini-PCIe slots

USB: Two USB2.0 Type A ports

I2C:
AT24C08 8K Board EEPROM (8 bit address)

---
 board/freescale/p1023rdb/Makefile   |   32 +++
 board/freescale/p1023rdb/law.c      |   34 +++
 board/freescale/p1023rdb/p1023rdb.c |  194 ++++++++++++++++
 board/freescale/p1023rdb/tlb.c      |  116 ++++++++++
 boards.cfg                          |    1 +
 include/configs/P1023RDB.h          |  433 +++++++++++++++++++++++++++++++++++
 6 files changed, 810 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/p1023rdb/Makefile
 create mode 100644 board/freescale/p1023rdb/law.c
 create mode 100644 board/freescale/p1023rdb/p1023rdb.c
 create mode 100644 board/freescale/p1023rdb/tlb.c
 create mode 100644 include/configs/P1023RDB.h
board/freescale/p1023rdb/Makefile new file +32 -0
new file mode 100644
index 0000000..c8e0866
@@ -0,0 +1,32 @@
+#
+# Copyright 2013 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS-y	+= $(BOARD).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))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/freescale/p1023rdb/law.c new file +34 -0
new file mode 100644
index 0000000..b041d1f
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ *
+ * 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[] = {
+	SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
+	SET_LAW(CONFIG_SYS_QMAN_MEM_PHYS, LAW_SIZE_4M,
+					LAW_TRGT_IF_DPAA_SWP_SRAM),
+	SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+};
+
+int num_law_entries = ARRAY_SIZE(law_table);
board/freescale/p1023rdb/p1023rdb.c new file +194 -0

194 lines not on this page · raw message

board/freescale/p1023rdb/tlb.c new file +116 -0

116 lines not on this page · raw message

boards.cfg +1 -0
index f785da8..d0db248 100644
@@ -815,6 +815,7 @@ P1022DS_36BIT_SPIFLASH       powerpc     mpc85xx     p1022ds             freesca
 P1022DS_SDCARD               powerpc     mpc85xx     p1022ds             freescale	-	    P1022DS:SDCARD
 P1022DS_36BIT_SDCARD         powerpc     mpc85xx     p1022ds             freescale	-	    P1022DS:36BIT,SDCARD
 P1022DS_36BIT                powerpc     mpc85xx     p1022ds             freescale      -           P1022DS:36BIT
+P1023RDB                     powerpc     mpc85xx     p1023rdb            freescale      -           P1023RDB
 P1023RDS                     powerpc     mpc85xx     p1023rds            freescale      -           P1023RDS
 P1023RDS_NAND                powerpc     mpc85xx     p1023rds            freescale      -           P1023RDS:NAND
 P1024RDB                     powerpc     mpc85xx     p1_p2_rdb_pc        freescale      -           p1_p2_rdb_pc:P1024RDB
include/configs/P1023RDB.h new file +433 -0

433 lines not on this page · raw message

Signature · 1 line
1.7.6.5
#1 lore raw

PATCH 1/1 powerpc/85xx: Add P1023RDB board support

include/configs/P1023RDB.h line 213

Quoted 3 lines · Chunhe Lan
include/configs/P1023RDB.h new file +2 -0
+#define CONFIG_SYS_BAUDRATE_TABLE      \
+       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}

It's amazing that Freescale is still producing board files that are missing 57,600 baud.

#2 lore raw

PATCH 1/1 powerpc/85xx: Add P1023RDB board support

Quoted 8 lines · Timur Tabi

include/configs/P1023RDB.h line 213

Quoted 3 lines · Chunhe Lan
include/configs/P1023RDB.h new file +2 -0
+#define CONFIG_SYS_BAUDRATE_TABLE      \
+       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}

It's amazing that Freescale is still producing board files that are missing 57,600 baud.

When they could just use the default table?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130416/15bb2929/attachment.pgp>
#3 lore raw

PATCH 1/1 powerpc/85xx: Add P1023RDB board support

In reply to Chunhe Lan
Quoted 8 lines · Chunhe Lan

P1023RDB Specification:
-----------------------
Memory subsystem:
512MB DDR3 (Fixed DDR on board)
64MB NOR flash
128MB NAND flash

Chunhe, what is the orderable part number of this board, I don't see anything on the FSL web page with the description above.

Regards

Sinan Akman

#4 lore raw

PATCH 1/1 powerpc/85xx: Add P1023RDB board support

Quoted 9 lines · Sinan Akman
Quoted 7 lines · Chunhe Lan

P1023RDB Specification:
-----------------------
Memory subsystem:
512MB DDR3 (Fixed DDR on board)
64MB NOR flash
128MB NAND flash

Quoted 3 lines

Chunhe, what is the orderable part number of this board, I don't see anything on the FSL web page with the description above.

Now, Freescale is developing it, and does not normally release it.

Thanks,
-Chunhe

Quoted 5 lines

Regards

Sinan Akman

#5 lore raw

PATCH 1/1 powerpc/85xx: Add P1023RDB board support

In reply to Chunhe Lan
Quoted 43 lines · Chunhe Lan
board/freescale/p1023rdb/tlb.c new file +3 -0
+struct fsl_e_tlb_entry tlb_table[] = {
+	/* TLB 0 - for temp stack in cache */
+	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,  

CONFIG_SYS_INIT_RAM_ADDR,

board/freescale/p1023rdb/tlb.c new file +29 -0
+		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
+		      0, 0, BOOKE_PAGESZ_4K, 0),
+	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
+		      CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
+		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
+		      0, 0, BOOKE_PAGESZ_4K, 0),
+	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
+		      CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
+		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
+		      0, 0, BOOKE_PAGESZ_4K, 0),
+	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
+		      CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
+		      MAS3_SX|MAS3_SW|MAS3_SR, 0,
+		      0, 0, BOOKE_PAGESZ_4K, 0),
+
+	/* TLB 1 */
+	/* *I*** - Covers boot page */
+	SET_TLB_ENTRY(1, 0xfffff000, 0xfffff000,
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I,
+		      0, 0, BOOKE_PAGESZ_4K, 1),
+
+	/* *I*G* - CCSRBAR */
+	SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+		      0, 1, BOOKE_PAGESZ_4M, 1),
+
+	/* W**G* - Flash/promjet, localbus */
+	/* This will be changed to *I*G* after relocation to RAM. */
+	SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE,  

CONFIG_SYS_FLASH_BASE_PHYS,

board/freescale/p1023rdb/tlb.c new file +5 -0
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_W|MAS2_G,
+		      0, 2, BOOKE_PAGESZ_256M, 1),
+
+	/* *I*G* - PCI */
+	SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT,  

CONFIG_SYS_PCIE3_MEM_PHYS,

board/freescale/p1023rdb/tlb.c new file +3 -0
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+		      0, 3, BOOKE_PAGESZ_1G, 1),
+

board/freescale/p1023rdb/tlb.c line 75

Quoted 10 lines
board/freescale/p1023rdb/tlb.c new file +10 -0
+	/* *I*G* - PCI */
+	SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x40000000,
+		      CONFIG_SYS_PCIE3_MEM_PHYS + 0x40000000,
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+		      0, 4, BOOKE_PAGESZ_256M, 1),
+
+	SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x50000000,
+		      CONFIG_SYS_PCIE3_MEM_PHYS + 0x50000000,
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+		      0, 5, BOOKE_PAGESZ_256M, 1),

Do not use MAS3_SX on I/O mappings. The G bit does not prevent speculative instruction fetches.

Review

Quoted 5 lines
(quoted diff) +2 -0
+	/* *I*G - NAND */
+	SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE,  

CONFIG_SYS_NAND_BASE_PHYS,

(quoted diff) +2 -0
+		      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+		      0, 11, BOOKE_PAGESZ_1M, 1),

Why do you need 1M for NAND? There's only 8K of stuff there.

Quoted 16 lines

+/*
+ * Memory map
+ *
+ * 0x0000_0000 0x1fff_ffff DDR 500M
Cacheable
+ * 0x8000_0000 0xbfff_ffff PCI Express Mem 1G
non-cacheable
+ * 0xc000_0000 0xdfff_ffff PCI 512M
non-cacheable
+ * 0xe100_0000 0xe3ff_ffff PCI IO range 4M
non-cacheable
+ *
+ * Localbus non-cacheable
+ *
+ * 0xec00_0000 0xefff_ffff NOR flash 64M NOR
flash

Quoted 8 lines

+ * 0xff00_0000 0xff3f_ffff DPAA_QBMAN 4M
+ * 0xff60_0000 0xff7f_ffff CCSR 2M
non-cacheable
+ * 0xffa0_0000 0xffaf_ffff NAND 1M
non-cacheable
+ * 0xffd0_0000 0xffd0_3fff L1 for stack 16K
Cacheable TLB0
+ */

L1 for stack is neither "localbus" nor "non-cacheable". If you don't want to distinguish that category, remove the comment.

[snip hundreds of lines of board config file]

Can we please refactor these board config headers to focus only on what's different from board to board? These patches are very hard to effectively review as is.

-Scott