diff --git a/arch/riscv/configs/k230_defconfig b/arch/riscv/configs/k230_defconfig index 369cd24be..0d6398741 100644 --- a/arch/riscv/configs/k230_defconfig +++ b/arch/riscv/configs/k230_defconfig @@ -274,6 +274,7 @@ CONFIG_I2C_DESIGNWARE_PLATFORM=y CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_EDT_FT5X06=y CONFIG_TOUCHSCREEN_GOODIX=y +CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C=y CONFIG_INPUT_EVDEV=y CONFIG_GPU_VGLITE=y CONFIG_BACKLIGHT_CLASS_DEVICE=y @@ -300,3 +301,9 @@ CONFIG_SND_SOC_K230_INNO=y CONFIG_SND_SOC_CANAAN_K230_INNO=y CONFIG_SND_SOC_CANAAN_K230_AUDIO=y CONFIG_K230_PERIDMA=y +# CONFIG_ERRATA_THEAD_PBMT is not set +CONFIG_RISCV_SBI_V01=y +CONFIG_SERIAL_EARLYCON_RISCV_SBI=y +# CONFIG_RISCV_ISA_ZICBOZ is not set +CONFIG_RISCV_ISA_SVPBMT=y +# CONFIG_FRAMEBUFFER_CONSOLE is not set diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile index 87689d173..6ec80284a 100644 --- a/arch/riscv/kernel/Makefile +++ b/arch/riscv/kernel/Makefile @@ -64,7 +64,7 @@ obj-$(CONFIG_VDSO64) += vdso64.o obj-$(CONFIG_VDSO32) += vdso32.o obj-$(CONFIG_VDSO64ILP32) += vdso64ilp32.o -obj-$(CONFIG_RISCV_M_MODE) += traps_misaligned.o +obj-y += traps_misaligned.o # K230: emulate misaligned in S-mode too obj-$(CONFIG_FPU) += fpu.o obj-$(CONFIG_RISCV_ISA_V) += vector.o obj-$(CONFIG_SMP) += smpboot.o diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 268187d4c..b99ea9454 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -590,6 +590,10 @@ void check_unaligned_access(int cpu) if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_UNKNOWN) return; + /* K230/OpenSBI-0.9: skip unaligned benchmark (M-mode misaligned emu hangs) */ + per_cpu(misaligned_access_speed, cpu) = RISCV_HWPROBE_MISALIGNED_SLOW; + return; + page = alloc_pages(GFP_NOWAIT, get_order(MISALIGNED_BUFFER_SIZE)); if (!page) { pr_warn("Can't alloc pages to measure memcpy performance"); diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c index 5e3ad459f..1324428d5 100644 --- a/arch/riscv/kernel/traps.c +++ b/arch/riscv/kernel/traps.c @@ -181,7 +181,7 @@ asmlinkage __visible __trap_section void do_trap_insn_illegal(struct pt_regs *re DO_ERROR_INFO(do_trap_load_fault, SIGSEGV, SEGV_ACCERR, "load access fault"); -#ifndef CONFIG_RISCV_M_MODE +#if 0 /* K230: always use the emulating misaligned handler (backported to S-mode) */ DO_ERROR_INFO(do_trap_load_misaligned, SIGBUS, BUS_ADRALN, "Oops - load address misaligned"); DO_ERROR_INFO(do_trap_store_misaligned, diff --git a/arch/riscv/kernel/traps_misaligned.c b/arch/riscv/kernel/traps_misaligned.c index 5348d842c..97fd8f558 100644 --- a/arch/riscv/kernel/traps_misaligned.c +++ b/arch/riscv/kernel/traps_misaligned.c @@ -240,7 +240,7 @@ int handle_misaligned_load(struct pt_regs *regs) union reg_data val; unsigned long epc = regs->epc; unsigned long insn = get_insn(epc); - unsigned long addr = csr_read(mtval); + unsigned long addr = csr_read(CSR_TVAL); /* K230: mode-aware (stval in S-mode) */ int i, fp = 0, shift = 0, len = 0; regs->epc = 0; @@ -323,7 +323,7 @@ int handle_misaligned_store(struct pt_regs *regs) union reg_data val; unsigned long epc = regs->epc; unsigned long insn = get_insn(epc); - unsigned long addr = csr_read(mtval); + unsigned long addr = csr_read(CSR_TVAL); /* K230: mode-aware (stval in S-mode) */ int i, len = 0; regs->epc = 0; diff --git a/drivers/gpu/drm/canaan/canaan_drv.c b/drivers/gpu/drm/canaan/canaan_drv.c index 40840e38f..47e4eca6b 100644 --- a/drivers/gpu/drm/canaan/canaan_drv.c +++ b/drivers/gpu/drm/canaan/canaan_drv.c @@ -269,7 +269,13 @@ static int canaan_drm_bind(struct device *dev) goto finish_poll; } - drm_fbdev_generic_setup(drm_dev, 32); + /* Use 16bpp (RGB565) for the emulated fbdev, NOT 32bpp (XRGB8888). + * The K230 OSD has no 32-bit-opaque format: 32bpp is always ARGB8888 with + * per-pixel alpha, and the mixer multiplies per-pixel * global alpha. fbcon + * (and any XRGB8888 client) clears the buffer to alpha=0, so the whole plane + * composites transparent and only the VO background shows. RGB565 has no + * alpha channel -> always opaque -> console and framebuffer content render. */ + drm_fbdev_generic_setup(drm_dev, 16); DRM_DEV_INFO(dev, "Canaan K230 DRM driver register successfully\n"); return 0; @@ -341,6 +347,14 @@ static int canaan_drm_platform_probe(struct platform_device *pdev) disp_dev = dev; pm_runtime_enable(disp_dev); + /* Root-cause fix: the display power domain (disp_domain) must stay powered while + * the display is driven. The only pm_runtime_get was in canaan_drm_open (userspace + * open of /dev/dri/card0); the in-kernel fbdev boot modeset never opens the device, + * so nothing held the ref -> genpd suspended the display-subsystem ~2s in -> every + * VO/DSI register read 0xffffffff and the timing generator died at ~5 frames. + * Hold the ref from probe (put is intentionally never called; the panel is always + * on for this handheld). */ + pm_runtime_get_sync(disp_dev); match = canaan_drm_match_add(dev); if (IS_ERR(match)) return PTR_ERR(match); diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index e3e232454..5d3eee2ad 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -401,6 +401,17 @@ config TOUCHSCREEN_FUJITSU To compile this driver as a module, choose M here: the module will be called fujitsu-ts. +config TOUCHSCREEN_GOODIX_BERLIN_CORE + tristate + +config TOUCHSCREEN_GOODIX_BERLIN_I2C + tristate "Goodix Berlin I2C touchscreen" + depends on I2C + select REGMAP_I2C + select TOUCHSCREEN_GOODIX_BERLIN_CORE + help + Goodix Berlin-series (GT9895/GT9916) touchscreen over I2C. + config TOUCHSCREEN_GOODIX tristate "Goodix I2C touchscreen" depends on I2C diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 62bd24f3a..ae36ac378 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -47,6 +47,8 @@ obj-$(CONFIG_TOUCHSCREEN_EGALAX_SERIAL) += egalax_ts_serial.o obj-$(CONFIG_TOUCHSCREEN_EXC3000) += exc3000.o obj-$(CONFIG_TOUCHSCREEN_FUJITSU) += fujitsu_ts.o obj-$(CONFIG_TOUCHSCREEN_GOODIX) += goodix_ts.o +obj-$(CONFIG_TOUCHSCREEN_GOODIX_BERLIN_CORE) += goodix_berlin_core.o +obj-$(CONFIG_TOUCHSCREEN_GOODIX_BERLIN_I2C) += goodix_berlin_i2c.o obj-$(CONFIG_TOUCHSCREEN_HIDEEP) += hideep.o obj-$(CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX) += hynitron_cstxxx.o obj-$(CONFIG_TOUCHSCREEN_ILI210X) += ili210x.o diff --git a/drivers/mmc/host/sdhci-of-kendryte.c b/drivers/mmc/host/sdhci-of-kendryte.c index ba8fd024f..f6e1694f4 100644 --- a/drivers/mmc/host/sdhci-of-kendryte.c +++ b/drivers/mmc/host/sdhci-of-kendryte.c @@ -330,6 +330,16 @@ static int dwcmshc_probe(struct platform_device *pdev) if (IS_ERR(host)) return PTR_ERR(host); + /* + * K230: force SDMA (disable ADMA). ADMA needs a non-cacheable coherent + * descriptor table (dma_alloc_coherent); with MAEE=0 and no working svpbmt + * on the C908 there is no non-cacheable coherent memory, so the ADMA + * descriptor fetch reads a stale table and fails (ST_FDS). SDMA uses no + * descriptor table - only streaming DMA whose cache maintenance is done via + * cbo.flush/inval (menvcfg enabled by OpenSBI >=1.x), which works. + */ + host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; + /* * extra adma table cnt for cross 128M boundary handling. */