Move platform independent firmware code into arch/mips/fw
cover Move platform independent firmware code into arch/mips/fw
The two following patches move platform independent firmware code, ie CFE and ARC, into arch/mips/fw. This way they can be used on other platforms.
The patches look big but that's just because some files are moved, they are actually almost trivial.
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net
PATCH 1/2 Move CFE code into arch/mips/fw/cfe
Move the platform independent part of the CFE code to arch/mips/fw/cfe from arch/mips/sibyte/cfe.
--- arch/mips/Kconfig | 3 + arch/mips/Makefile | 1 + arch/mips/fw/cfe/Makefile | 5 + arch/mips/fw/cfe/cfe_api.c | 502 +++++++++++++++++++++++++++++++++++ arch/mips/fw/cfe/cfe_api_int.h | 152 +++++++++++ arch/mips/sibyte/Kconfig | 1 + arch/mips/sibyte/cfe/Makefile | 2 +- arch/mips/sibyte/cfe/cfe_api.c | 502 ----------------------------------- arch/mips/sibyte/cfe/cfe_api.h | 185 ------------- arch/mips/sibyte/cfe/cfe_api_int.h | 152 ----------- arch/mips/sibyte/cfe/cfe_error.h | 85 ------ arch/mips/sibyte/cfe/console.c | 4 +- arch/mips/sibyte/cfe/setup.c | 4 +- arch/mips/sibyte/cfe/smp.c | 4 +- include/asm-mips/fw/cfe/cfe_api.h | 185 +++++++++++++ include/asm-mips/fw/cfe/cfe_error.h | 85 ++++++ 16 files changed, 941 insertions(+), 931 deletions(-)
arch/mips/Kconfig +3 -0
@@ -687,6 +687,9 @@ config ARCH_MAY_HAVE_PC_FDC config BOOT_RAW bool +config CFE + bool + config DMA_COHERENT bool
arch/mips/Makefile +1 -0
@@ -149,6 +149,7 @@ endif # Firmware support # libs-$(CONFIG_ARC) += arch/mips/arc/ +libs-$(CONFIG_CFE) += arch/mips/fw/cfe/ libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/ #
arch/mips/fw/cfe/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for the Broadcom Common Firmware Environment support +# + +lib-y += cfe_api.o
arch/mips/fw/cfe/cfe_api.c new file +502 -0
502 lines not on this page · raw message
arch/mips/fw/cfe/cfe_api_int.h new file +152 -0
152 lines not on this page · raw message
arch/mips/sibyte/Kconfig +1 -0
@@ -125,6 +125,7 @@ config SB1_CERR_STALL config SIBYTE_CFE bool "Booting from CFE" depends on SIBYTE_SB1xxx_SOC + select CFE select SYS_HAS_EARLY_PRINTK help Make use of the CFE API for enumerating available memory,
arch/mips/sibyte/cfe/Makefile +1 -1
@@ -1,3 +1,3 @@ -lib-y = cfe_api.o setup.o +lib-y = setup.o lib-$(CONFIG_SMP) += smp.o lib-$(CONFIG_SIBYTE_CFE_CONSOLE) += console.o
arch/mips/sibyte/cfe/cfe_api.c deleted +0 -502
502 lines not on this page · raw message
arch/mips/sibyte/cfe/cfe_api.h deleted +0 -185
185 lines not on this page · raw message
arch/mips/sibyte/cfe/cfe_api_int.h deleted +0 -152
152 lines not on this page · raw message
arch/mips/sibyte/cfe/cfe_error.h deleted +0 -85
85 lines not on this page · raw message
arch/mips/sibyte/cfe/console.c +2 -2
@@ -4,8 +4,8 @@#include <asm/sibyte/board.h> -#include "cfe_api.h" -#include "cfe_error.h" +#include <asm/fw/cfe/cfe_api.h> +#include <asm/fw/cfe/cfe_error.h> extern int cfe_cons_handle;
arch/mips/sibyte/cfe/setup.c +2 -2
@@ -29,8 +29,8 @@#include <asm/reboot.h> #include <asm/sibyte/board.h> -#include "cfe_api.h" -#include "cfe_error.h" +#include <asm/fw/cfe/cfe_api.h> +#include <asm/fw/cfe/cfe_error.h> /* Max ram addressable in 32-bit segments */ #ifdef CONFIG_64BIT
arch/mips/sibyte/cfe/smp.c +2 -2
@@ -21,8 +21,8 @@#include <linux/smp.h> #include <asm/processor.h> -#include "cfe_api.h" -#include "cfe_error.h" +#include <asm/fw/cfe/cfe_api.h> +#include <asm/fw/cfe/cfe_error.h> /* * Use CFE to find out how many CPUs are available, setting up
include/asm-mips/fw/cfe/cfe_api.h new file +185 -0
185 lines not on this page · raw message
include/asm-mips/fw/cfe/cfe_error.h new file +85 -0
85 lines not on this page · raw message
---
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net
PATCH 2/2 Move ARC code into arch/mips/fw/arc
In reply to Aurelien JarnoMove the ARC code to arch/mips/fw/arc from arch/mips/arc.
--- arch/mips/Makefile | 2 +- arch/mips/arc/Makefile | 10 -- arch/mips/arc/arc_con.c | 50 ----------- arch/mips/arc/cmdline.c | 108 ------------------------ arch/mips/arc/env.c | 27 ------ arch/mips/arc/file.c | 75 ----------------- arch/mips/arc/identify.c | 123 --------------------------- arch/mips/arc/init.c | 51 ----------- arch/mips/arc/memory.c | 160 ----------------------------------- arch/mips/arc/misc.c | 89 -------------------- arch/mips/arc/promlib.c | 43 ---------- arch/mips/arc/salone.c | 24 ------ arch/mips/arc/time.c | 25 ------ arch/mips/arc/tree.c | 127 ---------------------------- arch/mips/fw/arc/Makefile | 10 ++ arch/mips/fw/arc/arc_con.c | 50 +++++++++++ arch/mips/fw/arc/cmdline.c | 108 ++++++++++++++++++++++++ arch/mips/fw/arc/env.c | 27 ++++++ arch/mips/fw/arc/file.c | 75 +++++++++++++++++ arch/mips/fw/arc/identify.c | 123 +++++++++++++++++++++++++++ arch/mips/fw/arc/init.c | 51 +++++++++++ arch/mips/fw/arc/memory.c | 160 +++++++++++++++++++++++++++++++++++ arch/mips/fw/arc/misc.c | 89 ++++++++++++++++++++ arch/mips/fw/arc/promlib.c | 43 ++++++++++ arch/mips/fw/arc/salone.c | 24 ++++++ arch/mips/fw/arc/time.c | 25 ++++++ arch/mips/fw/arc/tree.c | 127 ++++++++++++++++++++++++++++ arch/mips/sni/setup.c | 2 +- include/asm-mips/arc/hinv.h | 175 --------------------------------------- include/asm-mips/arc/types.h | 86 ------------------- include/asm-mips/fw/arc/hinv.h | 175 +++++++++++++++++++++++++++++++++++++++ include/asm-mips/fw/arc/types.h | 86 +++++++++++++++++++ include/asm-mips/sgiarcs.h | 2 +- include/asm-mips/sn/klconfig.h | 4 +- 34 files changed, 1178 insertions(+), 1178 deletions(-)
arch/mips/Makefile +1 -1
@@ -148,7 +148,7 @@ endif # # Firmware support # -libs-$(CONFIG_ARC) += arch/mips/arc/ +libs-$(CONFIG_ARC) += arch/mips/fw/arc/ libs-$(CONFIG_CFE) += arch/mips/fw/cfe/ libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/
arch/mips/arc/Makefile deleted +0 -10
@@ -1,10 +0,0 @@ -# -# Makefile for the ARC prom monitor library routines under Linux. -# - -lib-y += cmdline.o env.o file.o identify.o init.o \ - misc.o salone.o time.o tree.o - -lib-$(CONFIG_ARC_MEMORY) += memory.o -lib-$(CONFIG_ARC_CONSOLE) += arc_con.o -lib-$(CONFIG_ARC_PROMLIB) += promlib.o
arch/mips/arc/arc_con.c deleted +0 -50
50 lines not on this page · raw message
arch/mips/arc/cmdline.c deleted +0 -108
108 lines not on this page · raw message
arch/mips/arc/env.c deleted +0 -27
@@ -1,27 +0,0 @@ -/* -* 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. -* -* env.c: ARCS environment variable routines. -* -* Copyright (C) 1996 David S. Miller ([email protected]) -*/ -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/string.h> - -#include <asm/arc/types.h> -#include <asm/sgialib.h> - -PCHAR __init -ArcGetEnvironmentVariable (CHAR *name) -{ -return (CHAR *)ARC_CALL1 (get_evar, name); -} - -LONG __init -ArcSetEnvironmentVariable (PCHAR name,PCHAR value) -{ -return ARC_CALL2 (set_evar, name, value); -}
arch/mips/arc/file.c deleted +0 -75
75 lines not on this page · raw message
arch/mips/arc/identify.c deleted +0 -123
123 lines not on this page · raw message
arch/mips/arc/init.c deleted +0 -51
51 lines not on this page · raw message
arch/mips/arc/memory.c deleted +0 -160
160 lines not on this page · raw message
arch/mips/arc/misc.c deleted +0 -89
89 lines not on this page · raw message
arch/mips/arc/promlib.c deleted +0 -43
43 lines not on this page · raw message
arch/mips/arc/salone.c deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* Routines to load into memory and execute stand-along program images using -* ARCS PROM firmware. -* -* Copyright (C) 1996 David S. Miller ([email protected]) -*/ -#include <linux/init.h> -#include <asm/sgialib.h> - -LONG __init ArcLoad (CHAR *Path,ULONG TopAddr,ULONG *ExecAddr,ULONG *LowAddr) -{ -return ARC_CALL4 (load, Path, TopAddr, ExecAddr, LowAddr); -} - -LONG __init ArcInvoke (ULONG ExecAddr,ULONG StackAddr,ULONG Argc,CHAR *Argv[], -CHAR *Envp[]) -{ -return ARC_CALL5 (invoke, ExecAddr, StackAddr, Argc, Argv, Envp); -} - -LONG __init ArcExecute (CHAR *Path,LONG Argc,CHAR *Argv[],CHAR *Envp[]) -{ -return ARC_CALL4 (exec, Path, Argc, Argv, Envp); -}
arch/mips/arc/time.c deleted +0 -25
@@ -1,25 +0,0 @@ -/* -* 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. -* -* Extracting time information from ARCS prom. -* -* Copyright (C) 1996 David S. Miller ([email protected]) -*/ -#include <linux/init.h> - -#include <asm/arc/types.h> -#include <asm/sgialib.h> - -struct linux_tinfo *__init -ArcGetTime (VOID ) -{ -return (struct linux_tinfo *)ARC_CALL0 (get_tinfo); -} - -ULONG __init -ArcGetRelativeTime (VOID ) -{ -return ARC_CALL0 (get_rtime); -}
arch/mips/arc/tree.c deleted +0 -127
127 lines not on this page · raw message
arch/mips/fw/arc/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# +# Makefile for the ARC prom monitor library routines under Linux. +# + +lib-y += cmdline.o env.o file.o identify.o init.o \ + misc.o salone.o time.o tree.o + +lib-$(CONFIG_ARC_MEMORY) += memory.o +lib-$(CONFIG_ARC_CONSOLE) += arc_con.o +lib-$(CONFIG_ARC_PROMLIB) += promlib.o
arch/mips/fw/arc/arc_con.c new file +50 -0
50 lines not on this page · raw message
arch/mips/fw/arc/cmdline.c new file +108 -0
108 lines not on this page · raw message
arch/mips/fw/arc/env.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* 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. +* +* env.c: ARCS environment variable routines. +* +* Copyright (C) 1996 David S. Miller ([email protected]) +*/ +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/string.h> + +#include <asm/fw/arc/types.h> +#include <asm/sgialib.h> + +PCHAR __init +ArcGetEnvironmentVariable (CHAR *name) +{ +return (CHAR *)ARC_CALL1 (get_evar, name); +} + +LONG __init +ArcSetEnvironmentVariable (PCHAR name,PCHAR value) +{ +return ARC_CALL2 (set_evar, name, value); +}
arch/mips/fw/arc/file.c new file +75 -0
75 lines not on this page · raw message
arch/mips/fw/arc/identify.c new file +123 -0
123 lines not on this page · raw message
arch/mips/fw/arc/init.c new file +51 -0
51 lines not on this page · raw message
arch/mips/fw/arc/memory.c new file +160 -0
160 lines not on this page · raw message
arch/mips/fw/arc/misc.c new file +89 -0
89 lines not on this page · raw message
arch/mips/fw/arc/promlib.c new file +43 -0
43 lines not on this page · raw message
arch/mips/fw/arc/salone.c new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Routines to load into memory and execute stand-along program images using +* ARCS PROM firmware. +* +* Copyright (C) 1996 David S. Miller ([email protected]) +*/ +#include <linux/init.h> +#include <asm/sgialib.h> + +LONG __init ArcLoad (CHAR *Path,ULONG TopAddr,ULONG *ExecAddr,ULONG *LowAddr) +{ +return ARC_CALL4 (load, Path, TopAddr, ExecAddr, LowAddr); +} + +LONG __init ArcInvoke (ULONG ExecAddr,ULONG StackAddr,ULONG Argc,CHAR *Argv[], +CHAR *Envp[]) +{ +return ARC_CALL5 (invoke, ExecAddr, StackAddr, Argc, Argv, Envp); +} + +LONG __init ArcExecute (CHAR *Path,LONG Argc,CHAR *Argv[],CHAR *Envp[]) +{ +return ARC_CALL4 (exec, Path, Argc, Argv, Envp); +}
arch/mips/fw/arc/time.c new file +25 -0
@@ -0,0 +1,25 @@ +/* +* 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. +* +* Extracting time information from ARCS prom. +* +* Copyright (C) 1996 David S. Miller ([email protected]) +*/ +#include <linux/init.h> + +#include <asm/fw/arc/types.h> +#include <asm/sgialib.h> + +struct linux_tinfo *__init +ArcGetTime (VOID ) +{ +return (struct linux_tinfo *)ARC_CALL0 (get_tinfo); +} + +ULONG __init +ArcGetRelativeTime (VOID ) +{ +return ARC_CALL0 (get_rtime); +}
arch/mips/fw/arc/tree.c new file +127 -0
127 lines not on this page · raw message
arch/mips/sni/setup.c +1 -1
@@ -15,7 +15,7 @@#include <linux/screen_info.h> #ifdef CONFIG_ARC -#include <asm/arc/types.h> +#include <asm/fw/arc/types.h> #include <asm/sgialib.h> #endif
include/asm-mips/arc/hinv.h deleted +0 -175
175 lines not on this page · raw message
include/asm-mips/arc/types.h deleted +0 -86
86 lines not on this page · raw message
include/asm-mips/fw/arc/hinv.h new file +175 -0
175 lines not on this page · raw message
include/asm-mips/fw/arc/types.h new file +86 -0
86 lines not on this page · raw message
include/asm-mips/sgiarcs.h +1 -1
@@ -13,7 +13,7 @@#define _ASM_SGIARCS_H#include <asm/types.h> -#include <asm/arc/types.h> +#include <asm/fw/arc/types.h> /* Various ARCS error codes. */ #define PROM_ESUCCESS 0x00
include/asm-mips/sn/klconfig.h +2 -2
@@ -51,8 +51,8 @@#if defined(CONFIG_SGI_IP27 ) || defined(CONFIG_SGI_IP35 )#include <asm/sn/agent.h> -#include <asm/arc/types.h> -#include <asm/arc/hinv.h> +#include <asm/fw/arc/types.h> +#include <asm/fw/arc/hinv.h> #if defined(CONFIG_SGI_IP35 )// The hack file has to be before vector and after sn0_fru.... #include <asm/hack.h>
---
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net