-
Notifications
You must be signed in to change notification settings - Fork 6
Sg2042 v1.8 #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Sg2042 v1.8 #21
Changes from all commits
a27b4d7
c8fee0e
c898ab4
6d0209c
45a1e7d
f672580
a6a17aa
2a6f692
ce2f67d
c46b633
877f33e
5c58e01
d3d5445
3fd02ff
607ad58
fc7320b
6e30e52
117a94d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| * SPDX-License-Identifier: BSD-2-Clause | ||
| * | ||
| * Copyright (c) 2025 SOPHGO Corporation | ||
| * | ||
| * Authors: | ||
| * Chao Wei <chao.wei@sophgo.com> | ||
| */ | ||
|
|
||
| #ifndef __SG2042_GMT_H__ | ||
| #define __SG2042_GMT_H__ | ||
|
|
||
| int sg2042gmt_cold_timer_init(unsigned long mtimer_base, | ||
| unsigned long mtimecmp_base, | ||
| unsigned long mtimecmp_size, | ||
| unsigned long delcared_freq, | ||
| unsigned long actual_freq, | ||
| unsigned long timecmp_freq); | ||
| int sg2042gmt_warm_timer_init(void); | ||
|
|
||
| #endif /* __SG2042_GMT_H__ */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,8 @@ void spin_lock(spinlock_t *lock) | |
| #error "need A or Zaamo or Zalrsc" | ||
| #endif | ||
|
|
||
| "fence w, o\n" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (performance): Additional fence in spin_lock hot path may hurt performance without clear benefit The |
||
|
|
||
| /* Did we get the lock? */ | ||
| " srli %1, %0, %6\n" | ||
| " and %1, %1, %5\n" | ||
|
|
@@ -83,4 +85,5 @@ void spin_lock(spinlock_t *lock) | |
| void spin_unlock(spinlock_t *lock) | ||
| { | ||
| __smp_store_release(&lock->owner, lock->owner + 1); | ||
| RISCV_FENCE(w, o); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (typo): Typo in parameter name
delcared_freqin SG2042 GMT timer headerThe prototype uses
delcared_freqbut the implementation usesdeclared_freq. Please align the spelling here to avoid confusion when searching or reading the header.