26 Commits

Author SHA1 Message Date
Swee Aun Khor
9074d7744f Enhance SDIO tuning algorithm
Improve the SDIO tuning algorithm to increase stability and
performance under low-temperature conditions.

Signed-off-by: Swee Aun Khor <sakhor@efinixinc.com>
2026-08-09 22:44:47 -07:00
Swee Aun Khor
334eb3ba15 Add a new SDIO controller driver for Efinix devices
The driver supports UHS-I bus speed modes: SDR25, DDR50, and SDR104.
By default, the controller operates in SDR25 mode. Higher-speed modes
can be enabled via the Device Tree by adding the following properties
to the SDIO node:

  - sd-uhs-ddr50
  - sd-uhs-sdr104

When these properties are present, the driver negotiates the highest
supported UHS mode with the card and host.

Signed-off-by: Swee Aun Khor <sakhor@efinixinc.com>
2026-08-09 22:44:47 -07:00
Kefeng Wang
d7b360824e riscv: Enable CMA support
riscv has selected HAVE_DMA_CONTIGUOUS, but don't call
dma_contiguous_reserve(). let's enable CMA as expect.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
2026-08-09 22:44:46 -07:00
Teoh Choon Zone
7c649c3ce5 mmc: Add Efinix eMMC driver 2026-08-09 22:42:42 -07:00
Mohamad Noor Alim Hussin
f0ec6f6955 drivers: add efinix watchdog driver 2026-08-09 22:42:42 -07:00
Mohamad Noor Alim Hussin
d31b653b2f drivers/mtd/spi-nor: add support for is25wp512m spi flash device
Ti375C529 use spi flash is25wp512m. This spi flash did not recognize by
the kernel as it missing the device id within spi-flash device driver.

Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:42:42 -07:00
Mohamad Noor Alim Hussin
b6b404e6d1 fb: add Efinix framebuffer driver 2026-08-09 22:42:42 -07:00
Mohamad Noor Alim Hussin
89d4b5521f dma: add Efinix DMA controller driver 2026-08-09 22:42:42 -07:00
Mohamad Noor Alim Hussin
6f082dfd7a spi-spinal-lib: fix spi driver to support dummy clock cycle
SPI flash require 8 dummy clock cycle during read operation
before it can receive the data. However, this might not needed
by other SPI device such as SD card when operate in SPI mode.
Thus, a new device tree property called 'dummy-cycle' is added
to resolve this issue. This optional device tree property is
needed for controlling the SPI flash device.

Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:42:41 -07:00
Mohamad Noor Alim Hussin
0debccc414 phy: realtek: enable master mode configuration for RTL8211F
The PHY has an issue when operating in gigabit slave mode.
It not able to transmit or receive any packet in the slave
mode. Thus, this patch enable the master mode configuration
of the phy.

Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:42:41 -07:00
Mohamad Noor Alim Hussin
8d7d404de2 phy/realtek: disable ALDPS mode for RTL8211F
The ALDPS mode will stop the pll to save the power.
This cause the kernel crash whenever it tried to read
or write to the phy due to phy is power off state.
Disable this mode to let the phy keep alive.

Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:42:41 -07:00
Mohamad Noor Alim Hussin
416f78df05 riscv/cpu: add more information to show on cpuinfo
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:42:41 -07:00
Mohamad Noor Alim Hussin
69a1a758d5 mmc: add efinix sdhci driver
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:42:41 -07:00
Kenny Cheung
4a4b5d8875 drivers: add efinix tsemac driver
Signed-off-by: Kenny Cheung <kenny.cheung@elitestek.com>
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:42:41 -07:00
Kefeng Wang
c7d01374b1 riscv: Improve __show_regs
Show the function symbols of epc and ra to improve the
readability of crash reports, and align the printing
formats about the raw epc value.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2026-08-09 22:42:41 -07:00
Guo Ren
ffb6934a45 riscv: Using PATCHABLE_FUNCTION_ENTRY instead of MCOUNT
This patch changes the current detour mechanism of dynamic ftrace
which has been discussed during LPC 2020 RISCV-MC [1].

Before the patch, we used mcount for detour:
<funca>:
	addi sp,sp,-16
	sd   ra,8(sp)
	sd   s0,0(sp)
	addi s0,sp,16
	mv   a5,ra
	mv   a0,a5
	auipc ra,0x0 -> nop
	jalr  -296(ra) <_mcount@plt> ->nop
	...

After the patch, we use nop call site area for detour:
<funca>:
	nop -> REG_S ra, -SZREG(sp)
	nop -> auipc ra, 0x?
	nop -> jalr ?(ra)
	nop -> REG_L ra, -SZREG(sp)
	...

The mcount mechanism is mixed with gcc function prologue which is
not very clear. The patchable function entry just put 16 bytes nop
before the front of the function prologue which could be filled
with a separated detour mechanism.

[1] https://www.linuxplumbersconf.org/event/7/contributions/807/

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2026-08-09 22:42:41 -07:00
Mohamad Noor Alim Hussin
455948e1e5 RISC-V: enable dynamic ftrace for RV32I
The RISC-V mcount function is now capable of supporting RV32I so make it
available in the kernel config.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Link: https://lore.kernel.org/r/20221115200832.706370-5-jamie@jamieiles.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:38:51 -07:00
Jamie Iles
e958eb5cf3 RISC-V: preserve a1 in mcount
The RISC-V ELF psABI states that both a0 and a1 are used for return
values so we should preserve them both in return_to_handler.  This is
especially important for RV32 for functions returning a 64-bit quantity
otherwise the return value can be corrupted and undefined behaviour
results.

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Link: https://lore.kernel.org/r/20221115200832.706370-4-jamie@jamieiles.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2026-08-09 22:38:51 -07:00
Jamie Iles
b2371299bf RISC-V: reduce mcount save space on RV32
For RV32 we can reduce the size of the ABI save+restore state by using
SZREG so that register stores are packed rather than on an 8 byte
boundary.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20221115200832.706370-3-jamie@jamieiles.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2026-08-09 22:38:51 -07:00
Jamie Iles
0f11a52582 RISC-V: use REG_S/REG_L for mcount
In preparation for rv32i ftrace support, convert mcount routines to use
native sized loads/stores.

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Link: https://lore.kernel.org/r/20221115200832.706370-2-jamie@jamieiles.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2026-08-09 22:38:51 -07:00
Sebastien Van Cauwenberghe
8b12b26dd9 riscv: Align on L1_CACHE_BYTES when STRICT_KERNEL_RWX
Allows the sections to be aligned on smaller boundaries and
therefore results in a smaller kernel image size.

Signed-off-by: Sebastien Van Cauwenberghe <svancau@gmail.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2026-08-09 22:38:51 -07:00
Mohamad Noor Alim Hussin
7e9a098f27 drivers: add dma spinal dmesg driver
Signed-off-by: Dolu1990 <charles.papon.90@gmail.com>
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:38:51 -07:00
Mohamad Noor Alim Hussin
270244937f drivers: add serial spinal driver
Signed-off-by: Dolu1990 <charles.papon.90@gmail.com>
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:38:51 -07:00
Mohamad Noor Alim Hussin
31e941effe drivers: add gpio spinal driver
Signed-off-by: Dolu1990 <charles.papon.90@gmail.com>
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:38:50 -07:00
Mohamad Noor Alim Hussin
1e5fdcf21c drivers: add spi spinal driver
Signed-off-by: Dolu1990 <charles.papon.90@gmail.com>
Signed-off-by: Mohamad Noor Alim Hussin <mnalim@efinixinc.com>
2026-08-09 22:38:50 -07:00
9d0aeafebd initial commit 2026-08-09 22:38:33 -07:00