s5pc100: universal ipl-onenand
authorByungho Min <bhmin@samsung.com>
Tue, 21 Jul 2009 02:48:49 +0000 (11:48 +0900)
committerByungho Min <bhmin@samsung.com>
Tue, 21 Jul 2009 02:48:49 +0000 (11:48 +0900)
onenand_ipl/board/samsung/universal [deleted symlink]
onenand_ipl/board/samsung/universal/Makefile [new file with mode: 0644]
onenand_ipl/board/samsung/universal/u-boot-onenand.lds [new file with mode: 0644]

diff --git a/onenand_ipl/board/samsung/universal b/onenand_ipl/board/samsung/universal
deleted file mode 120000 (symlink)
index 4bcd287..0000000
+++ /dev/null
@@ -1 +0,0 @@
-tickertape
\ No newline at end of file
diff --git a/onenand_ipl/board/samsung/universal/Makefile b/onenand_ipl/board/samsung/universal/Makefile
new file mode 100644 (file)
index 0000000..5d22482
--- /dev/null
@@ -0,0 +1,97 @@
+#
+#  Samsung TickerTape(S5PC100) board OneNAND IPL
+#
+#  Copyright (C) 2009 Samsung Electronics
+#  Minkyu Kang <mk7.kang@samsung.com>
+#
+# 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
+#TEXT_BASE = 0x22008000
+#TEXT_BASE = 0x00034000
+TEXT_BASE = 0xD0034000
+TEXT_BASE2K = 0xD0034800
+TEXT_BASE4K = 0xD0035000
+
+LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot-onenand.lds
+LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
+AFLAGS += -DCONFIG_ONENAND_IPL -g
+CFLAGS += -DCONFIG_ONENAND_IPL -g
+OBJCFLAGS += --gap-fill=0x00
+
+SOBJS  := lowlevel_init.o mem_setup.o
+SOBJS  += start.o
+COBJS  += onenand_read.o
+COBJS  += onenand_boot.o
+
+SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS := $(SOBJS) $(COBJS)
+LNDIR  := $(OBJTREE)/onenand_ipl/board/$(BOARDDIR)
+
+onenandobj     := $(OBJTREE)/onenand_ipl/
+
+ALL    = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin $(onenandobj)onenand-ipl-2k.bin $(onenandobj)onenand-ipl-4k.bin
+
+all:   $(obj).depend $(ALL)
+
+$(onenandobj)onenand-ipl-2k.bin:       $(onenandobj)onenand-ipl
+       $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(TEXT_BASE2K) -O binary $< $@
+
+$(onenandobj)onenand-ipl-4k.bin:       $(onenandobj)onenand-ipl
+       $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(TEXT_BASE4K) -O binary $< $@
+
+$(onenandobj)onenand-ipl.bin:  $(onenandobj)onenand-ipl
+       $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(onenandobj)onenand-ipl:      $(OBJS)
+       cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
+               -Map $@.map -o $@
+
+# create symbolic links from common files
+
+# from cpu directory
+$(obj)start.S:
+       @rm -f $@
+       ln -s $(SRCTREE)/cpu/$(CPU)/start.S $@
+
+$(obj)mem_setup.S:
+       ln -sf $(SRCTREE)/board/$(BOARDDIR)/mem_setup.S $@
+
+$(obj)lowlevel_init.S:
+       ln -sf $(SRCTREE)/board/$(BOARDDIR)/lowlevel_init.S $@
+
+# from onenand_ipl directory
+$(obj)onenand_ipl.h:
+       @rm -f $@
+       ln -s $(SRCTREE)/onenand_ipl/onenand_ipl.h $@
+
+$(obj)onenand_boot.c:  $(obj)onenand_ipl.h
+       @rm -f $@
+       ln -s $(SRCTREE)/onenand_ipl/onenand_boot.c $@
+
+$(obj)onenand_read.c:  $(obj)onenand_ipl.h
+       @rm -f $@
+       ln -s $(SRCTREE)/onenand_ipl/onenand_read.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
+
+clean:
+       rm onenand_boot.c onenand_read.c
+
+#########################################################################
diff --git a/onenand_ipl/board/samsung/universal/u-boot-onenand.lds b/onenand_ipl/board/samsung/universal/u-boot-onenand.lds
new file mode 100644 (file)
index 0000000..559f9f2
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * (C) Copyright 2005-2008 Samsung Electronics
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ *
+ * Derived from X-loader
+ *
+ * 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_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0x00000000;
+
+       . = ALIGN(4);
+       .text      :
+       {
+         start.o       (.text)
+         *(.text)
+       }
+
+       . = ALIGN(4);
+       .rodata : { *(.rodata) }
+
+       . = ALIGN(4);
+       .data : { *(.data) }
+
+       . = ALIGN(4);
+       .got : { *(.got) }
+
+       . = ALIGN(4);
+       __bss_start = .;
+       .bss : { *(.bss) }
+       _end = .;
+}