Commit Graph

1231493 Commits

Author SHA1 Message Date
4db7a3b799 dts: spacemit: add x1_orangepi-r2s.dts 2025-12-15 01:26:16 +08:00
5ee5debc3a dts: disable sound_codec for lpi3a to avoid panic 2025-11-21 15:14:42 +08:00
c8cba7c81b dts: spacemit: rename x1_orangepi-rv2.dts 2025-11-21 15:14:42 +08:00
James Deng
60e6765ae2 Merge remote-tracking branch 'internal/k1-release' into k1-bl-v2.2.y 2025-08-20 22:50:17 +08:00
zhangmeng
d5b2ef2c6a Merge remote-tracking branch 'origin/k1-dev' into k1-release
Change-Id: Iaf7b67f05faebea330a4b9f4593b1108b4f3e20f
2025-08-13 14:31:16 +08:00
zhangmeng
5bbd423d73 riscv: add ime extension in /proc/cpuinfo for userspace program
Change-Id: Ibfad53dce5b813eeca59801e60825d168aa23a2e
2025-08-13 14:25:07 +08:00
liweizhi
662a0c32be scripts: update build_kernel.sh to support build in docker
Usage: Run on the top of linux directory
	./scripts/build_kernel.sh [-c] [-d] [-x]

Change-Id: If33a505cae9cdbc8560aeaee62cad5a0524a0d54
2025-08-12 10:52:43 +08:00
yanhaodong
4e9d7cbeda k1: input: remove PEN event for libinput
Change-Id: I8984943d9ba2ebd5b45e5b81e09a603b548c4e6b
Signed-off-by: yanhaodong <haodong.yan@spacemit.com>
2025-08-11 13:52:15 +08:00
wanlong
180f0ef2c7 wireless: rtl8852bs: fix missing mutex_unlock in mac_ax
Change-Id: I4fe38a703141adcf67371f5164e8af073fcf5947
2025-08-06 15:35:52 +08:00
weijinmei
fedb75697d k1:audio: add playback_only support
avoid NULL pointer issue on some playback_only board

Change-Id: I90b75fa27087f3d9f3dfbf490c4008364ca84353
2025-08-01 09:40:10 +08:00
weijinmei
e8c154f25e k1:dts: add sound card playback_only config
Change-Id: I7806953a1fe879793b37a4a9cc4b4057f66e5825
2025-07-31 20:34:22 +08:00
James Deng
08e05c1286 Merge remote-tracking branch 'internal/k1-release' into k1-bl-v2.2.y 2025-07-28 10:30:49 +08:00
Nell
91e3d9a44b k1:p1:delete the shutdown-charging releated code
the charging logic in uboot don't use the shutdown-charging bit,
so we delete the code in kernle

Change-Id: Ie6be0968f929f528c2752eef0843ef25a6dca2b8
Signed-off-by: Nell <xianbin.zhu@spacemit.com>
2025-07-25 10:56:25 +08:00
liyeshan
959078162c k1_defconfig: Enable AMDGPU
Signed-off-by: liyeshan <yeshan.li@spacemit.com>
Change-Id: Ic893d7f650496b46e60c32e8d5c2ff0854cd6aac
2025-07-24 14:18:15 +08:00
liyeshan
3721fc6489 amdgpu,radeon: Add workarounds for the Spacemit K1-X RISC-V platform
1. In various GMC versions (v6-v11), the DMA address mask is
  reduced to 34 bits. This is necessary because PCIe devices on the
  Spacemit K1-X platform support a maximum of 34-bit physical addressing.
2. In amdgpu_ttm.c, force the use of the `ttm_write_combined` cache mode.
 This is required because the K1-X platform lacks PCIe cache coherency.
3. In radeon_ttm.c and amdgpu_vram_mgr.c, switch the caching for
IO memory to `ttm_uncached`.This is done to guarantee data correctness
 during VRAM access on this platform.

Signed-off-by: liyeshan <yeshan.li@spacemit.com>
Change-Id: I294b741d1cc7923bfe535299c304f9f443673d92
2025-07-24 14:17:52 +08:00
liyeshan
786e008e00 pcie: Adapt PCIe address space for AMD GPU on K1-X
1. In the Device Tree, merge the PCIe I/O and memory address
windows.The AMD GPU requires a large, contiguous BAR space,
which the previous separate windows could not satisfy.
2. Add a hack to correct the BAR space size calculation. The K1-X platform
reserves a total of 384MB (0x18000000) for PCIe devices (including BAR
and config space). However, the Linux kernel's allocation logic,
influenced by 128MB alignment, attempts to request a full 384MB BAR space
for the GPU.This commit reduces the requested size to 0x16000000,
ensuring the allocation succeeds, as the GPU itself only requires 258MB.

Signed-off-by: liyeshan <yeshan.li@spacemit.com>
Change-Id: Ic5610b455aac5b0dc97ac4904037865f83ad1c2c
2025-07-24 11:04:44 +08:00
zhangmeng
db0d3fc566 k1: support user-space load and store misaligned on io memory area
The PCIe BAR area must be mapped as IO attribute for GPU VRAM area,
but, there may be some misaligned access in user-space program. Then,
it will trigger 5# exception when misaligned load and 7# excepiton
when misaligned store. And user-space program will crash because of
the 5# exception and 7# exception can't be fixed.
So, we try to process the user-space io area misligned access firstly
when the 5# exception and 7# exception are caught

Change-Id: Iac78bcdb8505dd113dcc4deed782e78016ddbf9b
2025-07-23 09:25:05 +08:00
zhangmeng
27f0d82a2f Merge remote-tracking branch 'origin/k1-dev' into k1-release
Change-Id: Id57b1298ae73d10fdc3344e88fe14adf00765a5f
2025-07-17 16:07:52 +08:00
weijinmei
14d1b98300 i2s: adjust the sysclk divider parameters
The old parameters may cause jitter in sysclk.

Change-Id: Ia64dda7e35ae56090a7d27ad8ab972d3f8ba8280
Signed-off-by: weijinmei <jinmei.wei@spacemit.com>
2025-07-17 16:02:46 +08:00
wanlong
71908afd85 mmc: sdhci-of-k1x: fix the bug of schedule on spacemit_sdhci_request()
INFO: task kworker/3:1:81 blocked for more than 120 seconds.
      Not tainted 6.6.63 #20250714113129
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/3:1     state:D stack:0     pid:81    ppid:2      flags:0x00000000
Workqueue: events_freezable mmc_rescan
Call Trace:
[<ffffffff8101004e>] __schedule+0x32c/0xa86
[<ffffffff810107f6>] schedule+0x4e/0xd8
[<ffffffff80be23d6>] spacemit_sdhci_request+0xbc/0xfc
[<ffffffff80bc6c16>] __mmc_start_request+0x56/0x16e
[<ffffffff80bc6da6>] mmc_start_request+0x78/0x92
[<ffffffff80bc6eea>] mmc_wait_for_req+0x60/0xd0
[<ffffffff80bc6fb8>] mmc_wait_for_cmd+0x5e/0x88
[<ffffffff80bd2cd8>] mmc_io_rw_direct+0x7c/0x104
[<ffffffff80bd4288>] sdio_readb+0x2c/0x62
[<ffffffff02472052>] rtw_sdio_raw_read+0x19e/0x2c2 [8852bs]
[<ffffffff0250ef1a>] sdio_io+0xe4/0x2e4 [8852bs]
[<ffffffff0250f148>] rtw_sdio_read_cmd52+0x14/0x1c [8852bs]
[<ffffffff02596690>] hal_mac_sdio_cmd52_r8+0x2e/0x84 [8852bs]
[<ffffffff02644980>] w_indir_cmd53_sdio_8852b+0xc6/0x136 [8852bs]
[<ffffffff026391ce>] w8_indir_sdio+0x48/0x6c [8852bs]
[<ffffffff02639578>] reg_write8_sdio+0x54/0x72 [8852bs]
[<ffffffff0261e764>] mac_pwr_switch+0x358/0x418 [8852bs]
[<ffffffff02616f9a>] mac_hal_fast_init+0x4a/0x3a6 [8852bs]
[<ffffffff0259a870>] rtw_hal_mac_hal_fast_init+0xe4/0x2b8 [8852bs]
[<ffffffff0265b448>] hal_fast_start_8852b+0x10/0x18 [8852bs]
[<ffffffff0265ccbe>] hal_fast_start_8852bs+0x4e/0xae [8852bs]
[<ffffffff025b372e>] rtw_hal_preload+0x3c/0xca [8852bs]
[<ffffffff0251f06e>] rtw_phl_preload+0x20/0x3e [8852bs]
[<ffffffff02504388>] rtw_hw_init+0x128/0x294 [8852bs]
[<ffffffff02471bce>] rtw_dev_probe+0xd8/0x3be [8852bs]
[<ffffffff80bd3746>] sdio_bus_probe+0xf4/0x110
[<ffffffff8085d10c>] really_probe+0x8c/0x326
[<ffffffff8085d408>] __driver_probe_device+0x62/0x110
[<ffffffff8085d4ec>] driver_probe_device+0x36/0xba
[<ffffffff8085d5e2>] __device_attach_driver+0x72/0xd0
[<ffffffff8085b35e>] bus_for_each_drv+0x5c/0xb2
[<ffffffff8085d9aa>] __device_attach+0x84/0x158
[<ffffffff8085dc22>] device_initial_probe+0xe/0x16
[<ffffffff8085c156>] bus_probe_device+0x86/0x88
[<ffffffff80859a44>] device_add+0x534/0x6ec
[<ffffffff80bd38c2>] sdio_add_func+0x60/0x7a
[<ffffffff80bd29a2>] mmc_attach_sdio+0x178/0x34a
[<ffffffff80bc85c6>] mmc_rescan+0x274/0x334
[<ffffffff80037556>] process_one_work+0x116/0x314
[<ffffffff80037a12>] worker_thread+0x2be/0x3ac
[<ffffffff8003ea76>] kthread+0xda/0xf6
[<ffffffff81017266>] ret_from_fork+0xe/0x18

Change-Id: Id8fa5f7322455e1feeafafd083c615cbdcd49731
2025-07-17 14:57:25 +08:00
xuhaodong
14053d2d46 k1: ZT_RVOH007: enbale camera sensor
Change-Id: I1f4d44633ca5df18c31d5d7fb4cc4d0708e7c7f3
2025-07-17 14:43:49 +08:00
xuhaodong
746ca83504 camera: sensor: fix multiple sensors cannot get power simultaneously
Change-Id: I63888dae42983961609e0102d7fc240ba2176269
2025-07-17 14:43:35 +08:00
huzhen
fdee3b35a0 PCI: k1x: Add hold_phy_rst before phy enable
During the probe and resume processes, phy_enable will clear the app_hold_phy_rst bit.
app_hold_phy_rst must be set before this bit is cleared.

Change-Id: Ia9332c041199095dbfb9c0059b4704db743f189a
2025-07-17 14:42:51 +08:00
Junzhong Pan
120edd4c60 pinctrl: k1x: set strict for pinmux_ops
This will not allow simultaneous use of the same pin for GPIO and
another function. If user use a pin in such way, an error would be
reported, make it easier to debug.

d401e000.pinctrl: pin PIN80 already requested by k1x-gpio:79; cannot claim for xxx

Signed-off-by: Junzhong Pan <junzhong.pan@spacemit.com>
Change-Id: I0aad1e6a55ac46c47537d18bdb8586779f290435
2025-07-17 14:41:58 +08:00
wanlong
e3914cc9e6 usb: typec: husb239: add delay work for pd contract update
Change-Id: I2287a56cd8a31451c8f207bf5fdae3932b17b5b8
2025-07-11 15:14:17 +08:00
huanghaiqiang
89b76ac21d add RV4B solution
Change-Id: I011de8ba866873b0343fa71af0c2f641f56f111a
2025-07-11 15:13:00 +08:00
wanlong
2ace592a74 wireless: rtl8852bs: fix the warning about rg_interface lock not initialized
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?
turning off the locking correctness validator.
CPU: 1 PID: 2165 Comm: wpa_supplicant Not tainted 6.6.36+ #82
Hardware name: spacemit k1-x FusionOne board (DT)
Call Trace:
[<ffffffff8000693c>] dump_backtrace+0x1c/0x24
[<ffffffff80fae9f2>] show_stack+0x2c/0x38
[<ffffffff80fc4a36>] dump_stack_lvl+0x3c/0x54
[<ffffffff80fc4a62>] dump_stack+0x14/0x1c
[<ffffffff8007e6da>] register_lock_class+0x42e/0x47e
[<ffffffff8007d326>] __lock_acquire.isra.0+0x48/0x694
[<ffffffff8007da5e>] lock_acquire+0xec/0x1c2
[<ffffffff80fd02f8>] _raw_spin_lock_bh+0x38/0x76
[<ffffffff029305c4>] rtw_phl_query_regulation_info+0x26/0x56 [8852bs]
[<ffffffff029b0c76>] rtw_hal_query_regulation+0x10/0x18 [8852bs]
[<ffffffff02a301c6>] _send_bt_country_code+0xc2/0x108 [8852bs]
[<ffffffff02a3152e>] _update_bt_scbd+0xbc/0x404 [8852bs]
[<ffffffff02a331a8>] _ntfy_wl_rfk+0x10a/0x264 [8852bs]
[<ffffffff02994ae6>] rtw_hal_btc_wl_rfk_ntfy+0x24/0x32 [8852bs]
[<ffffffff02aba2b6>] halrf_btc_rfk_ntfy+0xf8/0x15e [8852bs]
[<ffffffff02ab6bde>] halrf_dack_trigger+0x2c/0x18c [8852bs]
[<ffffffff02acb3a0>] halrf_dm_init+0x90/0x156 [8852bs]
[<ffffffff02992b9a>] rtw_hal_rf_dm_init+0x14/0x1c [8852bs]
[<ffffffff02a47632>] hal_start_8852b+0x17c/0x2d0 [8852bs]
[<ffffffff02a48fa8>] hal_start_8852bs+0x4c/0x6e [8852bs]
[<ffffffff029995c0>] rtw_hal_start+0x24/0x210 [8852bs]
[<ffffffff028fd660>] rtw_phl_start+0xc0/0x128 [8852bs]
[<ffffffff028e2754>] rtw_hw_start+0x28/0x50 [8852bs]
[<ffffffff0282e176>] netdev_open+0xce/0x33c [8852bs]
[<ffffffff80cb6674>] __dev_open+0xcc/0x174
[<ffffffff80cb6a90>] __dev_change_flags+0x15c/0x1cc
[<ffffffff80cb6b1e>] dev_change_flags+0x1e/0x56
[<ffffffff80d8fdd4>] devinet_ioctl+0x1ec/0x5fc
[<ffffffff80d91812>] inet_ioctl+0x11c/0x152
[<ffffffff80c8a18c>] sock_do_ioctl+0x32/0xb4
[<ffffffff80c8afd0>] sock_ioctl+0xf2/0x2e8
[<ffffffff8026a6d8>] __riscv_sys_ioctl+0x86/0xae
[<ffffffff80fc54e0>] do_trap_ecall_u+0xba/0x12e
[<ffffffff80fd13f6>] ret_from_exception+0x0/0x6e

Change-Id: I8315279ed046109a171b73376c60bb622c0f4ca3
2025-07-11 13:54:20 +08:00
James Deng
6822bafeae Merge remote-tracking branch 'origin/k1-dev' into k1-release
Change-Id: I07561e8e8d46bc49285f49c14044697febdfaf33
2025-07-04 09:58:09 +08:00
liweizhi
67132bd6ae scripts/package/mkdebian
linux-image-6.6.63 depends on bianbu-esos (= 0.0.10)

Change-Id: I795f474e1c23de13c1a77320c588e58dc20b9cc8
2025-07-04 00:47:04 +08:00
zhangmeng
8dc9f24551 Merge remote-tracking branch 'origin/k1-dev' into k1-release
Change-Id: I9cb47755d031341ba9d219190baa15e25bf80fd9
2025-07-03 20:28:36 +08:00
Nell
503f4cb8b8 k1: update rootfs.cpio.gz
update the esos.elf to support DDR size 512M
sync with commit-id(master):f711f0809ac4657e9c12797c10e822a8416f07c2

Change-Id: Ic8f704017cfb0e051b7ccc7e608029e9e679e3ac
Signed-off-by: Nell <xianbin.zhu@spacemit.com>
2025-07-03 19:50:22 +08:00
goumin
294f479f26 Add nand boot support.
Change-Id: I8ed2a85dee3bfb50830f4550f29397aadb95ee5f
2025-07-03 16:08:05 +08:00
Nell
7b7932f6dd k1: set the load entry of kernel image to 0x600000
Change-Id: I078f1e5865373cc5cef6ccc7028960106499bbb8
Signed-off-by: Nell <xianbin.zhu@spacemit.com>
2025-07-03 15:17:05 +08:00
Nell
58fddb55e4 k1:dtsi:remoteproc: change the RCPU running address to 1M
Change-Id: Ib87953dc6ec2c17a7ffab37bc9d3e3f12091d43e
Signed-off-by: Nell <xianbin.zhu@spacemit.com>
2025-07-03 15:16:54 +08:00
Nell
0dc7617ee2 k1:remoteproc: modify the code to support moving the runtime-env of rcpu
to lower DDR address space

Change-Id: I8a0ff4f29e9695bdf9b90a3385984ab0fcd65ba8
Signed-off-by: Nell <xianbin.zhu@spacemit.com>
2025-07-03 15:16:37 +08:00
Nell
dd4630946d k1:remoteproc: modify the core code to support VIRTIO_F_ACCESS_PLATFORM
feature

when enable this feature, the AP & rcpu will using dma_addr to share
memroy

Change-Id: I0c2427abf3c455fcbdc78a51788287f8198eae55
Signed-off-by: Nell <xianbin.zhu@spacemit.com>
2025-07-03 15:16:27 +08:00
Junzhong Pan
b14d273869 dtsi: k1-x: use RESET_COMBO_PHY for combphy
Change-Id: Ifd12910bbff95c7df4ce8824b9ec59bde9e45497
Signed-off-by: Junzhong Pan <junzhong.pan@spacemit.com>
2025-07-03 10:29:16 +08:00
Junzhong Pan
defacd6ae1 reset: spacemit-k1x: add RESET_COMBO_PHY reset signal
USB3 and PCIE0 of k1x shares a combo phy. BIT(8) of APMU register
APMU_PCIE_CLK_RES_CTRL_0 is designed for USB3 to reset the combo phy
without resetting the PCIE0.

Change-Id: I1935d228b1c4c8d81fd280a8dc245806539d7104
Signed-off-by: Junzhong Pan <junzhong.pan@spacemit.com>
2025-07-03 10:28:53 +08:00
zhenglilang
8be331c040 k1:display: enable lcd hxdm101 for ZT_RVOH007
Change-Id: I7e1923c38e93062f7684c33688cebd42f5b9bc0e
2025-07-03 10:26:55 +08:00
yanhaodong
ad75b543a7 ZT_RVOH007:k1/dts: add k1-x_ZT_RVOH007.dts
Change-Id: If022c3a99761442dfc947962631e658df9c22c2e
Signed-off-by: yanhaodong <haodong.yan@spacemit.com>
2025-07-03 10:25:45 +08:00
zhenglilang
4f44e051e2 k1:display: ignore HPD IRQ if HDMI suspended
Change-Id: I1b73861871b1b641378c942c2a385a35151b68cc
2025-07-02 19:55:04 +08:00
zengyu
82d6e838de k1: ethercat: fix incorrect error path in emac_probe
Change-Id: I33da6d78004f62e8607050fe19d5f6c461afc84a
2025-07-01 10:27:38 +08:00
zengyu
125f711256 k1: ethercat: native driver optimization
Reused SKBs in the RX path to avoid frequent allocation and free.
In a 24-hour test running the same demo, max execution time jitter was
reduced by 18.1%, lowering the risk of synchronization failure.

Change-Id: I23bc1c0c56677dd233548cc183e8e5f1497ddefa
2025-07-01 10:27:13 +08:00
zhenglilang
aa9769f6b2 k1:display: add lcd hxdm101
Change-Id: I94ca7b9d75bb6ddeadead4a028c1f1e3286563ac
2025-07-01 10:25:57 +08:00
wanlong
bf34673bce wireless: rtl8852bs: fix oops in rtw_phl_cmd_scan_request() during
suspend

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000169
Oops [#1]
Modules linked in: algif_hash
 algif_skcipher af_alg 8852bs binfmt_misc sch_fq_codel ip_tables autofs4
CPU: 5 PID: 1001 Comm: fsm_thread Tainted: G        W          6.6.63 #20250623142956
Hardware name: spacemit k1-x deb1 board (DT)
epc : rtw_phl_cmd_scan_request+0x24/0x98c [8852bs]
 ra : rtw_sitesurvey_cmd+0x3e8/0x67a [8852bs]
epc : ffffffff0237dc42 ra : ffffffff022fa748 sp : ffffffc80939ba00
 gp : ffffffff820fac50 tp : ffffffd905ff8c80 t0 : ffffffc80939baa8
 t1 : 0000000000000001 t2 : 4f525245203a5754 s0 : ffffffc80939bae0
 s1 : ffffffc80926e18c a0 : ffffffc80063d000 a1 : ffffffd904328000
 a2 : 0000000000000010 a3 : 0000000000006312 a4 : 0000000000000000
 a5 : 0000000000000000 a6 : 0000000000000000 a7 : ffffffff8213c7b8
 s2 : ffffffc80926d048 s3 : ffffffd904328000 s4 : ffffffff026b8c08
 s5 : ffffffd907830000 s6 : 0000000000000000 s7 : 0000000000000070
 s8 : 0000000000000001 s9 : ffffffff026b7fd8 s10: ffffffd907837a78
 s11: ffffffd92c6dfe00 t3 : ffffffff82112ba7 t4 : ffffffff82112ba7
 t5 : ffffffff82112ba8 t6 : ffffffd9078300aa
status: 0000000200000120 badaddr: 0000000000000169 cause: 000000000000000d
[<ffffffff0237dc42>] rtw_phl_cmd_scan_request+0x24/0x98c [8852bs]
[<ffffffff022fa748>] rtw_sitesurvey_cmd+0x3e8/0x67a [8852bs]
[<ffffffff0227ba34>] rrm_sitesurvey.constprop.0.isra.0+0xd2/0x19e [8852bs]
[<ffffffff0227f760>] rrm_do_meas_st_hdl+0x10a/0x30c [8852bs]
[<ffffffff0227875c>] fsm_state_run.isra.0+0x66/0x128 [8852bs]
[<ffffffff022794ee>] fsm_state_goto+0x50/0x13c [8852bs]
[<ffffffff0227f482>] rrm_idle_st_hdl+0x2e2/0x356 [8852bs]
[<ffffffff0227875c>] fsm_state_run.isra.0+0x66/0x128 [8852bs]
[<ffffffff02278b9c>] fsm_thread_share+0x37e/0x478 [8852bs]
[<ffffffff8003ea76>] kthread+0xda/0xf6
[<ffffffff80fde1ce>] ret_from_fork+0xe/0x18
Code: f556 1180 b703 1c05 ba17 0033 0a13 fd2a 2783 000a (4703) 1697

Change-Id: I0ae3eca28216f31824767ff4ba6eacc637be1537
Signed-off-by: wanlong <long.wan@spacemit.com>
2025-07-01 10:21:44 +08:00
goumin
9cc34aec3f Led:Change led mode to heartbeat for k1-x_MUSE-Pi-Pro.
Change-Id: I10d3ba181ba41693a192690e0fa5889b099d9eb9
2025-07-01 10:20:44 +08:00
James Deng
cecd843d17 Merge remote-tracking branch 'internal/k1-bl-v2.2.y' into k1-bl-v2.2.y 2025-06-26 17:57:39 +08:00
zhangmeng
9513d7530f Merge remote-tracking branch 'origin/k1-dev' into k1-release
Change-Id: I301c7be11bb87d07b57ff2d43dbef0c2e79f4417
2025-06-25 17:01:05 +08:00
yanhaodong
fc2b447e45 k1: uart: fix DCTS state read turn
The func updates DCTS state in do-while.The last value of status
must be 0 so the func will return.We fix it.

Change-Id: Ie799c277cb46b6f8c6dda96c19181ed9ea66b617
Signed-off-by: yanhaodong <haodong.yan@spacemit.com>
2025-06-25 15:50:23 +08:00
lijuan
f15a423cda rt-patch: update rt patch for patch apply err
Change-Id: Ifc579d85350d10f13a5ee4386526156b364c5707
Signed-off-by: lijuan <juan.li@spacemit.com>
2025-06-19 16:04:44 +08:00