Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360634
b: refs/heads/master
c: 85d9d7a
h: refs/heads/master
v: v3
  • Loading branch information
James Hogan committed Mar 2, 2013
1 parent 37a7d9a commit 67e2109
Show file tree
Hide file tree
Showing 7 changed files with 716 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87aa1328f23a6bec15115af4d815e9c378557ef6
refs/heads/master: 85d9d7a9206631abd1030cd69ebb1c45f4a01037
4 changes: 4 additions & 0 deletions trunk/arch/metag/boot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vmlinux*
uImage*
ramdisk.*
*.dtb
82 changes: 82 additions & 0 deletions trunk/arch/metag/include/asm/mach/arch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* arch/metag/include/asm/mach/arch.h
*
* Copyright (C) 2012 Imagination Technologies Ltd.
*
* based on the ARM version:
* Copyright (C) 2000 Russell King
*
* 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 _METAG_MACH_ARCH_H_
#define _METAG_MACH_ARCH_H_

#include <linux/stddef.h>

/**
* struct machine_desc - Describes a board controlled by a Meta.
* @name: Board/SoC name.
* @dt_compat: Array of device tree 'compatible' strings.
*
* @nr_irqs: Maximum number of IRQs.
* If 0, defaults to NR_IRQS in asm-generic/irq.h.
*
* @init_early: Early init callback.
* @init_irq: IRQ init callback for setting up IRQ controllers.
* @init_machine: Arch init callback for setting up devices.
* @init_late: Late init callback.
*
* This structure is provided by each board which can be controlled by a Meta.
* It is chosen by matching the compatible strings in the device tree provided
* by the bootloader with the strings in @dt_compat, and sets up any aspects of
* the machine that aren't configured with device tree (yet).
*/
struct machine_desc {
const char *name;
const char **dt_compat;

unsigned int nr_irqs;

void (*init_early)(void);
void (*init_irq)(void);
void (*init_machine)(void);
void (*init_late)(void);
};

/*
* Current machine - only accessible during boot.
*/
extern struct machine_desc *machine_desc;

/*
* Machine type table - also only accessible during boot
*/
extern struct machine_desc __arch_info_begin[], __arch_info_end[];
#define for_each_machine_desc(p) \
for (p = __arch_info_begin; p < __arch_info_end; p++)

static inline struct machine_desc *default_machine_desc(void)
{
/* the default machine is the last one linked in */
if (__arch_info_end - 1 < __arch_info_begin)
return NULL;
return __arch_info_end - 1;
}

/*
* Set of macros to define architecture features. This is built into
* a table by the linker.
*/
#define MACHINE_START(_type, _name) \
static const struct machine_desc __mach_desc_##_type \
__used \
__attribute__((__section__(".arch.info.init"))) = { \
.name = _name,

#define MACHINE_END \
};

#endif /* _METAG_MACH_ARCH_H_ */
8 changes: 8 additions & 0 deletions trunk/arch/metag/include/asm/setup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef _ASM_METAG_SETUP_H
#define _ASM_METAG_SETUP_H

#include <uapi/asm/setup.h>

void per_cpu_trap_init(unsigned long);
extern void __init dump_machine_table(void);
#endif /* _ASM_METAG_SETUP_H */
45 changes: 45 additions & 0 deletions trunk/arch/metag/kernel/head.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
! Copyright 2005,2006,2007,2009 Imagination Technologies

#include <linux/init.h>
#include <generated/asm-offsets.h>
#undef __exit

__HEAD
! Setup the stack and get going into _metag_start_kernel
.global __start
.type __start,function
__start:
! D1Ar1 contains pTBI (ISTAT)
! D0Ar2 contains pTBI
! D1Ar3 contains __pTBISegs
! D0Ar4 contains kernel arglist pointer

MOVT D0Re0,#HI(___pTBIs)
ADD D0Re0,D0Re0,#LO(___pTBIs)
SETL [D0Re0],D0Ar2,D1Ar1
MOVT D0Re0,#HI(___pTBISegs)
ADD D0Re0,D0Re0,#LO(___pTBISegs)
SETD [D0Re0],D1Ar3
MOV A0FrP,#0
MOV D0Re0,#0
MOV D1Re0,#0
MOV D1Ar3,#0
MOV D1Ar1,D0Ar4 !Store kernel boot params
MOV D1Ar5,#0
MOV D0Ar6,#0
#ifdef CONFIG_METAG_DSP
MOV D0.8,#0
#endif
MOVT A0StP,#HI(_init_thread_union)
ADD A0StP,A0StP,#LO(_init_thread_union)
ADD A0StP,A0StP,#THREAD_INFO_SIZE
MOVT D1RtP,#HI(_metag_start_kernel)
CALL D1RtP,#LO(_metag_start_kernel)
.size __start,.-__start

!! Needed by TBX
.global __exit
.type __exit,function
__exit:
XOR TXENABLE,D0Re0,D0Re0
.size __exit,.-__exit
20 changes: 20 additions & 0 deletions trunk/arch/metag/kernel/machines.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* arch/metag/kernel/machines.c
*
* Copyright (C) 2012 Imagination Technologies Ltd.
*
* Generic Meta Boards.
*/

#include <linux/init.h>
#include <asm/irq.h>
#include <asm/mach/arch.h>

static const char *meta_boards_compat[] __initdata = {
"img,meta",
NULL,
};

MACHINE_START(META, "Generic Meta")
.dt_compat = meta_boards_compat,
MACHINE_END
Loading

0 comments on commit 67e2109

Please sign in to comment.