From 2d1a3e7bc11c7e3614e74acb1fe8342868f5d6e8 Mon Sep 17 00:00:00 2001 From: "github-action[bot]" Date: Sat, 15 Nov 2025 19:34:54 +0100 Subject: [PATCH] Update On Sat Nov 15 19:34:53 CET 2025 --- .github/update.log | 1 + clash-meta/listener/inbound/mieru.go | 2 + filebrowser/CHANGELOG.md | 8 + filebrowser/auth/hook.go | 2 +- filebrowser/auth/json.go | 2 +- filebrowser/cmd/root.go | 14 +- filebrowser/cmd/users.go | 4 +- filebrowser/cmd/users_import.go | 2 +- filebrowser/cmd/utils.go | 18 +- filebrowser/diskcache/file_cache.go | 4 +- filebrowser/diskcache/file_cache_test.go | 2 +- filebrowser/files/file.go | 7 +- filebrowser/files/mime.go | 1 - filebrowser/http/commands.go | 11 +- filebrowser/http/public_test.go | 4 +- filebrowser/http/share.go | 1 - filebrowser/http/static.go | 4 +- filebrowser/img/service.go | 2 +- filebrowser/runner/runner.go | 4 +- filebrowser/users/assets.go | 1 - filebrowser/users/storage.go | 2 +- filebrowser/users/users.go | 4 +- lede/include/kernel-6.12 | 4 +- lede/include/kernel-6.6 | 4 +- lede/package/boot/uboot-rk35xx/Makefile | 31 +- .../patches/100-disable-optee-build.patch | 18 - .../uboot-rk35xx/src/configs/rk3566_defconfig | 224 --------- lede/package/boot/uboot-rockchip/Makefile | 17 + ...chip-rk3588s-rock-5c-Add-support-for.patch | 32 ++ ...0-Use-MEDIA_BUS_FMT_UYVY8_1X16-for-C.patch | 48 ++ ...0-Add-support-for-V4L2_CID_LINK_FREQ.patch | 98 ++++ .../0151-arm64-qcom-ipq6018-nss_port5.patch | 125 +++++ .../dts/rockchip/rk3566-radxa-zero-3.dtsi | 73 --- ...6-zero-3e.dts => rk3566-radxa-zero-3e.dts} | 0 ...6-zero-3w.dts => rk3566-radxa-zero-3w.dts} | 4 - .../boot/dts/rockchip/rk3588s-rock-5c.dts | 77 +-- lede/target/linux/rockchip/image/armv8.mk | 15 +- ...chip-Split-up-RK3588-s-PCIe-pinctrls.patch | 444 ------------------ ...ts-rockchip-Add-HDMI0-node-to-rk3588.patch | 61 --- ...ip-Use-dma-noncoherent-in-base-RK358.patch | 51 -- ...ip-Enable-HDMI0-PHY-clk-provider-on-.patch | 28 -- ...ip-Add-HDMI0-PHY-PLL-clock-source-to.patch | 38 -- ...ip-Fix-label-name-of-hdptxphy-for-RK.patch | 44 -- ...ip-Add-PHY-node-for-HDMI1-TX-port-on.patch | 52 -- ...ts-rockchip-Add-HDMI1-node-on-RK3588.patch | 63 --- ...ip-Enable-HDMI1-PHY-clk-provider-on-.patch | 27 -- ...ip-Add-HDMI1-PHY-PLL-clock-source-to.patch | 48 -- ...-dts-rockchip-Add-rng-node-to-RK3588.patch | 34 -- ...ip-Add-HDMI-audio-outputs-for-rk3588.patch | 91 ---- ...ip-Add-GPU-power-domain-regulator-de.patch | 46 -- ...ip-change-rng-reset-id-back-to-its-c.patch | 25 - ...ip-Add-device-tree-support-for-HDMI-.patch | 88 ---- ...-reset-Add-SCMI-reset-IDs-for-RK3588.patch | 74 --- ...ip-add-hardware-random-number-genera.patch | 19 + mieru/apis/client/interface.go | 4 +- mieru/pkg/congestion/rtt.go | 2 +- mieru/pkg/congestion/rtt_test.go | 4 +- mieru/pkg/protocol/mux.go | 1 + mieru/pkg/protocol/segment.go | 7 + mieru/pkg/protocol/session.go | 144 +++--- mieru/pkg/protocol/underlay_base.go | 8 +- mieru/pkg/protocol/underlay_packet.go | 312 ++++++------ mieru/pkg/protocol/underlay_stream.go | 2 +- mihomo/listener/inbound/mieru.go | 2 + openwrt-packages/filebrowser/Makefile | 4 +- openwrt-passwall/luci-app-passwall/Makefile | 2 +- .../luasrc/controller/passwall.lua | 14 + .../model/cbi/passwall/client/acl_config.lua | 65 ++- .../model/cbi/passwall/client/global.lua | 66 +-- .../cbi/passwall/client/node_subscribe.lua | 2 +- .../passwall/client/node_subscribe_config.lua | 2 +- .../luci-app-passwall/luasrc/passwall/api.lua | 2 +- .../view/passwall/app_update/app_version.htm | 5 +- .../view/passwall/node_list/node_list.htm | 16 +- shadowsocks-rust/Cargo.lock | 4 +- .../crates/shadowsocks-service/Cargo.toml | 2 +- small/luci-app-passwall/Makefile | 2 +- .../model/cbi/passwall/client/acl_config.lua | 65 ++- .../model/cbi/passwall/client/global.lua | 66 +-- .../cbi/passwall/client/node_subscribe.lua | 2 +- .../passwall/client/node_subscribe_config.lua | 2 +- .../luci-app-passwall/luasrc/passwall/api.lua | 2 +- .../view/passwall/app_update/app_version.htm | 5 +- small/v2ray-geodata/Makefile | 4 +- xray-core/go.mod | 20 +- xray-core/go.sum | 41 +- xray-core/infra/conf/transport_internet.go | 3 + xray-core/proxy/wireguard/bind.go | 3 +- yt-dlp/yt_dlp/extractor/_extractors.py | 2 + yt-dlp/yt_dlp/extractor/bitmovin.py | 74 +++ yt-dlp/yt_dlp/extractor/floatplane.py | 13 + yt-dlp/yt_dlp/extractor/nowcanal.py | 37 ++ yt-dlp/yt_dlp/extractor/rinsefm.py | 39 +- 93 files changed, 1073 insertions(+), 2080 deletions(-) delete mode 100644 lede/package/boot/uboot-rk35xx/src/configs/rk3566_defconfig create mode 100644 lede/package/boot/uboot-rockchip/patches/204-rockchip-rk3588s-rock-5c-Add-support-for.patch create mode 100644 lede/target/linux/bcm27xx/patches-6.12/950-0409-media-i2c-adv7180-Use-MEDIA_BUS_FMT_UYVY8_1X16-for-C.patch create mode 100644 lede/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch create mode 100644 lede/target/linux/qualcommax/patches-6.12/0151-arm64-qcom-ipq6018-nss_port5.patch rename lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/{rk3566-zero-3e.dts => rk3566-radxa-zero-3e.dts} (100%) rename lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/{rk3566-zero-3w.dts => rk3566-radxa-zero-3w.dts} (98%) delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-02-v6.13-arm64-dts-rockchip-Add-HDMI0-node-to-rk3588.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-03-v6.15-arm64-dts-rockchip-Use-dma-noncoherent-in-base-RK358.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-04-v6.15-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider-on-.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-05-v6.15-arm64-dts-rockchip-Add-HDMI0-PHY-PLL-clock-source-to.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-06-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-07-v6.15-arm64-dts-rockchip-Add-PHY-node-for-HDMI1-TX-port-on.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-08-v6.15-arm64-dts-rockchip-Add-HDMI1-node-on-RK3588.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-09-v6.15-arm64-dts-rockchip-Enable-HDMI1-PHY-clk-provider-on-.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-10-v6.15-arm64-dts-rockchip-Add-HDMI1-PHY-PLL-clock-source-to.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-11-v6.15-arm64-dts-rockchip-Add-rng-node-to-RK3588.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-12-v6.15-arm64-dts-rockchip-Add-HDMI-audio-outputs-for-rk3588.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-13-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-14-v6.15-arm64-dts-rockchip-change-rng-reset-id-back-to-its-c.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/001-15-v6.15-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch delete mode 100644 lede/target/linux/rockchip/patches-6.12/031-01-v6.15-dt-bindings-reset-Add-SCMI-reset-IDs-for-RK3588.patch create mode 100644 yt-dlp/yt_dlp/extractor/bitmovin.py create mode 100644 yt-dlp/yt_dlp/extractor/nowcanal.py diff --git a/.github/update.log b/.github/update.log index 72c106bc60..3c2b0f6ca5 100644 --- a/.github/update.log +++ b/.github/update.log @@ -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 diff --git a/clash-meta/listener/inbound/mieru.go b/clash-meta/listener/inbound/mieru.go index cf8cc403bc..8a5718a636 100644 --- a/clash-meta/listener/inbound/mieru.go +++ b/clash-meta/listener/inbound/mieru.go @@ -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...) diff --git a/filebrowser/CHANGELOG.md b/filebrowser/CHANGELOG.md index 7b21953d6d..70d61c7128 100644 --- a/filebrowser/CHANGELOG.md +++ b/filebrowser/CHANGELOG.md @@ -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) diff --git a/filebrowser/auth/hook.go b/filebrowser/auth/hook.go index 2ecb12f3d4..ec3c5bfb05 100644 --- a/filebrowser/auth/hook.go +++ b/filebrowser/auth/hook.go @@ -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() diff --git a/filebrowser/auth/json.go b/filebrowser/auth/json.go index 81f430b36f..f779c476d0 100644 --- a/filebrowser/auth/json.go +++ b/filebrowser/auth/json.go @@ -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 diff --git a/filebrowser/cmd/root.go b/filebrowser/cmd/root.go index 8f7937429d..24f5d07727 100644 --- a/filebrowser/cmd/root.go +++ b/filebrowser/cmd/root.go @@ -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 diff --git a/filebrowser/cmd/users.go b/filebrowser/cmd/users.go index 64cd08eeb6..c2e2ce1ef7 100644 --- a/filebrowser/cmd/users.go +++ b/filebrowser/cmd/users.go @@ -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 { diff --git a/filebrowser/cmd/users_import.go b/filebrowser/cmd/users_import.go index d20dca682d..74353c2c9f 100644 --- a/filebrowser/cmd/users_import.go +++ b/filebrowser/cmd/users_import.go @@ -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) } } diff --git a/filebrowser/cmd/utils.go b/filebrowser/cmd/utils.go index 1971afd4b6..cc71834109 100644 --- a/filebrowser/cmd/utils.go +++ b/filebrowser/cmd/utils.go @@ -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 diff --git a/filebrowser/diskcache/file_cache.go b/filebrowser/diskcache/file_cache.go index cd5e27c767..b2979e4bc3 100644 --- a/filebrowser/diskcache/file_cache.go +++ b/filebrowser/diskcache/file_cache.go @@ -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) diff --git a/filebrowser/diskcache/file_cache_test.go b/filebrowser/diskcache/file_cache_test.go index 31d58c8eb7..9a41052e50 100644 --- a/filebrowser/diskcache/file_cache_test.go +++ b/filebrowser/diskcache/file_cache_test.go @@ -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) diff --git a/filebrowser/files/file.go b/filebrowser/files/file.go index 8e27e549b3..0f96440ed3 100644 --- a/filebrowser/files/file.go +++ b/filebrowser/files/file.go @@ -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() diff --git a/filebrowser/files/mime.go b/filebrowser/files/mime.go index 33fd93bd49..baa4d6d56c 100644 --- a/filebrowser/files/mime.go +++ b/filebrowser/files/mime.go @@ -600,7 +600,6 @@ var types = map[string]string{ ".epub": "application/epub+zip", } -//nolint:gochecknoinits func init() { for ext, typ := range types { // skip errors diff --git a/filebrowser/http/commands.go b/filebrowser/http/commands.go index 1da1f75c22..6229d59749 100644 --- a/filebrowser/http/commands.go +++ b/filebrowser/http/commands.go @@ -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() diff --git a/filebrowser/http/public_test.go b/filebrowser/http/public_test.go index 9f89cbc0a1..f102cc07fe 100644 --- a/filebrowser/http/public_test.go +++ b/filebrowser/http/public_test.go @@ -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) } }) diff --git a/filebrowser/http/share.go b/filebrowser/http/share.go index d968c05be2..670629bd82 100644 --- a/filebrowser/http/share.go +++ b/filebrowser/http/share.go @@ -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 diff --git a/filebrowser/http/static.go b/filebrowser/http/static.go index 5a52940d90..be2c135cbf 100644 --- a/filebrowser/http/static.go +++ b/filebrowser/http/static.go @@ -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 } diff --git a/filebrowser/img/service.go b/filebrowser/img/service.go index 34a84c67bf..47aaddca48 100644 --- a/filebrowser/img/service.go +++ b/filebrowser/img/service.go @@ -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()) } diff --git a/filebrowser/runner/runner.go b/filebrowser/runner/runner.go index 00e7c16af9..3408a1eee0 100644 --- a/filebrowser/runner/runner.go +++ b/filebrowser/runner/runner.go @@ -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)) diff --git a/filebrowser/users/assets.go b/filebrowser/users/assets.go index a01aed413e..7b09580d6c 100644 --- a/filebrowser/users/assets.go +++ b/filebrowser/users/assets.go @@ -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 diff --git a/filebrowser/users/storage.go b/filebrowser/users/storage.go index 163082fbb4..1dd0da3f2a 100644 --- a/filebrowser/users/storage.go +++ b/filebrowser/users/storage.go @@ -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 } } diff --git a/filebrowser/users/users.go b/filebrowser/users/users.go index 020faf118e..987a94f24a 100644 --- a/filebrowser/users/users.go +++ b/filebrowser/users/users.go @@ -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) } diff --git a/lede/include/kernel-6.12 b/lede/include/kernel-6.12 index 920ea0645e..a55d78ec64 100644 --- a/lede/include/kernel-6.12 +++ b/lede/include/kernel-6.12 @@ -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 diff --git a/lede/include/kernel-6.6 b/lede/include/kernel-6.6 index 6bedc40098..706c50ef7b 100644 --- a/lede/include/kernel-6.6 +++ b/lede/include/kernel-6.6 @@ -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 diff --git a/lede/package/boot/uboot-rk35xx/Makefile b/lede/package/boot/uboot-rk35xx/Makefile index 2aa3be0176..26fdc428d1 100644 --- a/lede/package/boot/uboot-rk35xx/Makefile +++ b/lede/package/boot/uboot-rk35xx/Makefile @@ -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 diff --git a/lede/package/boot/uboot-rk35xx/patches/100-disable-optee-build.patch b/lede/package/boot/uboot-rk35xx/patches/100-disable-optee-build.patch index 6b3baf6ebc..97a4c5e785 100644 --- a/lede/package/boot/uboot-rk35xx/patches/100-disable-optee-build.patch +++ b/lede/package/boot/uboot-rk35xx/patches/100-disable-optee-build.patch @@ -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 diff --git a/lede/package/boot/uboot-rk35xx/src/configs/rk3566_defconfig b/lede/package/boot/uboot-rk35xx/src/configs/rk3566_defconfig deleted file mode 100644 index dde1e26b75..0000000000 --- a/lede/package/boot/uboot-rk35xx/src/configs/rk3566_defconfig +++ /dev/null @@ -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 diff --git a/lede/package/boot/uboot-rockchip/Makefile b/lede/package/boot/uboot-rockchip/Makefile index 5ad7be0e74..d84b22b406 100644 --- a/lede/package/boot/uboot-rockchip/Makefile +++ b/lede/package/boot/uboot-rockchip/Makefile @@ -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 \ diff --git a/lede/package/boot/uboot-rockchip/patches/204-rockchip-rk3588s-rock-5c-Add-support-for.patch b/lede/package/boot/uboot-rockchip/patches/204-rockchip-rk3588s-rock-5c-Add-support-for.patch new file mode 100644 index 0000000000..a69f9d87ef --- /dev/null +++ b/lede/package/boot/uboot-rockchip/patches/204-rockchip-rk3588s-rock-5c-Add-support-for.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jonas Karlman +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 + +--- 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 diff --git a/lede/target/linux/bcm27xx/patches-6.12/950-0409-media-i2c-adv7180-Use-MEDIA_BUS_FMT_UYVY8_1X16-for-C.patch b/lede/target/linux/bcm27xx/patches-6.12/950-0409-media-i2c-adv7180-Use-MEDIA_BUS_FMT_UYVY8_1X16-for-C.patch new file mode 100644 index 0000000000..5790d79ade --- /dev/null +++ b/lede/target/linux/bcm27xx/patches-6.12/950-0409-media-i2c-adv7180-Use-MEDIA_BUS_FMT_UYVY8_1X16-for-C.patch @@ -0,0 +1,48 @@ +From 8680ecfcb4570e5f68a7b1bc237dfdfcf65b389e Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +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 +--- + 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; diff --git a/lede/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch b/lede/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch new file mode 100644 index 0000000000..4bc7a684eb --- /dev/null +++ b/lede/target/linux/bcm27xx/patches-6.12/950-0410-media-i2c-adv7180-Add-support-for-V4L2_CID_LINK_FREQ.patch @@ -0,0 +1,98 @@ +From 7e58b9c99676d641ef76edd9c097f1c3c4e6c464 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +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 +--- + 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); diff --git a/lede/target/linux/qualcommax/patches-6.12/0151-arm64-qcom-ipq6018-nss_port5.patch b/lede/target/linux/qualcommax/patches-6.12/0151-arm64-qcom-ipq6018-nss_port5.patch new file mode 100644 index 0000000000..9e4372a878 --- /dev/null +++ b/lede/target/linux/qualcommax/patches-6.12/0151-arm64-qcom-ipq6018-nss_port5.patch @@ -0,0 +1,125 @@ +From 9989fcd49c52500a2bf1f6d49411690dec45d2dc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= +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 . + +Link: https://lore.kernel.org/all/20231220221724.3822-4-ansuelsmth@gmail.com/ +Signed-off-by: Marko Mäkelä +Tested-by: Marko Mäkelä +--- + 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, + }, + }; + diff --git a/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3.dtsi b/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3.dtsi index dd8f22f055..4f0e9f4b4e 100644 --- a/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3.dtsi +++ b/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3.dtsi @@ -35,7 +35,6 @@ led_green: led-green { color = ; - 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"; diff --git a/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-zero-3e.dts b/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3e.dts similarity index 100% rename from lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-zero-3e.dts rename to lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3e.dts diff --git a/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-zero-3w.dts b/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3w.dts similarity index 98% rename from lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-zero-3w.dts rename to lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3w.dts index f92475c59d..244b66084f 100644 --- a/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-zero-3w.dts +++ b/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3566-radxa-zero-3w.dts @@ -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>; diff --git a/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts b/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts index 7a58ce5977..71aaf17c03 100644 --- a/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts +++ b/lede/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts @@ -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 = ; default-state = "on"; function = LED_FUNCTION_POWER; gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>; }; - led-1 { + led: led-1 { color = ; 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 = ; - remote-endpoint = <&hdmi0_in_vp0>; - }; -}; diff --git a/lede/target/linux/rockchip/image/armv8.mk b/lede/target/linux/rockchip/image/armv8.mk index 81ac265b83..f8bf194715 100644 --- a/lede/target/linux/rockchip/image/armv8.mk +++ b/lede/target/linux/rockchip/image/armv8.mk @@ -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 diff --git a/lede/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch b/lede/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch deleted file mode 100644 index 9a58adf4cd..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-01-v6.13-arm64-dts-rockchip-Split-up-RK3588-s-PCIe-pinctrls.patch +++ /dev/null @@ -1,444 +0,0 @@ -From 4294e32111781b3de4d73b944cbd1bc1662a9a7a Mon Sep 17 00:00:00 2001 -From: Sam Edwards -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 -Link: https://lore.kernel.org/r/20240912025034.180233-2-CFSworks@gmail.com -Signed-off-by: Heiko Stuebner - ---- 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 { diff --git a/lede/target/linux/rockchip/patches-6.12/001-02-v6.13-arm64-dts-rockchip-Add-HDMI0-node-to-rk3588.patch b/lede/target/linux/rockchip/patches-6.12/001-02-v6.13-arm64-dts-rockchip-Add-HDMI0-node-to-rk3588.patch deleted file mode 100644 index 135e79342f..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-02-v6.13-arm64-dts-rockchip-Add-HDMI0-node-to-rk3588.patch +++ /dev/null @@ -1,61 +0,0 @@ -From d7bb71e69f58c1b3665a9f926bf8d3855111bf8e Mon Sep 17 00:00:00 2001 -From: Cristian Ciocaltea -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 -Link: https://lore.kernel.org/r/20241019-rk3588-hdmi0-dt-v2-1-466cd80e8ff9@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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 = , -+ , -+ , -+ , -+ ; -+ 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>; diff --git a/lede/target/linux/rockchip/patches-6.12/001-03-v6.15-arm64-dts-rockchip-Use-dma-noncoherent-in-base-RK358.patch b/lede/target/linux/rockchip/patches-6.12/001-03-v6.15-arm64-dts-rockchip-Use-dma-noncoherent-in-base-RK358.patch deleted file mode 100644 index 0f3a564413..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-03-v6.15-arm64-dts-rockchip-Use-dma-noncoherent-in-base-RK358.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 33b561eb66f1e271f2899e103c857d20425076f4 Mon Sep 17 00:00:00 2001 -From: Dragan Simic -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 -Cc: FUKAUMI Naoki -Acked-by: Marc Zyngier -Signed-off-by: Dragan Simic -Link: https://lore.kernel.org/r/fa1a672dae3644bb3caa58f03216d0ca349db88b.1736279094.git.dsimic@manjaro.org -Signed-off-by: Heiko Stuebner - ---- 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 = ; - 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>; - }; diff --git a/lede/target/linux/rockchip/patches-6.12/001-04-v6.15-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider-on-.patch b/lede/target/linux/rockchip/patches-6.12/001-04-v6.15-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider-on-.patch deleted file mode 100644 index 4a6c2ab64c..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-04-v6.15-arm64-dts-rockchip-Enable-HDMI0-PHY-clk-provider-on-.patch +++ /dev/null @@ -1,28 +0,0 @@ -From d0f17738778c12be629ba77ff00c43c3e9eb8428 Mon Sep 17 00:00:00 2001 -From: Cristian Ciocaltea -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 -Tested-by: FUKAUMI Naoki -Link: https://lore.kernel.org/r/20250204-vop2-hdmi0-disp-modes-v3-4-d71c6a196e58@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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>, diff --git a/lede/target/linux/rockchip/patches-6.12/001-05-v6.15-arm64-dts-rockchip-Add-HDMI0-PHY-PLL-clock-source-to.patch b/lede/target/linux/rockchip/patches-6.12/001-05-v6.15-arm64-dts-rockchip-Add-HDMI0-PHY-PLL-clock-source-to.patch deleted file mode 100644 index 9fc343efd4..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-05-v6.15-arm64-dts-rockchip-Add-HDMI0-PHY-PLL-clock-source-to.patch +++ /dev/null @@ -1,38 +0,0 @@ -From eb4262203d7d85eb7b6f2696816db272e41f5464 Mon Sep 17 00:00:00 2001 -From: Cristian Ciocaltea -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 -Signed-off-by: Cristian Ciocaltea -Link: https://lore.kernel.org/r/20250204-vop2-hdmi0-disp-modes-v3-5-d71c6a196e58@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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>; diff --git a/lede/target/linux/rockchip/patches-6.12/001-06-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch b/lede/target/linux/rockchip/patches-6.12/001-06-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch deleted file mode 100644 index 6decd6e33f..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-06-v6.15-arm64-dts-rockchip-Fix-label-name-of-hdptxphy-for-RK.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 2efdb041019fd6c58abefba3eb6fdc4d659e576c Mon Sep 17 00:00:00 2001 -From: Damon Ding -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 -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 - ---- 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 @@ - , - ; - 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>; diff --git a/lede/target/linux/rockchip/patches-6.12/001-07-v6.15-arm64-dts-rockchip-Add-PHY-node-for-HDMI1-TX-port-on.patch b/lede/target/linux/rockchip/patches-6.12/001-07-v6.15-arm64-dts-rockchip-Add-PHY-node-for-HDMI1-TX-port-on.patch deleted file mode 100644 index 62371943f0..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-07-v6.15-arm64-dts-rockchip-Add-PHY-node-for-HDMI1-TX-port-on.patch +++ /dev/null @@ -1,52 +0,0 @@ -From ea97212a0f66b7bd71c23c12f781f1770dd6fcff Mon Sep 17 00:00:00 2001 -From: Cristian Ciocaltea -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 -Tested-by: Jagan Teki # edgeble-6tops-modules -Tested-by: Alexandre ARNOUD -Link: https://lore.kernel.org/r/20241211-rk3588-hdmi1-v2-2-02cdca22ff68@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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>; diff --git a/lede/target/linux/rockchip/patches-6.12/001-08-v6.15-arm64-dts-rockchip-Add-HDMI1-node-on-RK3588.patch b/lede/target/linux/rockchip/patches-6.12/001-08-v6.15-arm64-dts-rockchip-Add-HDMI1-node-on-RK3588.patch deleted file mode 100644 index 26672d90b4..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-08-v6.15-arm64-dts-rockchip-Add-HDMI1-node-on-RK3588.patch +++ /dev/null @@ -1,63 +0,0 @@ -From bed6964e779b5853de042da14320edf9f79506fe Mon Sep 17 00:00:00 2001 -From: Cristian Ciocaltea -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 -Tested-by: Jagan Teki # edgeble-6tops-modules -Tested-by: Alexandre ARNOUD -Link: https://lore.kernel.org/r/20241211-rk3588-hdmi1-v2-3-02cdca22ff68@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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 = , -+ , -+ , -+ , -+ ; -+ 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>; diff --git a/lede/target/linux/rockchip/patches-6.12/001-09-v6.15-arm64-dts-rockchip-Enable-HDMI1-PHY-clk-provider-on-.patch b/lede/target/linux/rockchip/patches-6.12/001-09-v6.15-arm64-dts-rockchip-Enable-HDMI1-PHY-clk-provider-on-.patch deleted file mode 100644 index 3503f1a6e9..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-09-v6.15-arm64-dts-rockchip-Enable-HDMI1-PHY-clk-provider-on-.patch +++ /dev/null @@ -1,27 +0,0 @@ -From aadaa27956e3430217d9e6b8af5880e39b05b961 Mon Sep 17 00:00:00 2001 -From: Cristian Ciocaltea -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 -Link: https://lore.kernel.org/r/20250223-vop2-hdmi1-disp-modes-v2-3-f4cec5e06fbe@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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>, diff --git a/lede/target/linux/rockchip/patches-6.12/001-10-v6.15-arm64-dts-rockchip-Add-HDMI1-PHY-PLL-clock-source-to.patch b/lede/target/linux/rockchip/patches-6.12/001-10-v6.15-arm64-dts-rockchip-Add-HDMI1-PHY-PLL-clock-source-to.patch deleted file mode 100644 index eec7d0ad10..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-10-v6.15-arm64-dts-rockchip-Add-HDMI1-PHY-PLL-clock-source-to.patch +++ /dev/null @@ -1,48 +0,0 @@ -From b2e668a60ed866ba960acb5310d1fb6bf81d154f Mon Sep 17 00:00:00 2001 -From: Cristian Ciocaltea -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 -Link: https://lore.kernel.org/r/20250223-vop2-hdmi1-disp-modes-v2-4-f4cec5e06fbe@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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"; -+}; diff --git a/lede/target/linux/rockchip/patches-6.12/001-11-v6.15-arm64-dts-rockchip-Add-rng-node-to-RK3588.patch b/lede/target/linux/rockchip/patches-6.12/001-11-v6.15-arm64-dts-rockchip-Add-rng-node-to-RK3588.patch deleted file mode 100644 index 1d955f8c14..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-11-v6.15-arm64-dts-rockchip-Add-rng-node-to-RK3588.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 6ee0b9ad3995ee5fa229035c69013b7dd0d3634b Mon Sep 17 00:00:00 2001 -From: Nicolas Frattaroli -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 -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 ---- - 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 = ; -+ 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>; diff --git a/lede/target/linux/rockchip/patches-6.12/001-12-v6.15-arm64-dts-rockchip-Add-HDMI-audio-outputs-for-rk3588.patch b/lede/target/linux/rockchip/patches-6.12/001-12-v6.15-arm64-dts-rockchip-Add-HDMI-audio-outputs-for-rk3588.patch deleted file mode 100644 index 3e4ba5bf10..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-12-v6.15-arm64-dts-rockchip-Add-HDMI-audio-outputs-for-rk3588.patch +++ /dev/null @@ -1,91 +0,0 @@ -From b8c6c136971c0e9750eec89f367529b2854d3a3c Mon Sep 17 00:00:00 2001 -From: Detlev Casanova -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 # RK3588 Tiger Haikou -Signed-off-by: Detlev Casanova -Fixes: 419d1918105e ("ASoC: simple-card-utils: use __free(device_node) for device node") -Signed-off-by: Kuninori Morimoto -Link: https://lore.kernel.org/r/20250217215641.372723-3-detlev.casanova@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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 = ; -@@ -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 { diff --git a/lede/target/linux/rockchip/patches-6.12/001-13-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch b/lede/target/linux/rockchip/patches-6.12/001-13-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch deleted file mode 100644 index 5ad1c88d6d..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-13-v6.15-arm64-dts-rockchip-Add-GPU-power-domain-regulator-de.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f94500eb7328b35f3d0927635b1aba26c85ea4b0 Mon Sep 17 00:00:00 2001 -From: Sebastian Reichel -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 -Reported-by: Adrián Martínez Larumbe -Tested-by: Adrian Larumbe # On Rock 5B -Signed-off-by: Sebastian Reichel -Link: https://lore.kernel.org/r/20250220-rk3588-gpu-pwr-domain-regulator-v6-8-a4f9c24e5b81@kernel.org -Signed-off-by: Heiko Stuebner - ---- 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 = ; - clocks = <&cru CLK_GPU>, - <&cru CLK_GPU_COREGROUP>, diff --git a/lede/target/linux/rockchip/patches-6.12/001-14-v6.15-arm64-dts-rockchip-change-rng-reset-id-back-to-its-c.patch b/lede/target/linux/rockchip/patches-6.12/001-14-v6.15-arm64-dts-rockchip-change-rng-reset-id-back-to-its-c.patch deleted file mode 100644 index 91045bc80e..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-14-v6.15-arm64-dts-rockchip-change-rng-reset-id-back-to-its-c.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 55a43c346d24434e46ef7fcc09a9df8179c346e4 Mon Sep 17 00:00:00 2001 -From: Heiko Stuebner -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 ---- - 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 = ; - clocks = <&scmi_clk SCMI_HCLK_SECURE_NS>; -- resets = <&scmi_reset 48>; -+ resets = <&scmi_reset SCMI_SRST_H_TRNG_NS>; - }; - - i2s0_8ch: i2s@fe470000 { diff --git a/lede/target/linux/rockchip/patches-6.12/001-15-v6.15-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch b/lede/target/linux/rockchip/patches-6.12/001-15-v6.15-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch deleted file mode 100644 index f269185be5..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/001-15-v6.15-arm64-dts-rockchip-Add-device-tree-support-for-HDMI-.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 0327238991ba2d1de25e1116b1c064f433e45b8d Mon Sep 17 00:00:00 2001 -From: Shreeya Patel -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 -Tested-by: Dmitry Osipenko -Co-developed-by: Dingxian Wen -Signed-off-by: Dingxian Wen -Signed-off-by: Shreeya Patel -Signed-off-by: Dmitry Osipenko -Link: https://lore.kernel.org/r/20250307091857.646581-2-dmitry.osipenko@collabora.com -Signed-off-by: Heiko Stuebner - ---- 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 = , -+ , -+ ; -+ 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>; diff --git a/lede/target/linux/rockchip/patches-6.12/031-01-v6.15-dt-bindings-reset-Add-SCMI-reset-IDs-for-RK3588.patch b/lede/target/linux/rockchip/patches-6.12/031-01-v6.15-dt-bindings-reset-Add-SCMI-reset-IDs-for-RK3588.patch deleted file mode 100644 index 8f98680aea..0000000000 --- a/lede/target/linux/rockchip/patches-6.12/031-01-v6.15-dt-bindings-reset-Add-SCMI-reset-IDs-for-RK3588.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 849d9db170fc8a03ce9f64133a1d0cd46c135105 Mon Sep 17 00:00:00 2001 -From: Nicolas Frattaroli -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 -Signed-off-by: XiaoDong Huang -Acked-by: Conor Dooley -Signed-off-by: Nicolas Frattaroli -Signed-off-by: Herbert Xu ---- - .../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 -@@ -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 diff --git a/lede/target/linux/rockchip/patches-6.12/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch b/lede/target/linux/rockchip/patches-6.12/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch index 72a44c9f10..c9f99a9701 100644 --- a/lede/target/linux/rockchip/patches-6.12/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch +++ b/lede/target/linux/rockchip/patches-6.12/802-arm64-dts-rockchip-add-hardware-random-number-genera.patch @@ -24,3 +24,22 @@ Signed-off-by: wevsty 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 = ; ++ 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>; diff --git a/mieru/apis/client/interface.go b/mieru/apis/client/interface.go index e3993745d8..4ebc0e2269 100644 --- a/mieru/apis/client/interface.go +++ b/mieru/apis/client/interface.go @@ -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 } diff --git a/mieru/pkg/congestion/rtt.go b/mieru/pkg/congestion/rtt.go index 3fb492c7fc..769823d56e 100644 --- a/mieru/pkg/congestion/rtt.go +++ b/mieru/pkg/congestion/rtt.go @@ -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) ) diff --git a/mieru/pkg/congestion/rtt_test.go b/mieru/pkg/congestion/rtt_test.go index a86e52135e..87e8aab0eb 100644 --- a/mieru/pkg/congestion/rtt_test.go +++ b/mieru/pkg/congestion/rtt_test.go @@ -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) } } diff --git a/mieru/pkg/protocol/mux.go b/mieru/pkg/protocol/mux.go index bd90688bf3..c78b759559 100644 --- a/mieru/pkg/protocol/mux.go +++ b/mieru/pkg/protocol/mux.go @@ -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, } diff --git a/mieru/pkg/protocol/segment.go b/mieru/pkg/protocol/segment.go index fbde80c499..e12bf27b9e 100644 --- a/mieru/pkg/protocol/segment.go +++ b/mieru/pkg/protocol/segment.go @@ -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 diff --git a/mieru/pkg/protocol/session.go b/mieru/pkg/protocol/session.go index 495b8ce3e7..4fc17fbeac 100644 --- a/mieru/pkg/protocol/session.go +++ b/mieru/pkg/protocol/session.go @@ -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") diff --git a/mieru/pkg/protocol/underlay_base.go b/mieru/pkg/protocol/underlay_base.go index ba959d809d..4d6a3d7a31 100644 --- a/mieru/pkg/protocol/underlay_base.go +++ b/mieru/pkg/protocol/underlay_base.go @@ -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. diff --git a/mieru/pkg/protocol/underlay_packet.go b/mieru/pkg/protocol/underlay_packet.go index 9997e857e4..cdd98159eb 100644 --- a/mieru/pkg/protocol/underlay_packet.go +++ b/mieru/pkg/protocol/underlay_packet.go @@ -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 diff --git a/mieru/pkg/protocol/underlay_stream.go b/mieru/pkg/protocol/underlay_stream.go index 16a86f83b3..9c499a5af4 100644 --- a/mieru/pkg/protocol/underlay_stream.go +++ b/mieru/pkg/protocol/underlay_stream.go @@ -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 diff --git a/mihomo/listener/inbound/mieru.go b/mihomo/listener/inbound/mieru.go index cf8cc403bc..8a5718a636 100644 --- a/mihomo/listener/inbound/mieru.go +++ b/mihomo/listener/inbound/mieru.go @@ -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...) diff --git a/openwrt-packages/filebrowser/Makefile b/openwrt-packages/filebrowser/Makefile index c06281f87e..26df9d1c20 100644 --- a/openwrt-packages/filebrowser/Makefile +++ b/openwrt-packages/filebrowser/Makefile @@ -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 diff --git a/openwrt-passwall/luci-app-passwall/Makefile b/openwrt-passwall/luci-app-passwall/Makefile index aa8c73c6ec..bf0de6f304 100644 --- a/openwrt-passwall/luci-app-passwall/Makefile +++ b/openwrt-passwall/luci-app-passwall/Makefile @@ -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) diff --git a/openwrt-passwall/luci-app-passwall/luasrc/controller/passwall.lua b/openwrt-passwall/luci-app-passwall/luasrc/controller/passwall.lua index 267f8be6db..c9a72c2088 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/controller/passwall.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/controller/passwall.lua @@ -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 diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index 35c352b14d..48b0651917 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -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('%s', translate("The port settings support single ports and ranges.
Separate multiple ports with commas (,).
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 .. "" 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 diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua index 62075e013e..c0228939ae 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua @@ -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")) diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua index 3a49009236..65f7adc087 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe.lua @@ -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) diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua index 8619ad9675..184789d1bb 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/node_subscribe_config.lua @@ -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) diff --git a/openwrt-passwall/luci-app-passwall/luasrc/passwall/api.lua b/openwrt-passwall/luci-app-passwall/luasrc/passwall/api.lua index 55ffe57bdb..3519802b5d 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/passwall/api.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/passwall/api.lua @@ -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() diff --git a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/app_update/app_version.htm b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/app_update/app_version.htm index 4bedcc840c..cda606e76b 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/app_update/app_version.htm +++ b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/app_update/app_version.htm @@ -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); diff --git a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm index 05f3c84d5c..81ce9a866b 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm +++ b/openwrt-passwall/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm @@ -44,7 +44,6 @@ table td, .table .td { } - <% if api.is_js_luci() then -%> +<%- else %> + <%- end %>