forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
524 changed files
with
7,566 additions
and
2,887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#include <asm/setup.h> | ||
#include <libfdt.h> | ||
|
||
static int node_offset(void *fdt, const char *node_path) | ||
{ | ||
int offset = fdt_path_offset(fdt, node_path); | ||
if (offset == -FDT_ERR_NOTFOUND) | ||
offset = fdt_add_subnode(fdt, 0, node_path); | ||
return offset; | ||
} | ||
|
||
static int setprop(void *fdt, const char *node_path, const char *property, | ||
uint32_t *val_array, int size) | ||
{ | ||
int offset = node_offset(fdt, node_path); | ||
if (offset < 0) | ||
return offset; | ||
return fdt_setprop(fdt, offset, property, val_array, size); | ||
} | ||
|
||
static int setprop_string(void *fdt, const char *node_path, | ||
const char *property, const char *string) | ||
{ | ||
int offset = node_offset(fdt, node_path); | ||
if (offset < 0) | ||
return offset; | ||
return fdt_setprop_string(fdt, offset, property, string); | ||
} | ||
|
||
static int setprop_cell(void *fdt, const char *node_path, | ||
const char *property, uint32_t val) | ||
{ | ||
int offset = node_offset(fdt, node_path); | ||
if (offset < 0) | ||
return offset; | ||
return fdt_setprop_cell(fdt, offset, property, val); | ||
} | ||
|
||
/* | ||
* Convert and fold provided ATAGs into the provided FDT. | ||
* | ||
* REturn values: | ||
* = 0 -> pretend success | ||
* = 1 -> bad ATAG (may retry with another possible ATAG pointer) | ||
* < 0 -> error from libfdt | ||
*/ | ||
int atags_to_fdt(void *atag_list, void *fdt, int total_space) | ||
{ | ||
struct tag *atag = atag_list; | ||
uint32_t mem_reg_property[2 * NR_BANKS]; | ||
int memcount = 0; | ||
int ret; | ||
|
||
/* make sure we've got an aligned pointer */ | ||
if ((u32)atag_list & 0x3) | ||
return 1; | ||
|
||
/* if we get a DTB here we're done already */ | ||
if (*(u32 *)atag_list == fdt32_to_cpu(FDT_MAGIC)) | ||
return 0; | ||
|
||
/* validate the ATAG */ | ||
if (atag->hdr.tag != ATAG_CORE || | ||
(atag->hdr.size != tag_size(tag_core) && | ||
atag->hdr.size != 2)) | ||
return 1; | ||
|
||
/* let's give it all the room it could need */ | ||
ret = fdt_open_into(fdt, fdt, total_space); | ||
if (ret < 0) | ||
return ret; | ||
|
||
for_each_tag(atag, atag_list) { | ||
if (atag->hdr.tag == ATAG_CMDLINE) { | ||
setprop_string(fdt, "/chosen", "bootargs", | ||
atag->u.cmdline.cmdline); | ||
} else if (atag->hdr.tag == ATAG_MEM) { | ||
if (memcount >= sizeof(mem_reg_property)/4) | ||
continue; | ||
mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.start); | ||
mem_reg_property[memcount++] = cpu_to_fdt32(atag->u.mem.size); | ||
} else if (atag->hdr.tag == ATAG_INITRD2) { | ||
uint32_t initrd_start, initrd_size; | ||
initrd_start = atag->u.initrd.start; | ||
initrd_size = atag->u.initrd.size; | ||
setprop_cell(fdt, "/chosen", "linux,initrd-start", | ||
initrd_start); | ||
setprop_cell(fdt, "/chosen", "linux,initrd-end", | ||
initrd_start + initrd_size); | ||
} | ||
} | ||
|
||
if (memcount) | ||
setprop(fdt, "/memory", "reg", mem_reg_property, 4*memcount); | ||
|
||
return fdt_pack(fdt); | ||
} |
Oops, something went wrong.