diff options
Diffstat (limited to 'arch/powerpc')
61 files changed, 289 insertions, 31 deletions
diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild index 65e2493386..e9f7b32848 100644 --- a/arch/powerpc/Kbuild +++ b/arch/powerpc/Kbuild @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-$(CONFIG_ARCH_MPC85XX) += cpu-85xx/ obj-y += lib/ obj-$(CONFIG_FSL_DDR2) += ddr-8xxx/ diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 376c1bf42b..ba875767b2 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + config PPC bool select HAVE_CONFIGURABLE_TEXT_BASE @@ -6,7 +8,7 @@ config PPC select HAS_CACHE select GENERIC_FIND_NEXT_BIT select OFTREE - select HAS_ARCH_SJLJ + select ARCH_HAS_SJLJ default y choice diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index aa76260496..ebd8fe60d3 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + KBUILD_DEFCONFIG := p2020rdb_defconfig KBUILD_CPPFLAGS += -ffixed-r14 -m32 \ diff --git a/arch/powerpc/boards/.gitignore b/arch/powerpc/boards/.gitignore index d1165788c9..03987a7009 100644 --- a/arch/powerpc/boards/.gitignore +++ b/arch/powerpc/boards/.gitignore @@ -1 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only + barebox.lds diff --git a/arch/powerpc/boards/freescale-p1010rdb/Makefile b/arch/powerpc/boards/freescale-p1010rdb/Makefile index a7b64eef4d..e54ee8ee43 100644 --- a/arch/powerpc/boards/freescale-p1010rdb/Makefile +++ b/arch/powerpc/boards/freescale-p1010rdb/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += p1010rdb.o obj-y += law.o obj-y += tlb.o diff --git a/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c b/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c index f2f6d00b77..e769933412 100644 --- a/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c +++ b/arch/powerpc/boards/freescale-p1010rdb/p1010rdb.c @@ -23,7 +23,6 @@ #include <i2c/i2c.h> #include <gpio.h> #include <envfs.h> -#include <partition.h> #include <memory.h> #include <asm/cache.h> #include <asm/fsl_ddr_sdram.h> diff --git a/arch/powerpc/boards/freescale-p1022ds/Makefile b/arch/powerpc/boards/freescale-p1022ds/Makefile index 48867fa851..1d969d48eb 100644 --- a/arch/powerpc/boards/freescale-p1022ds/Makefile +++ b/arch/powerpc/boards/freescale-p1022ds/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += p1022ds.o obj-y += law.o obj-y += tlb.o diff --git a/arch/powerpc/boards/freescale-p1022ds/p1022ds.c b/arch/powerpc/boards/freescale-p1022ds/p1022ds.c index 956b830c5d..fd07b6f89f 100644 --- a/arch/powerpc/boards/freescale-p1022ds/p1022ds.c +++ b/arch/powerpc/boards/freescale-p1022ds/p1022ds.c @@ -21,7 +21,6 @@ #include <net.h> #include <types.h> #include <i2c/i2c.h> -#include <partition.h> #include <memory.h> #include <envfs.h> #include <asm/cache.h> diff --git a/arch/powerpc/boards/freescale-p2020rdb/Makefile b/arch/powerpc/boards/freescale-p2020rdb/Makefile index b2497f695c..ff0cdd657c 100644 --- a/arch/powerpc/boards/freescale-p2020rdb/Makefile +++ b/arch/powerpc/boards/freescale-p2020rdb/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += p2020rdb.o obj-y += law.o obj-y += tlb.o diff --git a/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c b/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c index cfbcc61e35..2c154db77c 100644 --- a/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c +++ b/arch/powerpc/boards/freescale-p2020rdb/p2020rdb.c @@ -20,7 +20,6 @@ #include <platform_data/serial-ns16550.h> #include <types.h> #include <i2c/i2c.h> -#include <partition.h> #include <memory.h> #include <envfs.h> #include <asm/cache.h> diff --git a/arch/powerpc/boards/owc-da923rc/Makefile b/arch/powerpc/boards/owc-da923rc/Makefile index 4cf6c5cf3c..78b6885c08 100644 --- a/arch/powerpc/boards/owc-da923rc/Makefile +++ b/arch/powerpc/boards/owc-da923rc/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += da923rc.o obj-y += tlb.o obj-y += law.o diff --git a/arch/powerpc/boards/owc-da923rc/da923rc.c b/arch/powerpc/boards/owc-da923rc/da923rc.c index 2665a15091..b9eb2520cf 100644 --- a/arch/powerpc/boards/owc-da923rc/da923rc.c +++ b/arch/powerpc/boards/owc-da923rc/da923rc.c @@ -25,7 +25,6 @@ #include <gpio.h> #include <envfs.h> #include <platform_data/serial-ns16550.h> -#include <partition.h> #include <environment.h> #include <i2c/i2c.h> #include <asm/fsl_ddr_sdram.h> diff --git a/arch/powerpc/boards/pcm030/Makefile b/arch/powerpc/boards/pcm030/Makefile index 4e5dc4f57b..95dd061043 100644 --- a/arch/powerpc/boards/pcm030/Makefile +++ b/arch/powerpc/boards/pcm030/Makefile @@ -1,2 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += pcm030.o eeprom.o extra-y += barebox.lds diff --git a/arch/powerpc/boards/pcm030/barebox.lds.S b/arch/powerpc/boards/pcm030/barebox.lds.S index 2536db745c..146b63fe88 100644 --- a/arch/powerpc/boards/pcm030/barebox.lds.S +++ b/arch/powerpc/boards/pcm030/barebox.lds.S @@ -14,9 +14,9 @@ * */ -#include <asm-generic/barebox.lds.h> +#include <asm/barebox.lds.h> -OUTPUT_ARCH("powerpc") +OUTPUT_ARCH(BAREBOX_OUTPUT_ARCH) ENTRY(_start) /* Do we need any of these for elf? __DYNAMIC = 0; */ diff --git a/arch/powerpc/boards/pcm030/pcm030.c b/arch/powerpc/boards/pcm030/pcm030.c index c603643d58..2bdbc6695d 100644 --- a/arch/powerpc/boards/pcm030/pcm030.c +++ b/arch/powerpc/boards/pcm030/pcm030.c @@ -25,7 +25,6 @@ #include <init.h> #include <platform_data/eth-fec.h> #include <types.h> -#include <partition.h> #include <memory.h> #include <linux/sizes.h> #include <linux/stat.h> diff --git a/arch/powerpc/cpu-85xx/Makefile b/arch/powerpc/cpu-85xx/Makefile index c649c4ec25..c7c5c8a006 100644 --- a/arch/powerpc/cpu-85xx/Makefile +++ b/arch/powerpc/cpu-85xx/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += traps.o obj-y += tlb.o obj-$(CONFIG_MMU) += mmu.o diff --git a/arch/powerpc/cpu-85xx/mmu.c b/arch/powerpc/cpu-85xx/mmu.c index 6b93c3e8db..b484acbf80 100644 --- a/arch/powerpc/cpu-85xx/mmu.c +++ b/arch/powerpc/cpu-85xx/mmu.c @@ -17,13 +17,16 @@ #include <mmu.h> #include <mach/mmu.h> -int arch_remap_range(void *_start, size_t size, unsigned flags) +int arch_remap_range(void *virt_addr, phys_addr_t phys_addr, size_t size, unsigned flags) { uint32_t ptr, start, tsize, valid, wimge, pte_flags; unsigned long epn; phys_addr_t rpn = 0; int esel = 0; + if (phys_addr != virt_to_phys(virt_addr)) + return -ENOSYS; + switch (flags) { case MAP_UNCACHED: pte_flags = MAS2_I; @@ -35,7 +38,7 @@ int arch_remap_range(void *_start, size_t size, unsigned flags) return -EINVAL; } - ptr = start = (uint32_t)_start; + ptr = start = (uint32_t)virt_addr; wimge = pte_flags | MAS2_M; while (ptr < (start + size)) { diff --git a/arch/powerpc/cpu-85xx/resetvec.S b/arch/powerpc/cpu-85xx/resetvec.S index 29555d4a00..b21cc0f19d 100644 --- a/arch/powerpc/cpu-85xx/resetvec.S +++ b/arch/powerpc/cpu-85xx/resetvec.S @@ -1,2 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + .section .resetvec,"ax" b _start_e500 diff --git a/arch/powerpc/ddr-8xxx/Makefile b/arch/powerpc/ddr-8xxx/Makefile index 43ae3a41df..651fe050f6 100644 --- a/arch/powerpc/ddr-8xxx/Makefile +++ b/arch/powerpc/ddr-8xxx/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += main.o util.o ctrl_regs.o options.o lc_common_dimm_params.o obj-y += ddr_setctrl.o obj-$(CONFIG_FSL_DDR2) += ddr2_dimm_params.o diff --git a/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c b/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c index 3ae88b7c49..80d01ab366 100644 --- a/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c +++ b/arch/powerpc/ddr-8xxx/ddr2_dimm_params.c @@ -162,7 +162,7 @@ static uint32_t determine_refresh_rate_ps(const uint32_t spd_refresh) * Not certain if any good value exists for CL=2 */ /* CL2 CL3 CL4 CL5 CL6 CL7 */ -uint16_t ddr2_speed_bins[] = { 0, 5000, 3750, 3000, 2500, 1875 }; +static uint16_t ddr2_speed_bins[] = { 0, 5000, 3750, 3000, 2500, 1875 }; static uint32_t compute_derated_DDR2_CAS_latency(uint32_t mclk_ps) { diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h index af3c61a823..814bf50d63 100644 --- a/arch/powerpc/include/asm/atomic.h +++ b/arch/powerpc/include/asm/atomic.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * PowerPC atomic operations */ diff --git a/arch/powerpc/include/asm/barebox.lds.h b/arch/powerpc/include/asm/barebox.lds.h new file mode 100644 index 0000000000..14477bd44a --- /dev/null +++ b/arch/powerpc/include/asm/barebox.lds.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#define BAREBOX_OUTPUT_ARCH "powerpc" + +#include <asm-generic/barebox.lds.h> diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index 2fdd57eff0..62b09c7da4 100644 --- a/arch/powerpc/include/asm/bitops.h +++ b/arch/powerpc/include/asm/bitops.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * bitops.h: Bit string operations on the ppc */ @@ -182,6 +184,7 @@ static inline int ffs(int x) return __ilog2(x & -x) + 1; } +#include <asm-generic/bitops/__fls.h> #include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/hweight.h> diff --git a/arch/powerpc/include/asm/bitsperlong.h b/arch/powerpc/include/asm/bitsperlong.h index 6dc0bb0c13..bf000a04cc 100644 --- a/arch/powerpc/include/asm/bitsperlong.h +++ b/arch/powerpc/include/asm/bitsperlong.h @@ -1 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #include <asm-generic/bitsperlong.h> diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h index 147ceb6714..c9066099ab 100644 --- a/arch/powerpc/include/asm/cache.h +++ b/arch/powerpc/include/asm/cache.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * include/asm-ppc/cache.h */ diff --git a/arch/powerpc/include/asm/common.h b/arch/powerpc/include/asm/common.h index b91f51e462..1e1ea4601d 100644 --- a/arch/powerpc/include/asm/common.h +++ b/arch/powerpc/include/asm/common.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_COMMON_H #define __ASM_COMMON_H diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 30d0987023..88f14b54f4 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* originally from linux source. * removed the dependencies on CONFIG_ values * removed virt_to_phys stuff (and in fact everything surrounded by #if __KERNEL__) diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index c691de1c77..10b15a47b9 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * PowerPC memory management structures */ @@ -561,7 +563,7 @@ extern int write_bat(ppc_bat_t bat, unsigned long upper, unsigned long lower); #ifdef CONFIG_MMU #define ARCH_HAS_REMAP -int arch_remap_range(void *_start, size_t size, unsigned flags); +int arch_remap_range(void *virt_addr, phys_addr_t phys_addr, size_t size, unsigned flags); #endif #endif diff --git a/arch/powerpc/include/asm/module.h b/arch/powerpc/include/asm/module.h index 09c04402c5..e5c10e35da 100644 --- a/arch/powerpc/include/asm/module.h +++ b/arch/powerpc/include/asm/module.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /**/ struct mod_arch_specific { diff --git a/arch/powerpc/include/asm/pci_io.h b/arch/powerpc/include/asm/pci_io.h index 9b738c383f..d601a9671e 100644 --- a/arch/powerpc/include/asm/pci_io.h +++ b/arch/powerpc/include/asm/pci_io.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* originally from linux source (asm-ppc/io.h). * Sanity added by Rob Taylor, Flying Pig Systems, 2000 */ diff --git a/arch/powerpc/include/asm/posix_types.h b/arch/powerpc/include/asm/posix_types.h index 22cae6230c..feaed42471 100644 --- a/arch/powerpc/include/asm/posix_types.h +++ b/arch/powerpc/include/asm/posix_types.h @@ -1 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #include <asm-generic/posix_types.h> diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index f4677d11e1..b9b73580c4 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_PPC_PROCESSOR_H #define __ASM_PPC_PROCESSOR_H diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index b4d599f43b..c7800576d5 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _PPC_PTRACE_H #define _PPC_PTRACE_H diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index 2b8c516038..c6dd0eead2 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h @@ -1 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #include <asm-generic/sections.h> diff --git a/arch/powerpc/include/asm/sigcontext.h b/arch/powerpc/include/asm/sigcontext.h index 4bd66a707d..78648b089c 100644 --- a/arch/powerpc/include/asm/sigcontext.h +++ b/arch/powerpc/include/asm/sigcontext.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _ASM_PPC_SIGCONTEXT_H #define _ASM_PPC_SIGCONTEXT_H diff --git a/arch/powerpc/include/asm/signal.h b/arch/powerpc/include/asm/signal.h index b11a28efd1..851fc7d41c 100644 --- a/arch/powerpc/include/asm/signal.h +++ b/arch/powerpc/include/asm/signal.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _ASMPPC_SIGNAL_H #define _ASMPPC_SIGNAL_H diff --git a/arch/powerpc/include/asm/status_led.h b/arch/powerpc/include/asm/status_led.h index eb81f371c9..129aa6614a 100644 --- a/arch/powerpc/include/asm/status_led.h +++ b/arch/powerpc/include/asm/status_led.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * asm/status_led.h * diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h index 33d143f04e..b06bb4cbff 100644 --- a/arch/powerpc/include/asm/string.h +++ b/arch/powerpc/include/asm/string.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _PPC_STRING_H_ #define _PPC_STRING_H_ diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index f3d41905ca..c2c501828b 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _PPC_TYPES_H #define _PPC_TYPES_H diff --git a/arch/powerpc/include/asm/unaligned.h b/arch/powerpc/include/asm/unaligned.h index a41fa8cb4a..a28cc24b12 100644 --- a/arch/powerpc/include/asm/unaligned.h +++ b/arch/powerpc/include/asm/unaligned.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef _ASM_PPC_UNALIGNED_H #define _ASM_PPC_UNALIGNED_H diff --git a/arch/powerpc/include/asm/word-at-a-time.h b/arch/powerpc/include/asm/word-at-a-time.h new file mode 100644 index 0000000000..029740c6de --- /dev/null +++ b/arch/powerpc/include/asm/word-at-a-time.h @@ -0,0 +1,162 @@ +#ifndef _ASM_WORD_AT_A_TIME_H +#define _ASM_WORD_AT_A_TIME_H + +/* + * Word-at-a-time interfaces for PowerPC. + */ + +#include <linux/kernel.h> +#include <linux/bitops.h> + +#ifdef __BIG_ENDIAN__ + +struct word_at_a_time { + const unsigned long high_bits, low_bits; +}; + +#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0xfe) + 1, REPEAT_BYTE(0x7f) } + +/* Bit set in the bytes that have a zero */ +static inline long prep_zero_mask(unsigned long val, unsigned long rhs, const struct word_at_a_time *c) +{ + unsigned long mask = (val & c->low_bits) + c->low_bits; + return ~(mask | rhs); +} + +#define create_zero_mask(mask) (mask) + +static inline long find_zero(unsigned long mask) +{ + long leading_zero_bits; + +#ifdef __powerpc64__ + asm ("cntlzd %0,%1" : "=r" (leading_zero_bits) : "r" (mask)); +#else + asm ("cntlzw %0,%1" : "=r" (leading_zero_bits) : "r" (mask)); +#endif + + return leading_zero_bits >> 3; +} + +static inline unsigned long has_zero(unsigned long val, unsigned long *data, const struct word_at_a_time *c) +{ + unsigned long rhs = val | c->low_bits; + *data = rhs; + return (val + c->high_bits) & ~rhs; +} + +static inline unsigned long zero_bytemask(unsigned long mask) +{ + return ~1ul << __fls(mask); +} + +#else + +#ifdef CONFIG_64BIT + +/* unused */ +struct word_at_a_time { +}; + +#define WORD_AT_A_TIME_CONSTANTS { } + +/* This will give us 0xff for a NULL char and 0x00 elsewhere */ +static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c) +{ + unsigned long ret; + unsigned long zero = 0; + + asm("cmpb %0,%1,%2" : "=r" (ret) : "r" (a), "r" (zero)); + *bits = ret; + + return ret; +} + +static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c) +{ + return bits; +} + +/* Alan Modra's little-endian strlen tail for 64-bit */ +static inline unsigned long create_zero_mask(unsigned long bits) +{ + unsigned long leading_zero_bits; + long trailing_zero_bit_mask; + + asm("addi %1,%2,-1\n\t" + "andc %1,%1,%2\n\t" + "popcntd %0,%1" + : "=r" (leading_zero_bits), "=&r" (trailing_zero_bit_mask) + : "b" (bits)); + + return leading_zero_bits; +} + +static inline unsigned long find_zero(unsigned long mask) +{ + return mask >> 3; +} + +/* This assumes that we never ask for an all 1s bitmask */ +static inline unsigned long zero_bytemask(unsigned long mask) +{ + return (1UL << mask) - 1; +} + +#else /* 32-bit case */ + +struct word_at_a_time { + const unsigned long one_bits, high_bits; +}; + +#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) } + +/* + * This is largely generic for little-endian machines, but the + * optimal byte mask counting is probably going to be something + * that is architecture-specific. If you have a reliably fast + * bit count instruction, that might be better than the multiply + * and shift, for example. + */ + +/* Carl Chatfield / Jan Achrenius G+ version for 32-bit */ +static inline long count_masked_bytes(long mask) +{ + /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */ + long a = (0x0ff0001+mask) >> 23; + /* Fix the 1 for 00 case */ + return a & mask; +} + +static inline unsigned long create_zero_mask(unsigned long bits) +{ + bits = (bits - 1) & ~bits; + return bits >> 7; +} + +static inline unsigned long find_zero(unsigned long mask) +{ + return count_masked_bytes(mask); +} + +/* Return nonzero if it has a zero */ +static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c) +{ + unsigned long mask = ((a - c->one_bits) & ~a) & c->high_bits; + *bits = mask; + return mask; +} + +static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c) +{ + return bits; +} + +/* The mask we created is directly usable as a bytemask */ +#define zero_bytemask(mask) (mask) + +#endif /* CONFIG_64BIT */ + +#endif /* __BIG_ENDIAN__ */ + +#endif /* _ASM_WORD_AT_A_TIME_H */ diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 405351c199..65729953e6 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += bat_rw.o obj-y += board.o obj-y += extable.o diff --git a/arch/powerpc/lib/kgdb.c b/arch/powerpc/lib/kgdb.c index 762cc7a88c..bbe7a80d27 100644 --- a/arch/powerpc/lib/kgdb.c +++ b/arch/powerpc/lib/kgdb.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only + #include <common.h> #include <command.h> diff --git a/arch/powerpc/lib/misc.S b/arch/powerpc/lib/misc.S index bd06ff2062..024d26ed58 100644 --- a/arch/powerpc/lib/misc.S +++ b/arch/powerpc/lib/misc.S @@ -1,6 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ #include <asm/ppc_asm.tmpl> -#include <asm-generic/errno.h> +#include <linux/errno.h> .globl __ashrdi3 __ashrdi3: diff --git a/arch/powerpc/lib/ppclinux.c b/arch/powerpc/lib/ppclinux.c index b4cb59a524..9b8404962c 100644 --- a/arch/powerpc/lib/ppclinux.c +++ b/arch/powerpc/lib/ppclinux.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only + #define DEBUG #include <common.h> diff --git a/arch/powerpc/lib/ppcstring.S b/arch/powerpc/lib/ppcstring.S index cce85e3252..55f96cc9a4 100644 --- a/arch/powerpc/lib/ppcstring.S +++ b/arch/powerpc/lib/ppcstring.S @@ -9,7 +9,7 @@ * 2 of the License, or (at your option) any later version. */ #include <asm/ppc_asm.tmpl> -#include <asm-generic/errno.h> +#include <linux/errno.h> .globl strcpy strcpy: diff --git a/arch/powerpc/mach-mpc5xxx/Kconfig b/arch/powerpc/mach-mpc5xxx/Kconfig index 4da947dc6c..e78c2fa350 100644 --- a/arch/powerpc/mach-mpc5xxx/Kconfig +++ b/arch/powerpc/mach-mpc5xxx/Kconfig @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + if ARCH_MPC5XXX config ARCH_TEXT_BASE diff --git a/arch/powerpc/mach-mpc5xxx/Makefile b/arch/powerpc/mach-mpc5xxx/Makefile index 101d061815..9fc45c08bb 100644 --- a/arch/powerpc/mach-mpc5xxx/Makefile +++ b/arch/powerpc/mach-mpc5xxx/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += cpu.o obj-y += cpu_init.o obj-y += loadtask.o diff --git a/arch/powerpc/mach-mpc5xxx/firmware_sc_task_bestcomm.impl.S b/arch/powerpc/mach-mpc5xxx/firmware_sc_task_bestcomm.impl.S index 42d0e3ce08..17213053d2 100644 --- a/arch/powerpc/mach-mpc5xxx/firmware_sc_task_bestcomm.impl.S +++ b/arch/powerpc/mach-mpc5xxx/firmware_sc_task_bestcomm.impl.S @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * Copyright (C) 2001, Software Center, Motorola China. * diff --git a/arch/powerpc/mach-mpc5xxx/include/mach/clock.h b/arch/powerpc/mach-mpc5xxx/include/mach/clock.h index b19686f18c..1813740eb1 100644 --- a/arch/powerpc/mach-mpc5xxx/include/mach/clock.h +++ b/arch/powerpc/mach-mpc5xxx/include/mach/clock.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_ARCH_CLOCKS_H #define __ASM_ARCH_CLOCKS_H diff --git a/arch/powerpc/mach-mpc5xxx/include/mach/sdma.h b/arch/powerpc/mach-mpc5xxx/include/mach/sdma.h index 6a25d79fb6..176ed3e892 100644 --- a/arch/powerpc/mach-mpc5xxx/include/mach/sdma.h +++ b/arch/powerpc/mach-mpc5xxx/include/mach/sdma.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * (C) Copyright 2003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. @@ -47,40 +49,35 @@ ALL PARAMETERS ARE ALL LONGWORDS (FOUR BYTES EACH). /*---------------------------------------------------------------------*/ /* Disable SmartDMA task */ -#define SDMA_TASK_DISABLE(tasknum) \ -{ \ +#define SDMA_TASK_DISABLE(tasknum) do { \ volatile ushort *tcr = (ushort *)(MPC5XXX_SDMA + 0x0000001c + 2 * tasknum); \ *tcr = (*tcr) & (~0x8000); \ -} +} while (0) /* Enable SmartDMA task */ -#define SDMA_TASK_ENABLE(tasknum) \ -{ \ +#define SDMA_TASK_ENABLE(tasknum) do { \ volatile ushort *tcr = (ushort *) (MPC5XXX_SDMA + 0x0000001c + 2 * tasknum); \ *tcr = (*tcr) | 0x8000; \ -} +} while (0) /* Enable interrupt */ -#define SDMA_INT_ENABLE(tasknum) \ -{ \ +#define SDMA_INT_ENABLE(tasknum) do { \ struct mpc5xxx_sdma *sdma = (struct mpc5xxx_sdma *)MPC5XXX_SDMA; \ sdma->IntMask &= ~(1 << tasknum); \ -} +} while (0) /* Disable interrupt */ -#define SDMA_INT_DISABLE(tasknum) \ -{ \ +#define SDMA_INT_DISABLE(tasknum) do { \ struct mpc5xxx_sdma *sdma = (struct mpc5xxx_sdma *)MPC5XXX_SDMA; \ sdma->IntMask |= (1 << tasknum); \ -} +} while (0) /* Clear interrupt pending bits */ -#define SDMA_CLEAR_IEVENT(tasknum) \ -{ \ +#define SDMA_CLEAR_IEVENT(tasknum) do { \ struct mpc5xxx_sdma *sdma = (struct mpc5xxx_sdma *)MPC5XXX_SDMA; \ sdma->IntPend = (1 << tasknum); \ -} +} while (0) /* get interrupt pending bit of a task */ #define SDMA_GET_PENDINGBIT(tasknum) \ diff --git a/arch/powerpc/mach-mpc5xxx/loadtask.c b/arch/powerpc/mach-mpc5xxx/loadtask.c index 1458cf7218..e2489983ee 100644 --- a/arch/powerpc/mach-mpc5xxx/loadtask.c +++ b/arch/powerpc/mach-mpc5xxx/loadtask.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only + /* * (C) Copyright 2003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. diff --git a/arch/powerpc/mach-mpc5xxx/reginfo.c b/arch/powerpc/mach-mpc5xxx/reginfo.c index 8b646e7d04..64816faffc 100644 --- a/arch/powerpc/mach-mpc5xxx/reginfo.c +++ b/arch/powerpc/mach-mpc5xxx/reginfo.c @@ -1,3 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only + #include <stdio.h> #include <common.h> #include <config.h> diff --git a/arch/powerpc/mach-mpc5xxx/time.c b/arch/powerpc/mach-mpc5xxx/time.c index 8981b14eeb..d690d50f0d 100644 --- a/arch/powerpc/mach-mpc5xxx/time.c +++ b/arch/powerpc/mach-mpc5xxx/time.c @@ -29,6 +29,7 @@ static struct clocksource cs = { .read = ppc_clocksource_read, .mask = CLOCKSOURCE_MASK(32), .shift = 15, + .priority = 80, }; static int clocksource_init(void) diff --git a/arch/powerpc/mach-mpc85xx/.gitignore b/arch/powerpc/mach-mpc85xx/.gitignore index d1165788c9..03987a7009 100644 --- a/arch/powerpc/mach-mpc85xx/.gitignore +++ b/arch/powerpc/mach-mpc85xx/.gitignore @@ -1 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only + barebox.lds diff --git a/arch/powerpc/mach-mpc85xx/Kconfig b/arch/powerpc/mach-mpc85xx/Kconfig index aa518b98fc..550c554286 100644 --- a/arch/powerpc/mach-mpc85xx/Kconfig +++ b/arch/powerpc/mach-mpc85xx/Kconfig @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + if ARCH_MPC85XX config MMU diff --git a/arch/powerpc/mach-mpc85xx/Makefile b/arch/powerpc/mach-mpc85xx/Makefile index 9886c7da45..3e23c1b812 100644 --- a/arch/powerpc/mach-mpc85xx/Makefile +++ b/arch/powerpc/mach-mpc85xx/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += cpuid.o obj-y += cpu.o obj-y += cpu_init.o diff --git a/arch/powerpc/mach-mpc85xx/barebox.lds.S b/arch/powerpc/mach-mpc85xx/barebox.lds.S index 2b73fda4e6..6e348d4db3 100644 --- a/arch/powerpc/mach-mpc85xx/barebox.lds.S +++ b/arch/powerpc/mach-mpc85xx/barebox.lds.S @@ -13,7 +13,7 @@ * GNU General Public License for more details. */ -#include <asm-generic/barebox.lds.h> +#include <asm/barebox.lds.h> #ifdef CONFIG_RESET_VECTOR_ADDRESS #define RESET_VECTOR_ADDRESS CONFIG_RESET_VECTOR_ADDRESS @@ -21,7 +21,7 @@ #define RESET_VECTOR_ADDRESS 0xfffffffc #endif -OUTPUT_ARCH("powerpc") +OUTPUT_ARCH(BAREBOX_OUTPUT_ARCH) ENTRY(_start_e500) PHDRS @@ -68,6 +68,8 @@ SECTIONS PROVIDE (etext = .); _sdata = .; + .barebox_imd : { BAREBOX_IMD } + .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) diff --git a/arch/powerpc/mach-mpc85xx/include/mach/clock.h b/arch/powerpc/mach-mpc85xx/include/mach/clock.h index 0e68cf6667..bfd9cf4d8e 100644 --- a/arch/powerpc/mach-mpc85xx/include/mach/clock.h +++ b/arch/powerpc/mach-mpc85xx/include/mach/clock.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + #ifndef __ASM_ARCH_CLOCKS_H #define __ASM_ARCH_CLOCKS_H diff --git a/arch/powerpc/mach-mpc85xx/include/mach/mpc85xx.h b/arch/powerpc/mach-mpc85xx/include/mach/mpc85xx.h index 1d9993ace9..5491f0b08d 100644 --- a/arch/powerpc/mach-mpc85xx/include/mach/mpc85xx.h +++ b/arch/powerpc/mach-mpc85xx/include/mach/mpc85xx.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * Copyright 2004, 2007 Freescale Semiconductor. * Copyright(c) 2003 Motorola Inc. diff --git a/arch/powerpc/mach-mpc85xx/time.c b/arch/powerpc/mach-mpc85xx/time.c index 067bce8ea6..5981995ac2 100644 --- a/arch/powerpc/mach-mpc85xx/time.c +++ b/arch/powerpc/mach-mpc85xx/time.c @@ -28,6 +28,7 @@ static uint64_t ppc_clocksource_read(void) static struct clocksource cs = { .read = ppc_clocksource_read, .mask = CLOCKSOURCE_MASK(64), + .priority = 80, }; static int clocksource_init(void) |