summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* barebox_imd: Add IMD sections to mpc-85xx.Christian Melki2024-01-291-0/+2
| | | | | | | | | | Seems PowerPC in general is missing the IMD sections. Placement might be suboptimal, please correct if so. Signed-off-by: Christian Melki <christian.melki@t2data.com> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240126075231.1285729-1-christian.melki@t2data.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: import Linux word-at-a-time.hAhmad Fatoum2023-11-232-0/+163
| | | | | | | | | | | | | | | | | | | The Linux <linux/word-at-a-time.h> interface is used to optimize searching for bytes in strings by doing word-size comparisons. This will be used in the implementation of strscpy in a follow-up commit, so import the generic version here. A good overview on the interface is available at LWN[1]. Note that it discuss Linux v3.5. The asm-generic version imported here works also on little-endian and not only big-endian[2]. [1]: https://lwn.net/Articles/501492/ [2]: Linux kernel commit a6e2f029ae34 ("Make asm/word-at-a-time.h available on all architectures"). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231122172951.376531-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: provide linux/errno.hAhmad Fatoum2023-11-232-2/+2
| | | | | | | | | | | | | | | We don't have the historic baggage of having to support different errno definitions depending on architecture. We thus have only asm-generic/errno.h and include that from errno.h and elsewhere directly. Kernel code however includes <linux/errno.h>, so let's provide that file as well and define there the Linux-specific errno's and include <asm-generic/errno.h> for all other errnos. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231122172951.376531-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: fec_mpc5200: fix false positive -Wmisleading-indentationAhmad Fatoum2023-06-061-15/+10
| | | | | | | | | | | | | | | | | | After the preprocessor runs, the code in question looks like this: SDMA_INT_DISABLE while ((counter--) && (!(fec->eth->ievent & FEC_IEVENT_GRA))); { struct mpc5xxx_sdma *sdma = (struct mpc5xxx_sdma *)MPC5XXX_SDMA; sdma->IntMask |= (1 << tasknum); } Which understandably looks like a bug. Avoid this by using do { } while (0) and moving the semicolon to a separate line. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605062939.242063-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mmu: add physical address parameter to arch_remap_rangeAhmad Fatoum2023-05-232-3/+6
| | | | | | | | | | | | | | ARM32 has map_io_sections for non-1:1 remapping, but it's limited to 1M sections. arch_remap_range has newly gained support for 4K granularity remapping, but supports only changing attributes and no non-1:1 remapping yet. In preparation for adding this missing feature, adjust the prototype. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230522052835.1039143-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* powerpc: Kconfig: fix reference to unknown symbolAntony Pavlov2023-05-121-1/+1
| | | | | | | | | | In Kconfig files, the symbols don't have a CONFIG_ prefix. Fix an unknown Kconfig symbol introduced in d3b8a88d34 ("treewide: rename CONFIG_HAS_ARCH_SJLJ to CONFIG_ARCH_HAS_SJLJ"). Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20230512023838.1255762-1-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ddr_dimms: Move ddr*_dimm_params to commonJohn Watts2023-01-251-1/+1
| | | | | | | | | | This code is no longer specific to the any board. Also make ddr2_speed_bins static to not break PowerPC compilation Signed-off-by: John Watts <contact@jookia.org> Link: https://lore.barebox.org/20230121144429.3524905-6-contact@jookia.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: rename CONFIG_HAS_ARCH_SJLJ to CONFIG_ARCH_HAS_SJLJAhmad Fatoum2022-12-071-1/+1
| | | | | | | | | We have 9 symbols beginning with ARCH_HAS, but only with HAS_ARCH. Change it over for symmetry. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221205133033.3008535-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Remove unused struct partitionSascha Hauer2022-11-235-5/+0
| | | | | | | | struct partition from include/partition.h is entirely unused. Remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20221117120604.3840211-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: move OUTPUT_FORMAT/ARCH definition into headerAhmad Fatoum2022-10-113-2/+4
| | | | | | | | | | In order to allow us having architecture-indepenent linker scripts, move the definition for the format and the architecture into the new <asm/barebox.lds.h> header file. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: introduce <asm/barebox.lds.h>Ahmad Fatoum2022-10-113-2/+5
| | | | | | | | | | | | | | We have a separate linker script for each architecture and one more for PBL if supported. All linker scripts include <asm-generic/barebox.lds.h>. In future, we may want to use a linker script common to more than one architecture. Prepare for this by having each architecture define a <asm/barebox.lds.h>. Currently, these files contain little more than 1-2 #include directives, but this will change in later commits. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: assign non-zero priorities to all clocksourcesAhmad Fatoum2022-04-252-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most barebox clocksources have a zero priority and if multiple of them exist, but no higher priority ones, the first to call init_clock wins. Some supported boards like the Raspberry Pi additionally depended on initcall ordering to favor one zero-priority clocksource over another. With the move to deep probe and with Commit b641580deb8c ("of: platform: Ensure timers are probed early"), device tree blob iteration order could now dictate which clocksource is ultimately used. This led to a 20 times slower clock source being chosen on the Raspberry Pi, because the ARM architected timer was taken instead of the bcm2835 timer. Fix the root cause by assigning priorities to all clocksource drivers. Priorities chosen are: 50: device_initcall 60: coredevice_initcall 70: postcore_initcall 80: core_initcall These priorities are all below 100, which was previously the lowest positive priority and as they are positive, they win against the dummy clocksource. This should ensure no priority inversion happens. Fixes: b641580deb8c ("of: platform: Ensure timers are probed early") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220425094857.674044-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all .c filesAhmad Fatoum2022-01-054-0/+8
| | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all .S filesAhmad Fatoum2022-01-053-0/+5
| | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all headersAhmad Fatoum2022-01-0523-0/+46
| | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for .gitignoreAhmad Fatoum2022-01-052-0/+4
| | | | | | | | | Makes the files not appear when searching for files that lack SPDX-License-Identifier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for Kbuild/KconfigAhmad Fatoum2022-01-0515-0/+30
| | | | | | | | | | | | | | | To verify only Kconfig/Makefile is touched: git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile' will print only arch/powerpc/Kbuild. To verify nothing unexpected is added: git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* asm-generic: include bitio.h from io.hAhmad Fatoum2021-08-231-0/+10
| | | | | | | | | | | | | | This is currently used on ARM and sandbox, but it's relevant for other platforms like x86 as well if driver code wants to make use of the functions defined within. MIPS and PowerPC already defines the symbols, but that's ok because <bitio.h> doesn't override existing macros. This works for MIPS, but not PowerPC, where those aren't macros. Fix that up. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blspec: Rework firmware loadSascha Hauer2021-06-281-0/+4
| | | | | | | | | | | | | | | | Applying overlays in blspec currently works in two steps. First of_firmware_load_overlay() is called which doesn't load an overlay, but instead loads firmware when one is needed by the overlay. This is done on the live tree, because that was needed to find the firmware manager. The second step is to call of_register_overlay() to apply the overlay to the kernel device tree when the fixups are executed. Instead of using a separate step to load the firmware, load the firmware as part of the of_fixups. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210624085223.14616-14-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* powerpc: law: use signed type to allow error checkingSascha Hauer2021-05-181-1/+1
| | | | | | | | | unsigned idx is checked for >= 0 which is always true and < 0 which is never true. Use a signed type instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210517185424.32145-16-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* powerpc: Implement initjmp/setjmp/longjmpSascha Hauer2021-03-175-1/+114
| | | | | | | | | Implementation has been taken from newlib as this is much simpler than the glibc version. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/asm-io'Sascha Hauer2021-02-221-4/+0
|\
| * ppc: <asm/io.h>: remove duplicate definitionAhmad Fatoum2021-02-041-4/+0
| | | | | | | | | | | | | | | | This implementation is equivalent to the one now provided by <asm-generic/io.h>, so it can be dropped. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: include <linux/math64.h> wrapper instead of <asm-generic/div64.h>Ahmad Fatoum2021-02-191-1/+1
|/ | | | | | | | | | | <asm-generic/div64.h> isn't meant for direct usage as <asm/div64.h> may override this on a per-architecture basis. We don't do that currently, but in the future we might. Include the <linux/math64.h> instead. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/powerpc' into masterSascha Hauer2020-09-2524-118/+58
|\
| * powerpc: Add function prototypes for exception handlersSascha Hauer2020-09-151-0/+8
| | | | | | | | | | | | | | The exception handlers lead to -Wmissing-prototypes warnings. Add prototypes for them to avoid these warnings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * powerpc: Remove unused functionsSascha Hauer2020-09-154-90/+0
| | | | | | | | | | | | | | Some functions are unused in the code base and do not have a prototype in any header file. Remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * powerpc: Add prototypes for functions called from assemblySascha Hauer2020-09-154-0/+12
| | | | | | | | | | | | | | | | Some functions are called from assembly only. There's no prototype for them so this leads to -Wmissing-prototypes warnings. Add a prototype right aboce the functions to avoid these warnings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * powerpc: Make locally used functions staticSascha Hauer2020-09-158-18/+19
| | | | | | | | | | | | | | Make only locally used functions static to avoid -Wmissing-prototypes warnings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * powerpc: Add missing includesSascha Hauer2020-09-157-0/+9
| | | | | | | | | | | | Add missing includes to avoid -Wmissing-prototypes warnings. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * powerpc: Add prototypes to header fileSascha Hauer2020-09-154-10/+10
| | | | | | | | | | | | | | | | | | | | This adds prototypes of the board specific functions fsl_ddr_board_options() and fsl_ddr_board_info() to a header file. Including this header file from the board files reveals that the prototypes are different across the different implementations, so harmonize them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | restart: give all restart handlers a descriptive nameAhmad Fatoum2020-09-152-2/+2
|/ | | | | | | | | | | | | With incoming changes to choose a specific reset method, give all currently unnamed "default" reset handlers a name: - soc reset via SoC-specific means - soc-wdt reset via SoC watchdog timer - vector reset via jump to reset vector - efi reset via EFI firmware Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: mpc5xxx: delete dead codeAhmad Fatoum2020-07-144-670/+0
| | | | | | | | These files had never been built since being added. At least the C file doesn't compile due to missing headers. Remove them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-06-111-33/+2
|\
| * arch: include <asm-generic/int-ll64.h> from <asm/types.h>Masahiro Yamada2020-05-181-33/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many architectures duplicate the same fixed type definitions as in <asm-generic/int-ll64.h>. Include <asm-generic/int-ll64.h> from <asm/types.h>, and remove the duplicated code. Note: Linux commit 0c79a8e29b5f ("asm/types.h: Remove include/asm-generic/int-l64.h") unified the kernel space definition into int-ll64.h. Barebox also adopts int-ll64. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | powerpc: move ddr-8xxx/ to the relevant MakefileMasahiro Yamada2020-05-252-2/+2
|/ | | | | | | | | | Directory descending upward is ugly. Move it to the correct Makefile. No functional change is intended because FSL_DDR{2,3} depend on ARCH_MPC85XX. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-05-1439-116/+0
|
* Merge branch 'for-next/kconfig'Sascha Hauer2020-05-141-13/+0
|
* arch: remove KBUILD_SRC checks from arch MakefileMasahiro Yamada2020-05-121-4/+0
| | | | | | | You can always add $(srctree)/ to the mach include path. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ppc: rename arch/ppc/ to arch/powerpc/Masahiro Yamada2020-05-04158-0/+18854
In old days, Linux supported PowerPC with two arch directories, arch/ppc/ and arch/ppc64/. Linux commit 564ee7a5668e ("[PATCH] powerpc: Move arch/ppc*/kernel/vecemu.c to arch/powerpc") started the migration to arch/powerpc/, and commit 917f0af9e5a9 ("powerpc: Remove arch/ppc and include/asm-ppc") finished it. This commit aligns the directory name with the current Linux. I did 'git mv arch/ppc/ arch/powerpc/', and fixed up some hard-coded arch/ppc paths. Barebox has stuck to arch/ppc/ for a long time. To keep the backward compatibility, I added the following to the top Makefile. # Support ARCH=ppc for backward compatibility ifeq ($(ARCH),ppc) SRCARCH := powerpc endif Both ARCH=ppc and ARCH=powerpc work in the same way. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>