Commit Graph

13200 Commits

Author SHA1 Message Date
Henry Willard
1492c6b187 MIPS: Don't clear _PAGE_SPECIAL in _PAGE_CHG_MASK
In the special case where

	p = mmap(NULL, ALLOC_SIZE, PROT_READ,
                MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);

is followed by

	rc = mprotect(p, ALLOC_SIZE, PROT_NONE);

the _PAGE_SPECIAL bit in the page tables will be cleared by
mistake and the later unmapped operations will incorrectly
modify the struct page for the the zero page. This sequence
occurs in the madvise05 test of the Linux Test Project
suite of tests.

This was discovered while testing an older version of the kernel
(5.4.17) on a MIPS device. Unfortunately, support for this device
is not available in newer kernels, so I can't test this with the
latest Linux kernel code. It looks like the problem exists in
newer kernels, but I can't verify it. Except for the LTP test,
this sequence of calls is probably not common.

Passing it along in the hope it will be useful to someone.

Signed-off-by: Henry Willard <henry.willard@oracle.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-24 09:48:51 +02:00
Nathan Chancellor
f4670a1b30 MIPS: Sink body of check_bugs_early() into its only call site
If check_bugs_early() is not inlined, which a compiler is free to do
after commit ac7c3e4ff4 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly"), modpost would warn that check_bugs_early(), a non-init
function, refers to check_bugs64_early(), which is marked __init. This
would not result in any run time issues, as check_bugs_early() is only
called from setup_arch(), which is marked __init.

To avoid this potential warning, just sink the body of
check_bugs_early() into its single call site in setup_arch().

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-22 23:29:00 +02:00
Nathan Chancellor
95b5baf810 MIPS: Mark check_bugs() as __init
After commit ac7c3e4ff4 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly"), a compiler may choose not to inline a function marked with
just 'inline'. If check_bugs() is not inlined into start_kernel(), which
occurs when building with clang after commit 9ea7e6b62c ("init: Mark
[arch_call_]rest_init() __noreturn"), modpost complains with:

  WARNING: modpost: vmlinux.o: section mismatch in reference: check_bugs (section: .text) -> check_bugs32 (section: .init.text)

check_bugs() is only called from start_kernel(), which itself is marked
__init, so there would not be any issues at run time. Make it obvious to
modpost that this call chain is safe by marking check_bugs() as __init,
which fixes the warning.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Link: https://lore.kernel.org/CA+G9fYt+4e57Gdy6cix=LeNK6XqWoui8du=mZWu=cf8vPYocKw@mail.gmail.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-22 23:28:35 +02:00
Thomas Bogendoerfer
20470a68a0 Revert "MIPS: generic: Enable all CPUs supported by virt board in Kconfig"
This reverts commit de34007751.

There are too many build errors, which needs to be sorted out first.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-12 15:25:37 +02:00
Jiaxun Yang
6ca176fa3a MIPS: octeon_switch: Remove duplicated labels
EXPORT macro already have labels defined by itself.
Remove duplicated labels outside to silent assembler warnings.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-12 15:14:16 +02:00
Jiaxun Yang
f0e7c06f2b MIPS: loongson2ef: Add missing break in cs5536_isa
Fixes build error:

arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:217:2: error:
unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
        default:
        ^
arch/mips/loongson2ef/common/cs5536/cs5536_isa.c:217:2:
note: insert 'break;' to avoid fall-through
        default:
        ^
        break;

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-12 15:12:24 +02:00
Tiezhu Yang
afa624ff96 MIPS: Remove set_swbp() in uprobes.c
set_swbp() in arch/mips/kernel/uprobes.c is same with the weak version
in kernel/events/uprobes.c, remove it.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-12 15:09:38 +02:00
Tiezhu Yang
f5748b8c79 MIPS: Use def_bool y for ARCH_SUPPORTS_UPROBES
Like all the other archs, use def_bool y for ARCH_SUPPORTS_UPROBES,
then no need to select ARCH_SUPPORTS_UPROBES.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-12 15:08:36 +02:00
Jiaxun Yang
ee1809ed7b MIPS: fw: Allow firmware to pass a empty env
fw_getenv will use env entry to determine style of env,
however it is legal for firmware to just pass a empty list.

Check if first entry exist before running strchr to avoid
null pointer dereference.

Cc: stable@vger.kernel.org
Link: https://github.com/clbr/n64bootloader/issues/5
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-12 15:07:36 +02:00
Thomas Bogendoerfer
7fb6f7b0af MIPS: Remove deprecated CONFIG_MIPS_CMP
Commit 5cac93b35c ("MIPS: Deprecate CONFIG_MIPS_CMP") deprecated
CONFIG_MIPS_CMP and after 9 years it's time to remove it.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-12 15:01:09 +02:00
Aleksander Jan Bajkowski
045c340c86 MIPS: lantiq: remove unused function declaration
The removed function declaration is a leftover of the old gphy firmware
loader, that has been removed in d5103604f7.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 10:21:06 +02:00
Nathan Chancellor
275aca650e MIPS: Drop unused positional parameter in local_irq_{dis,en}able
When building with clang's integrated assembler, it points out that the
CONFIG_CPU_HAS_DIEI versions of local_irq_enable and local_irq_disable
have a named parameter that is not used in the body of the macro and it
thinks that $8 is a positional parameter, rather than a register:

  arch/mips/include/asm/asmmacro.h:48:2: warning: macro defined with named parameters which are not used in macro body, possible positional parameter found in body which will have no effect
   .macro local_irq_enable reg=$8
   ^

The comment above the function that performs this check in LLVM notes
that the warning may trigger in this case, even though it is not
problematic. It is easy enough to clean this up by just omitting the
named parameter for this version of the macro, as it is entirely unused.

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1415
Link: 81c944cadb
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 10:20:00 +02:00
Thomas Bogendoerfer
c86df6c0d4 MIPS: mm: Remove local_cache_flush_page
After ide.h is gone, there are no users of local_cache_flush_page() left.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 10:08:53 +02:00
Thomas Bogendoerfer
461ba3e7e6 MIPS: Remove no longer used ide.h
There are only three drivers left using ide.h, which are all m68k only.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 10:08:51 +02:00
Thomas Bogendoerfer
db9947cea8 MIPS: mm: Remove unused *cache_page_indexed flush functions
The *cache_page_indexed flush functions are no (longer) used.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 10:08:41 +02:00
Jiaxun Yang
de34007751 MIPS: generic: Enable all CPUs supported by virt board in Kconfig
Enable extra CPUs that may be supported by virt board, including
R4x00 (R4000 in QEMU), Cavium Octeon (Octeon68XX in QEMU), loongson2e,
loongson2f.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
03be534e1b MIPS: Add board config for virt board
Aligned with QEMU MIPS virt board.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
78073b8f1f MIPS: Octeon: Disable CVMSEG by default on other platforms
QEMU can't emulate CVMSEG on generic platform for now.

Just disable it by default.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
0c6ff92773 MIPS: Loongson: Don't select platform features with CPU
ARCH_HAS_PHYS_TO_DMA and GPIOLIB are all platform level features
they shouldn't be selected with CPU.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
194a835210 MIPS: Loongson: Move arch cflags to MIPS top level Makefile
Arch cflags should be independent to Platform.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
b6007ff809 MIPS: Octeon: Allow CVMSEG to be disabled
Don't include cvmseg states into thread_status when
CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE is not defined or 0.

Fix compile for kernel without this feature.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
6e90049162 MIPS: c-octeon: Provide alternative SMP cache flush function
Currently c-octeon relies on octeon's own smp function to flush
I-Cache. However this function is not available on generic platform.

Just use smp_call_function_many on generic platform.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
f641519409 MIPS: cpu-features: Enable octeon_cache by cpu_type
cpu_has_octeon_cache was tied to 0 for generic cpu-features,
whith this generic kernel built for octeon CPU won't boot.

Just enable this flag by cpu_type. It won't hurt orther platforms
because compiler will eliminate the code path on other processors.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
918d779569 MIPS: Octeon: Opt-out 4k_cache feature
Octeon has a different cache interface with traditional R4K one,
just opt-out this flag for octeon to avoid run R4K cache initialization
code accidentally.

Also remove ISA level assumption for 4k cache.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:09 +02:00
Jiaxun Yang
e1aa1dfef6 MIPS: mips-cm: Check availability of config registers
Prevent reading unsupported config register during probing process.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:08 +02:00
Jiaxun Yang
aa45787c0d MIPS: smp-cps: Disable coherence setup for unsupported ISA
We don't know how to do coherence setup on ISA before MIPS
Release 1.

As CPS support only servers simulation purpose on those cores,
and simulators are always coherent, just disable initialization
code and provide user a warning in case coherence is not setup
properly.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:08 +02:00
Jiaxun Yang
393a759647 MIPS: Move declaration of bcache ops to cache.c
bcache is not tied to CPU's cache interface. Just move those
declaration to cache.c so it can be avaialble to CPU with all
cache types.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-04-05 09:45:08 +02:00
Thomas Bogendoerfer
101f26c728 MIPS: octeon: Fix compile error
Commit ed6a0b6e9f ("MIPS: octeon: Use of_address_to_resource()") lost
a cast, which causes a compile error.

Fixes: ed6a0b6e9f ("MIPS: octeon: Use of_address_to_resource()")
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-27 10:39:47 +02:00
Jiaxun Yang
600efe35d5 MIPS: c-r4k: Always install dma flush functions
As nowadays DMA coherence is managed per device, it is possible
to have a system that is defaulted to coherent dma but still
have noncoherent device that needs to use those flush functions.

Just install them unconditionally.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-24 14:07:13 +01:00
Jiaxun Yang
e0b7fd1207 MIPS: Always select ARCH_HAS_SYNC_DMA_FOR_CPU for noncoherent platforms
As now we are telling the necessity of post DMA flush per CPU type,
there is no need to select ARCH_HAS_SYNC_DMA_FOR_CPU on per platform
bias, just select it unconditionally and we can sort it at runtime.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-24 14:06:59 +01:00
Jiaxun Yang
6be87d61c4 MIPS: Always select ARCH_HAS_SETUP_DMA_OPS
arch_setup_dma_ops on MIPS sets coherency information in struct device.
It's essential for per-device coherency to work.

Select it for all non-coherent platforms.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-24 14:06:43 +01:00
Rob Herring
ed6a0b6e9f MIPS: octeon: Use of_address_to_resource()
Replace of_get_address() and of_translate_address() calls with single
call to of_address_to_resource().

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-24 14:01:39 +01:00
Lukas Bulwahn
d703e5a6ff mips: Remove obsolete configs IRQ_MSP_CIC and IRQ_MSP_SLP
Commit 1b00767fd8 ("MIPS: Remove PMC MSP71xx platform") removes all uses
of the config IRQ_MSP_CIC and IRQ_MSP_SLP.

Remove these two obsolete configs IRQ_MSP_CIC and IRQ_MSP_SLP.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-24 13:59:02 +01:00
Lukas Bulwahn
a45e5fe792 MIPS: ath79: remove obsolete ATH79_DEV_* configs
Commit 85b9686dae ("MIPS: ath79: drop platform device registration code")
removes all files arch/mips/ath79/dev-*.[ch], adjusts the Makefile, but
misses to adjust the Kconfig file. Hence, since then, the configs
ATH79_DEV_* are really dead.

Commit 3a77e0d75e ("MIPS: ath79: drop machfiles") already removes all
configs that select ATH79_DEV_* config. So at that point, they was not a
way to enable them with a kernel build configuration.

Remove these obsolete ATH79_DEV_* configs.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-17 10:28:04 +01:00
Thomas Bogendoerfer
0345234720 MIPS: sibyte: Replace BCM1125H with SB1250 option
SIBYTE_BCM1125H is identical to SIBYTE_SB1250, so remove one of them.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-17 10:27:34 +01:00
Thomas Bogendoerfer
a0136c28a2 MIPS: sibyte: Remove Sibyte CARMEL and CRHINE board support
Looks like these boards were nether in active use, so let's remove them.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-17 10:27:21 +01:00
Thomas Bogendoerfer
b984d7b56d MIPS: sibyte: Remove unused config option SIBYTE_BCM1x55
SIBYTE_BCM1x55 is not selected anywhere, so let's get rid of it.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-17 10:27:08 +01:00
Thomas Bogendoerfer
1150e181a1 MIPS: sibyte: remove no longer needed board_mem_region
With the direct use of memblock interface board_mem_region is no
longer needed.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-17 10:26:51 +01:00
Rob Herring
9c99b4880d mips: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:16:46 +01:00
Sergio Paracuellos
83552892b7 mips: ralink: mt7620: introduce 'soc_device' initialization
MT7620 SoCs have their own 'ralink_soc_info' structure with some
information about the soc itself. In order to be able to retrieve this
information from driver code and avoid architecture dependencies for
retrieving these details introduce this 'soc_device'. Set 'data' pointer
points to the struct 'ralink_soc_info' to be able to export also current
soc information using this mechanism. We need to select 'SOC_BUS' in
Kconfig configuration for these SoCs.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:51 +01:00
Sergio Paracuellos
727ea3c77d mips: ralink: mt7620: soc queries and tests as functions
Move the SoC register value queries and tests to specific functions,
to remove repetition of logic. No functional changes intended

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:51 +01:00
Sergio Paracuellos
217cf927e7 mips: ralink: mt7620: define MT7620_SYSC_BASE with __iomem
So that MT7620_SYSC_BASE can be used later in multiple functions without
needing to repeat this __iomem declaration each time

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:51 +01:00
Sergio Paracuellos
7a26b384c4 mips: ralink: rt288x: introduce 'soc_device' initialization
RT288X SoCs have their own 'ralink_soc_info' structure with some
information about the soc itself. In order to be able to retrieve this
information from driver code and avoid architecture dependencies for
retrieving these details introduce this 'soc_device'. Set 'data' pointer
points to the struct 'ralink_soc_info' to be able to export also current
soc information using this mechanism. We need to select 'SOC_BUS' in
Kconfig configuration for these SoCs.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:51 +01:00
Sergio Paracuellos
5a5aa151bd mips: ralink: rt288x: soc queries and tests as functions
Move the SoC register value queries and tests to specific functions,
 to remove repetition of logic. No functional changes intended

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:50 +01:00
Sergio Paracuellos
1e688601d1 mips: ralink: rt288x: define RT2880_SYSC_BASE with __iomem
So that RT2880_SYSC_BASE can be used later in multiple functions without
 needing to repeat this __iomem declaration each time

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:50 +01:00
Sergio Paracuellos
2165248f68 mips: ralink: rt3883: introduce 'soc_device' initialization
RT3883 SoC have its own 'ralink_soc_info' structure with some
information about the soc itself. In order to be able to retrieve this
information from driver code and avoid architecture dependencies for
retrieving these details introduce this 'soc_device'. Set 'data' pointer
points to the struct 'ralink_soc_info' to be able to export also current
soc information using this mechanism. We need to select 'SOC_BUS' in
Kconfig configuration for these SoCs.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:50 +01:00
Sergio Paracuellos
89f9b3041e mips: ralink: rt3883: soc queries and tests as functions
Move the SoC register value queries and tests to specific functions,
 to remove repetition of logic. No functional changes intended

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:50 +01:00
Sergio Paracuellos
7edb177584 mips: ralink: rt3883: define RT3883_SYSC_BASE with __iomem
So that RT3883_SYSC_BASE can be used later in multiple functions without
needing to repeat this __iomem declaration each time

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:50 +01:00
Sergio Paracuellos
bf27860fca mips: ralink: rt305x: introduce 'soc_device' initialization
RT305x SoCs have their own 'ralink_soc_info' structure with some
information about the soc itself. In order to be able to retrieve this
information from driver code and avoid architecture dependencies for
retrieving these details introduce this 'soc_device'. Set 'data' pointer
points to the struct 'ralink_soc_info' to be able to export also current
soc information using this mechanism. We need to select 'SOC_BUS' in
Kconfig configuration for these SoCs.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:50 +01:00
Sergio Paracuellos
0def2164c9 mips: ralink: rt305x: soc queries and tests as functions
Move the SoC register value queries and tests to specific functions,
to remove repetition of logic. No functional changes intended

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2023-03-14 17:13:50 +01:00