Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: fw: arc: remove unused ARC code

Current kernel uses only a few ARC calls. Drop all unused ARC functions.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

authored by

Thomas Bogendoerfer and committed by
Paul Burton
d11646b5 3c0be584

+6 -304
+1 -1
arch/mips/fw/arc/Makefile
··· 4 4 # 5 5 6 6 lib-y += cmdline.o env.o file.o identify.o init.o \ 7 - misc.o salone.o time.o tree.o 7 + misc.o 8 8 9 9 lib-$(CONFIG_ARC_MEMORY) += memory.o 10 10 lib-$(CONFIG_ARC_CONSOLE) += arc_con.o
-6
arch/mips/fw/arc/env.c
··· 19 19 { 20 20 return (CHAR *) ARC_CALL1(get_evar, name); 21 21 } 22 - 23 - LONG __init 24 - ArcSetEnvironmentVariable(PCHAR name, PCHAR value) 25 - { 26 - return ARC_CALL2(set_evar, name, value); 27 - }
-49
arch/mips/fw/arc/file.c
··· 13 13 #include <asm/sgialib.h> 14 14 15 15 LONG 16 - ArcGetDirectoryEntry(ULONG FileID, struct linux_vdirent *Buffer, 17 - ULONG N, ULONG *Count) 18 - { 19 - return ARC_CALL4(get_vdirent, FileID, Buffer, N, Count); 20 - } 21 - 22 - LONG 23 - ArcOpen(CHAR *Path, enum linux_omode OpenMode, ULONG *FileID) 24 - { 25 - return ARC_CALL3(open, Path, OpenMode, FileID); 26 - } 27 - 28 - LONG 29 - ArcClose(ULONG FileID) 30 - { 31 - return ARC_CALL1(close, FileID); 32 - } 33 - 34 - LONG 35 16 ArcRead(ULONG FileID, VOID *Buffer, ULONG N, ULONG *Count) 36 17 { 37 18 return ARC_CALL4(read, FileID, Buffer, N, Count); 38 19 } 39 20 40 21 LONG 41 - ArcGetReadStatus(ULONG FileID) 42 - { 43 - return ARC_CALL1(get_rstatus, FileID); 44 - } 45 - 46 - LONG 47 22 ArcWrite(ULONG FileID, PVOID Buffer, ULONG N, PULONG Count) 48 23 { 49 24 return ARC_CALL4(write, FileID, Buffer, N, Count); 50 - } 51 - 52 - LONG 53 - ArcSeek(ULONG FileID, struct linux_bigint *Position, enum linux_seekmode SeekMode) 54 - { 55 - return ARC_CALL3(seek, FileID, Position, SeekMode); 56 - } 57 - 58 - LONG 59 - ArcMount(char *name, enum linux_mountops op) 60 - { 61 - return ARC_CALL2(mount, name, op); 62 - } 63 - 64 - LONG 65 - ArcGetFileInformation(ULONG FileID, struct linux_finfo *Information) 66 - { 67 - return ARC_CALL2(get_finfo, FileID, Information); 68 - } 69 - 70 - LONG ArcSetFileInformation(ULONG FileID, ULONG AttributeFlags, 71 - ULONG AttributeMask) 72 - { 73 - return ARC_CALL3(set_finfo, FileID, AttributeFlags, AttributeMask); 74 25 }
+5
arch/mips/fw/arc/identify.c
··· 87 87 return system_type; 88 88 } 89 89 90 + static pcomponent * __init ArcGetChild(pcomponent *Current) 91 + { 92 + return (pcomponent *) ARC_CALL1(child_component, Current); 93 + } 94 + 90 95 void __init prom_identify_arch(void) 91 96 { 92 97 pcomponent *p;
-59
arch/mips/fw/arc/misc.c
··· 21 21 #include <asm/bootinfo.h> 22 22 23 23 VOID __noreturn 24 - ArcHalt(VOID) 25 - { 26 - bc_disable(); 27 - local_irq_disable(); 28 - ARC_CALL0(halt); 29 - 30 - unreachable(); 31 - } 32 - 33 - VOID __noreturn 34 - ArcPowerDown(VOID) 35 - { 36 - bc_disable(); 37 - local_irq_disable(); 38 - ARC_CALL0(pdown); 39 - 40 - unreachable(); 41 - } 42 - 43 - /* XXX is this a soft reset basically? XXX */ 44 - VOID __noreturn 45 - ArcRestart(VOID) 46 - { 47 - bc_disable(); 48 - local_irq_disable(); 49 - ARC_CALL0(restart); 50 - 51 - unreachable(); 52 - } 53 - 54 - VOID __noreturn 55 - ArcReboot(VOID) 56 - { 57 - bc_disable(); 58 - local_irq_disable(); 59 - ARC_CALL0(reboot); 60 - 61 - unreachable(); 62 - } 63 - 64 - VOID __noreturn 65 24 ArcEnterInteractiveMode(VOID) 66 25 { 67 26 bc_disable(); ··· 28 69 ARC_CALL0(imode); 29 70 30 71 unreachable(); 31 - } 32 - 33 - LONG 34 - ArcSaveConfiguration(VOID) 35 - { 36 - return ARC_CALL0(cfg_save); 37 - } 38 - 39 - struct linux_sysid * 40 - ArcGetSystemId(VOID) 41 - { 42 - return (struct linux_sysid *) ARC_CALL0(get_sysid); 43 - } 44 - 45 - VOID __init 46 - ArcFlushAllCaches(VOID) 47 - { 48 - ARC_CALL0(cache_flush); 49 72 } 50 73 51 74 DISPLAY_STATUS * __init ArcGetDisplayStatus(ULONG FileID)
-25
arch/mips/fw/arc/salone.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * Routines to load into memory and execute stand-along program images using 4 - * ARCS PROM firmware. 5 - * 6 - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) 7 - */ 8 - #include <linux/init.h> 9 - #include <asm/sgialib.h> 10 - 11 - LONG __init ArcLoad(CHAR *Path, ULONG TopAddr, ULONG *ExecAddr, ULONG *LowAddr) 12 - { 13 - return ARC_CALL4(load, Path, TopAddr, ExecAddr, LowAddr); 14 - } 15 - 16 - LONG __init ArcInvoke(ULONG ExecAddr, ULONG StackAddr, ULONG Argc, CHAR *Argv[], 17 - CHAR *Envp[]) 18 - { 19 - return ARC_CALL5(invoke, ExecAddr, StackAddr, Argc, Argv, Envp); 20 - } 21 - 22 - LONG __init ArcExecute(CHAR *Path, LONG Argc, CHAR *Argv[], CHAR *Envp[]) 23 - { 24 - return ARC_CALL4(exec, Path, Argc, Argv, Envp); 25 - }
-25
arch/mips/fw/arc/time.c
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Extracting time information from ARCS prom. 7 - * 8 - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) 9 - */ 10 - #include <linux/init.h> 11 - 12 - #include <asm/fw/arc/types.h> 13 - #include <asm/sgialib.h> 14 - 15 - struct linux_tinfo * __init 16 - ArcGetTime(VOID) 17 - { 18 - return (struct linux_tinfo *) ARC_CALL0(get_tinfo); 19 - } 20 - 21 - ULONG __init 22 - ArcGetRelativeTime(VOID) 23 - { 24 - return ARC_CALL0(get_rtime); 25 - }
-127
arch/mips/fw/arc/tree.c
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * PROM component device tree code. 7 - * 8 - * Copyright (C) 1996 David S. Miller (davem@davemloft.net) 9 - * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 10 - * Copyright (C) 1999 Silicon Graphics, Inc. 11 - */ 12 - #include <linux/init.h> 13 - #include <asm/fw/arc/types.h> 14 - #include <asm/sgialib.h> 15 - 16 - #undef DEBUG_PROM_TREE 17 - 18 - pcomponent * __init 19 - ArcGetPeer(pcomponent *Current) 20 - { 21 - if (Current == PROM_NULL_COMPONENT) 22 - return PROM_NULL_COMPONENT; 23 - 24 - return (pcomponent *) ARC_CALL1(next_component, Current); 25 - } 26 - 27 - pcomponent * __init 28 - ArcGetChild(pcomponent *Current) 29 - { 30 - return (pcomponent *) ARC_CALL1(child_component, Current); 31 - } 32 - 33 - pcomponent * __init 34 - ArcGetParent(pcomponent *Current) 35 - { 36 - if (Current == PROM_NULL_COMPONENT) 37 - return PROM_NULL_COMPONENT; 38 - 39 - return (pcomponent *) ARC_CALL1(parent_component, Current); 40 - } 41 - 42 - LONG __init 43 - ArcGetConfigurationData(VOID *Buffer, pcomponent *Current) 44 - { 45 - return ARC_CALL2(component_data, Buffer, Current); 46 - } 47 - 48 - pcomponent * __init 49 - ArcAddChild(pcomponent *Current, pcomponent *Template, VOID *ConfigurationData) 50 - { 51 - return (pcomponent *) 52 - ARC_CALL3(child_add, Current, Template, ConfigurationData); 53 - } 54 - 55 - LONG __init 56 - ArcDeleteComponent(pcomponent *ComponentToDelete) 57 - { 58 - return ARC_CALL1(comp_del, ComponentToDelete); 59 - } 60 - 61 - pcomponent * __init 62 - ArcGetComponent(CHAR *Path) 63 - { 64 - return (pcomponent *)ARC_CALL1(component_by_path, Path); 65 - } 66 - 67 - #ifdef DEBUG_PROM_TREE 68 - 69 - static char *classes[] = { 70 - "system", "processor", "cache", "adapter", "controller", "peripheral", 71 - "memory" 72 - }; 73 - 74 - static char *types[] = { 75 - "arc", "cpu", "fpu", "picache", "pdcache", "sicache", "sdcache", 76 - "sccache", "memdev", "eisa adapter", "tc adapter", "scsi adapter", 77 - "dti adapter", "multi-func adapter", "disk controller", 78 - "tp controller", "cdrom controller", "worm controller", 79 - "serial controller", "net controller", "display controller", 80 - "parallel controller", "pointer controller", "keyboard controller", 81 - "audio controller", "misc controller", "disk peripheral", 82 - "floppy peripheral", "tp peripheral", "modem peripheral", 83 - "monitor peripheral", "printer peripheral", "pointer peripheral", 84 - "keyboard peripheral", "terminal peripheral", "line peripheral", 85 - "net peripheral", "misc peripheral", "anonymous" 86 - }; 87 - 88 - static char *iflags[] = { 89 - "bogus", "read only", "removable", "console in", "console out", 90 - "input", "output" 91 - }; 92 - 93 - static void __init 94 - dump_component(pcomponent *p) 95 - { 96 - printk("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>", 97 - p, classes[p->class], types[p->type], 98 - iflags[p->iflags], p->vers, p->rev); 99 - printk("key<%08lx>\n\tamask<%08lx>cdsize<%d>ilen<%d>iname<%s>\n", 100 - p->key, p->amask, (int)p->cdsize, (int)p->ilen, p->iname); 101 - } 102 - 103 - static void __init 104 - traverse(pcomponent *p, int op) 105 - { 106 - dump_component(p); 107 - if(ArcGetChild(p)) 108 - traverse(ArcGetChild(p), 1); 109 - if(ArcGetPeer(p) && op) 110 - traverse(ArcGetPeer(p), 1); 111 - } 112 - 113 - void __init 114 - prom_testtree(void) 115 - { 116 - pcomponent *p; 117 - 118 - p = ArcGetChild(PROM_NULL_COMPONENT); 119 - dump_component(p); 120 - p = ArcGetChild(p); 121 - while(p) { 122 - dump_component(p); 123 - p = ArcGetPeer(p); 124 - } 125 - } 126 - 127 - #endif /* DEBUG_PROM_TREE */
-12
arch/mips/include/asm/sgialib.h
··· 47 47 /* PROM device tree library routines. */ 48 48 #define PROM_NULL_COMPONENT ((pcomponent *) 0) 49 49 50 - /* Get sibling component of THIS. */ 51 - extern pcomponent *ArcGetPeer(pcomponent *this); 52 - 53 - /* Get child component of THIS. */ 54 - extern pcomponent *ArcGetChild(pcomponent *this); 55 - 56 50 /* This is called at prom_init time to identify the 57 51 * ARC architecture we are running on 58 52 */ ··· 54 60 55 61 /* Environment variable routines. */ 56 62 extern PCHAR ArcGetEnvironmentVariable(PCHAR name); 57 - extern LONG ArcSetEnvironmentVariable(PCHAR name, PCHAR value); 58 63 59 64 /* ARCS command line parsing. */ 60 65 extern void prom_init_cmdline(void); ··· 63 70 extern LONG ArcWrite(ULONG fd, PVOID buf, ULONG num, PULONG cnt); 64 71 65 72 /* Misc. routines. */ 66 - extern VOID ArcHalt(VOID) __noreturn; 67 - extern VOID ArcPowerDown(VOID) __noreturn; 68 - extern VOID ArcRestart(VOID) __noreturn; 69 - extern VOID ArcReboot(VOID) __noreturn; 70 73 extern VOID ArcEnterInteractiveMode(VOID) __noreturn; 71 - extern VOID ArcFlushAllCaches(VOID); 72 74 extern DISPLAY_STATUS *ArcGetDisplayStatus(ULONG FileID); 73 75 74 76 #endif /* _ASM_SGIALIB_H */