diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 15:02:27 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 15:02:27 -0400 |
| commit | 1fdb24e969110fafea36d3b393bea438f702c87f (patch) | |
| tree | 47a1dfef8a259e7922285315f8a02d31b4efe2f1 /arch/arm/boot/compressed | |
| parent | f362f98e7c445643d27c610bb7a86b79727b592e (diff) | |
| parent | 531a6a941745e1e045dd2a6bd09e1dc01247a5f3 (diff) | |
Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm
* 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: (178 commits)
ARM: 7139/1: fix compilation with CONFIG_ARM_ATAG_DTB_COMPAT and large TEXT_OFFSET
ARM: gic, local timers: use the request_percpu_irq() interface
ARM: gic: consolidate PPI handling
ARM: switch from NO_MACH_MEMORY_H to NEED_MACH_MEMORY_H
ARM: mach-s5p64x0: remove mach/memory.h
ARM: mach-s3c64xx: remove mach/memory.h
ARM: plat-mxc: remove mach/memory.h
ARM: mach-prima2: remove mach/memory.h
ARM: mach-zynq: remove mach/memory.h
ARM: mach-bcmring: remove mach/memory.h
ARM: mach-davinci: remove mach/memory.h
ARM: mach-pxa: remove mach/memory.h
ARM: mach-ixp4xx: remove mach/memory.h
ARM: mach-h720x: remove mach/memory.h
ARM: mach-vt8500: remove mach/memory.h
ARM: mach-s5pc100: remove mach/memory.h
ARM: mach-tegra: remove mach/memory.h
ARM: plat-tcc: remove mach/memory.h
ARM: mach-mmp: remove mach/memory.h
ARM: mach-cns3xxx: remove mach/memory.h
...
Fix up mostly pretty trivial conflicts in:
- arch/arm/Kconfig
- arch/arm/include/asm/localtimer.h
- arch/arm/kernel/Makefile
- arch/arm/mach-shmobile/board-ap4evb.c
- arch/arm/mach-u300/core.c
- arch/arm/mm/dma-mapping.c
- arch/arm/mm/proc-v7.S
- arch/arm/plat-omap/Kconfig
largely due to some CONFIG option renaming (ie CONFIG_PM_SLEEP ->
CONFIG_ARM_CPU_SUSPEND for the arm-specific suspend code etc) and
addition of NEED_MACH_MEMORY_H next to HAVE_IDE.
Diffstat (limited to 'arch/arm/boot/compressed')
| -rw-r--r-- | arch/arm/boot/compressed/.gitignore | 9 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/Makefile | 32 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/atags_to_fdt.c | 97 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/head.S | 122 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/libfdt_env.h | 15 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/misc.c | 42 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/string.c | 127 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/vmlinux.lds.in | 4 |
8 files changed, 396 insertions, 52 deletions
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore index c6028967d336..e0936a148516 100644 --- a/arch/arm/boot/compressed/.gitignore +++ b/arch/arm/boot/compressed/.gitignore | |||
| @@ -5,3 +5,12 @@ piggy.lzo | |||
| 5 | piggy.lzma | 5 | piggy.lzma |
| 6 | vmlinux | 6 | vmlinux |
| 7 | vmlinux.lds | 7 | vmlinux.lds |
| 8 | |||
| 9 | # borrowed libfdt files | ||
| 10 | fdt.c | ||
| 11 | fdt.h | ||
| 12 | fdt_ro.c | ||
| 13 | fdt_rw.c | ||
| 14 | fdt_wip.c | ||
| 15 | libfdt.h | ||
| 16 | libfdt_internal.h | ||
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index a6b30b35ca65..21f56ff32797 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
| @@ -26,6 +26,10 @@ HEAD = head.o | |||
| 26 | OBJS += misc.o decompress.o | 26 | OBJS += misc.o decompress.o |
| 27 | FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c | 27 | FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c |
| 28 | 28 | ||
| 29 | # string library code (-Os is enforced to keep it much smaller) | ||
| 30 | OBJS += string.o | ||
| 31 | CFLAGS_string.o := -Os | ||
| 32 | |||
| 29 | # | 33 | # |
| 30 | # Architecture dependencies | 34 | # Architecture dependencies |
| 31 | # | 35 | # |
| @@ -89,21 +93,41 @@ suffix_$(CONFIG_KERNEL_GZIP) = gzip | |||
| 89 | suffix_$(CONFIG_KERNEL_LZO) = lzo | 93 | suffix_$(CONFIG_KERNEL_LZO) = lzo |
| 90 | suffix_$(CONFIG_KERNEL_LZMA) = lzma | 94 | suffix_$(CONFIG_KERNEL_LZMA) = lzma |
| 91 | 95 | ||
| 96 | # Borrowed libfdt files for the ATAG compatibility mode | ||
| 97 | |||
| 98 | libfdt := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c | ||
| 99 | libfdt_hdrs := fdt.h libfdt.h libfdt_internal.h | ||
| 100 | |||
| 101 | libfdt_objs := $(addsuffix .o, $(basename $(libfdt))) | ||
| 102 | |||
| 103 | $(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/% | ||
| 104 | $(call cmd,shipped) | ||
| 105 | |||
| 106 | $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \ | ||
| 107 | $(addprefix $(obj)/,$(libfdt_hdrs)) | ||
| 108 | |||
| 109 | ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) | ||
| 110 | OBJS += $(libfdt_objs) atags_to_fdt.o | ||
| 111 | endif | ||
| 112 | |||
| 92 | targets := vmlinux vmlinux.lds \ | 113 | targets := vmlinux vmlinux.lds \ |
| 93 | piggy.$(suffix_y) piggy.$(suffix_y).o \ | 114 | piggy.$(suffix_y) piggy.$(suffix_y).o \ |
| 94 | font.o font.c head.o misc.o $(OBJS) | 115 | lib1funcs.o lib1funcs.S font.o font.c head.o misc.o $(OBJS) |
| 95 | 116 | ||
| 96 | # Make sure files are removed during clean | 117 | # Make sure files are removed during clean |
| 97 | extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S | 118 | extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S $(libfdt) $(libfdt_hdrs) |
| 98 | 119 | ||
| 99 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | 120 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
| 100 | ORIG_CFLAGS := $(KBUILD_CFLAGS) | 121 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
| 101 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 122 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
| 102 | endif | 123 | endif |
| 103 | 124 | ||
| 104 | ccflags-y := -fpic -fno-builtin | 125 | ccflags-y := -fpic -fno-builtin -I$(obj) |
| 105 | asflags-y := -Wa,-march=all | 126 | asflags-y := -Wa,-march=all |
| 106 | 127 | ||
| 128 | # Supply kernel BSS size to the decompressor via a linker symbol. | ||
| 129 | KBSS_SZ = $(shell size $(obj)/../../../../vmlinux | awk 'END{print $$3}') | ||
| 130 | LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) | ||
| 107 | # Supply ZRELADDR to the decompressor via a linker symbol. | 131 | # Supply ZRELADDR to the decompressor via a linker symbol. |
| 108 | ifneq ($(CONFIG_AUTO_ZRELADDR),y) | 132 | ifneq ($(CONFIG_AUTO_ZRELADDR),y) |
| 109 | LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) | 133 | LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) |
| @@ -123,7 +147,7 @@ LDFLAGS_vmlinux += -T | |||
| 123 | # For __aeabi_uidivmod | 147 | # For __aeabi_uidivmod |
| 124 | lib1funcs = $(obj)/lib1funcs.o | 148 | lib1funcs = $(obj)/lib1funcs.o |
| 125 | 149 | ||
| 126 | $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE | 150 | $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S |
| 127 | $(call cmd,shipped) | 151 | $(call cmd,shipped) |
| 128 | 152 | ||
| 129 | # We need to prevent any GOTOFF relocs being used with references | 153 | # We need to prevent any GOTOFF relocs being used with references |
diff --git a/arch/arm/boot/compressed/atags_to_fdt.c b/arch/arm/boot/compressed/atags_to_fdt.c new file mode 100644 index 000000000000..6ce11c481178 --- /dev/null +++ b/arch/arm/boot/compressed/atags_to_fdt.c | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | #include <asm/setup.h> | ||
| 2 | #include <libfdt.h> | ||
| 3 | |||
| 4 | static int node_offset(void *fdt, const char *node_path) | ||
| 5 | { | ||
| 6 | int offset = fdt_path_offset(fdt, node_path); | ||
| 7 | if (offset == -FDT_ERR_NOTFOUND) | ||
| 8 | offset = fdt_add_subnode(fdt, 0, node_path); | ||
| 9 | return offset; | ||
| 10 | } | ||
| 11 | |||
| 12 | static int setprop(void *fdt, const char *node_path, const char *property, | ||
| 13 | uint32_t *val_array, int size) | ||
| 14 | { | ||
| 15 | int offset = node_offset(fdt, node_path); | ||
| 16 | if (offset < 0) | ||
| 17 | return offset; | ||
| 18 | return fdt_setprop(fdt, offset, property, val_array, size); | ||
| 19 | } | ||
| 20 | |||
| 21 | static int setprop_string(void *fdt, const char *node_path, | ||
| 22 | const char *property, const char *string) | ||
| 23 | { | ||
| 24 | int offset = node_offset(fdt, node_path); | ||
| 25 | if (offset < 0) | ||
| 26 | return offset; | ||
| 27 | return fdt_setprop_string(fdt, offset, property, string); | ||
| 28 | } | ||
| 29 | |||
| 30 | static int setprop_cell(void *fdt, const char *node_path, | ||
| 31 | const char *property, uint32_t val) | ||
| 32 | { | ||
| 33 | int offset = node_offset(fdt, node_path); | ||
| 34 | if (offset < 0) | ||
| 35 | return offset; | ||
| 36 | return fdt_setprop_cell(fdt, offset, property, val); | ||
| 37 | } | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Convert and fold provided ATAGs into the provided FDT. | ||
| 41 | * | ||
| 42 | * REturn values: | ||
| 43 | * = 0 -> pretend success | ||
| 44 | * = 1 -> bad ATAG (may retry with another possible ATAG pointer) | ||
| 45 | * < 0 -> error from libfdt | ||
| 46 | */ | ||
| 47 | int atags_to_fdt(void *atag_list, void *fdt, int total_space) | ||
| 48 | { | ||
| 49 | struct tag *atag = atag_list; | ||
| 50 | uint32_t mem_reg_property[2 * NR_BANKS]; | ||
| 51 | int memcount = 0; | ||
| 52 | int ret; | ||
| 53 | |||
| 54 | /* make sure we've got an aligned pointer */ | ||
| 55 | if ((u32)atag_list & 0x3) | ||
| 56 | return 1; | ||
| 57 | |||
| 58 | /* if we get a DTB here we're done already */ | ||
| 59 | if (*(u32 *)atag_list == fdt32_to_cpu(FDT_MAGIC)) | ||
| 60 | return 0; | ||
| 61 | |||
| 62 | /* validate the ATAG */ | ||
| 63 | if (atag->hdr.tag != ATAG_CORE || | ||
| 64 | (atag->hdr.size != tag_size(tag_core) && | ||
| 65 | atag->hdr.size != 2)) | ||
| 66 | return 1; | ||
| 67 | |||
| 68 | /* let's give it all the room it could need */ | ||
| 69 | ret = fdt_open_into(fdt, fdt, total_space); | ||
| 70 | if (ret < 0) | ||
| 71 | return ret; | ||
| 72 | |||
| 73 | for_each_tag(atag, atag_list) { | ||
| 74 | if (atag->hdr.tag == ATAG_CMDLINE) { | ||
