Skip to contentSkip to conversation

unicore32 core architecture: booting process

PATCH In review Guan Xuetao 1 participant 1 message Dec 25, 2010 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 12/12 unicore32 core architecture: booting process

From: Guan Xuetao <[email protected]>

Patch 12 implements booting process before uncompressed.

---
 arch/unicore32/boot/Makefile                  |   47 ++++++
 arch/unicore32/boot/compressed/Makefile       |   71 +++++++++
 arch/unicore32/boot/compressed/head.S         |  203 +++++++++++++++++++++++++
 arch/unicore32/boot/compressed/misc.c         |  126 +++++++++++++++
 arch/unicore32/boot/compressed/piggy.S.in     |    6 +
 arch/unicore32/boot/compressed/vmlinux.lds.in |   61 ++++++++
 arch/unicore32/include/asm/mach/uncompress.h  |   34 ++++
 7 files changed, 548 insertions(+), 0 deletions(-)
arch/unicore32/boot/Makefile new file +47 -0
new file mode 100644
index 0000000..79e5f88
@@ -0,0 +1,47 @@
+#
+# arch/unicore32/boot/Makefile
+#
+# This file is included by the global makefile so that you can add your own
+# architecture-specific flags and dependencies.
+#
+# This file is subject to the terms and conditions of the GNU General Public
+# License.  See the file "COPYING" in the main directory of this archive
+# for more details.
+#
+# Copyright (C) 2001~2010 GUAN Xue-tao
+#
+
+MKIMAGE := $(srctree)/scripts/mkuboot.sh
+
+targets := Image zImage uImage
+
+$(obj)/Image: vmlinux FORCE
+	$(call if_changed,objcopy)
+	@echo '  Kernel: $@ is ready'
+
+$(obj)/compressed/vmlinux: $(obj)/Image FORCE
+	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
+
+$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
+	$(call if_changed,objcopy)
+	@echo '  Kernel: $@ is ready'
+
+quiet_cmd_uimage = UIMAGE  $@
+      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A unicore -O linux -T kernel \
+		   -C none -a $(LOADADDR) -e $(STARTADDR) \
+		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
+
+$(obj)/uImage: LOADADDR=0x0
+
+$(obj)/uImage: STARTADDR=$(LOADADDR)
+
+$(obj)/uImage: $(obj)/zImage FORCE
+	$(call if_changed,uimage)
+	@echo '  Image $@ is ready'
+
+PHONY += initrd FORCE
+initrd:
+	@test "$(INITRD)" != "" || \
+	(echo You must specify INITRD; exit -1)
+
+subdir- := compressed
arch/unicore32/boot/compressed/Makefile new file +71 -0

71 lines not on this page · raw message

arch/unicore32/boot/compressed/head.S new file +203 -0

203 lines not on this page · raw message

arch/unicore32/boot/compressed/misc.c new file +126 -0

126 lines not on this page · raw message

arch/unicore32/boot/compressed/piggy.S.in new file +6 -0
new file mode 100644
index 0000000..b79704d
@@ -0,0 +1,6 @@
+	.section .piggydata,#alloc
+	.globl	input_data
+input_data:
+	.incbin	"arch/unicore32/boot/compressed/piggy.DECOMP_SUFFIX"
+	.globl	input_data_end
+input_data_end:
arch/unicore32/boot/compressed/vmlinux.lds.in new file +61 -0

61 lines not on this page · raw message

arch/unicore32/include/asm/mach/uncompress.h new file +34 -0
new file mode 100644
index 0000000..4610e3d
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/unicore32/mach-puv3/include/mach/uncompress.h
+ *
+ * Code specific to PKUnity SoC and UniCore ISA
+ *
+ * Copyright (C) 2001-2010 GUAN Xue-tao
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __MACH_PUV3_UNCOMPRESS_H__
+#define __MACH_PUV3_UNCOMPRESS_H__
+
+#include "hardware.h"
+#include "ocd.h"
+
+extern char input_data[];
+extern char input_data_end[];
+
+static void arch_decomp_puts(const char *ptr)
+{
+	char c;
+
+	while ((c = *ptr++) != '\0') {
+		if (c == '\n')
+			putc('\r');
+		putc(c);
+	}
+}
+#define ARCH_HAVE_DECOMP_PUTS
+
+#endif /* __MACH_PUV3_UNCOMPRESS_H__ */