Commit Graph

1229090 Commits

Author SHA1 Message Date
zhencheng.zhang 0246b57ea0 driver: spifmc: fix spif bug when bs of dd exceed 64k
- data read is divided into 64k due to IP restrictions that
  reg TRANS_NUM is 16bit

Signed-off-by: zhencheng.zhang <zhencheng.zhang@sophgo.com>
2024-10-30 22:38:18 +08:00
Xiaoguang Xing 64f488f806 riscv:mm: Use old __set_pte_at() because highmem is in use
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:52 +08:00
Han Gao acb043a536 riscv: xtheadvector: enable vector function
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2024-10-25 09:27:52 +08:00
zhaohui-yan 80618f9757 Fixed the problem of getting stuck when loading rtcbmc driver 2024-10-25 09:27:52 +08:00
zhaohui-yan 9ddd2e8351 MSIX interrupts are allocated starting from bit 14 of the top register. 2024-10-25 09:27:52 +08:00
CC becb95688c add pmbus debugging tool 2024-10-25 09:27:51 +08:00
Han Gao 50e4e1f71f fix: riscv: xtheadvector: fix setup_v_vsize
riscv: xtheadvector: fix setup_v_vsize

Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
Signed-off-by: Han Gao <rabenda.cn@gmail.com>
2024-10-25 09:27:51 +08:00
lin peng fbae4bce18 add null event check logic in riscv_pmu_sbi.c
Signed-off-by: lin peng <peng.lin@sophgo.com>
2024-10-25 09:27:51 +08:00
Han Gao 7cb1cba6b2 xtheadvector: fix it used as v-ext when hwprobe is used
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2024-10-25 09:27:51 +08:00
Han Gao 24e2c806ef fix: use has_vector instead of judge ELF_HWCAP
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2024-10-25 09:27:51 +08:00
Han Gao a94944c116 riscv: sophgo: mango: add xtheadvector for mango-cpus-socket0&1
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2024-10-25 09:27:50 +08:00
Han Gao 209be718c3 fix: use ulong insteadof xlen_t & UL instead of UXL
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
2024-10-25 09:27:50 +08:00
Heiko Stuebner 93b0b72d1a T-Head C9xx cores implement an older version (0.7.1) of the vector specification.
Relevant changes concerning the kernel are:
- different placement of the SR_VS bit for the vector unit status
- different encoding of the vsetvli instruction
- different instructions for loads and stores

And a fixed VLEN of 128.

The in-kernel access to vector instances is limited to the save and
restore of process states so the above mentioned areas can simply be
handled via the alternatives framework, similar to other T-Head specific
issues.

TODO:
FIXME: Do real vstate discard in __riscv_v_vstate_discard!

Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Co-developed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Guo Ren <guoren@kernel.org>
Tested-by: Chen Pei <cp0613@linux.alibaba.com>
Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
2024-10-25 09:27:50 +08:00
Palmer Dabbelt cac64108d2 Merge patch series "membarrier: riscv: Core serializing command"
RISC-V was lacking a membarrier implementation for the store/fetch
ordering, which is a bit tricky because of the deferred icache flushing
we use in RISC-V.

* b4-shazam-merge:
  membarrier: riscv: Provide core serializing command
  locking: Introduce prepare_sync_core_cmd()
  membarrier: Create Documentation/scheduler/membarrier.rst
  membarrier: riscv: Add full memory barrier in switch_mm()

Link: https://lore.kernel.org/r/20240131144936.29190-1-parri.andrea@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-10-25 09:27:50 +08:00
chunzhi.lin d184d699ff riscv:dts:add i2c4 node for multi chips
Signed-off-by: chunzhi.lin <chunzhi.lin@sophgo.com>
2024-10-25 09:27:49 +08:00
Felix Yan f7a90c2091 pcie: whitelist and support mellanox connectx-2
Basic functionalities have been tested to work fine on pioneer board.
2024-10-25 09:27:49 +08:00
chunzhi.lin 0cc95f672a riscv:dts:capricorn:add i2c-rtc device
Signed-off-by: chunzhi.lin <chunzhi.lin@sophgo.com>
2024-10-25 09:27:49 +08:00
chunzhi.lin 104465ccbb dts:sophgo:x4evb:Apply top interrupt instead of msi on x16 slot
Signed-off-by: chunzhi.lin <chunzhi.lin@sophgo.com>
2024-10-25 09:27:49 +08:00
Jingyu Li 45f3421958 drivers: rtc: disable BMC RTC device
Signed-off-by: Jingyu Li <jingyu.li01@sophgo.com>
2024-10-25 09:27:48 +08:00
chunzhi.lin 24e4f7d7f4 dts:sophgo:add i2c-rtc ds1307 device node for single chip
Signed-off-by: chunzhi.lin <chunzhi.lin@sophgo.com>
2024-10-25 09:27:48 +08:00
chunzhi.lin 160db13849 riscv:dts:modify dw gpio clock name
Modified the gpio clock-names in GPIO nodes so mango dts could
adapt to Designware gpio controller driver, then gpio bus clock
and gpio debounce clock would be enabled.
I also force enable the gpio interrupt clock in sophgo clock
system so that the gpio interrupt trigger could take effect.

Signed-off-by: chunzhi.lin <chunzhi.lin@sophgo.com>
2024-10-25 09:27:48 +08:00
Xiaoguang Xing 07f62cd9fb riscv: defconfig: Add openeuler defconfig
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:48 +08:00
fengchun.li 2db5cf9a78 drivers:pci:remove the err log of parsing pci
dirvers:pci:remove the err log of parsing pci

Signed-off-by: fengchun.li <fengchun.li@sophgo.com>
2024-10-25 09:27:48 +08:00
Xiaoguang Xing 3b67aba3fb riscv: configs: Add sophgo sg2042 soc defconfig
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:47 +08:00
Xiaoguang Xing c782e92806 driver: ipmi: support KVM and IPMI SI for BMC
- support KVM

- support IPMI System Interface (KCS)

- exchange messages and data between the AST2600 BMC and the Host SG2042
over PCIe link using BAR1. Have to set the KCS channel offset is
0x0e80 according to the AST2600 User Guide.

- drivers/rtc: Add rtc-astbmc module.

- drivers/char/ipmi: Initialize ipmi_si module using hardcode method.

- rtc-astbmc module is initialized before ipmi_si module.

Signed-off-by: jingyu.li01 <jingyu.li01@sophgo.com>
Signed-off-by: zhaohui-yan <zhaohui.yan@sophgo.com>
2024-10-25 09:27:47 +08:00
Khem Raj 9065e5aaaf perf cpumap: Make counter as unsigned ints
These are loop counters which is inherently unsigned. Therefore make
them unsigned. Moreover it also fixes alloc-size-larger-than
error with gcc-13, where malloc can be called with (-1) due to tmp_len
being an int type.

Fixes
| cpumap.c:366:20: error: argument 1 range [18446744065119617024, 18446744073709551612] exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
|   366 |         tmp_cpus = malloc(tmp_len * sizeof(struct perf_cpu));
|       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>

Upstream-Status: Submitted [https://lore.kernel.org/linux-perf-users/20230123211310.127532-1-raj.khem@gmail.com/T/#u]
2024-10-25 09:27:47 +08:00
Chao Wei b21bf92db5 driver: radeon: deinit device during kexec
kexec to another kernel without deinit device will cause power
management part init failed in new kernel.
when reading from system file 'freq1_input', an oops occur.

Signed-off-by: Chao Wei <chao.wei@sophgo.com>
2024-10-25 09:27:47 +08:00
Xiaoguang Xing 41072ca64f kernel: schedule: Fix set_task_cpu() bug
The bug is triggered when run WARN_ON_ONCE(is_migration_disabled(p)).

[ 3298.725394] WARNING: CPU: 73 PID: 0 at kernel/sched/core.c:3147 set_task_cpu+0x18a/0x18e
[ 3298.733591] Modules linked in: nf_conntrack_netlink xt_addrtype xt_statistic xt_nat xt_MASQUERADE nft_chain_nat nf_nat xt_mark xt_conntrack xt_comment nft_compat tls nf_tables nfnetlink overlay rfkill qrtr sunrpc ofpart ipmi_si vfat sophgo_spifmc ipmi_devintf spi_nor fat ipmi_msghandler mtd uio_pdrv_genirq uio loop zram ast drm_vram_helper drm_ttm_helper spi_dw_mmio ixgbe spi_dw gpio_dwapb r8169 ttm mdio scsi_dh_rdac scsi_dh_emc scsi_dh_alua ip6_tables ip_tables dm_multipath ip_vs_sh ip_vs_wrr ip_vs_rr ip_vs nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter bridge stp llc
[ 3298.785070] CPU: 73 PID: 0 Comm: swapper/73 Not tainted 6.1.31 #1
[ 3298.791220] Hardware name: Sophgo Mango (DT)
[ 3298.795504] epc : set_task_cpu+0x18a/0x18e
[ 3298.799649]  ra : load_balance+0x51c/0xb5c
[ 3298.803766] epc : ffffffff8004cef6 ra : ffffffff8005dae0 sp : ffffffc80a60bab0
[ 3298.810995]  gp : ffffffff81e75e48 tp : ffffffe7feaf1f40 t0 : ffffffc80a60bad0
[ 3298.818216]  t1 : 0000000002e2c8d6 t2 : 0000000008016002 s0 : ffffffc80a60baf0
[ 3298.825436]  s1 : fffffff00038ddc0 a0 : fffffff00038ddc0 a1 : 000000000000002d
[ 3298.832659]  a2 : fffffffffe45afe4 a3 : 0000000000000000 a4 : ffffffff81e9c098
[ 3298.839878]  a5 : 0000000000000001 a6 : 0000000000000001 a7 : ffffffffffffffff
[ 3298.847099]  s2 : fffffff00038dea8 s3 : 000000000000002d s4 : 000000000000002d
[ 3298.854320]  s5 : fffffff65f4fe800 s6 : ffffffff81efb588 s7 : 0000000000000001
[ 3298.861539]  s8 : 0000000000000002 s9 : ffffffff81e75d78 s10: ffffffc80a60bbc0
[ 3298.868757]  s11: fffffff65f4fe800 t3 : 0000000002845dfc t4 : 00000000000065f9
[ 3298.875983]  t5 : 0000000000013dc2 t6 : 000000000000032e
[ 3298.881294] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
[ 3298.889211] [<ffffffff8004cef6>] set_task_cpu+0x18a/0x18e
[ 3298.894621] [<ffffffff8005dae0>] load_balance+0x51c/0xb5c
[ 3298.900026] [<ffffffff8005eb52>] rebalance_domains+0x1f0/0x382
[ 3298.905862] [<ffffffff8005f094>] run_rebalance_domains+0x6a/0x8a
[ 3298.911869] [<ffffffff80c6d04c>] __do_softirq+0x18c/0x336
[ 3298.917280] [<ffffffff80020990>] __irq_exit_rcu+0x116/0x148
[ 3298.922866] [<ffffffff80020b22>] irq_exit+0x18/0x28
[ 3298.927745] [<ffffffff80c62c96>] generic_handle_arch_irq+0x64/0x74
[ 3298.933929] [<ffffffff80003dbc>] ret_from_exception+0x0/0x16
[ 3298.939595] [<ffffffff80c62f52>] ct_idle_enter+0x12/0x1a
[ 3298.944912] ---[ end trace 0000000000000000 ]---

Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:46 +08:00
Xiaoguang Xing fc263f7aca mm: Modify __find_max_addr for memory hole
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:46 +08:00
xiaoguang.xing 8813a332a7 riscv: kernel: Optimize apply_relocate_add() 2024-10-25 09:27:46 +08:00
xiaoguang.xing 806ad01511 riscv: mm: Clear compilation warning about last_cpupid
"warning Unfortunate NUMA and NUMA Balancing config,
growing page-frame for last_cpupid"
because MAX_PHYSMEM_BITS is too large,
when LAST_CPUPID_NOT_IN_PAGE_FLAGS is defined.
2024-10-25 09:27:46 +08:00
haijiao.liu 05c0fe8d2e kernel: tick: filter unnecessary printing
set the print level of the switch_to oneshot function to DEBUG

Signed-off-by: haijiao.liu <haijiao.liu@sophgo.com>
2024-10-25 09:27:45 +08:00
haijiao.liu e9b5f69e44 kernel: Adjust the log level of the tick_switch_to_oneshot function
Signed-off-by: haijiao.liu <haijiao.liu@sophgo.com>
2024-10-25 09:27:45 +08:00
Xiaoguang Xing 6676544647 driver: clk: Modify the timer clock is turned off defaultly
Signed-off-by: haijiao.liu <haijiao.liu@sophgo.com>
2024-10-25 09:27:45 +08:00
Xiaoguang Xing 428d8d035b drivers: clock: Add sophgo sg2042 multi-chip clock synchronous support
To solve the problem of asynchronous multi-chip clocks,
the local timer has been replaced with an APB timer.

Signed-off-by: haijiao.liu <haijiao.liu@sophgo.com>
2024-10-25 09:27:45 +08:00
Xiaoguang Xing 31da85fc08 riscv: mm: Add high memory on riscv64 using sv39
High memory function is developed because T-HEAD C920
supports max 39-bit virtual address spaces(sv39).
High memory function can remove when other RISCV64 SoC
supports sv48 or higher.
2024-10-25 09:27:45 +08:00
xiaoguang.xing 339f337a40 riscv: kexec: Add image loader for kexec file 2024-10-25 09:27:44 +08:00
Xiaoguang Xing 3f79a1911e drm/amd/display: Support DRM_AMD_DC_FP on RISC-V
RISC-V uses kernel_fpu_begin()/kernel_fpu_end() like several other
architectures. Enabling hardware FP requires overriding the ISA string
for the relevant compilation units.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2024-10-25 09:27:44 +08:00
Xiaoguang Xing 8a4cf68465 riscv: Factor out riscv-march-y to a separate Makefile
Since it is not possible to incrementally add/remove extensions from the
compiler's ISA string by appending arguments, any code that wants to
modify the ISA string must recreate the whole thing. To support this,
factor out the logic for generating the -march argument so it can be
reused where needed.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2024-10-25 09:27:44 +08:00
Xiaoguang Xing 9881800088 riscv: Add support for kernel-mode FPU
This is needed to support recent hardware in the amdgpu DRM driver. The
FPU code in that driver is not performance-critical, so only provide the
minimal support.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2024-10-25 09:27:44 +08:00
Xiaoguang Xing 3da85c5163 mango pci hack:broadcast when no MSI source known
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:44 +08:00
Icenowy Zheng 55b0da7c3e nvidia hda: force msi
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2024-10-25 09:27:43 +08:00
Icenowy Zheng f2833e5b15 radeon hack: force 64-bit msi to fit top intc
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2024-10-25 09:27:43 +08:00
Icenowy Zheng 0ff5d8600b amdgpu: disable rebar
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2024-10-25 09:27:43 +08:00
Icenowy Zheng 20abf7c7d0 ttm: disallow cached mapping
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2024-10-25 09:27:43 +08:00
Xiaoguang Xing 21ba17a498 driver: soc: Add sophgo sg2042 soc support
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:42 +08:00
Xiaoguang Xing 1d9b9a4b8f drivers: pcie: sophgo: Create msi-x whitelist,turn on msi-x for top intr
Turn on msi-x for top intr. Create msi-x whitelist,
Limited the number of msi-x interrupts for inter x520 and wangxun NIC.

Signed-off-by: chengjun.li <chengjun.li@sophgo.com>
2024-10-25 09:27:42 +08:00
Xiaoguang Xing 3b2390309f driver: pcie: Add sophgo sg2042 soc support
Signed-off-by: fengchun.li <fengchun.li@sophgo.com>
2024-10-25 09:27:42 +08:00
Xiaoguang Xing 5a2311df3c driver: net: Add sophgo sg2042 soc support
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-10-25 09:27:42 +08:00
Xiaoguang Xing b8d0ad06ff driver: mtd: Add sophgo sg2042 soc support
Sophgo SPI Flash Master Controller (SPIFMC) is a master controller to
control serial SPI Flash. Enable CONFIG_SPI_SOPHGO_SPIFMC if you have a
device with a SPIFMC controller and want to access the Flash as a mtd
device.

There is GD25LB512ME Serial Flash on SG2042 EVB, controlled by
SPIFMC.

Signed-off-by: jingyu.li01 <jingyu.li01@sophgo.com>
2024-10-25 09:27:41 +08:00