mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-22 16:07:49 +08:00
Update On Sat Nov 15 19:34:53 CET 2025
This commit is contained in:
@@ -1182,3 +1182,4 @@ Update On Tue Nov 11 19:39:14 CET 2025
|
||||
Update On Wed Nov 12 19:37:25 CET 2025
|
||||
Update On Thu Nov 13 19:41:20 CET 2025
|
||||
Update On Fri Nov 14 19:38:12 CET 2025
|
||||
Update On Sat Nov 15 19:34:45 CET 2025
|
||||
|
||||
@@ -90,6 +90,8 @@ func (m *Mieru) Listen(tunnel C.Tunnel) error {
|
||||
if err != nil {
|
||||
if !m.server.IsRunning() {
|
||||
break
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
go mieru.Handle(c, tunnel, req, additions...)
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||
|
||||
## [2.46.1](https://github.com/filebrowser/filebrowser/compare/v2.46.0...v2.46.1) (2025-11-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* env key replacer and remove unused function ([#5547](https://github.com/filebrowser/filebrowser/issues/5547)) ([13814e1](https://github.com/filebrowser/filebrowser/commit/13814e11197ebd9101940883e3ca85998f86d442))
|
||||
* remove duplicated 'hide-defaults' flag (is 'hideDefaults') ([#5548](https://github.com/filebrowser/filebrowser/issues/5548)) ([ffc8504](https://github.com/filebrowser/filebrowser/commit/ffc850454e4cb8f10b970511681d6c627340afc7))
|
||||
|
||||
## [2.46.0](https://github.com/filebrowser/filebrowser/compare/v2.45.3...v2.46.0) (2025-11-14)
|
||||
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ func (a *HookAuth) RunCommand() (string, error) {
|
||||
command[i] = os.Expand(arg, envMapping)
|
||||
}
|
||||
|
||||
cmd := exec.Command(command[0], command[1:]...) //nolint:gosec
|
||||
cmd := exec.Command(command[0], command[1:]...)
|
||||
cmd.Env = append(os.Environ(), fmt.Sprintf("USERNAME=%s", a.Cred.Username))
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("PASSWORD=%s", a.Cred.Password))
|
||||
out, err := cmd.Output()
|
||||
|
||||
@@ -40,7 +40,7 @@ func (a JSONAuth) Auth(r *http.Request, usr users.Store, _ *settings.Settings, s
|
||||
|
||||
// If ReCaptcha is enabled, check the code.
|
||||
if a.ReCaptcha != nil && a.ReCaptcha.Secret != "" {
|
||||
ok, err := a.ReCaptcha.Ok(cred.ReCaptcha) //nolint:govet
|
||||
ok, err := a.ReCaptcha.Ok(cred.ReCaptcha)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -70,7 +70,7 @@ func addServerFlags(flags *pflag.FlagSet) {
|
||||
flags.StringP("baseurl", "b", "", "base url")
|
||||
flags.String("cache-dir", "", "file cache directory (disabled if empty)")
|
||||
flags.String("token-expiration-time", "2h", "user session timeout")
|
||||
flags.Int("img-processors", 4, "image processors count") //nolint:mnd
|
||||
flags.Int("img-processors", 4, "image processors count")
|
||||
flags.Bool("disable-thumbnails", false, "disable image thumbnails")
|
||||
flags.Bool("disable-preview-resize", false, "disable resize of image previews")
|
||||
flags.Bool("disable-exec", true, "disables Command Runner feature")
|
||||
@@ -141,7 +141,7 @@ user created with the credentials from options "username" and "password".`,
|
||||
return err
|
||||
}
|
||||
if cacheDir != "" {
|
||||
if err := os.MkdirAll(cacheDir, 0700); err != nil { //nolint:govet
|
||||
if err := os.MkdirAll(cacheDir, 0700); err != nil {
|
||||
return fmt.Errorf("can't make directory %s: %w", cacheDir, err)
|
||||
}
|
||||
fileCache = diskcache.New(afero.NewOsFs(), cacheDir)
|
||||
@@ -169,7 +169,7 @@ user created with the credentials from options "username" and "password".`,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
socketPerm, err := cmd.Flags().GetUint32("socket-perm") //nolint:govet
|
||||
socketPerm, err := cmd.Flags().GetUint32("socket-perm")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -178,7 +178,7 @@ user created with the credentials from options "username" and "password".`,
|
||||
return err
|
||||
}
|
||||
case server.TLSKey != "" && server.TLSCert != "":
|
||||
cer, err := tls.LoadX509KeyPair(server.TLSCert, server.TLSKey) //nolint:govet
|
||||
cer, err := tls.LoadX509KeyPair(server.TLSCert, server.TLSKey)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -233,7 +233,7 @@ user created with the credentials from options "username" and "password".`,
|
||||
sig := <-sigc
|
||||
log.Println("Got signal:", sig)
|
||||
|
||||
shutdownCtx, shutdownRelease := context.WithTimeout(context.Background(), 10*time.Second) //nolint:mnd
|
||||
shutdownCtx, shutdownRelease := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer shutdownRelease()
|
||||
|
||||
if err := srv.Shutdown(shutdownCtx); err != nil {
|
||||
@@ -256,7 +256,6 @@ user created with the credentials from options "username" and "password".`,
|
||||
}, pythonConfig{allowNoDB: true}),
|
||||
}
|
||||
|
||||
//nolint:gocyclo
|
||||
func getRunParams(flags *pflag.FlagSet, st *storage.Storage) (*settings.Server, error) {
|
||||
server, err := st.Settings.GetServer()
|
||||
if err != nil {
|
||||
@@ -534,8 +533,7 @@ func initConfig() {
|
||||
|
||||
v.SetEnvPrefix("FB")
|
||||
v.AutomaticEnv()
|
||||
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
|
||||
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
|
||||
|
||||
if err := v.ReadInConfig(); err != nil {
|
||||
var configParseError v.ConfigParseError
|
||||
|
||||
@@ -80,7 +80,6 @@ func addUserFlags(flags *pflag.FlagSet) {
|
||||
flags.Bool("dateFormat", false, "use date format (true for absolute time, false for relative)")
|
||||
flags.Bool("hideDotfiles", false, "hide dotfiles")
|
||||
flags.String("aceEditorTheme", "", "ace editor's syntax highlighting theme for users")
|
||||
flags.Bool("hide-dotfiles", false, "Hide dotfiles by default")
|
||||
}
|
||||
|
||||
func getViewMode(flags *pflag.FlagSet) (users.ViewMode, error) {
|
||||
@@ -95,7 +94,6 @@ func getViewMode(flags *pflag.FlagSet) (users.ViewMode, error) {
|
||||
return viewMode, nil
|
||||
}
|
||||
|
||||
//nolint:gocyclo
|
||||
func getUserDefaults(flags *pflag.FlagSet, defaults *settings.UserDefaults, all bool) error {
|
||||
var visitErr error
|
||||
visit := func(flag *pflag.Flag) {
|
||||
@@ -136,7 +134,7 @@ func getUserDefaults(flags *pflag.FlagSet, defaults *settings.UserDefaults, all
|
||||
defaults.Sorting.By, err = getString(flags, flag.Name)
|
||||
case "sorting.asc":
|
||||
defaults.Sorting.Asc, err = getBool(flags, flag.Name)
|
||||
case "hide-dotfiles":
|
||||
case "hideDotfiles":
|
||||
defaults.HideDotfiles, err = getBool(flags, flag.Name)
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
@@ -87,7 +87,7 @@ list or set it to 0.`,
|
||||
// with the new username. If there is, print an error and cancel the
|
||||
// operation
|
||||
if user.Username != onDB.Username {
|
||||
if conflictuous, err := d.store.Users.Get("", user.Username); err == nil { //nolint:govet
|
||||
if conflictuous, err := d.store.Users.Get("", user.Username); err == nil {
|
||||
return usernameConflictError(user.Username, conflictuous.ID, user.ID)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,16 +23,8 @@ import (
|
||||
|
||||
const dbPerms = 0640
|
||||
|
||||
func returnErr(err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getString(flags *pflag.FlagSet, flag string) (string, error) {
|
||||
s, err := flags.GetString(flag)
|
||||
return s, returnErr(err)
|
||||
return flags.GetString(flag)
|
||||
}
|
||||
|
||||
func getMode(flags *pflag.FlagSet, flag string) (fs.FileMode, error) {
|
||||
@@ -48,13 +40,11 @@ func getMode(flags *pflag.FlagSet, flag string) (fs.FileMode, error) {
|
||||
}
|
||||
|
||||
func getBool(flags *pflag.FlagSet, flag string) (bool, error) {
|
||||
b, err := flags.GetBool(flag)
|
||||
return b, returnErr(err)
|
||||
return flags.GetBool(flag)
|
||||
}
|
||||
|
||||
func getUint(flags *pflag.FlagSet, flag string) (uint, error) {
|
||||
b, err := flags.GetUint(flag)
|
||||
return b, returnErr(err)
|
||||
return flags.GetUint(flag)
|
||||
}
|
||||
|
||||
func generateKey() []byte {
|
||||
@@ -89,7 +79,7 @@ func dbExists(path string) (bool, error) {
|
||||
d := filepath.Dir(path)
|
||||
_, err = os.Stat(d)
|
||||
if os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(d, 0700); err != nil { //nolint:govet
|
||||
if err := os.MkdirAll(d, 0700); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return false, nil
|
||||
|
||||
@@ -2,7 +2,7 @@ package diskcache
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha1" //nolint:gosec
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -103,7 +103,7 @@ func (f *FileCache) getScopedLocks(key string) (lock sync.Locker) {
|
||||
}
|
||||
|
||||
func (f *FileCache) getFileName(key string) string {
|
||||
hasher := sha1.New() //nolint:gosec
|
||||
hasher := sha1.New()
|
||||
_, _ = hasher.Write([]byte(key))
|
||||
hash := hex.EncodeToString(hasher.Sum(nil))
|
||||
return fmt.Sprintf("%s/%s/%s", hash[:1], hash[1:3], hash)
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestFileCache(t *testing.T) {
|
||||
require.False(t, exists)
|
||||
}
|
||||
|
||||
func checkValue(t *testing.T, ctx context.Context, fs afero.Fs, fileFullPath string, cache *FileCache, key, wantValue string) { //nolint:revive
|
||||
func checkValue(t *testing.T, ctx context.Context, fs afero.Fs, fileFullPath string, cache *FileCache, key, wantValue string) {
|
||||
t.Helper()
|
||||
// check actual file content
|
||||
b, err := afero.ReadFile(fs, fileFullPath)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package files
|
||||
|
||||
import (
|
||||
"crypto/md5" //nolint:gosec
|
||||
"crypto/sha1" //nolint:gosec
|
||||
"crypto/md5"
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"crypto/sha512"
|
||||
"encoding/hex"
|
||||
@@ -90,7 +90,7 @@ func NewFileInfo(opts *FileOptions) (*FileInfo, error) {
|
||||
|
||||
if opts.Expand {
|
||||
if file.IsDir {
|
||||
if err := file.readListing(opts.Checker, opts.ReadHeader); err != nil { //nolint:govet
|
||||
if err := file.readListing(opts.Checker, opts.ReadHeader); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return file, nil
|
||||
@@ -183,7 +183,6 @@ func (i *FileInfo) Checksum(algo string) error {
|
||||
|
||||
var h hash.Hash
|
||||
|
||||
//nolint:gosec
|
||||
switch algo {
|
||||
case "md5":
|
||||
h = md5.New()
|
||||
|
||||
@@ -600,7 +600,6 @@ var types = map[string]string{
|
||||
".epub": "application/epub+zip",
|
||||
}
|
||||
|
||||
//nolint:gochecknoinits
|
||||
func init() {
|
||||
for ext, typ := range types {
|
||||
// skip errors
|
||||
|
||||
@@ -28,7 +28,6 @@ var (
|
||||
cmdNotAllowed = []byte("Command not allowed.")
|
||||
)
|
||||
|
||||
//nolint:unparam
|
||||
func wsErr(ws *websocket.Conn, r *http.Request, status int, err error) {
|
||||
txt := http.StatusText(status)
|
||||
if err != nil || status >= 400 {
|
||||
@@ -49,7 +48,7 @@ var commandsHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *d
|
||||
var raw string
|
||||
|
||||
for {
|
||||
_, msg, err := conn.ReadMessage() //nolint:govet
|
||||
_, msg, err := conn.ReadMessage()
|
||||
if err != nil {
|
||||
wsErr(conn, r, http.StatusInternalServerError, err)
|
||||
return 0, nil
|
||||
@@ -63,7 +62,7 @@ var commandsHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *d
|
||||
|
||||
// Fail fast
|
||||
if !d.server.EnableExec || !d.user.Perm.Execute {
|
||||
if err := conn.WriteMessage(websocket.TextMessage, cmdNotAllowed); err != nil { //nolint:govet
|
||||
if err := conn.WriteMessage(websocket.TextMessage, cmdNotAllowed); err != nil {
|
||||
wsErr(conn, r, http.StatusInternalServerError, err)
|
||||
}
|
||||
|
||||
@@ -72,21 +71,21 @@ var commandsHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *d
|
||||
|
||||
command, name, err := runner.ParseCommand(d.settings, raw)
|
||||
if err != nil {
|
||||
if err := conn.WriteMessage(websocket.TextMessage, []byte(err.Error())); err != nil { //nolint:govet
|
||||
if err := conn.WriteMessage(websocket.TextMessage, []byte(err.Error())); err != nil {
|
||||
wsErr(conn, r, http.StatusInternalServerError, err)
|
||||
}
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
if !slices.Contains(d.user.Commands, name) {
|
||||
if err := conn.WriteMessage(websocket.TextMessage, cmdNotAllowed); err != nil { //nolint:govet
|
||||
if err := conn.WriteMessage(websocket.TextMessage, cmdNotAllowed); err != nil {
|
||||
wsErr(conn, r, http.StatusInternalServerError, err)
|
||||
}
|
||||
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
cmd := exec.Command(command[0], command[1:]...) //nolint:gosec
|
||||
cmd := exec.Command(command[0], command[1:]...)
|
||||
cmd.Dir = d.user.FullPath(r.URL.Path)
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
func TestPublicShareHandlerAuthentication(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
const passwordBcrypt = "$2y$10$TFAmdCbyd/mEZDe5fUeZJu.MaJQXRTwdqb/IQV.eTn6dWrF58gCSe" //nolint:gosec
|
||||
const passwordBcrypt = "$2y$10$TFAmdCbyd/mEZDe5fUeZJu.MaJQXRTwdqb/IQV.eTn6dWrF58gCSe"
|
||||
testCases := map[string]struct {
|
||||
share *share.Link
|
||||
req *http.Request
|
||||
@@ -70,7 +70,7 @@ func TestPublicShareHandlerAuthentication(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Cleanup(func() {
|
||||
if err := db.Close(); err != nil { //nolint:govet
|
||||
if err := db.Close(); err != nil {
|
||||
t.Errorf("failed to close db: %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -111,7 +111,6 @@ var sharePostHandler = withPermShare(func(w http.ResponseWriter, r *http.Request
|
||||
var expire int64 = 0
|
||||
|
||||
if body.Expires != "" {
|
||||
//nolint:govet
|
||||
num, err := strconv.Atoi(body.Expires)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
|
||||
@@ -51,7 +51,7 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys
|
||||
|
||||
if d.settings.Branding.Files != "" {
|
||||
fPath := filepath.Join(d.settings.Branding.Files, "custom.css")
|
||||
_, err := os.Stat(fPath) //nolint:govet
|
||||
_, err := os.Stat(fPath)
|
||||
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
log.Printf("couldn't load custom styles: %v", err)
|
||||
@@ -63,7 +63,7 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys
|
||||
}
|
||||
|
||||
if d.settings.AuthMethod == auth.MethodJSONAuth {
|
||||
raw, err := d.store.Auth.Get(d.settings.AuthMethod) //nolint:govet
|
||||
raw, err := d.store.Auth.Get(d.settings.AuthMethod)
|
||||
if err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ func (s *Service) Resize(ctx context.Context, in io.Reader, width, height int, o
|
||||
case ResizeModeFill:
|
||||
img = imaging.Fill(img, width, height, imaging.Center, config.quality.resampleFilter())
|
||||
case ResizeModeFit:
|
||||
fallthrough //nolint:gocritic
|
||||
fallthrough
|
||||
default:
|
||||
img = imaging.Fit(img, width, height, config.quality.resampleFilter())
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ func (r *Runner) exec(raw, evt, path, dst string, user *users.User) error {
|
||||
command[i] = os.Expand(arg, envMapping)
|
||||
}
|
||||
|
||||
cmd := exec.Command(command[0], command[1:]...) //nolint:gosec
|
||||
cmd := exec.Command(command[0], command[1:]...)
|
||||
cmd.Env = append(os.Environ(), fmt.Sprintf("FILE=%s", path))
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("SCOPE=%s", user.Scope)) //nolint:gocritic
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("SCOPE=%s", user.Scope))
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("TRIGGER=%s", evt))
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("USERNAME=%s", user.Username))
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("DESTINATION=%s", dst))
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
var assets embed.FS
|
||||
var commonPasswords map[string]struct{}
|
||||
|
||||
//nolint:gochecknoinits
|
||||
func init() {
|
||||
// Password list sourced from:
|
||||
// https://github.com/danielmiessler/SecLists/blob/master/Passwords/Common-Credentials/100k-most-used-passwords-NCSC.txt
|
||||
|
||||
@@ -63,7 +63,7 @@ func (s *Storage) Gets(baseScope string) ([]*User, error) {
|
||||
}
|
||||
|
||||
for _, user := range users {
|
||||
if err := user.Clean(baseScope); err != nil { //nolint:govet
|
||||
if err := user.Clean(baseScope); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,6 @@ var checkableFields = []string{
|
||||
|
||||
// Clean cleans up a user and verifies if all its fields
|
||||
// are alright to be saved.
|
||||
//
|
||||
//nolint:gocyclo
|
||||
func (u *User) Clean(baseScope string, fields ...string) error {
|
||||
if len(fields) == 0 {
|
||||
fields = checkableFields
|
||||
@@ -93,7 +91,7 @@ func (u *User) Clean(baseScope string, fields ...string) error {
|
||||
|
||||
if u.Fs == nil {
|
||||
scope := u.Scope
|
||||
scope = filepath.Join(baseScope, filepath.Join("/", scope)) //nolint:gocritic
|
||||
scope = filepath.Join(baseScope, filepath.Join("/", scope))
|
||||
u.Fs = afero.NewBasePathFs(afero.NewOsFs(), scope)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.12 = .58
|
||||
LINUX_KERNEL_HASH-6.12.58 = 5f1c4c546660a6a81046fdfa6195306bad2c8d17c0d69876dc100a85ad4613ac
|
||||
LINUX_VERSION-6.12 = .56
|
||||
LINUX_KERNEL_HASH-6.12.56 = 55432b2af352f7bf3053c348d8549df2f2deeaa4a361c65d638c2f3b2ca7ec96
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .116
|
||||
LINUX_KERNEL_HASH-6.6.116 = a9a59742c29be284c205dc87cbe9b065f9688488132c8f5a6057a5539230a51d
|
||||
LINUX_VERSION-6.6 = .115
|
||||
LINUX_KERNEL_HASH-6.6.115 = 0a98c05e8d0f6b49fad71b8d779410a0811ea5ae17d81744fe30718633fd9047
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uboot-rk35xx
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/radxa/u-boot
|
||||
@@ -38,19 +38,6 @@ define U-Boot/evb-rk3528
|
||||
SOC:=rk3528
|
||||
endef
|
||||
|
||||
define U-Boot/evb-rk3566
|
||||
BUILD_SUBTARGET:=armv8
|
||||
NAME:=RK3566 Evaluation
|
||||
BUILD_DEVICES:= \
|
||||
radxa_zero-3e \
|
||||
radxa_zero-3w
|
||||
DEPENDS:=+PACKAGE_u-boot-evb-rk3566:rkbin-rk3566
|
||||
ATF:=rk3568_bl31_v1.44.elf
|
||||
DDR:=rk3566_ddr_1056MHz_v1.23.bin
|
||||
UBOOT_CONFIG:=rk3566
|
||||
SOC:=rk3568
|
||||
endef
|
||||
|
||||
define U-Boot/evb-rk3576
|
||||
BUILD_SUBTARGET:=armv8
|
||||
NAME:=RK3576 Evaluation
|
||||
@@ -66,23 +53,9 @@ define U-Boot/evb-rk3576
|
||||
SOC:=rk3576
|
||||
endef
|
||||
|
||||
define U-Boot/evb-rk3588
|
||||
BUILD_SUBTARGET:=armv8
|
||||
NAME:=RK3588 Evaluation
|
||||
BUILD_DEVICES:= \
|
||||
radxa_rock-5c
|
||||
DEPENDS:=+PACKAGE_u-boot-evb-rk3588:rkbin-rk3588
|
||||
ATF:=rk3588_bl31_v1.47.elf
|
||||
DDR:=rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.18.bin
|
||||
UBOOT_CONFIG:=rk3588
|
||||
SOC:=rk3588
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
evb-rk3528 \
|
||||
evb-rk3566 \
|
||||
evb-rk3576 \
|
||||
evb-rk3588
|
||||
evb-rk3576
|
||||
|
||||
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
|
||||
|
||||
|
||||
@@ -6,15 +6,6 @@
|
||||
CONFIG_RK_AVB_LIBAVB_USER=y
|
||||
-CONFIG_OPTEE_CLIENT=y
|
||||
-CONFIG_OPTEE_V2=y
|
||||
--- a/configs/rk3568_defconfig
|
||||
+++ b/configs/rk3568_defconfig
|
||||
@@ -222,6 +222,3 @@
|
||||
CONFIG_AVB_LIBAVB_ATX=y
|
||||
CONFIG_AVB_LIBAVB_USER=y
|
||||
CONFIG_RK_AVB_LIBAVB_USER=y
|
||||
-CONFIG_OPTEE_CLIENT=y
|
||||
-CONFIG_OPTEE_V2=y
|
||||
-CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION=y
|
||||
--- a/configs/rk3576_defconfig
|
||||
+++ b/configs/rk3576_defconfig
|
||||
@@ -224,6 +224,3 @@ CONFIG_AVB_LIBAVB_AB=y
|
||||
@@ -24,12 +15,3 @@
|
||||
-CONFIG_OPTEE_CLIENT=y
|
||||
-CONFIG_OPTEE_V2=y
|
||||
-CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION=y
|
||||
--- a/configs/rk3588_defconfig
|
||||
+++ b/configs/rk3588_defconfig
|
||||
@@ -232,6 +232,3 @@
|
||||
CONFIG_AVB_LIBAVB_ATX=y
|
||||
CONFIG_AVB_LIBAVB_USER=y
|
||||
CONFIG_RK_AVB_LIBAVB_USER=y
|
||||
-CONFIG_OPTEE_CLIENT=y
|
||||
-CONFIG_OPTEE_V2=y
|
||||
-CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION=y
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_SPL_LIBCOMMON_SUPPORT=y
|
||||
CONFIG_SPL_LIBGENERIC_SUPPORT=y
|
||||
CONFIG_SYS_MALLOC_F_LEN=0x80000
|
||||
CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.sh"
|
||||
CONFIG_ROCKCHIP_RK3568=y
|
||||
CONFIG_ROCKCHIP_FIT_IMAGE=y
|
||||
CONFIG_ROCKCHIP_VENDOR_PARTITION=y
|
||||
CONFIG_DM_DMC=y
|
||||
CONFIG_ROCKCHIP_DMC_FSP=y
|
||||
CONFIG_ROCKCHIP_FIT_IMAGE_PACK=y
|
||||
CONFIG_ROCKCHIP_NEW_IDB=y
|
||||
CONFIG_SPL_SERIAL_SUPPORT=y
|
||||
CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
|
||||
CONFIG_TARGET_EVB_RK3568=y
|
||||
CONFIG_SPL_LIBDISK_SUPPORT=y
|
||||
CONFIG_SPL_NAND_SUPPORT=y
|
||||
CONFIG_SPL_SPI_FLASH_SUPPORT=y
|
||||
CONFIG_SPL_SPI_SUPPORT=y
|
||||
CONFIG_DEFAULT_DEVICE_TREE="rk3568-evb"
|
||||
CONFIG_DEBUG_UART=y
|
||||
CONFIG_IMAGE_GZIP=y
|
||||
CONFIG_FIT=y
|
||||
CONFIG_FIT_IMAGE_POST_PROCESS=y
|
||||
CONFIG_FIT_HW_CRYPTO=y
|
||||
CONFIG_SPL_LOAD_FIT=y
|
||||
CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y
|
||||
CONFIG_SPL_FIT_HW_CRYPTO=y
|
||||
# CONFIG_SPL_SYS_DCACHE_OFF is not set
|
||||
CONFIG_BOOTDELAY=0
|
||||
CONFIG_SYS_CONSOLE_INFO_QUIET=y
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
CONFIG_ANDROID_BOOTLOADER=y
|
||||
CONFIG_ANDROID_AVB=y
|
||||
CONFIG_ANDROID_BOOT_IMAGE_HASH=y
|
||||
CONFIG_BOARD_RNG_SEED=y
|
||||
CONFIG_SPL_BOARD_INIT=y
|
||||
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
|
||||
CONFIG_SPL_SEPARATE_BSS=y
|
||||
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y
|
||||
CONFIG_SPL_SHA256_SUPPORT=y
|
||||
CONFIG_SPL_CRYPTO_SUPPORT=y
|
||||
CONFIG_SPL_HASH_SUPPORT=y
|
||||
CONFIG_SPL_MMC_WRITE=y
|
||||
CONFIG_SPL_MTD_SUPPORT=y
|
||||
CONFIG_SPL_MTD_WRITE=y
|
||||
CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
|
||||
CONFIG_SPL_ATF=y
|
||||
CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
|
||||
CONFIG_SPL_AB=y
|
||||
CONFIG_FASTBOOT_BUF_ADDR=0xc00800
|
||||
CONFIG_FASTBOOT_BUF_SIZE=0x04000000
|
||||
CONFIG_FASTBOOT_FLASH=y
|
||||
CONFIG_FASTBOOT_FLASH_MMC_DEV=0
|
||||
CONFIG_CMD_BOOTZ=y
|
||||
CONFIG_CMD_DTIMG=y
|
||||
# CONFIG_CMD_ELF is not set
|
||||
# CONFIG_CMD_IMI is not set
|
||||
# CONFIG_CMD_IMLS is not set
|
||||
# CONFIG_CMD_XIMG is not set
|
||||
# CONFIG_CMD_LZMADEC is not set
|
||||
# CONFIG_CMD_UNZIP is not set
|
||||
# CONFIG_CMD_FLASH is not set
|
||||
# CONFIG_CMD_FPGA is not set
|
||||
CONFIG_CMD_GPT=y
|
||||
# CONFIG_CMD_LOADB is not set
|
||||
# CONFIG_CMD_LOADS is not set
|
||||
CONFIG_CMD_BOOT_ANDROID=y
|
||||
CONFIG_CMD_BOOT_ROCKCHIP=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_MTD=y
|
||||
CONFIG_CMD_NAND=y
|
||||
CONFIG_CMD_USB=y
|
||||
CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
# CONFIG_CMD_ITEST is not set
|
||||
# CONFIG_CMD_SETEXPR is not set
|
||||
CONFIG_CMD_TFTPPUT=y
|
||||
CONFIG_CMD_TFTP_BOOTM=y
|
||||
CONFIG_CMD_TFTP_FLASH=y
|
||||
# CONFIG_CMD_MISC is not set
|
||||
# CONFIG_CMD_CHARGE_DISPLAY is not set
|
||||
CONFIG_CMD_MTD_BLK=y
|
||||
# CONFIG_SPL_DOS_PARTITION is not set
|
||||
# CONFIG_ISO_PARTITION is not set
|
||||
CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=64
|
||||
CONFIG_SPL_OF_CONTROL=y
|
||||
CONFIG_SPL_DTB_MINIMUM=y
|
||||
CONFIG_OF_LIVE=y
|
||||
CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
# CONFIG_NET_TFTP_VARS is not set
|
||||
CONFIG_REGMAP=y
|
||||
CONFIG_SPL_REGMAP=y
|
||||
CONFIG_SYSCON=y
|
||||
CONFIG_SPL_SYSCON=y
|
||||
CONFIG_CLK=y
|
||||
CONFIG_SPL_CLK=y
|
||||
CONFIG_CLK_SCMI=y
|
||||
CONFIG_DM_CRYPTO=y
|
||||
CONFIG_SPL_DM_CRYPTO=y
|
||||
CONFIG_ROCKCHIP_CRYPTO_V2=y
|
||||
CONFIG_SPL_ROCKCHIP_CRYPTO_V2=y
|
||||
CONFIG_DM_RNG=y
|
||||
CONFIG_RNG_ROCKCHIP=y
|
||||
CONFIG_SCMI_FIRMWARE=y
|
||||
CONFIG_ROCKCHIP_GPIO=y
|
||||
CONFIG_ROCKCHIP_GPIO_V2=y
|
||||
CONFIG_SYS_I2C_ROCKCHIP=y
|
||||
CONFIG_DM_KEY=y
|
||||
CONFIG_RK8XX_PWRKEY=y
|
||||
CONFIG_ADC_KEY=y
|
||||
CONFIG_MISC=y
|
||||
CONFIG_SPL_MISC=y
|
||||
CONFIG_ROCKCHIP_OTP=y
|
||||
CONFIG_SPL_ROCKCHIP_SECURE_OTP=y
|
||||
CONFIG_MMC_DW=y
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_BLK=y
|
||||
CONFIG_MTD_DEVICE=y
|
||||
CONFIG_NAND=y
|
||||
CONFIG_NAND_ROCKCHIP_V9=y
|
||||
CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
|
||||
CONFIG_SYS_NAND_U_BOOT_OFFS=0x8000
|
||||
CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x10000
|
||||
CONFIG_MTD_SPI_NAND=y
|
||||
CONFIG_SPI_FLASH=y
|
||||
CONFIG_SF_DEFAULT_SPEED=20000000
|
||||
CONFIG_SPI_FLASH_EON=y
|
||||
CONFIG_SPI_FLASH_GIGADEVICE=y
|
||||
CONFIG_SPI_FLASH_MACRONIX=y
|
||||
CONFIG_SPI_FLASH_WINBOND=y
|
||||
CONFIG_SPI_FLASH_XMC=y
|
||||
CONFIG_SPI_FLASH_MTD=y
|
||||
CONFIG_DM_ETH=y
|
||||
CONFIG_DM_ETH_PHY=y
|
||||
CONFIG_DWC_ETH_QOS=y
|
||||
CONFIG_GMAC_ROCKCHIP=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
|
||||
CONFIG_PHY_ROCKCHIP_NANENG_EDP=y
|
||||
CONFIG_PINCTRL=y
|
||||
CONFIG_SPL_PINCTRL=y
|
||||
CONFIG_DM_FUEL_GAUGE=y
|
||||
CONFIG_POWER_FG_RK817=y
|
||||
CONFIG_IO_DOMAIN=y
|
||||
CONFIG_ROCKCHIP_IO_DOMAIN=y
|
||||
CONFIG_DM_PMIC=y
|
||||
CONFIG_PMIC_RK8XX=y
|
||||
CONFIG_REGULATOR_FAN53555=y
|
||||
CONFIG_REGULATOR_PWM=y
|
||||
CONFIG_DM_REGULATOR_FIXED=y
|
||||
CONFIG_DM_REGULATOR_GPIO=y
|
||||
CONFIG_REGULATOR_RK8XX=y
|
||||
CONFIG_DM_CHARGE_DISPLAY=y
|
||||
CONFIG_CHARGE_ANIMATION=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_RAM=y
|
||||
CONFIG_SPL_RAM=y
|
||||
CONFIG_TPL_RAM=y
|
||||
CONFIG_DM_RAMDISK=y
|
||||
CONFIG_RAMDISK_RO=y
|
||||
CONFIG_ROCKCHIP_SDRAM_COMMON=y
|
||||
CONFIG_ROCKCHIP_TPL_INIT_DRAM_TYPE=0
|
||||
CONFIG_DM_RESET=y
|
||||
CONFIG_SPL_DM_RESET=y
|
||||
CONFIG_SPL_RESET_ROCKCHIP=y
|
||||
CONFIG_BAUDRATE=1500000
|
||||
CONFIG_DEBUG_UART_BASE=0xFE660000
|
||||
CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
CONFIG_DEBUG_UART_SHIFT=2
|
||||
CONFIG_ROCKCHIP_SFC=y
|
||||
CONFIG_SYSRESET=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_XHCI_DWC3=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_GENERIC=y
|
||||
CONFIG_USB_OHCI_HCD=y
|
||||
CONFIG_USB_OHCI_GENERIC=y
|
||||
CONFIG_USB_DWC3=y
|
||||
CONFIG_USB_DWC3_GADGET=y
|
||||
CONFIG_USB_DWC3_GENERIC=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="Rockchip"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x2207
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x350a
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
CONFIG_DM_VIDEO=y
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_DRM_ROCKCHIP=y
|
||||
CONFIG_DRM_ROCKCHIP_DW_HDMI=y
|
||||
CONFIG_DRM_ROCKCHIP_INNO_MIPI_PHY=y
|
||||
CONFIG_DRM_ROCKCHIP_INNO_VIDEO_COMBO_PHY=y
|
||||
CONFIG_DRM_ROCKCHIP_DW_MIPI_DSI=y
|
||||
CONFIG_DRM_ROCKCHIP_ANALOGIX_DP=y
|
||||
CONFIG_DRM_ROCKCHIP_LVDS=y
|
||||
CONFIG_DRM_ROCKCHIP_RGB=y
|
||||
CONFIG_ROCKCHIP_CUBIC_LUT_SIZE=9
|
||||
CONFIG_LCD=y
|
||||
CONFIG_USE_TINY_PRINTF=y
|
||||
CONFIG_SPL_TINY_MEMSET=y
|
||||
CONFIG_RSA=y
|
||||
CONFIG_SPL_RSA=y
|
||||
CONFIG_RSA_N_SIZE=0x200
|
||||
CONFIG_RSA_E_SIZE=0x10
|
||||
CONFIG_RSA_C_SIZE=0x20
|
||||
CONFIG_XBC=y
|
||||
CONFIG_SHA512=y
|
||||
CONFIG_LZ4=y
|
||||
CONFIG_LZMA=y
|
||||
CONFIG_SPL_GZIP=y
|
||||
CONFIG_ERRNO_STR=y
|
||||
# CONFIG_EFI_LOADER is not set
|
||||
CONFIG_AVB_LIBAVB=y
|
||||
CONFIG_AVB_LIBAVB_AB=y
|
||||
CONFIG_AVB_LIBAVB_ATX=y
|
||||
CONFIG_AVB_LIBAVB_USER=y
|
||||
CONFIG_RK_AVB_LIBAVB_USER=y
|
||||
@@ -236,6 +236,14 @@ define U-Boot/panther-x2-rk3566
|
||||
panther_x2
|
||||
endef
|
||||
|
||||
define U-Boot/radxa-zero-3-rk3566
|
||||
$(U-Boot/rk3566/Default)
|
||||
NAME:=ZERO 3E/3W
|
||||
BUILD_DEVICES:= \
|
||||
radxa_zero-3e \
|
||||
radxa_zero-3w
|
||||
endef
|
||||
|
||||
define U-Boot/rock-3c-rk3566
|
||||
$(U-Boot/rk3566/Default)
|
||||
NAME:=ROCK 3C
|
||||
@@ -451,11 +459,19 @@ define U-Boot/rock5a-rk3588s
|
||||
radxa_rock-5a
|
||||
endef
|
||||
|
||||
define U-Boot/rock-5c-rk3588s
|
||||
$(U-Boot/rk3588/Default)
|
||||
NAME:=ROCK 5C/5C Lite
|
||||
BUILD_DEVICES:= \
|
||||
radxa_rock-5c
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
generic-rk3528 \
|
||||
radxa-e20c-rk3528 \
|
||||
nanopi-r3s-rk3566 \
|
||||
panther-x2-rk3566 \
|
||||
radxa-zero-3-rk3566 \
|
||||
rock-3c-rk3566 \
|
||||
bpi-r2-pro-rk3568 \
|
||||
generic-rk3568 \
|
||||
@@ -480,6 +496,7 @@ UBOOT_TARGETS := \
|
||||
nanopi-r6s-rk3588s \
|
||||
orangepi-5-rk3588s \
|
||||
rock5a-rk3588s \
|
||||
rock-5c-rk3588s \
|
||||
dlfr100-rk3399 \
|
||||
h3399pc-rk3399 \
|
||||
fine3399-rk3399 \
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Karlman <jonas@kwiboo.se>
|
||||
Date: Sun, 10 Aug 2025 22:26:31 +0000
|
||||
Subject: rockchip: rk3588s-rock-5c: Add support for ROCK 5C Lite variant
|
||||
|
||||
Add Kconfig option OF_SYSTEM_SETUP=y to support booting ROCK 5C Lite
|
||||
boards with a RK3582 SoC. CPU and GPU cores are failed based on ip-state
|
||||
and policy.
|
||||
|
||||
Tested on a ROCK 5C Lite v1.1:
|
||||
|
||||
cpu-code: 35 82
|
||||
ip-state: 00 80 00 (otp)
|
||||
ip-state: c0 80 04 (policy)
|
||||
remove cpu-map cluster2
|
||||
fail rkvdec1
|
||||
fail rkvenc1
|
||||
fail cpu cpu@600
|
||||
fail cpu cpu@700
|
||||
|
||||
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
|
||||
|
||||
--- a/configs/rock-5c-rk3588s_defconfig
|
||||
+++ b/configs/rock-5c-rk3588s_defconfig
|
||||
@@ -18,6 +18,7 @@ CONFIG_FIT_VERBOSE=y
|
||||
CONFIG_SPL_FIT_SIGNATURE=y
|
||||
CONFIG_SPL_LOAD_FIT=y
|
||||
CONFIG_LEGACY_IMAGE_FORMAT=y
|
||||
+CONFIG_OF_SYSTEM_SETUP=y
|
||||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588s-rock-5c.dtb"
|
||||
# CONFIG_DISPLAY_CPUINFO is not set
|
||||
CONFIG_SPL_MAX_SIZE=0x40000
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
From 8680ecfcb4570e5f68a7b1bc237dfdfcf65b389e Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 21 Dec 2023 18:01:59 +0000
|
||||
Subject: [PATCH] media: i2c: adv7180: Use MEDIA_BUS_FMT_UYVY8_1X16 for CSI2
|
||||
output
|
||||
|
||||
CSI2 devices are meant to use the 1Xnn formats rather than 2Xnn
|
||||
such as MEDIA_BUS_FMT_UYVY8_2X8.
|
||||
|
||||
For devices with ADV7180_FLAG_MIPI_CSI2 set, use
|
||||
MEDIA_BUS_FMT_UYVY8_1X16.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/i2c/adv7180.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/media/i2c/adv7180.c
|
||||
+++ b/drivers/media/i2c/adv7180.c
|
||||
@@ -737,10 +737,15 @@ static int adv7180_enum_mbus_code(struct
|
||||
struct v4l2_subdev_state *sd_state,
|
||||
struct v4l2_subdev_mbus_code_enum *code)
|
||||
{
|
||||
+ struct adv7180_state *state = to_state(sd);
|
||||
+
|
||||
if (code->index != 0)
|
||||
return -EINVAL;
|
||||
|
||||
- code->code = MEDIA_BUS_FMT_UYVY8_2X8;
|
||||
+ if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
|
||||
+ code->code = MEDIA_BUS_FMT_UYVY8_1X16;
|
||||
+ else
|
||||
+ code->code = MEDIA_BUS_FMT_UYVY8_2X8;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -750,7 +755,10 @@ static int adv7180_mbus_fmt(struct v4l2_
|
||||
{
|
||||
struct adv7180_state *state = to_state(sd);
|
||||
|
||||
- fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
|
||||
+ if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
|
||||
+ fmt->code = MEDIA_BUS_FMT_UYVY8_1X16;
|
||||
+ else
|
||||
+ fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
|
||||
fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
|
||||
fmt->width = 720;
|
||||
fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
From 7e58b9c99676d641ef76edd9c097f1c3c4e6c464 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Date: Thu, 21 Dec 2023 18:03:34 +0000
|
||||
Subject: [PATCH] media: i2c: adv7180: Add support for V4L2_CID_LINK_FREQ
|
||||
|
||||
For CSI2 receivers that need to know the link frequency,
|
||||
add it as a control to the driver.
|
||||
Interlaced modes are 216Mbp/s or 108MHz, whilst going through
|
||||
the I2P to deinterlace gives 432Mb/s or 216MHz.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
---
|
||||
drivers/media/i2c/adv7180.c | 32 +++++++++++++++++++++++++++++++-
|
||||
1 file changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/media/i2c/adv7180.c
|
||||
+++ b/drivers/media/i2c/adv7180.c
|
||||
@@ -189,6 +189,16 @@
|
||||
/* Initial number of frames to skip to avoid possible garbage */
|
||||
#define ADV7180_NUM_OF_SKIP_FRAMES 2
|
||||
|
||||
+enum adv7180_link_freq_idx {
|
||||
+ INTERLACED_IDX,
|
||||
+ I2P_IDX,
|
||||
+};
|
||||
+
|
||||
+static const s64 adv7180_link_freqs[] = {
|
||||
+ [INTERLACED_IDX] = 108000000,
|
||||
+ [I2P_IDX] = 216000000,
|
||||
+};
|
||||
+
|
||||
static int dbg_input;
|
||||
module_param(dbg_input, int, 0644);
|
||||
MODULE_PARM_DESC(dbg_input, "Input number (0-31)");
|
||||
@@ -229,6 +239,7 @@ struct adv7180_state {
|
||||
const struct adv7180_chip_info *chip_info;
|
||||
enum v4l2_field field;
|
||||
bool force_bt656_4;
|
||||
+ struct v4l2_ctrl *link_freq;
|
||||
};
|
||||
#define to_adv7180_sd(_ctrl) (&container_of(_ctrl->handler, \
|
||||
struct adv7180_state, \
|
||||
@@ -630,6 +641,9 @@ static int adv7180_s_ctrl(struct v4l2_ct
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
+ if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY)
|
||||
+ goto unlock;
|
||||
+
|
||||
val = ctrl->val;
|
||||
switch (ctrl->id) {
|
||||
case V4L2_CID_BRIGHTNESS:
|
||||
@@ -671,6 +685,7 @@ static int adv7180_s_ctrl(struct v4l2_ct
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
+unlock:
|
||||
mutex_unlock(&state->mutex);
|
||||
return ret;
|
||||
}
|
||||
@@ -691,7 +706,7 @@ static const struct v4l2_ctrl_config adv
|
||||
|
||||
static int adv7180_init_controls(struct adv7180_state *state)
|
||||
{
|
||||
- v4l2_ctrl_handler_init(&state->ctrl_hdl, 4);
|
||||
+ v4l2_ctrl_handler_init(&state->ctrl_hdl, 5);
|
||||
|
||||
v4l2_ctrl_new_std(&state->ctrl_hdl, &adv7180_ctrl_ops,
|
||||
V4L2_CID_BRIGHTNESS, ADV7180_BRI_MIN,
|
||||
@@ -717,6 +732,17 @@ static int adv7180_init_controls(struct
|
||||
test_pattern_menu);
|
||||
}
|
||||
|
||||
+ if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {
|
||||
+ state->link_freq =
|
||||
+ v4l2_ctrl_new_int_menu(&state->ctrl_hdl,
|
||||
+ &adv7180_ctrl_ops,
|
||||
+ V4L2_CID_LINK_FREQ,
|
||||
+ ARRAY_SIZE(adv7180_link_freqs) - 1,
|
||||
+ 0, adv7180_link_freqs);
|
||||
+ if (state->link_freq)
|
||||
+ state->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
|
||||
+ }
|
||||
+
|
||||
state->sd.ctrl_handler = &state->ctrl_hdl;
|
||||
if (state->ctrl_hdl.error) {
|
||||
int err = state->ctrl_hdl.error;
|
||||
@@ -849,6 +875,10 @@ static int adv7180_set_pad_format(struct
|
||||
adv7180_set_power(state, false);
|
||||
adv7180_set_field_mode(state);
|
||||
adv7180_set_power(state, true);
|
||||
+ if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
|
||||
+ __v4l2_ctrl_s_ctrl(state->link_freq,
|
||||
+ (state->field == V4L2_FIELD_NONE) ?
|
||||
+ I2P_IDX : INTERLACED_IDX);
|
||||
}
|
||||
} else {
|
||||
framefmt = v4l2_subdev_state_get_format(sd_state, 0);
|
||||
@@ -0,0 +1,125 @@
|
||||
From 9989fcd49c52500a2bf1f6d49411690dec45d2dc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= <marko.makela@iki.fi>
|
||||
Date: Sat, 2 Aug 2025 12:47:08 +0300
|
||||
Subject: [PATCH] clk: qcom: gcc-ipq6018: rework nss_port5 clock to multiple
|
||||
conf
|
||||
|
||||
Rework nss_port5 to use the new multiple configuration implementation
|
||||
and correctly fix the clocks for this port under some corner case.
|
||||
|
||||
In OpenWrt, this patch avoids intermittent dmesg errors of the form
|
||||
nss_port5_rx_clk_src: rcg didn't update its configuration.
|
||||
|
||||
This is a mechanical, straightforward port of
|
||||
commit e88f03230dc07aa3293b6aeb078bd27370bb2594
|
||||
("clk: qcom: gcc-ipq8074: rework nss_port5/6 clock to multiple conf")
|
||||
to gcc-ipq6018, with two conflicts resolved: different frequency of the
|
||||
P_XO clock source, and only 5 Ethernet ports.
|
||||
|
||||
This was originally developed by JiaY-shi <shi05275@163.com>.
|
||||
|
||||
Link: https://lore.kernel.org/all/20231220221724.3822-4-ansuelsmth@gmail.com/
|
||||
Signed-off-by: Marko Mäkelä <marko.makela@iki.fi>
|
||||
Tested-by: Marko Mäkelä <marko.makela@iki.fi>
|
||||
---
|
||||
drivers/clk/qcom/gcc-ipq6018.c | 60 +++++++++++++++++++++-------------
|
||||
1 file changed, 38 insertions(+), 22 deletions(-)
|
||||
|
||||
--- a/drivers/clk/qcom/gcc-ipq6018.c
|
||||
+++ b/drivers/clk/qcom/gcc-ipq6018.c
|
||||
@@ -511,15 +511,23 @@ static struct clk_rcg2 apss_ahb_clk_src
|
||||
},
|
||||
};
|
||||
|
||||
-static const struct freq_tbl ftbl_nss_port5_rx_clk_src[] = {
|
||||
- F(24000000, P_XO, 1, 0, 0),
|
||||
- F(25000000, P_UNIPHY1_RX, 12.5, 0, 0),
|
||||
- F(25000000, P_UNIPHY0_RX, 5, 0, 0),
|
||||
- F(78125000, P_UNIPHY1_RX, 4, 0, 0),
|
||||
- F(125000000, P_UNIPHY1_RX, 2.5, 0, 0),
|
||||
- F(125000000, P_UNIPHY0_RX, 1, 0, 0),
|
||||
- F(156250000, P_UNIPHY1_RX, 2, 0, 0),
|
||||
- F(312500000, P_UNIPHY1_RX, 1, 0, 0),
|
||||
+static const struct freq_conf ftbl_nss_port5_rx_clk_src_25[] = {
|
||||
+ C(P_UNIPHY1_RX, 12.5, 0, 0),
|
||||
+ C(P_UNIPHY0_RX, 5, 0, 0),
|
||||
+};
|
||||
+
|
||||
+static const struct freq_conf ftbl_nss_port5_rx_clk_src_125[] = {
|
||||
+ C(P_UNIPHY1_RX, 2.5, 0, 0),
|
||||
+ C(P_UNIPHY0_RX, 1, 0, 0),
|
||||
+};
|
||||
+
|
||||
+static const struct freq_multi_tbl ftbl_nss_port5_rx_clk_src[] = {
|
||||
+ FMS(24000000, P_XO, 1, 0, 0),
|
||||
+ FM(25000000, ftbl_nss_port5_rx_clk_src_25),
|
||||
+ FMS(78125000, P_UNIPHY1_RX, 4, 0, 0),
|
||||
+ FM(125000000, ftbl_nss_port5_rx_clk_src_125),
|
||||
+ FMS(156250000, P_UNIPHY1_RX, 2, 0, 0),
|
||||
+ FMS(312500000, P_UNIPHY1_RX, 1, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -547,26 +555,34 @@ gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32
|
||||
|
||||
static struct clk_rcg2 nss_port5_rx_clk_src = {
|
||||
.cmd_rcgr = 0x68060,
|
||||
- .freq_tbl = ftbl_nss_port5_rx_clk_src,
|
||||
+ .freq_multi_tbl = ftbl_nss_port5_rx_clk_src,
|
||||
.hid_width = 5,
|
||||
.parent_map = gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias_map,
|
||||
.clkr.hw.init = &(struct clk_init_data){
|
||||
.name = "nss_port5_rx_clk_src",
|
||||
.parent_data = gcc_xo_uniphy0_rx_tx_uniphy1_rx_tx_ubi32_bias,
|
||||
.num_parents = 7,
|
||||
- .ops = &clk_rcg2_ops,
|
||||
+ .ops = &clk_rcg2_fm_ops,
|
||||
},
|
||||
};
|
||||
|
||||
-static const struct freq_tbl ftbl_nss_port5_tx_clk_src[] = {
|
||||
- F(24000000, P_XO, 1, 0, 0),
|
||||
- F(25000000, P_UNIPHY1_TX, 12.5, 0, 0),
|
||||
- F(25000000, P_UNIPHY0_TX, 5, 0, 0),
|
||||
- F(78125000, P_UNIPHY1_TX, 4, 0, 0),
|
||||
- F(125000000, P_UNIPHY1_TX, 2.5, 0, 0),
|
||||
- F(125000000, P_UNIPHY0_TX, 1, 0, 0),
|
||||
- F(156250000, P_UNIPHY1_TX, 2, 0, 0),
|
||||
- F(312500000, P_UNIPHY1_TX, 1, 0, 0),
|
||||
+static const struct freq_conf ftbl_nss_port5_tx_clk_src_25[] = {
|
||||
+ C(P_UNIPHY1_TX, 12.5, 0, 0),
|
||||
+ C(P_UNIPHY0_TX, 5, 0, 0),
|
||||
+};
|
||||
+
|
||||
+static const struct freq_conf ftbl_nss_port5_tx_clk_src_125[] = {
|
||||
+ C(P_UNIPHY1_TX, 2.5, 0, 0),
|
||||
+ C(P_UNIPHY0_TX, 1, 0, 0),
|
||||
+};
|
||||
+
|
||||
+static const struct freq_multi_tbl ftbl_nss_port5_tx_clk_src[] = {
|
||||
+ FMS(24000000, P_XO, 1, 0, 0),
|
||||
+ FM(25000000, ftbl_nss_port5_tx_clk_src_25),
|
||||
+ FMS(78125000, P_UNIPHY1_TX, 4, 0, 0),
|
||||
+ FM(125000000, ftbl_nss_port5_tx_clk_src_125),
|
||||
+ FMS(156250000, P_UNIPHY1_TX, 2, 0, 0),
|
||||
+ FMS(312500000, P_UNIPHY1_TX, 1, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -594,14 +610,14 @@ gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32
|
||||
|
||||
static struct clk_rcg2 nss_port5_tx_clk_src = {
|
||||
.cmd_rcgr = 0x68068,
|
||||
- .freq_tbl = ftbl_nss_port5_tx_clk_src,
|
||||
+ .freq_multi_tbl = ftbl_nss_port5_tx_clk_src,
|
||||
.hid_width = 5,
|
||||
.parent_map = gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias_map,
|
||||
.clkr.hw.init = &(struct clk_init_data){
|
||||
.name = "nss_port5_tx_clk_src",
|
||||
.parent_data = gcc_xo_uniphy0_tx_rx_uniphy1_tx_rx_ubi32_bias,
|
||||
.num_parents = 7,
|
||||
- .ops = &clk_rcg2_ops,
|
||||
+ .ops = &clk_rcg2_fm_ops,
|
||||
},
|
||||
};
|
||||
|
||||
-73
@@ -35,7 +35,6 @@
|
||||
|
||||
led_green: led-green {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
default-state = "on";
|
||||
function = LED_FUNCTION_HEARTBEAT;
|
||||
gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
@@ -111,78 +110,6 @@
|
||||
cpu-supply = <&vdd_cpu>;
|
||||
};
|
||||
|
||||
&gpio0 {
|
||||
gpio-line-names =
|
||||
/* GPIO0_A0 - A7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO0_B0 - B7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO0_C0 - C7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO0_D0 - D7 */
|
||||
"pin-10 [GPIO0_D0]", "pin-08 [GPIO0_D1]", "",
|
||||
"", "", "", "", "";
|
||||
};
|
||||
|
||||
&gpio1 {
|
||||
gpio-line-names =
|
||||
/* GPIO1_A0 - A7 */
|
||||
"pin-03 [GPIO1_A0]", "pin-05 [GPIO1_A1]", "",
|
||||
"", "pin-37 [GPIO1_A4]", "",
|
||||
"", "",
|
||||
/* GPIO1_B0 - B7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO1_C0 - C7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO1_D0 - D7 */
|
||||
"", "", "", "", "", "", "", "";
|
||||
};
|
||||
|
||||
&gpio2 {
|
||||
gpio-line-names =
|
||||
/* GPIO2_A0 - A7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO2_B0 - B7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO2_C0 - C7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO2_D0 - D7 */
|
||||
"", "", "", "", "", "", "", "";
|
||||
};
|
||||
|
||||
&gpio3 {
|
||||
gpio-line-names =
|
||||
/* GPIO3_A0 - A7 */
|
||||
"", "pin-11 [GPIO3_A1]", "pin-13 [GPIO3_A2]",
|
||||
"pin-12 [GPIO3_A3]", "pin-35 [GPIO3_A4]", "pin-40 [GPIO3_A5]",
|
||||
"pin-38 [GPIO3_A6]", "pin-36 [GPIO3_A7]",
|
||||
/* GPIO3_B0 - B7 */
|
||||
"pin-15 [GPIO3_B0]", "pin-16 [GPIO3_B1]", "pin-18 [GPIO3_B2]",
|
||||
"pin-29 [GPIO3_B3]", "pin-31 [GPIO3_B4]", "",
|
||||
"", "",
|
||||
/* GPIO3_C0 - C7 */
|
||||
"", "pin-22 [GPIO3_C1]", "pin-32 [GPIO3_C2]",
|
||||
"pin-33 [GPIO3_C3]", "pin-07 [GPIO3_C4]", "",
|
||||
"", "",
|
||||
/* GPIO3_D0 - D7 */
|
||||
"", "", "", "", "", "", "", "";
|
||||
};
|
||||
|
||||
&gpio4 {
|
||||
gpio-line-names =
|
||||
/* GPIO4_A0 - A7 */
|
||||
"", "", "", "", "", "", "", "",
|
||||
/* GPIO4_B0 - B7 */
|
||||
"", "", "pin-27 [GPIO4_B2]",
|
||||
"pin-28 [GPIO4_B3]", "", "", "", "",
|
||||
/* GPIO4_C0 - C7 */
|
||||
"", "", "pin-23 [GPIO4_C2]",
|
||||
"pin-19 [GPIO4_C3]", "", "pin-21 [GPIO4_C5]",
|
||||
"pin-24 [GPIO4_C6]", "",
|
||||
/* GPIO4_D0 - D7 */
|
||||
"", "", "", "", "", "", "", "";
|
||||
};
|
||||
|
||||
&gpu {
|
||||
mali-supply = <&vdd_gpu_npu>;
|
||||
status = "okay";
|
||||
|
||||
-4
@@ -57,8 +57,6 @@
|
||||
cap-mmc-highspeed;
|
||||
max-frequency = <200000000>;
|
||||
mmc-hs200-1_8v;
|
||||
no-sd;
|
||||
no-sdio;
|
||||
non-removable;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
|
||||
@@ -73,8 +71,6 @@
|
||||
cap-sdio-irq;
|
||||
keep-power-in-suspend;
|
||||
mmc-pwrseq = <&sdio_pwrseq>;
|
||||
no-mmc;
|
||||
no-sd;
|
||||
non-removable;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_clk &sdmmc1_cmd>;
|
||||
@@ -19,10 +19,10 @@
|
||||
ethernet0 = &gmac1;
|
||||
mmc0 = &sdhci;
|
||||
mmc1 = &sdmmc;
|
||||
led-boot = &led_green;
|
||||
led-failsafe = &led_green;
|
||||
led-running = &led_green;
|
||||
led-upgrade = &led_green;
|
||||
led-boot = &led;
|
||||
led-failsafe = &led;
|
||||
led-running = &led;
|
||||
led-upgrade = &led;
|
||||
};
|
||||
|
||||
chosen {
|
||||
@@ -40,30 +40,19 @@
|
||||
"Headphone", "Headphones";
|
||||
};
|
||||
|
||||
hdmi0-con {
|
||||
compatible = "hdmi-connector";
|
||||
type = "a";
|
||||
|
||||
port {
|
||||
hdmi0_con_in: endpoint {
|
||||
remote-endpoint = <&hdmi0_out_con>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&led_pins>;
|
||||
|
||||
led_green: led-0 {
|
||||
led-0 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
default-state = "on";
|
||||
function = LED_FUNCTION_POWER;
|
||||
gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
led-1 {
|
||||
led: led-1 {
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_HEARTBEAT;
|
||||
gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
|
||||
@@ -241,6 +230,7 @@
|
||||
};
|
||||
|
||||
&gmac1 {
|
||||
clock_in_out = "output";
|
||||
phy-handle = <&rgmii_phy1>;
|
||||
phy-mode = "rgmii-id";
|
||||
phy-supply = <&vcc_3v3_s0>;
|
||||
@@ -259,31 +249,6 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdmi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hdmim0_tx0_cec
|
||||
&hdmim1_tx0_hpd
|
||||
&hdmim0_tx0_scl
|
||||
&hdmim0_tx0_sda>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdmi0_in {
|
||||
hdmi0_in_vp0: endpoint {
|
||||
remote-endpoint = <&vp0_out_hdmi0>;
|
||||
};
|
||||
};
|
||||
|
||||
&hdmi0_out {
|
||||
hdmi0_out_con: endpoint {
|
||||
remote-endpoint = <&hdmi0_con_in>;
|
||||
};
|
||||
};
|
||||
|
||||
&hdptxphy0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0m2_xfer>;
|
||||
@@ -457,10 +422,6 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pd_gpu {
|
||||
domain-supply = <&vdd_gpu_s0>;
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
leds {
|
||||
led_pins: led-pins {
|
||||
@@ -525,8 +486,6 @@
|
||||
bus-width = <8>;
|
||||
mmc-hs400-1_8v;
|
||||
mmc-hs400-enhanced-strobe;
|
||||
no-sdio;
|
||||
no-sd;
|
||||
non-removable;
|
||||
status = "okay";
|
||||
};
|
||||
@@ -536,8 +495,6 @@
|
||||
cap-mmc-highspeed;
|
||||
cap-sd-highspeed;
|
||||
disable-wp;
|
||||
no-sdio;
|
||||
no-mmc;
|
||||
sd-uhs-sdr104;
|
||||
vmmc-supply = <&vcc_3v3_s3>;
|
||||
vqmmc-supply = <&vccio_sd_s0>;
|
||||
@@ -879,8 +836,8 @@
|
||||
};
|
||||
|
||||
&tsadc {
|
||||
rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
|
||||
rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
|
||||
rockchip,hw-tshut-mode = <1>;
|
||||
rockchip,hw-tshut-polarity = <0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
@@ -898,7 +855,6 @@
|
||||
};
|
||||
|
||||
&u2phy2_host {
|
||||
/* connected to USB hub, which is powered by vcc_5v0 */
|
||||
phy-supply = <&vcc_5v0>;
|
||||
status = "okay";
|
||||
};
|
||||
@@ -941,18 +897,3 @@
|
||||
&usb_host2_xhci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&vop_mmu {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&vop {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&vp0 {
|
||||
vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
|
||||
reg = <ROCKCHIP_VOP2_EP_HDMI0>;
|
||||
remote-endpoint = <&hdmi0_in_vp0>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -528,28 +528,25 @@ define Device/radxa_rock-5c
|
||||
DEVICE_VENDOR := Radxa
|
||||
DEVICE_MODEL := ROCK 5C/5C Lite
|
||||
SOC := rk3588s
|
||||
UBOOT_DEVICE_NAME := evb-rk3588
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
|
||||
DEVICE_PACKAGES := blkdiscard block-mount kmod-ata-ahci kmod-hwmon-pwmfan kmod-nvme kmod-r8168 kmod-r8125 kmod-hwmon-pwmfan kmod-aic8800u wpad-openssl
|
||||
UBOOT_DEVICE_NAME := rock-5c-rk3588s
|
||||
DEVICE_PACKAGES := kmod-aic8800u wpad-openssl
|
||||
endef
|
||||
TARGET_DEVICES += radxa_rock-5c
|
||||
|
||||
define Device/radxa_zero-3e
|
||||
DEVICE_VENDOR := Radxa
|
||||
DEVICE_MODEL := ZERO 3E
|
||||
SOC := rk3566
|
||||
UBOOT_DEVICE_NAME := evb-rk3566
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
|
||||
DEVICE_DTS := rockchip/rk3566-radxa-zero-3e
|
||||
UBOOT_DEVICE_NAME := radxa-zero-3-rk3566
|
||||
endef
|
||||
TARGET_DEVICES += radxa_zero-3e
|
||||
|
||||
define Device/radxa_zero-3w
|
||||
DEVICE_VENDOR := Radxa
|
||||
DEVICE_MODEL := ZERO 3W
|
||||
SOC := rk3566
|
||||
UBOOT_DEVICE_NAME := evb-rk3566
|
||||
DEVICE_DTS := rockchip/rk3566-radxa-zero-3w
|
||||
DEVICE_PACKAGES := kmod-aic8800s wpad-openssl
|
||||
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
|
||||
UBOOT_DEVICE_NAME := radxa-zero-3-rk3566
|
||||
endef
|
||||
TARGET_DEVICES += radxa_zero-3w
|
||||
|
||||
|
||||
-444
@@ -1,444 +0,0 @@
|
||||
From 4294e32111781b3de4d73b944cbd1bc1662a9a7a Mon Sep 17 00:00:00 2001
|
||||
From: Sam Edwards <cfsworks@gmail.com>
|
||||
Date: Wed, 11 Sep 2024 19:50:30 -0700
|
||||
Subject: arm64: dts: rockchip: Split up RK3588's PCIe pinctrls
|
||||
|
||||
These pinctrls manage the low-speed PCIe signals:
|
||||
- CLKREQ#: An output on the RK3588 (both RC or EP modes), used to
|
||||
request that external clock-generation circuitry provide a clock.
|
||||
- PERST#: An input on the RK3588 in EP mode, used to detect a reset
|
||||
signal from the RC. In RC mode, the hardware does not use this signal:
|
||||
Linux itself generates it by putting the pin in GPIO mode.
|
||||
- WAKE#: In EP mode, this is an output; in RC mode, this is an input.
|
||||
|
||||
Each of these signals serves a distinct purpose, and more importantly,
|
||||
PERST# should not be muxed when the RK3588 is in the RC role. Bundling
|
||||
them together in pinctrl groups prevents proper use: indeed, almost none
|
||||
of the current board-specific .dts files make any use of them.
|
||||
(Exception: Rock 5A recently had a patch land that misuses _pins; this
|
||||
patch corrects that.)
|
||||
|
||||
However, on some RK3588 boards, the PCIe 3 controller will indefinitely
|
||||
stall the boot if CLKREQ# is not muxed (details in the next patch).
|
||||
This patch unbundles the signals to allow them to be used.
|
||||
|
||||
Signed-off-by: Sam Edwards <CFSworks@gmail.com>
|
||||
Link: https://lore.kernel.org/r/20240912025034.180233-2-CFSworks@gmail.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi
|
||||
@@ -1612,23 +1612,43 @@
|
||||
|
||||
pcie20x1 {
|
||||
/omit-if-no-ref/
|
||||
- pcie20x1m0_pins: pcie20x1m0-pins {
|
||||
+ pcie20x1m0_clkreqn: pcie20x1m0-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie20x1_2_clkreqn_m0 */
|
||||
- <3 RK_PC7 4 &pcfg_pull_none>,
|
||||
+ <3 RK_PC7 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie20x1m0_perstn: pcie20x1m0-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie20x1_2_perstn_m0 */
|
||||
- <3 RK_PD1 4 &pcfg_pull_none>,
|
||||
+ <3 RK_PD1 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie20x1m0_waken: pcie20x1m0-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie20x1_2_waken_m0 */
|
||||
<3 RK_PD0 4 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie20x1m1_pins: pcie20x1m1-pins {
|
||||
+ pcie20x1m1_clkreqn: pcie20x1m1-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie20x1_2_clkreqn_m1 */
|
||||
- <4 RK_PB7 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PB7 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie20x1m1_perstn: pcie20x1m1-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie20x1_2_perstn_m1 */
|
||||
- <4 RK_PC1 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PC1 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie20x1m1_waken: pcie20x1m1-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie20x1_2_waken_m1 */
|
||||
<4 RK_PC0 4 &pcfg_pull_none>;
|
||||
};
|
||||
@@ -1654,52 +1674,127 @@
|
||||
|
||||
pcie30x1 {
|
||||
/omit-if-no-ref/
|
||||
- pcie30x1m0_pins: pcie30x1m0-pins {
|
||||
+ pcie30x1m0_0_clkreqn: pcie30x1m0-0-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x1_0_clkreqn_m0 */
|
||||
- <0 RK_PC0 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PC0 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m0_0_perstn: pcie30x1m0-0-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_0_perstn_m0 */
|
||||
- <0 RK_PC5 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PC5 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m0_0_waken: pcie30x1m0-0-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_0_waken_m0 */
|
||||
- <0 RK_PC4 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PC4 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m0_1_clkreqn: pcie30x1m0-1-clkreqn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_clkreqn_m0 */
|
||||
- <0 RK_PB5 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PB5 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m0_1_perstn: pcie30x1m0-1-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_perstn_m0 */
|
||||
- <0 RK_PB7 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PB7 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m0_1_waken: pcie30x1m0-1-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_waken_m0 */
|
||||
<0 RK_PB6 12 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x1m1_pins: pcie30x1m1-pins {
|
||||
+ pcie30x1m1_0_clkreqn: pcie30x1m1-0-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x1_0_clkreqn_m1 */
|
||||
- <4 RK_PA3 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PA3 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m1_0_perstn: pcie30x1m1-0-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_0_perstn_m1 */
|
||||
- <4 RK_PA5 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PA5 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m1_0_waken: pcie30x1m1-0-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_0_waken_m1 */
|
||||
- <4 RK_PA4 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PA4 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m1_1_clkreqn: pcie30x1m1-1-clkreqn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_clkreqn_m1 */
|
||||
- <4 RK_PA0 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PA0 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m1_1_perstn: pcie30x1m1-1-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_perstn_m1 */
|
||||
- <4 RK_PA2 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PA2 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m1_1_waken: pcie30x1m1-1-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_waken_m1 */
|
||||
<4 RK_PA1 4 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x1m2_pins: pcie30x1m2-pins {
|
||||
+ pcie30x1m2_0_clkreqn: pcie30x1m2-0-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x1_0_clkreqn_m2 */
|
||||
- <1 RK_PB5 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PB5 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m2_0_perstn: pcie30x1m2-0-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_0_perstn_m2 */
|
||||
- <1 RK_PB4 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PB4 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m2_0_waken: pcie30x1m2-0-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_0_waken_m2 */
|
||||
- <1 RK_PB3 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PB3 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m2_1_clkreqn: pcie30x1m2-1-clkreqn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_clkreqn_m2 */
|
||||
- <1 RK_PA0 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PA0 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m2_1_perstn: pcie30x1m2-1-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_perstn_m2 */
|
||||
- <1 RK_PA7 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PA7 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x1m2_1_waken: pcie30x1m2-1-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x1_1_waken_m2 */
|
||||
<1 RK_PA1 4 &pcfg_pull_none>;
|
||||
};
|
||||
@@ -1721,45 +1816,85 @@
|
||||
|
||||
pcie30x2 {
|
||||
/omit-if-no-ref/
|
||||
- pcie30x2m0_pins: pcie30x2m0-pins {
|
||||
+ pcie30x2m0_clkreqn: pcie30x2m0-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x2_clkreqn_m0 */
|
||||
- <0 RK_PD1 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PD1 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m0_perstn: pcie30x2m0-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_perstn_m0 */
|
||||
- <0 RK_PD4 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PD4 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m0_waken: pcie30x2m0-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_waken_m0 */
|
||||
<0 RK_PD2 12 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x2m1_pins: pcie30x2m1-pins {
|
||||
+ pcie30x2m1_clkreqn: pcie30x2m1-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x2_clkreqn_m1 */
|
||||
- <4 RK_PA6 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PA6 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m1_perstn: pcie30x2m1-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_perstn_m1 */
|
||||
- <4 RK_PB0 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PB0 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m1_waken: pcie30x2m1-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_waken_m1 */
|
||||
<4 RK_PA7 4 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x2m2_pins: pcie30x2m2-pins {
|
||||
+ pcie30x2m2_clkreqn: pcie30x2m2-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x2_clkreqn_m2 */
|
||||
- <3 RK_PD2 4 &pcfg_pull_none>,
|
||||
+ <3 RK_PD2 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m2_perstn: pcie30x2m2-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_perstn_m2 */
|
||||
- <3 RK_PD4 4 &pcfg_pull_none>,
|
||||
+ <3 RK_PD4 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m2_waken: pcie30x2m2-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_waken_m2 */
|
||||
<3 RK_PD3 4 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x2m3_pins: pcie30x2m3-pins {
|
||||
+ pcie30x2m3_clkreqn: pcie30x2m3-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x2_clkreqn_m3 */
|
||||
- <1 RK_PD7 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PD7 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m3_perstn: pcie30x2m3-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_perstn_m3 */
|
||||
- <1 RK_PB7 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PB7 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x2m3_waken: pcie30x2m3-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x2_waken_m3 */
|
||||
<1 RK_PB6 4 &pcfg_pull_none>;
|
||||
};
|
||||
@@ -1774,45 +1909,85 @@
|
||||
|
||||
pcie30x4 {
|
||||
/omit-if-no-ref/
|
||||
- pcie30x4m0_pins: pcie30x4m0-pins {
|
||||
+ pcie30x4m0_clkreqn: pcie30x4m0-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x4_clkreqn_m0 */
|
||||
- <0 RK_PC6 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PC6 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m0_perstn: pcie30x4m0-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_perstn_m0 */
|
||||
- <0 RK_PD0 12 &pcfg_pull_none>,
|
||||
+ <0 RK_PD0 12 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m0_waken: pcie30x4m0-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_waken_m0 */
|
||||
<0 RK_PC7 12 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x4m1_pins: pcie30x4m1-pins {
|
||||
+ pcie30x4m1_clkreqn: pcie30x4m1-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x4_clkreqn_m1 */
|
||||
- <4 RK_PB4 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PB4 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m1_perstn: pcie30x4m1-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_perstn_m1 */
|
||||
- <4 RK_PB6 4 &pcfg_pull_none>,
|
||||
+ <4 RK_PB6 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m1_waken: pcie30x4m1-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_waken_m1 */
|
||||
<4 RK_PB5 4 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x4m2_pins: pcie30x4m2-pins {
|
||||
+ pcie30x4m2_clkreqn: pcie30x4m2-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x4_clkreqn_m2 */
|
||||
- <3 RK_PC4 4 &pcfg_pull_none>,
|
||||
+ <3 RK_PC4 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m2_perstn: pcie30x4m2-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_perstn_m2 */
|
||||
- <3 RK_PC6 4 &pcfg_pull_none>,
|
||||
+ <3 RK_PC6 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m2_waken: pcie30x4m2-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_waken_m2 */
|
||||
<3 RK_PC5 4 &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
/omit-if-no-ref/
|
||||
- pcie30x4m3_pins: pcie30x4m3-pins {
|
||||
+ pcie30x4m3_clkreqn: pcie30x4m3-clkreqn {
|
||||
rockchip,pins =
|
||||
/* pcie30x4_clkreqn_m3 */
|
||||
- <1 RK_PB0 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PB0 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m3_perstn: pcie30x4m3-perstn {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_perstn_m3 */
|
||||
- <1 RK_PB2 4 &pcfg_pull_none>,
|
||||
+ <1 RK_PB2 4 &pcfg_pull_none>;
|
||||
+ };
|
||||
+
|
||||
+ /omit-if-no-ref/
|
||||
+ pcie30x4m3_waken: pcie30x4m3-waken {
|
||||
+ rockchip,pins =
|
||||
/* pcie30x4_waken_m3 */
|
||||
<1 RK_PB1 4 &pcfg_pull_none>;
|
||||
};
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
|
||||
@@ -310,7 +310,7 @@
|
||||
};
|
||||
|
||||
&pcie2x1l2 {
|
||||
- pinctrl-0 = <&pcie20x1m0_pins>;
|
||||
+ pinctrl-0 = <&pcie2_reset>, <&pcie20x1m0_clkreqn>, <&pcie20x1m0_waken>;
|
||||
pinctrl-names = "default";
|
||||
reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
|
||||
vpcie3v3-supply = <&vcc3v3_wf>;
|
||||
@@ -328,6 +328,10 @@
|
||||
pow_en: pow-en {
|
||||
rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
+
|
||||
+ pcie2_reset: pcie2-reset {
|
||||
+ rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
+ };
|
||||
};
|
||||
|
||||
power {
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
From d7bb71e69f58c1b3665a9f926bf8d3855111bf8e Mon Sep 17 00:00:00 2001
|
||||
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Date: Sat, 19 Oct 2024 13:12:10 +0300
|
||||
Subject: arm64: dts: rockchip: Add HDMI0 node to rk3588
|
||||
|
||||
Add support for the HDMI0 output port found on RK3588 SoC.
|
||||
|
||||
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20241019-rk3588-hdmi0-dt-v2-1-466cd80e8ff9@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1369,6 +1369,47 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ hdmi0: hdmi@fde80000 {
|
||||
+ compatible = "rockchip,rk3588-dw-hdmi-qp";
|
||||
+ reg = <0x0 0xfde80000 0x0 0x20000>;
|
||||
+ clocks = <&cru PCLK_HDMITX0>,
|
||||
+ <&cru CLK_HDMITX0_EARC>,
|
||||
+ <&cru CLK_HDMITX0_REF>,
|
||||
+ <&cru MCLK_I2S5_8CH_TX>,
|
||||
+ <&cru CLK_HDMIHDP0>,
|
||||
+ <&cru HCLK_VO1>;
|
||||
+ clock-names = "pclk", "earc", "ref", "aud", "hdp", "hclk_vo1";
|
||||
+ interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
+ interrupt-names = "avp", "cec", "earc", "main", "hpd";
|
||||
+ phys = <&hdptxphy_hdmi0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&hdmim0_tx0_cec &hdmim0_tx0_hpd
|
||||
+ &hdmim0_tx0_scl &hdmim0_tx0_sda>;
|
||||
+ power-domains = <&power RK3588_PD_VO1>;
|
||||
+ resets = <&cru SRST_HDMITX0_REF>, <&cru SRST_HDMIHDP0>;
|
||||
+ reset-names = "ref", "hdp";
|
||||
+ rockchip,grf = <&sys_grf>;
|
||||
+ rockchip,vo-grf = <&vo1_grf>;
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ ports {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ hdmi0_in: port@0 {
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+
|
||||
+ hdmi0_out: port@1 {
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
qos_gpu_m0: qos@fdf35000 {
|
||||
compatible = "rockchip,rk3588-qos", "syscon";
|
||||
reg = <0x0 0xfdf35000 0x0 0x20>;
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
From 33b561eb66f1e271f2899e103c857d20425076f4 Mon Sep 17 00:00:00 2001
|
||||
From: Dragan Simic <dsimic@manjaro.org>
|
||||
Date: Wed, 8 Jan 2025 05:26:45 +0100
|
||||
Subject: arm64: dts: rockchip: Use "dma-noncoherent" in base RK3588 SoC dtsi
|
||||
|
||||
The preferred way to denote hardware with non-coherent DMA is to use the
|
||||
"dma-noncoherent" DT property, at both the GIC redistributor and the GIC ITS
|
||||
levels, [1] instead of relying on the compatibles to handle hardware errata,
|
||||
in this case the Rockchip 3588001 errata. [2]
|
||||
|
||||
Let's have the preferred way employed in the base Rockchip RK3588 SoC dtsi,
|
||||
which also goes along with adding initial support for the Rockchip RK3582 SoC
|
||||
variant, with its separate compatible. [2][3]
|
||||
|
||||
[1] Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
|
||||
[2] https://lore.kernel.org/linux-rockchip/86msgoozqa.wl-maz@kernel.org/
|
||||
[3] https://lore.kernel.org/linux-rockchip/20241222030355.2246-4-naoki@radxa.com/
|
||||
|
||||
Cc: Marc Zyngier <maz@kernel.org>
|
||||
Cc: FUKAUMI Naoki <naoki@radxa.com>
|
||||
Acked-by: Marc Zyngier <maz@kernel.org>
|
||||
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
|
||||
Link: https://lore.kernel.org/r/fa1a672dae3644bb3caa58f03216d0ca349db88b.1736279094.git.dsimic@manjaro.org
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -2020,6 +2020,7 @@
|
||||
<0x0 0xfe680000 0 0x100000>; /* GICR */
|
||||
interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
interrupt-controller;
|
||||
+ dma-noncoherent;
|
||||
mbi-alias = <0x0 0xfe610000>;
|
||||
mbi-ranges = <424 56>;
|
||||
msi-controller;
|
||||
@@ -2031,6 +2032,7 @@
|
||||
its0: msi-controller@fe640000 {
|
||||
compatible = "arm,gic-v3-its";
|
||||
reg = <0x0 0xfe640000 0x0 0x20000>;
|
||||
+ dma-noncoherent;
|
||||
msi-controller;
|
||||
#msi-cells = <1>;
|
||||
};
|
||||
@@ -2038,6 +2040,7 @@
|
||||
its1: msi-controller@fe660000 {
|
||||
compatible = "arm,gic-v3-its";
|
||||
reg = <0x0 0xfe660000 0x0 0x20000>;
|
||||
+ dma-noncoherent;
|
||||
msi-controller;
|
||||
#msi-cells = <1>;
|
||||
};
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
From d0f17738778c12be629ba77ff00c43c3e9eb8428 Mon Sep 17 00:00:00 2001
|
||||
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Date: Tue, 4 Feb 2025 14:40:07 +0200
|
||||
Subject: arm64: dts: rockchip: Enable HDMI0 PHY clk provider on RK3588
|
||||
|
||||
Since commit c4b09c562086 ("phy: phy-rockchip-samsung-hdptx: Add clock
|
||||
provider support"), the HDMI PHY PLL can be used as an alternative and
|
||||
more accurate pixel clock source for VOP2 to improve display modes
|
||||
handling on RK3588 SoC.
|
||||
|
||||
Add the missing #clock-cells property to allow using the clock provider
|
||||
functionality of HDMI0 PHY.
|
||||
|
||||
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Tested-by: FUKAUMI Naoki <naoki@radxa.com>
|
||||
Link: https://lore.kernel.org/r/20250204-vop2-hdmi0-disp-modes-v3-4-d71c6a196e58@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -2813,6 +2813,7 @@
|
||||
reg = <0x0 0xfed60000 0x0 0x2000>;
|
||||
clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>, <&cru PCLK_HDPTX0>;
|
||||
clock-names = "ref", "apb";
|
||||
+ #clock-cells = <0>;
|
||||
#phy-cells = <0>;
|
||||
resets = <&cru SRST_HDPTX0>, <&cru SRST_P_HDPTX0>,
|
||||
<&cru SRST_HDPTX0_INIT>, <&cru SRST_HDPTX0_CMN>,
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
From eb4262203d7d85eb7b6f2696816db272e41f5464 Mon Sep 17 00:00:00 2001
|
||||
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Date: Tue, 4 Feb 2025 14:40:08 +0200
|
||||
Subject: arm64: dts: rockchip: Add HDMI0 PHY PLL clock source to VOP2 on
|
||||
RK3588
|
||||
|
||||
VOP2 on RK3588 is able to use the HDMI PHY PLL as an alternative and
|
||||
more accurate pixel clock source to improve handling of display modes up
|
||||
to 4K@60Hz on video ports 0, 1 and 2.
|
||||
|
||||
For now only HDMI0 output is supported, hence add the related PLL clock.
|
||||
|
||||
Tested-by: FUKAUMI Naoki <naoki@radxa.com>
|
||||
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20250204-vop2-hdmi0-disp-modes-v3-5-d71c6a196e58@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1261,14 +1261,16 @@
|
||||
<&cru DCLK_VOP1>,
|
||||
<&cru DCLK_VOP2>,
|
||||
<&cru DCLK_VOP3>,
|
||||
- <&cru PCLK_VOP_ROOT>;
|
||||
+ <&cru PCLK_VOP_ROOT>,
|
||||
+ <&hdptxphy_hdmi0>;
|
||||
clock-names = "aclk",
|
||||
"hclk",
|
||||
"dclk_vp0",
|
||||
"dclk_vp1",
|
||||
"dclk_vp2",
|
||||
"dclk_vp3",
|
||||
- "pclk_vop";
|
||||
+ "pclk_vop",
|
||||
+ "pll_hdmiphy0";
|
||||
iommus = <&vop_mmu>;
|
||||
power-domains = <&power RK3588_PD_VOP>;
|
||||
rockchip,grf = <&sys_grf>;
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
From 2efdb041019fd6c58abefba3eb6fdc4d659e576c Mon Sep 17 00:00:00 2001
|
||||
From: Damon Ding <damon.ding@rock-chips.com>
|
||||
Date: Thu, 6 Feb 2025 11:03:30 +0800
|
||||
Subject: arm64: dts: rockchip: Fix label name of hdptxphy for RK3588
|
||||
|
||||
The hdptxphy is a combo transmit-PHY for HDMI2.1 TMDS Link, FRL Link, DP
|
||||
and eDP Link. Therefore, it is better to name it hdptxphy0 other than
|
||||
hdptxphy_hdmi0, which will be referenced by both hdmi0 and edp0 nodes.
|
||||
|
||||
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
|
||||
Link: https://lore.kernel.org/r/20250206030330.680424-3-damon.ding@rock-chips.com
|
||||
[added armsom-sige7, where hdmi-support was added recently and also
|
||||
the hdptxphy0-as-dclk source I just added]
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1262,7 +1262,7 @@
|
||||
<&cru DCLK_VOP2>,
|
||||
<&cru DCLK_VOP3>,
|
||||
<&cru PCLK_VOP_ROOT>,
|
||||
- <&hdptxphy_hdmi0>;
|
||||
+ <&hdptxphy0>;
|
||||
clock-names = "aclk",
|
||||
"hclk",
|
||||
"dclk_vp0",
|
||||
@@ -1387,7 +1387,7 @@
|
||||
<GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
<GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
interrupt-names = "avp", "cec", "earc", "main", "hpd";
|
||||
- phys = <&hdptxphy_hdmi0>;
|
||||
+ phys = <&hdptxphy0>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hdmim0_tx0_cec &hdmim0_tx0_hpd
|
||||
&hdmim0_tx0_scl &hdmim0_tx0_sda>;
|
||||
@@ -2810,7 +2810,7 @@
|
||||
#dma-cells = <1>;
|
||||
};
|
||||
|
||||
- hdptxphy_hdmi0: phy@fed60000 {
|
||||
+ hdptxphy0: phy@fed60000 {
|
||||
compatible = "rockchip,rk3588-hdptx-phy";
|
||||
reg = <0x0 0xfed60000 0x0 0x2000>;
|
||||
clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>, <&cru PCLK_HDPTX0>;
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
From ea97212a0f66b7bd71c23c12f781f1770dd6fcff Mon Sep 17 00:00:00 2001
|
||||
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Date: Wed, 11 Dec 2024 01:06:15 +0200
|
||||
Subject: arm64: dts: rockchip: Add PHY node for HDMI1 TX port on RK3588
|
||||
|
||||
In preparation to enable the second HDMI output port found on RK3588
|
||||
SoC, add the related PHY node. This requires a GRF, hence add the
|
||||
dependent node as well.
|
||||
|
||||
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Tested-by: Jagan Teki <jagan@edgeble.ai> # edgeble-6tops-modules
|
||||
Tested-by: Alexandre ARNOUD <aarnoud@me.com>
|
||||
Link: https://lore.kernel.org/r/20241211-rk3588-hdmi1-v2-2-02cdca22ff68@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
@@ -67,6 +67,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ hdptxphy1_grf: syscon@fd5e4000 {
|
||||
+ compatible = "rockchip,rk3588-hdptxphy-grf", "syscon";
|
||||
+ reg = <0x0 0xfd5e4000 0x0 0x100>;
|
||||
+ };
|
||||
+
|
||||
i2s8_8ch: i2s@fddc8000 {
|
||||
compatible = "rockchip,rk3588-i2s-tdm";
|
||||
reg = <0x0 0xfddc8000 0x0 0x1000>;
|
||||
@@ -395,6 +400,22 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ hdptxphy1: phy@fed70000 {
|
||||
+ compatible = "rockchip,rk3588-hdptx-phy";
|
||||
+ reg = <0x0 0xfed70000 0x0 0x2000>;
|
||||
+ clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>, <&cru PCLK_HDPTX1>;
|
||||
+ clock-names = "ref", "apb";
|
||||
+ #phy-cells = <0>;
|
||||
+ resets = <&cru SRST_HDPTX1>, <&cru SRST_P_HDPTX1>,
|
||||
+ <&cru SRST_HDPTX1_INIT>, <&cru SRST_HDPTX1_CMN>,
|
||||
+ <&cru SRST_HDPTX1_LANE>, <&cru SRST_HDPTX1_ROPLL>,
|
||||
+ <&cru SRST_HDPTX1_LCPLL>;
|
||||
+ reset-names = "phy", "apb", "init", "cmn", "lane", "ropll",
|
||||
+ "lcpll";
|
||||
+ rockchip,grf = <&hdptxphy1_grf>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
usbdp_phy1: phy@fed90000 {
|
||||
compatible = "rockchip,rk3588-usbdp-phy";
|
||||
reg = <0x0 0xfed90000 0x0 0x10000>;
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
From bed6964e779b5853de042da14320edf9f79506fe Mon Sep 17 00:00:00 2001
|
||||
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Date: Wed, 11 Dec 2024 01:06:16 +0200
|
||||
Subject: arm64: dts: rockchip: Add HDMI1 node on RK3588
|
||||
|
||||
Add support for the second HDMI TX port found on RK3588 SoC.
|
||||
|
||||
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Tested-by: Jagan Teki <jagan@edgeble.ai> # edgeble-6tops-modules
|
||||
Tested-by: Alexandre ARNOUD <aarnoud@me.com>
|
||||
Link: https://lore.kernel.org/r/20241211-rk3588-hdmi1-v2-3-02cdca22ff68@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
@@ -140,6 +140,47 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ hdmi1: hdmi@fdea0000 {
|
||||
+ compatible = "rockchip,rk3588-dw-hdmi-qp";
|
||||
+ reg = <0x0 0xfdea0000 0x0 0x20000>;
|
||||
+ clocks = <&cru PCLK_HDMITX1>,
|
||||
+ <&cru CLK_HDMITX1_EARC>,
|
||||
+ <&cru CLK_HDMITX1_REF>,
|
||||
+ <&cru MCLK_I2S6_8CH_TX>,
|
||||
+ <&cru CLK_HDMIHDP1>,
|
||||
+ <&cru HCLK_VO1>;
|
||||
+ clock-names = "pclk", "earc", "ref", "aud", "hdp", "hclk_vo1";
|
||||
+ interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
+ interrupt-names = "avp", "cec", "earc", "main", "hpd";
|
||||
+ phys = <&hdptxphy1>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&hdmim2_tx1_cec &hdmim0_tx1_hpd
|
||||
+ &hdmim1_tx1_scl &hdmim1_tx1_sda>;
|
||||
+ power-domains = <&power RK3588_PD_VO1>;
|
||||
+ resets = <&cru SRST_HDMITX1_REF>, <&cru SRST_HDMIHDP1>;
|
||||
+ reset-names = "ref", "hdp";
|
||||
+ rockchip,grf = <&sys_grf>;
|
||||
+ rockchip,vo-grf = <&vo1_grf>;
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ ports {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ hdmi1_in: port@0 {
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+
|
||||
+ hdmi1_out: port@1 {
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
pcie3x4: pcie@fe150000 {
|
||||
compatible = "rockchip,rk3588-pcie", "rockchip,rk3568-pcie";
|
||||
#address-cells = <3>;
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
From aadaa27956e3430217d9e6b8af5880e39b05b961 Mon Sep 17 00:00:00 2001
|
||||
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Date: Sun, 23 Feb 2025 11:31:39 +0200
|
||||
Subject: arm64: dts: rockchip: Enable HDMI1 PHY clk provider on RK3588
|
||||
|
||||
Since commit c4b09c562086 ("phy: phy-rockchip-samsung-hdptx: Add clock
|
||||
provider support"), the HDMI PHY PLL can be used as an alternative and
|
||||
more accurate pixel clock source for VOP2 to improve display modes
|
||||
handling on RK3588 SoC.
|
||||
|
||||
Add the missing #clock-cells property to allow using the clock provider
|
||||
functionality of HDMI1 PHY.
|
||||
|
||||
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20250223-vop2-hdmi1-disp-modes-v2-3-f4cec5e06fbe@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
@@ -446,6 +446,7 @@
|
||||
reg = <0x0 0xfed70000 0x0 0x2000>;
|
||||
clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>, <&cru PCLK_HDPTX1>;
|
||||
clock-names = "ref", "apb";
|
||||
+ #clock-cells = <0>;
|
||||
#phy-cells = <0>;
|
||||
resets = <&cru SRST_HDPTX1>, <&cru SRST_P_HDPTX1>,
|
||||
<&cru SRST_HDPTX1_INIT>, <&cru SRST_HDPTX1_CMN>,
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
From b2e668a60ed866ba960acb5310d1fb6bf81d154f Mon Sep 17 00:00:00 2001
|
||||
From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Date: Sun, 23 Feb 2025 11:31:40 +0200
|
||||
Subject: arm64: dts: rockchip: Add HDMI1 PHY PLL clock source to VOP2 on
|
||||
RK3588
|
||||
|
||||
VOP2 on RK3588 is able to use the HDMI PHY PLL as an alternative and
|
||||
more accurate pixel clock source to improve handling of display modes up
|
||||
to 4K@60Hz on video ports 0, 1 and 2.
|
||||
|
||||
The HDMI1 PHY PLL clock source cannot be added directly to vop node in
|
||||
rk3588-base.dtsi, along with the HDMI0 related one, because HDMI1 is an
|
||||
optional feature and its PHY node belongs to a separate (extra) DT file.
|
||||
|
||||
Therefore, add the HDMI1 PHY PLL clock source to VOP2 by overwriting its
|
||||
clocks & clock-names properties in the extra DT file.
|
||||
|
||||
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20250223-vop2-hdmi1-disp-modes-v2-4-f4cec5e06fbe@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
@@ -509,3 +509,24 @@
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
+
|
||||
+&vop {
|
||||
+ clocks = <&cru ACLK_VOP>,
|
||||
+ <&cru HCLK_VOP>,
|
||||
+ <&cru DCLK_VOP0>,
|
||||
+ <&cru DCLK_VOP1>,
|
||||
+ <&cru DCLK_VOP2>,
|
||||
+ <&cru DCLK_VOP3>,
|
||||
+ <&cru PCLK_VOP_ROOT>,
|
||||
+ <&hdptxphy0>,
|
||||
+ <&hdptxphy1>;
|
||||
+ clock-names = "aclk",
|
||||
+ "hclk",
|
||||
+ "dclk_vp0",
|
||||
+ "dclk_vp1",
|
||||
+ "dclk_vp2",
|
||||
+ "dclk_vp3",
|
||||
+ "pclk_vop",
|
||||
+ "pll_hdmiphy0",
|
||||
+ "pll_hdmiphy1";
|
||||
+};
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
From 6ee0b9ad3995ee5fa229035c69013b7dd0d3634b Mon Sep 17 00:00:00 2001
|
||||
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
|
||||
Date: Tue, 4 Feb 2025 16:35:51 +0100
|
||||
Subject: [PATCH] arm64: dts: rockchip: Add rng node to RK3588
|
||||
|
||||
Add the RK3588's standalone hardware random number generator node to its
|
||||
device tree, and enable it.
|
||||
|
||||
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20250204-rk3588-trng-submission-v2-6-608172b6fd91@collabora.com
|
||||
[changed reset-id to its numeric value while the constant makes its
|
||||
way through the crypto tree]
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1921,6 +1921,14 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ rng@fe378000 {
|
||||
+ compatible = "rockchip,rk3588-rng";
|
||||
+ reg = <0x0 0xfe378000 0x0 0x200>;
|
||||
+ interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
+ clocks = <&scmi_clk SCMI_HCLK_SECURE_NS>;
|
||||
+ resets = <&scmi_reset 48>;
|
||||
+ };
|
||||
+
|
||||
i2s0_8ch: i2s@fe470000 {
|
||||
compatible = "rockchip,rk3588-i2s-tdm";
|
||||
reg = <0x0 0xfe470000 0x0 0x1000>;
|
||||
-91
@@ -1,91 +0,0 @@
|
||||
From b8c6c136971c0e9750eec89f367529b2854d3a3c Mon Sep 17 00:00:00 2001
|
||||
From: Detlev Casanova <detlev.casanova@collabora.com>
|
||||
Date: Mon, 17 Feb 2025 16:47:41 -0500
|
||||
Subject: arm64: dts: rockchip: Add HDMI audio outputs for rk3588
|
||||
|
||||
For hdmi0_sound, use the simple-audio-card driver with the hdmi0 QP node
|
||||
as CODEC and the i2s5 device as CPU.
|
||||
|
||||
Similarly for hdmi1_sound, the CODEC is the hdmi1 node and the CPU is
|
||||
i2s6, but only added in the rk3588-extra.dtsi device tree as the second
|
||||
TX HDMI port is not available on base versions of the SoC.
|
||||
|
||||
The simple-audio-card,mclk-fs value is set to 128 as it is done in
|
||||
the downstream driver.
|
||||
|
||||
The #sound-dai-cells value is set to 0 in the hdmi0 and hdmi1 nodes so
|
||||
that they can be used as audio codec nodes.
|
||||
|
||||
Tested-by: Quentin Schulz <quentin.schulz@cherry.de> # RK3588 Tiger Haikou
|
||||
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
|
||||
Fixes: 419d1918105e ("ASoC: simple-card-utils: use __free(device_node) for device node")
|
||||
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
||||
Link: https://lore.kernel.org/r/20250217215641.372723-3-detlev.casanova@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -382,6 +382,22 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ hdmi0_sound: hdmi0-sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,mclk-fs = <128>;
|
||||
+ simple-audio-card,name = "hdmi0";
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&hdmi0>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s5_8ch>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
pmu-a55 {
|
||||
compatible = "arm,cortex-a55-pmu";
|
||||
interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH &ppi_partition0>;
|
||||
@@ -1396,6 +1412,7 @@
|
||||
reset-names = "ref", "hdp";
|
||||
rockchip,grf = <&sys_grf>;
|
||||
rockchip,vo-grf = <&vo1_grf>;
|
||||
+ #sound-dai-cells = <0>;
|
||||
status = "disabled";
|
||||
|
||||
ports {
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
@@ -7,6 +7,22 @@
|
||||
#include "rk3588-extra-pinctrl.dtsi"
|
||||
|
||||
/ {
|
||||
+ hdmi1_sound: hdmi1-sound {
|
||||
+ compatible = "simple-audio-card";
|
||||
+ simple-audio-card,format = "i2s";
|
||||
+ simple-audio-card,mclk-fs = <128>;
|
||||
+ simple-audio-card,name = "hdmi1";
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ simple-audio-card,codec {
|
||||
+ sound-dai = <&hdmi1>;
|
||||
+ };
|
||||
+
|
||||
+ simple-audio-card,cpu {
|
||||
+ sound-dai = <&i2s6_8ch>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
usb_host1_xhci: usb@fc400000 {
|
||||
compatible = "rockchip,rk3588-dwc3", "snps,dwc3";
|
||||
reg = <0x0 0xfc400000 0x0 0x400000>;
|
||||
@@ -165,6 +181,7 @@
|
||||
reset-names = "ref", "hdp";
|
||||
rockchip,grf = <&sys_grf>;
|
||||
rockchip,vo-grf = <&vo1_grf>;
|
||||
+ #sound-dai-cells = <0>;
|
||||
status = "disabled";
|
||||
|
||||
ports {
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
From f94500eb7328b35f3d0927635b1aba26c85ea4b0 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Date: Thu, 20 Feb 2025 19:58:11 +0100
|
||||
Subject: arm64: dts: rockchip: Add GPU power domain regulator dependency for
|
||||
RK3588
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Enabling the GPU power domain requires that the GPU regulator is
|
||||
enabled. The regulator is enabled at boot time, but gets disabled
|
||||
automatically when there are no users.
|
||||
|
||||
This means the system might run into a failure state hanging the
|
||||
whole system for the following use cases:
|
||||
|
||||
* if the GPU driver is being probed late (e.g. build as a
|
||||
module and firmware is not in initramfs), the regulator
|
||||
might already have been disabled. In that case the power
|
||||
domain is enabled before the regulator.
|
||||
* unbinding the GPU driver will disable the PM domain and
|
||||
the regulator. When the driver is bound again, the PM
|
||||
domain will be enabled before the regulator and error
|
||||
appears.
|
||||
|
||||
Avoid this by adding an explicit regulator dependency to the
|
||||
power domain.
|
||||
|
||||
Tested-by: Heiko Stuebner <heiko@sntech.de>
|
||||
Reported-by: Adrián Martínez Larumbe <adrian.larumbe@collabora.com>
|
||||
Tested-by: Adrian Larumbe <adrian.larumbe@collabora.com> # On Rock 5B
|
||||
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20250220-rk3588-gpu-pwr-domain-regulator-v6-8-a4f9c24e5b81@kernel.org
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -880,7 +880,7 @@
|
||||
};
|
||||
};
|
||||
/* These power domains are grouped by VD_GPU */
|
||||
- power-domain@RK3588_PD_GPU {
|
||||
+ pd_gpu: power-domain@RK3588_PD_GPU {
|
||||
reg = <RK3588_PD_GPU>;
|
||||
clocks = <&cru CLK_GPU>,
|
||||
<&cru CLK_GPU_COREGROUP>,
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
From 55a43c346d24434e46ef7fcc09a9df8179c346e4 Mon Sep 17 00:00:00 2001
|
||||
From: Heiko Stuebner <heiko@sntech.de>
|
||||
Date: Sun, 16 Feb 2025 16:27:42 +0100
|
||||
Subject: [PATCH] arm64: dts: rockchip: change rng reset id back to its
|
||||
constant value
|
||||
|
||||
With the binding header now providing the SCMI_SRST_H_TRNG_NS constant,
|
||||
switch back to it from the temporary numeric value.
|
||||
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
---
|
||||
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1943,7 +1943,7 @@
|
||||
reg = <0x0 0xfe378000 0x0 0x200>;
|
||||
interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
clocks = <&scmi_clk SCMI_HCLK_SECURE_NS>;
|
||||
- resets = <&scmi_reset 48>;
|
||||
+ resets = <&scmi_reset SCMI_SRST_H_TRNG_NS>;
|
||||
};
|
||||
|
||||
i2s0_8ch: i2s@fe470000 {
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
From 0327238991ba2d1de25e1116b1c064f433e45b8d Mon Sep 17 00:00:00 2001
|
||||
From: Shreeya Patel <shreeya.patel@collabora.com>
|
||||
Date: Fri, 7 Mar 2025 12:18:56 +0300
|
||||
Subject: arm64: dts: rockchip: Add device tree support for HDMI RX Controller
|
||||
|
||||
Add device tree support for Synopsys DesignWare HDMI RX
|
||||
Controller.
|
||||
|
||||
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
|
||||
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
|
||||
Co-developed-by: Dingxian Wen <shawn.wen@rock-chips.com>
|
||||
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
|
||||
Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com>
|
||||
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
|
||||
Link: https://lore.kernel.org/r/20250307091857.646581-2-dmitry.osipenko@collabora.com
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
|
||||
@@ -23,6 +23,30 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ reserved-memory {
|
||||
+ #address-cells = <2>;
|
||||
+ #size-cells = <2>;
|
||||
+ ranges;
|
||||
+
|
||||
+ /*
|
||||
+ * The 4k HDMI capture controller works only with 32bit
|
||||
+ * phys addresses and doesn't support IOMMU. HDMI RX CMA
|
||||
+ * must be reserved below 4GB.
|
||||
+ * The size of 160MB was determined as follows:
|
||||
+ * (3840 * 2160 pixels) * (4 bytes/pixel) * (2 frames/buffer) / 10^6 = 66MB
|
||||
+ * To ensure sufficient support for practical use-cases,
|
||||
+ * we doubled the 66MB value.
|
||||
+ */
|
||||
+ hdmi_receiver_cma: hdmi-receiver-cma {
|
||||
+ compatible = "shared-dma-pool";
|
||||
+ alloc-ranges = <0x0 0x0 0x0 0xffffffff>;
|
||||
+ size = <0x0 (160 * 0x100000)>; /* 160MiB */
|
||||
+ alignment = <0x0 0x40000>; /* 64K */
|
||||
+ no-map;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
usb_host1_xhci: usb@fc400000 {
|
||||
compatible = "rockchip,rk3588-dwc3", "snps,dwc3";
|
||||
reg = <0x0 0xfc400000 0x0 0x400000>;
|
||||
@@ -198,6 +222,37 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ hdmi_receiver: hdmi_receiver@fdee0000 {
|
||||
+ compatible = "rockchip,rk3588-hdmirx-ctrler", "snps,dw-hdmi-rx";
|
||||
+ reg = <0x0 0xfdee0000 0x0 0x6000>;
|
||||
+ interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH 0>,
|
||||
+ <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
+ interrupt-names = "cec", "hdmi", "dma";
|
||||
+ clocks = <&cru ACLK_HDMIRX>,
|
||||
+ <&cru CLK_HDMIRX_AUD>,
|
||||
+ <&cru CLK_CR_PARA>,
|
||||
+ <&cru PCLK_HDMIRX>,
|
||||
+ <&cru CLK_HDMIRX_REF>,
|
||||
+ <&cru PCLK_S_HDMIRX>,
|
||||
+ <&cru HCLK_VO1>;
|
||||
+ clock-names = "aclk",
|
||||
+ "audio",
|
||||
+ "cr_para",
|
||||
+ "pclk",
|
||||
+ "ref",
|
||||
+ "hclk_s_hdmirx",
|
||||
+ "hclk_vo1";
|
||||
+ memory-region = <&hdmi_receiver_cma>;
|
||||
+ power-domains = <&power RK3588_PD_VO1>;
|
||||
+ resets = <&cru SRST_A_HDMIRX>, <&cru SRST_P_HDMIRX>,
|
||||
+ <&cru SRST_HDMIRX_REF>, <&cru SRST_A_HDMIRX_BIU>;
|
||||
+ reset-names = "axi", "apb", "ref", "biu";
|
||||
+ rockchip,grf = <&sys_grf>;
|
||||
+ rockchip,vo1-grf = <&vo1_grf>;
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+
|
||||
pcie3x4: pcie@fe150000 {
|
||||
compatible = "rockchip,rk3588-pcie", "rockchip,rk3568-pcie";
|
||||
#address-cells = <3>;
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
From 849d9db170fc8a03ce9f64133a1d0cd46c135105 Mon Sep 17 00:00:00 2001
|
||||
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
|
||||
Date: Tue, 4 Feb 2025 16:35:46 +0100
|
||||
Subject: [PATCH] dt-bindings: reset: Add SCMI reset IDs for RK3588
|
||||
|
||||
When TF-A is used to assert/deassert the resets through SCMI, the
|
||||
IDs communicated to it are different than the ones mainline Linux uses.
|
||||
|
||||
Import the list of SCMI reset IDs from mainline TF-A so that devicetrees
|
||||
can use these IDs more easily.
|
||||
|
||||
Co-developed-by: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
|
||||
Acked-by: Conor Dooley <conor.dooley@microchip.com>
|
||||
Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
|
||||
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
||||
---
|
||||
.../dt-bindings/reset/rockchip,rk3588-cru.h | 41 ++++++++++++++++++-
|
||||
1 file changed, 40 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/include/dt-bindings/reset/rockchip,rk3588-cru.h
|
||||
+++ b/include/dt-bindings/reset/rockchip,rk3588-cru.h
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
|
||||
/*
|
||||
- * Copyright (c) 2021 Rockchip Electronics Co. Ltd.
|
||||
+ * Copyright (c) 2021, 2024 Rockchip Electronics Co. Ltd.
|
||||
* Copyright (c) 2022 Collabora Ltd.
|
||||
*
|
||||
* Author: Elaine Zhang <zhangqing@rock-chips.com>
|
||||
@@ -753,4 +753,43 @@
|
||||
|
||||
#define SRST_A_HDMIRX_BIU 660
|
||||
|
||||
+/* SCMI Secure Resets */
|
||||
+
|
||||
+/* Name=SECURE_SOFTRST_CON00,Offset=0xA00 */
|
||||
+#define SCMI_SRST_A_SECURE_NS_BIU 10
|
||||
+#define SCMI_SRST_H_SECURE_NS_BIU 11
|
||||
+#define SCMI_SRST_A_SECURE_S_BIU 12
|
||||
+#define SCMI_SRST_H_SECURE_S_BIU 13
|
||||
+#define SCMI_SRST_P_SECURE_S_BIU 14
|
||||
+#define SCMI_SRST_CRYPTO_CORE 15
|
||||
+/* Name=SECURE_SOFTRST_CON01,Offset=0xA04 */
|
||||
+#define SCMI_SRST_CRYPTO_PKA 16
|
||||
+#define SCMI_SRST_CRYPTO_RNG 17
|
||||
+#define SCMI_SRST_A_CRYPTO 18
|
||||
+#define SCMI_SRST_H_CRYPTO 19
|
||||
+#define SCMI_SRST_KEYLADDER_CORE 25
|
||||
+#define SCMI_SRST_KEYLADDER_RNG 26
|
||||
+#define SCMI_SRST_A_KEYLADDER 27
|
||||
+#define SCMI_SRST_H_KEYLADDER 28
|
||||
+#define SCMI_SRST_P_OTPC_S 29
|
||||
+#define SCMI_SRST_OTPC_S 30
|
||||
+#define SCMI_SRST_WDT_S 31
|
||||
+/* Name=SECURE_SOFTRST_CON02,Offset=0xA08 */
|
||||
+#define SCMI_SRST_T_WDT_S 32
|
||||
+#define SCMI_SRST_H_BOOTROM 33
|
||||
+#define SCMI_SRST_A_DCF 34
|
||||
+#define SCMI_SRST_P_DCF 35
|
||||
+#define SCMI_SRST_H_BOOTROM_NS 37
|
||||
+#define SCMI_SRST_P_KEYLADDER 46
|
||||
+#define SCMI_SRST_H_TRNG_S 47
|
||||
+/* Name=SECURE_SOFTRST_CON03,Offset=0xA0C */
|
||||
+#define SCMI_SRST_H_TRNG_NS 48
|
||||
+#define SCMI_SRST_D_SDMMC_BUFFER 49
|
||||
+#define SCMI_SRST_H_SDMMC 50
|
||||
+#define SCMI_SRST_H_SDMMC_BUFFER 51
|
||||
+#define SCMI_SRST_SDMMC 52
|
||||
+#define SCMI_SRST_P_TRNG_CHK 53
|
||||
+#define SCMI_SRST_TRNG_S 54
|
||||
+
|
||||
+
|
||||
#endif
|
||||
+19
@@ -24,3 +24,22 @@ Signed-off-by: wevsty <ty@wevs.org>
|
||||
resets = <&cru SRST_TRNG_NS>;
|
||||
status = "disabled";
|
||||
};
|
||||
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
|
||||
@@ -1857,6 +1857,16 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ rng: rng@fe378000 {
|
||||
+ compatible = "rockchip,trngv1";
|
||||
+ reg = <0x0 0xfe378000 0x0 0x200>;
|
||||
+ interrupts = <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ clocks = <&scmi_clk SCMI_HCLK_SECURE_NS>;
|
||||
+ clock-names = "hclk_trng";
|
||||
+ resets = <&scmi_reset SRST_H_TRNG_NS>;
|
||||
+ reset-names = "reset";
|
||||
+ };
|
||||
+
|
||||
sdhci: mmc@fe2e0000 {
|
||||
compatible = "rockchip,rk3588-dwcmshc";
|
||||
reg = <0x0 0xfe2e0000 0x0 0x10000>;
|
||||
|
||||
@@ -104,8 +104,8 @@ type ClientConfig struct {
|
||||
|
||||
// If set, the resolver translates proxy server domain name into IP addresses.
|
||||
//
|
||||
// This field is not required, if Dialer is able to do DNS, or proxy server
|
||||
// endpoints are IP addresses rather than domain names.
|
||||
// This field is not required, if Dialer or PacketDialer is able to do DNS,
|
||||
// or proxy server endpoints are IP addresses rather than domain names.
|
||||
// Otherwise, the proxy server won't be reachable.
|
||||
Resolver apicommon.DNSResolver
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ const (
|
||||
oneMinusAlpha = 1 - rttAlpha
|
||||
rttBeta = 0.25
|
||||
oneMinusBeta = 1 - rttBeta
|
||||
defaultInitialRTT = 500 * time.Millisecond
|
||||
defaultInitialRTT = time.Second
|
||||
infDuration = time.Duration(math.MaxInt64)
|
||||
)
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ func TestRTO(t *testing.T) {
|
||||
|
||||
// Reset measurement.
|
||||
s.Reset()
|
||||
if s.RTO() != 1000*time.Millisecond {
|
||||
t.Errorf("RTO() = %v, want %v", s.RTO(), 1000*time.Millisecond)
|
||||
if s.RTO() != 2000*time.Millisecond {
|
||||
t.Errorf("RTO() = %v, want %v", s.RTO(), 2000*time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,6 +510,7 @@ func (m *Mux) acceptUnderlayLoop(ctx context.Context, properties UnderlayPropert
|
||||
underlay := &PacketUnderlay{
|
||||
baseUnderlay: *newBaseUnderlay(false, properties.MTU()),
|
||||
conn: conn,
|
||||
packetQueue: make(chan bufferWithAddr, packetChanCapacityServer),
|
||||
sessionCleanTicker: time.NewTicker(sessionCleanInterval),
|
||||
users: m.users,
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ package protocol
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -126,6 +127,12 @@ func segmentLessFunc(a, b *segment) bool {
|
||||
return a.Less(b)
|
||||
}
|
||||
|
||||
// bufferWithAddr associate a raw network packet payload with a remote network address.
|
||||
type bufferWithAddr struct {
|
||||
b []byte
|
||||
addr net.Addr
|
||||
}
|
||||
|
||||
// segmentIterator processes the given segment.
|
||||
// If it returns false, stop the iteration.
|
||||
type segmentIterator func(*segment) bool
|
||||
|
||||
@@ -54,11 +54,14 @@ const (
|
||||
serverRespTimeout = 10 * time.Second
|
||||
sessionHeartbeatInterval = 5 * time.Second
|
||||
|
||||
earlyRetransmission = 3 // number of ack to trigger early retransmission
|
||||
earlyRetransmissionLimit = 2 // maximum number of early retransmission attempt
|
||||
maxRetransmissionBatchSize = 16 // maximum number of segments in a retransmission batch
|
||||
txTimeoutBackOff = 1.25 // tx timeout back off multiplier
|
||||
maxBackOffMultiplier = 20.0 // maximum back off multiplier
|
||||
// Number of ack to trigger early retransmission.
|
||||
earlyRetransmission = 3
|
||||
// Maximum number of early retransmission attempt.
|
||||
earlyRetransmissionLimit = 1
|
||||
// Send timeout back off multiplier.
|
||||
txTimeoutBackOff = 1.25
|
||||
// Maximum back off multiplier.
|
||||
maxBackOffMultiplier = 20.0
|
||||
)
|
||||
|
||||
type sessionState byte
|
||||
@@ -127,10 +130,10 @@ type Session struct {
|
||||
uploadBytes metrics.Metric // number of bytes from client to server, only used by server
|
||||
downloadBytes metrics.Metric // number of bytes from server to client, only used by server
|
||||
|
||||
rttStat *congestion.RTTStats
|
||||
legacysendAlgorithm *congestion.CubicSendAlgorithm
|
||||
sendAlgorithm *congestion.BBRSender
|
||||
remoteWindowSize uint16
|
||||
rttStat *congestion.RTTStats
|
||||
cubicSendAlgorithm *congestion.CubicSendAlgorithm
|
||||
bbrSendAlgorithm *congestion.BBRSender
|
||||
remoteWindowSize uint16
|
||||
|
||||
wg sync.WaitGroup
|
||||
rLock sync.Mutex // serialize application read
|
||||
@@ -153,31 +156,31 @@ func NewSession(id uint32, isClient bool, mtu int, users map[string]*appctlpb.Us
|
||||
rttStat.SetMaxAckDelay(periodicOutputInterval)
|
||||
rttStat.SetRTOMultiplier(txTimeoutBackOff)
|
||||
return &Session{
|
||||
conn: nil,
|
||||
block: atomic.Pointer[cipher.BlockCipher]{},
|
||||
id: id,
|
||||
isClient: isClient,
|
||||
mtu: mtu,
|
||||
state: sessionInit,
|
||||
status: statusOK,
|
||||
users: users,
|
||||
ready: make(chan struct{}),
|
||||
closedChan: make(chan struct{}),
|
||||
readDeadline: time.Time{},
|
||||
writeDeadline: time.Time{},
|
||||
inputErr: make(chan error),
|
||||
outputErr: make(chan error),
|
||||
sendQueue: newSegmentTree(segmentTreeCapacity),
|
||||
sendBuf: newSegmentTree(segmentTreeCapacity),
|
||||
recvBuf: newSegmentTree(segmentTreeCapacity),
|
||||
recvQueue: newSegmentTree(segmentTreeRecvQueueCapacity),
|
||||
recvChan: make(chan *segment, segmentChanCapacity),
|
||||
lastRXTime: time.Now(),
|
||||
lastTXTime: time.Now(),
|
||||
rttStat: rttStat,
|
||||
legacysendAlgorithm: congestion.NewCubicSendAlgorithm(minWindowSize, maxWindowSize),
|
||||
sendAlgorithm: congestion.NewBBRSender(fmt.Sprintf("%d", id), rttStat),
|
||||
remoteWindowSize: minWindowSize,
|
||||
conn: nil,
|
||||
block: atomic.Pointer[cipher.BlockCipher]{},
|
||||
id: id,
|
||||
isClient: isClient,
|
||||
mtu: mtu,
|
||||
state: sessionInit,
|
||||
status: statusOK,
|
||||
users: users,
|
||||
ready: make(chan struct{}),
|
||||
closedChan: make(chan struct{}),
|
||||
readDeadline: time.Time{},
|
||||
writeDeadline: time.Time{},
|
||||
inputErr: make(chan error),
|
||||
outputErr: make(chan error),
|
||||
sendQueue: newSegmentTree(segmentTreeCapacity),
|
||||
sendBuf: newSegmentTree(segmentTreeCapacity),
|
||||
recvBuf: newSegmentTree(segmentTreeCapacity),
|
||||
recvQueue: newSegmentTree(segmentTreeRecvQueueCapacity),
|
||||
recvChan: make(chan *segment, segmentChanCapacity),
|
||||
lastRXTime: time.Now(),
|
||||
lastTXTime: time.Now(),
|
||||
rttStat: rttStat,
|
||||
cubicSendAlgorithm: congestion.NewCubicSendAlgorithm(minWindowSize, maxWindowSize),
|
||||
bbrSendAlgorithm: congestion.NewBBRSender(fmt.Sprintf("%d", id), rttStat),
|
||||
remoteWindowSize: minWindowSize,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,7 +538,7 @@ func (s *Session) writeChunk(b []byte) (n int, err error) {
|
||||
sessionID: s.id,
|
||||
seq: s.nextSend,
|
||||
unAckSeq: s.nextRecv,
|
||||
windowSize: uint16(mathext.Max(0, int(s.legacysendAlgorithm.CongestionWindowSize())-s.recvBuf.Len())),
|
||||
windowSize: uint16(s.receiveWindowSize()),
|
||||
fragment: uint8(i),
|
||||
payloadLen: uint16(partLen),
|
||||
},
|
||||
@@ -680,11 +683,14 @@ func (s *Session) runOutputOncePacket() {
|
||||
// Resend segments in sendBuf.
|
||||
//
|
||||
// Iterate all the segments in sendBuf to calculate bytesInFlight,
|
||||
// but only resend first a few segments if needed.
|
||||
// but only resend segments if needed.
|
||||
//
|
||||
// Retransmission is not limited by window.
|
||||
//
|
||||
// To avoid deadlock, session can't be closed inside Ascend().
|
||||
s.oLock.Lock()
|
||||
retransmissionCount := 0
|
||||
totalTransmissionCount := 0
|
||||
skipSendNewSegment := s.sendWindowSize() <= 0
|
||||
s.sendBuf.Ascend(func(iter *segment) bool {
|
||||
bytesInFlight += int64(packetOverhead + len(iter.payload))
|
||||
if iter.txCount >= txCountLimit {
|
||||
@@ -696,8 +702,9 @@ func (s *Session) runOutputOncePacket() {
|
||||
closeSessionReason = err
|
||||
return false
|
||||
}
|
||||
if retransmissionCount <= maxRetransmissionBatchSize && ((iter.ackCount >= earlyRetransmission && iter.txCount <= earlyRetransmissionLimit) || time.Since(iter.txTime) > iter.txTimeout) {
|
||||
if iter.ackCount >= earlyRetransmission {
|
||||
satisfyEarlyRetransmission := iter.ackCount >= earlyRetransmission && iter.txCount <= earlyRetransmissionLimit
|
||||
if satisfyEarlyRetransmission || time.Since(iter.txTime) > iter.txTimeout {
|
||||
if satisfyEarlyRetransmission {
|
||||
hasLoss = true
|
||||
} else {
|
||||
hasTimeout = true
|
||||
@@ -720,7 +727,7 @@ func (s *Session) runOutputOncePacket() {
|
||||
return false
|
||||
}
|
||||
bytesInFlight += int64(packetOverhead + len(iter.payload))
|
||||
retransmissionCount++
|
||||
totalTransmissionCount++
|
||||
return true
|
||||
}
|
||||
return true
|
||||
@@ -729,12 +736,15 @@ func (s *Session) runOutputOncePacket() {
|
||||
if closeSessionReason != nil {
|
||||
s.closeWithError(closeSessionReason)
|
||||
}
|
||||
if hasLoss || hasTimeout {
|
||||
s.legacysendAlgorithm.OnLoss() // OnTimeout() is too aggressive.
|
||||
if hasTimeout {
|
||||
s.cubicSendAlgorithm.OnTimeout()
|
||||
} else if hasLoss {
|
||||
s.cubicSendAlgorithm.OnLoss()
|
||||
}
|
||||
|
||||
// Send new segments in sendQueue.
|
||||
if s.sendQueue.Len() > 0 {
|
||||
skipSendNewSegment = skipSendNewSegment || totalTransmissionCount >= s.sendWindowSize()
|
||||
if s.sendQueue.Len() > 0 && !skipSendNewSegment {
|
||||
s.oLock.Lock()
|
||||
for {
|
||||
if s.sendBuf.Remaining() <= 1 {
|
||||
@@ -743,7 +753,9 @@ func (s *Session) runOutputOncePacket() {
|
||||
}
|
||||
|
||||
seg, deleted := s.sendQueue.DeleteMinIf(func(iter *segment) bool {
|
||||
return s.sendAlgorithm.CanSend(bytesInFlight, int64(packetOverhead+len(iter.payload)))
|
||||
bbrCanSend := s.bbrSendAlgorithm.CanSend(bytesInFlight, int64(packetOverhead+len(iter.payload)))
|
||||
congestionWindowCanSend := totalTransmissionCount < s.sendWindowSize()
|
||||
return bbrCanSend && congestionWindowCanSend
|
||||
})
|
||||
if !deleted {
|
||||
s.oLock.Unlock()
|
||||
@@ -789,15 +801,17 @@ func (s *Session) runOutputOncePacket() {
|
||||
break
|
||||
}
|
||||
newBytesInFlight := int64(packetOverhead + len(seg.payload))
|
||||
s.sendAlgorithm.OnPacketSent(time.Now(), bytesInFlight, int64(seq), newBytesInFlight, true)
|
||||
s.bbrSendAlgorithm.OnPacketSent(time.Now(), bytesInFlight, int64(seq), newBytesInFlight, true)
|
||||
bytesInFlight += newBytesInFlight
|
||||
totalTransmissionCount++
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s.sendAlgorithm.OnApplicationLimited(bytesInFlight)
|
||||
s.bbrSendAlgorithm.OnApplicationLimited(bytesInFlight)
|
||||
}
|
||||
|
||||
// Send ACK or heartbeat if needed.
|
||||
// ACK is not limited by window.
|
||||
exceedHeartbeatInterval := time.Since(s.lastTXTime) > sessionHeartbeatInterval
|
||||
if s.ackOnDataRecv.Load() || exceedHeartbeatInterval {
|
||||
baseStruct := baseStruct{}
|
||||
@@ -813,7 +827,7 @@ func (s *Session) runOutputOncePacket() {
|
||||
sessionID: s.id,
|
||||
seq: uint32(mathext.Max(0, int(s.nextSend)-1)),
|
||||
unAckSeq: s.nextRecv,
|
||||
windowSize: uint16(mathext.Max(0, int(s.legacysendAlgorithm.CongestionWindowSize())-s.recvBuf.Len())),
|
||||
windowSize: uint16(s.receiveWindowSize()),
|
||||
},
|
||||
transport: s.transportProtocol}
|
||||
if err := s.output(ackSeg, s.RemoteAddr()); err != nil {
|
||||
@@ -827,17 +841,11 @@ func (s *Session) runOutputOncePacket() {
|
||||
} else {
|
||||
seq, err := ackSeg.Seq()
|
||||
if err != nil {
|
||||
s.oLock.Unlock()
|
||||
err = fmt.Errorf("failed to get sequence number from %v: %w", ackSeg, err)
|
||||
log.Debugf("%v %v", s, err)
|
||||
if s.outputHasErr.CompareAndSwap(false, true) {
|
||||
close(s.outputErr)
|
||||
}
|
||||
s.closeWithError(err)
|
||||
panic(fmt.Sprintf("failed to get sequence number from ack segment %v: %v", ackSeg, err))
|
||||
} else {
|
||||
s.oLock.Unlock()
|
||||
newBytesInFlight := int64(packetOverhead + len(ackSeg.payload))
|
||||
s.sendAlgorithm.OnPacketSent(time.Now(), bytesInFlight, int64(seq), newBytesInFlight, true)
|
||||
s.bbrSendAlgorithm.OnPacketSent(time.Now(), bytesInFlight, int64(seq), newBytesInFlight, true)
|
||||
bytesInFlight += newBytesInFlight
|
||||
}
|
||||
}
|
||||
@@ -936,7 +944,7 @@ func (s *Session) inputData(seg *segment) error {
|
||||
break
|
||||
}
|
||||
s.rttStat.UpdateRTT(time.Since(seg2.txTime))
|
||||
s.legacysendAlgorithm.OnAck()
|
||||
s.cubicSendAlgorithm.OnAck()
|
||||
seq, _ := seg2.Seq()
|
||||
ackedPackets = append(ackedPackets, congestion.AckedPacketInfo{
|
||||
PacketNumber: int64(seq),
|
||||
@@ -945,7 +953,7 @@ func (s *Session) inputData(seg *segment) error {
|
||||
})
|
||||
}
|
||||
if len(ackedPackets) > 0 {
|
||||
s.sendAlgorithm.OnCongestionEvent(priorInFlight, time.Now(), ackedPackets, nil)
|
||||
s.bbrSendAlgorithm.OnCongestionEvent(priorInFlight, time.Now(), ackedPackets, nil)
|
||||
}
|
||||
s.remoteWindowSize = das.windowSize
|
||||
}
|
||||
@@ -1060,7 +1068,7 @@ func (s *Session) inputAck(seg *segment) error {
|
||||
break
|
||||
}
|
||||
s.rttStat.UpdateRTT(time.Since(seg2.txTime))
|
||||
s.legacysendAlgorithm.OnAck()
|
||||
s.cubicSendAlgorithm.OnAck()
|
||||
seq, _ := seg2.Seq()
|
||||
ackedPackets = append(ackedPackets, congestion.AckedPacketInfo{
|
||||
PacketNumber: int64(seq),
|
||||
@@ -1069,7 +1077,7 @@ func (s *Session) inputAck(seg *segment) error {
|
||||
})
|
||||
}
|
||||
if len(ackedPackets) > 0 {
|
||||
s.sendAlgorithm.OnCongestionEvent(priorInFlight, time.Now(), ackedPackets, nil)
|
||||
s.bbrSendAlgorithm.OnCongestionEvent(priorInFlight, time.Now(), ackedPackets, nil)
|
||||
}
|
||||
s.remoteWindowSize = das.windowSize
|
||||
|
||||
@@ -1222,6 +1230,24 @@ func (s *Session) closeWithError(err error) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// sendWindowSize determines how many packets this session can send.
|
||||
func (s *Session) sendWindowSize() int {
|
||||
return mathext.Max(0, mathext.Min(int(s.cubicSendAlgorithm.CongestionWindowSize()), int(s.remoteWindowSize)))
|
||||
}
|
||||
|
||||
// receiveWindowSize determines how many packets this session can receive.
|
||||
func (s *Session) receiveWindowSize() int {
|
||||
var underlayWaitingPackets int
|
||||
if s.conn != nil {
|
||||
packetUnderlay, ok := s.conn.(*PacketUnderlay)
|
||||
if ok {
|
||||
// Other packets sharing the same UDP socket reduce the congestion window.
|
||||
underlayWaitingPackets = len(packetUnderlay.packetQueue)
|
||||
}
|
||||
}
|
||||
return mathext.Max(0, int(s.cubicSendAlgorithm.CongestionWindowSize())-s.recvBuf.Len()-underlayWaitingPackets)
|
||||
}
|
||||
|
||||
func (s *Session) checkQuota(userName string) (ok bool, err error) {
|
||||
if len(s.users) == 0 {
|
||||
return true, fmt.Errorf("no registered user")
|
||||
|
||||
@@ -30,8 +30,14 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
sessionChanCapacity = 64
|
||||
// Number of ready sessions before they are consumed by Accept().
|
||||
sessionChanCapacity = 64
|
||||
|
||||
sessionCleanInterval = 5 * time.Second
|
||||
|
||||
// Buffer received network packets before they are dropped by OS kernel.
|
||||
packetChanCapacityClient = 4 * 1024
|
||||
packetChanCapacityServer = 16 * 1024
|
||||
)
|
||||
|
||||
// baseUnderlay contains a partial implementation of underlay.
|
||||
|
||||
@@ -49,6 +49,9 @@ type PacketUnderlay struct {
|
||||
baseUnderlay
|
||||
conn net.PacketConn
|
||||
|
||||
// packetQueue stores raw network packets payload not parsed to segments.
|
||||
packetQueue chan bufferWithAddr
|
||||
|
||||
sessionCleanTicker *time.Ticker
|
||||
|
||||
// ---- client fields ----
|
||||
@@ -87,6 +90,7 @@ func NewPacketUnderlay(ctx context.Context, packetDialer apicommon.PacketDialer,
|
||||
u := &PacketUnderlay{
|
||||
baseUnderlay: *newBaseUnderlay(true, mtu),
|
||||
conn: conn,
|
||||
packetQueue: make(chan bufferWithAddr, packetChanCapacityClient),
|
||||
sessionCleanTicker: time.NewTicker(sessionCleanInterval),
|
||||
serverAddr: remoteAddr,
|
||||
block: block,
|
||||
@@ -168,6 +172,28 @@ func (u *PacketUnderlay) RunEventLoop(ctx context.Context) error {
|
||||
return stderror.ErrNullPointer
|
||||
}
|
||||
|
||||
// OS has limited buffer to store received UDP packets.
|
||||
// Move the received UDP packets to user space as quickly as possible,
|
||||
// so we can process them later at a slower pace.
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-u.done:
|
||||
return
|
||||
default:
|
||||
}
|
||||
if err := u.readOneSegment(); err != nil {
|
||||
if stderror.IsTimeout(err) {
|
||||
continue
|
||||
}
|
||||
log.Debugf("%v readOneSegment() failed: %v", u, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
@@ -180,12 +206,9 @@ func (u *PacketUnderlay) RunEventLoop(ctx context.Context) error {
|
||||
u.cleanSessions()
|
||||
default:
|
||||
}
|
||||
seg, addr, err := u.readOneSegment()
|
||||
seg, addr, err := u.parseOneSegment()
|
||||
if err != nil {
|
||||
if stderror.IsTimeout(err) {
|
||||
continue
|
||||
}
|
||||
return fmt.Errorf("readOneSegment() failed: %w", err)
|
||||
return fmt.Errorf("parseOneSegment() failed: %w", err)
|
||||
}
|
||||
if log.IsLevelEnabled(log.TraceLevel) {
|
||||
log.Tracef("%v received %v from peer %v", u, seg, addr)
|
||||
@@ -294,28 +317,29 @@ func (u *PacketUnderlay) onCloseSession(seg *segment) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (u *PacketUnderlay) readOneSegment() (*segment, net.Addr, error) {
|
||||
func (u *PacketUnderlay) readOneSegment() error {
|
||||
var n int
|
||||
var addr net.Addr
|
||||
var err error
|
||||
for {
|
||||
select {
|
||||
case <-u.done:
|
||||
return nil, nil, io.ErrClosedPipe
|
||||
return io.ErrClosedPipe
|
||||
default:
|
||||
}
|
||||
|
||||
common.SetReadTimeout(u.conn, readOneSegmentTimeout)
|
||||
defer common.SetReadTimeout(u.conn, 0)
|
||||
|
||||
// Peer may select a different MTU.
|
||||
// Use the largest possible value here to avoid error.
|
||||
b := make([]byte, 1500)
|
||||
n, addr, err = u.conn.ReadFrom(b)
|
||||
if err != nil {
|
||||
if stderror.IsTimeout(err) {
|
||||
return nil, nil, stderror.ErrTimeout
|
||||
return stderror.ErrTimeout
|
||||
}
|
||||
return nil, nil, fmt.Errorf("ReadFrom() failed: %w", err)
|
||||
return fmt.Errorf("ReadFrom() failed: %w", err)
|
||||
}
|
||||
if u.isClient && addr.String() != u.serverAddr.String() {
|
||||
UnderlayUnsolicitedUDP.Add(1)
|
||||
@@ -337,153 +361,171 @@ func (u *PacketUnderlay) readOneSegment() (*segment, net.Addr, error) {
|
||||
} else {
|
||||
metrics.UploadBytes.Add(int64(n))
|
||||
}
|
||||
|
||||
// Read encrypted metadata.
|
||||
encryptedMeta := b[:packetNonHeaderPosition]
|
||||
isNewSessionReplay := false
|
||||
if packetReplayCache.IsDuplicate(encryptedMeta[:cipher.DefaultOverhead], addr.String()) {
|
||||
replay.NewSession.Add(1)
|
||||
isNewSessionReplay = true
|
||||
u.packetQueue <- bufferWithAddr{
|
||||
b: b,
|
||||
addr: addr,
|
||||
}
|
||||
nonce := encryptedMeta[:cipher.DefaultNonceSize]
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// Decrypt metadata.
|
||||
var decryptedMeta []byte
|
||||
var blockCipher cipher.BlockCipher
|
||||
if u.isClient {
|
||||
decryptedMeta, err = u.block.Decrypt(encryptedMeta)
|
||||
cipher.ClientDirectDecrypt.Add(1)
|
||||
if err != nil {
|
||||
cipher.ClientFailedDirectDecrypt.Add(1)
|
||||
if log.IsLevelEnabled(log.TraceLevel) {
|
||||
log.Tracef("%v Decrypt() failed with packet from %v", u, addr)
|
||||
}
|
||||
continue
|
||||
func (u *PacketUnderlay) parseOneSegment() (*segment, net.Addr, error) {
|
||||
var err error
|
||||
for {
|
||||
select {
|
||||
case <-u.done:
|
||||
return nil, nil, io.ErrClosedPipe
|
||||
case raw := <-u.packetQueue:
|
||||
b := raw.b
|
||||
addr := raw.addr
|
||||
|
||||
// Read encrypted metadata.
|
||||
encryptedMeta := b[:packetNonHeaderPosition]
|
||||
isNewSessionReplay := false
|
||||
if packetReplayCache.IsDuplicate(encryptedMeta[:cipher.DefaultOverhead], addr.String()) {
|
||||
replay.NewSession.Add(1)
|
||||
isNewSessionReplay = true
|
||||
}
|
||||
} else {
|
||||
var decrypted bool
|
||||
var err error
|
||||
// Try existing sessions.
|
||||
cipher.ServerIterateDecrypt.Add(1)
|
||||
u.sessionMap.Range(func(k, v any) bool {
|
||||
session := v.(*Session)
|
||||
if session.block.Load() != nil && session.RemoteAddr().String() == addr.String() {
|
||||
decryptedMeta, err = (*session.block.Load()).Decrypt(encryptedMeta)
|
||||
if err == nil {
|
||||
decrypted = true
|
||||
blockCipher = *session.block.Load()
|
||||
return false
|
||||
nonce := encryptedMeta[:cipher.DefaultNonceSize]
|
||||
|
||||
// Decrypt metadata.
|
||||
var decryptedMeta []byte
|
||||
var blockCipher cipher.BlockCipher
|
||||
if u.isClient {
|
||||
decryptedMeta, err = u.block.Decrypt(encryptedMeta)
|
||||
cipher.ClientDirectDecrypt.Add(1)
|
||||
if err != nil {
|
||||
cipher.ClientFailedDirectDecrypt.Add(1)
|
||||
if log.IsLevelEnabled(log.TraceLevel) {
|
||||
log.Tracef("%v Decrypt() failed with packet from %v", u, addr)
|
||||
}
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
var decrypted bool
|
||||
var err error
|
||||
// Try existing sessions.
|
||||
cipher.ServerIterateDecrypt.Add(1)
|
||||
u.sessionMap.Range(func(k, v any) bool {
|
||||
session := v.(*Session)
|
||||
if session.block.Load() != nil && session.RemoteAddr().String() == addr.String() {
|
||||
decryptedMeta, err = (*session.block.Load()).Decrypt(encryptedMeta)
|
||||
if err == nil {
|
||||
decrypted = true
|
||||
blockCipher = *session.block.Load()
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
if !decrypted {
|
||||
// This is a new session. Try all registered users.
|
||||
for _, user := range u.users {
|
||||
var password []byte
|
||||
password, err = hex.DecodeString(user.GetHashedPassword())
|
||||
if err != nil {
|
||||
log.Debugf("Unable to decode hashed password %q from user %q", user.GetHashedPassword(), user.GetName())
|
||||
continue
|
||||
}
|
||||
if len(password) == 0 {
|
||||
password = cipher.HashPassword([]byte(user.GetPassword()), []byte(user.GetName()))
|
||||
}
|
||||
blockCipher, decryptedMeta, err = cipher.TryDecrypt(encryptedMeta, password, true)
|
||||
if err == nil {
|
||||
decrypted = true
|
||||
blockCipher.SetBlockContext(cipher.BlockContext{
|
||||
UserName: user.GetName(),
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
if !decrypted {
|
||||
// This is a new session. Try all registered users.
|
||||
for _, user := range u.users {
|
||||
var password []byte
|
||||
password, err = hex.DecodeString(user.GetHashedPassword())
|
||||
if err != nil {
|
||||
log.Debugf("Unable to decode hashed password %q from user %q", user.GetHashedPassword(), user.GetName())
|
||||
if !decrypted {
|
||||
cipher.ServerFailedIterateDecrypt.Add(1)
|
||||
if isNewSessionReplay {
|
||||
log.Debugf("found possible replay attack in %v from %v", u, addr)
|
||||
} else if log.IsLevelEnabled(log.TraceLevel) {
|
||||
log.Tracef("%v TryDecrypt() failed with packet from %v", u, addr)
|
||||
}
|
||||
continue
|
||||
} else {
|
||||
if blockCipher == nil {
|
||||
panic("PacketUnderlay parseOneSegment(): block cipher is nil after decryption is successful")
|
||||
}
|
||||
if isNewSessionReplay {
|
||||
replay.NewSessionDecrypted.Add(1)
|
||||
log.Debugf("found possible replay attack with payload decrypted in %v from %v", u, addr)
|
||||
continue
|
||||
}
|
||||
if len(password) == 0 {
|
||||
password = cipher.HashPassword([]byte(user.GetPassword()), []byte(user.GetName()))
|
||||
}
|
||||
blockCipher, decryptedMeta, err = cipher.TryDecrypt(encryptedMeta, password, true)
|
||||
if err == nil {
|
||||
decrypted = true
|
||||
blockCipher.SetBlockContext(cipher.BlockContext{
|
||||
UserName: user.GetName(),
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if !decrypted {
|
||||
cipher.ServerFailedIterateDecrypt.Add(1)
|
||||
if isNewSessionReplay {
|
||||
log.Debugf("found possible replay attack in %v from %v", u, addr)
|
||||
} else if log.IsLevelEnabled(log.TraceLevel) {
|
||||
log.Tracef("%v TryDecrypt() failed with packet from %v", u, addr)
|
||||
}
|
||||
if len(decryptedMeta) != MetadataLength {
|
||||
log.Debugf("decrypted metadata size %d is unexpected", len(decryptedMeta))
|
||||
continue
|
||||
} else {
|
||||
if blockCipher == nil {
|
||||
panic("PacketUnderlay readOneSegment(): block cipher is nil after decryption is successful")
|
||||
}
|
||||
if isNewSessionReplay {
|
||||
replay.NewSessionDecrypted.Add(1)
|
||||
log.Debugf("found possible replay attack with payload decrypted in %v from %v", u, addr)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(decryptedMeta) != MetadataLength {
|
||||
log.Debugf("decrypted metadata size %d is unexpected", len(decryptedMeta))
|
||||
continue
|
||||
}
|
||||
|
||||
// Read payload and construct segment.
|
||||
var seg *segment
|
||||
p := decryptedMeta[0]
|
||||
if isSessionProtocol(protocolType(p)) {
|
||||
ss := &sessionStruct{}
|
||||
if err := ss.Unmarshal(decryptedMeta); err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, fmt.Errorf("Unmarshal() to sessionStruct failed: %w", err)
|
||||
} else {
|
||||
log.Debugf("%v Unmarshal() to sessionStruct failed: %v", u, err)
|
||||
continue
|
||||
// Read payload and construct segment.
|
||||
var seg *segment
|
||||
p := decryptedMeta[0]
|
||||
if isSessionProtocol(protocolType(p)) {
|
||||
ss := &sessionStruct{}
|
||||
if err := ss.Unmarshal(decryptedMeta); err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, fmt.Errorf("Unmarshal() to sessionStruct failed: %w", err)
|
||||
} else {
|
||||
log.Debugf("%v Unmarshal() to sessionStruct failed: %v", u, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
seg, err = u.readSessionSegment(ss, nonce, b[packetNonHeaderPosition:], blockCipher)
|
||||
if err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, err
|
||||
} else {
|
||||
log.Debugf("%v readSessionSegment() failed: %v", u, err)
|
||||
continue
|
||||
seg, err = u.parseSessionSegment(ss, nonce, b[packetNonHeaderPosition:], blockCipher)
|
||||
if err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, err
|
||||
} else {
|
||||
log.Debugf("%v parseSessionSegment() failed: %v", u, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if blockCipher != nil {
|
||||
seg.block = blockCipher
|
||||
}
|
||||
return seg, addr, nil
|
||||
} else if isDataAckProtocol(protocolType(p)) {
|
||||
das := &dataAckStruct{}
|
||||
if err := das.Unmarshal(decryptedMeta); err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, fmt.Errorf("Unmarshal() to dataAckStruct failed: %w", err)
|
||||
} else {
|
||||
log.Debugf("%v Unmarshal() to dataAckStruct failed: %v", u, err)
|
||||
continue
|
||||
if blockCipher != nil {
|
||||
seg.block = blockCipher
|
||||
}
|
||||
}
|
||||
seg, err = u.readDataAckSegment(das, nonce, b[packetNonHeaderPosition:], blockCipher)
|
||||
if err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, err
|
||||
} else {
|
||||
log.Debugf("%v readDataAckSegment() failed: %v", u, err)
|
||||
continue
|
||||
return seg, addr, nil
|
||||
} else if isDataAckProtocol(protocolType(p)) {
|
||||
das := &dataAckStruct{}
|
||||
if err := das.Unmarshal(decryptedMeta); err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, fmt.Errorf("Unmarshal() to dataAckStruct failed: %w", err)
|
||||
} else {
|
||||
log.Debugf("%v Unmarshal() to dataAckStruct failed: %v", u, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if blockCipher != nil {
|
||||
seg.block = blockCipher
|
||||
}
|
||||
return seg, addr, nil
|
||||
} else {
|
||||
if u.isClient {
|
||||
return nil, nil, fmt.Errorf("unable to handle protocol %d", p)
|
||||
seg, err = u.parseDataAckSegment(das, nonce, b[packetNonHeaderPosition:], blockCipher)
|
||||
if err != nil {
|
||||
if u.isClient {
|
||||
return nil, nil, err
|
||||
} else {
|
||||
log.Debugf("%v parseDataAckSegment() failed: %v", u, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
if blockCipher != nil {
|
||||
seg.block = blockCipher
|
||||
}
|
||||
return seg, addr, nil
|
||||
} else {
|
||||
log.Debugf("%v unable to handle protocol %d", u, p)
|
||||
continue
|
||||
if u.isClient {
|
||||
return nil, nil, fmt.Errorf("unable to handle protocol %d", p)
|
||||
} else {
|
||||
log.Debugf("%v unable to handle protocol %d", u, p)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (u *PacketUnderlay) readSessionSegment(ss *sessionStruct, nonce, remaining []byte, blockCipher cipher.BlockCipher) (*segment, error) {
|
||||
func (u *PacketUnderlay) parseSessionSegment(ss *sessionStruct, nonce, remaining []byte, blockCipher cipher.BlockCipher) (*segment, error) {
|
||||
var decryptedPayload []byte
|
||||
var err error
|
||||
|
||||
@@ -529,7 +571,7 @@ func (u *PacketUnderlay) readSessionSegment(ss *sessionStruct, nonce, remaining
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (u *PacketUnderlay) readDataAckSegment(das *dataAckStruct, nonce, remaining []byte, blockCipher cipher.BlockCipher) (*segment, error) {
|
||||
func (u *PacketUnderlay) parseDataAckSegment(das *dataAckStruct, nonce, remaining []byte, blockCipher cipher.BlockCipher) (*segment, error) {
|
||||
var decryptedPayload []byte
|
||||
var err error
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ type StreamUnderlay struct {
|
||||
send cipher.BlockCipher
|
||||
recv cipher.BlockCipher
|
||||
|
||||
// Candidates are block ciphers that can be used to encrypt or decrypt data.
|
||||
// candidates are block ciphers that can be used to encrypt or decrypt data.
|
||||
// When isClient is true, there must be exactly 1 element in the slice.
|
||||
candidates []cipher.BlockCipher
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ func (m *Mieru) Listen(tunnel C.Tunnel) error {
|
||||
if err != nil {
|
||||
if !m.server.IsRunning() {
|
||||
break
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
go mieru.Handle(c, tunnel, req, additions...)
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=filebrowser
|
||||
PKG_VERSION:=2.45.3
|
||||
PKG_VERSION:=2.46.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/filebrowser/filebrowser/tar.gz/v${PKG_VERSION}?
|
||||
PKG_HASH:=433a79deb0bca31cabfb17e5517728a32dd6692070e520f9beb8a10659e3e0c6
|
||||
PKG_HASH:=53e06f5501eaee32a89c6e1f7d211843c5cb37de042ac0fc45c25b5866f6b486
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=25.11.14
|
||||
PKG_VERSION:=25.11.15
|
||||
PKG_RELEASE:=1
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||
|
||||
|
||||
@@ -420,6 +420,20 @@ function set_node()
|
||||
local protocol = http.formvalue("protocol")
|
||||
local section = http.formvalue("section")
|
||||
uci:set(appname, "@global[0]", protocol .. "_node", section)
|
||||
if protocol == "tcp" then
|
||||
local node_protocol = uci:get(appname, section, "protocol")
|
||||
if node_protocol == "_shunt" then
|
||||
local type = uci:get(appname, section, "type")
|
||||
local dns_shunt = uci:get(appname, "@global[0]", "dns_shunt")
|
||||
local dns_key = (dns_shunt == "smartdns") and "smartdns_dns_mode" or "dns_mode"
|
||||
local dns_mode = uci:get(appname, "@global[0]", dns_key)
|
||||
local new_dns_mode = (type == "Xray") and "xray" or "sing-box"
|
||||
if dns_mode ~= new_dns_mode then
|
||||
uci:set(appname, "@global[0]", dns_key, new_dns_mode)
|
||||
uci:set(appname, "@global[0]", "v2ray_dns_mode", "tcp")
|
||||
end
|
||||
end
|
||||
end
|
||||
api.uci_save(uci, appname, true, true)
|
||||
http.redirect(api.url("log"))
|
||||
end
|
||||
|
||||
+41
-24
@@ -22,11 +22,17 @@ local port_validate = function(self, value, t)
|
||||
end
|
||||
|
||||
local nodes_table = {}
|
||||
local shunt_list = {}
|
||||
for k, e in ipairs(api.get_valid_nodes()) do
|
||||
for _, e in ipairs(api.get_valid_nodes()) do
|
||||
nodes_table[#nodes_table + 1] = e
|
||||
end
|
||||
|
||||
local normal_list = {}
|
||||
for _, v in pairs(nodes_table) do
|
||||
if v.node_type == "normal" then
|
||||
normal_list[#normal_list + 1] = v
|
||||
end
|
||||
end
|
||||
|
||||
local dynamicList_write = function(self, section, value)
|
||||
local t = {}
|
||||
local t2 = {}
|
||||
@@ -200,14 +206,6 @@ o:value("", translate("Close"))
|
||||
o:value("tcp", translate("Same as the tcp node"))
|
||||
o:depends({ _tcp_node_bool = "1" })
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
if v.protocol and v.protocol == "_shunt" then
|
||||
shunt_list[#shunt_list + 1] = v
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "_udp_node_bool", "")
|
||||
o.template = "passwall/cbi/hidevalue"
|
||||
o.value = "1"
|
||||
@@ -260,6 +258,8 @@ o.cfgvalue = function(t, n)
|
||||
return string.format('<font color="red">%s</font>',
|
||||
translate("The port settings support single ports and ranges.<br>Separate multiple ports with commas (,).<br>Example: 21,80,443,1000:2000."))
|
||||
end
|
||||
o:depends({ use_global_config = true })
|
||||
o:depends({ _tcp_node_bool = "1" })
|
||||
|
||||
o = s:option(Flag, "use_direct_list", translatef("Use %s", translate("Direct List")))
|
||||
o.default = "1"
|
||||
@@ -333,10 +333,18 @@ o.remove = function(self, section)
|
||||
if id_val == "" then
|
||||
return m:del(section, self.option)
|
||||
end
|
||||
for k, v in pairs(shunt_list) do
|
||||
for _, v in pairs(nodes_table) do
|
||||
if v.id == id_val then
|
||||
local new_val = (v.type == "Xray") and "xray" or "sing-box"
|
||||
return m:set(section, self.option, new_val)
|
||||
m:set(section, self.option, new_val)
|
||||
|
||||
local dns_field = s.fields[new_val .. "_dns_mode"]
|
||||
local v2ray_dns_mode = dns_field and dns_field:formvalue(section)
|
||||
if v2ray_dns_mode then
|
||||
m:set(section, "v2ray_dns_mode", v2ray_dns_mode)
|
||||
end
|
||||
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -453,20 +461,29 @@ o.description = desc .. "</ul>"
|
||||
o:depends({dns_shunt = "dnsmasq", tcp_proxy_mode = "proxy", chn_list = "direct"})
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
if v.protocol ~= "_shunt" then
|
||||
if #normal_list == 0 then
|
||||
s.fields["dns_mode"]:depends({ _tcp_node_bool = "1" })
|
||||
break
|
||||
end
|
||||
if v.protocol == "_shunt" then
|
||||
if v.type == "Xray" and has_xray then
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
s.fields["xray_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if v.type == "sing-box" and has_singbox then
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
s.fields["singbox_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if has_xray or has_singbox then
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
else
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
s.fields["dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
for k, v in pairs(shunt_list) do
|
||||
if v.type == "Xray" and has_xray then
|
||||
s.fields["xray_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if v.type == "sing-box" and has_singbox then
|
||||
s.fields["singbox_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if has_xray or has_singbox then
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
|
||||
return m
|
||||
|
||||
@@ -12,7 +12,7 @@ m = Map(appname)
|
||||
api.set_apply_on_parse(m)
|
||||
|
||||
local nodes_table = {}
|
||||
for k, e in ipairs(api.get_valid_nodes()) do
|
||||
for _, e in ipairs(api.get_valid_nodes()) do
|
||||
nodes_table[#nodes_table + 1] = e
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ local balancing_list = {}
|
||||
local urltest_list = {}
|
||||
local shunt_list = {}
|
||||
local iface_list = {}
|
||||
for k, v in pairs(nodes_table) do
|
||||
for _, v in pairs(nodes_table) do
|
||||
if v.node_type == "normal" then
|
||||
normal_list[#normal_list + 1] = v
|
||||
end
|
||||
@@ -136,15 +136,16 @@ if (has_singbox or has_xray) and #nodes_table > 0 then
|
||||
for k, v in pairs(shunt_list) do
|
||||
local vid = v.id
|
||||
-- shunt node type, Sing-Box or Xray
|
||||
local type = s:taboption("Main", ListValue, vid .. "-type", translate("Type"))
|
||||
if has_singbox then
|
||||
type:value("sing-box", "Sing-Box")
|
||||
end
|
||||
o = s:taboption("Main", ListValue, vid .. "-type", translate("Type"))
|
||||
if has_xray then
|
||||
type:value("Xray", translate("Xray"))
|
||||
o:value("Xray", translate("Xray"))
|
||||
end
|
||||
type.cfgvalue = get_cfgvalue(v.id, "type")
|
||||
type.write = get_write(v.id, "type")
|
||||
if has_singbox then
|
||||
o:value("sing-box", "Sing-Box")
|
||||
end
|
||||
o:depends("tcp_node", v.id)
|
||||
o.cfgvalue = get_cfgvalue(v.id, "type")
|
||||
o.write = get_write(v.id, "type")
|
||||
|
||||
-- pre-proxy
|
||||
o = s:taboption("Main", Flag, vid .. "-preproxy_enabled", translate("Preproxy"))
|
||||
@@ -173,12 +174,6 @@ if (has_singbox or has_xray) and #nodes_table > 0 then
|
||||
o.cfgvalue = get_cfgvalue(v.id, "main_node")
|
||||
o.write = get_write(v.id, "main_node")
|
||||
|
||||
if (has_singbox and has_xray) or (v.type == "sing-box" and not has_singbox) or (v.type == "Xray" and not has_xray) then
|
||||
type:depends("tcp_node", v.id)
|
||||
else
|
||||
type:depends("tcp_node", "__hide") --不存在的依赖,即始终隐藏
|
||||
end
|
||||
|
||||
m.uci:foreach(appname, "shunt_rules", function(e)
|
||||
local id = e[".name"]
|
||||
local node_option = vid .. "-" .. id .. "_node"
|
||||
@@ -587,7 +582,6 @@ local use_nft = m:get("@global_forwarding[0]", "use_nft") == "1"
|
||||
local set_title = api.i18n.translate(use_nft and "Clear NFTSET on Reboot" or "Clear IPSET on Reboot")
|
||||
o = s:taboption("DNS", Flag, "flush_set_on_reboot", set_title, translate("Clear IPSET/NFTSET on service reboot. This may increase reboot time."))
|
||||
o.default = "0"
|
||||
o.rmempty = false
|
||||
|
||||
set_title = api.i18n.translate(use_nft and "Clear NFTSET" or "Clear IPSET")
|
||||
o = s:taboption("DNS", DummyValue, "clear_ipset", set_title, translate("Try this feature if the rule modification does not take effect."))
|
||||
@@ -766,8 +760,29 @@ if has_singbox or has_xray then
|
||||
end
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
if #normal_list == 0 then
|
||||
break
|
||||
end
|
||||
if v.protocol == "_shunt" then
|
||||
if has_singbox or has_xray then
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
|
||||
s.fields["xray_dns_mode"]:depends({ [v.id .. "-type"] = "Xray", tcp_node = v.id })
|
||||
s.fields["singbox_dns_mode"]:depends({ [v.id .. "-type"] = "sing-box", tcp_node = v.id })
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
s.fields["remote_fakedns"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
else
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "chinadns-ng", tcp_node = v.id })
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "dnsmasq", tcp_node = v.id })
|
||||
if api.is_finded("smartdns") then
|
||||
s.fields["smartdns_dns_mode"]:depends({ dns_shunt = "smartdns", tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
if v.type == "Socks" then
|
||||
if has_singbox or has_xray then
|
||||
s2.fields["node"]:value(v.id, v["remark"])
|
||||
@@ -775,21 +790,6 @@ for k, v in pairs(nodes_table) do
|
||||
else
|
||||
s2.fields["node"]:value(v.id, v["remark"])
|
||||
end
|
||||
|
||||
if v.protocol ~= "_shunt" then
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "chinadns-ng", tcp_node = v.id })
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "dnsmasq", tcp_node = v.id })
|
||||
if api.is_finded("smartdns") then
|
||||
s.fields["smartdns_dns_mode"]:depends({ dns_shunt = "smartdns", tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for k, v in pairs(shunt_list) do
|
||||
s.fields["xray_dns_mode"]:depends({ [v.id .. "-type"] = "Xray", tcp_node = v.id })
|
||||
s.fields["singbox_dns_mode"]:depends({ [v.id .. "-type"] = "sing-box", tcp_node = v.id })
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
s.fields["remote_fakedns"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
|
||||
m:append(Template(appname .. "/global/footer"))
|
||||
|
||||
+1
-1
@@ -194,7 +194,7 @@ o.validate = function(self, value, section)
|
||||
end
|
||||
o.write = function(self, section, value)
|
||||
local old = m:get(section, self.option) or ""
|
||||
if old:lower() ~= value:lower() then
|
||||
if old ~= value then
|
||||
m.uci:foreach(appname, "nodes", function(e)
|
||||
if e["group"] and e["group"]:lower() == old:lower() then
|
||||
m.uci:set(appname, e[".name"], "group", value)
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ o.validate = function(self, value, section)
|
||||
end
|
||||
o.write = function(self, section, value)
|
||||
local old = m:get(section, self.option) or ""
|
||||
if old:lower() ~= value:lower() then
|
||||
if old ~= value then
|
||||
m.uci:foreach(appname, "nodes", function(e)
|
||||
if e["group"] and e["group"]:lower() == old:lower() then
|
||||
m.uci:set(appname, e[".name"], "group", value)
|
||||
|
||||
@@ -1205,7 +1205,7 @@ function get_version()
|
||||
if not version or #version == 0 then
|
||||
version = sys.exec("apk list luci-app-passwall 2>/dev/null | awk '/installed/ {print $1}' | cut -d'-' -f4-")
|
||||
end
|
||||
return version or ""
|
||||
return (version or ""):gsub("\n", "")
|
||||
end
|
||||
|
||||
function to_check_self()
|
||||
|
||||
@@ -111,7 +111,10 @@ local version = {}
|
||||
} else {
|
||||
btn.disabled = true;
|
||||
btn.value = noUpdateText;
|
||||
window['_' + app + '-force_btn'].style.display = "inline";
|
||||
var forceBtn = document.getElementById('_' + app + '-force_btn');
|
||||
if (forceBtn) {
|
||||
forceBtn.style.display = "inline";
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
|
||||
@@ -44,7 +44,6 @@ table td, .table .td {
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<% if api.is_js_luci() then -%>
|
||||
<script type="text/javascript">
|
||||
var cbi_t = [];
|
||||
@@ -84,6 +83,21 @@ table td, .table .td {
|
||||
return false
|
||||
}
|
||||
</script>
|
||||
<%- else %>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
if (typeof(cbi_t_switch) === "function") {
|
||||
var old_switch = cbi_t_switch;
|
||||
cbi_t_switch = function(section, tab) {
|
||||
var btn = document.getElementById("select_all_btn");
|
||||
if (btn) {
|
||||
dechecked_all_node(btn);
|
||||
}
|
||||
return old_switch(section, tab);
|
||||
};
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<%- end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
Generated
+2
-2
@@ -402,9 +402,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.10.1"
|
||||
version = "1.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
|
||||
checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
|
||||
|
||||
[[package]]
|
||||
name = "bzip2-sys"
|
||||
|
||||
@@ -170,7 +170,7 @@ hickory-resolver = { version = "0.25", optional = true, features = ["serde"] }
|
||||
idna = "1.0"
|
||||
ipnet = "2.10"
|
||||
iprange = "0.6"
|
||||
regex = "1.4"
|
||||
regex = { version = "1.4", default-features = false, features = ["std", "perf"] }
|
||||
|
||||
mime = { version = "0.3", optional = true }
|
||||
flate2 = { version = "1.0", optional = true }
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-passwall
|
||||
PKG_VERSION:=25.11.14
|
||||
PKG_VERSION:=25.11.15
|
||||
PKG_RELEASE:=1
|
||||
PKG_PO_VERSION:=$(PKG_VERSION)
|
||||
|
||||
|
||||
@@ -22,11 +22,17 @@ local port_validate = function(self, value, t)
|
||||
end
|
||||
|
||||
local nodes_table = {}
|
||||
local shunt_list = {}
|
||||
for k, e in ipairs(api.get_valid_nodes()) do
|
||||
for _, e in ipairs(api.get_valid_nodes()) do
|
||||
nodes_table[#nodes_table + 1] = e
|
||||
end
|
||||
|
||||
local normal_list = {}
|
||||
for _, v in pairs(nodes_table) do
|
||||
if v.node_type == "normal" then
|
||||
normal_list[#normal_list + 1] = v
|
||||
end
|
||||
end
|
||||
|
||||
local dynamicList_write = function(self, section, value)
|
||||
local t = {}
|
||||
local t2 = {}
|
||||
@@ -200,14 +206,6 @@ o:value("", translate("Close"))
|
||||
o:value("tcp", translate("Same as the tcp node"))
|
||||
o:depends({ _tcp_node_bool = "1" })
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
if v.protocol and v.protocol == "_shunt" then
|
||||
shunt_list[#shunt_list + 1] = v
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "_udp_node_bool", "")
|
||||
o.template = "passwall/cbi/hidevalue"
|
||||
o.value = "1"
|
||||
@@ -260,6 +258,8 @@ o.cfgvalue = function(t, n)
|
||||
return string.format('<font color="red">%s</font>',
|
||||
translate("The port settings support single ports and ranges.<br>Separate multiple ports with commas (,).<br>Example: 21,80,443,1000:2000."))
|
||||
end
|
||||
o:depends({ use_global_config = true })
|
||||
o:depends({ _tcp_node_bool = "1" })
|
||||
|
||||
o = s:option(Flag, "use_direct_list", translatef("Use %s", translate("Direct List")))
|
||||
o.default = "1"
|
||||
@@ -333,10 +333,18 @@ o.remove = function(self, section)
|
||||
if id_val == "" then
|
||||
return m:del(section, self.option)
|
||||
end
|
||||
for k, v in pairs(shunt_list) do
|
||||
for _, v in pairs(nodes_table) do
|
||||
if v.id == id_val then
|
||||
local new_val = (v.type == "Xray") and "xray" or "sing-box"
|
||||
return m:set(section, self.option, new_val)
|
||||
m:set(section, self.option, new_val)
|
||||
|
||||
local dns_field = s.fields[new_val .. "_dns_mode"]
|
||||
local v2ray_dns_mode = dns_field and dns_field:formvalue(section)
|
||||
if v2ray_dns_mode then
|
||||
m:set(section, "v2ray_dns_mode", v2ray_dns_mode)
|
||||
end
|
||||
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -453,20 +461,29 @@ o.description = desc .. "</ul>"
|
||||
o:depends({dns_shunt = "dnsmasq", tcp_proxy_mode = "proxy", chn_list = "direct"})
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
if v.protocol ~= "_shunt" then
|
||||
if #normal_list == 0 then
|
||||
s.fields["dns_mode"]:depends({ _tcp_node_bool = "1" })
|
||||
break
|
||||
end
|
||||
if v.protocol == "_shunt" then
|
||||
if v.type == "Xray" and has_xray then
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
s.fields["xray_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if v.type == "sing-box" and has_singbox then
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
s.fields["singbox_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if has_xray or has_singbox then
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
else
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
s.fields["dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
for k, v in pairs(shunt_list) do
|
||||
if v.type == "Xray" and has_xray then
|
||||
s.fields["xray_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if v.type == "sing-box" and has_singbox then
|
||||
s.fields["singbox_dns_mode"]:depends({ _tcp_node_bool = "1", tcp_node = v.id })
|
||||
end
|
||||
if has_xray or has_singbox then
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
|
||||
return m
|
||||
|
||||
@@ -12,7 +12,7 @@ m = Map(appname)
|
||||
api.set_apply_on_parse(m)
|
||||
|
||||
local nodes_table = {}
|
||||
for k, e in ipairs(api.get_valid_nodes()) do
|
||||
for _, e in ipairs(api.get_valid_nodes()) do
|
||||
nodes_table[#nodes_table + 1] = e
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ local balancing_list = {}
|
||||
local urltest_list = {}
|
||||
local shunt_list = {}
|
||||
local iface_list = {}
|
||||
for k, v in pairs(nodes_table) do
|
||||
for _, v in pairs(nodes_table) do
|
||||
if v.node_type == "normal" then
|
||||
normal_list[#normal_list + 1] = v
|
||||
end
|
||||
@@ -136,15 +136,16 @@ if (has_singbox or has_xray) and #nodes_table > 0 then
|
||||
for k, v in pairs(shunt_list) do
|
||||
local vid = v.id
|
||||
-- shunt node type, Sing-Box or Xray
|
||||
local type = s:taboption("Main", ListValue, vid .. "-type", translate("Type"))
|
||||
if has_singbox then
|
||||
type:value("sing-box", "Sing-Box")
|
||||
end
|
||||
o = s:taboption("Main", ListValue, vid .. "-type", translate("Type"))
|
||||
if has_xray then
|
||||
type:value("Xray", translate("Xray"))
|
||||
o:value("Xray", translate("Xray"))
|
||||
end
|
||||
type.cfgvalue = get_cfgvalue(v.id, "type")
|
||||
type.write = get_write(v.id, "type")
|
||||
if has_singbox then
|
||||
o:value("sing-box", "Sing-Box")
|
||||
end
|
||||
o:depends("tcp_node", v.id)
|
||||
o.cfgvalue = get_cfgvalue(v.id, "type")
|
||||
o.write = get_write(v.id, "type")
|
||||
|
||||
-- pre-proxy
|
||||
o = s:taboption("Main", Flag, vid .. "-preproxy_enabled", translate("Preproxy"))
|
||||
@@ -173,12 +174,6 @@ if (has_singbox or has_xray) and #nodes_table > 0 then
|
||||
o.cfgvalue = get_cfgvalue(v.id, "main_node")
|
||||
o.write = get_write(v.id, "main_node")
|
||||
|
||||
if (has_singbox and has_xray) or (v.type == "sing-box" and not has_singbox) or (v.type == "Xray" and not has_xray) then
|
||||
type:depends("tcp_node", v.id)
|
||||
else
|
||||
type:depends("tcp_node", "__hide") --不存在的依赖,即始终隐藏
|
||||
end
|
||||
|
||||
m.uci:foreach(appname, "shunt_rules", function(e)
|
||||
local id = e[".name"]
|
||||
local node_option = vid .. "-" .. id .. "_node"
|
||||
@@ -587,7 +582,6 @@ local use_nft = m:get("@global_forwarding[0]", "use_nft") == "1"
|
||||
local set_title = api.i18n.translate(use_nft and "Clear NFTSET on Reboot" or "Clear IPSET on Reboot")
|
||||
o = s:taboption("DNS", Flag, "flush_set_on_reboot", set_title, translate("Clear IPSET/NFTSET on service reboot. This may increase reboot time."))
|
||||
o.default = "0"
|
||||
o.rmempty = false
|
||||
|
||||
set_title = api.i18n.translate(use_nft and "Clear NFTSET" or "Clear IPSET")
|
||||
o = s:taboption("DNS", DummyValue, "clear_ipset", set_title, translate("Try this feature if the rule modification does not take effect."))
|
||||
@@ -766,8 +760,29 @@ if has_singbox or has_xray then
|
||||
end
|
||||
|
||||
for k, v in pairs(nodes_table) do
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
if #normal_list == 0 then
|
||||
break
|
||||
end
|
||||
if v.protocol == "_shunt" then
|
||||
if has_singbox or has_xray then
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
|
||||
s.fields["xray_dns_mode"]:depends({ [v.id .. "-type"] = "Xray", tcp_node = v.id })
|
||||
s.fields["singbox_dns_mode"]:depends({ [v.id .. "-type"] = "sing-box", tcp_node = v.id })
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
s.fields["remote_fakedns"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
else
|
||||
s.fields["tcp_node"]:value(v.id, v["remark"])
|
||||
s.fields["udp_node"]:value(v.id, v["remark"])
|
||||
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "chinadns-ng", tcp_node = v.id })
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "dnsmasq", tcp_node = v.id })
|
||||
if api.is_finded("smartdns") then
|
||||
s.fields["smartdns_dns_mode"]:depends({ dns_shunt = "smartdns", tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
if v.type == "Socks" then
|
||||
if has_singbox or has_xray then
|
||||
s2.fields["node"]:value(v.id, v["remark"])
|
||||
@@ -775,21 +790,6 @@ for k, v in pairs(nodes_table) do
|
||||
else
|
||||
s2.fields["node"]:value(v.id, v["remark"])
|
||||
end
|
||||
|
||||
if v.protocol ~= "_shunt" then
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "chinadns-ng", tcp_node = v.id })
|
||||
s.fields["dns_mode"]:depends({ dns_shunt = "dnsmasq", tcp_node = v.id })
|
||||
if api.is_finded("smartdns") then
|
||||
s.fields["smartdns_dns_mode"]:depends({ dns_shunt = "smartdns", tcp_node = v.id })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for k, v in pairs(shunt_list) do
|
||||
s.fields["xray_dns_mode"]:depends({ [v.id .. "-type"] = "Xray", tcp_node = v.id })
|
||||
s.fields["singbox_dns_mode"]:depends({ [v.id .. "-type"] = "sing-box", tcp_node = v.id })
|
||||
s.fields["remote_dns_client_ip"]:depends({ tcp_node = v.id })
|
||||
s.fields["remote_fakedns"]:depends({ tcp_node = v.id })
|
||||
end
|
||||
|
||||
m:append(Template(appname .. "/global/footer"))
|
||||
|
||||
@@ -194,7 +194,7 @@ o.validate = function(self, value, section)
|
||||
end
|
||||
o.write = function(self, section, value)
|
||||
local old = m:get(section, self.option) or ""
|
||||
if old:lower() ~= value:lower() then
|
||||
if old ~= value then
|
||||
m.uci:foreach(appname, "nodes", function(e)
|
||||
if e["group"] and e["group"]:lower() == old:lower() then
|
||||
m.uci:set(appname, e[".name"], "group", value)
|
||||
|
||||
@@ -107,7 +107,7 @@ o.validate = function(self, value, section)
|
||||
end
|
||||
o.write = function(self, section, value)
|
||||
local old = m:get(section, self.option) or ""
|
||||
if old:lower() ~= value:lower() then
|
||||
if old ~= value then
|
||||
m.uci:foreach(appname, "nodes", function(e)
|
||||
if e["group"] and e["group"]:lower() == old:lower() then
|
||||
m.uci:set(appname, e[".name"], "group", value)
|
||||
|
||||
@@ -1205,7 +1205,7 @@ function get_version()
|
||||
if not version or #version == 0 then
|
||||
version = sys.exec("apk list luci-app-passwall 2>/dev/null | awk '/installed/ {print $1}' | cut -d'-' -f4-")
|
||||
end
|
||||
return version or ""
|
||||
return (version or ""):gsub("\n", "")
|
||||
end
|
||||
|
||||
function to_check_self()
|
||||
|
||||
@@ -111,7 +111,10 @@ local version = {}
|
||||
} else {
|
||||
btn.disabled = true;
|
||||
btn.value = noUpdateText;
|
||||
window['_' + app + '-force_btn'].style.display = "inline";
|
||||
var forceBtn = document.getElementById('_' + app + '-force_btn');
|
||||
if (forceBtn) {
|
||||
forceBtn.style.display = "inline";
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
|
||||
@@ -21,13 +21,13 @@ define Download/geoip
|
||||
HASH:=2445b44d9ae3ab9a867c9d1e0e244646c4c378622e14b9afaf3658ecf46a40b9
|
||||
endef
|
||||
|
||||
GEOSITE_VER:=20251114093154
|
||||
GEOSITE_VER:=20251115145809
|
||||
GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
|
||||
define Download/geosite
|
||||
URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
|
||||
URL_FILE:=dlc.dat
|
||||
FILE:=$(GEOSITE_FILE)
|
||||
HASH:=0789b961eb45a2cb35f60962a36bf37b8178ed57bab47bd91320140dc804f150
|
||||
HASH:=c41cd987bdd3dda6df67bbf15790713c833e59c619e289e7673bcec178db90c0
|
||||
endef
|
||||
|
||||
GEOSITE_IRAN_VER:=202511100042
|
||||
|
||||
+10
-10
@@ -11,7 +11,7 @@ require (
|
||||
github.com/miekg/dns v1.1.68
|
||||
github.com/pelletier/go-toml v1.9.5
|
||||
github.com/pires/go-proxyproto v0.8.1
|
||||
github.com/quic-go/quic-go v0.55.0
|
||||
github.com/quic-go/quic-go v0.56.0
|
||||
github.com/refraction-networking/utls v1.8.1
|
||||
github.com/sagernet/sing v0.5.1
|
||||
github.com/sagernet/sing-shadowsocks v0.2.7
|
||||
@@ -21,10 +21,10 @@ require (
|
||||
github.com/vishvananda/netlink v1.3.1
|
||||
github.com/xtls/reality v0.0.0-20251014195629-e4eec4520535
|
||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
|
||||
golang.org/x/crypto v0.43.0
|
||||
golang.org/x/net v0.46.0
|
||||
golang.org/x/sync v0.17.0
|
||||
golang.org/x/sys v0.37.0
|
||||
golang.org/x/crypto v0.44.0
|
||||
golang.org/x/net v0.47.0
|
||||
golang.org/x/sync v0.18.0
|
||||
golang.org/x/sys v0.38.0
|
||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
|
||||
google.golang.org/grpc v1.76.0
|
||||
google.golang.org/protobuf v1.36.10
|
||||
@@ -41,15 +41,15 @@ require (
|
||||
github.com/juju/ratelimit v1.0.2 // indirect
|
||||
github.com/klauspost/compress v1.17.4 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
|
||||
github.com/kr/pretty v0.3.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/quic-go/qpack v0.5.1 // indirect
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
|
||||
github.com/vishvananda/netns v0.0.5 // indirect
|
||||
golang.org/x/mod v0.28.0 // indirect
|
||||
golang.org/x/text v0.30.0 // indirect
|
||||
golang.org/x/time v0.7.0 // indirect
|
||||
golang.org/x/tools v0.37.0 // indirect
|
||||
golang.org/x/mod v0.29.0 // indirect
|
||||
golang.org/x/text v0.31.0 // indirect
|
||||
golang.org/x/time v0.12.0 // indirect
|
||||
golang.org/x/tools v0.38.0 // indirect
|
||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
||||
+20
-21
@@ -46,19 +46,18 @@ github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoU
|
||||
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
|
||||
github.com/pires/go-proxyproto v0.8.1 h1:9KEixbdJfhrbtjpz/ZwCdWDD2Xem0NZ38qMYaASJgp0=
|
||||
github.com/pires/go-proxyproto v0.8.1/go.mod h1:ZKAAyp3cgy5Y5Mo4n9AlScrkCZwUy0g3Jf+slqQVcuU=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
||||
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
||||
github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk=
|
||||
github.com/quic-go/quic-go v0.55.0/go.mod h1:DR51ilwU1uE164KuWXhinFcKWGlEjzys2l8zUl5Ss1U=
|
||||
github.com/quic-go/quic-go v0.56.0 h1:q/TW+OLismmXAehgFLczhCDTYB3bFmua4D9lsNBWxvY=
|
||||
github.com/quic-go/quic-go v0.56.0/go.mod h1:9gx5KsFQtw2oZ6GZTyh+7YEvOxWCL9WZAepnHxgAo6c=
|
||||
github.com/refraction-networking/utls v1.8.1 h1:yNY1kapmQU8JeM1sSw2H2asfTIwWxIkrMJI0pRUOCAo=
|
||||
github.com/refraction-networking/utls v1.8.1/go.mod h1:jkSOEkLqn+S/jtpEHPOsVv/4V4EVnelwbMQl4vCWXAM=
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
|
||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
|
||||
github.com/sagernet/sing v0.5.1 h1:mhL/MZVq0TjuvHcpYcFtmSD1BFOxZ/+8ofbNZcg1k1Y=
|
||||
github.com/sagernet/sing v0.5.1/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
|
||||
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
|
||||
@@ -96,20 +95,20 @@ go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBs
|
||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
|
||||
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
|
||||
golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU=
|
||||
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
|
||||
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
|
||||
golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
|
||||
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
|
||||
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
|
||||
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
|
||||
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
||||
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
|
||||
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
|
||||
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -117,21 +116,21 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
|
||||
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
||||
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
|
||||
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
|
||||
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
|
||||
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
||||
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
|
||||
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
|
||||
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
|
||||
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
|
||||
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
|
||||
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
||||
@@ -629,6 +629,9 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
|
||||
config.ShortIds = make([][]byte, len(c.ShortIds))
|
||||
for i, s := range c.ShortIds {
|
||||
config.ShortIds[i] = make([]byte, 8)
|
||||
if len(s) > 16 {
|
||||
return nil, errors.New(`invalid "shortIds[`, i, `]": `, s)
|
||||
}
|
||||
if _, err = hex.Decode(config.ShortIds[i], []byte(s)); err != nil {
|
||||
return nil, errors.New(`invalid "shortIds[`, i, `]": `, s)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package wireguard
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"net/netip"
|
||||
"strconv"
|
||||
@@ -153,7 +152,7 @@ func (bind *netBindClient) connectTo(endpoint *netEndpoint) error {
|
||||
v.endpoint = endpoint
|
||||
v.err = err
|
||||
v.waiter.Done()
|
||||
if err != nil && errors.Is(err, io.EOF) {
|
||||
if err != nil {
|
||||
endpoint.conn = nil
|
||||
return
|
||||
}
|
||||
|
||||
@@ -268,6 +268,7 @@ from .bitchute import (
|
||||
BitChuteChannelIE,
|
||||
BitChuteIE,
|
||||
)
|
||||
from .bitmovin import BitmovinIE
|
||||
from .blackboardcollaborate import (
|
||||
BlackboardCollaborateIE,
|
||||
BlackboardCollaborateLaunchIE,
|
||||
@@ -1368,6 +1369,7 @@ from .nova import (
|
||||
NovaIE,
|
||||
)
|
||||
from .novaplay import NovaPlayIE
|
||||
from .nowcanal import NowCanalIE
|
||||
from .nowness import (
|
||||
NownessIE,
|
||||
NownessPlaylistIE,
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils.traversal import traverse_obj
|
||||
|
||||
|
||||
class BitmovinIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://streams\.bitmovin\.com/(?P<id>\w+)'
|
||||
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//streams\.bitmovin\.com/(?P<id>\w+)[^"\']+)']
|
||||
_TESTS = [{
|
||||
'url': 'https://streams.bitmovin.com/cqkl1t5giv3lrce7pjbg/embed',
|
||||
'info_dict': {
|
||||
'id': 'cqkl1t5giv3lrce7pjbg',
|
||||
'ext': 'mp4',
|
||||
'title': 'Developing Osteopathic Residents as Faculty',
|
||||
'thumbnail': 'https://streams.bitmovin.com/cqkl1t5giv3lrce7pjbg/poster',
|
||||
},
|
||||
'params': {'skip_download': 'm3u8'},
|
||||
}, {
|
||||
'url': 'https://streams.bitmovin.com/cgl9rh94uvs51rqc8jhg/share',
|
||||
'info_dict': {
|
||||
'id': 'cgl9rh94uvs51rqc8jhg',
|
||||
'ext': 'mp4',
|
||||
'title': 'Big Buck Bunny (Streams Docs)',
|
||||
'thumbnail': 'https://streams.bitmovin.com/cgl9rh94uvs51rqc8jhg/poster',
|
||||
},
|
||||
'params': {'skip_download': 'm3u8'},
|
||||
}]
|
||||
_WEBPAGE_TESTS = [{
|
||||
# bitmovin-stream web component
|
||||
'url': 'https://www.institutionalinvestor.com/article/2bsw1in1l9k68mp9kritc/video-war-stories-over-board-games/best-case-i-get-fired-war-stories',
|
||||
'info_dict': {
|
||||
'id': 'cuiumeil6g115lc4li3g',
|
||||
'ext': 'mp4',
|
||||
'title': '[media] War Stories over Board Games: “Best Case: I Get Fired” ',
|
||||
'thumbnail': 'https://streams.bitmovin.com/cuiumeil6g115lc4li3g/poster',
|
||||
},
|
||||
'params': {'skip_download': 'm3u8'},
|
||||
}, {
|
||||
# iframe embed
|
||||
'url': 'https://www.clearblueionizer.com/en/pool-ionizers/mineral-pool-vs-saltwater-pool/',
|
||||
'info_dict': {
|
||||
'id': 'cvpvfsm1pf7itg7cfvtg',
|
||||
'ext': 'mp4',
|
||||
'title': 'Pool Ionizer vs. Salt Chlorinator',
|
||||
'thumbnail': 'https://streams.bitmovin.com/cvpvfsm1pf7itg7cfvtg/poster',
|
||||
},
|
||||
'params': {'skip_download': 'm3u8'},
|
||||
}]
|
||||
|
||||
@classmethod
|
||||
def _extract_embed_urls(cls, url, webpage):
|
||||
yield from super()._extract_embed_urls(url, webpage)
|
||||
for stream_id in re.findall(r'<bitmovin-stream\b[^>]*\bstream-id=["\'](?P<id>\w+)', webpage):
|
||||
yield f'https://streams.bitmovin.com/{stream_id}'
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
|
||||
player_config = self._download_json(
|
||||
f'https://streams.bitmovin.com/{video_id}/config', video_id)['sources']
|
||||
|
||||
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
|
||||
player_config['hls'], video_id, 'mp4')
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'formats': formats,
|
||||
'subtitles': subtitles,
|
||||
**traverse_obj(player_config, {
|
||||
'title': ('title', {str}),
|
||||
'thumbnail': ('poster', {str}),
|
||||
}),
|
||||
}
|
||||
@@ -109,6 +109,17 @@ class FloatplaneBaseIE(InfoExtractor):
|
||||
'hls_media_playlist_data': m3u8_data,
|
||||
'hls_aes': hls_aes or None,
|
||||
})
|
||||
|
||||
subtitles = {}
|
||||
automatic_captions = {}
|
||||
for sub_data in traverse_obj(metadata, ('textTracks', lambda _, v: url_or_none(v['src']))):
|
||||
sub_lang = sub_data.get('language') or 'en'
|
||||
sub_entry = {'url': sub_data['src']}
|
||||
if sub_data.get('generated'):
|
||||
automatic_captions.setdefault(sub_lang, []).append(sub_entry)
|
||||
else:
|
||||
subtitles.setdefault(sub_lang, []).append(sub_entry)
|
||||
|
||||
items.append({
|
||||
**common_info,
|
||||
'id': media_id,
|
||||
@@ -118,6 +129,8 @@ class FloatplaneBaseIE(InfoExtractor):
|
||||
'thumbnail': ('thumbnail', 'path', {url_or_none}),
|
||||
}),
|
||||
'formats': formats,
|
||||
'subtitles': subtitles,
|
||||
'automatic_captions': automatic_captions,
|
||||
})
|
||||
|
||||
post_info = {
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
from .brightcove import BrightcoveNewIE
|
||||
from .common import InfoExtractor
|
||||
|
||||
|
||||
class NowCanalIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?nowcanal\.pt(?:/[\w-]+)+/detalhe/(?P<id>[\w-]+)'
|
||||
_TESTS = [{
|
||||
'url': 'https://www.nowcanal.pt/ultimas/detalhe/pedro-sousa-hjulmand-pode-ter-uma-saida-limpa-do-sporting-daqui-a-um-ano',
|
||||
'md5': '047f17cb783e66e467d703e704bbc95d',
|
||||
'info_dict': {
|
||||
'id': '6376598467112',
|
||||
'ext': 'mp4',
|
||||
'title': 'Pedro Sousa «Hjulmand pode ter uma saída limpa do Sporting daqui a um ano»',
|
||||
'description': '',
|
||||
'uploader_id': '6108484330001',
|
||||
'duration': 65.237,
|
||||
'thumbnail': r're:^https://.+\.jpg',
|
||||
'timestamp': 1754440620,
|
||||
'upload_date': '20250806',
|
||||
'tags': ['now'],
|
||||
},
|
||||
}, {
|
||||
'url': 'https://www.nowcanal.pt/programas/frente-a-frente/detalhe/frente-a-frente-eva-cruzeiro-ps-e-rita-matias-chega',
|
||||
'only_matching': True,
|
||||
}]
|
||||
|
||||
_BC_URL_TMPL = 'https://players.brightcove.net/6108484330001/chhIqzukMq_default/index.html?videoId={}'
|
||||
|
||||
def _real_extract(self, url):
|
||||
display_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, display_id)
|
||||
|
||||
video_id = self._search_json(
|
||||
r'videoHandler\.addBrightcoveVideoWithJson\(\[',
|
||||
webpage, 'video data', display_id)['brightcoveVideoId']
|
||||
|
||||
return self.url_result(self._BC_URL_TMPL.format(video_id), BrightcoveNewIE)
|
||||
@@ -3,12 +3,14 @@ from ..utils import (
|
||||
MEDIA_EXTENSIONS,
|
||||
determine_ext,
|
||||
parse_iso8601,
|
||||
traverse_obj,
|
||||
url_or_none,
|
||||
)
|
||||
from ..utils.traversal import traverse_obj
|
||||
|
||||
|
||||
class RinseFMBaseIE(InfoExtractor):
|
||||
_API_BASE = 'https://rinse.fm/api/query/v1'
|
||||
|
||||
@staticmethod
|
||||
def _parse_entry(entry):
|
||||
return {
|
||||
@@ -45,8 +47,10 @@ class RinseFMIE(RinseFMBaseIE):
|
||||
|
||||
def _real_extract(self, url):
|
||||
display_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, display_id)
|
||||
entry = self._search_nextjs_data(webpage, display_id)['props']['pageProps']['entry']
|
||||
|
||||
entry = self._download_json(
|
||||
f'{self._API_BASE}/episodes/{display_id}', display_id,
|
||||
note='Downloading episode data from API')['entry']
|
||||
|
||||
return self._parse_entry(entry)
|
||||
|
||||
@@ -58,32 +62,35 @@ class RinseFMArtistPlaylistIE(RinseFMBaseIE):
|
||||
'info_dict': {
|
||||
'id': 'resources',
|
||||
'title': '[re]sources',
|
||||
'description': '[re]sources est un label parisien piloté par le DJ et producteur Tommy Kid.',
|
||||
'description': 'md5:fd6a7254e8273510e6d49fbf50edf392',
|
||||
},
|
||||
'playlist_mincount': 40,
|
||||
}, {
|
||||
'url': 'https://rinse.fm/shows/ivy/',
|
||||
'url': 'https://www.rinse.fm/shows/esk',
|
||||
'info_dict': {
|
||||
'id': 'ivy',
|
||||
'title': '[IVY]',
|
||||
'description': 'A dedicated space for DNB/Turbo House and 4x4.',
|
||||
'id': 'esk',
|
||||
'title': 'Esk',
|
||||
'description': 'md5:5893d7c1d411ae8dea7fba12f109aa98',
|
||||
},
|
||||
'playlist_mincount': 7,
|
||||
'playlist_mincount': 139,
|
||||
}]
|
||||
|
||||
def _entries(self, data):
|
||||
for episode in traverse_obj(data, (
|
||||
'props', 'pageProps', 'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio),
|
||||
'episodes', lambda _, v: determine_ext(v['fileUrl']) in MEDIA_EXTENSIONS.audio),
|
||||
):
|
||||
yield self._parse_entry(episode)
|
||||
|
||||
def _real_extract(self, url):
|
||||
playlist_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, playlist_id)
|
||||
title = self._og_search_title(webpage) or self._html_search_meta('title', webpage)
|
||||
description = self._og_search_description(webpage) or self._html_search_meta(
|
||||
'description', webpage)
|
||||
data = self._search_nextjs_data(webpage, playlist_id)
|
||||
|
||||
api_data = self._download_json(
|
||||
f'{self._API_BASE}/shows/{playlist_id}', playlist_id,
|
||||
note='Downloading show data from API')
|
||||
|
||||
return self.playlist_result(
|
||||
self._entries(data), playlist_id, title, description=description)
|
||||
self._entries(api_data), playlist_id,
|
||||
**traverse_obj(api_data, ('entry', {
|
||||
'title': ('title', {str}),
|
||||
'description': ('description', {str}),
|
||||
})))
|
||||
|
||||
Reference in New Issue
Block a user