[PATCH 1/2] virtio: remove VIRTIO_PCI dependance on MMU for MIPS

2023-06-10 Thread Denis Orlov
The issues that broke the usage of VIRTIO_PCI on MIPS when we are running uncached (i.e. with CONFIG_MMU=n) seem to have been fixed. As such, allow this option to be set for those configurations. Signed-off-by: Denis Orlov --- drivers/virtio/Kconfig | 1 - 1 file changed, 1 deletion(-) diff

[PATCH 0/2] MIPS: set virtio and other options in malta defconfigs

2023-06-10 Thread Denis Orlov
The issues with VIRTIO_PCI on MIPS seems to have been fixes, so enable this option. And, while at it, also enable a few more for which there is no reason not to have them enabled. Denis Orlov (2): virtio: remove VIRTIO_PCI dependance on MMU for MIPS MIPS: enable more options in malta

Re: [PATCH 02/17] MIPS: malta: use CKSEG instead of KSEG macros

2023-06-06 Thread Denis Orlov
On Tue, 6 Jun 2023 at 11:03, Ahmad Fatoum wrote: > > On 05.06.23 22:10, Denis Orlov wrote: > > KSEG macro is not available when compiling with CONFIG_64BIT enabled, so > > use CKSEG instead. > > If they're interchangeable, why do we need KSEG? Hmm, I think maybe we don

Re: [PATCH 00/17] MIPS: fix and improve 64BIT support

2023-06-06 Thread Denis Orlov
Hello Ahmad, On Tue, 6 Jun 2023 at 11:02, Ahmad Fatoum wrote: > > Hello Denis, > > On 05.06.23 22:10, Denis Orlov wrote: > > The existing 64BIT support for MIPS was somewhat incomplete with no > > board having MIPS64 CPUs specified to be available as targets. Define >

Re: [PATCH 11/17] MIPS: Makefile: sign-extend TEXT_BASE value on CONFIG_64BIT

2023-06-06 Thread Denis Orlov
On Tue, 6 Jun 2023 at 12:04, Ahmad Fatoum wrote: > > On 05.06.23 22:10, Denis Orlov wrote: > > The code that uses TEXT_BASE will fail on reading truncated 32-bit > > address if running with 64BIT enabled. As we only support running from > > compatibility segments (i.e.

Re: [PATCH 04/17] MIPS: o32: provide ta0..ta3 register definitions

2023-06-06 Thread Denis Orlov
On Tue, 6 Jun 2023 at 11:13, Ahmad Fatoum wrote: > > On 05.06.23 22:10, Denis Orlov wrote: > > This allows to write generic assembly code that will compile under both > > o32 and n64 ABIs, as otherwise the register definitions would conflict. > > > > Taken from Linu

[PATCH 05/21] MIPS: reloc: mark relocate_code() as noreturn

2023-07-24 Thread Denis Orlov
After relocating the code we jump straight to it, with the function having an 'unreachable()' call at the end. So add an appropriate attribute. Signed-off-by: Denis Orlov --- arch/mips/lib/reloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/lib/reloc.c b

[PATCH 02/21] MIPS: addrspace: simplify the header

2023-07-24 Thread Denis Orlov
Deduplicate some of the definitions for 32/64-bit targets and make KSEG* 32-bit defines available for 64-bit builds, as those might still be useful in certain cases. Signed-off-by: Denis Orlov --- arch/mips/include/asm/addrspace.h | 45 ++- 1 file changed, 20

[PATCH 00/21] MIPS: semi-random code improvements

2023-07-24 Thread Denis Orlov
Denis Orlov (21): MIPS: addrspace: rectify ksseg segment naming MIPS: addrspace: simplify the header MIPS: main_entry-pbl: remove unused variable MIPS: barebox.lds: remove extra whitespace MIPS: reloc: mark relocate_code() as noreturn MIPS: cpuinfo: use appropriate format specifiers

[PATCH 07/21] MIPS: print BadVAddr CP0 register on exception

2023-07-24 Thread Denis Orlov
This register contains the failing address on Address Error and some TLB-related exceptions, and is useful for debugging purposes. Signed-off-by: Denis Orlov --- arch/mips/include/asm/stackframe.h | 4 arch/mips/lib/traps.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion

[PATCH 10/21] MIPS: malta: remove duplicated barebox magic code

2023-07-24 Thread Denis Orlov
Use 'mips_barebox_10h' macro instead. Remove the comment about the same address being reserved for a Board ID as we don't really do anything about it anyway. Signed-off-by: Denis Orlov --- arch/mips/boards/qemu-malta/lowlevel.S | 11 +-- 1 file changed, 1 insertion(+), 10 deletions

[PATCH 08/21] MIPS: malta: merge GT64120 headers

2023-07-24 Thread Denis Orlov
The various definitions related to GT64120 system controller were split between two headers: 'asm/gt64120.h' and 'mach/mach-gt64120.h'. It seems that they were taken from Linux in this form. No reason to keep it like that though, so unify them into 'mach/gt64120.h'. Signed-off-by: Denis Orlov

[PATCH 12/21] MIPS: pbl: make sure to disable interrupts/watchpoints on entry

2023-07-24 Thread Denis Orlov
of those actions and ensure that it's used in every board's entry code. Signed-off-by: Denis Orlov --- arch/mips/boards/8devices-lima/lowlevel.S | 2 ++ arch/mips/boards/dlink-dir-320/lowlevel.S | 2 +- arch/mips/boards/img-ci20/lowlevel.S | 2 +- arch/mips/boards/loongson-ls1b

[PATCH 06/21] MIPS: cpuinfo: use appropriate format specifiers in printf

2023-07-24 Thread Denis Orlov
Signed-off-by: Denis Orlov --- arch/mips/lib/cpuinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/lib/cpuinfo.c b/arch/mips/lib/cpuinfo.c index fd27920f9b..41ec7b8d53 100644 --- a/arch/mips/lib/cpuinfo.c +++ b/arch/mips/lib/cpuinfo.c @@ -25,12 +25,12

[PATCH 09/21] MIPS: pbl_macros: use .asciiz instead of .ascii + .byte 0

2023-07-24 Thread Denis Orlov
GAS allows to use '.asciz'/'.asciiz' instead of manually writing '.byte 0' to null-terminate the string specified in '.ascii' directive. Do just that in 'mips_barebox_10h'. The malta-specific entry code currently does the same. Signed-off-by: Denis Orlov --- arch/mips/include/asm/pbl_macros.h

[PATCH 11/21] MIPS: pbl: put mips_barebox_10h into ENTRY_FUNCTION

2023-07-24 Thread Denis Orlov
Remove duplicated macro calls by moving it into a common macro, as is done in ARM code. Some boards were missing this one for no good reason, it seems. Well, now they don't. Signed-off-by: Denis Orlov --- arch/mips/boards/8devices-lima/lowlevel.S | 2 -- arch/mips/boards/dlink-dir-320

[PATCH 15/21] MIPS: main_entry: properly set XTLB handler for 64-bit mode

2023-07-24 Thread Denis Orlov
compatible exception handling scheme (and we even hardcode that), so what are we trying to achieve there anyway? Signed-off-by: Denis Orlov --- arch/mips/boot/main_entry.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/mips/boot/main_entry.c b/arch/mips/boot

[PATCH 13/21] MIPS: pbl: do enable 64-bit addressing in PBL

2023-07-24 Thread Denis Orlov
It seems more reasonable to do that in PBL code that initializes all the other appropriate CP0 register bits. This also makes a corresponding call in barebox proper entry code redundant, paving the way to its removal. Signed-off-by: Denis Orlov --- arch/mips/include/asm/pbl_macros.h | 1 + 1

[PATCH 18/21] MIPS: c-r4k: generate blast_*cache functions via macros

2023-07-24 Thread Denis Orlov
This gets us rid of this logic repeated in 'flush_cache_all()' for each cache and allows to use blast_*cache funcs elsewhere if such a need arises. Signed-off-by: Denis Orlov --- arch/mips/lib/c-r4k.c | 41 - 1 file changed, 24 insertions(+), 17 deletions

[PATCH 01/21] MIPS: addrspace: rectify ksseg segment naming

2023-07-24 Thread Denis Orlov
-by: Denis Orlov --- arch/mips/include/asm/addrspace.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h index 11f10e5011..7a2006a8d1 100644 --- a/arch/mips/include/asm/addrspace.h +++ b/arch/mips

[PATCH 03/21] MIPS: main_entry-pbl: remove unused variable

2023-07-24 Thread Denis Orlov
For some reason we do set 'ttb' global variable, however we never end up using it. Signed-off-by: Denis Orlov --- arch/mips/boot/main_entry-pbl.c | 4 1 file changed, 4 deletions(-) diff --git a/arch/mips/boot/main_entry-pbl.c b/arch/mips/boot/main_entry-pbl.c index f75ec03851..78982fd995

[PATCH 14/21] MIPS: clean up barebox proper entry point

2023-07-24 Thread Denis Orlov
()'. Signed-off-by: Denis Orlov --- arch/mips/boot/start.S | 46 -- arch/mips/boot/start.c | 17 2 files changed, 17 insertions(+), 46 deletions(-) delete mode 100644 arch/mips/boot/start.S create mode 100644 arch/mips/boot/start.c diff

[PATCH 16/21] MIPS: main_entry: remove exception vector array

2023-07-24 Thread Denis Orlov
to copy now consists of just two instructions. However it feels more safe to calculate that in code instead, so that we don't have to update this value if some code is added there in the future. Signed-off-by: Denis Orlov --- arch/mips/boot/main_entry.c | 39

[PATCH 21/21] MIPS: reloc: use IS_ALIGNED macro to check for an alignment

2023-07-24 Thread Denis Orlov
Improves the code readability a tiny little bit. Signed-off-by: Denis Orlov --- arch/mips/lib/reloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c index 83b4040d95..a9078aa813 100644 --- a/arch/mips/lib/reloc.c +++ b/arch/mips

[PATCH 20/21] MIPS: c-r4k: remove extra function declaration

2023-07-24 Thread Denis Orlov
'r4k_cache_init()' is already declared in the appropriate 'asm/cache.h' header. Signed-off-by: Denis Orlov --- arch/mips/lib/c-r4k.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/mips/lib/c-r4k.c b/arch/mips/lib/c-r4k.c index 2fb4e90138..44cf57d99b 100644 --- a/arch/mips/lib/c-r4k.c

[PATCH 17/21] MIPS: c-r4k: prettify code in __BUILD_BLAST_CACHE_RANGE

2023-07-24 Thread Denis Orlov
Even though the original code was taken from Linux, it is quite old and crufty. Replace the 'while (1)' loop with the 'for' one, use const for constant variables and use ALIGN_DOWN macro instead of repeating its code. Signed-off-by: Denis Orlov --- arch/mips/lib/c-r4k.c | 13 + 1

[PATCH 19/21] MIPS: c-r4k: do flush secondary cache

2023-07-24 Thread Denis Orlov
and calls to them. This will make it easier to add support for boards that do happen to have secondary caches. Signed-off-by: Denis Orlov --- arch/mips/include/asm/cacheops.h | 5 + arch/mips/lib/c-r4k.c| 12 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git

[PATCH 04/21] MIPS: barebox.lds: remove extra whitespace

2023-07-24 Thread Denis Orlov
Signed-off-by: Denis Orlov --- arch/mips/lib/barebox.lds.S | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/mips/lib/barebox.lds.S b/arch/mips/lib/barebox.lds.S index 1259a4e94f..0720f9295d 100644 --- a/arch/mips/lib/barebox.lds.S +++ b/arch/mips/lib/barebox.lds.S @@ -3,7 +3,6

[PATCH 0/2] usb: small dma allocation fixes

2023-06-29 Thread Denis Orlov
Make sure dma buffers are both properly allocated and freed (they were not in a few places). Denis Orlov (2): usb: storage: fix missing calls to free() usb: make sure dma buffers are properly allocated drivers/usb/core/usb.c | 16 --- drivers/usb/storage/transport.c | 74

[PATCH 2/2] usb: make sure dma buffers are properly allocated

2023-06-29 Thread Denis Orlov
. This is exactly what dma_alloc() is for, so use that for buffers which we are going to map for dma. Signed-off-by: Denis Orlov --- drivers/usb/core/usb.c | 16 --- drivers/usb/storage/transport.c | 74 +++-- drivers/usb/storage/usb.c | 17 3

[PATCH 1/2] usb: storage: fix missing calls to free()

2023-06-29 Thread Denis Orlov
Memory allocated with xzalloc() was not actually being freed in a few functions, resulting in memory leaks. Signed-off-by: Denis Orlov --- drivers/usb/storage/usb.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/usb/storage/usb.c b/drivers/usb

[PATCH] nios2: remove arch remains from drivers

2023-06-29 Thread Denis Orlov
The architecture was removed back in the commit efccc13513, however some drivers that were available exclusively for NIOS2 were left over. As it has been impossible to compile those since then, it seems reasonable to just get rid of them. Signed-off-by: Denis Orlov --- drivers/serial/Kconfig

Re: [PATCH] nios2: remove arch remains from drivers

2023-06-30 Thread Denis Orlov
On 6/30/23 11:57, Ian Abbott wrote: > On 29/06/2023 21:13, Denis Orlov wrote: >> The architecture was removed back in the commit efccc13513, however some >> drivers that were available exclusively for NIOS2 were left over. As it >> has been impossible to compile those

[PATCH] video: bochs: fix IOMEM usage

2023-05-11 Thread Denis Orlov
of the latter function having __iomem attributes, we should not be remapping them. So, remove those IOMEM calls and instead do explicit remapping in bochs_isa_detect(), which was missing it. Also fix bochs_hw_probe() declaration missing one __iomem. Signed-off-by: Denis Orlov --- drivers/video/bochs

[PATCH 1/2] ddr_spd: add DDR3 Load Reduced module specific data

2024-03-11 Thread Denis Orlov
This will be used by the DDR3 SPD data printing routine and is needed for completeness, to cover all of the DDR3-related cases from the original decode-dimms tool. Signed-off-by: Denis Orlov --- include/ddr_spd.h | 34 ++ 1 file changed, 34 insertions(+) diff

[PATCH 0/2] ddr_spd: extend spd_decode to cover DDR3

2024-03-11 Thread Denis Orlov
This extends the spd_decode command to correctly print out the contents of the DDR3 SPD EEPROMs in addition to the DDR2 ones. Denis Orlov (2): ddr_spd: add DDR3 Load Reduced module specific data ddr_spd: add routine for printing DDR3 SPD contents common/ddr_spd.c | 556

[PATCH 2/2] ddr_spd: add routine for printing DDR3 SPD contents

2024-03-11 Thread Denis Orlov
as a hexadecimal value instead of a decoded string. The logic is mostly the same too, but some changes in how calculations are made were required so as not to use floating point arithmetic. Signed-off-by: Denis Orlov --- common/ddr_spd.c | 556 ++- 1

[PATCH] clk: fix clk_set_rate command help text

2024-03-20 Thread Denis Orlov
It was at odds with the list of options, with the former mentioning RATE and the latter mentioning HZ as a parameter. It seems that every other clk-related command uses HZ, so use it here too. Signed-off-by: Denis Orlov --- commands/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 3/3] mips: mipsregs: remove duplicate definitions for Config 1 bits

2024-03-28 Thread Denis Orlov
Also reorder some of them to be more uniform. Signed-off-by: Denis Orlov --- arch/mips/include/asm/mipsregs.h | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 9e7d656542..0b618320ff 100644

[PATCH 2/3] mips: cpu-probe: identify more MIPS CPUs

2024-03-28 Thread Denis Orlov
This adds support for identifying more CPUs emulatable by QEMU, so that their names are shown when using 'cpuinfo' command. Signed-off-by: Denis Orlov --- arch/mips/include/asm/cpu.h | 30 +++ arch/mips/lib/cpu-probe.c | 59 - 2 files

[PATCH 1/3] mips: cpuinfo: fix cpu name output for unknown processors

2024-03-28 Thread Denis Orlov
Otherwise it would output as __cpu_name global variable ends up being a null pointer. Signed-off-by: Denis Orlov --- arch/mips/lib/cpu-probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/lib/cpu-probe.c b/arch/mips/lib/cpu-probe.c index cbde43a595..47c9c671eb

[PATCH 0/3] mips: small improvements

2024-03-28 Thread Denis Orlov
Denis Orlov (3): mips: cpuinfo: fix cpu name output for unknown processors mips: cpu-probe: identify more MIPS CPUs mips: mipsregs: remove duplicate definitions for Config 1 bits arch/mips/include/asm/cpu.h | 30 +--- arch/mips/include/asm/mipsregs.h | 12 +++ arch

<    1   2