MIPS: unify CPU code in arch/mips/cpu/
PATCH 1/1 MIPS: unify CPU code in arch/mips/cpu/
Unify and move code in arch/mips/cpu/mips[32|64]/ to arch/mips/cpu/. The CPU specific config.mk files need to remain until CONFIG_STANDALONE_LOAD_ADDR is converted to a global Kconfig symbol.
Signed-off-by Paul Burton <[email protected]>
Signed-off-by Daniel Schwierzeck <[email protected]>
--- arch/mips/Makefile | 6 +- arch/mips/cpu/Makefile | 9 ++ arch/mips/cpu/cpu.c | 38 +++++ arch/mips/cpu/interrupts.c | 22 +++ arch/mips/cpu/mips32/Makefile | 9 -- arch/mips/cpu/mips32/cpu.c | 34 ---- arch/mips/cpu/mips32/interrupts.c | 22 --- arch/mips/cpu/mips32/start.S | 320 -------------------------------------- arch/mips/cpu/mips32/time.c | 19 --- arch/mips/cpu/mips64/Makefile | 9 -- arch/mips/cpu/mips64/cpu.c | 37 ----- arch/mips/cpu/mips64/interrupts.c | 22 --- arch/mips/cpu/mips64/start.S | 291 ---------------------------------- arch/mips/cpu/mips64/time.c | 19 --- arch/mips/cpu/start.S | 320 ++++++++++++++++++++++++++++++++++++++ arch/mips/cpu/time.c | 19 +++ 16 files changed, 410 insertions(+), 786 deletions(-) create mode 100644 arch/mips/cpu/Makefile create mode 100644 arch/mips/cpu/cpu.c create mode 100644 arch/mips/cpu/interrupts.c delete mode 100644 arch/mips/cpu/mips32/Makefile delete mode 100644 arch/mips/cpu/mips32/cpu.c delete mode 100644 arch/mips/cpu/mips32/interrupts.c delete mode 100644 arch/mips/cpu/mips32/start.S delete mode 100644 arch/mips/cpu/mips32/time.c delete mode 100644 arch/mips/cpu/mips64/Makefile delete mode 100644 arch/mips/cpu/mips64/cpu.c delete mode 100644 arch/mips/cpu/mips64/interrupts.c delete mode 100644 arch/mips/cpu/mips64/start.S delete mode 100644 arch/mips/cpu/mips64/time.c create mode 100644 arch/mips/cpu/start.S create mode 100644 arch/mips/cpu/time.c
arch/mips/Makefile +2 -4
@@ -2,11 +2,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -head-$(CONFIG_CPU_MIPS32) := arch/mips/cpu/mips32/start.o -head-$(CONFIG_CPU_MIPS64) := arch/mips/cpu/mips64/start.o +head-y := arch/mips/cpu/start.o -libs-$(CONFIG_CPU_MIPS32) += arch/mips/cpu/mips32/ -libs-$(CONFIG_CPU_MIPS64) += arch/mips/cpu/mips64/ +libs-y += arch/mips/cpu/ libs-y += arch/mips/lib/ libs-$(CONFIG_SOC_AU1X00) += arch/mips/mach-au1x00/
arch/mips/cpu/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# + +extra-y = start.o + +obj-y += time.o +obj-y += interrupts.o +obj-y += cpu.o
arch/mips/cpu/cpu.c new file +38 -0
@@ -0,0 +1,38 @@ +/* +* (C) Copyright 2003 +* Wolfgang Denk, DENX Software Engineering, <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <command.h> +#include <netdev.h> +#include <linux/compiler.h> +#include <asm/mipsregs.h> +#include <asm/reboot.h> + +void __weak _machine_restart (void ) +{ +fprintf (stderr,"*** reset failed ***\n" ); + +while (1 ) +/* NOP */ ; +} + +int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +_machine_restart (); + +return 0 ; +} + +void write_one_tlb (int index,u32 pagemask,u32 hi,u32 low0,u32 low1) +{ +write_c0_entrylo0 (low0); +write_c0_pagemask (pagemask); +write_c0_entrylo1 (low1); +write_c0_entryhi (hi); +write_c0_index (index); +tlb_write_indexed (); +}
arch/mips/cpu/interrupts.c new file +22 -0
@@ -0,0 +1,22 @@ +/* +* (C) Copyright 2003 +* Wolfgang Denk, DENX Software Engineering, <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> + +int interrupt_init (void ) +{ +return 0 ; +} + +void enable_interrupts (void ) +{ +} + +int disable_interrupts (void ) +{ +return 0 ; +}
arch/mips/cpu/mips32/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# (C) Copyright 2003-2006 -# Wolfgang Denk, DENX Software Engineering, wd at denx.de. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -extra-y = start.o -obj-y = cpu.o interrupts.o time.o
arch/mips/cpu/mips32/cpu.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> -#include <command.h> -#include <netdev.h> -#include <asm/mipsregs.h> -#include <asm/reboot.h> - -void __attribute__((weak))_machine_restart (void ) -{ -} - -int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) -{ -_machine_restart (); - -fprintf (stderr,"*** reset failed ***\n" ); -return 0 ; -} - -void write_one_tlb (int index,u32 pagemask,u32 hi,u32 low0,u32 low1) -{ -write_c0_entrylo0 (low0); -write_c0_pagemask (pagemask); -write_c0_entrylo1 (low1); -write_c0_entryhi (hi); -write_c0_index (index); -tlb_write_indexed (); -}
arch/mips/cpu/mips32/interrupts.c deleted +0 -22
@@ -1,22 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> - -int interrupt_init (void ) -{ -return 0 ; -} - -void enable_interrupts (void ) -{ -} - -int disable_interrupts (void ) -{ -return 0 ; -}
arch/mips/cpu/mips32/start.S deleted +0 -320
320 lines not on this page · raw message
arch/mips/cpu/mips32/time.c deleted +0 -19
@@ -1,19 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, [email protected]. -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> -#include <asm/mipsregs.h> - -unsigned long notrace timer_read_counter (void ) -{ -return read_c0_count (); -} - -ulong notrace get_tbclk(void) -{ -return CONFIG_SYS_MIPS_TIMER_FREQ ; -}
arch/mips/cpu/mips64/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# (C) Copyright 2003-2006 -# Wolfgang Denk, DENX Software Engineering, wd at denx.de. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -extra-y = start.o -obj-y = cpu.o interrupts.o time.o
arch/mips/cpu/mips64/cpu.c deleted +0 -37
@@ -1,37 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> -#include <command.h> -#include <netdev.h> -#include <asm/mipsregs.h> -#include <asm/reboot.h> - -void __attribute__((weak))_machine_restart (void ) -{ -fprintf (stderr,"*** reset failed ***\n" ); - -while (1 ) -/* NOP */ ; -} - -int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) -{ -_machine_restart (); - -return 0 ; -} - -void write_one_tlb (int index,u32 pagemask,u32 hi,u32 low0,u32 low1) -{ -write_c0_entrylo0 (low0); -write_c0_pagemask (pagemask); -write_c0_entrylo1 (low1); -write_c0_entryhi (hi); -write_c0_index (index); -tlb_write_indexed (); -}
arch/mips/cpu/mips64/interrupts.c deleted +0 -22
@@ -1,22 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> - -int interrupt_init (void ) -{ -return 0 ; -} - -void enable_interrupts (void ) -{ -} - -int disable_interrupts (void ) -{ -return 0 ; -}
arch/mips/cpu/mips64/start.S deleted +0 -291
291 lines not on this page · raw message
arch/mips/cpu/mips64/time.c deleted +0 -19
@@ -1,19 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, [email protected]. -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> -#include <asm/mipsregs.h> - -unsigned long notrace timer_read_counter (void ) -{ -return read_c0_count (); -} - -ulong notrace get_tbclk(void) -{ -return CONFIG_SYS_MIPS_TIMER_FREQ ; -}
arch/mips/cpu/start.S new file +320 -0
320 lines not on this page · raw message
arch/mips/cpu/time.c new file +19 -0
@@ -0,0 +1,19 @@ +/* +* (C) Copyright 2003 +* Wolfgang Denk, DENX Software Engineering, [email protected]. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <asm/mipsregs.h> + +unsigned long notrace timer_read_counter (void ) +{ +return read_c0_count (); +} + +ulong notrace get_tbclk(void) +{ +return CONFIG_SYS_MIPS_TIMER_FREQ ; +}
Signature · 1 line
1.9.1
PATCH v2 1/1 MIPS: unify CPU code in arch/mips/cpu/
Unify and move code in arch/mips/cpu/mips[32|64]/ to arch/mips/cpu/. The CPU specific config.mk files need to remain until CONFIG_STANDALONE_LOAD_ADDR is converted to a global Kconfig symbol.
Signed-off-by Paul Burton <[email protected]>
Signed-off-by Daniel Schwierzeck <[email protected]>
---
Changes for v2:
- resend with git rename detection enabled
---
arch/mips/Makefile | 6 +-
arch/mips/cpu/Makefile | 9 +
arch/mips/cpu/{mips64 => }/cpu.c | 3 +-
arch/mips/cpu/{mips32 => }/interrupts.c | 0
arch/mips/cpu/mips32/Makefile | 9 -
arch/mips/cpu/mips32/cpu.c | 34 ----
arch/mips/cpu/mips64/Makefile | 9 -
arch/mips/cpu/mips64/interrupts.c | 22 ---
arch/mips/cpu/mips64/start.S | 291 --------------------------------
arch/mips/cpu/mips64/time.c | 19 ---
arch/mips/cpu/{mips32 => }/start.S | 0
arch/mips/cpu/{mips32 => }/time.c | 0
12 files changed, 13 insertions(+), 389 deletions(-)
create mode 100644 arch/mips/cpu/Makefile
rename arch/mips/cpu/{mips64 => }/cpu.c (91%)
rename arch/mips/cpu/{mips32 => }/interrupts.c (100%)
delete mode 100644 arch/mips/cpu/mips32/Makefile
delete mode 100644 arch/mips/cpu/mips32/cpu.c
delete mode 100644 arch/mips/cpu/mips64/Makefile
delete mode 100644 arch/mips/cpu/mips64/interrupts.c
delete mode 100644 arch/mips/cpu/mips64/start.S
delete mode 100644 arch/mips/cpu/mips64/time.c
rename arch/mips/cpu/{mips32 => }/start.S (100%)
rename arch/mips/cpu/{mips32 => }/time.c (100%)arch/mips/Makefile +2 -4
@@ -2,11 +2,9 @@ # SPDX-License-Identifier: GPL-2.0+ # -head-$(CONFIG_CPU_MIPS32) := arch/mips/cpu/mips32/start.o -head-$(CONFIG_CPU_MIPS64) := arch/mips/cpu/mips64/start.o +head-y := arch/mips/cpu/start.o -libs-$(CONFIG_CPU_MIPS32) += arch/mips/cpu/mips32/ -libs-$(CONFIG_CPU_MIPS64) += arch/mips/cpu/mips64/ +libs-y += arch/mips/cpu/ libs-y += arch/mips/lib/ libs-$(CONFIG_SOC_AU1X00) += arch/mips/mach-au1x00/
arch/mips/cpu/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# + +extra-y = start.o + +obj-y += time.o +obj-y += interrupts.o +obj-y += cpu.o
arch/mips/cpu/cpu.c renamed from arch/mips/cpu/mips64/cpu.c +2 -1
@@ -8,10 +8,11 @@#include <common.h> #include <command.h> #include <netdev.h> +#include <linux/compiler.h> #include <asm/mipsregs.h> #include <asm/reboot.h> -void __attribute__((weak))_machine_restart (void ) +void __weak _machine_restart (void ) {fprintf (stderr,"*** reset failed ***\n" );
arch/mips/cpu/interrupts.c renamed from arch/mips/cpu/mips32/interrupts.c +0 -0
arch/mips/cpu/mips32/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# (C) Copyright 2003-2006 -# Wolfgang Denk, DENX Software Engineering, wd at denx.de. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -extra-y = start.o -obj-y = cpu.o interrupts.o time.o
arch/mips/cpu/mips32/cpu.c deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> -#include <command.h> -#include <netdev.h> -#include <asm/mipsregs.h> -#include <asm/reboot.h> - -void __attribute__((weak))_machine_restart (void ) -{ -} - -int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) -{ -_machine_restart (); - -fprintf (stderr,"*** reset failed ***\n" ); -return 0 ; -} - -void write_one_tlb (int index,u32 pagemask,u32 hi,u32 low0,u32 low1) -{ -write_c0_entrylo0 (low0); -write_c0_pagemask (pagemask); -write_c0_entrylo1 (low1); -write_c0_entryhi (hi); -write_c0_index (index); -tlb_write_indexed (); -}
arch/mips/cpu/mips64/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# (C) Copyright 2003-2006 -# Wolfgang Denk, DENX Software Engineering, wd at denx.de. -# -# SPDX-License-Identifier: GPL-2.0+ -# - -extra-y = start.o -obj-y = cpu.o interrupts.o time.o
arch/mips/cpu/mips64/interrupts.c deleted +0 -22
@@ -1,22 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, <[email protected]> -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> - -int interrupt_init (void ) -{ -return 0 ; -} - -void enable_interrupts (void ) -{ -} - -int disable_interrupts (void ) -{ -return 0 ; -}
arch/mips/cpu/mips64/start.S deleted +0 -291
291 lines not on this page · raw message
arch/mips/cpu/mips64/time.c deleted +0 -19
@@ -1,19 +0,0 @@ -/* -* (C) Copyright 2003 -* Wolfgang Denk, DENX Software Engineering, [email protected]. -* -* SPDX-License-Identifier: GPL-2.0+ -*/ - -#include <common.h> -#include <asm/mipsregs.h> - -unsigned long notrace timer_read_counter (void ) -{ -return read_c0_count (); -} - -ulong notrace get_tbclk(void) -{ -return CONFIG_SYS_MIPS_TIMER_FREQ ; -}
arch/mips/cpu/start.S renamed from arch/mips/cpu/mips32/start.S +0 -0
arch/mips/cpu/time.c renamed from arch/mips/cpu/mips32/time.c +0 -0
Signature · 1 line
1.9.1