1
0
Fork 0
forked from mirror/openwrt
openwrt/target/linux/ramips
Michael Pratt 76f7dd3312 ramips: lzma-loader: use virtual memory segments for uart base address
The native bus address for UART was entered for rt305x UART_BASE,
but the bootloaders have memory space remapped with the same
virtual memory map the kernel uses for program addressing at boot time.

In UBoot, the remapped address is often defined as TEXT_BASE.
In the kernel, for rt305x this remapped address is RT305X_SYSC_BASE.
(arch/mips/include/asm/mach-ralink/rt305x.h)

Because the ralink I/O busses begin at a low address of 0x10000000,
they are remapped using KSEG0 or KSEG1, which for all 32-bit MIPS SOCs
(arch/mips/include/asm/addrspace.h)
are offsets of 0x80000000 and 0xa0000000 respectively.
This is consistent with the other UART_BASE macros here
and with MIPS memory map documentation.

Before the recent rework of the lzma-loader for ramips,
the original board-$(PLATFORM).c files also did not
use KSEG1ADDR for UART_BASE despite being defined,
which made this mistake easier to occur.

Fix this by defining KSEG1ADDR again and actually use it.
Copy and paste from the kernel's macros for consistency.

Link: https://training.mips.com/basic_mips/PDF/Memory_Map.pdf
Fixes: c31319b66 ("ramips: lzma-loader: Refactor loader")
Reported-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>

(cherry picked from commit 4c1e9bd858)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2024-01-05 23:32:59 +01:00
..
base-files/etc ramips: remove model name from LED labels 2020-10-02 14:51:57 +02:00
dts ramips: dts: mt7628an: reset FE and ESW cores together 2024-01-05 23:32:59 +01:00
files/drivers raimps: mtk_eth_soc: drop rst_esw from ESW driver 2024-01-05 23:32:59 +01:00
image ramips: lzma-loader: use virtual memory segments for uart base address 2024-01-05 23:32:59 +01:00
mt76x8 ramips: enable variable sector size erasure for all subtarget 2023-05-18 16:46:16 +02:00
mt7620 ramips: add support for Sercomm CPJ routers 2023-11-27 02:02:35 +01:00
mt7621 ramips: add support for Rostelecom RT-FE-1A 2024-01-04 21:45:04 +01:00
patches-5.15 kernel: bump 5.15 to 5.15.132 2023-09-25 23:04:37 +02:00
rt288x ramips: enable variable sector size erasure for all subtarget 2023-05-18 16:46:16 +02:00
rt305x ramips: enable variable sector size erasure for all subtarget 2023-05-18 16:46:16 +02:00
rt3883 ramips: enable variable sector size erasure for all subtarget 2023-05-18 16:46:16 +02:00
Makefile ramips: Switch default kernel to 5.15 2023-02-17 16:31:53 +02:00
modules.mk ramips: rename mtk-hsdma to hsdma-mt7621 2021-03-04 23:43:02 -10:00