[U-Boot-Users] [PATCH 5/8] New board SIMPC8313 support: nand_spl

Ron Madrid ron_madrid at sbcglobal.net
Fri May 30 20:15:16 CEST 2008


New board SIMPC8313 support: nand_spl

Signed-off-by: Ron Madrid
---
 nand_spl/board/sheldon/simpc8313/Makefile   |   91
+++++++++++++++++++++++++++
 nand_spl/board/sheldon/simpc8313/config.mk  |   50
+++++++++++++++
 nand_spl/board/sheldon/simpc8313/u-boot.lds |   65
+++++++++++++++++++
 3 files changed, 206 insertions(+), 0 deletions(-)
 create mode 100644
nand_spl/board/sheldon/simpc8313/Makefile
 create mode 100644
nand_spl/board/sheldon/simpc8313/config.mk
 create mode 100644
nand_spl/board/sheldon/simpc8313/u-boot.lds

diff --git a/nand_spl/board/sheldon/simpc8313/Makefile
b/nand_spl/board/sheldon/simpc8313/Makefile
new file mode 100644
index 0000000..3ebe00d
--- /dev/null
+++ b/nand_spl/board/sheldon/simpc8313/Makefile
@@ -0,0 +1,91 @@
+#
+# (C) Copyright 2008, Sheldon Instruments, Inc.
+# Adapted from Freescale MPC8313ERDB BSP
+#
+# (C) Copyright 2006
+# Stefan Roese, DENX Software Engineering,
sr at denx.de.
+#
+# 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
+include
$(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
+
+LDSCRIPT=
$(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
+LDFLAGS	= -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE)
$(PLATFORM_LDFLAGS)
+AFLAGS	+= -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_NAND_SPL
+
+SOBJS	= start.o
+COBJS	= sdram.o nand_boot.o nand_ecc.o
+
+SRCS	:= $(addprefix $(obj),$(SOBJS:.o=.S)
$(COBJS:.o=.c))
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS	:= $(SOBJS) $(COBJS)
+LNDIR	:= $(OBJTREE)/nand_spl/board/$(BOARDDIR)
+
+nandobj	:= $(OBJTREE)/nand_spl/
+
+ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin
$(nandobj)u-boot-spl-16k.bin
+
+all:	$(obj).depend $(ALL)
+
+$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
+	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary
$< $@
+
+$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
+	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(nandobj)u-boot-spl:	$(OBJS)
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM
$(__OBJS) \
+		-Map $(nandobj)u-boot-spl.map \
+		-o $(nandobj)u-boot-spl
+
+# from cpu directory
+$(obj)start.S:
+	@rm -f $(obj)start.S
+	ln -s $(SRCTREE)/cpu/mpc83xx/start.S $(obj)start.S
+
+# from board directory
+$(obj)sdram.c:
+	@rm -f $(obj)sdram.c
+	ln -s $(SRCTREE)/board/$(BOARDDIR)/sdram.c
$(obj)sdram.c
+
+$(obj)nand_boot.c:
+	@rm -f $(obj)nand_boot.c
+	ln -s $(SRCTREE)/board/$(BOARDDIR)/nand_boot.c
$(obj)nand_boot.c
+
+$(obj)nand_ecc.c:
+	@rm -f $(obj)nand_ecc.c
+	ln -s $(SRCTREE)/board/$(BOARDDIR)/nand_ecc.c
$(obj)nand_ecc.c
+
+#########################################################################
+
+$(obj)%.o:	$(obj)%.S
+	$(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o:	$(obj)%.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git
a/nand_spl/board/sheldon/simpc8313/config.mk
b/nand_spl/board/sheldon/simpc8313/config.mk
new file mode 100644
index 0000000..c8c2d9a
--- /dev/null
+++ b/nand_spl/board/sheldon/simpc8313/config.mk
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2008, Sheldon Instruments, Inc.
+# Adapted from Freescale MPC8313ERDB BSP
+#
+# (C) Copyright 2006
+# Stefan Roese, DENX Software Engineering,
sr at denx.de.
+#
+# 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
+#
+#
+# Sheldon Instrument SIMPC8313
+#
+#
+# TEXT_BASE for SPL:
+#
+# On Boot-from-NAND the FCM buffer is mapped to the
boot space. This
+# will be either 0x00000000 for low boot or
0xFFF00000 for high boot.
+# The u-boot NAND bootload is configured to use high
boot only so
+# that it does not conflict with the DDR memory which
is configured
+# at 0x00000000. Accordingly TEXT_BASE is set to the
high boot memory
+# space at 0xFFF00000.
+#
+TEXT_BASE = 0xFFF00000
+
+# PAD_TO used to generate a 16kByte binary needed for
the combined image
+# -> PAD_TO = TEXT_BASE + 0x4000
+ifndef PAD_TO
+PAD_TO  = 0xFFF20000
+endif
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif
+
diff --git
a/nand_spl/board/sheldon/simpc8313/u-boot.lds
b/nand_spl/board/sheldon/simpc8313/u-boot.lds
new file mode 100644
index 0000000..cbf9fe2
--- /dev/null
+++ b/nand_spl/board/sheldon/simpc8313/u-boot.lds
@@ -0,0 +1,65 @@
+/*
+ * (C) Copyright 2008, Sheldon Instruments, Inc.
+ * Adapted from Freescale MPC8313ERDB BSP
+ *
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering,
sr at denx.de.
+ *
+ * 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
+ */
+
+OUTPUT_ARCH(powerpc:common)
+SECTIONS
+{
+  .text      :
+  {
+    start.o	(.text)
+
+    *(.text)
+    *(.fixup)
+  }
+  _etext = .;
+
+  .reloc    :
+  {
+    _GOT_TABLE_ = .;
+    *(.got*)
+    __got_end = .;
+    *(.got2)
+  }
+  __got_entries = (__got_end - _GOT_TABLE_) >> 2;
+
+  .data    :
+  {
+    *(.rodata*)
+    *(.data*)
+    *(.sdata*)
+  }
+
+  _edata  =  .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss)
+   *(.bss)
+  }
+
+  _end = . ;
+}
-- 
1.5.5.1






More information about the U-Boot mailing list