Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295300
b: refs/heads/master
c: dec8301
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Kristiansson authored and Jonas Bonn committed Feb 17, 2012
1 parent 9664d3a commit c53efeb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e1c958de4e22b6badc13dba1a0ebaa5aa798664
refs/heads/master: dec830189e1e192a80f574243a2dc31bdc1c4fc5
17 changes: 16 additions & 1 deletion trunk/arch/openrisc/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <asm/cache.h>
#include <asm/spr_defs.h>
#include <asm/asm-offsets.h>
#include <linux/of_fdt.h>

#define tophys(rd,rs) \
l.movhi rd,hi(-KERNELBASE) ;\
Expand Down Expand Up @@ -440,6 +441,9 @@ _dispatch_do_ipage_fault:
__HEAD
.global _start
_start:
/* save kernel parameters */
l.or r25,r0,r3 /* pointer to fdt */

/*
* ensure a deterministic start
*/
Expand Down Expand Up @@ -471,7 +475,6 @@ _start:
CLEAR_GPR(r22)
CLEAR_GPR(r23)
CLEAR_GPR(r24)
CLEAR_GPR(r25)
CLEAR_GPR(r26)
CLEAR_GPR(r27)
CLEAR_GPR(r28)
Expand Down Expand Up @@ -565,6 +568,18 @@ enable_mmu:
// reset the simulation counters
l.nop 5

/* check fdt header magic word */
l.lwz r3,0(r25) /* load magic from fdt into r3 */
l.movhi r4,hi(OF_DT_HEADER)
l.ori r4,r4,lo(OF_DT_HEADER)
l.sfeq r3,r4
l.bf _fdt_found
l.nop
/* magic number mismatch, set fdt pointer to null */
l.or r25,r0,r0
_fdt_found:
/* pass fdt pointer to or32_early_setup in r3 */
l.or r3,r0,r25
LOAD_SYMBOL_2_GPR(r24, or32_early_setup)
l.jalr r24
l.nop
Expand Down
18 changes: 9 additions & 9 deletions trunk/arch/openrisc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,18 @@ void __init setup_cpuinfo(void)
* Handles the pointer to the device tree that this kernel is to use
* for establishing the available platform devices.
*
* For now, this is limited to using the built-in device tree. In the future,
* it is intended that this function will take a pointer to the device tree
* that is potentially built-in, but potentially also passed in by the
* bootloader, or discovered by some equally clever means...
* Falls back on built-in device tree in case null pointer is passed.
*/

void __init or32_early_setup(void)
void __init or32_early_setup(unsigned int fdt)
{

early_init_devtree(__dtb_start);

printk(KERN_INFO "Compiled-in FDT at 0x%p\n", __dtb_start);
if (fdt) {
early_init_devtree((void*) fdt);
printk(KERN_INFO "FDT at 0x%08x\n", fdt);
} else {
early_init_devtree(__dtb_start);
printk(KERN_INFO "Compiled-in FDT at %p\n", __dtb_start);
}
}

static int __init openrisc_device_probe(void)
Expand Down

0 comments on commit c53efeb

Please sign in to comment.