diff --git a/.github/update.log b/.github/update.log index 0166f7a642..8d353792ff 100644 --- a/.github/update.log +++ b/.github/update.log @@ -917,3 +917,4 @@ Update On Fri Feb 14 19:34:35 CET 2025 Update On Sat Feb 15 19:30:59 CET 2025 Update On Sun Feb 16 19:32:22 CET 2025 Update On Mon Feb 17 19:35:15 CET 2025 +Update On Tue Feb 18 19:34:22 CET 2025 diff --git a/clash-meta-android/core/src/foss/golang/clash/.github/workflows/build.yml b/clash-meta-android/core/src/foss/golang/clash/.github/workflows/build.yml index 56c7b66d78..ee1266b802 100644 --- a/clash-meta-android/core/src/foss/golang/clash/.github/workflows/build.yml +++ b/clash-meta-android/core/src/foss/golang/clash/.github/workflows/build.yml @@ -54,7 +54,6 @@ jobs: - { goos: windows, goarch: '386', output: '386' } - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible } - { goos: windows, goarch: amd64, goamd64: v3, output: amd64 } - - { goos: windows, goarch: arm, goarm: '7', output: armv7 } - { goos: windows, goarch: arm64, output: arm64 } - { goos: freebsd, goarch: '386', output: '386' } @@ -67,6 +66,12 @@ jobs: - { goos: android, goarch: arm, ndk: armv7a-linux-androideabi34, output: armv7 } - { goos: android, goarch: arm64, ndk: aarch64-linux-android34, output: arm64-v8 } + # Go 1.23 with special patch can work on Windows 7 + # https://github.com/MetaCubeX/go/commits/release-branch.go1.23/ + - { goos: windows, goarch: '386', output: '386-go123', goversion: '1.23' } + - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go123, goversion: '1.23' } + - { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go123, goversion: '1.23' } + # Go 1.22 with special patch can work on Windows 7 # https://github.com/MetaCubeX/go/commits/release-branch.go1.22/ - { goos: windows, goarch: '386', output: '386-go122', goversion: '1.22' } @@ -95,6 +100,11 @@ jobs: - { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' } - { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' } + # Go 1.23 is the last release that requires Linux kernel version 2.6.32 or later. Go 1.24 will require Linux kernel version 3.2 or later. + - { goos: linux, goarch: '386', output: '386-go123', goversion: '1.23' } + - { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go123, goversion: '1.23', test: test } + - { goos: linux, goarch: amd64, goamd64: v3, output: amd64-go123, goversion: '1.23' } + # only for test - { goos: linux, goarch: '386', output: '386-go120', goversion: '1.20' } - { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20', test: test } @@ -107,7 +117,7 @@ jobs: if: ${{ matrix.jobs.goversion == '' && matrix.jobs.abi != '1' }} uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: '1.24' - name: Set up Go if: ${{ matrix.jobs.goversion != '' && matrix.jobs.abi != '1' }} @@ -122,6 +132,24 @@ jobs: sudo tar zxf go1.23.0.linux-amd64-abi1.tar.gz -C /usr/local echo "/usr/local/go/bin" >> $GITHUB_PATH + # modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557 + # this patch file only works on golang1.24.x + # that means after golang1.25 release it must be changed + # see: https://github.com/MetaCubeX/go/commits/release-branch.go1.24/ + # revert: + # 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng" + # 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7" + # 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround" + # a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries" + - name: Revert Golang1.24 commit for Windows7/8 + if: ${{ matrix.jobs.goos == 'windows' && matrix.jobs.goversion == '' }} + run: | + cd $(go env GOROOT) + curl https://github.com/MetaCubeX/go/commit/2a406dc9f1ea7323d6ca9fccb2fe9ddebb6b1cc8.diff | patch --verbose -p 1 + curl https://github.com/MetaCubeX/go/commit/7b1fd7d39c6be0185fbe1d929578ab372ac5c632.diff | patch --verbose -p 1 + curl https://github.com/MetaCubeX/go/commit/979d6d8bab3823ff572ace26767fd2ce3cf351ae.diff | patch --verbose -p 1 + curl https://github.com/MetaCubeX/go/commit/ac3e93c061779dfefc0dd13a5b6e6f764a25621e.diff | patch --verbose -p 1 + # modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557 # this patch file only works on golang1.23.x # that means after golang1.24 release it must be changed @@ -132,7 +160,7 @@ jobs: # 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround" # a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries" - name: Revert Golang1.23 commit for Windows7/8 - if: ${{ matrix.jobs.goos == 'windows' && matrix.jobs.goversion == '' }} + if: ${{ matrix.jobs.goos == 'windows' && matrix.jobs.goversion == '1.23' }} run: | cd $(go env GOROOT) curl https://github.com/MetaCubeX/go/commit/9ac42137ef6730e8b7daca016ece831297a1d75b.diff | patch --verbose -p 1 diff --git a/clash-meta-android/core/src/foss/golang/clash/adapter/outbound/anytls.go b/clash-meta-android/core/src/foss/golang/clash/adapter/outbound/anytls.go new file mode 100644 index 0000000000..482623ee8c --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/adapter/outbound/anytls.go @@ -0,0 +1,138 @@ +package outbound + +import ( + "context" + "errors" + "net" + "runtime" + "strconv" + "time" + + CN "github.com/metacubex/mihomo/common/net" + "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/proxydialer" + "github.com/metacubex/mihomo/component/resolver" + tlsC "github.com/metacubex/mihomo/component/tls" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/anytls" + "github.com/metacubex/mihomo/transport/vmess" + + M "github.com/sagernet/sing/common/metadata" + "github.com/sagernet/sing/common/uot" +) + +type AnyTLS struct { + *Base + client *anytls.Client + dialer proxydialer.SingDialer + option *AnyTLSOption +} + +type AnyTLSOption struct { + BasicOption + Name string `proxy:"name"` + Server string `proxy:"server"` + Port int `proxy:"port"` + Password string `proxy:"password"` + ALPN []string `proxy:"alpn,omitempty"` + SNI string `proxy:"sni,omitempty"` + ClientFingerprint string `proxy:"client-fingerprint,omitempty"` + SkipCertVerify bool `proxy:"skip-cert-verify,omitempty"` + Fingerprint string `proxy:"fingerprint,omitempty"` + UDP bool `proxy:"udp,omitempty"` + IdleSessionCheckInterval int `proxy:"idle-session-check-interval,omitempty"` + IdleSessionTimeout int `proxy:"idle-session-timeout,omitempty"` +} + +func (t *AnyTLS) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.Conn, err error) { + options := t.Base.DialOptions(opts...) + t.dialer.SetDialer(dialer.NewDialer(options...)) + c, err := t.client.CreateProxy(ctx, M.ParseSocksaddrHostPort(metadata.String(), metadata.DstPort)) + if err != nil { + return nil, err + } + return NewConn(CN.NewRefConn(c, t), t), nil +} + +func (t *AnyTLS) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error) { + // create tcp + options := t.Base.DialOptions(opts...) + t.dialer.SetDialer(dialer.NewDialer(options...)) + c, err := t.client.CreateProxy(ctx, uot.RequestDestination(2)) + if err != nil { + return nil, err + } + + // create uot on tcp + if !metadata.Resolved() { + ip, err := resolver.ResolveIP(ctx, metadata.Host) + if err != nil { + return nil, errors.New("can't resolve ip") + } + metadata.DstIP = ip + } + destination := M.SocksaddrFromNet(metadata.UDPAddr()) + return newPacketConn(CN.NewRefPacketConn(CN.NewThreadSafePacketConn(uot.NewLazyConn(c, uot.Request{Destination: destination})), t), t), nil +} + +// SupportUOT implements C.ProxyAdapter +func (t *AnyTLS) SupportUOT() bool { + return true +} + +// ProxyInfo implements C.ProxyAdapter +func (t *AnyTLS) ProxyInfo() C.ProxyInfo { + info := t.Base.ProxyInfo() + info.DialerProxy = t.option.DialerProxy + return info +} + +func NewAnyTLS(option AnyTLSOption) (*AnyTLS, error) { + addr := net.JoinHostPort(option.Server, strconv.Itoa(option.Port)) + + singDialer := proxydialer.NewByNameSingDialer(option.DialerProxy, dialer.NewDialer()) + + tOption := anytls.ClientConfig{ + Password: option.Password, + Server: M.ParseSocksaddrHostPort(option.Server, uint16(option.Port)), + Dialer: singDialer, + IdleSessionCheckInterval: time.Duration(option.IdleSessionCheckInterval) * time.Second, + IdleSessionTimeout: time.Duration(option.IdleSessionTimeout) * time.Second, + } + tlsConfig := &vmess.TLSConfig{ + Host: option.SNI, + SkipCertVerify: option.SkipCertVerify, + NextProtos: option.ALPN, + FingerPrint: option.Fingerprint, + ClientFingerprint: option.ClientFingerprint, + } + if tlsConfig.Host == "" { + tlsConfig.Host = option.Server + } + if tlsC.HaveGlobalFingerprint() && len(option.ClientFingerprint) == 0 { + tlsConfig.ClientFingerprint = tlsC.GetGlobalFingerprint() + } + tOption.TLSConfig = tlsConfig + + outbound := &AnyTLS{ + Base: &Base{ + name: option.Name, + addr: addr, + tp: C.AnyTLS, + udp: option.UDP, + tfo: option.TFO, + mpTcp: option.MPTCP, + iface: option.Interface, + rmark: option.RoutingMark, + prefer: C.NewDNSPrefer(option.IPVersion), + }, + client: anytls.NewClient(context.TODO(), tOption), + option: &option, + dialer: singDialer, + } + runtime.SetFinalizer(outbound, func(o *AnyTLS) { + _ = o.client.Close() + }) + + return outbound, nil +} diff --git a/clash-meta-android/core/src/foss/golang/clash/adapter/parser.go b/clash-meta-android/core/src/foss/golang/clash/adapter/parser.go index ce4e91d5e9..9b256e6dc8 100644 --- a/clash-meta-android/core/src/foss/golang/clash/adapter/parser.go +++ b/clash-meta-android/core/src/foss/golang/clash/adapter/parser.go @@ -148,6 +148,13 @@ func ParseProxy(mapping map[string]any) (C.Proxy, error) { break } proxy, err = outbound.NewMieru(*mieruOption) + case "anytls": + anytlsOption := &outbound.AnyTLSOption{} + err = decoder.Decode(mapping, anytlsOption) + if err != nil { + break + } + proxy, err = outbound.NewAnyTLS(*anytlsOption) default: return nil, fmt.Errorf("unsupport proxy type: %s", proxyType) } diff --git a/clash-meta-android/core/src/foss/golang/clash/constant/adapters.go b/clash-meta-android/core/src/foss/golang/clash/constant/adapters.go index 420a797fa6..b6b104c983 100644 --- a/clash-meta-android/core/src/foss/golang/clash/constant/adapters.go +++ b/clash-meta-android/core/src/foss/golang/clash/constant/adapters.go @@ -43,6 +43,7 @@ const ( Tuic Ssh Mieru + AnyTLS ) const ( @@ -229,6 +230,8 @@ func (at AdapterType) String() string { return "Ssh" case Mieru: return "Mieru" + case AnyTLS: + return "AnyTLS" case Relay: return "Relay" case Selector: diff --git a/clash-meta-android/core/src/foss/golang/clash/constant/metadata.go b/clash-meta-android/core/src/foss/golang/clash/constant/metadata.go index e4167845fa..ac676b040a 100644 --- a/clash-meta-android/core/src/foss/golang/clash/constant/metadata.go +++ b/clash-meta-android/core/src/foss/golang/clash/constant/metadata.go @@ -32,6 +32,7 @@ const ( TUN TUIC HYSTERIA2 + ANYTLS INNER ) @@ -84,6 +85,8 @@ func (t Type) String() string { return "Tuic" case HYSTERIA2: return "Hysteria2" + case ANYTLS: + return "AnyTLS" case INNER: return "Inner" default: @@ -120,6 +123,8 @@ func ParseType(t string) (*Type, error) { res = TUIC case "HYSTERIA2": res = HYSTERIA2 + case "ANYTLS": + res = ANYTLS case "INNER": res = INNER default: diff --git a/clash-meta-android/core/src/foss/golang/clash/docs/config.yaml b/clash-meta-android/core/src/foss/golang/clash/docs/config.yaml index 2c2f3f43b3..db66a2b32a 100644 --- a/clash-meta-android/core/src/foss/golang/clash/docs/config.yaml +++ b/clash-meta-android/core/src/foss/golang/clash/docs/config.yaml @@ -61,7 +61,7 @@ external-controller-tls: 0.0.0.0:9443 # RESTful API HTTPS 监听地址,需要 # RESTful API CORS标头配置 external-controller-cors: allow-origins: - - * + - "*" allow-private-network: true # RESTful API Unix socket 监听地址( windows版本大于17063也可以使用,即大于等于1803/RS4版本即可使用 ) @@ -78,6 +78,7 @@ external-controller-pipe: \\.\pipe\mihomo # 配置 WEB UI 目录,使用 http://{{external-controller}}/ui 访问 external-ui: /path/to/ui/folder/ external-ui-name: xd +# 目前支持下载zip,tgz格式的压缩包 external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip" # 在RESTful API端口上开启DOH服务器 @@ -863,6 +864,22 @@ proxies: # socks5 # 可以使用的值包括 MULTIPLEXING_OFF, MULTIPLEXING_LOW, MULTIPLEXING_MIDDLE, MULTIPLEXING_HIGH。其中 MULTIPLEXING_OFF 会关闭多路复用功能。默认值为 MULTIPLEXING_LOW。 # multiplexing: MULTIPLEXING_LOW + # anytls + - name: anytls + type: anytls + server: 1.2.3.4 + port: 443 + password: "" + # client-fingerprint: chrome + udp: true + # idle-session-check-interval: 30 # seconds + # idle-session-timeout: 30 # seconds + # sni: "example.com" + # alpn: + # - h2 + # - http/1.1 + # skip-cert-verify: true + # dns 出站会将请求劫持到内部 dns 模块,所有请求均在内部处理 - name: "dns-out" type: dns @@ -1208,6 +1225,18 @@ listeners: - test.com ### 注意,对于vless listener, 至少需要填写 “certificate和private-key” 或 “reality-config” 的其中一项 ### + - name: anytls-in-1 + type: anytls + port: 10818 + listen: 0.0.0.0 + users: + username1: password1 + username2: password2 + # "certificate" and "private-key" are required + certificate: ./server.crt + private-key: ./server.key + # padding-scheme: "" # https://github.com/anytls/anytls-go/blob/main/docs/protocol.md#cmdupdatepaddingscheme + - name: tun-in-1 type: tun # rule: sub-rule-name1 # 默认使用 rules,如果未找到 sub-rule 则直接使用 rules diff --git a/clash-meta-android/core/src/foss/golang/clash/go.mod b/clash-meta-android/core/src/foss/golang/clash/go.mod index 9829af442a..ee9a209247 100644 --- a/clash-meta-android/core/src/foss/golang/clash/go.mod +++ b/clash-meta-android/core/src/foss/golang/clash/go.mod @@ -6,12 +6,12 @@ require ( github.com/3andne/restls-client-go v0.1.6 github.com/bahlo/generic-list-go v0.2.0 github.com/coreos/go-iptables v0.8.0 - github.com/dlclark/regexp2 v1.11.4 - github.com/enfein/mieru/v3 v3.11.1 - github.com/go-chi/chi/v5 v5.2.0 + github.com/dlclark/regexp2 v1.11.5 + github.com/enfein/mieru/v3 v3.11.2 + github.com/go-chi/chi/v5 v5.2.1 github.com/go-chi/render v1.0.3 github.com/gobwas/ws v1.4.0 - github.com/gofrs/uuid/v5 v5.3.0 + github.com/gofrs/uuid/v5 v5.3.1 github.com/insomniacslk/dhcp v0.0.0-20250109001534-8abf58130905 github.com/klauspost/compress v1.17.9 // lastest version compatible with golang1.20 github.com/klauspost/cpuid/v2 v2.2.9 @@ -19,9 +19,9 @@ require ( github.com/mdlayher/netlink v1.7.2 github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 - github.com/metacubex/chacha v0.1.0 + github.com/metacubex/chacha v0.1.1 github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 - github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da + github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996 github.com/metacubex/randv2 v0.2.0 github.com/metacubex/sing-quic v0.0.0-20250119013740-2a19cce83925 github.com/metacubex/sing-shadowsocks v0.2.8 @@ -53,10 +53,10 @@ require ( gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7 go.uber.org/automaxprocs v1.6.0 go4.org/netipx v0.0.0-20231129151722-fdeea329fbba - golang.org/x/crypto v0.32.0 + golang.org/x/crypto v0.33.0 golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // lastest version compatible with golang1.20 - golang.org/x/net v0.34.0 - golang.org/x/sys v0.29.0 + golang.org/x/net v0.35.0 + golang.org/x/sys v0.30.0 google.golang.org/protobuf v1.34.2 // lastest version compatible with golang1.20 gopkg.in/yaml.v3 v3.0.1 lukechampine.com/blake3 v1.3.0 @@ -111,8 +111,8 @@ require ( gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect go.uber.org/mock v0.4.0 // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/sync v0.10.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/text v0.22.0 // indirect golang.org/x/time v0.7.0 // indirect golang.org/x/tools v0.24.0 // indirect ) diff --git a/clash-meta-android/core/src/foss/golang/clash/go.sum b/clash-meta-android/core/src/foss/golang/clash/go.sum index b916e5b4ac..82fa5d50b6 100644 --- a/clash-meta-android/core/src/foss/golang/clash/go.sum +++ b/clash-meta-android/core/src/foss/golang/clash/go.sum @@ -24,12 +24,12 @@ github.com/coreos/go-iptables v0.8.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFE github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= -github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= +github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I= github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= -github.com/enfein/mieru/v3 v3.11.1 h1:G6PjSWPvzvgWUoMqnD4sBe1OGkDgrpNVT2UqCQhE6SE= -github.com/enfein/mieru/v3 v3.11.1/go.mod h1:XvVfNsM78lUMSlJJKXJZ0Hn3lAB2o/ETXTbb84x5egw= +github.com/enfein/mieru/v3 v3.11.2 h1:06KyGbXiiGz2nSHLJDOOkztAVY3cRr3wBMOpYxPotTo= +github.com/enfein/mieru/v3 v3.11.2/go.mod h1:XvVfNsM78lUMSlJJKXJZ0Hn3lAB2o/ETXTbb84x5egw= github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 h1:/5RkVc9Rc81XmMyVqawCiDyrBHZbLAZgTTCqou4mwj8= github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I= github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 h1:8j2RH289RJplhA6WfdaPqzg1MjH2K8wX5e0uhAxrw2g= @@ -43,8 +43,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI= -github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0= -github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= +github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4= github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= @@ -59,8 +59,8 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= -github.com/gofrs/uuid/v5 v5.3.0 h1:m0mUMr+oVYUdxpMLgSYCZiXe7PuVPnI94+OMeVBNedk= -github.com/gofrs/uuid/v5 v5.3.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gofrs/uuid/v5 v5.3.1 h1:aPx49MwJbekCzOyhZDjJVb0hx3A0KLjlbLx6p2gY0p0= +github.com/gofrs/uuid/v5 v5.3.1/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= @@ -99,14 +99,14 @@ github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab h1:Chbw+/31 github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab/go.mod h1:xVKK8jC5Sd3hfh7WjmCq+HorehIbrBijaUWmcuKjPcI= github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 h1:oBowHVKZycNtAFbZ6avaCSZJYeme2Nrj+4RpV2cNJig= github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399/go.mod h1:4xcieuIK+M4bGQmQYZVqEaIYqjS1ahO4kXG7EmDgEro= -github.com/metacubex/chacha v0.1.0 h1:tg9RSJ18NvL38cCWNyYH1eiG6qDCyyXIaTLQthon0sc= -github.com/metacubex/chacha v0.1.0/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8= +github.com/metacubex/chacha v0.1.1 h1:OHIv11Nd9CISAIzegpjfupIoZp9DYm6uQw41RxvmU/c= +github.com/metacubex/chacha v0.1.1/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 h1:cjd4biTvOzK9ubNCCkQ+ldc4YSH/rILn53l/xGBFHHI= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759/go.mod h1:UHOv2xu+RIgLwpXca7TLrXleEd4oR3sPatW6IF8wU88= github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a h1:cZ6oNVrsmsi3SNlnSnRio4zOgtQq+/XidwsaNgKICcg= github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a/go.mod h1:xBw/SYJPgUMPQ1tklV/brGn2nxhfr3BnvBzNlyi4Nic= -github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da h1:Mq6cbHbPTLLTUfA9scrwBmOGkvl6y99E3WmtMIMqo30= -github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da/go.mod h1:AiZ+UPgrkO1DTnmiAX4b+kRoV1Vfc65UkYD7RbFlIZA= +github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996 h1:B+AP/Pj2/jBDS/kCYjz/x+0BCOKfd2VODYevyeIt+Ds= +github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996/go.mod h1:ExVjGyEwTUjCFqx+5uxgV7MOoA3fZI+th4D40H35xmY= github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs= github.com/metacubex/randv2 v0.2.0/go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY= github.com/metacubex/sing v0.0.0-20241121030428-33b6ebc52000 h1:gUbMXcQXhXGj0vCpCVFTUyIH7TMpD1dpTcNv/MCS+ok= @@ -232,8 +232,8 @@ go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBs go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -242,11 +242,11 @@ golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -262,12 +262,12 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= diff --git a/clash-meta-android/core/src/foss/golang/clash/listener/anytls/server.go b/clash-meta-android/core/src/foss/golang/clash/listener/anytls/server.go new file mode 100644 index 0000000000..f89f2277a2 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/listener/anytls/server.go @@ -0,0 +1,182 @@ +package anytls + +import ( + "context" + "crypto/sha256" + "crypto/tls" + "encoding/binary" + "errors" + "net" + "strings" + + "github.com/metacubex/mihomo/adapter/inbound" + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/buf" + N "github.com/metacubex/mihomo/common/net" + C "github.com/metacubex/mihomo/constant" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/listener/sing" + "github.com/metacubex/mihomo/transport/anytls/padding" + "github.com/metacubex/mihomo/transport/anytls/session" + + "github.com/sagernet/sing/common/auth" + "github.com/sagernet/sing/common/bufio" + M "github.com/sagernet/sing/common/metadata" +) + +type Listener struct { + closed bool + config LC.AnyTLSServer + listeners []net.Listener + tlsConfig *tls.Config + userMap map[[32]byte]string + padding atomic.TypedValue[*padding.PaddingFactory] +} + +func New(config LC.AnyTLSServer, tunnel C.Tunnel, additions ...inbound.Addition) (sl *Listener, err error) { + if len(additions) == 0 { + additions = []inbound.Addition{ + inbound.WithInName("DEFAULT-ANYTLS"), + inbound.WithSpecialRules(""), + } + } + + tlsConfig := &tls.Config{} + if config.Certificate != "" && config.PrivateKey != "" { + cert, err := N.ParseCert(config.Certificate, config.PrivateKey, C.Path) + if err != nil { + return nil, err + } + tlsConfig.Certificates = []tls.Certificate{cert} + } + + sl = &Listener{ + config: config, + tlsConfig: tlsConfig, + userMap: make(map[[32]byte]string), + } + + for user, password := range config.Users { + sl.userMap[sha256.Sum256([]byte(password))] = user + } + + if len(config.PaddingScheme) > 0 { + if !padding.UpdatePaddingScheme([]byte(config.PaddingScheme), &sl.padding) { + return nil, errors.New("incorrect padding scheme format") + } + } else { + padding.UpdatePaddingScheme(padding.DefaultPaddingScheme, &sl.padding) + } + + // Using sing handler can automatically handle UoT + h, err := sing.NewListenerHandler(sing.ListenerConfig{ + Tunnel: tunnel, + Type: C.ANYTLS, + Additions: additions, + }) + if err != nil { + return nil, err + } + + for _, addr := range strings.Split(config.Listen, ",") { + addr := addr + + //TCP + l, err := inbound.Listen("tcp", addr) + if err != nil { + return nil, err + } + sl.listeners = append(sl.listeners, l) + + go func() { + for { + c, err := l.Accept() + if err != nil { + if sl.closed { + break + } + continue + } + go sl.HandleConn(c, h) + } + }() + } + + return sl, nil +} + +func (l *Listener) Close() error { + l.closed = true + var retErr error + for _, lis := range l.listeners { + err := lis.Close() + if err != nil { + retErr = err + } + } + return retErr +} + +func (l *Listener) Config() string { + return l.config.String() +} + +func (l *Listener) AddrList() (addrList []net.Addr) { + for _, lis := range l.listeners { + addrList = append(addrList, lis.Addr()) + } + return +} + +func (l *Listener) HandleConn(conn net.Conn, h *sing.ListenerHandler) { + ctx := context.TODO() + + conn = tls.Server(conn, l.tlsConfig) + defer conn.Close() + + b := buf.NewPacket() + _, err := b.ReadOnceFrom(conn) + if err != nil { + return + } + conn = bufio.NewCachedConn(conn, b) + + by, err := b.ReadBytes(32) + if err != nil { + return + } + var passwordSha256 [32]byte + copy(passwordSha256[:], by) + if user, ok := l.userMap[passwordSha256]; ok { + ctx = auth.ContextWithUser(ctx, user) + } else { + return + } + by, err = b.ReadBytes(2) + if err != nil { + return + } + paddingLen := binary.BigEndian.Uint16(by) + if paddingLen > 0 { + _, err = b.ReadBytes(int(paddingLen)) + if err != nil { + return + } + } + + session := session.NewServerSession(conn, func(stream *session.Stream) { + defer stream.Close() + + destination, err := M.SocksaddrSerializer.ReadAddrPort(stream) + if err != nil { + return + } + + h.NewConnection(ctx, stream, M.Metadata{ + Source: M.SocksaddrFromNet(conn.RemoteAddr()), + Destination: destination, + }) + }, &l.padding) + session.Run(true) + session.Close() +} diff --git a/clash-meta-android/core/src/foss/golang/clash/listener/config/anytls.go b/clash-meta-android/core/src/foss/golang/clash/listener/config/anytls.go new file mode 100644 index 0000000000..adbafa60fa --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/listener/config/anytls.go @@ -0,0 +1,19 @@ +package config + +import ( + "encoding/json" +) + +type AnyTLSServer struct { + Enable bool `yaml:"enable" json:"enable"` + Listen string `yaml:"listen" json:"listen"` + Users map[string]string `yaml:"users" json:"users,omitempty"` + Certificate string `yaml:"certificate" json:"certificate"` + PrivateKey string `yaml:"private-key" json:"private-key"` + PaddingScheme string `yaml:"padding-scheme" json:"padding-scheme,omitempty"` +} + +func (t AnyTLSServer) String() string { + b, _ := json.Marshal(t) + return string(b) +} diff --git a/clash-meta-android/core/src/foss/golang/clash/listener/inbound/anytls.go b/clash-meta-android/core/src/foss/golang/clash/listener/inbound/anytls.go new file mode 100644 index 0000000000..a995bf4f79 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/listener/inbound/anytls.go @@ -0,0 +1,79 @@ +package inbound + +import ( + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/listener/anytls" + LC "github.com/metacubex/mihomo/listener/config" + "github.com/metacubex/mihomo/log" +) + +type AnyTLSOption struct { + BaseOption + Users map[string]string `inbound:"users,omitempty"` + Certificate string `inbound:"certificate"` + PrivateKey string `inbound:"private-key"` + PaddingScheme string `inbound:"padding-scheme,omitempty"` +} + +func (o AnyTLSOption) Equal(config C.InboundConfig) bool { + return optionToString(o) == optionToString(config) +} + +type AnyTLS struct { + *Base + config *AnyTLSOption + l C.MultiAddrListener + vs LC.AnyTLSServer +} + +func NewAnyTLS(options *AnyTLSOption) (*AnyTLS, error) { + base, err := NewBase(&options.BaseOption) + if err != nil { + return nil, err + } + return &AnyTLS{ + Base: base, + config: options, + vs: LC.AnyTLSServer{ + Enable: true, + Listen: base.RawAddress(), + Users: options.Users, + Certificate: options.Certificate, + PrivateKey: options.PrivateKey, + PaddingScheme: options.PaddingScheme, + }, + }, nil +} + +// Config implements constant.InboundListener +func (v *AnyTLS) Config() C.InboundConfig { + return v.config +} + +// Address implements constant.InboundListener +func (v *AnyTLS) Address() string { + if v.l != nil { + for _, addr := range v.l.AddrList() { + return addr.String() + } + } + return "" +} + +// Listen implements constant.InboundListener +func (v *AnyTLS) Listen(tunnel C.Tunnel) error { + var err error + v.l, err = anytls.New(v.vs, tunnel, v.Additions()...) + if err != nil { + return err + } + log.Infoln("AnyTLS[%s] proxy listening at: %s", v.Name(), v.Address()) + return nil +} + +// Close implements constant.InboundListener +func (v *AnyTLS) Close() error { + return v.l.Close() +} + +var _ C.InboundListener = (*AnyTLS)(nil) diff --git a/clash-meta-android/core/src/foss/golang/clash/listener/parse.go b/clash-meta-android/core/src/foss/golang/clash/listener/parse.go index 38082e92bd..5c5d6c7e48 100644 --- a/clash-meta-android/core/src/foss/golang/clash/listener/parse.go +++ b/clash-meta-android/core/src/foss/golang/clash/listener/parse.go @@ -113,6 +113,13 @@ func ParseListener(mapping map[string]any) (C.InboundListener, error) { return nil, err } listener, err = IN.NewTuic(tuicOption) + case "anytls": + anytlsOption := &IN.AnyTLSOption{} + err = decoder.Decode(mapping, anytlsOption) + if err != nil { + return nil, err + } + listener, err = IN.NewAnyTLS(anytlsOption) default: return nil, fmt.Errorf("unsupport proxy type: %s", proxyType) } diff --git a/clash-meta-android/core/src/foss/golang/clash/rules/parser.go b/clash-meta-android/core/src/foss/golang/clash/rules/parser.go index 83325433d4..f4e945c915 100644 --- a/clash-meta-android/core/src/foss/golang/clash/rules/parser.go +++ b/clash-meta-android/core/src/foss/golang/clash/rules/parser.go @@ -81,8 +81,10 @@ func ParseRule(tp, payload, target string, params []string, subRules map[string] case "MATCH": parsed = RC.NewMatch(target) parseErr = nil + case "": + parseErr = fmt.Errorf("missing subsequent parameters: %s", payload) default: - parseErr = fmt.Errorf("unsupported rule type %s", tp) + parseErr = fmt.Errorf("unsupported rule type: %s", tp) } if parseErr != nil { diff --git a/clash-meta-android/core/src/foss/golang/clash/rules/provider/classical_strategy.go b/clash-meta-android/core/src/foss/golang/clash/rules/provider/classical_strategy.go index 205a8e5996..95a772e845 100644 --- a/clash-meta-android/core/src/foss/golang/clash/rules/provider/classical_strategy.go +++ b/clash-meta-android/core/src/foss/golang/clash/rules/provider/classical_strategy.go @@ -59,7 +59,7 @@ func (c *classicalStrategy) Insert(rule string) { r, err := c.parse(ruleType, rule, "", params) if err != nil { - log.Warnln("parse rule error:[%s]", err.Error()) + log.Warnln("parse classical rule error: %s", err.Error()) } else { if r.ShouldResolveIP() { c.shouldResolveIP = true @@ -83,7 +83,7 @@ func ruleParse(ruleRaw string) (string, string, []string) { return item[0], item[1], nil } else if len(item) > 2 { if item[0] == "NOT" || item[0] == "OR" || item[0] == "AND" || item[0] == "SUB-RULE" || item[0] == "DOMAIN-REGEX" || item[0] == "PROCESS-NAME-REGEX" || item[0] == "PROCESS-PATH-REGEX" { - return item[0], strings.Join(item[1:len(item)], ","), nil + return item[0], strings.Join(item[1:], ","), nil } else { return item[0], item[1], item[2:] } @@ -95,8 +95,8 @@ func ruleParse(ruleRaw string) (string, string, []string) { func NewClassicalStrategy(parse func(tp, payload, target string, params []string, subRules map[string][]C.Rule) (parsed C.Rule, parseErr error)) *classicalStrategy { return &classicalStrategy{rules: []C.Rule{}, parse: func(tp, payload, target string, params []string) (parsed C.Rule, parseErr error) { switch tp { - case "MATCH": - return nil, fmt.Errorf("unsupported rule type on rule-set") + case "MATCH", "RULE-SET", "SUB-RULE": + return nil, fmt.Errorf("unsupported rule type on classical rule-set: %s", tp) default: return parse(tp, payload, target, params, nil) } diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/client.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/client.go new file mode 100644 index 0000000000..fd573ebe79 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/client.go @@ -0,0 +1,105 @@ +package anytls + +import ( + "context" + "crypto/sha256" + "encoding/binary" + "net" + "time" + + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/buf" + C "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/transport/anytls/padding" + "github.com/metacubex/mihomo/transport/anytls/session" + "github.com/metacubex/mihomo/transport/vmess" + + M "github.com/sagernet/sing/common/metadata" + N "github.com/sagernet/sing/common/network" +) + +type ClientConfig struct { + Password string + IdleSessionCheckInterval time.Duration + IdleSessionTimeout time.Duration + Server M.Socksaddr + Dialer N.Dialer + TLSConfig *vmess.TLSConfig +} + +type Client struct { + passwordSha256 []byte + tlsConfig *vmess.TLSConfig + clientFingerprint string + dialer N.Dialer + server M.Socksaddr + sessionClient *session.Client + padding atomic.TypedValue[*padding.PaddingFactory] +} + +func NewClient(ctx context.Context, config ClientConfig) *Client { + pw := sha256.Sum256([]byte(config.Password)) + c := &Client{ + passwordSha256: pw[:], + tlsConfig: config.TLSConfig, + dialer: config.Dialer, + server: config.Server, + } + // Initialize the padding state of this client + padding.UpdatePaddingScheme(padding.DefaultPaddingScheme, &c.padding) + c.sessionClient = session.NewClient(ctx, c.CreateOutboundTLSConnection, &c.padding, config.IdleSessionCheckInterval, config.IdleSessionTimeout) + return c +} + +func (c *Client) CreateProxy(ctx context.Context, destination M.Socksaddr) (net.Conn, error) { + conn, err := c.sessionClient.CreateStream(ctx) + if err != nil { + return nil, err + } + err = M.SocksaddrSerializer.WriteAddrPort(conn, destination) + if err != nil { + conn.Close() + return nil, err + } + return conn, nil +} + +func (c *Client) CreateOutboundTLSConnection(ctx context.Context) (net.Conn, error) { + conn, err := c.dialer.DialContext(ctx, N.NetworkTCP, c.server) + if err != nil { + return nil, err + } + + b := buf.NewPacket() + b.Write(c.passwordSha256) + var paddingLen int + if pad := c.padding.Load().GenerateRecordPayloadSizes(0); len(pad) > 0 { + paddingLen = pad[0] + } + binary.BigEndian.PutUint16(b.Extend(2), uint16(paddingLen)) + if paddingLen > 0 { + b.WriteZeroN(paddingLen) + } + + getTlsConn := func() (net.Conn, error) { + ctx, cancel := context.WithTimeout(ctx, C.DefaultTLSTimeout) + defer cancel() + return vmess.StreamTLSConn(ctx, conn, c.tlsConfig) + } + tlsConn, err := getTlsConn() + if err != nil { + conn.Close() + return nil, err + } + + _, err = b.WriteTo(tlsConn) + if err != nil { + tlsConn.Close() + return nil, err + } + return tlsConn, nil +} + +func (h *Client) Close() error { + return h.sessionClient.Close() +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/padding/padding.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/padding/padding.go new file mode 100644 index 0000000000..addd47c2fb --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/padding/padding.go @@ -0,0 +1,92 @@ +package padding + +import ( + "crypto/md5" + "crypto/rand" + "fmt" + "math/big" + "strconv" + "strings" + + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/transport/anytls/util" +) + +const CheckMark = -1 + +var DefaultPaddingScheme = []byte(`stop=8 +0=34-120 +1=100-400 +2=400-500,c,500-1000,c,400-500,c,500-1000,c,500-1000,c,400-500 +3=500-1000 +4=500-1000 +5=500-1000 +6=500-1000 +7=500-1000`) + +type PaddingFactory struct { + scheme util.StringMap + RawScheme []byte + Stop uint32 + Md5 string +} + +func UpdatePaddingScheme(rawScheme []byte, to *atomic.TypedValue[*PaddingFactory]) bool { + if p := NewPaddingFactory(rawScheme); p != nil { + to.Store(p) + return true + } + return false +} + +func NewPaddingFactory(rawScheme []byte) *PaddingFactory { + p := &PaddingFactory{ + RawScheme: rawScheme, + Md5: fmt.Sprintf("%x", md5.Sum(rawScheme)), + } + scheme := util.StringMapFromBytes(rawScheme) + if len(scheme) == 0 { + return nil + } + if stop, err := strconv.Atoi(scheme["stop"]); err == nil { + p.Stop = uint32(stop) + } else { + return nil + } + p.scheme = scheme + return p +} + +func (p *PaddingFactory) GenerateRecordPayloadSizes(pkt uint32) (pktSizes []int) { + if s, ok := p.scheme[strconv.Itoa(int(pkt))]; ok { + sRanges := strings.Split(s, ",") + for _, sRange := range sRanges { + sRangeMinMax := strings.Split(sRange, "-") + if len(sRangeMinMax) == 2 { + _min, err := strconv.ParseInt(sRangeMinMax[0], 10, 64) + if err != nil { + continue + } + _max, err := strconv.ParseInt(sRangeMinMax[1], 10, 64) + if err != nil { + continue + } + if _min > _max { + _min, _max = _max, _min + } + if _min <= 0 || _max <= 0 { + continue + } + if _min == _max { + pktSizes = append(pktSizes, int(_min)) + } else { + i, _ := rand.Int(rand.Reader, big.NewInt(_max-_min)) + pktSizes = append(pktSizes, int(i.Int64()+_min)) + } + } else if sRange == "c" { + pktSizes = append(pktSizes, CheckMark) + } + } + } + return +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/client.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/client.go new file mode 100644 index 0000000000..869a4b317a --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/client.go @@ -0,0 +1,158 @@ +package session + +import ( + "context" + "fmt" + "io" + "math" + "net" + "sync" + "time" + + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/transport/anytls/padding" + "github.com/metacubex/mihomo/transport/anytls/skiplist" + "github.com/metacubex/mihomo/transport/anytls/util" +) + +type Client struct { + die context.Context + dieCancel context.CancelFunc + + dialOut func(ctx context.Context) (net.Conn, error) + + sessionCounter atomic.Uint64 + idleSession *skiplist.SkipList[uint64, *Session] + idleSessionLock sync.Mutex + + padding *atomic.TypedValue[*padding.PaddingFactory] + + idleSessionTimeout time.Duration +} + +func NewClient(ctx context.Context, dialOut func(ctx context.Context) (net.Conn, error), _padding *atomic.TypedValue[*padding.PaddingFactory], idleSessionCheckInterval, idleSessionTimeout time.Duration) *Client { + c := &Client{ + dialOut: dialOut, + padding: _padding, + idleSessionTimeout: idleSessionTimeout, + } + if idleSessionCheckInterval <= time.Second*5 { + idleSessionCheckInterval = time.Second * 30 + } + if c.idleSessionTimeout <= time.Second*5 { + c.idleSessionTimeout = time.Second * 30 + } + c.die, c.dieCancel = context.WithCancel(ctx) + c.idleSession = skiplist.NewSkipList[uint64, *Session]() + util.StartRoutine(c.die, idleSessionCheckInterval, c.idleCleanup) + return c +} + +func (c *Client) CreateStream(ctx context.Context) (net.Conn, error) { + select { + case <-c.die.Done(): + return nil, io.ErrClosedPipe + default: + } + + var session *Session + var stream *Stream + var err error + + for i := 0; i < 3; i++ { + session, err = c.findSession(ctx) + if session == nil { + return nil, fmt.Errorf("failed to create session: %w", err) + } + stream, err = session.OpenStream() + if err != nil { + _ = session.Close() + continue + } + break + } + if session == nil || stream == nil { + return nil, fmt.Errorf("too many closed session: %w", err) + } + + stream.dieHook = func() { + if session.IsClosed() { + if session.dieHook != nil { + session.dieHook() + } + } else { + c.idleSessionLock.Lock() + session.idleSince = time.Now() + c.idleSession.Insert(math.MaxUint64-session.seq, session) + c.idleSessionLock.Unlock() + } + } + + return stream, nil +} + +func (c *Client) findSession(ctx context.Context) (*Session, error) { + var idle *Session + + c.idleSessionLock.Lock() + if !c.idleSession.IsEmpty() { + it := c.idleSession.Iterate() + idle = it.Value() + c.idleSession.Remove(it.Key()) + } + c.idleSessionLock.Unlock() + + if idle == nil { + s, err := c.createSession(ctx) + return s, err + } + return idle, nil +} + +func (c *Client) createSession(ctx context.Context) (*Session, error) { + underlying, err := c.dialOut(ctx) + if err != nil { + return nil, err + } + + session := NewClientSession(underlying, c.padding) + session.seq = c.sessionCounter.Add(1) + session.dieHook = func() { + //logrus.Debugln("session died", session) + c.idleSessionLock.Lock() + c.idleSession.Remove(math.MaxUint64 - session.seq) + c.idleSessionLock.Unlock() + } + session.Run(false) + return session, nil +} + +func (c *Client) Close() error { + c.dieCancel() + go c.idleCleanupExpTime(time.Now()) + return nil +} + +func (c *Client) idleCleanup() { + c.idleCleanupExpTime(time.Now().Add(-c.idleSessionTimeout)) +} + +func (c *Client) idleCleanupExpTime(expTime time.Time) { + var sessionToRemove = make([]*Session, 0) + + c.idleSessionLock.Lock() + it := c.idleSession.Iterate() + for it.IsNotEnd() { + session := it.Value() + if session.idleSince.Before(expTime) { + sessionToRemove = append(sessionToRemove, session) + c.idleSession.Remove(it.Key()) + } + it.MoveToNext() + } + c.idleSessionLock.Unlock() + + for _, session := range sessionToRemove { + session.Close() + } +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/frame.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/frame.go new file mode 100644 index 0000000000..49597c5526 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/frame.go @@ -0,0 +1,44 @@ +package session + +import ( + "encoding/binary" +) + +const ( // cmds + cmdWaste = 0 // Paddings + cmdSYN = 1 // stream open + cmdPSH = 2 // data push + cmdFIN = 3 // stream close, a.k.a EOF mark + cmdSettings = 4 // Settings + cmdAlert = 5 // Alert + cmdUpdatePaddingScheme = 6 // update padding scheme +) + +const ( + headerOverHeadSize = 1 + 4 + 2 +) + +// frame defines a packet from or to be multiplexed into a single connection +type frame struct { + cmd byte // 1 + sid uint32 // 4 + data []byte // 2 + len(data) +} + +func newFrame(cmd byte, sid uint32) frame { + return frame{cmd: cmd, sid: sid} +} + +type rawHeader [headerOverHeadSize]byte + +func (h rawHeader) Cmd() byte { + return h[0] +} + +func (h rawHeader) StreamID() uint32 { + return binary.BigEndian.Uint32(h[1:]) +} + +func (h rawHeader) Length() uint16 { + return binary.BigEndian.Uint16(h[5:]) +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/session.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/session.go new file mode 100644 index 0000000000..ce4d580f20 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/session.go @@ -0,0 +1,379 @@ +package session + +import ( + "crypto/md5" + "encoding/binary" + "io" + "net" + "runtime/debug" + "sync" + "time" + + "github.com/metacubex/mihomo/common/atomic" + "github.com/metacubex/mihomo/common/buf" + "github.com/metacubex/mihomo/common/pool" + "github.com/metacubex/mihomo/constant" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/transport/anytls/padding" + "github.com/metacubex/mihomo/transport/anytls/util" +) + +type Session struct { + conn net.Conn + connLock sync.Mutex + + streams map[uint32]*Stream + streamId atomic.Uint32 + streamLock sync.RWMutex + + dieOnce sync.Once + die chan struct{} + dieHook func() + + // pool + seq uint64 + idleSince time.Time + padding *atomic.TypedValue[*padding.PaddingFactory] + + // client + isClient bool + buffering bool + buffer []byte + pktCounter atomic.Uint32 + + // server + onNewStream func(stream *Stream) +} + +func NewClientSession(conn net.Conn, _padding *atomic.TypedValue[*padding.PaddingFactory]) *Session { + s := &Session{ + conn: conn, + isClient: true, + padding: _padding, + } + s.die = make(chan struct{}) + s.streams = make(map[uint32]*Stream) + return s +} + +func NewServerSession(conn net.Conn, onNewStream func(stream *Stream), _padding *atomic.TypedValue[*padding.PaddingFactory]) *Session { + s := &Session{ + conn: conn, + onNewStream: onNewStream, + isClient: false, + padding: _padding, + } + s.die = make(chan struct{}) + s.streams = make(map[uint32]*Stream) + return s +} + +func (s *Session) Run(isServer bool) { + if isServer { + s.recvLoop() + return + } + + settings := util.StringMap{ + "v": "1", + "client": "mihomo/" + constant.Version, + "padding-md5": s.padding.Load().Md5, + } + f := newFrame(cmdSettings, 0) + f.data = settings.ToBytes() + s.buffering = true + s.writeFrame(f) + + go s.recvLoop() +} + +// IsClosed does a safe check to see if we have shutdown +func (s *Session) IsClosed() bool { + select { + case <-s.die: + return true + default: + return false + } +} + +// Close is used to close the session and all streams. +func (s *Session) Close() error { + var once bool + s.dieOnce.Do(func() { + close(s.die) + once = true + }) + + if once { + if s.dieHook != nil { + s.dieHook() + } + s.streamLock.Lock() + for k := range s.streams { + s.streams[k].sessionClose() + } + s.streamLock.Unlock() + return s.conn.Close() + } else { + return io.ErrClosedPipe + } +} + +// OpenStream is used to create a new stream for CLIENT +func (s *Session) OpenStream() (*Stream, error) { + if s.IsClosed() { + return nil, io.ErrClosedPipe + } + + sid := s.streamId.Add(1) + stream := newStream(sid, s) + + //logrus.Debugln("stream open", sid, s.streams) + + if _, err := s.writeFrame(newFrame(cmdSYN, sid)); err != nil { + return nil, err + } + + s.buffering = false // proxy Write it's SocksAddr to flush the buffer + + s.streamLock.Lock() + defer s.streamLock.Unlock() + select { + case <-s.die: + return nil, io.ErrClosedPipe + default: + s.streams[sid] = stream + return stream, nil + } +} + +func (s *Session) recvLoop() error { + defer func() { + if r := recover(); r != nil { + log.Errorln("[BUG] %v %s", r, string(debug.Stack())) + } + }() + defer s.Close() + + var receivedSettingsFromClient bool + var hdr rawHeader + + for { + if s.IsClosed() { + return io.ErrClosedPipe + } + // read header first + if _, err := io.ReadFull(s.conn, hdr[:]); err == nil { + sid := hdr.StreamID() + switch hdr.Cmd() { + case cmdPSH: + if hdr.Length() > 0 { + buffer := pool.Get(int(hdr.Length())) + if _, err := io.ReadFull(s.conn, buffer); err == nil { + s.streamLock.RLock() + stream, ok := s.streams[sid] + s.streamLock.RUnlock() + if ok { + stream.pipeW.Write(buffer) + } + pool.Put(buffer) + } else { + pool.Put(buffer) + return err + } + } + case cmdSYN: // should be server only + if !s.isClient && !receivedSettingsFromClient { + f := newFrame(cmdAlert, 0) + f.data = []byte("client did not send its settings") + s.writeFrame(f) + return nil + } + s.streamLock.Lock() + if _, ok := s.streams[sid]; !ok { + stream := newStream(sid, s) + s.streams[sid] = stream + if s.onNewStream != nil { + go s.onNewStream(stream) + } else { + go s.Close() + } + } + s.streamLock.Unlock() + case cmdFIN: + s.streamLock.RLock() + stream, ok := s.streams[sid] + s.streamLock.RUnlock() + if ok { + stream.Close() + } + //logrus.Debugln("stream fin", sid, s.streams) + case cmdWaste: + if hdr.Length() > 0 { + buffer := pool.Get(int(hdr.Length())) + if _, err := io.ReadFull(s.conn, buffer); err != nil { + pool.Put(buffer) + return err + } + pool.Put(buffer) + } + case cmdSettings: + if hdr.Length() > 0 { + buffer := pool.Get(int(hdr.Length())) + if _, err := io.ReadFull(s.conn, buffer); err != nil { + pool.Put(buffer) + return err + } + if !s.isClient { + receivedSettingsFromClient = true + m := util.StringMapFromBytes(buffer) + paddingF := s.padding.Load() + if m["padding-md5"] != paddingF.Md5 { + // logrus.Debugln("remote md5 is", m["padding-md5"]) + f := newFrame(cmdUpdatePaddingScheme, 0) + f.data = paddingF.RawScheme + _, err = s.writeFrame(f) + if err != nil { + pool.Put(buffer) + return err + } + } + } + pool.Put(buffer) + } + case cmdAlert: + if hdr.Length() > 0 { + buffer := pool.Get(int(hdr.Length())) + if _, err := io.ReadFull(s.conn, buffer); err != nil { + pool.Put(buffer) + return err + } + if s.isClient { + log.Errorln("[Alert from server] %s", string(buffer)) + } + pool.Put(buffer) + return nil + } + case cmdUpdatePaddingScheme: + if hdr.Length() > 0 { + buffer := pool.Get(int(hdr.Length())) + if _, err := io.ReadFull(s.conn, buffer); err != nil { + pool.Put(buffer) + return err + } + if s.isClient { + if padding.UpdatePaddingScheme(buffer, s.padding) { + log.Infoln("[Update padding succeed] %x\n", md5.Sum(buffer)) + } else { + log.Warnln("[Update padding failed] %x\n", md5.Sum(buffer)) + } + } + pool.Put(buffer) + } + default: + // I don't know what command it is (can't have data) + } + } else { + return err + } + } +} + +// notify the session that a stream has closed +func (s *Session) streamClosed(sid uint32) error { + _, err := s.writeFrame(newFrame(cmdFIN, sid)) + s.streamLock.Lock() + delete(s.streams, sid) + s.streamLock.Unlock() + return err +} + +func (s *Session) writeFrame(frame frame) (int, error) { + dataLen := len(frame.data) + + buffer := buf.NewSize(dataLen + headerOverHeadSize) + buffer.WriteByte(frame.cmd) + binary.BigEndian.PutUint32(buffer.Extend(4), frame.sid) + binary.BigEndian.PutUint16(buffer.Extend(2), uint16(dataLen)) + buffer.Write(frame.data) + _, err := s.writeConn(buffer.Bytes()) + buffer.Release() + if err != nil { + return 0, err + } + + return dataLen, nil +} + +func (s *Session) writeConn(b []byte) (n int, err error) { + s.connLock.Lock() + defer s.connLock.Unlock() + + if s.buffering { + s.buffer = append(s.buffer, b...) + return len(b), nil + } else if len(s.buffer) > 0 { + b = append(s.buffer, b...) + s.buffer = nil + } + + // calulate & send padding + if s.isClient { + pkt := s.pktCounter.Add(1) + paddingF := s.padding.Load() + if pkt < paddingF.Stop { + pktSizes := paddingF.GenerateRecordPayloadSizes(pkt) + for _, l := range pktSizes { + remainPayloadLen := len(b) + if l == padding.CheckMark { + if remainPayloadLen == 0 { + break + } else { + continue + } + } + // logrus.Debugln(pkt, "write", l, "len", remainPayloadLen, "remain", remainPayloadLen-l) + if remainPayloadLen > l { // this packet is all payload + _, err = s.conn.Write(b[:l]) + if err != nil { + return 0, err + } + n += l + b = b[l:] + } else if remainPayloadLen > 0 { // this packet contains padding and the last part of payload + paddingLen := l - remainPayloadLen - headerOverHeadSize + if paddingLen > 0 { + padding := make([]byte, headerOverHeadSize+paddingLen) + padding[0] = cmdWaste + binary.BigEndian.PutUint32(padding[1:5], 0) + binary.BigEndian.PutUint16(padding[5:7], uint16(paddingLen)) + b = append(b, padding...) + } + _, err = s.conn.Write(b) + if err != nil { + return 0, err + } + n += remainPayloadLen + b = nil + } else { // this packet is all padding + padding := make([]byte, headerOverHeadSize+l) + padding[0] = cmdWaste + binary.BigEndian.PutUint32(padding[1:5], 0) + binary.BigEndian.PutUint16(padding[5:7], uint16(l)) + _, err = s.conn.Write(padding) + if err != nil { + return 0, err + } + b = nil + } + } + // maybe still remain payload to write + if len(b) == 0 { + return + } + } + } + + return s.conn.Write(b) +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/stream.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/stream.go new file mode 100644 index 0000000000..140396e486 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/session/stream.go @@ -0,0 +1,99 @@ +package session + +import ( + "io" + "net" + "os" + "sync" + "time" +) + +// Stream implements net.Conn +type Stream struct { + id uint32 + + sess *Session + + pipeR *io.PipeReader + pipeW *io.PipeWriter + + dieOnce sync.Once + dieHook func() +} + +// newStream initiates a Stream struct +func newStream(id uint32, sess *Session) *Stream { + s := new(Stream) + s.id = id + s.sess = sess + s.pipeR, s.pipeW = io.Pipe() + return s +} + +// Read implements net.Conn +func (s *Stream) Read(b []byte) (n int, err error) { + return s.pipeR.Read(b) +} + +// Write implements net.Conn +func (s *Stream) Write(b []byte) (n int, err error) { + f := newFrame(cmdPSH, s.id) + f.data = b + n, err = s.sess.writeFrame(f) + return +} + +// Close implements net.Conn +func (s *Stream) Close() error { + if s.sessionClose() { + // notify remote + return s.sess.streamClosed(s.id) + } else { + return io.ErrClosedPipe + } +} + +// sessionClose close stream from session side, do not notify remote +func (s *Stream) sessionClose() (once bool) { + s.dieOnce.Do(func() { + s.pipeR.Close() + once = true + if s.dieHook != nil { + s.dieHook() + s.dieHook = nil + } + }) + return +} + +func (s *Stream) SetReadDeadline(t time.Time) error { + return os.ErrNotExist +} + +func (s *Stream) SetWriteDeadline(t time.Time) error { + return os.ErrNotExist +} + +func (s *Stream) SetDeadline(t time.Time) error { + return os.ErrNotExist +} + +// LocalAddr satisfies net.Conn interface +func (s *Stream) LocalAddr() net.Addr { + if ts, ok := s.sess.conn.(interface { + LocalAddr() net.Addr + }); ok { + return ts.LocalAddr() + } + return nil +} + +// RemoteAddr satisfies net.Conn interface +func (s *Stream) RemoteAddr() net.Addr { + if ts, ok := s.sess.conn.(interface { + RemoteAddr() net.Addr + }); ok { + return ts.RemoteAddr() + } + return nil +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/contianer.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/contianer.go new file mode 100644 index 0000000000..ceda042193 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/contianer.go @@ -0,0 +1,46 @@ +package skiplist + +// Container is a holder object that stores a collection of other objects. +type Container interface { + IsEmpty() bool // IsEmpty checks if the container has no elements. + Len() int // Len returns the number of elements in the container. + Clear() // Clear erases all elements from the container. After this call, Len() returns zero. +} + +// Map is a associative container that contains key-value pairs with unique keys. +type Map[K any, V any] interface { + Container + Has(K) bool // Checks whether the container contains element with specific key. + Find(K) *V // Finds element with specific key. + Insert(K, V) // Inserts a key-value pair in to the container or replace existing value. + Remove(K) bool // Remove element with specific key. + ForEach(func(K, V)) // Iterate the container. + ForEachIf(func(K, V) bool) // Iterate the container, stops when the callback returns false. + ForEachMutable(func(K, *V)) // Iterate the container, *V is mutable. + ForEachMutableIf(func(K, *V) bool) // Iterate the container, *V is mutable, stops when the callback returns false. +} + +// Set is a containers that store unique elements. +type Set[K any] interface { + Container + Has(K) bool // Checks whether the container contains element with specific key. + Insert(K) // Inserts a key-value pair in to the container or replace existing value. + InsertN(...K) // Inserts multiple key-value pairs in to the container or replace existing value. + Remove(K) bool // Remove element with specific key. + RemoveN(...K) // Remove multiple elements with specific keys. + ForEach(func(K)) // Iterate the container. + ForEachIf(func(K) bool) // Iterate the container, stops when the callback returns false. +} + +// Iterator is the interface for container's iterator. +type Iterator[T any] interface { + IsNotEnd() bool // Whether it is point to the end of the range. + MoveToNext() // Let it point to the next element. + Value() T // Return the value of current element. +} + +// MapIterator is the interface for map's iterator. +type MapIterator[K any, V any] interface { + Iterator[V] + Key() K // The key of the element +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/skiplist.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/skiplist.go new file mode 100644 index 0000000000..f1ce402a95 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/skiplist.go @@ -0,0 +1,457 @@ +package skiplist + +// This implementation is based on https://github.com/liyue201/gostl/tree/master/ds/skiplist +// (many thanks), added many optimizations, such as: +// +// - adaptive level +// - lesser search for prevs when key already exists. +// - reduce memory allocations +// - richer interface. +// +// etc. + +import ( + "math/bits" + "math/rand" + "time" +) + +const ( + skipListMaxLevel = 40 +) + +// SkipList is a probabilistic data structure that seem likely to supplant balanced trees as the +// implementation method of choice for many applications. Skip list algorithms have the same +// asymptotic expected time bounds as balanced trees and are simpler, faster and use less space. +// +// See https://en.wikipedia.org/wiki/Skip_list for more details. +type SkipList[K any, V any] struct { + level int // Current level, may increase dynamically during insertion + len int // Total elements numner in the skiplist. + head skipListNode[K, V] // head.next[level] is the head of each level. + // This cache is used to save the previous nodes when modifying the skip list to avoid + // allocating memory each time it is called. + prevsCache []*skipListNode[K, V] + rander *rand.Rand + impl skipListImpl[K, V] +} + +// NewSkipList creates a new SkipList for Ordered key type. +func NewSkipList[K Ordered, V any]() *SkipList[K, V] { + sl := skipListOrdered[K, V]{} + sl.init() + sl.impl = (skipListImpl[K, V])(&sl) + return &sl.SkipList +} + +// NewSkipListFromMap creates a new SkipList from a map. +func NewSkipListFromMap[K Ordered, V any](m map[K]V) *SkipList[K, V] { + sl := NewSkipList[K, V]() + for k, v := range m { + sl.Insert(k, v) + } + return sl +} + +// NewSkipListFunc creates a new SkipList with specified compare function keyCmp. +func NewSkipListFunc[K any, V any](keyCmp CompareFn[K]) *SkipList[K, V] { + sl := skipListFunc[K, V]{} + sl.init() + sl.keyCmp = keyCmp + sl.impl = skipListImpl[K, V](&sl) + return &sl.SkipList +} + +// IsEmpty implements the Container interface. +func (sl *SkipList[K, V]) IsEmpty() bool { + return sl.len == 0 +} + +// Len implements the Container interface. +func (sl *SkipList[K, V]) Len() int { + return sl.len +} + +// Clear implements the Container interface. +func (sl *SkipList[K, V]) Clear() { + for i := range sl.head.next { + sl.head.next[i] = nil + } + sl.level = 1 + sl.len = 0 +} + +// Iterate return an iterator to the skiplist. +func (sl *SkipList[K, V]) Iterate() MapIterator[K, V] { + return &skipListIterator[K, V]{sl.head.next[0], nil} +} + +// Insert inserts a key-value pair into the skiplist. +// If the key is already in the skip list, it's value will be updated. +func (sl *SkipList[K, V]) Insert(key K, value V) { + node, prevs := sl.impl.findInsertPoint(key) + + if node != nil { + // Already exist, update the value + node.value = value + return + } + + level := sl.randomLevel() + node = newSkipListNode(level, key, value) + + minLevel := level + if sl.level < level { + minLevel = sl.level + } + for i := 0; i < minLevel; i++ { + node.next[i] = prevs[i].next[i] + prevs[i].next[i] = node + } + + if level > sl.level { + for i := sl.level; i < level; i++ { + sl.head.next[i] = node + } + sl.level = level + } + + sl.len++ +} + +// Find returns the value associated with the passed key if the key is in the skiplist, otherwise +// returns nil. +func (sl *SkipList[K, V]) Find(key K) *V { + node := sl.impl.findNode(key) + if node != nil { + return &node.value + } + return nil +} + +// Has implement the Map interface. +func (sl *SkipList[K, V]) Has(key K) bool { + return sl.impl.findNode(key) != nil +} + +// LowerBound returns an iterator to the first element in the skiplist that +// does not satisfy element < value (i.e. greater or equal to), +// or a end itetator if no such element is found. +func (sl *SkipList[K, V]) LowerBound(key K) MapIterator[K, V] { + return &skipListIterator[K, V]{sl.impl.lowerBound(key), nil} +} + +// UpperBound returns an iterator to the first element in the skiplist that +// does not satisfy value < element (i.e. strictly greater), +// or a end itetator if no such element is found. +func (sl *SkipList[K, V]) UpperBound(key K) MapIterator[K, V] { + return &skipListIterator[K, V]{sl.impl.upperBound(key), nil} +} + +// FindRange returns an iterator in range [first, last) (last is not includeed). +func (sl *SkipList[K, V]) FindRange(first, last K) MapIterator[K, V] { + return &skipListIterator[K, V]{sl.impl.lowerBound(first), sl.impl.upperBound(last)} +} + +// Remove removes the key-value pair associated with the passed key and returns true if the key is +// in the skiplist, otherwise returns false. +func (sl *SkipList[K, V]) Remove(key K) bool { + node, prevs := sl.impl.findRemovePoint(key) + if node == nil { + return false + } + for i, v := range node.next { + prevs[i].next[i] = v + } + for sl.level > 1 && sl.head.next[sl.level-1] == nil { + sl.level-- + } + sl.len-- + return true +} + +// ForEach implements the Map interface. +func (sl *SkipList[K, V]) ForEach(op func(K, V)) { + for e := sl.head.next[0]; e != nil; e = e.next[0] { + op(e.key, e.value) + } +} + +// ForEachMutable implements the Map interface. +func (sl *SkipList[K, V]) ForEachMutable(op func(K, *V)) { + for e := sl.head.next[0]; e != nil; e = e.next[0] { + op(e.key, &e.value) + } +} + +// ForEachIf implements the Map interface. +func (sl *SkipList[K, V]) ForEachIf(op func(K, V) bool) { + for e := sl.head.next[0]; e != nil; e = e.next[0] { + if !op(e.key, e.value) { + return + } + } +} + +// ForEachMutableIf implements the Map interface. +func (sl *SkipList[K, V]) ForEachMutableIf(op func(K, *V) bool) { + for e := sl.head.next[0]; e != nil; e = e.next[0] { + if !op(e.key, &e.value) { + return + } + } +} + +/// SkipList implementation part. + +type skipListNode[K any, V any] struct { + key K + value V + next []*skipListNode[K, V] +} + +//go:generate bash ./skiplist_newnode_generate.sh skipListMaxLevel skiplist_newnode.go +// func newSkipListNode[K Ordered, V any](level int, key K, value V) *skipListNode[K, V] + +type skipListIterator[K any, V any] struct { + node, end *skipListNode[K, V] +} + +func (it *skipListIterator[K, V]) IsNotEnd() bool { + return it.node != it.end +} + +func (it *skipListIterator[K, V]) MoveToNext() { + it.node = it.node.next[0] +} + +func (it *skipListIterator[K, V]) Key() K { + return it.node.key +} + +func (it *skipListIterator[K, V]) Value() V { + return it.node.value +} + +// skipListImpl is an interface to provide different implementation for Ordered key or CompareFn. +// +// We can use CompareFn to cumpare Ordered keys, but a separated implementation is much faster. +// We don't make the whole skip list an interface, in order to share the type independented method. +// And because these methods are called directly without going through the interface, they are also +// much faster. +type skipListImpl[K any, V any] interface { + findNode(key K) *skipListNode[K, V] + lowerBound(key K) *skipListNode[K, V] + upperBound(key K) *skipListNode[K, V] + findInsertPoint(key K) (*skipListNode[K, V], []*skipListNode[K, V]) + findRemovePoint(key K) (*skipListNode[K, V], []*skipListNode[K, V]) +} + +func (sl *SkipList[K, V]) init() { + sl.level = 1 + // #nosec G404 -- This is not a security condition + sl.rander = rand.New(rand.NewSource(time.Now().Unix())) + sl.prevsCache = make([]*skipListNode[K, V], skipListMaxLevel) + sl.head.next = make([]*skipListNode[K, V], skipListMaxLevel) +} + +func (sl *SkipList[K, V]) randomLevel() int { + total := uint64(1)< 3 && 1<<(level-3) > sl.len { + level-- + } + + return level +} + +/// skipListOrdered part + +// skipListOrdered is the skip list implementation for Ordered types. +type skipListOrdered[K Ordered, V any] struct { + SkipList[K, V] +} + +func (sl *skipListOrdered[K, V]) findNode(key K) *skipListNode[K, V] { + return sl.doFindNode(key, true) +} + +func (sl *skipListOrdered[K, V]) doFindNode(key K, eq bool) *skipListNode[K, V] { + // This function execute the job of findNode if eq is true, otherwise lowBound. + // Passing the control variable eq is ugly but it's faster than testing node + // again outside the function in findNode. + prev := &sl.head + for i := sl.level - 1; i >= 0; i-- { + for cur := prev.next[i]; cur != nil; cur = cur.next[i] { + if cur.key == key { + return cur + } + if cur.key > key { + // All other node in this level must be greater than the key, + // search the next level. + break + } + prev = cur + } + } + if eq { + return nil + } + return prev.next[0] +} + +func (sl *skipListOrdered[K, V]) lowerBound(key K) *skipListNode[K, V] { + return sl.doFindNode(key, false) +} + +func (sl *skipListOrdered[K, V]) upperBound(key K) *skipListNode[K, V] { + node := sl.lowerBound(key) + if node != nil && node.key == key { + return node.next[0] + } + return node +} + +// findInsertPoint returns (*node, nil) to the existed node if the key exists, +// or (nil, []*node) to the previous nodes if the key doesn't exist +func (sl *skipListOrdered[K, V]) findInsertPoint(key K) (*skipListNode[K, V], []*skipListNode[K, V]) { + prevs := sl.prevsCache[0:sl.level] + prev := &sl.head + for i := sl.level - 1; i >= 0; i-- { + for next := prev.next[i]; next != nil; next = next.next[i] { + if next.key == key { + // The key is already existed, prevs are useless because no new node insertion. + // stop searching. + return next, nil + } + if next.key > key { + // All other node in this level must be greater than the key, + // search the next level. + break + } + prev = next + } + prevs[i] = prev + } + return nil, prevs +} + +// findRemovePoint finds the node which match the key and it's previous nodes. +func (sl *skipListOrdered[K, V]) findRemovePoint(key K) (*skipListNode[K, V], []*skipListNode[K, V]) { + prevs := sl.findPrevNodes(key) + node := prevs[0].next[0] + if node == nil || node.key != key { + return nil, nil + } + return node, prevs +} + +func (sl *skipListOrdered[K, V]) findPrevNodes(key K) []*skipListNode[K, V] { + prevs := sl.prevsCache[0:sl.level] + prev := &sl.head + for i := sl.level - 1; i >= 0; i-- { + for next := prev.next[i]; next != nil; next = next.next[i] { + if next.key >= key { + break + } + prev = next + } + prevs[i] = prev + } + return prevs +} + +/// skipListFunc part + +// skipListFunc is the skip list implementation which compare keys with func. +type skipListFunc[K any, V any] struct { + SkipList[K, V] + keyCmp CompareFn[K] +} + +func (sl *skipListFunc[K, V]) findNode(key K) *skipListNode[K, V] { + node := sl.lowerBound(key) + if node != nil && sl.keyCmp(node.key, key) == 0 { + return node + } + return nil +} + +func (sl *skipListFunc[K, V]) lowerBound(key K) *skipListNode[K, V] { + var prev = &sl.head + for i := sl.level - 1; i >= 0; i-- { + cur := prev.next[i] + for ; cur != nil; cur = cur.next[i] { + cmpRet := sl.keyCmp(cur.key, key) + if cmpRet == 0 { + return cur + } + if cmpRet > 0 { + break + } + prev = cur + } + } + return prev.next[0] +} + +func (sl *skipListFunc[K, V]) upperBound(key K) *skipListNode[K, V] { + node := sl.lowerBound(key) + if node != nil && sl.keyCmp(node.key, key) == 0 { + return node.next[0] + } + return node +} + +// findInsertPoint returns (*node, nil) to the existed node if the key exists, +// or (nil, []*node) to the previous nodes if the key doesn't exist +func (sl *skipListFunc[K, V]) findInsertPoint(key K) (*skipListNode[K, V], []*skipListNode[K, V]) { + prevs := sl.prevsCache[0:sl.level] + prev := &sl.head + for i := sl.level - 1; i >= 0; i-- { + for cur := prev.next[i]; cur != nil; cur = cur.next[i] { + r := sl.keyCmp(cur.key, key) + if r == 0 { + // The key is already existed, prevs are useless because no new node insertion. + // stop searching. + return cur, nil + } + if r > 0 { + // All other node in this level must be greater than the key, + // search the next level. + break + } + prev = cur + } + prevs[i] = prev + } + return nil, prevs +} + +// findRemovePoint finds the node which match the key and it's previous nodes. +func (sl *skipListFunc[K, V]) findRemovePoint(key K) (*skipListNode[K, V], []*skipListNode[K, V]) { + prevs := sl.findPrevNodes(key) + node := prevs[0].next[0] + if node == nil || sl.keyCmp(node.key, key) != 0 { + return nil, nil + } + return node, prevs +} + +func (sl *skipListFunc[K, V]) findPrevNodes(key K) []*skipListNode[K, V] { + prevs := sl.prevsCache[0:sl.level] + prev := &sl.head + for i := sl.level - 1; i >= 0; i-- { + for next := prev.next[i]; next != nil; next = next.next[i] { + if sl.keyCmp(next.key, key) >= 0 { + break + } + prev = next + } + prevs[i] = prev + } + return prevs +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/skiplist_newnode.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/skiplist_newnode.go new file mode 100644 index 0000000000..4e8a6d8839 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/skiplist_newnode.go @@ -0,0 +1,297 @@ +// AUTO GENERATED CODE, DON'T EDIT!!! +// EDIT skiplist_newnode_generate.sh accordingly. + +package skiplist + +// newSkipListNode creates a new node initialized with specified key, value and next slice. +func newSkipListNode[K any, V any](level int, key K, value V) *skipListNode[K, V] { + // For nodes with each levels, point their next slice to the nexts array allocated together, + // which can reduce 1 memory allocation and improve performance. + // + // The generics of the golang doesn't support non-type parameters like in C++, + // so we have to generate it manually. + switch level { + case 1: + n := struct { + head skipListNode[K, V] + nexts [1]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 2: + n := struct { + head skipListNode[K, V] + nexts [2]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 3: + n := struct { + head skipListNode[K, V] + nexts [3]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 4: + n := struct { + head skipListNode[K, V] + nexts [4]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 5: + n := struct { + head skipListNode[K, V] + nexts [5]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 6: + n := struct { + head skipListNode[K, V] + nexts [6]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 7: + n := struct { + head skipListNode[K, V] + nexts [7]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 8: + n := struct { + head skipListNode[K, V] + nexts [8]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 9: + n := struct { + head skipListNode[K, V] + nexts [9]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 10: + n := struct { + head skipListNode[K, V] + nexts [10]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 11: + n := struct { + head skipListNode[K, V] + nexts [11]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 12: + n := struct { + head skipListNode[K, V] + nexts [12]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 13: + n := struct { + head skipListNode[K, V] + nexts [13]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 14: + n := struct { + head skipListNode[K, V] + nexts [14]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 15: + n := struct { + head skipListNode[K, V] + nexts [15]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 16: + n := struct { + head skipListNode[K, V] + nexts [16]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 17: + n := struct { + head skipListNode[K, V] + nexts [17]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 18: + n := struct { + head skipListNode[K, V] + nexts [18]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 19: + n := struct { + head skipListNode[K, V] + nexts [19]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 20: + n := struct { + head skipListNode[K, V] + nexts [20]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 21: + n := struct { + head skipListNode[K, V] + nexts [21]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 22: + n := struct { + head skipListNode[K, V] + nexts [22]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 23: + n := struct { + head skipListNode[K, V] + nexts [23]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 24: + n := struct { + head skipListNode[K, V] + nexts [24]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 25: + n := struct { + head skipListNode[K, V] + nexts [25]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 26: + n := struct { + head skipListNode[K, V] + nexts [26]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 27: + n := struct { + head skipListNode[K, V] + nexts [27]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 28: + n := struct { + head skipListNode[K, V] + nexts [28]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 29: + n := struct { + head skipListNode[K, V] + nexts [29]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 30: + n := struct { + head skipListNode[K, V] + nexts [30]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 31: + n := struct { + head skipListNode[K, V] + nexts [31]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 32: + n := struct { + head skipListNode[K, V] + nexts [32]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 33: + n := struct { + head skipListNode[K, V] + nexts [33]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 34: + n := struct { + head skipListNode[K, V] + nexts [34]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 35: + n := struct { + head skipListNode[K, V] + nexts [35]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 36: + n := struct { + head skipListNode[K, V] + nexts [36]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 37: + n := struct { + head skipListNode[K, V] + nexts [37]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 38: + n := struct { + head skipListNode[K, V] + nexts [38]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 39: + n := struct { + head skipListNode[K, V] + nexts [39]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + case 40: + n := struct { + head skipListNode[K, V] + nexts [40]*skipListNode[K, V] + }{head: skipListNode[K, V]{key, value, nil}} + n.head.next = n.nexts[:] + return &n.head + } + + panic("should not reach here") +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/types.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/types.go new file mode 100644 index 0000000000..c534f46092 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/skiplist/types.go @@ -0,0 +1,75 @@ +package skiplist + +// Signed is a constraint that permits any signed integer type. +// If future releases of Go add new predeclared signed integer types, +// this constraint will be modified to include them. +type Signed interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 +} + +// Unsigned is a constraint that permits any unsigned integer type. +// If future releases of Go add new predeclared unsigned integer types, +// this constraint will be modified to include them. +type Unsigned interface { + ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr +} + +// Integer is a constraint that permits any integer type. +// If future releases of Go add new predeclared integer types, +// this constraint will be modified to include them. +type Integer interface { + Signed | Unsigned +} + +// Float is a constraint that permits any floating-point type. +// If future releases of Go add new predeclared floating-point types, +// this constraint will be modified to include them. +type Float interface { + ~float32 | ~float64 +} + +// Ordered is a constraint that permits any ordered type: any type +// that supports the operators < <= >= >. +// If future releases of Go add new ordered types, +// this constraint will be modified to include them. +type Ordered interface { + Integer | Float | ~string +} + +// Numeric is a constraint that permits any numeric type. +type Numeric interface { + Integer | Float +} + +// LessFn is a function that returns whether 'a' is less than 'b'. +type LessFn[T any] func(a, b T) bool + +// CompareFn is a 3 way compare function that +// returns 1 if a > b, +// returns 0 if a == b, +// returns -1 if a < b. +type CompareFn[T any] func(a, b T) int + +// HashFn is a function that returns the hash of 't'. +type HashFn[T any] func(t T) uint64 + +// Equals wraps the '==' operator for comparable types. +func Equals[T comparable](a, b T) bool { + return a == b +} + +// Less wraps the '<' operator for ordered types. +func Less[T Ordered](a, b T) bool { + return a < b +} + +// OrderedCompare provide default CompareFn for ordered types. +func OrderedCompare[T Ordered](a, b T) int { + if a < b { + return -1 + } + if a > b { + return 1 + } + return 0 +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/util/routine.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/util/routine.go new file mode 100644 index 0000000000..4fdfbdd414 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/util/routine.go @@ -0,0 +1,28 @@ +package util + +import ( + "context" + "runtime/debug" + "time" + + "github.com/metacubex/mihomo/log" +) + +func StartRoutine(ctx context.Context, d time.Duration, f func()) { + go func() { + defer func() { + if r := recover(); r != nil { + log.Errorln("[BUG] %v %s", r, string(debug.Stack())) + } + }() + for { + time.Sleep(d) + f() + select { + case <-ctx.Done(): + return + default: + } + } + }() +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/anytls/util/string_map.go b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/util/string_map.go new file mode 100644 index 0000000000..27fb3581f1 --- /dev/null +++ b/clash-meta-android/core/src/foss/golang/clash/transport/anytls/util/string_map.go @@ -0,0 +1,27 @@ +package util + +import ( + "strings" +) + +type StringMap map[string]string + +func (s StringMap) ToBytes() []byte { + var lines []string + for k, v := range s { + lines = append(lines, k+"="+v) + } + return []byte(strings.Join(lines, "\n")) +} + +func StringMapFromBytes(b []byte) StringMap { + var m = make(StringMap) + var lines = strings.Split(string(b), "\n") + for _, line := range lines { + v := strings.SplitN(line, "=", 2) + if len(v) == 2 { + m[v[0]] = v[1] + } + } + return m +} diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/trojan/trojan.go b/clash-meta-android/core/src/foss/golang/clash/transport/trojan/trojan.go index 17f403c12d..c1ebb8da25 100644 --- a/clash-meta-android/core/src/foss/golang/clash/transport/trojan/trojan.go +++ b/clash-meta-android/core/src/foss/golang/clash/transport/trojan/trojan.go @@ -93,7 +93,7 @@ func (t *Trojan) StreamConn(ctx context.Context, conn net.Conn) (net.Conn, error ctx, cancel := context.WithTimeout(context.Background(), C.DefaultTLSTimeout) defer cancel() - err := utlsConn.(*tlsC.UConn).HandshakeContext(ctx) + err := utlsConn.HandshakeContext(ctx) return utlsConn, err } } else { diff --git a/clash-meta-android/core/src/foss/golang/clash/transport/vmess/tls.go b/clash-meta-android/core/src/foss/golang/clash/transport/vmess/tls.go index bdaa8cccb7..82a484f1b8 100644 --- a/clash-meta-android/core/src/foss/golang/clash/transport/vmess/tls.go +++ b/clash-meta-android/core/src/foss/golang/clash/transport/vmess/tls.go @@ -36,7 +36,7 @@ func StreamTLSConn(ctx context.Context, conn net.Conn, cfg *TLSConfig) (net.Conn if cfg.Reality == nil { utlsConn, valid := GetUTLSConn(conn, cfg.ClientFingerprint, tlsConfig) if valid { - err := utlsConn.(*tlsC.UConn).HandshakeContext(ctx) + err = utlsConn.HandshakeContext(ctx) return utlsConn, err } } else { @@ -53,7 +53,7 @@ func StreamTLSConn(ctx context.Context, conn net.Conn, cfg *TLSConfig) (net.Conn return tlsConn, err } -func GetUTLSConn(conn net.Conn, ClientFingerprint string, tlsConfig *tls.Config) (net.Conn, bool) { +func GetUTLSConn(conn net.Conn, ClientFingerprint string, tlsConfig *tls.Config) (*tlsC.UConn, bool) { if fingerprint, exists := tlsC.GetFingerprint(ClientFingerprint); exists { utlsConn := tlsC.UClient(conn, tlsConfig, fingerprint) diff --git a/clash-meta-android/core/src/foss/golang/go.mod b/clash-meta-android/core/src/foss/golang/go.mod index 606f29e3e0..077d9280b0 100644 --- a/clash-meta-android/core/src/foss/golang/go.mod +++ b/clash-meta-android/core/src/foss/golang/go.mod @@ -14,23 +14,23 @@ require ( github.com/buger/jsonparser v1.1.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/coreos/go-iptables v0.8.0 // indirect - github.com/dlclark/regexp2 v1.11.4 // indirect + github.com/dlclark/regexp2 v1.11.5 // indirect github.com/ebitengine/purego v0.8.2 // indirect - github.com/enfein/mieru/v3 v3.11.1 // indirect + github.com/enfein/mieru/v3 v3.11.2 // indirect github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 // indirect github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 // indirect github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1 // indirect github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gaukas/godicttls v0.0.4 // indirect - github.com/go-chi/chi/v5 v5.2.0 // indirect + github.com/go-chi/chi/v5 v5.2.1 // indirect github.com/go-chi/render v1.0.3 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect github.com/gobwas/ws v1.4.0 // indirect - github.com/gofrs/uuid/v5 v5.3.0 // indirect + github.com/gofrs/uuid/v5 v5.3.1 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect @@ -46,11 +46,11 @@ require ( github.com/mdlayher/socket v0.4.1 // indirect github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab // indirect github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 // indirect - github.com/metacubex/chacha v0.1.0 // indirect + github.com/metacubex/chacha v0.1.1 // indirect github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 // indirect github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a // indirect github.com/metacubex/mihomo v1.7.0 // indirect - github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da // indirect + github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996 // indirect github.com/metacubex/randv2 v0.2.0 // indirect github.com/metacubex/sing-quic v0.0.0-20250119013740-2a19cce83925 // indirect github.com/metacubex/sing-shadowsocks v0.2.8 // indirect @@ -99,13 +99,13 @@ require ( gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect go.uber.org/mock v0.4.0 // indirect go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect - golang.org/x/crypto v0.32.0 // indirect + golang.org/x/crypto v0.33.0 // indirect golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sync v0.11.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect golang.org/x/time v0.7.0 // indirect golang.org/x/tools v0.24.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/clash-meta-android/core/src/foss/golang/go.sum b/clash-meta-android/core/src/foss/golang/go.sum index fd77047bcd..5d8e453726 100644 --- a/clash-meta-android/core/src/foss/golang/go.sum +++ b/clash-meta-android/core/src/foss/golang/go.sum @@ -24,12 +24,12 @@ github.com/coreos/go-iptables v0.8.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFE github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= -github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= +github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I= github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= -github.com/enfein/mieru/v3 v3.11.1 h1:G6PjSWPvzvgWUoMqnD4sBe1OGkDgrpNVT2UqCQhE6SE= -github.com/enfein/mieru/v3 v3.11.1/go.mod h1:XvVfNsM78lUMSlJJKXJZ0Hn3lAB2o/ETXTbb84x5egw= +github.com/enfein/mieru/v3 v3.11.2 h1:06KyGbXiiGz2nSHLJDOOkztAVY3cRr3wBMOpYxPotTo= +github.com/enfein/mieru/v3 v3.11.2/go.mod h1:XvVfNsM78lUMSlJJKXJZ0Hn3lAB2o/ETXTbb84x5egw= github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 h1:/5RkVc9Rc81XmMyVqawCiDyrBHZbLAZgTTCqou4mwj8= github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I= github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 h1:8j2RH289RJplhA6WfdaPqzg1MjH2K8wX5e0uhAxrw2g= @@ -43,8 +43,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI= -github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0= -github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= +github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4= github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= @@ -59,8 +59,8 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= -github.com/gofrs/uuid/v5 v5.3.0 h1:m0mUMr+oVYUdxpMLgSYCZiXe7PuVPnI94+OMeVBNedk= -github.com/gofrs/uuid/v5 v5.3.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gofrs/uuid/v5 v5.3.1 h1:aPx49MwJbekCzOyhZDjJVb0hx3A0KLjlbLx6p2gY0p0= +github.com/gofrs/uuid/v5 v5.3.1/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= @@ -99,14 +99,14 @@ github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab h1:Chbw+/31 github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab/go.mod h1:xVKK8jC5Sd3hfh7WjmCq+HorehIbrBijaUWmcuKjPcI= github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 h1:oBowHVKZycNtAFbZ6avaCSZJYeme2Nrj+4RpV2cNJig= github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399/go.mod h1:4xcieuIK+M4bGQmQYZVqEaIYqjS1ahO4kXG7EmDgEro= -github.com/metacubex/chacha v0.1.0 h1:tg9RSJ18NvL38cCWNyYH1eiG6qDCyyXIaTLQthon0sc= -github.com/metacubex/chacha v0.1.0/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8= +github.com/metacubex/chacha v0.1.1 h1:OHIv11Nd9CISAIzegpjfupIoZp9DYm6uQw41RxvmU/c= +github.com/metacubex/chacha v0.1.1/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 h1:cjd4biTvOzK9ubNCCkQ+ldc4YSH/rILn53l/xGBFHHI= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759/go.mod h1:UHOv2xu+RIgLwpXca7TLrXleEd4oR3sPatW6IF8wU88= github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a h1:cZ6oNVrsmsi3SNlnSnRio4zOgtQq+/XidwsaNgKICcg= github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a/go.mod h1:xBw/SYJPgUMPQ1tklV/brGn2nxhfr3BnvBzNlyi4Nic= -github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da h1:Mq6cbHbPTLLTUfA9scrwBmOGkvl6y99E3WmtMIMqo30= -github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da/go.mod h1:AiZ+UPgrkO1DTnmiAX4b+kRoV1Vfc65UkYD7RbFlIZA= +github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996 h1:B+AP/Pj2/jBDS/kCYjz/x+0BCOKfd2VODYevyeIt+Ds= +github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996/go.mod h1:ExVjGyEwTUjCFqx+5uxgV7MOoA3fZI+th4D40H35xmY= github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs= github.com/metacubex/randv2 v0.2.0/go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY= github.com/metacubex/sing v0.0.0-20241121030428-33b6ebc52000 h1:gUbMXcQXhXGj0vCpCVFTUyIH7TMpD1dpTcNv/MCS+ok= @@ -228,8 +228,8 @@ go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBs go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -238,11 +238,11 @@ golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -258,12 +258,12 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= diff --git a/clash-meta-android/core/src/main/golang/go.mod b/clash-meta-android/core/src/main/golang/go.mod index 4f7e9b3a04..96f64f6ec2 100644 --- a/clash-meta-android/core/src/main/golang/go.mod +++ b/clash-meta-android/core/src/main/golang/go.mod @@ -3,9 +3,9 @@ module cfa go 1.20 require ( - github.com/dlclark/regexp2 v1.11.4 + github.com/dlclark/regexp2 v1.11.5 github.com/metacubex/mihomo v1.7.0 - golang.org/x/sync v0.10.0 + golang.org/x/sync v0.11.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -24,21 +24,21 @@ require ( github.com/cloudflare/circl v1.3.7 // indirect github.com/coreos/go-iptables v0.8.0 // indirect github.com/ebitengine/purego v0.8.2 // indirect - github.com/enfein/mieru/v3 v3.11.1 // indirect + github.com/enfein/mieru/v3 v3.11.2 // indirect github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 // indirect github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 // indirect github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1 // indirect github.com/ericlagergren/subtle v0.0.0-20220507045147-890d697da010 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gaukas/godicttls v0.0.4 // indirect - github.com/go-chi/chi/v5 v5.2.0 // indirect + github.com/go-chi/chi/v5 v5.2.1 // indirect github.com/go-chi/render v1.0.3 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect github.com/gobwas/ws v1.4.0 // indirect - github.com/gofrs/uuid/v5 v5.3.0 // indirect + github.com/gofrs/uuid/v5 v5.3.1 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -55,10 +55,10 @@ require ( github.com/mdlayher/socket v0.4.1 // indirect github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab // indirect github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 // indirect - github.com/metacubex/chacha v0.1.0 // indirect + github.com/metacubex/chacha v0.1.1 // indirect github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 // indirect github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a // indirect - github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da // indirect + github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996 // indirect github.com/metacubex/randv2 v0.2.0 // indirect github.com/metacubex/sing-quic v0.0.0-20250119013740-2a19cce83925 // indirect github.com/metacubex/sing-shadowsocks v0.2.8 // indirect @@ -107,12 +107,12 @@ require ( gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect go.uber.org/mock v0.4.0 // indirect go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect - golang.org/x/crypto v0.32.0 // indirect + golang.org/x/crypto v0.33.0 // indirect golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect golang.org/x/time v0.7.0 // indirect golang.org/x/tools v0.24.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/clash-meta-android/core/src/main/golang/go.sum b/clash-meta-android/core/src/main/golang/go.sum index d95c61e5f7..4a1acb93d2 100644 --- a/clash-meta-android/core/src/main/golang/go.sum +++ b/clash-meta-android/core/src/main/golang/go.sum @@ -24,12 +24,12 @@ github.com/coreos/go-iptables v0.8.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFE github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= -github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= +github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/ebitengine/purego v0.8.2 h1:jPPGWs2sZ1UgOSgD2bClL0MJIqu58nOmIcBuXr62z1I= github.com/ebitengine/purego v0.8.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= -github.com/enfein/mieru/v3 v3.11.1 h1:G6PjSWPvzvgWUoMqnD4sBe1OGkDgrpNVT2UqCQhE6SE= -github.com/enfein/mieru/v3 v3.11.1/go.mod h1:XvVfNsM78lUMSlJJKXJZ0Hn3lAB2o/ETXTbb84x5egw= +github.com/enfein/mieru/v3 v3.11.2 h1:06KyGbXiiGz2nSHLJDOOkztAVY3cRr3wBMOpYxPotTo= +github.com/enfein/mieru/v3 v3.11.2/go.mod h1:XvVfNsM78lUMSlJJKXJZ0Hn3lAB2o/ETXTbb84x5egw= github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9 h1:/5RkVc9Rc81XmMyVqawCiDyrBHZbLAZgTTCqou4mwj8= github.com/ericlagergren/aegis v0.0.0-20230312195928-b4ce538b56f9/go.mod h1:hkIFzoiIPZYxdFOOLyDho59b7SrDfo+w3h+yWdlg45I= github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 h1:8j2RH289RJplhA6WfdaPqzg1MjH2K8wX5e0uhAxrw2g= @@ -43,8 +43,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk= github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI= -github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0= -github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= +github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4= github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= @@ -59,8 +59,8 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= -github.com/gofrs/uuid/v5 v5.3.0 h1:m0mUMr+oVYUdxpMLgSYCZiXe7PuVPnI94+OMeVBNedk= -github.com/gofrs/uuid/v5 v5.3.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gofrs/uuid/v5 v5.3.1 h1:aPx49MwJbekCzOyhZDjJVb0hx3A0KLjlbLx6p2gY0p0= +github.com/gofrs/uuid/v5 v5.3.1/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= @@ -100,14 +100,14 @@ github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab h1:Chbw+/31 github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab/go.mod h1:xVKK8jC5Sd3hfh7WjmCq+HorehIbrBijaUWmcuKjPcI= github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 h1:oBowHVKZycNtAFbZ6avaCSZJYeme2Nrj+4RpV2cNJig= github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399/go.mod h1:4xcieuIK+M4bGQmQYZVqEaIYqjS1ahO4kXG7EmDgEro= -github.com/metacubex/chacha v0.1.0 h1:tg9RSJ18NvL38cCWNyYH1eiG6qDCyyXIaTLQthon0sc= -github.com/metacubex/chacha v0.1.0/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8= +github.com/metacubex/chacha v0.1.1 h1:OHIv11Nd9CISAIzegpjfupIoZp9DYm6uQw41RxvmU/c= +github.com/metacubex/chacha v0.1.1/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 h1:cjd4biTvOzK9ubNCCkQ+ldc4YSH/rILn53l/xGBFHHI= github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759/go.mod h1:UHOv2xu+RIgLwpXca7TLrXleEd4oR3sPatW6IF8wU88= github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a h1:cZ6oNVrsmsi3SNlnSnRio4zOgtQq+/XidwsaNgKICcg= github.com/metacubex/gvisor v0.0.0-20241126021258-5b028898cc5a/go.mod h1:xBw/SYJPgUMPQ1tklV/brGn2nxhfr3BnvBzNlyi4Nic= -github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da h1:Mq6cbHbPTLLTUfA9scrwBmOGkvl6y99E3WmtMIMqo30= -github.com/metacubex/quic-go v0.48.3-0.20241126053724-b69fea3888da/go.mod h1:AiZ+UPgrkO1DTnmiAX4b+kRoV1Vfc65UkYD7RbFlIZA= +github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996 h1:B+AP/Pj2/jBDS/kCYjz/x+0BCOKfd2VODYevyeIt+Ds= +github.com/metacubex/quic-go v0.49.1-0.20250212162123-c135a4412996/go.mod h1:ExVjGyEwTUjCFqx+5uxgV7MOoA3fZI+th4D40H35xmY= github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs= github.com/metacubex/randv2 v0.2.0/go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY= github.com/metacubex/sing v0.0.0-20241121030428-33b6ebc52000 h1:gUbMXcQXhXGj0vCpCVFTUyIH7TMpD1dpTcNv/MCS+ok= @@ -229,8 +229,8 @@ go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBs go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -239,11 +239,11 @@ golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -259,12 +259,12 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= diff --git a/clash-meta-android/core/src/main/java/com/github/kr328/clash/core/model/Proxy.kt b/clash-meta-android/core/src/main/java/com/github/kr328/clash/core/model/Proxy.kt index a74d2097bb..941bccd7a3 100644 --- a/clash-meta-android/core/src/main/java/com/github/kr328/clash/core/model/Proxy.kt +++ b/clash-meta-android/core/src/main/java/com/github/kr328/clash/core/model/Proxy.kt @@ -36,6 +36,7 @@ data class Proxy( Dns(false), Ssh(false), Mieru(false), + AnyTLS(false), Relay(true), diff --git a/clash-nyanpasu/frontend/interface/package.json b/clash-nyanpasu/frontend/interface/package.json index 954d163cbc..c74ad89e65 100644 --- a/clash-nyanpasu/frontend/interface/package.json +++ b/clash-nyanpasu/frontend/interface/package.json @@ -11,7 +11,7 @@ "build": "tsc" }, "dependencies": { - "@tanstack/react-query": "5.66.5", + "@tanstack/react-query": "5.66.6", "@tauri-apps/api": "2.2.0", "ahooks": "3.8.4", "lodash-es": "4.17.21", diff --git a/clash-nyanpasu/frontend/nyanpasu/package.json b/clash-nyanpasu/frontend/nyanpasu/package.json index 9450e3c005..0a50b98d29 100644 --- a/clash-nyanpasu/frontend/nyanpasu/package.json +++ b/clash-nyanpasu/frontend/nyanpasu/package.json @@ -53,9 +53,9 @@ "@csstools/normalize.css": "12.1.1", "@emotion/babel-plugin": "11.13.5", "@emotion/react": "11.14.0", - "@iconify/json": "2.2.307", + "@iconify/json": "2.2.308", "@monaco-editor/react": "4.7.0", - "@tanstack/react-query": "5.66.5", + "@tanstack/react-query": "5.66.6", "@tanstack/react-router": "1.105.0", "@tanstack/router-devtools": "1.105.0", "@tanstack/router-plugin": "1.105.0", diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-nyanpasu-version.tsx b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-nyanpasu-version.tsx index 563899d2f9..c72668af9f 100644 --- a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-nyanpasu-version.tsx +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-nyanpasu-version.tsx @@ -30,7 +30,7 @@ const AutoCheckUpdate = () => { return ( upsert(!value)} /> ) diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-system-service.tsx b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-system-service.tsx index 750f4c20d5..fde4f447ad 100644 --- a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-system-service.tsx +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/setting-system-service.tsx @@ -128,7 +128,7 @@ export const SettingSystemService = () => { serviceMode.upsert(!serviceMode.value)} /> diff --git a/clash-nyanpasu/manifest/version.json b/clash-nyanpasu/manifest/version.json index fdd6ed36cf..8b66c7e9e0 100644 --- a/clash-nyanpasu/manifest/version.json +++ b/clash-nyanpasu/manifest/version.json @@ -2,10 +2,10 @@ "manifest_version": 1, "latest": { "mihomo": "v1.19.2", - "mihomo_alpha": "alpha-ef29e45", + "mihomo_alpha": "alpha-dc1145a", "clash_rs": "v0.7.5", "clash_premium": "2023-09-05-gdcc8d87", - "clash_rs_alpha": "0.7.5-alpha+sha.80cde99" + "clash_rs_alpha": "0.7.5-alpha+sha.4b76691" }, "arch_template": { "mihomo": { @@ -69,5 +69,5 @@ "linux-armv7hf": "clash-armv7-unknown-linux-gnueabihf" } }, - "updated_at": "2025-02-16T22:20:24.343Z" + "updated_at": "2025-02-17T22:20:30.476Z" } diff --git a/clash-nyanpasu/package.json b/clash-nyanpasu/package.json index 00f6c1a317..5929b9bdd5 100644 --- a/clash-nyanpasu/package.json +++ b/clash-nyanpasu/package.json @@ -66,8 +66,8 @@ "@types/fs-extra": "11.0.4", "@types/lodash-es": "4.17.12", "@types/node": "22.13.4", - "@typescript-eslint/eslint-plugin": "8.24.0", - "@typescript-eslint/parser": "8.24.0", + "@typescript-eslint/eslint-plugin": "8.24.1", + "@typescript-eslint/parser": "8.24.1", "autoprefixer": "10.4.20", "conventional-changelog-conventionalcommits": "8.0.0", "cross-env": "7.0.3", @@ -107,7 +107,7 @@ "tailwindcss": "4.0.6", "tsx": "4.19.2", "typescript": "5.7.3", - "typescript-eslint": "8.24.0" + "typescript-eslint": "8.24.1" }, "packageManager": "pnpm@10.4.1", "engines": { diff --git a/clash-nyanpasu/pnpm-lock.yaml b/clash-nyanpasu/pnpm-lock.yaml index 9712862db4..e2d88b29df 100644 --- a/clash-nyanpasu/pnpm-lock.yaml +++ b/clash-nyanpasu/pnpm-lock.yaml @@ -46,11 +46,11 @@ importers: specifier: 22.13.4 version: 22.13.4 '@typescript-eslint/eslint-plugin': - specifier: 8.24.0 - version: 8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + specifier: 8.24.1 + version: 8.24.1(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) '@typescript-eslint/parser': - specifier: 8.24.0 - version: 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + specifier: 8.24.1 + version: 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) autoprefixer: specifier: 10.4.20 version: 10.4.20(postcss@8.5.2) @@ -71,16 +71,16 @@ importers: version: 10.0.1(eslint@9.20.1(jiti@2.4.2)) eslint-config-standard: specifier: 17.1.0 - version: 17.1.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-n@17.15.1(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-promise@7.2.1(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)) + version: 17.1.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-n@17.15.1(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-promise@7.2.1(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)) eslint-import-resolver-alias: specifier: 1.1.2 - version: 1.1.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))) + version: 1.1.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))) eslint-plugin-html: specifier: 8.1.2 version: 8.1.2 eslint-plugin-import: specifier: 2.31.0 - version: 2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) + version: 2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) eslint-plugin-n: specifier: 17.15.1 version: 17.15.1(eslint@9.20.1(jiti@2.4.2)) @@ -110,7 +110,7 @@ importers: version: 15.4.3 neostandard: specifier: 0.12.1 - version: 0.12.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + version: 0.12.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) npm-run-all2: specifier: 7.0.2 version: 7.0.2 @@ -169,14 +169,14 @@ importers: specifier: 5.7.3 version: 5.7.3 typescript-eslint: - specifier: 8.24.0 - version: 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + specifier: 8.24.1 + version: 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) frontend/interface: dependencies: '@tanstack/react-query': - specifier: 5.66.5 - version: 5.66.5(react@19.0.0) + specifier: 5.66.6 + version: 5.66.6(react@19.0.0) '@tauri-apps/api': specifier: 2.2.0 version: 2.2.0 @@ -330,14 +330,14 @@ importers: specifier: 11.14.0 version: 11.14.0(@types/react@19.0.10)(react@19.0.0) '@iconify/json': - specifier: 2.2.307 - version: 2.2.307 + specifier: 2.2.308 + version: 2.2.308 '@monaco-editor/react': specifier: 4.7.0 version: 4.7.0(monaco-editor@0.52.2)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@tanstack/react-query': - specifier: 5.66.5 - version: 5.66.5(react@19.0.0) + specifier: 5.66.6 + version: 5.66.6(react@19.0.0) '@tanstack/react-router': specifier: 1.105.0 version: 1.105.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -1818,8 +1818,8 @@ packages: '@vue/compiler-sfc': optional: true - '@iconify/json@2.2.307': - resolution: {integrity: sha512-540d6XxtPwSVdWf2fM0JTq9j7DYPV7SLpjxPtU5i/AXPTltqZVk0hjVCt5yiFW5fYi0/eiCM44tSDJZJXgKp/w==} + '@iconify/json@2.2.308': + resolution: {integrity: sha512-tT+fOVu/cU9Q6GOZfFE+rcfrK4rqwM7ucn3PnTXG+bIcr9PmuvJExZ4oSXwdgPKLdjPqFnQFGgEvDtWFfJVP2g==} '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} @@ -2885,8 +2885,8 @@ packages: '@tanstack/query-core@5.66.4': resolution: {integrity: sha512-skM/gzNX4shPkqmdTCSoHtJAPMTtmIJNS0hE+xwTTUVYwezArCT34NMermABmBVUg5Ls5aiUXEDXfqwR1oVkcA==} - '@tanstack/react-query@5.66.5': - resolution: {integrity: sha512-D9aABj3/aFeNmifsdllh5O3hPyA8gUnZ1jAV8MjODQ7blirfAyGed9NjAnm8rgEdr1wChyjTT738ij3vY0EREQ==} + '@tanstack/react-query@5.66.6': + resolution: {integrity: sha512-Xepc53h+D5sqoO/MZiSH2ROVLTDfRwR+3E4C2oS71/lo9u2mwbneZIEyIGXEHvmfyQpqtbf9voghD+QwLDLzcA==} peerDependencies: react: ^18 || ^19 @@ -3329,16 +3329,16 @@ packages: '@types/yauzl@2.10.3': resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} - '@typescript-eslint/eslint-plugin@8.24.0': - resolution: {integrity: sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==} + '@typescript-eslint/eslint-plugin@8.24.1': + resolution: {integrity: sha512-ll1StnKtBigWIGqvYDVuDmXJHVH4zLVot1yQ4fJtLpL7qacwkxJc1T0bptqw+miBQ/QfUbhl1TcQ4accW5KUyA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/parser@8.24.0': - resolution: {integrity: sha512-MFDaO9CYiard9j9VepMNa9MTcqVvSny2N4hkY6roquzj8pdCBRENhErrteaQuu7Yjn1ppk0v1/ZF9CG3KIlrTA==} + '@typescript-eslint/parser@8.24.1': + resolution: {integrity: sha512-Tqoa05bu+t5s8CTZFaGpCH2ub3QeT9YDkXbPd3uQ4SfsLoh1/vv2GEYAioPoxCWJJNsenXlC88tRjwoHNts1oQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -3348,12 +3348,12 @@ packages: resolution: {integrity: sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/scope-manager@8.24.0': - resolution: {integrity: sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==} + '@typescript-eslint/scope-manager@8.24.1': + resolution: {integrity: sha512-OdQr6BNBzwRjNEXMQyaGyZzgg7wzjYKfX2ZBV3E04hUCBDv3GQCHiz9RpqdUIiVrMgJGkXm3tcEh4vFSHreS2Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.24.0': - resolution: {integrity: sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==} + '@typescript-eslint/type-utils@8.24.1': + resolution: {integrity: sha512-/Do9fmNgCsQ+K4rCz0STI7lYB4phTtEXqqCAs3gZW0pnK7lWNkvWd5iW545GSmApm4AzmQXmSqXPO565B4WVrw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -3363,8 +3363,8 @@ packages: resolution: {integrity: sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/types@8.24.0': - resolution: {integrity: sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==} + '@typescript-eslint/types@8.24.1': + resolution: {integrity: sha512-9kqJ+2DkUXiuhoiYIUvIYjGcwle8pcPpdlfkemGvTObzgmYfJ5d0Qm6jwb4NBXP9W1I5tss0VIAnWFumz3mC5A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@8.23.0': @@ -3373,8 +3373,8 @@ packages: peerDependencies: typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/typescript-estree@8.24.0': - resolution: {integrity: sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==} + '@typescript-eslint/typescript-estree@8.24.1': + resolution: {integrity: sha512-UPyy4MJ/0RE648DSKQe9g0VDSehPINiejjA6ElqnFaFIhI6ZEiZAkUI0D5MCk0bQcTf/LVqZStvQ6K4lPn/BRg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.8.0' @@ -3386,8 +3386,8 @@ packages: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@8.24.0': - resolution: {integrity: sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==} + '@typescript-eslint/utils@8.24.1': + resolution: {integrity: sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -3397,8 +3397,8 @@ packages: resolution: {integrity: sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/visitor-keys@8.24.0': - resolution: {integrity: sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==} + '@typescript-eslint/visitor-keys@8.24.1': + resolution: {integrity: sha512-EwVHlp5l+2vp8CoqJm9KikPZgi3gbdZAtabKT9KPShGeOcJhsv4Zdo3oc8T8I0uKEmYoU4ItyxbptjF08enaxg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ungap/structured-clone@1.2.0': @@ -7799,8 +7799,8 @@ packages: typedarray-to-buffer@3.1.5: resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} - typescript-eslint@8.24.0: - resolution: {integrity: sha512-/lmv4366en/qbB32Vz5+kCNZEMf6xYHwh1z48suBwZvAtnXKbP+YhGe8OLE2BqC67LMqKkCNLtjejdwsdW6uOQ==} + typescript-eslint@8.24.1: + resolution: {integrity: sha512-cw3rEdzDqBs70TIcb0Gdzbt6h11BSs2pS0yaq7hDWDBtCCSei1pPSUXE9qUdQ/Wm9NgFg8mKtMt1b8fTHIl1jA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -9710,7 +9710,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@iconify/json@2.2.307': + '@iconify/json@2.2.308': dependencies: '@iconify/types': 2.0.0 pathe: 1.1.2 @@ -10744,7 +10744,7 @@ snapshots: '@tanstack/query-core@5.66.4': {} - '@tanstack/react-query@5.66.5(react@19.0.0)': + '@tanstack/react-query@5.66.6(react@19.0.0)': dependencies: '@tanstack/query-core': 5.66.4 react: 19.0.0 @@ -11214,14 +11214,14 @@ snapshots: '@types/node': 22.13.4 optional: true - '@typescript-eslint/eslint-plugin@8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': + '@typescript-eslint/eslint-plugin@8.24.1(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/type-utils': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) - '@typescript-eslint/utils': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 8.24.0 + '@typescript-eslint/parser': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/scope-manager': 8.24.1 + '@typescript-eslint/type-utils': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/utils': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.24.1 eslint: 9.20.1(jiti@2.4.2) graphemer: 1.4.0 ignore: 5.3.2 @@ -11231,12 +11231,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': + '@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) - '@typescript-eslint/visitor-keys': 8.24.0 + '@typescript-eslint/scope-manager': 8.24.1 + '@typescript-eslint/types': 8.24.1 + '@typescript-eslint/typescript-estree': 8.24.1(typescript@5.7.3) + '@typescript-eslint/visitor-keys': 8.24.1 debug: 4.4.0 eslint: 9.20.1(jiti@2.4.2) typescript: 5.7.3 @@ -11248,15 +11248,15 @@ snapshots: '@typescript-eslint/types': 8.23.0 '@typescript-eslint/visitor-keys': 8.23.0 - '@typescript-eslint/scope-manager@8.24.0': + '@typescript-eslint/scope-manager@8.24.1': dependencies: - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/visitor-keys': 8.24.0 + '@typescript-eslint/types': 8.24.1 + '@typescript-eslint/visitor-keys': 8.24.1 - '@typescript-eslint/type-utils@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': + '@typescript-eslint/type-utils@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': dependencies: - '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) - '@typescript-eslint/utils': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/typescript-estree': 8.24.1(typescript@5.7.3) + '@typescript-eslint/utils': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) debug: 4.4.0 eslint: 9.20.1(jiti@2.4.2) ts-api-utils: 2.0.1(typescript@5.7.3) @@ -11266,7 +11266,7 @@ snapshots: '@typescript-eslint/types@8.23.0': {} - '@typescript-eslint/types@8.24.0': {} + '@typescript-eslint/types@8.24.1': {} '@typescript-eslint/typescript-estree@8.23.0(typescript@5.7.3)': dependencies: @@ -11282,10 +11282,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.24.0(typescript@5.7.3)': + '@typescript-eslint/typescript-estree@8.24.1(typescript@5.7.3)': dependencies: - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/visitor-keys': 8.24.0 + '@typescript-eslint/types': 8.24.1 + '@typescript-eslint/visitor-keys': 8.24.1 debug: 4.4.0 fast-glob: 3.3.3 is-glob: 4.0.3 @@ -11307,12 +11307,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': + '@typescript-eslint/utils@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.20.1(jiti@2.4.2)) - '@typescript-eslint/scope-manager': 8.24.0 - '@typescript-eslint/types': 8.24.0 - '@typescript-eslint/typescript-estree': 8.24.0(typescript@5.7.3) + '@typescript-eslint/scope-manager': 8.24.1 + '@typescript-eslint/types': 8.24.1 + '@typescript-eslint/typescript-estree': 8.24.1(typescript@5.7.3) eslint: 9.20.1(jiti@2.4.2) typescript: 5.7.3 transitivePeerDependencies: @@ -11323,9 +11323,9 @@ snapshots: '@typescript-eslint/types': 8.23.0 eslint-visitor-keys: 4.2.0 - '@typescript-eslint/visitor-keys@8.24.0': + '@typescript-eslint/visitor-keys@8.24.1': dependencies: - '@typescript-eslint/types': 8.24.0 + '@typescript-eslint/types': 8.24.1 eslint-visitor-keys: 4.2.0 '@ungap/structured-clone@1.2.0': {} @@ -12775,16 +12775,16 @@ snapshots: dependencies: eslint: 9.20.1(jiti@2.4.2) - eslint-config-standard@17.1.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-n@17.15.1(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-promise@7.2.1(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)): + eslint-config-standard@17.1.0(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-n@17.15.1(eslint@9.20.1(jiti@2.4.2)))(eslint-plugin-promise@7.2.1(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)): dependencies: eslint: 9.20.1(jiti@2.4.2) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) eslint-plugin-n: 17.15.1(eslint@9.20.1(jiti@2.4.2)) eslint-plugin-promise: 7.2.1(eslint@9.20.1(jiti@2.4.2)) - eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))): + eslint-import-resolver-alias@1.1.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))): dependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) eslint-import-resolver-node@0.3.9: dependencies: @@ -12794,7 +12794,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)): + eslint-import-resolver-typescript@3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.0 @@ -12806,16 +12806,16 @@ snapshots: is-glob: 4.0.3 stable-hash: 0.0.4 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)) eslint-plugin-import-x: 4.5.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.1(jiti@2.4.2)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.1(jiti@2.4.2)): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/parser': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) eslint: 9.20.1(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -12850,7 +12850,7 @@ snapshots: - supports-color - typescript - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -12861,7 +12861,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.20.1(jiti@2.4.2) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.1(jiti@2.4.2)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint@9.20.1(jiti@2.4.2)) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -12873,7 +12873,7 @@ snapshots: string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/parser': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -14653,12 +14653,12 @@ snapshots: sax: 1.3.0 optional: true - neostandard@0.12.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3): + neostandard@0.12.1(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3): dependencies: '@humanwhocodes/gitignore-to-minimatch': 1.0.2 '@stylistic/eslint-plugin': 2.11.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) eslint: 9.20.1(jiti@2.4.2) - eslint-import-resolver-typescript: 3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)) + eslint-import-resolver-typescript: 3.7.0(eslint-plugin-import-x@4.5.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2)))(eslint@9.20.1(jiti@2.4.2)) eslint-plugin-import-x: 4.5.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) eslint-plugin-n: 17.15.1(eslint@9.20.1(jiti@2.4.2)) eslint-plugin-promise: 7.2.1(eslint@9.20.1(jiti@2.4.2)) @@ -14666,7 +14666,7 @@ snapshots: find-up: 5.0.0 globals: 15.15.0 peowly: 1.3.2 - typescript-eslint: 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + typescript-eslint: 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) transitivePeerDependencies: - eslint-plugin-import - supports-color @@ -16289,11 +16289,11 @@ snapshots: dependencies: is-typedarray: 1.0.0 - typescript-eslint@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3): + typescript-eslint@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.24.0(@typescript-eslint/parser@8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) - '@typescript-eslint/parser': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) - '@typescript-eslint/utils': 8.24.0(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/eslint-plugin': 8.24.1(@typescript-eslint/parser@8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3))(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/parser': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) + '@typescript-eslint/utils': 8.24.1(eslint@9.20.1(jiti@2.4.2))(typescript@5.7.3) eslint: 9.20.1(jiti@2.4.2) typescript: 5.7.3 transitivePeerDependencies: diff --git a/lede/package/firmware/ipq-wifi/Makefile b/lede/package/firmware/ipq-wifi/Makefile index fd9f332b91..fc021818df 100644 --- a/lede/package/firmware/ipq-wifi/Makefile +++ b/lede/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2024-10-08 -PKG_SOURCE_VERSION:=dcbab62272bf5cab2ed857bc655d240970e14f2a -PKG_MIRROR_HASH:=23fc47a0fd9f39defe272b9f5d5b08622e7762a57bc4830965972ee89d89f481 +PKG_SOURCE_DATE:=2025-02-16 +PKG_SOURCE_VERSION:=331dd0ead646f0d3fe38cb4bf83cce4b448343e8 +PKG_MIRROR_HASH:=8b611788800b04dd71970bc4fec20d032eda4e3cb3441c3f7b7c29d174da3d2b PKG_FLAGS:=nonshared @@ -60,6 +60,7 @@ ALLWIFIBOARDS:= \ xiaomi_rm1800 \ yuncore_ax880 \ yuncore_fap650 \ + zbtlink_zbt-z800ax \ zte_mf269 \ zte_mf287 \ zte_mf287plus \ @@ -175,6 +176,7 @@ $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000)) $(eval $(call generate-ipq-wifi-package,xiaomi_rm1800,Xiaomi RM1800)) $(eval $(call generate-ipq-wifi-package,yuncore_ax880,Yuncore AX880)) $(eval $(call generate-ipq-wifi-package,yuncore_fap650,Yuncore FAP650)) +$(eval $(call generate-ipq-wifi-package,zbtlink_zbt-z800ax,Zbtlink ZBT-Z800AX)) $(eval $(call generate-ipq-wifi-package,zte_mf269,ZTE MF269)) $(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287)) $(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus)) diff --git a/lede/package/firmware/ipq-wifi/src/board-qihoo_360v6.ipq6018 b/lede/package/firmware/ipq-wifi/src/board-qihoo_360v6.ipq6018 deleted file mode 100644 index cdeb213a77..0000000000 Binary files a/lede/package/firmware/ipq-wifi/src/board-qihoo_360v6.ipq6018 and /dev/null differ diff --git a/lede/package/firmware/ipq-wifi/src/board-zn_m2.ipq6018 b/lede/package/firmware/ipq-wifi/src/board-zn_m2.ipq6018 deleted file mode 100644 index 5436c2c3f5..0000000000 Binary files a/lede/package/firmware/ipq-wifi/src/board-zn_m2.ipq6018 and /dev/null differ diff --git a/lede/target/linux/qualcommbe/patches-6.6/001-v6.8-arm64-dts-qcom-ipq9574-Add-common-RDP-dtsi-file.patch b/lede/target/linux/qualcommbe/patches-6.6/001-v6.8-arm64-dts-qcom-ipq9574-Add-common-RDP-dtsi-file.patch index dc41c33c03..ac12d16428 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/001-v6.8-arm64-dts-qcom-ipq9574-Add-common-RDP-dtsi-file.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/001-v6.8-arm64-dts-qcom-ipq9574-Add-common-RDP-dtsi-file.patch @@ -20,9 +20,6 @@ Signed-off-by: Bjorn Andersson 6 files changed, 130 insertions(+), 345 deletions(-) create mode 100644 arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -new file mode 100644 -index 000000000000..40a7aefd0540 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi @@ -0,0 +1,125 @@ @@ -151,8 +148,6 @@ index 000000000000..40a7aefd0540 +&xo_board_clk { + clock-frequency = <24000000>; +}; -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp418.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp418.dts -index 2b093e02637b..f4f9199d4ab1 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp418.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp418.dts @@ -8,58 +8,12 @@ @@ -215,7 +210,7 @@ index 2b093e02637b..f4f9199d4ab1 100644 }; &sdhc_1 { -@@ -74,10 +28,6 @@ &sdhc_1 { +@@ -74,10 +28,6 @@ status = "okay"; }; @@ -226,7 +221,7 @@ index 2b093e02637b..f4f9199d4ab1 100644 &tlmm { sdc_default_state: sdc-default-state { clk-pins { -@@ -110,15 +60,4 @@ rclk-pins { +@@ -110,15 +60,4 @@ bias-pull-down; }; }; @@ -242,8 +237,6 @@ index 2b093e02637b..f4f9199d4ab1 100644 -&xo_board_clk { - clock-frequency = <24000000>; }; -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -index 877026ccc6e2..1bb8d96c9a82 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts @@ -8,69 +8,11 @@ @@ -317,7 +310,7 @@ index 877026ccc6e2..1bb8d96c9a82 100644 }; &sdhc_1 { -@@ -85,10 +27,6 @@ &sdhc_1 { +@@ -85,10 +27,6 @@ status = "okay"; }; @@ -328,7 +321,7 @@ index 877026ccc6e2..1bb8d96c9a82 100644 &tlmm { sdc_default_state: sdc-default-state { clk-pins { -@@ -122,30 +60,3 @@ rclk-pins { +@@ -122,30 +60,3 @@ }; }; }; @@ -359,8 +352,6 @@ index 877026ccc6e2..1bb8d96c9a82 100644 -&xo_board_clk { - clock-frequency = <24000000>; -}; -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp449.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp449.dts -index c8fa54e1a62c..d36d1078763e 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp449.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp449.dts @@ -8,73 +8,10 @@ @@ -438,8 +429,6 @@ index c8fa54e1a62c..d36d1078763e 100644 -&xo_board_clk { - clock-frequency = <24000000>; }; -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp453.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp453.dts -index f01de6628c3b..c30c9fbedf26 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp453.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp453.dts @@ -8,73 +8,10 @@ @@ -517,8 +506,6 @@ index f01de6628c3b..c30c9fbedf26 100644 -&xo_board_clk { - clock-frequency = <24000000>; }; -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp454.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp454.dts -index 6efae3426cb8..0dc382f5d5ec 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp454.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp454.dts @@ -8,73 +8,9 @@ @@ -596,6 +583,3 @@ index 6efae3426cb8..0dc382f5d5ec 100644 -&xo_board_clk { - clock-frequency = <24000000>; }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/002-01-v6.11-dt-bindings-clock-add-qca8386-qca8084-clock-and-rese.patch b/lede/target/linux/qualcommbe/patches-6.6/002-01-v6.11-dt-bindings-clock-add-qca8386-qca8084-clock-and-rese.patch index 0e300ca56d..ed41e747e1 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/002-01-v6.11-dt-bindings-clock-add-qca8386-qca8084-clock-and-rese.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/002-01-v6.11-dt-bindings-clock-add-qca8386-qca8084-clock-and-rese.patch @@ -21,9 +21,6 @@ Signed-off-by: Bjorn Andersson create mode 100644 include/dt-bindings/clock/qcom,qca8k-nsscc.h create mode 100644 include/dt-bindings/reset/qcom,qca8k-nsscc.h -diff --git a/Documentation/devicetree/bindings/clock/qcom,qca8k-nsscc.yaml b/Documentation/devicetree/bindings/clock/qcom,qca8k-nsscc.yaml -new file mode 100644 -index 000000000000..61473385da2d --- /dev/null +++ b/Documentation/devicetree/bindings/clock/qcom,qca8k-nsscc.yaml @@ -0,0 +1,86 @@ @@ -113,9 +110,6 @@ index 000000000000..61473385da2d + }; + }; +... -diff --git a/include/dt-bindings/clock/qcom,qca8k-nsscc.h b/include/dt-bindings/clock/qcom,qca8k-nsscc.h -new file mode 100644 -index 000000000000..0ac3e4c69a1a --- /dev/null +++ b/include/dt-bindings/clock/qcom,qca8k-nsscc.h @@ -0,0 +1,101 @@ @@ -220,9 +214,6 @@ index 000000000000..0ac3e4c69a1a +#define NSS_CC_GEPHY2_SYS_CLK 90 +#define NSS_CC_GEPHY3_SYS_CLK 91 +#endif -diff --git a/include/dt-bindings/reset/qcom,qca8k-nsscc.h b/include/dt-bindings/reset/qcom,qca8k-nsscc.h -new file mode 100644 -index 000000000000..c71167a3bd41 --- /dev/null +++ b/include/dt-bindings/reset/qcom,qca8k-nsscc.h @@ -0,0 +1,76 @@ @@ -302,6 +293,3 @@ index 000000000000..c71167a3bd41 +#define NSS_CC_GLOBAL_ARES 66 +#define NSS_CC_XPCS_ARES 67 +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/002-02-v6.11-clk-qcom-add-clock-controller-driver-for-qca8386-qca.patch b/lede/target/linux/qualcommbe/patches-6.6/002-02-v6.11-clk-qcom-add-clock-controller-driver-for-qca8386-qca.patch index d831bb6a75..fe670b1f02 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/002-02-v6.11-clk-qcom-add-clock-controller-driver-for-qca8386-qca.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/002-02-v6.11-clk-qcom-add-clock-controller-driver-for-qca8386-qca.patch @@ -32,11 +32,9 @@ Signed-off-by: Bjorn Andersson 3 files changed, 2231 insertions(+) create mode 100644 drivers/clk/qcom/nsscc-qca8k.c -diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig -index 20ba2eeb24ec..4432b1cce478 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig -@@ -249,6 +249,15 @@ config IPQ_GCC_9574 +@@ -204,6 +204,15 @@ config IPQ_GCC_9574 i2c, USB, SD/eMMC, etc. Select this for the root clock of ipq9574. @@ -52,11 +50,9 @@ index 20ba2eeb24ec..4432b1cce478 100644 config MSM_GCC_8660 tristate "MSM8660 Global Clock Controller" depends on ARM || COMPILE_TEST -diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile -index b7de8600dc3d..0241f00689bc 100644 --- a/drivers/clk/qcom/Makefile +++ b/drivers/clk/qcom/Makefile -@@ -36,6 +36,7 @@ obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o +@@ -31,6 +31,7 @@ obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806 obj-$(CONFIG_IPQ_GCC_8074) += gcc-ipq8074.o obj-$(CONFIG_IPQ_GCC_9574) += gcc-ipq9574.o obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o @@ -64,9 +60,6 @@ index b7de8600dc3d..0241f00689bc 100644 obj-$(CONFIG_MDM_GCC_9607) += gcc-mdm9607.o obj-$(CONFIG_MDM_GCC_9615) += gcc-mdm9615.o obj-$(CONFIG_MSM_GCC_8660) += gcc-msm8660.o -diff --git a/drivers/clk/qcom/nsscc-qca8k.c b/drivers/clk/qcom/nsscc-qca8k.c -new file mode 100644 -index 000000000000..5c8324e2bcca --- /dev/null +++ b/drivers/clk/qcom/nsscc-qca8k.c @@ -0,0 +1,2221 @@ @@ -2291,6 +2284,3 @@ index 000000000000..5c8324e2bcca + +MODULE_DESCRIPTION("QCOM NSS_CC QCA8K Driver"); +MODULE_LICENSE("GPL"); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/003-v6.11-arm64-dts-qcom-ipq9574-add-MDIO-bus.patch b/lede/target/linux/qualcommbe/patches-6.6/003-v6.11-arm64-dts-qcom-ipq9574-add-MDIO-bus.patch index 90a7ad364c..43f256bb26 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/003-v6.11-arm64-dts-qcom-ipq9574-add-MDIO-bus.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/003-v6.11-arm64-dts-qcom-ipq9574-add-MDIO-bus.patch @@ -13,11 +13,9 @@ Signed-off-by: Bjorn Andersson arch/arm64/boot/dts/qcom/ipq9574.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 7f2e5cbf3bbb..ded02bc39275 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -232,6 +232,16 @@ rng: rng@e3000 { +@@ -218,6 +218,16 @@ clock-names = "core"; }; @@ -34,6 +32,3 @@ index 7f2e5cbf3bbb..ded02bc39275 100644 qfprom: efuse@a4000 { compatible = "qcom,ipq9574-qfprom", "qcom,qfprom"; reg = <0x000a4000 0x5a1>; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/004-01-v.610-clk-qcom-clk-rcg-introduce-support-for-multiple-conf.patch b/lede/target/linux/qualcommbe/patches-6.6/004-01-v.610-clk-qcom-clk-rcg-introduce-support-for-multiple-conf.patch index c75cd16d6b..91d956240a 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/004-01-v.610-clk-qcom-clk-rcg-introduce-support-for-multiple-conf.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/004-01-v.610-clk-qcom-clk-rcg-introduce-support-for-multiple-conf.patch @@ -35,8 +35,6 @@ Signed-off-by: Bjorn Andersson drivers/clk/qcom/clk-rcg.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) -diff --git a/drivers/clk/qcom/clk-rcg.h b/drivers/clk/qcom/clk-rcg.h -index e6d84c8c7989..c50e6616d02c 100644 --- a/drivers/clk/qcom/clk-rcg.h +++ b/drivers/clk/qcom/clk-rcg.h @@ -17,6 +17,23 @@ struct freq_tbl { @@ -63,7 +61,7 @@ index e6d84c8c7989..c50e6616d02c 100644 /** * struct mn - M/N:D counter * @mnctr_en_bit: bit to enable mn counter -@@ -138,6 +155,7 @@ extern const struct clk_ops clk_dyn_rcg_ops; +@@ -138,6 +155,7 @@ extern const struct clk_ops clk_dyn_rcg_ * @safe_src_index: safe src index value * @parent_map: map from software's parent index to hardware's src_sel field * @freq_tbl: frequency table @@ -83,6 +81,3 @@ index e6d84c8c7989..c50e6616d02c 100644 struct clk_regmap clkr; u8 cfg_off; u32 parked_cfg; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/004-02-v6.10-clk-qcom-clk-rcg2-add-support-for-rcg2-freq-multi-op.patch b/lede/target/linux/qualcommbe/patches-6.6/004-02-v6.10-clk-qcom-clk-rcg2-add-support-for-rcg2-freq-multi-op.patch index 94451fd636..7c329cb0c0 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/004-02-v6.10-clk-qcom-clk-rcg2-add-support-for-rcg2-freq-multi-op.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/004-02-v6.10-clk-qcom-clk-rcg2-add-support-for-rcg2-freq-multi-op.patch @@ -36,8 +36,6 @@ Signed-off-by: Bjorn Andersson drivers/clk/qcom/common.h | 2 + 4 files changed, 187 insertions(+) -diff --git a/drivers/clk/qcom/clk-rcg.h b/drivers/clk/qcom/clk-rcg.h -index c50e6616d02c..d7414361e432 100644 --- a/drivers/clk/qcom/clk-rcg.h +++ b/drivers/clk/qcom/clk-rcg.h @@ -190,6 +190,7 @@ struct clk_rcg2_gfx3d { @@ -48,11 +46,9 @@ index c50e6616d02c..d7414361e432 100644 extern const struct clk_ops clk_rcg2_mux_closest_ops; extern const struct clk_ops clk_edp_pixel_ops; extern const struct clk_ops clk_byte_ops; -diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c -index 5183c74b074f..9b3aaa7f20ac 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c -@@ -260,6 +260,115 @@ static int _freq_tbl_determine_rate(struct clk_hw *hw, const struct freq_tbl *f, +@@ -260,6 +260,115 @@ static int _freq_tbl_determine_rate(stru return 0; } @@ -168,7 +164,7 @@ index 5183c74b074f..9b3aaa7f20ac 100644 static int clk_rcg2_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) { -@@ -276,6 +385,14 @@ static int clk_rcg2_determine_floor_rate(struct clk_hw *hw, +@@ -276,6 +385,14 @@ static int clk_rcg2_determine_floor_rate return _freq_tbl_determine_rate(hw, rcg->freq_tbl, req, FLOOR); } @@ -183,7 +179,7 @@ index 5183c74b074f..9b3aaa7f20ac 100644 static int __clk_rcg2_configure(struct clk_rcg2 *rcg, const struct freq_tbl *f, u32 *_cfg) { -@@ -371,6 +488,30 @@ static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate, +@@ -371,6 +488,30 @@ static int __clk_rcg2_set_rate(struct cl return clk_rcg2_configure(rcg, f); } @@ -214,7 +210,7 @@ index 5183c74b074f..9b3aaa7f20ac 100644 static int clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { -@@ -383,6 +524,12 @@ static int clk_rcg2_set_floor_rate(struct clk_hw *hw, unsigned long rate, +@@ -383,6 +524,12 @@ static int clk_rcg2_set_floor_rate(struc return __clk_rcg2_set_rate(hw, rate, FLOOR); } @@ -227,7 +223,7 @@ index 5183c74b074f..9b3aaa7f20ac 100644 static int clk_rcg2_set_rate_and_parent(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate, u8 index) { -@@ -395,6 +542,12 @@ static int clk_rcg2_set_floor_rate_and_parent(struct clk_hw *hw, +@@ -395,6 +542,12 @@ static int clk_rcg2_set_floor_rate_and_p return __clk_rcg2_set_rate(hw, rate, FLOOR); } @@ -240,7 +236,7 @@ index 5183c74b074f..9b3aaa7f20ac 100644 static int clk_rcg2_get_duty_cycle(struct clk_hw *hw, struct clk_duty *duty) { struct clk_rcg2 *rcg = to_clk_rcg2(hw); -@@ -505,6 +658,19 @@ const struct clk_ops clk_rcg2_floor_ops = { +@@ -505,6 +658,19 @@ const struct clk_ops clk_rcg2_floor_ops }; EXPORT_SYMBOL_GPL(clk_rcg2_floor_ops); @@ -260,11 +256,9 @@ index 5183c74b074f..9b3aaa7f20ac 100644 const struct clk_ops clk_rcg2_mux_closest_ops = { .determine_rate = __clk_mux_determine_rate_closest, .get_parent = clk_rcg2_get_parent, -diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c -index 75f09e6e057e..48f81e3a5e80 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c -@@ -41,6 +41,24 @@ struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, unsigned long rate) +@@ -41,6 +41,24 @@ struct freq_tbl *qcom_find_freq(const st } EXPORT_SYMBOL_GPL(qcom_find_freq); @@ -289,11 +283,9 @@ index 75f09e6e057e..48f81e3a5e80 100644 const struct freq_tbl *qcom_find_freq_floor(const struct freq_tbl *f, unsigned long rate) { -diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h -index 9c8f7b798d9f..2d4a8a837e6c 100644 --- a/drivers/clk/qcom/common.h +++ b/drivers/clk/qcom/common.h -@@ -45,6 +45,8 @@ extern const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, +@@ -45,6 +45,8 @@ extern const struct freq_tbl *qcom_find_ unsigned long rate); extern const struct freq_tbl *qcom_find_freq_floor(const struct freq_tbl *f, unsigned long rate); @@ -302,6 +294,3 @@ index 9c8f7b798d9f..2d4a8a837e6c 100644 extern void qcom_pll_set_fsm_mode(struct regmap *m, u32 reg, u8 bias_count, u8 lock_count); extern int qcom_find_src_index(struct clk_hw *hw, const struct parent_map *map, --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/005-v6.11-clk-qcom-branch-Add-clk_branch2_prepare_ops.patch b/lede/target/linux/qualcommbe/patches-6.6/005-v6.11-clk-qcom-branch-Add-clk_branch2_prepare_ops.patch index 7790af54ee..1f35ac2002 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/005-v6.11-clk-qcom-branch-Add-clk_branch2_prepare_ops.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/005-v6.11-clk-qcom-branch-Add-clk_branch2_prepare_ops.patch @@ -20,11 +20,9 @@ Signed-off-by: Bjorn Andersson drivers/clk/qcom/clk-branch.h | 1 + 2 files changed, 8 insertions(+) -diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c -index c1dba33ac31a..229480c5b075 100644 --- a/drivers/clk/qcom/clk-branch.c +++ b/drivers/clk/qcom/clk-branch.c -@@ -191,3 +191,10 @@ const struct clk_ops clk_branch_simple_ops = { +@@ -153,3 +153,10 @@ const struct clk_ops clk_branch_simple_o .is_enabled = clk_is_enabled_regmap, }; EXPORT_SYMBOL_GPL(clk_branch_simple_ops); @@ -35,18 +33,13 @@ index c1dba33ac31a..229480c5b075 100644 + .is_prepared = clk_is_enabled_regmap, +}; +EXPORT_SYMBOL_GPL(clk_branch2_prepare_ops); -diff --git a/drivers/clk/qcom/clk-branch.h b/drivers/clk/qcom/clk-branch.h -index f1b3b635ff32..292756435f53 100644 --- a/drivers/clk/qcom/clk-branch.h +++ b/drivers/clk/qcom/clk-branch.h -@@ -109,6 +109,7 @@ extern const struct clk_ops clk_branch2_ops; +@@ -85,6 +85,7 @@ extern const struct clk_ops clk_branch_o + extern const struct clk_ops clk_branch2_ops; extern const struct clk_ops clk_branch_simple_ops; extern const struct clk_ops clk_branch2_aon_ops; +extern const struct clk_ops clk_branch2_prepare_ops; #define to_clk_branch(_hw) \ container_of(to_clk_regmap(_hw), struct clk_branch, clkr) - --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/006-v6.11-clk-qcom-common-commonize-qcom_cc_really_probe.patch b/lede/target/linux/qualcommbe/patches-6.6/006-v6.11-clk-qcom-common-commonize-qcom_cc_really_probe.patch index d5db3712df..8d4153d70c 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/006-v6.11-clk-qcom-common-commonize-qcom_cc_really_probe.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/006-v6.11-clk-qcom-common-commonize-qcom_cc_really_probe.patch @@ -131,11 +131,9 @@ Signed-off-by: Bjorn Andersson drivers/clk/qcom/videocc-sm8550.c | 2 +- 105 files changed, 108 insertions(+), 109 deletions(-) -diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c -index e6295b832686..c89d126ebac3 100644 --- a/drivers/clk/qcom/apss-ipq6018.c +++ b/drivers/clk/qcom/apss-ipq6018.c -@@ -123,7 +123,7 @@ static int apss_ipq6018_probe(struct platform_device *pdev) +@@ -89,7 +89,7 @@ static int apss_ipq6018_probe(struct pla if (!regmap) return -ENODEV; @@ -144,11 +142,9 @@ index e6295b832686..c89d126ebac3 100644 } static struct platform_driver apss_ipq6018_driver = { -diff --git a/drivers/clk/qcom/camcc-sc7280.c b/drivers/clk/qcom/camcc-sc7280.c -index da29d3b953ee..accd257632df 100644 --- a/drivers/clk/qcom/camcc-sc7280.c +++ b/drivers/clk/qcom/camcc-sc7280.c -@@ -2481,7 +2481,7 @@ static int cam_cc_sc7280_probe(struct platform_device *pdev) +@@ -2462,7 +2462,7 @@ static int cam_cc_sc7280_probe(struct pl clk_lucid_pll_configure(&cam_cc_pll5, regmap, &cam_cc_pll5_config); clk_lucid_pll_configure(&cam_cc_pll6, regmap, &cam_cc_pll6_config); @@ -157,11 +153,9 @@ index da29d3b953ee..accd257632df 100644 } static struct platform_driver cam_cc_sc7280_driver = { -diff --git a/drivers/clk/qcom/camcc-sdm845.c b/drivers/clk/qcom/camcc-sdm845.c -index 8466d03e0d05..40022a10f8c0 100644 --- a/drivers/clk/qcom/camcc-sdm845.c +++ b/drivers/clk/qcom/camcc-sdm845.c -@@ -1735,7 +1735,7 @@ static int cam_cc_sdm845_probe(struct platform_device *pdev) +@@ -1735,7 +1735,7 @@ static int cam_cc_sdm845_probe(struct pl cam_cc_pll_config.l = 0x14; clk_fabia_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll_config); @@ -170,11 +164,9 @@ index 8466d03e0d05..40022a10f8c0 100644 } static struct platform_driver cam_cc_sdm845_driver = { -diff --git a/drivers/clk/qcom/camcc-sm6350.c b/drivers/clk/qcom/camcc-sm6350.c -index c6fe684aa780..f6634cc8663e 100644 --- a/drivers/clk/qcom/camcc-sm6350.c +++ b/drivers/clk/qcom/camcc-sm6350.c -@@ -1879,7 +1879,7 @@ static int camcc_sm6350_probe(struct platform_device *pdev) +@@ -1879,7 +1879,7 @@ static int camcc_sm6350_probe(struct pla clk_agera_pll_configure(&camcc_pll2, regmap, &camcc_pll2_config); clk_fabia_pll_configure(&camcc_pll3, regmap, &camcc_pll3_config); @@ -183,11 +175,9 @@ index c6fe684aa780..f6634cc8663e 100644 } static struct platform_driver camcc_sm6350_driver = { -diff --git a/drivers/clk/qcom/camcc-sm8250.c b/drivers/clk/qcom/camcc-sm8250.c -index 96103eeda586..34d2f17520dc 100644 --- a/drivers/clk/qcom/camcc-sm8250.c +++ b/drivers/clk/qcom/camcc-sm8250.c -@@ -2433,7 +2433,7 @@ static int cam_cc_sm8250_probe(struct platform_device *pdev) +@@ -2433,7 +2433,7 @@ static int cam_cc_sm8250_probe(struct pl clk_lucid_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config); clk_lucid_pll_configure(&cam_cc_pll4, regmap, &cam_cc_pll4_config); @@ -196,11 +186,9 @@ index 96103eeda586..34d2f17520dc 100644 } static struct platform_driver cam_cc_sm8250_driver = { -diff --git a/drivers/clk/qcom/camcc-sm8450.c b/drivers/clk/qcom/camcc-sm8450.c -index 51338a2884d2..26b78eed15ef 100644 --- a/drivers/clk/qcom/camcc-sm8450.c +++ b/drivers/clk/qcom/camcc-sm8450.c -@@ -2839,7 +2839,7 @@ static int cam_cc_sm8450_probe(struct platform_device *pdev) +@@ -2839,7 +2839,7 @@ static int cam_cc_sm8450_probe(struct pl clk_lucid_evo_pll_configure(&cam_cc_pll7, regmap, &cam_cc_pll7_config); clk_lucid_evo_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config); @@ -209,11 +197,9 @@ index 51338a2884d2..26b78eed15ef 100644 } static struct platform_driver cam_cc_sm8450_driver = { -diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c -index 1e79f05d5226..c92e10c60322 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c -@@ -252,11 +252,10 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec, +@@ -250,11 +250,10 @@ static struct clk_hw *qcom_cc_clk_hw_get return cc->rclks[idx] ? &cc->rclks[idx]->hw : NULL; } @@ -226,7 +212,7 @@ index 1e79f05d5226..c92e10c60322 100644 struct qcom_reset_controller *reset; struct qcom_cc *cc; struct gdsc_desc *scd; -@@ -333,7 +332,7 @@ int qcom_cc_probe(struct platform_device *pdev, const struct qcom_cc_desc *desc) +@@ -331,7 +330,7 @@ int qcom_cc_probe(struct platform_device if (IS_ERR(regmap)) return PTR_ERR(regmap); @@ -235,7 +221,7 @@ index 1e79f05d5226..c92e10c60322 100644 } EXPORT_SYMBOL_GPL(qcom_cc_probe); -@@ -351,7 +350,7 @@ int qcom_cc_probe_by_index(struct platform_device *pdev, int index, +@@ -349,7 +348,7 @@ int qcom_cc_probe_by_index(struct platfo if (IS_ERR(regmap)) return PTR_ERR(regmap); @@ -244,11 +230,9 @@ index 1e79f05d5226..c92e10c60322 100644 } EXPORT_SYMBOL_GPL(qcom_cc_probe_by_index); -diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h -index 2d4a8a837e6c..d048bdeeba10 100644 --- a/drivers/clk/qcom/common.h +++ b/drivers/clk/qcom/common.h -@@ -60,7 +60,7 @@ extern int qcom_cc_register_sleep_clk(struct device *dev); +@@ -60,7 +60,7 @@ extern int qcom_cc_register_sleep_clk(st extern struct regmap *qcom_cc_map(struct platform_device *pdev, const struct qcom_cc_desc *desc); @@ -257,24 +241,20 @@ index 2d4a8a837e6c..d048bdeeba10 100644 const struct qcom_cc_desc *desc, struct regmap *regmap); extern int qcom_cc_probe(struct platform_device *pdev, -diff --git a/drivers/clk/qcom/dispcc-qcm2290.c b/drivers/clk/qcom/dispcc-qcm2290.c -index 654a10d53e5c..449ffea2295d 100644 --- a/drivers/clk/qcom/dispcc-qcm2290.c +++ b/drivers/clk/qcom/dispcc-qcm2290.c -@@ -522,7 +522,7 @@ static int disp_cc_qcm2290_probe(struct platform_device *pdev) - /* Keep some clocks always-on */ - qcom_branch_set_clk_en(regmap, 0x604c); /* DISP_CC_XO_CLK */ +@@ -522,7 +522,7 @@ static int disp_cc_qcm2290_probe(struct + /* Keep DISP_CC_XO_CLK always-ON */ + regmap_update_bits(regmap, 0x604c, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &disp_cc_qcm2290_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_qcm2290_desc, regmap); if (ret) { dev_err(&pdev->dev, "Failed to register DISP CC clocks\n"); return ret; -diff --git a/drivers/clk/qcom/dispcc-sc7180.c b/drivers/clk/qcom/dispcc-sc7180.c -index 38d7859981c7..4710247be530 100644 --- a/drivers/clk/qcom/dispcc-sc7180.c +++ b/drivers/clk/qcom/dispcc-sc7180.c -@@ -713,7 +713,7 @@ static int disp_cc_sc7180_probe(struct platform_device *pdev) +@@ -713,7 +713,7 @@ static int disp_cc_sc7180_probe(struct p clk_fabia_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll_config); @@ -283,24 +263,20 @@ index 38d7859981c7..4710247be530 100644 } static struct platform_driver disp_cc_sc7180_driver = { -diff --git a/drivers/clk/qcom/dispcc-sc7280.c b/drivers/clk/qcom/dispcc-sc7280.c -index fbeb8fccb99a..db0745954894 100644 --- a/drivers/clk/qcom/dispcc-sc7280.c +++ b/drivers/clk/qcom/dispcc-sc7280.c -@@ -881,7 +881,7 @@ static int disp_cc_sc7280_probe(struct platform_device *pdev) - /* Keep some clocks always-on */ - qcom_branch_set_clk_en(regmap, 0x5008); /* DISP_CC_XO_CLK */ +@@ -884,7 +884,7 @@ static int disp_cc_sc7280_probe(struct p + */ + regmap_update_bits(regmap, 0x5008, BIT(0), BIT(0)); - return qcom_cc_really_probe(pdev, &disp_cc_sc7280_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &disp_cc_sc7280_desc, regmap); } static struct platform_driver disp_cc_sc7280_driver = { -diff --git a/drivers/clk/qcom/dispcc-sc8280xp.c b/drivers/clk/qcom/dispcc-sc8280xp.c -index 91172f5b2f15..f1ca9ae0b33f 100644 --- a/drivers/clk/qcom/dispcc-sc8280xp.c +++ b/drivers/clk/qcom/dispcc-sc8280xp.c -@@ -3172,7 +3172,7 @@ static int disp_cc_sc8280xp_probe(struct platform_device *pdev) +@@ -3172,7 +3172,7 @@ static int disp_cc_sc8280xp_probe(struct clk_lucid_pll_configure(clkr_to_alpha_clk_pll(desc->clks[DISP_CC_PLL1]), regmap, &disp_cc_pll1_config); clk_lucid_pll_configure(clkr_to_alpha_clk_pll(desc->clks[DISP_CC_PLL2]), regmap, &disp_cc_pll2_config); @@ -309,11 +285,9 @@ index 91172f5b2f15..f1ca9ae0b33f 100644 if (ret) { dev_err(&pdev->dev, "Failed to register display clock controller\n"); goto out_pm_runtime_put; -diff --git a/drivers/clk/qcom/dispcc-sdm845.c b/drivers/clk/qcom/dispcc-sdm845.c -index b84fdd17c3d8..e6139e8f74dc 100644 --- a/drivers/clk/qcom/dispcc-sdm845.c +++ b/drivers/clk/qcom/dispcc-sdm845.c -@@ -863,7 +863,7 @@ static int disp_cc_sdm845_probe(struct platform_device *pdev) +@@ -863,7 +863,7 @@ static int disp_cc_sdm845_probe(struct p /* Enable hardware clock gating for DSI and MDP clocks */ regmap_update_bits(regmap, 0x8000, 0x7f0, 0x7f0); @@ -322,24 +296,20 @@ index b84fdd17c3d8..e6139e8f74dc 100644 } static struct platform_driver disp_cc_sdm845_driver = { -diff --git a/drivers/clk/qcom/dispcc-sm6115.c b/drivers/clk/qcom/dispcc-sm6115.c -index bd07f26af35a..939887f82ecc 100644 --- a/drivers/clk/qcom/dispcc-sm6115.c +++ b/drivers/clk/qcom/dispcc-sm6115.c -@@ -586,7 +586,7 @@ static int disp_cc_sm6115_probe(struct platform_device *pdev) - /* Keep some clocks always-on */ - qcom_branch_set_clk_en(regmap, 0x604c); /* DISP_CC_XO_CLK */ +@@ -586,7 +586,7 @@ static int disp_cc_sm6115_probe(struct p + /* Keep DISP_CC_XO_CLK always-ON */ + regmap_update_bits(regmap, 0x604c, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &disp_cc_sm6115_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_sm6115_desc, regmap); if (ret) { dev_err(&pdev->dev, "Failed to register DISP CC clocks\n"); return ret; -diff --git a/drivers/clk/qcom/dispcc-sm6125.c b/drivers/clk/qcom/dispcc-sm6125.c -index 85e07731cce2..51c7492816fb 100644 --- a/drivers/clk/qcom/dispcc-sm6125.c +++ b/drivers/clk/qcom/dispcc-sm6125.c -@@ -682,7 +682,7 @@ static int disp_cc_sm6125_probe(struct platform_device *pdev) +@@ -682,7 +682,7 @@ static int disp_cc_sm6125_probe(struct p clk_alpha_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config); @@ -348,11 +318,9 @@ index 85e07731cce2..51c7492816fb 100644 } static struct platform_driver disp_cc_sm6125_driver = { -diff --git a/drivers/clk/qcom/dispcc-sm6350.c b/drivers/clk/qcom/dispcc-sm6350.c -index f712cbef9456..50facb36701a 100644 --- a/drivers/clk/qcom/dispcc-sm6350.c +++ b/drivers/clk/qcom/dispcc-sm6350.c -@@ -761,7 +761,7 @@ static int disp_cc_sm6350_probe(struct platform_device *pdev) +@@ -761,7 +761,7 @@ static int disp_cc_sm6350_probe(struct p clk_fabia_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config); @@ -361,11 +329,9 @@ index f712cbef9456..50facb36701a 100644 } static struct platform_driver disp_cc_sm6350_driver = { -diff --git a/drivers/clk/qcom/dispcc-sm6375.c b/drivers/clk/qcom/dispcc-sm6375.c -index 2d42f85f184b..167dd369a794 100644 --- a/drivers/clk/qcom/dispcc-sm6375.c +++ b/drivers/clk/qcom/dispcc-sm6375.c -@@ -583,7 +583,7 @@ static int disp_cc_sm6375_probe(struct platform_device *pdev) +@@ -583,7 +583,7 @@ static int disp_cc_sm6375_probe(struct p clk_lucid_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config); @@ -374,50 +340,42 @@ index 2d42f85f184b..167dd369a794 100644 } static struct platform_driver disp_cc_sm6375_driver = { -diff --git a/drivers/clk/qcom/dispcc-sm8250.c b/drivers/clk/qcom/dispcc-sm8250.c -index 43307c8a342c..5a09009b7289 100644 --- a/drivers/clk/qcom/dispcc-sm8250.c +++ b/drivers/clk/qcom/dispcc-sm8250.c -@@ -1366,7 +1366,7 @@ static int disp_cc_sm8250_probe(struct platform_device *pdev) - /* Keep some clocks always-on */ - qcom_branch_set_clk_en(regmap, 0x605c); /* DISP_CC_XO_CLK */ +@@ -1376,7 +1376,7 @@ static int disp_cc_sm8250_probe(struct p + /* DISP_CC_XO_CLK always-on */ + regmap_update_bits(regmap, 0x605c, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &disp_cc_sm8250_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_sm8250_desc, regmap); pm_runtime_put(&pdev->dev); -diff --git a/drivers/clk/qcom/dispcc-sm8450.c b/drivers/clk/qcom/dispcc-sm8450.c -index 5d028871624e..d1d3f60789ee 100644 --- a/drivers/clk/qcom/dispcc-sm8450.c +++ b/drivers/clk/qcom/dispcc-sm8450.c -@@ -1778,7 +1778,7 @@ static int disp_cc_sm8450_probe(struct platform_device *pdev) - /* Keep some clocks always-on */ - qcom_branch_set_clk_en(regmap, 0xe05c); /* DISP_CC_XO_CLK */ +@@ -1781,7 +1781,7 @@ static int disp_cc_sm8450_probe(struct p + */ + regmap_update_bits(regmap, 0xe05c, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &disp_cc_sm8450_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_sm8450_desc, regmap); if (ret) goto err_put_rpm; -diff --git a/drivers/clk/qcom/dispcc-sm8550.c b/drivers/clk/qcom/dispcc-sm8550.c -index 88f9347ab77c..31ae46f180a5 100644 --- a/drivers/clk/qcom/dispcc-sm8550.c +++ b/drivers/clk/qcom/dispcc-sm8550.c -@@ -1771,7 +1771,7 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev) - /* Keep some clocks always-on */ - qcom_branch_set_clk_en(regmap, 0xe054); /* DISP_CC_XO_CLK */ +@@ -1774,7 +1774,7 @@ static int disp_cc_sm8550_probe(struct p + */ + regmap_update_bits(regmap, 0xe054, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &disp_cc_sm8550_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_sm8550_desc, regmap); if (ret) goto err_put_rpm; -diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c -index c1732d70e3a2..70f5dcb96700 100644 --- a/drivers/clk/qcom/gcc-ipq5018.c +++ b/drivers/clk/qcom/gcc-ipq5018.c -@@ -3698,7 +3698,7 @@ static int gcc_ipq5018_probe(struct platform_device *pdev) +@@ -3697,7 +3697,7 @@ static int gcc_ipq5018_probe(struct plat clk_alpha_pll_configure(&ubi32_pll_main, regmap, &ubi32_pll_config); @@ -426,11 +384,9 @@ index c1732d70e3a2..70f5dcb96700 100644 } static struct platform_driver gcc_ipq5018_driver = { -diff --git a/drivers/clk/qcom/gcc-ipq6018.c b/drivers/clk/qcom/gcc-ipq6018.c -index 7e69de34c310..9e5885101366 100644 --- a/drivers/clk/qcom/gcc-ipq6018.c +++ b/drivers/clk/qcom/gcc-ipq6018.c -@@ -4642,7 +4642,7 @@ static int gcc_ipq6018_probe(struct platform_device *pdev) +@@ -4604,7 +4604,7 @@ static int gcc_ipq6018_probe(struct plat clk_alpha_pll_configure(&nss_crypto_pll_main, regmap, &nss_crypto_pll_config); @@ -439,11 +395,9 @@ index 7e69de34c310..9e5885101366 100644 } static struct platform_driver gcc_ipq6018_driver = { -diff --git a/drivers/clk/qcom/gcc-ipq8074.c b/drivers/clk/qcom/gcc-ipq8074.c -index d2be56c5892d..32fd01ef469a 100644 --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c -@@ -4760,7 +4760,7 @@ static int gcc_ipq8074_probe(struct platform_device *pdev) +@@ -4728,7 +4728,7 @@ static int gcc_ipq8074_probe(struct plat clk_alpha_pll_configure(&nss_crypto_pll_main, regmap, &nss_crypto_pll_config); @@ -452,11 +406,9 @@ index d2be56c5892d..32fd01ef469a 100644 } static struct platform_driver gcc_ipq8074_driver = { -diff --git a/drivers/clk/qcom/gcc-mdm9607.c b/drivers/clk/qcom/gcc-mdm9607.c -index fb290e73ce94..6e6068b168e6 100644 --- a/drivers/clk/qcom/gcc-mdm9607.c +++ b/drivers/clk/qcom/gcc-mdm9607.c -@@ -1604,7 +1604,7 @@ static int gcc_mdm9607_probe(struct platform_device *pdev) +@@ -1604,7 +1604,7 @@ static int gcc_mdm9607_probe(struct plat /* Vote for GPLL0 to turn on. Needed by acpuclock. */ regmap_update_bits(regmap, 0x45000, BIT(0), BIT(0)); @@ -465,11 +417,9 @@ index fb290e73ce94..6e6068b168e6 100644 } static struct platform_driver gcc_mdm9607_driver = { -diff --git a/drivers/clk/qcom/gcc-mdm9615.c b/drivers/clk/qcom/gcc-mdm9615.c -index aec7c4a1d3de..33987b957737 100644 --- a/drivers/clk/qcom/gcc-mdm9615.c +++ b/drivers/clk/qcom/gcc-mdm9615.c -@@ -1736,7 +1736,7 @@ static int gcc_mdm9615_probe(struct platform_device *pdev) +@@ -1736,7 +1736,7 @@ static int gcc_mdm9615_probe(struct plat if (IS_ERR(regmap)) return PTR_ERR(regmap); @@ -478,11 +428,9 @@ index aec7c4a1d3de..33987b957737 100644 } static struct platform_driver gcc_mdm9615_driver = { -diff --git a/drivers/clk/qcom/gcc-msm8917.c b/drivers/clk/qcom/gcc-msm8917.c -index f2b8729e4198..3e2a2ae2ee6e 100644 --- a/drivers/clk/qcom/gcc-msm8917.c +++ b/drivers/clk/qcom/gcc-msm8917.c -@@ -3270,7 +3270,7 @@ static int gcc_msm8917_probe(struct platform_device *pdev) +@@ -3270,7 +3270,7 @@ static int gcc_msm8917_probe(struct plat clk_alpha_pll_configure(&gpll3_early, regmap, &gpll3_early_config); @@ -491,11 +439,9 @@ index f2b8729e4198..3e2a2ae2ee6e 100644 } static const struct of_device_id gcc_msm8917_match_table[] = { -diff --git a/drivers/clk/qcom/gcc-msm8939.c b/drivers/clk/qcom/gcc-msm8939.c -index 7b9a3e99b589..7431c9a65044 100644 --- a/drivers/clk/qcom/gcc-msm8939.c +++ b/drivers/clk/qcom/gcc-msm8939.c -@@ -4108,7 +4108,7 @@ static int gcc_msm8939_probe(struct platform_device *pdev) +@@ -4004,7 +4004,7 @@ static int gcc_msm8939_probe(struct plat clk_pll_configure_sr_hpm_lp(&gpll3, regmap, &gpll3_config, true); clk_pll_configure_sr_hpm_lp(&gpll4, regmap, &gpll4_config, true); @@ -504,11 +450,9 @@ index 7b9a3e99b589..7431c9a65044 100644 } static struct platform_driver gcc_msm8939_driver = { -diff --git a/drivers/clk/qcom/gcc-msm8953.c b/drivers/clk/qcom/gcc-msm8953.c -index 7563bff58118..855a61966f3e 100644 --- a/drivers/clk/qcom/gcc-msm8953.c +++ b/drivers/clk/qcom/gcc-msm8953.c -@@ -4220,7 +4220,7 @@ static int gcc_msm8953_probe(struct platform_device *pdev) +@@ -4216,7 +4216,7 @@ static int gcc_msm8953_probe(struct plat clk_alpha_pll_configure(&gpll3_early, regmap, &gpll3_early_config); @@ -517,11 +461,9 @@ index 7563bff58118..855a61966f3e 100644 } static const struct of_device_id gcc_msm8953_match_table[] = { -diff --git a/drivers/clk/qcom/gcc-msm8976.c b/drivers/clk/qcom/gcc-msm8976.c -index 7fac0ca594aa..399f22033c29 100644 --- a/drivers/clk/qcom/gcc-msm8976.c +++ b/drivers/clk/qcom/gcc-msm8976.c -@@ -4129,7 +4129,7 @@ static int gcc_msm8976_probe(struct platform_device *pdev) +@@ -4129,7 +4129,7 @@ static int gcc_msm8976_probe(struct plat if (ret) return ret; @@ -530,11 +472,9 @@ index 7fac0ca594aa..399f22033c29 100644 } static struct platform_driver gcc_msm8976_driver = { -diff --git a/drivers/clk/qcom/gcc-msm8996.c b/drivers/clk/qcom/gcc-msm8996.c -index e7b03a17514a..4fc667b94cf2 100644 --- a/drivers/clk/qcom/gcc-msm8996.c +++ b/drivers/clk/qcom/gcc-msm8996.c -@@ -3620,7 +3620,7 @@ static int gcc_msm8996_probe(struct platform_device *pdev) +@@ -3620,7 +3620,7 @@ static int gcc_msm8996_probe(struct plat */ regmap_update_bits(regmap, 0x52008, BIT(21), BIT(21)); @@ -543,11 +483,9 @@ index e7b03a17514a..4fc667b94cf2 100644 } static struct platform_driver gcc_msm8996_driver = { -diff --git a/drivers/clk/qcom/gcc-msm8998.c b/drivers/clk/qcom/gcc-msm8998.c -index 5f8c87c1793f..90b66caba2cd 100644 --- a/drivers/clk/qcom/gcc-msm8998.c +++ b/drivers/clk/qcom/gcc-msm8998.c -@@ -3292,7 +3292,7 @@ static int gcc_msm8998_probe(struct platform_device *pdev) +@@ -3292,7 +3292,7 @@ static int gcc_msm8998_probe(struct plat regmap_write(regmap, GCC_MMSS_MISC, 0x10003); regmap_write(regmap, GCC_GPU_MISC, 0x10003); @@ -556,11 +494,9 @@ index 5f8c87c1793f..90b66caba2cd 100644 } static const struct of_device_id gcc_msm8998_match_table[] = { -diff --git a/drivers/clk/qcom/gcc-qcm2290.c b/drivers/clk/qcom/gcc-qcm2290.c -index 48995e50c6bd..9a6703365e61 100644 --- a/drivers/clk/qcom/gcc-qcm2290.c +++ b/drivers/clk/qcom/gcc-qcm2290.c -@@ -2994,7 +2994,7 @@ static int gcc_qcm2290_probe(struct platform_device *pdev) +@@ -2994,7 +2994,7 @@ static int gcc_qcm2290_probe(struct plat clk_alpha_pll_configure(&gpll8, regmap, &gpll8_config); clk_alpha_pll_configure(&gpll9, regmap, &gpll9_config); @@ -569,11 +505,9 @@ index 48995e50c6bd..9a6703365e61 100644 } static struct platform_driver gcc_qcm2290_driver = { -diff --git a/drivers/clk/qcom/gcc-qcs404.c b/drivers/clk/qcom/gcc-qcs404.c -index a39c4990b29d..c3cfd572e7c1 100644 --- a/drivers/clk/qcom/gcc-qcs404.c +++ b/drivers/clk/qcom/gcc-qcs404.c -@@ -2824,7 +2824,7 @@ static int gcc_qcs404_probe(struct platform_device *pdev) +@@ -2825,7 +2825,7 @@ static int gcc_qcs404_probe(struct platf clk_alpha_pll_configure(&gpll3_out_main, regmap, &gpll3_config); @@ -582,11 +516,9 @@ index a39c4990b29d..c3cfd572e7c1 100644 } static struct platform_driver gcc_qcs404_driver = { -diff --git a/drivers/clk/qcom/gcc-qdu1000.c b/drivers/clk/qcom/gcc-qdu1000.c -index 9f42d2601464..dbe9e9437939 100644 --- a/drivers/clk/qcom/gcc-qdu1000.c +++ b/drivers/clk/qcom/gcc-qdu1000.c -@@ -2674,7 +2674,7 @@ static int gcc_qdu1000_probe(struct platform_device *pdev) +@@ -2674,7 +2674,7 @@ static int gcc_qdu1000_probe(struct plat if (ret) return ret; @@ -595,24 +527,20 @@ index 9f42d2601464..dbe9e9437939 100644 if (ret) return dev_err_probe(&pdev->dev, ret, "Failed to register GCC clocks\n"); -diff --git a/drivers/clk/qcom/gcc-sa8775p.c b/drivers/clk/qcom/gcc-sa8775p.c -index 5bcbfbf52cb9..9f31ce4cea18 100644 --- a/drivers/clk/qcom/gcc-sa8775p.c +++ b/drivers/clk/qcom/gcc-sa8775p.c -@@ -4753,7 +4753,7 @@ static int gcc_sa8775p_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x34004); /* GCC_VIDEO_AHB_CLK */ - qcom_branch_set_clk_en(regmap, 0x34024); /* GCC_VIDEO_XO_CLK */ +@@ -4798,7 +4798,7 @@ static int gcc_sa8775p_probe(struct plat + regmap_update_bits(regmap, 0x34004, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x34024, BIT(0), BIT(0)); - return qcom_cc_really_probe(pdev, &gcc_sa8775p_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &gcc_sa8775p_desc, regmap); } static struct platform_driver gcc_sa8775p_driver = { -diff --git a/drivers/clk/qcom/gcc-sc7180.c b/drivers/clk/qcom/gcc-sc7180.c -index 6a5f785c0ced..4a49ad7a9e5b 100644 --- a/drivers/clk/qcom/gcc-sc7180.c +++ b/drivers/clk/qcom/gcc-sc7180.c -@@ -2458,7 +2458,7 @@ static int gcc_sc7180_probe(struct platform_device *pdev) +@@ -2462,7 +2462,7 @@ static int gcc_sc7180_probe(struct platf if (ret) return ret; @@ -621,11 +549,9 @@ index 6a5f785c0ced..4a49ad7a9e5b 100644 } static struct platform_driver gcc_sc7180_driver = { -diff --git a/drivers/clk/qcom/gcc-sc7280.c b/drivers/clk/qcom/gcc-sc7280.c -index b937d513b814..4502926a2691 100644 --- a/drivers/clk/qcom/gcc-sc7280.c +++ b/drivers/clk/qcom/gcc-sc7280.c -@@ -3481,7 +3481,7 @@ static int gcc_sc7280_probe(struct platform_device *pdev) +@@ -3475,7 +3475,7 @@ static int gcc_sc7280_probe(struct platf if (ret) return ret; @@ -634,11 +560,9 @@ index b937d513b814..4502926a2691 100644 } static struct platform_driver gcc_sc7280_driver = { -diff --git a/drivers/clk/qcom/gcc-sc8180x.c b/drivers/clk/qcom/gcc-sc8180x.c -index ad905affd376..ad135bfa4c76 100644 --- a/drivers/clk/qcom/gcc-sc8180x.c +++ b/drivers/clk/qcom/gcc-sc8180x.c -@@ -4623,7 +4623,7 @@ static int gcc_sc8180x_probe(struct platform_device *pdev) +@@ -4555,7 +4555,7 @@ static int gcc_sc8180x_probe(struct plat regmap_update_bits(regmap, 0x4d110, 0x3, 0x3); regmap_update_bits(regmap, 0x71028, 0x3, 0x3); @@ -647,11 +571,9 @@ index ad905affd376..ad135bfa4c76 100644 } static struct platform_driver gcc_sc8180x_driver = { -diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c -index 082d7b5504eb..5f11760cf73f 100644 --- a/drivers/clk/qcom/gcc-sc8280xp.c +++ b/drivers/clk/qcom/gcc-sc8280xp.c -@@ -7558,7 +7558,7 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev) +@@ -7563,7 +7563,7 @@ static int gcc_sc8280xp_probe(struct pla if (ret) goto err_put_rpm; @@ -660,11 +582,9 @@ index 082d7b5504eb..5f11760cf73f 100644 if (ret) goto err_put_rpm; -diff --git a/drivers/clk/qcom/gcc-sdm660.c b/drivers/clk/qcom/gcc-sdm660.c -index c4fe70871b6d..df79298a1a25 100644 --- a/drivers/clk/qcom/gcc-sdm660.c +++ b/drivers/clk/qcom/gcc-sdm660.c -@@ -2474,7 +2474,7 @@ static int gcc_sdm660_probe(struct platform_device *pdev) +@@ -2474,7 +2474,7 @@ static int gcc_sdm660_probe(struct platf if (ret) return ret; @@ -673,11 +593,9 @@ index c4fe70871b6d..df79298a1a25 100644 } static struct platform_driver gcc_sdm660_driver = { -diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c -index ea4c3bf4fb9b..dc3aa7014c3e 100644 --- a/drivers/clk/qcom/gcc-sdm845.c +++ b/drivers/clk/qcom/gcc-sdm845.c -@@ -4011,7 +4011,7 @@ static int gcc_sdm845_probe(struct platform_device *pdev) +@@ -4011,7 +4011,7 @@ static int gcc_sdm845_probe(struct platf return ret; gcc_desc = of_device_get_match_data(&pdev->dev); @@ -686,50 +604,42 @@ index ea4c3bf4fb9b..dc3aa7014c3e 100644 } static struct platform_driver gcc_sdm845_driver = { -diff --git a/drivers/clk/qcom/gcc-sdx55.c b/drivers/clk/qcom/gcc-sdx55.c -index 26279b8d321a..84c507656e8f 100644 --- a/drivers/clk/qcom/gcc-sdx55.c +++ b/drivers/clk/qcom/gcc-sdx55.c -@@ -1616,7 +1616,7 @@ static int gcc_sdx55_probe(struct platform_device *pdev) - regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); /* GCC_CPUSS_AHB_CLK */ - regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); /* GCC_CPUSS_GNOC_CLK */ +@@ -1620,7 +1620,7 @@ static int gcc_sdx55_probe(struct platfo + regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); + regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); - return qcom_cc_really_probe(pdev, &gcc_sdx55_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &gcc_sdx55_desc, regmap); } static struct platform_driver gcc_sdx55_driver = { -diff --git a/drivers/clk/qcom/gcc-sdx65.c b/drivers/clk/qcom/gcc-sdx65.c -index 8fde6463574b..fe297c606f97 100644 --- a/drivers/clk/qcom/gcc-sdx65.c +++ b/drivers/clk/qcom/gcc-sdx65.c -@@ -1580,7 +1580,7 @@ static int gcc_sdx65_probe(struct platform_device *pdev) - regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); /* GCC_CPUSS_AHB_CLK */ - regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); /* GCC_CPUSS_GNOC_CLK */ +@@ -1583,7 +1583,7 @@ static int gcc_sdx65_probe(struct platfo + regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); + regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); - return qcom_cc_really_probe(pdev, &gcc_sdx65_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &gcc_sdx65_desc, regmap); } static struct platform_driver gcc_sdx65_driver = { -diff --git a/drivers/clk/qcom/gcc-sdx75.c b/drivers/clk/qcom/gcc-sdx75.c -index c51338f08ef1..453a6bf8e878 100644 --- a/drivers/clk/qcom/gcc-sdx75.c +++ b/drivers/clk/qcom/gcc-sdx75.c -@@ -2940,7 +2940,7 @@ static int gcc_sdx75_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x3e004); /* GCC_AHB_PCIE_LINK_CLK */ - qcom_branch_set_clk_en(regmap, 0x3e008); /* GCC_XO_PCIE_LINK_CLK */ +@@ -2944,7 +2944,7 @@ static int gcc_sdx75_probe(struct platfo + regmap_update_bits(regmap, 0x3e004, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x3e008, BIT(0), BIT(0)); - return qcom_cc_really_probe(pdev, &gcc_sdx75_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &gcc_sdx75_desc, regmap); } static struct platform_driver gcc_sdx75_driver = { -diff --git a/drivers/clk/qcom/gcc-sm6115.c b/drivers/clk/qcom/gcc-sm6115.c -index 167e344ad399..4c3804701e24 100644 --- a/drivers/clk/qcom/gcc-sm6115.c +++ b/drivers/clk/qcom/gcc-sm6115.c -@@ -3513,7 +3513,7 @@ static int gcc_sm6115_probe(struct platform_device *pdev) +@@ -3513,7 +3513,7 @@ static int gcc_sm6115_probe(struct platf clk_alpha_pll_configure(&gpll10, regmap, &gpll10_config); clk_alpha_pll_configure(&gpll11, regmap, &gpll11_config); @@ -738,11 +648,9 @@ index 167e344ad399..4c3804701e24 100644 } static struct platform_driver gcc_sm6115_driver = { -diff --git a/drivers/clk/qcom/gcc-sm6125.c b/drivers/clk/qcom/gcc-sm6125.c -index da554efee2ce..07bb1e5c4a30 100644 --- a/drivers/clk/qcom/gcc-sm6125.c +++ b/drivers/clk/qcom/gcc-sm6125.c -@@ -4161,7 +4161,7 @@ static int gcc_sm6125_probe(struct platform_device *pdev) +@@ -4161,7 +4161,7 @@ static int gcc_sm6125_probe(struct platf if (ret) return ret; @@ -751,11 +659,9 @@ index da554efee2ce..07bb1e5c4a30 100644 } static struct platform_driver gcc_sm6125_driver = { -diff --git a/drivers/clk/qcom/gcc-sm6350.c b/drivers/clk/qcom/gcc-sm6350.c -index cf4a7b6e0b23..0dcc8eeb77e6 100644 --- a/drivers/clk/qcom/gcc-sm6350.c +++ b/drivers/clk/qcom/gcc-sm6350.c -@@ -2559,7 +2559,7 @@ static int gcc_sm6350_probe(struct platform_device *pdev) +@@ -2559,7 +2559,7 @@ static int gcc_sm6350_probe(struct platf if (ret) return ret; @@ -764,11 +670,9 @@ index cf4a7b6e0b23..0dcc8eeb77e6 100644 } static struct platform_driver gcc_sm6350_driver = { -diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c -index ac1ed2d728f9..f47dc2808095 100644 --- a/drivers/clk/qcom/gcc-sm6375.c +++ b/drivers/clk/qcom/gcc-sm6375.c -@@ -3892,7 +3892,7 @@ static int gcc_sm6375_probe(struct platform_device *pdev) +@@ -3895,7 +3895,7 @@ static int gcc_sm6375_probe(struct platf clk_lucid_pll_configure(&gpll8, regmap, &gpll8_config); clk_zonda_pll_configure(&gpll9, regmap, &gpll9_config); @@ -777,11 +681,9 @@ index ac1ed2d728f9..f47dc2808095 100644 } static struct platform_driver gcc_sm6375_driver = { -diff --git a/drivers/clk/qcom/gcc-sm7150.c b/drivers/clk/qcom/gcc-sm7150.c -index b0c50ebb86be..7eabaf0e1b57 100644 --- a/drivers/clk/qcom/gcc-sm7150.c +++ b/drivers/clk/qcom/gcc-sm7150.c -@@ -3017,7 +3017,7 @@ static int gcc_sm7150_probe(struct platform_device *pdev) +@@ -3022,7 +3022,7 @@ static int gcc_sm7150_probe(struct platf if (ret) return ret; @@ -790,24 +692,20 @@ index b0c50ebb86be..7eabaf0e1b57 100644 } static struct platform_driver gcc_sm7150_driver = { -diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c -index 1f748141d12c..cefceb780889 100644 --- a/drivers/clk/qcom/gcc-sm8150.c +++ b/drivers/clk/qcom/gcc-sm8150.c -@@ -3797,7 +3797,7 @@ static int gcc_sm8150_probe(struct platform_device *pdev) - if (ret) - dev_err_probe(&pdev->dev, ret, "Failed to register with DFS!\n"); +@@ -3786,7 +3786,7 @@ static int gcc_sm8150_probe(struct platf + regmap_update_bits(regmap, 0x4d110, 0x3, 0x3); + regmap_update_bits(regmap, 0x71028, 0x3, 0x3); - return qcom_cc_really_probe(pdev, &gcc_sm8150_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &gcc_sm8150_desc, regmap); } static struct platform_driver gcc_sm8150_driver = { -diff --git a/drivers/clk/qcom/gcc-sm8250.c b/drivers/clk/qcom/gcc-sm8250.c -index e630bfa2d0c1..991cd8b8d597 100644 --- a/drivers/clk/qcom/gcc-sm8250.c +++ b/drivers/clk/qcom/gcc-sm8250.c -@@ -3656,7 +3656,7 @@ static int gcc_sm8250_probe(struct platform_device *pdev) +@@ -3661,7 +3661,7 @@ static int gcc_sm8250_probe(struct platf if (ret) return ret; @@ -816,11 +714,9 @@ index e630bfa2d0c1..991cd8b8d597 100644 } static struct platform_driver gcc_sm8250_driver = { -diff --git a/drivers/clk/qcom/gcc-sm8350.c b/drivers/clk/qcom/gcc-sm8350.c -index fc0402e8a2a7..2d94f3046b71 100644 --- a/drivers/clk/qcom/gcc-sm8350.c +++ b/drivers/clk/qcom/gcc-sm8350.c -@@ -3822,7 +3822,7 @@ static int gcc_sm8350_probe(struct platform_device *pdev) +@@ -3826,7 +3826,7 @@ static int gcc_sm8350_probe(struct platf /* FORCE_MEM_CORE_ON for ufs phy ice core clocks */ regmap_update_bits(regmap, gcc_ufs_phy_ice_core_clk.halt_reg, BIT(14), BIT(14)); @@ -829,24 +725,20 @@ index fc0402e8a2a7..2d94f3046b71 100644 } static struct platform_driver gcc_sm8350_driver = { -diff --git a/drivers/clk/qcom/gcc-sm8450.c b/drivers/clk/qcom/gcc-sm8450.c -index e86c58bc5e48..639a9a955914 100644 --- a/drivers/clk/qcom/gcc-sm8450.c +++ b/drivers/clk/qcom/gcc-sm8450.c -@@ -3289,7 +3289,7 @@ static int gcc_sm8450_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x42004); /* GCC_VIDEO_AHB_CLK */ - qcom_branch_set_clk_en(regmap, 0x42028); /* GCC_VIDEO_XO_CLK */ +@@ -3294,7 +3294,7 @@ static int gcc_sm8450_probe(struct platf + regmap_update_bits(regmap, 0x42004, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x42028, BIT(0), BIT(0)); - return qcom_cc_really_probe(pdev, &gcc_sm8450_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &gcc_sm8450_desc, regmap); } static struct platform_driver gcc_sm8450_driver = { -diff --git a/drivers/clk/qcom/gcc-sm8550.c b/drivers/clk/qcom/gcc-sm8550.c -index 26d7349e7642..7944ddb4b47d 100644 --- a/drivers/clk/qcom/gcc-sm8550.c +++ b/drivers/clk/qcom/gcc-sm8550.c -@@ -3364,7 +3364,7 @@ static int gcc_sm8550_probe(struct platform_device *pdev) +@@ -3369,7 +3369,7 @@ static int gcc_sm8550_probe(struct platf /* Clear GDSC_SLEEP_ENA_VOTE to stop votes being auto-removed in sleep. */ regmap_write(regmap, 0x52024, 0x0); @@ -855,11 +747,9 @@ index 26d7349e7642..7944ddb4b47d 100644 } static struct platform_driver gcc_sm8550_driver = { -diff --git a/drivers/clk/qcom/gpucc-msm8998.c b/drivers/clk/qcom/gpucc-msm8998.c -index 7b1cb44e31b2..9efeab2691ba 100644 --- a/drivers/clk/qcom/gpucc-msm8998.c +++ b/drivers/clk/qcom/gpucc-msm8998.c -@@ -334,7 +334,7 @@ static int gpucc_msm8998_probe(struct platform_device *pdev) +@@ -334,7 +334,7 @@ static int gpucc_msm8998_probe(struct pl /* tweak droop detector (GPUCC_GPU_DD_WRAP_CTRL) to reduce leakage */ regmap_write_bits(regmap, gfx3d_clk.clkr.enable_reg, BIT(0), BIT(0)); @@ -868,11 +758,9 @@ index 7b1cb44e31b2..9efeab2691ba 100644 } static struct platform_driver gpucc_msm8998_driver = { -diff --git a/drivers/clk/qcom/gpucc-sa8775p.c b/drivers/clk/qcom/gpucc-sa8775p.c -index 1167c42da39d..ac7552b146c7 100644 --- a/drivers/clk/qcom/gpucc-sa8775p.c +++ b/drivers/clk/qcom/gpucc-sa8775p.c -@@ -598,7 +598,7 @@ static int gpu_cc_sa8775p_probe(struct platform_device *pdev) +@@ -599,7 +599,7 @@ static int gpu_cc_sa8775p_probe(struct p clk_lucid_evo_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); clk_lucid_evo_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config); @@ -881,11 +769,9 @@ index 1167c42da39d..ac7552b146c7 100644 } static struct platform_driver gpu_cc_sa8775p_driver = { -diff --git a/drivers/clk/qcom/gpucc-sc7180.c b/drivers/clk/qcom/gpucc-sc7180.c -index 66f5b48cbf87..08f3983d016f 100644 --- a/drivers/clk/qcom/gpucc-sc7180.c +++ b/drivers/clk/qcom/gpucc-sc7180.c -@@ -241,7 +241,7 @@ static int gpu_cc_sc7180_probe(struct platform_device *pdev) +@@ -241,7 +241,7 @@ static int gpu_cc_sc7180_probe(struct pl value = 0xF << CX_GMU_CBCR_WAKE_SHIFT | 0xF << CX_GMU_CBCR_SLEEP_SHIFT; regmap_update_bits(regmap, 0x1098, mask, value); @@ -894,12 +780,10 @@ index 66f5b48cbf87..08f3983d016f 100644 } static struct platform_driver gpu_cc_sc7180_driver = { -diff --git a/drivers/clk/qcom/gpucc-sc7280.c b/drivers/clk/qcom/gpucc-sc7280.c -index ebda57eac979..bd699a624517 100644 --- a/drivers/clk/qcom/gpucc-sc7280.c +++ b/drivers/clk/qcom/gpucc-sc7280.c -@@ -469,7 +469,7 @@ static int gpu_cc_sc7280_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x1098); /* GPUCC_CX_GMU_CLK */ +@@ -465,7 +465,7 @@ static int gpu_cc_sc7280_probe(struct pl + regmap_update_bits(regmap, 0x1098, BIT(0), BIT(0)); regmap_update_bits(regmap, 0x1098, BIT(13), BIT(13)); - return qcom_cc_really_probe(pdev, &gpu_cc_sc7280_desc, regmap); @@ -907,24 +791,20 @@ index ebda57eac979..bd699a624517 100644 } static struct platform_driver gpu_cc_sc7280_driver = { -diff --git a/drivers/clk/qcom/gpucc-sc8280xp.c b/drivers/clk/qcom/gpucc-sc8280xp.c -index 3611d2d1823d..c96be61e3f47 100644 --- a/drivers/clk/qcom/gpucc-sc8280xp.c +++ b/drivers/clk/qcom/gpucc-sc8280xp.c -@@ -449,7 +449,7 @@ static int gpu_cc_sc8280xp_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x1170); /* GPU_CC_CB_CLK */ - qcom_branch_set_clk_en(regmap, 0x109c); /* GPU_CC_CXO_CLK */ +@@ -451,7 +451,7 @@ static int gpu_cc_sc8280xp_probe(struct + regmap_update_bits(regmap, 0x1170, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x109c, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &gpu_cc_sc8280xp_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &gpu_cc_sc8280xp_desc, regmap); pm_runtime_put(&pdev->dev); return ret; -diff --git a/drivers/clk/qcom/gpucc-sdm660.c b/drivers/clk/qcom/gpucc-sdm660.c -index a52d98b7cf4c..3ae1b80e38d9 100644 --- a/drivers/clk/qcom/gpucc-sdm660.c +++ b/drivers/clk/qcom/gpucc-sdm660.c -@@ -330,7 +330,7 @@ static int gpucc_sdm660_probe(struct platform_device *pdev) +@@ -330,7 +330,7 @@ static int gpucc_sdm660_probe(struct pla gpu_pll_config.alpha_hi = 0x8a; clk_alpha_pll_configure(&gpu_pll1_pll_out_main, regmap, &gpu_pll_config); @@ -933,11 +813,9 @@ index a52d98b7cf4c..3ae1b80e38d9 100644 } static struct platform_driver gpucc_sdm660_driver = { -diff --git a/drivers/clk/qcom/gpucc-sdm845.c b/drivers/clk/qcom/gpucc-sdm845.c -index c87c3215dfe3..ef26690cf504 100644 --- a/drivers/clk/qcom/gpucc-sdm845.c +++ b/drivers/clk/qcom/gpucc-sdm845.c -@@ -192,7 +192,7 @@ static int gpu_cc_sdm845_probe(struct platform_device *pdev) +@@ -192,7 +192,7 @@ static int gpu_cc_sdm845_probe(struct pl value = 0xf << CX_GMU_CBCR_WAKE_SHIFT | 0xf << CX_GMU_CBCR_SLEEP_SHIFT; regmap_update_bits(regmap, 0x1098, mask, value); @@ -946,11 +824,9 @@ index c87c3215dfe3..ef26690cf504 100644 } static struct platform_driver gpu_cc_sdm845_driver = { -diff --git a/drivers/clk/qcom/gpucc-sm6115.c b/drivers/clk/qcom/gpucc-sm6115.c -index 9793dd9a2596..d43c86cf73a5 100644 --- a/drivers/clk/qcom/gpucc-sm6115.c +++ b/drivers/clk/qcom/gpucc-sm6115.c -@@ -488,7 +488,7 @@ static int gpu_cc_sm6115_probe(struct platform_device *pdev) +@@ -488,7 +488,7 @@ static int gpu_cc_sm6115_probe(struct pl qcom_branch_set_force_mem_core(regmap, gpu_cc_gx_gfx3d_clk, true); qcom_branch_set_force_periph_on(regmap, gpu_cc_gx_gfx3d_clk, true); @@ -959,11 +835,9 @@ index 9793dd9a2596..d43c86cf73a5 100644 } static struct platform_driver gpu_cc_sm6115_driver = { -diff --git a/drivers/clk/qcom/gpucc-sm6125.c b/drivers/clk/qcom/gpucc-sm6125.c -index b719a48fe706..ed6a6e505801 100644 --- a/drivers/clk/qcom/gpucc-sm6125.c +++ b/drivers/clk/qcom/gpucc-sm6125.c -@@ -409,7 +409,7 @@ static int gpu_cc_sm6125_probe(struct platform_device *pdev) +@@ -409,7 +409,7 @@ static int gpu_cc_sm6125_probe(struct pl qcom_branch_set_force_mem_core(regmap, gpu_cc_gx_gfx3d_clk, true); qcom_branch_set_force_periph_on(regmap, gpu_cc_gx_gfx3d_clk, true); @@ -972,11 +846,9 @@ index b719a48fe706..ed6a6e505801 100644 } static struct platform_driver gpu_cc_sm6125_driver = { -diff --git a/drivers/clk/qcom/gpucc-sm6350.c b/drivers/clk/qcom/gpucc-sm6350.c -index 0bcbba2a2943..1e12ad8948db 100644 --- a/drivers/clk/qcom/gpucc-sm6350.c +++ b/drivers/clk/qcom/gpucc-sm6350.c -@@ -502,7 +502,7 @@ static int gpu_cc_sm6350_probe(struct platform_device *pdev) +@@ -502,7 +502,7 @@ static int gpu_cc_sm6350_probe(struct pl value = 0xF << CX_GMU_CBCR_WAKE_SHIFT | 0xF << CX_GMU_CBCR_SLEEP_SHIFT; regmap_update_bits(regmap, 0x1098, mask, value); @@ -985,11 +857,9 @@ index 0bcbba2a2943..1e12ad8948db 100644 } static struct platform_driver gpu_cc_sm6350_driver = { -diff --git a/drivers/clk/qcom/gpucc-sm6375.c b/drivers/clk/qcom/gpucc-sm6375.c -index 4e9a30a080d3..41f59024143e 100644 --- a/drivers/clk/qcom/gpucc-sm6375.c +++ b/drivers/clk/qcom/gpucc-sm6375.c -@@ -455,7 +455,7 @@ static int gpucc_sm6375_probe(struct platform_device *pdev) +@@ -455,7 +455,7 @@ static int gpucc_sm6375_probe(struct pla clk_lucid_pll_configure(&gpucc_pll0, regmap, &gpucc_pll0_config); clk_lucid_pll_configure(&gpucc_pll1, regmap, &gpucc_pll1_config); @@ -998,11 +868,9 @@ index 4e9a30a080d3..41f59024143e 100644 pm_runtime_put(&pdev->dev); return ret; -diff --git a/drivers/clk/qcom/gpucc-sm8150.c b/drivers/clk/qcom/gpucc-sm8150.c -index 135601629cba..d711464a71b6 100644 --- a/drivers/clk/qcom/gpucc-sm8150.c +++ b/drivers/clk/qcom/gpucc-sm8150.c -@@ -304,7 +304,7 @@ static int gpu_cc_sm8150_probe(struct platform_device *pdev) +@@ -304,7 +304,7 @@ static int gpu_cc_sm8150_probe(struct pl clk_trion_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config); @@ -1011,11 +879,9 @@ index 135601629cba..d711464a71b6 100644 } static struct platform_driver gpu_cc_sm8150_driver = { -diff --git a/drivers/clk/qcom/gpucc-sm8250.c b/drivers/clk/qcom/gpucc-sm8250.c -index 012bd1380f55..113b486a6d2f 100644 --- a/drivers/clk/qcom/gpucc-sm8250.c +++ b/drivers/clk/qcom/gpucc-sm8250.c -@@ -320,7 +320,7 @@ static int gpu_cc_sm8250_probe(struct platform_device *pdev) +@@ -320,7 +320,7 @@ static int gpu_cc_sm8250_probe(struct pl value = 0xf << CX_GMU_CBCR_WAKE_SHIFT | 0xf << CX_GMU_CBCR_SLEEP_SHIFT; regmap_update_bits(regmap, 0x1098, mask, value); @@ -1024,11 +890,9 @@ index 012bd1380f55..113b486a6d2f 100644 } static struct platform_driver gpu_cc_sm8250_driver = { -diff --git a/drivers/clk/qcom/gpucc-sm8350.c b/drivers/clk/qcom/gpucc-sm8350.c -index 9437d316d145..f6bb8244dd40 100644 --- a/drivers/clk/qcom/gpucc-sm8350.c +++ b/drivers/clk/qcom/gpucc-sm8350.c -@@ -604,7 +604,7 @@ static int gpu_cc_sm8350_probe(struct platform_device *pdev) +@@ -605,7 +605,7 @@ static int gpu_cc_sm8350_probe(struct pl clk_lucid_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); clk_lucid_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config); @@ -1037,11 +901,9 @@ index 9437d316d145..f6bb8244dd40 100644 } static const struct of_device_id gpu_cc_sm8350_match_table[] = { -diff --git a/drivers/clk/qcom/gpucc-sm8450.c b/drivers/clk/qcom/gpucc-sm8450.c -index 7b329a803289..b3c5d6923cd2 100644 --- a/drivers/clk/qcom/gpucc-sm8450.c +++ b/drivers/clk/qcom/gpucc-sm8450.c -@@ -751,7 +751,7 @@ static int gpu_cc_sm8450_probe(struct platform_device *pdev) +@@ -751,7 +751,7 @@ static int gpu_cc_sm8450_probe(struct pl clk_lucid_evo_pll_configure(&gpu_cc_pll0, regmap, &gpu_cc_pll0_config); clk_lucid_evo_pll_configure(&gpu_cc_pll1, regmap, &gpu_cc_pll1_config); @@ -1050,24 +912,20 @@ index 7b329a803289..b3c5d6923cd2 100644 } static struct platform_driver gpu_cc_sm8450_driver = { -diff --git a/drivers/clk/qcom/gpucc-sm8550.c b/drivers/clk/qcom/gpucc-sm8550.c -index 4fc69c6026e5..7486edf56160 100644 --- a/drivers/clk/qcom/gpucc-sm8550.c +++ b/drivers/clk/qcom/gpucc-sm8550.c -@@ -579,7 +579,7 @@ static int gpu_cc_sm8550_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x9004); /* GPU_CC_CXO_AON_CLK */ - qcom_branch_set_clk_en(regmap, 0x900c); /* GPU_CC_DEMET_CLK */ +@@ -585,7 +585,7 @@ static int gpu_cc_sm8550_probe(struct pl + regmap_update_bits(regmap, 0x9004, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x900c, BIT(0), BIT(0)); - return qcom_cc_really_probe(pdev, &gpu_cc_sm8550_desc, regmap); + return qcom_cc_really_probe(&pdev->dev, &gpu_cc_sm8550_desc, regmap); } static struct platform_driver gpu_cc_sm8550_driver = { -diff --git a/drivers/clk/qcom/lcc-ipq806x.c b/drivers/clk/qcom/lcc-ipq806x.c -index fa8cda63cf20..bf5320a43e8c 100644 --- a/drivers/clk/qcom/lcc-ipq806x.c +++ b/drivers/clk/qcom/lcc-ipq806x.c -@@ -454,7 +454,7 @@ static int lcc_ipq806x_probe(struct platform_device *pdev) +@@ -454,7 +454,7 @@ static int lcc_ipq806x_probe(struct plat /* Enable PLL4 source on the LPASS Primary PLL Mux */ regmap_write(regmap, 0xc4, 0x1); @@ -1076,11 +934,9 @@ index fa8cda63cf20..bf5320a43e8c 100644 } static struct platform_driver lcc_ipq806x_driver = { -diff --git a/drivers/clk/qcom/lcc-msm8960.c b/drivers/clk/qcom/lcc-msm8960.c -index e725e7b9c456..d53bf315e9c3 100644 --- a/drivers/clk/qcom/lcc-msm8960.c +++ b/drivers/clk/qcom/lcc-msm8960.c -@@ -481,7 +481,7 @@ static int lcc_msm8960_probe(struct platform_device *pdev) +@@ -481,7 +481,7 @@ static int lcc_msm8960_probe(struct plat /* Enable PLL4 source on the LPASS Primary PLL Mux */ regmap_write(regmap, 0xc4, 0x1); @@ -1089,11 +945,9 @@ index e725e7b9c456..d53bf315e9c3 100644 } static struct platform_driver lcc_msm8960_driver = { -diff --git a/drivers/clk/qcom/lpassaudiocc-sc7280.c b/drivers/clk/qcom/lpassaudiocc-sc7280.c -index c43d0b1af7f7..45e726477086 100644 --- a/drivers/clk/qcom/lpassaudiocc-sc7280.c +++ b/drivers/clk/qcom/lpassaudiocc-sc7280.c -@@ -772,7 +772,7 @@ static int lpass_audio_cc_sc7280_probe(struct platform_device *pdev) +@@ -772,7 +772,7 @@ static int lpass_audio_cc_sc7280_probe(s regmap_write(regmap, 0x4, 0x3b); regmap_write(regmap, 0x8, 0xff05); @@ -1102,7 +956,7 @@ index c43d0b1af7f7..45e726477086 100644 if (ret) { dev_err(&pdev->dev, "Failed to register LPASS AUDIO CC clocks\n"); goto exit; -@@ -847,7 +847,7 @@ static int lpass_aon_cc_sc7280_probe(struct platform_device *pdev) +@@ -847,7 +847,7 @@ static int lpass_aon_cc_sc7280_probe(str clk_lucid_pll_configure(&lpass_aon_cc_pll, regmap, &lpass_aon_cc_pll_config); @@ -1111,11 +965,9 @@ index c43d0b1af7f7..45e726477086 100644 if (ret) { dev_err(&pdev->dev, "Failed to register LPASS AON CC clocks\n"); goto exit; -diff --git a/drivers/clk/qcom/lpasscorecc-sc7180.c b/drivers/clk/qcom/lpasscorecc-sc7180.c -index 8ac72d26087e..726c6378752f 100644 --- a/drivers/clk/qcom/lpasscorecc-sc7180.c +++ b/drivers/clk/qcom/lpasscorecc-sc7180.c -@@ -411,7 +411,7 @@ static int lpass_core_cc_sc7180_probe(struct platform_device *pdev) +@@ -414,7 +414,7 @@ static int lpass_core_cc_sc7180_probe(st clk_fabia_pll_configure(&lpass_lpaaudio_dig_pll, regmap, &lpass_lpaaudio_dig_pll_config); @@ -1124,11 +976,9 @@ index 8ac72d26087e..726c6378752f 100644 pm_runtime_mark_last_busy(&pdev->dev); exit: -diff --git a/drivers/clk/qcom/lpasscorecc-sc7280.c b/drivers/clk/qcom/lpasscorecc-sc7280.c -index a2f1e6ad6da4..b0888cd2460b 100644 --- a/drivers/clk/qcom/lpasscorecc-sc7280.c +++ b/drivers/clk/qcom/lpasscorecc-sc7280.c -@@ -406,7 +406,7 @@ static int lpass_core_cc_sc7280_probe(struct platform_device *pdev) +@@ -406,7 +406,7 @@ static int lpass_core_cc_sc7280_probe(st clk_lucid_pll_configure(&lpass_core_cc_dig_pll, regmap, &lpass_core_cc_dig_pll_config); @@ -1137,11 +987,9 @@ index a2f1e6ad6da4..b0888cd2460b 100644 } static struct platform_driver lpass_core_cc_sc7280_driver = { -diff --git a/drivers/clk/qcom/mmcc-msm8960.c b/drivers/clk/qcom/mmcc-msm8960.c -index 50638ab341ec..1061322534c4 100644 --- a/drivers/clk/qcom/mmcc-msm8960.c +++ b/drivers/clk/qcom/mmcc-msm8960.c -@@ -3122,7 +3122,7 @@ static int mmcc_msm8960_probe(struct platform_device *pdev) +@@ -3128,7 +3128,7 @@ static int mmcc_msm8960_probe(struct pla clk_pll_configure_sr(&pll15, regmap, &pll15_config, false); @@ -1150,11 +998,9 @@ index 50638ab341ec..1061322534c4 100644 } static struct platform_driver mmcc_msm8960_driver = { -diff --git a/drivers/clk/qcom/mmcc-msm8974.c b/drivers/clk/qcom/mmcc-msm8974.c -index 36f460b78be2..d5bcb09ebd0c 100644 --- a/drivers/clk/qcom/mmcc-msm8974.c +++ b/drivers/clk/qcom/mmcc-msm8974.c -@@ -2768,7 +2768,7 @@ static int mmcc_msm8974_probe(struct platform_device *pdev) +@@ -2786,7 +2786,7 @@ static int mmcc_msm8974_probe(struct pla msm8226_clock_override(); } @@ -1163,11 +1009,9 @@ index 36f460b78be2..d5bcb09ebd0c 100644 } static struct platform_driver mmcc_msm8974_driver = { -diff --git a/drivers/clk/qcom/mmcc-msm8994.c b/drivers/clk/qcom/mmcc-msm8994.c -index f19080cf715b..78e5083eaf0f 100644 --- a/drivers/clk/qcom/mmcc-msm8994.c +++ b/drivers/clk/qcom/mmcc-msm8994.c -@@ -2602,7 +2602,7 @@ static int mmcc_msm8994_probe(struct platform_device *pdev) +@@ -2602,7 +2602,7 @@ static int mmcc_msm8994_probe(struct pla clk_alpha_pll_configure(&mmpll3_early, regmap, &mmpll_p_config); clk_alpha_pll_configure(&mmpll5_early, regmap, &mmpll_p_config); @@ -1176,11 +1020,9 @@ index f19080cf715b..78e5083eaf0f 100644 } static struct platform_driver mmcc_msm8994_driver = { -diff --git a/drivers/clk/qcom/mmcc-msm8996.c b/drivers/clk/qcom/mmcc-msm8996.c -index 92287d40c3a5..1a32c6eb8217 100644 --- a/drivers/clk/qcom/mmcc-msm8996.c +++ b/drivers/clk/qcom/mmcc-msm8996.c -@@ -3626,7 +3626,7 @@ static int mmcc_msm8996_probe(struct platform_device *pdev) +@@ -3626,7 +3626,7 @@ static int mmcc_msm8996_probe(struct pla /* Disable the NoC FSM for mmss_mmagic_cfg_ahb_clk */ regmap_update_bits(regmap, 0x5054, BIT(15), 0); @@ -1189,11 +1031,9 @@ index 92287d40c3a5..1a32c6eb8217 100644 } static struct platform_driver mmcc_msm8996_driver = { -diff --git a/drivers/clk/qcom/mmcc-msm8998.c b/drivers/clk/qcom/mmcc-msm8998.c -index 275fb3b71ede..5738445a8656 100644 --- a/drivers/clk/qcom/mmcc-msm8998.c +++ b/drivers/clk/qcom/mmcc-msm8998.c -@@ -2866,7 +2866,7 @@ static int mmcc_msm8998_probe(struct platform_device *pdev) +@@ -2866,7 +2866,7 @@ static int mmcc_msm8998_probe(struct pla if (IS_ERR(regmap)) return PTR_ERR(regmap); @@ -1202,11 +1042,9 @@ index 275fb3b71ede..5738445a8656 100644 } static struct platform_driver mmcc_msm8998_driver = { -diff --git a/drivers/clk/qcom/mmcc-sdm660.c b/drivers/clk/qcom/mmcc-sdm660.c -index 4b8380c2d648..98ba5b4518fb 100644 --- a/drivers/clk/qcom/mmcc-sdm660.c +++ b/drivers/clk/qcom/mmcc-sdm660.c -@@ -2847,7 +2847,7 @@ static int mmcc_660_probe(struct platform_device *pdev) +@@ -2851,7 +2851,7 @@ static int mmcc_660_probe(struct platfor clk_alpha_pll_configure(&mmpll8, regmap, &mmpll8_config); clk_alpha_pll_configure(&mmpll10, regmap, &mmpll10_config); @@ -1215,11 +1053,9 @@ index 4b8380c2d648..98ba5b4518fb 100644 } static struct platform_driver mmcc_660_driver = { -diff --git a/drivers/clk/qcom/tcsrcc-sm8550.c b/drivers/clk/qcom/tcsrcc-sm8550.c -index 552a3eb1fd91..e5e8f2e82b94 100644 --- a/drivers/clk/qcom/tcsrcc-sm8550.c +++ b/drivers/clk/qcom/tcsrcc-sm8550.c -@@ -166,7 +166,7 @@ static int tcsr_cc_sm8550_probe(struct platform_device *pdev) +@@ -180,7 +180,7 @@ static int tcsr_cc_sm8550_probe(struct p if (IS_ERR(regmap)) return PTR_ERR(regmap); @@ -1228,11 +1064,9 @@ index 552a3eb1fd91..e5e8f2e82b94 100644 } static struct platform_driver tcsr_cc_sm8550_driver = { -diff --git a/drivers/clk/qcom/videocc-sc7180.c b/drivers/clk/qcom/videocc-sc7180.c -index ae0f812f83e8..d7f845480396 100644 --- a/drivers/clk/qcom/videocc-sc7180.c +++ b/drivers/clk/qcom/videocc-sc7180.c -@@ -226,7 +226,7 @@ static int video_cc_sc7180_probe(struct platform_device *pdev) +@@ -226,7 +226,7 @@ static int video_cc_sc7180_probe(struct /* Keep VIDEO_CC_XO_CLK ALWAYS-ON */ regmap_update_bits(regmap, 0x984, 0x1, 0x1); @@ -1241,11 +1075,9 @@ index ae0f812f83e8..d7f845480396 100644 } static struct platform_driver video_cc_sc7180_driver = { -diff --git a/drivers/clk/qcom/videocc-sc7280.c b/drivers/clk/qcom/videocc-sc7280.c -index 119a3ed6eb6a..317b325d6daf 100644 --- a/drivers/clk/qcom/videocc-sc7280.c +++ b/drivers/clk/qcom/videocc-sc7280.c -@@ -305,7 +305,7 @@ static int video_cc_sc7280_probe(struct platform_device *pdev) +@@ -298,7 +298,7 @@ static int video_cc_sc7280_probe(struct clk_lucid_pll_configure(&video_pll0, regmap, &video_pll0_config); @@ -1254,11 +1086,9 @@ index 119a3ed6eb6a..317b325d6daf 100644 } static struct platform_driver video_cc_sc7280_driver = { -diff --git a/drivers/clk/qcom/videocc-sdm845.c b/drivers/clk/qcom/videocc-sdm845.c -index 80095a283a86..f77a07779477 100644 --- a/drivers/clk/qcom/videocc-sdm845.c +++ b/drivers/clk/qcom/videocc-sdm845.c -@@ -329,7 +329,7 @@ static int video_cc_sdm845_probe(struct platform_device *pdev) +@@ -329,7 +329,7 @@ static int video_cc_sdm845_probe(struct clk_fabia_pll_configure(&video_pll0, regmap, &video_pll0_config); @@ -1267,11 +1097,9 @@ index 80095a283a86..f77a07779477 100644 } static struct platform_driver video_cc_sdm845_driver = { -diff --git a/drivers/clk/qcom/videocc-sm8150.c b/drivers/clk/qcom/videocc-sm8150.c -index 554631aa279b..daab3237eec1 100644 --- a/drivers/clk/qcom/videocc-sm8150.c +++ b/drivers/clk/qcom/videocc-sm8150.c -@@ -262,7 +262,7 @@ static int video_cc_sm8150_probe(struct platform_device *pdev) +@@ -250,7 +250,7 @@ static int video_cc_sm8150_probe(struct /* Keep VIDEO_CC_XO_CLK ALWAYS-ON */ regmap_update_bits(regmap, 0x984, 0x1, 0x1); @@ -1280,58 +1108,47 @@ index 554631aa279b..daab3237eec1 100644 } static struct platform_driver video_cc_sm8150_driver = { -diff --git a/drivers/clk/qcom/videocc-sm8250.c b/drivers/clk/qcom/videocc-sm8250.c -index 914eddd0ae15..d7e0c32284c1 100644 --- a/drivers/clk/qcom/videocc-sm8250.c +++ b/drivers/clk/qcom/videocc-sm8250.c -@@ -387,7 +387,7 @@ static int video_cc_sm8250_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0xe58); /* VIDEO_CC_AHB_CLK */ - qcom_branch_set_clk_en(regmap, 0xeec); /* VIDEO_CC_XO_CLK */ +@@ -387,7 +387,7 @@ static int video_cc_sm8250_probe(struct + regmap_update_bits(regmap, 0xe58, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0xeec, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &video_cc_sm8250_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8250_desc, regmap); pm_runtime_put(&pdev->dev); -diff --git a/drivers/clk/qcom/videocc-sm8350.c b/drivers/clk/qcom/videocc-sm8350.c -index f7aec28d4c87..5bd6fe3e1298 100644 --- a/drivers/clk/qcom/videocc-sm8350.c +++ b/drivers/clk/qcom/videocc-sm8350.c -@@ -562,7 +562,7 @@ static int video_cc_sm8350_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0xe58); /* VIDEO_CC_AHB_CLK */ - qcom_branch_set_clk_en(regmap, video_cc_xo_clk_cbcr); /* VIDEO_CC_XO_CLK */ +@@ -566,7 +566,7 @@ static int video_cc_sm8350_probe(struct + regmap_update_bits(regmap, 0xe58, BIT(0), BIT(0)); + regmap_update_bits(regmap, video_cc_xo_clk_cbcr, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &video_cc_sm8350_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8350_desc, regmap); pm_runtime_put(&pdev->dev); return ret; -diff --git a/drivers/clk/qcom/videocc-sm8450.c b/drivers/clk/qcom/videocc-sm8450.c -index 67df40f16423..ed9163d64244 100644 --- a/drivers/clk/qcom/videocc-sm8450.c +++ b/drivers/clk/qcom/videocc-sm8450.c -@@ -428,7 +428,7 @@ static int video_cc_sm8450_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x8130); /* VIDEO_CC_SLEEP_CLK */ - qcom_branch_set_clk_en(regmap, 0x8114); /* VIDEO_CC_XO_CLK */ +@@ -433,7 +433,7 @@ static int video_cc_sm8450_probe(struct + regmap_update_bits(regmap, 0x8130, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x8114, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &video_cc_sm8450_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8450_desc, regmap); pm_runtime_put(&pdev->dev); -diff --git a/drivers/clk/qcom/videocc-sm8550.c b/drivers/clk/qcom/videocc-sm8550.c -index d73f747d2474..4d36362db1d0 100644 --- a/drivers/clk/qcom/videocc-sm8550.c +++ b/drivers/clk/qcom/videocc-sm8550.c -@@ -433,7 +433,7 @@ static int video_cc_sm8550_probe(struct platform_device *pdev) - qcom_branch_set_clk_en(regmap, 0x8140); /* VIDEO_CC_SLEEP_CLK */ - qcom_branch_set_clk_en(regmap, 0x8124); /* VIDEO_CC_XO_CLK */ +@@ -440,7 +440,7 @@ static int video_cc_sm8550_probe(struct + regmap_update_bits(regmap, 0x8140, BIT(0), BIT(0)); + regmap_update_bits(regmap, 0x8124, BIT(0), BIT(0)); - ret = qcom_cc_really_probe(pdev, &video_cc_sm8550_desc, regmap); + ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8550_desc, regmap); pm_runtime_put(&pdev->dev); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/007-v6.11-net-phy-introduce-core-support-for-phy-mode-10g-qxgm.patch b/lede/target/linux/qualcommbe/patches-6.6/007-v6.11-net-phy-introduce-core-support-for-phy-mode-10g-qxgm.patch index 8b0f93a7e8..31a3dc84bb 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/007-v6.11-net-phy-introduce-core-support-for-phy-mode-10g-qxgm.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/007-v6.11-net-phy-introduce-core-support-for-phy-mode-10g-qxgm.patch @@ -25,11 +25,9 @@ Signed-off-by: Paolo Abeni include/linux/phylink.h | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) -diff --git a/Documentation/networking/phy.rst b/Documentation/networking/phy.rst -index 1283240d7620..f64641417c54 100644 --- a/Documentation/networking/phy.rst +++ b/Documentation/networking/phy.rst -@@ -327,6 +327,12 @@ Some of the interface modes are described below: +@@ -327,6 +327,12 @@ Some of the interface modes are describe This is the Penta SGMII mode, it is similar to QSGMII but it combines 5 SGMII lines into a single link compared to 4 on QSGMII. @@ -42,11 +40,9 @@ index 1283240d7620..f64641417c54 100644 Pause frames / flow control =========================== -diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c -index 15f349e5995a..a235ea2264a7 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c -@@ -141,6 +141,7 @@ int phy_interface_num_ports(phy_interface_t interface) +@@ -141,6 +141,7 @@ int phy_interface_num_ports(phy_interfac return 1; case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_QUSGMII: @@ -54,11 +50,9 @@ index 15f349e5995a..a235ea2264a7 100644 return 4; case PHY_INTERFACE_MODE_PSGMII: return 5; -diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c -index 02427378acfd..6c24c48dcf0f 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -231,6 +231,7 @@ static int phylink_interface_max_speed(phy_interface_t interface) +@@ -231,6 +231,7 @@ static int phylink_interface_max_speed(p return SPEED_1000; case PHY_INTERFACE_MODE_2500BASEX: @@ -66,7 +60,7 @@ index 02427378acfd..6c24c48dcf0f 100644 return SPEED_2500; case PHY_INTERFACE_MODE_5GBASER: -@@ -500,7 +501,11 @@ static unsigned long phylink_get_capabilities(phy_interface_t interface, +@@ -500,7 +501,11 @@ unsigned long phylink_get_capabilities(p switch (interface) { case PHY_INTERFACE_MODE_USXGMII: @@ -79,19 +73,17 @@ index 02427378acfd..6c24c48dcf0f 100644 fallthrough; case PHY_INTERFACE_MODE_RGMII_TXID: -@@ -926,6 +931,7 @@ static int phylink_parse_mode(struct phylink *pl, - case PHY_INTERFACE_MODE_5GBASER: - case PHY_INTERFACE_MODE_25GBASER: +@@ -956,6 +961,7 @@ static int phylink_parse_mode(struct phy + phylink_set(pl->supported, 25000baseSR_Full); + fallthrough; case PHY_INTERFACE_MODE_USXGMII: + case PHY_INTERFACE_MODE_10G_QXGMII: case PHY_INTERFACE_MODE_10GKR: case PHY_INTERFACE_MODE_10GBASER: - case PHY_INTERFACE_MODE_XLGMII: -diff --git a/include/linux/phy.h b/include/linux/phy.h -index e6e83304558e..205fccfc0f60 100644 + phylink_set(pl->supported, 10baseT_Half); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -128,6 +128,7 @@ extern const int phy_10gbit_features_array[1]; +@@ -125,6 +125,7 @@ extern const int phy_10gbit_features_arr * @PHY_INTERFACE_MODE_10GKR: 10GBASE-KR - with Clause 73 AN * @PHY_INTERFACE_MODE_QUSGMII: Quad Universal SGMII * @PHY_INTERFACE_MODE_1000BASEKX: 1000Base-KX - with Clause 73 AN @@ -99,7 +91,7 @@ index e6e83304558e..205fccfc0f60 100644 * @PHY_INTERFACE_MODE_MAX: Book keeping * * Describes the interface between the MAC and PHY. -@@ -168,6 +169,7 @@ typedef enum { +@@ -165,6 +166,7 @@ typedef enum { PHY_INTERFACE_MODE_10GKR, PHY_INTERFACE_MODE_QUSGMII, PHY_INTERFACE_MODE_1000BASEKX, @@ -107,7 +99,7 @@ index e6e83304558e..205fccfc0f60 100644 PHY_INTERFACE_MODE_MAX, } phy_interface_t; -@@ -289,6 +291,8 @@ static inline const char *phy_modes(phy_interface_t interface) +@@ -286,6 +288,8 @@ static inline const char *phy_modes(phy_ return "100base-x"; case PHY_INTERFACE_MODE_QUSGMII: return "qusgmii"; @@ -116,11 +108,9 @@ index e6e83304558e..205fccfc0f60 100644 default: return "unknown"; } -diff --git a/include/linux/phylink.h b/include/linux/phylink.h -index a30a692acc32..2381e07429a2 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h -@@ -124,6 +130,7 @@ static unsigned int phylink_pcs_neg_mode(unsigned int mode, +@@ -128,6 +128,7 @@ static inline unsigned int phylink_pcs_n case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_QUSGMII: case PHY_INTERFACE_MODE_USXGMII: @@ -128,7 +118,7 @@ index a30a692acc32..2381e07429a2 100644 /* These protocols are designed for use with a PHY which * communicates its negotiation result back to the MAC via * inband communication. Note: there exist PHYs that run -@@ -654,6 +654,7 @@ static inline int phylink_get_link_timer_ns(phy_interface_t interface) +@@ -714,6 +715,7 @@ static inline int phylink_get_link_timer case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_USXGMII: @@ -136,6 +126,3 @@ index a30a692acc32..2381e07429a2 100644 return 1600000; case PHY_INTERFACE_MODE_1000BASEX: --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/008-v6.9-clk-Provide-managed-helper-to-get-and-enable-bulk-cl.patch b/lede/target/linux/qualcommbe/patches-6.6/008-v6.9-clk-Provide-managed-helper-to-get-and-enable-bulk-cl.patch index ab61f0b658..c803a7bd2c 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/008-v6.9-clk-Provide-managed-helper-to-get-and-enable-bulk-cl.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/008-v6.9-clk-Provide-managed-helper-to-get-and-enable-bulk-cl.patch @@ -18,11 +18,9 @@ Signed-off-by: Stephen Boyd include/linux/clk.h | 22 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) -diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c -index 737aa70e2cb3..90e6078fb6e1 100644 --- a/drivers/clk/clk-devres.c +++ b/drivers/clk/clk-devres.c -@@ -182,6 +182,46 @@ int __must_check devm_clk_bulk_get_all(struct device *dev, +@@ -182,6 +182,46 @@ int __must_check devm_clk_bulk_get_all(s } EXPORT_SYMBOL_GPL(devm_clk_bulk_get_all); @@ -69,15 +67,12 @@ index 737aa70e2cb3..90e6078fb6e1 100644 static int devm_clk_match(struct device *dev, void *res, void *data) { struct clk **c = res; -diff --git a/include/linux/clk.h b/include/linux/clk.h -index 06f1b292f8a0..0f44d3863de2 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h -@@ -478,6 +478,22 @@ int __must_check devm_clk_bulk_get_optional(struct device *dev, int num_clks, - int __must_check devm_clk_bulk_get_all(struct device *dev, +@@ -479,6 +479,22 @@ int __must_check devm_clk_bulk_get_all(s struct clk_bulk_data **clks); -+/** + /** + * devm_clk_bulk_get_all_enable - Get and enable all clocks of the consumer (managed) + * @dev: device for clock "consumer" + * @clks: pointer to the clk_bulk_data table of consumer @@ -93,10 +88,11 @@ index 06f1b292f8a0..0f44d3863de2 100644 +int __must_check devm_clk_bulk_get_all_enable(struct device *dev, + struct clk_bulk_data **clks); + - /** ++/** * devm_clk_get - lookup and obtain a managed reference to a clock producer. * @dev: device for clock "consumer" -@@ -968,6 +984,12 @@ static inline int __must_check devm_clk_bulk_get_all(struct device *dev, + * @id: clock consumer ID +@@ -968,6 +984,12 @@ static inline int __must_check devm_clk_ return 0; } @@ -109,6 +105,3 @@ index 06f1b292f8a0..0f44d3863de2 100644 static inline struct clk *devm_get_clk_from_child(struct device *dev, struct device_node *np, const char *con_id) { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/009-v6.13-clk-Provide-devm_clk_bulk_get_all_enabled-helper.patch b/lede/target/linux/qualcommbe/patches-6.6/009-v6.13-clk-Provide-devm_clk_bulk_get_all_enabled-helper.patch index 8d9bd9ce01..cf43ed1a6d 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/009-v6.13-clk-Provide-devm_clk_bulk_get_all_enabled-helper.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/009-v6.13-clk-Provide-devm_clk_bulk_get_all_enabled-helper.patch @@ -34,11 +34,9 @@ Signed-off-by: Stephen Boyd include/linux/clk.h | 21 ++++++++++++++++----- 2 files changed, 21 insertions(+), 9 deletions(-) -diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c -index 82ae1f26e634..5368d92d9b39 100644 --- a/drivers/clk/clk-devres.c +++ b/drivers/clk/clk-devres.c -@@ -218,8 +218,8 @@ static void devm_clk_bulk_release_all_enable(struct device *dev, void *res) +@@ -190,8 +190,8 @@ static void devm_clk_bulk_release_all_en clk_bulk_put_all(devres->num_clks, devres->clks); } @@ -49,7 +47,7 @@ index 82ae1f26e634..5368d92d9b39 100644 { struct clk_bulk_devres *devres; int ret; -@@ -244,11 +244,12 @@ int __must_check devm_clk_bulk_get_all_enable(struct device *dev, +@@ -216,11 +216,12 @@ int __must_check devm_clk_bulk_get_all_e } else { clk_bulk_put_all(devres->num_clks, devres->clks); devres_free(devres); @@ -64,11 +62,9 @@ index 82ae1f26e634..5368d92d9b39 100644 static int devm_clk_match(struct device *dev, void *res, void *data) { -diff --git a/include/linux/clk.h b/include/linux/clk.h -index 851a0f2cf42c..1dcee6d701e4 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h -@@ -496,11 +496,13 @@ int __must_check devm_clk_bulk_get_all(struct device *dev, +@@ -479,11 +479,13 @@ int __must_check devm_clk_bulk_get_all(s struct clk_bulk_data **clks); /** @@ -84,7 +80,7 @@ index 851a0f2cf42c..1dcee6d701e4 100644 * * This helper function allows drivers to get all clocks of the * consumer and enables them in one operation with management. -@@ -508,8 +510,8 @@ int __must_check devm_clk_bulk_get_all(struct device *dev, +@@ -491,8 +493,8 @@ int __must_check devm_clk_bulk_get_all(s * is unbound. */ @@ -95,7 +91,7 @@ index 851a0f2cf42c..1dcee6d701e4 100644 /** * devm_clk_get - lookup and obtain a managed reference to a clock producer. -@@ -1034,7 +1036,7 @@ static inline int __must_check devm_clk_bulk_get_all(struct device *dev, +@@ -984,7 +986,7 @@ static inline int __must_check devm_clk_ return 0; } @@ -104,7 +100,7 @@ index 851a0f2cf42c..1dcee6d701e4 100644 struct clk_bulk_data **clks) { return 0; -@@ -1136,6 +1138,15 @@ static inline void clk_restore_context(void) {} +@@ -1086,6 +1088,15 @@ static inline void clk_restore_context(v #endif @@ -120,6 +116,3 @@ index 851a0f2cf42c..1dcee6d701e4 100644 /* clk_prepare_enable helps cases using clk_enable in non-atomic context. */ static inline int clk_prepare_enable(struct clk *clk) { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/010-01-v6.11-dt-bindings-clock-Add-PCIe-pipe-related-clocks-for-I.patch b/lede/target/linux/qualcommbe/patches-6.6/010-01-v6.11-dt-bindings-clock-Add-PCIe-pipe-related-clocks-for-I.patch index 3580795aa5..d03253d706 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/010-01-v6.11-dt-bindings-clock-Add-PCIe-pipe-related-clocks-for-I.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/010-01-v6.11-dt-bindings-clock-Add-PCIe-pipe-related-clocks-for-I.patch @@ -13,8 +13,6 @@ Signed-off-by: Bjorn Andersson include/dt-bindings/clock/qcom,ipq9574-gcc.h | 4 ++++ 1 file changed, 4 insertions(+) -diff --git a/include/dt-bindings/clock/qcom,ipq9574-gcc.h b/include/dt-bindings/clock/qcom,ipq9574-gcc.h -index 08fd3a37acaa..52123c5a09fa 100644 --- a/include/dt-bindings/clock/qcom,ipq9574-gcc.h +++ b/include/dt-bindings/clock/qcom,ipq9574-gcc.h @@ -216,4 +216,8 @@ @@ -26,6 +24,3 @@ index 08fd3a37acaa..52123c5a09fa 100644 +#define GCC_PCIE2_PIPE_CLK 212 +#define GCC_PCIE3_PIPE_CLK 213 #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/010-02-v6.11-clk-qcom-gcc-ipq9574-Add-PCIe-pipe-clocks.patch b/lede/target/linux/qualcommbe/patches-6.6/010-02-v6.11-clk-qcom-gcc-ipq9574-Add-PCIe-pipe-clocks.patch index 05a634a1c6..eb38b15861 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/010-02-v6.11-clk-qcom-gcc-ipq9574-Add-PCIe-pipe-clocks.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/010-02-v6.11-clk-qcom-gcc-ipq9574-Add-PCIe-pipe-clocks.patch @@ -14,11 +14,9 @@ Signed-off-by: Bjorn Andersson drivers/clk/qcom/gcc-ipq9574.c | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) -diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c -index 0a3f846695b8..bc3e17f34295 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c -@@ -1569,6 +1569,24 @@ static struct clk_regmap_phy_mux pcie0_pipe_clk_src = { +@@ -1569,6 +1569,24 @@ static struct clk_regmap_phy_mux pcie0_p }, }; @@ -43,7 +41,7 @@ index 0a3f846695b8..bc3e17f34295 100644 static struct clk_regmap_phy_mux pcie1_pipe_clk_src = { .reg = 0x29064, .clkr = { -@@ -1583,6 +1601,24 @@ static struct clk_regmap_phy_mux pcie1_pipe_clk_src = { +@@ -1583,6 +1601,24 @@ static struct clk_regmap_phy_mux pcie1_p }, }; @@ -68,7 +66,7 @@ index 0a3f846695b8..bc3e17f34295 100644 static struct clk_regmap_phy_mux pcie2_pipe_clk_src = { .reg = 0x2a064, .clkr = { -@@ -1597,6 +1633,24 @@ static struct clk_regmap_phy_mux pcie2_pipe_clk_src = { +@@ -1597,6 +1633,24 @@ static struct clk_regmap_phy_mux pcie2_p }, }; @@ -93,7 +91,7 @@ index 0a3f846695b8..bc3e17f34295 100644 static struct clk_regmap_phy_mux pcie3_pipe_clk_src = { .reg = 0x2b064, .clkr = { -@@ -1611,6 +1665,24 @@ static struct clk_regmap_phy_mux pcie3_pipe_clk_src = { +@@ -1611,6 +1665,24 @@ static struct clk_regmap_phy_mux pcie3_p }, }; @@ -118,7 +116,7 @@ index 0a3f846695b8..bc3e17f34295 100644 static const struct freq_tbl ftbl_pcie_rchng_clk_src[] = { F(24000000, P_XO, 1, 0, 0), F(100000000, P_GPLL0, 8, 0, 0), -@@ -4141,6 +4213,10 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { +@@ -4143,6 +4215,10 @@ static struct clk_regmap *gcc_ipq9574_cl [GCC_SNOC_PCIE1_1LANE_S_CLK] = &gcc_snoc_pcie1_1lane_s_clk.clkr, [GCC_SNOC_PCIE2_2LANE_S_CLK] = &gcc_snoc_pcie2_2lane_s_clk.clkr, [GCC_SNOC_PCIE3_2LANE_S_CLK] = &gcc_snoc_pcie3_2lane_s_clk.clkr, @@ -129,6 +127,3 @@ index 0a3f846695b8..bc3e17f34295 100644 }; static const struct qcom_reset_map gcc_ipq9574_resets[] = { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/011-v6.11-arm64-dts-qcom-ipq9574-drop-power-domain-cells-prope.patch b/lede/target/linux/qualcommbe/patches-6.6/011-v6.11-arm64-dts-qcom-ipq9574-drop-power-domain-cells-prope.patch index ed8e3e9e5d..85e9b618c3 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/011-v6.11-arm64-dts-qcom-ipq9574-drop-power-domain-cells-prope.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/011-v6.11-arm64-dts-qcom-ipq9574-drop-power-domain-cells-prope.patch @@ -15,11 +15,9 @@ Signed-off-by: Bjorn Andersson arch/arm64/boot/dts/qcom/ipq9574.dtsi | 1 - 1 file changed, 1 deletion(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index ded02bc39275..d21937b09b4b 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -315,7 +315,6 @@ gcc: clock-controller@1800000 { +@@ -296,7 +296,6 @@ <0>; #clock-cells = <1>; #reset-cells = <1>; @@ -27,6 +25,3 @@ index ded02bc39275..d21937b09b4b 100644 }; tcsr_mutex: hwlock@1905000 { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/012-01-v6.11-interconnect-icc-clk-Specify-master-slave-ids.patch b/lede/target/linux/qualcommbe/patches-6.6/012-01-v6.11-interconnect-icc-clk-Specify-master-slave-ids.patch index eae33982b2..281558cfa2 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/012-01-v6.11-interconnect-icc-clk-Specify-master-slave-ids.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/012-01-v6.11-interconnect-icc-clk-Specify-master-slave-ids.patch @@ -23,11 +23,9 @@ Signed-off-by: Bjorn Andersson include/linux/interconnect-clk.h | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) -diff --git a/drivers/clk/qcom/clk-cbf-8996.c b/drivers/clk/qcom/clk-cbf-8996.c -index 76bf523431b8..f5fd1ff9c6c9 100644 --- a/drivers/clk/qcom/clk-cbf-8996.c +++ b/drivers/clk/qcom/clk-cbf-8996.c -@@ -226,7 +226,12 @@ static int qcom_msm8996_cbf_icc_register(struct platform_device *pdev, struct cl +@@ -237,7 +237,12 @@ static int qcom_msm8996_cbf_icc_register struct device *dev = &pdev->dev; struct clk *clk = devm_clk_hw_get_clk(dev, cbf_hw, "cbf"); const struct icc_clk_data data[] = { @@ -41,11 +39,9 @@ index 76bf523431b8..f5fd1ff9c6c9 100644 }; struct icc_provider *provider; -diff --git a/drivers/interconnect/icc-clk.c b/drivers/interconnect/icc-clk.c -index d787f2ea36d9..2be193fd7d8f 100644 --- a/drivers/interconnect/icc-clk.c +++ b/drivers/interconnect/icc-clk.c -@@ -108,7 +108,7 @@ struct icc_provider *icc_clk_register(struct device *dev, +@@ -109,7 +109,7 @@ struct icc_provider *icc_clk_register(st for (i = 0, j = 0; i < num_clocks; i++) { qp->clocks[i].clk = data[i].clk; @@ -54,7 +50,7 @@ index d787f2ea36d9..2be193fd7d8f 100644 if (IS_ERR(node)) { ret = PTR_ERR(node); goto err; -@@ -118,10 +118,10 @@ struct icc_provider *icc_clk_register(struct device *dev, +@@ -119,10 +119,10 @@ struct icc_provider *icc_clk_register(st node->data = &qp->clocks[i]; icc_node_add(node, provider); /* link to the next node, slave */ @@ -67,8 +63,6 @@ index d787f2ea36d9..2be193fd7d8f 100644 if (IS_ERR(node)) { ret = PTR_ERR(node); goto err; -diff --git a/include/linux/interconnect-clk.h b/include/linux/interconnect-clk.h -index 0cd80112bea5..170898faaacb 100644 --- a/include/linux/interconnect-clk.h +++ b/include/linux/interconnect-clk.h @@ -11,6 +11,8 @@ struct device; @@ -80,6 +74,3 @@ index 0cd80112bea5..170898faaacb 100644 }; struct icc_provider *icc_clk_register(struct device *dev, --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/012-02-v6.11-dt-bindings-interconnect-Add-Qualcomm-IPQ9574-suppor.patch b/lede/target/linux/qualcommbe/patches-6.6/012-02-v6.11-dt-bindings-interconnect-Add-Qualcomm-IPQ9574-suppor.patch index f822003a57..130abfcbe1 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/012-02-v6.11-dt-bindings-interconnect-Add-Qualcomm-IPQ9574-suppor.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/012-02-v6.11-dt-bindings-interconnect-Add-Qualcomm-IPQ9574-suppor.patch @@ -22,8 +22,6 @@ Signed-off-by: Bjorn Andersson 2 files changed, 62 insertions(+) create mode 100644 include/dt-bindings/interconnect/qcom,ipq9574.h -diff --git a/Documentation/devicetree/bindings/clock/qcom,ipq9574-gcc.yaml b/Documentation/devicetree/bindings/clock/qcom,ipq9574-gcc.yaml -index 944a0ea79cd6..824781cbdf34 100644 --- a/Documentation/devicetree/bindings/clock/qcom,ipq9574-gcc.yaml +++ b/Documentation/devicetree/bindings/clock/qcom,ipq9574-gcc.yaml @@ -33,6 +33,9 @@ properties: @@ -36,9 +34,6 @@ index 944a0ea79cd6..824781cbdf34 100644 required: - compatible - clocks -diff --git a/include/dt-bindings/interconnect/qcom,ipq9574.h b/include/dt-bindings/interconnect/qcom,ipq9574.h -new file mode 100644 -index 000000000000..42019335c7dd --- /dev/null +++ b/include/dt-bindings/interconnect/qcom,ipq9574.h @@ -0,0 +1,59 @@ @@ -101,6 +96,3 @@ index 000000000000..42019335c7dd +#define SLAVE_NSSNOC_IMEM_AHB 9 + +#endif /* INTERCONNECT_QCOM_IPQ9574_H */ --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/012-03-v6.11-interconnect-icc-clk-Add-devm_icc_clk_register.patch b/lede/target/linux/qualcommbe/patches-6.6/012-03-v6.11-interconnect-icc-clk-Add-devm_icc_clk_register.patch index ae86828196..c1ad657551 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/012-03-v6.11-interconnect-icc-clk-Add-devm_icc_clk_register.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/012-03-v6.11-interconnect-icc-clk-Add-devm_icc_clk_register.patch @@ -16,11 +16,9 @@ Signed-off-by: Bjorn Andersson include/linux/interconnect-clk.h | 2 ++ 2 files changed, 20 insertions(+) -diff --git a/drivers/interconnect/icc-clk.c b/drivers/interconnect/icc-clk.c -index 2be193fd7d8f..f788db15cd76 100644 --- a/drivers/interconnect/icc-clk.c +++ b/drivers/interconnect/icc-clk.c -@@ -148,6 +148,24 @@ struct icc_provider *icc_clk_register(struct device *dev, +@@ -147,6 +147,24 @@ err: } EXPORT_SYMBOL_GPL(icc_clk_register); @@ -45,11 +43,9 @@ index 2be193fd7d8f..f788db15cd76 100644 /** * icc_clk_unregister() - unregister a previously registered clk interconnect provider * @provider: provider returned by icc_clk_register() -diff --git a/include/linux/interconnect-clk.h b/include/linux/interconnect-clk.h -index 170898faaacb..9bcee3e9c56c 100644 --- a/include/linux/interconnect-clk.h +++ b/include/linux/interconnect-clk.h -@@ -19,6 +19,8 @@ struct icc_provider *icc_clk_register(struct device *dev, +@@ -19,6 +19,8 @@ struct icc_provider *icc_clk_register(st unsigned int first_id, unsigned int num_clocks, const struct icc_clk_data *data); @@ -58,6 +54,3 @@ index 170898faaacb..9bcee3e9c56c 100644 void icc_clk_unregister(struct icc_provider *provider); #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/012-04-v6.11-clk-qcom-common-Add-interconnect-clocks-support.patch b/lede/target/linux/qualcommbe/patches-6.6/012-04-v6.11-clk-qcom-common-Add-interconnect-clocks-support.patch index e0af1be618..402c58aed8 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/012-04-v6.11-clk-qcom-common-Add-interconnect-clocks-support.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/012-04-v6.11-clk-qcom-common-Add-interconnect-clocks-support.patch @@ -23,8 +23,6 @@ Signed-off-by: Bjorn Andersson drivers/clk/qcom/common.h | 9 +++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) -diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c -index c92e10c60322..ea3788ba46f7 100644 --- a/drivers/clk/qcom/common.c +++ b/drivers/clk/qcom/common.c @@ -8,6 +8,7 @@ @@ -35,7 +33,7 @@ index c92e10c60322..ea3788ba46f7 100644 #include #include -@@ -252,6 +253,38 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec, +@@ -250,6 +251,38 @@ static struct clk_hw *qcom_cc_clk_hw_get return cc->rclks[idx] ? &cc->rclks[idx]->hw : NULL; } @@ -74,7 +72,7 @@ index c92e10c60322..ea3788ba46f7 100644 int qcom_cc_really_probe(struct device *dev, const struct qcom_cc_desc *desc, struct regmap *regmap) { -@@ -320,7 +353,7 @@ int qcom_cc_really_probe(struct device *dev, +@@ -318,7 +351,7 @@ int qcom_cc_really_probe(struct device * if (ret) return ret; @@ -83,8 +81,6 @@ index c92e10c60322..ea3788ba46f7 100644 } EXPORT_SYMBOL_GPL(qcom_cc_really_probe); -diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h -index d048bdeeba10..7e57f8fe8ea6 100644 --- a/drivers/clk/qcom/common.h +++ b/drivers/clk/qcom/common.h @@ -19,6 +19,12 @@ struct clk_hw; @@ -110,6 +106,3 @@ index d048bdeeba10..7e57f8fe8ea6 100644 }; /** --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/012-05-v6.11-clk-qcom-ipq9574-Use-icc-clk-for-enabling-NoC-relate.patch b/lede/target/linux/qualcommbe/patches-6.6/012-05-v6.11-clk-qcom-ipq9574-Use-icc-clk-for-enabling-NoC-relate.patch index bbcecdc8cc..ba597fc5e3 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/012-05-v6.11-clk-qcom-ipq9574-Use-icc-clk-for-enabling-NoC-relate.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/012-05-v6.11-clk-qcom-ipq9574-Use-icc-clk-for-enabling-NoC-relate.patch @@ -16,11 +16,9 @@ Signed-off-by: Bjorn Andersson drivers/clk/qcom/gcc-ipq9574.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) -diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig -index 1231eae51556..11ae28430dad 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig -@@ -14,6 +14,8 @@ menuconfig COMMON_CLK_QCOM +@@ -17,6 +17,8 @@ menuconfig COMMON_CLK_QCOM select RATIONAL select REGMAP_MMIO select RESET_CONTROLLER @@ -29,8 +27,6 @@ index 1231eae51556..11ae28430dad 100644 if COMMON_CLK_QCOM -diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c -index bc3e17f34295..f08a447370bd 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c @@ -4,6 +4,8 @@ @@ -50,7 +46,7 @@ index bc3e17f34295..f08a447370bd 100644 #include "clk-alpha-pll.h" #include "clk-branch.h" -@@ -4377,6 +4380,32 @@ static const struct qcom_reset_map gcc_ipq9574_resets[] = { +@@ -4379,6 +4382,32 @@ static const struct qcom_reset_map gcc_i [GCC_WCSS_Q6_TBU_BCR] = { 0x12054, 0 }, }; @@ -83,7 +79,7 @@ index bc3e17f34295..f08a447370bd 100644 static const struct of_device_id gcc_ipq9574_match_table[] = { { .compatible = "qcom,ipq9574-gcc" }, { } -@@ -4399,6 +4428,9 @@ static const struct qcom_cc_desc gcc_ipq9574_desc = { +@@ -4401,6 +4430,9 @@ static const struct qcom_cc_desc gcc_ipq .num_resets = ARRAY_SIZE(gcc_ipq9574_resets), .clk_hws = gcc_ipq9574_hws, .num_clk_hws = ARRAY_SIZE(gcc_ipq9574_hws), @@ -93,7 +89,7 @@ index bc3e17f34295..f08a447370bd 100644 }; static int gcc_ipq9574_probe(struct platform_device *pdev) -@@ -4411,6 +4443,7 @@ static struct platform_driver gcc_ipq9574_driver = { +@@ -4413,6 +4445,7 @@ static struct platform_driver gcc_ipq957 .driver = { .name = "qcom,gcc-ipq9574", .of_match_table = gcc_ipq9574_match_table, @@ -101,6 +97,3 @@ index bc3e17f34295..f08a447370bd 100644 }, }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/012-06-v6.11-arm64-dts-qcom-ipq9574-Add-icc-provider-ability-to-g.patch b/lede/target/linux/qualcommbe/patches-6.6/012-06-v6.11-arm64-dts-qcom-ipq9574-Add-icc-provider-ability-to-g.patch index b5f9c0f297..d24889c525 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/012-06-v6.11-arm64-dts-qcom-ipq9574-Add-icc-provider-ability-to-g.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/012-06-v6.11-arm64-dts-qcom-ipq9574-Add-icc-provider-ability-to-g.patch @@ -21,8 +21,6 @@ Signed-off-by: Bjorn Andersson arch/arm64/boot/dts/qcom/ipq9574.dtsi | 2 ++ 1 file changed, 2 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 04ba09a9156c..48dfafea46a7 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -8,6 +8,7 @@ @@ -33,7 +31,7 @@ index 04ba09a9156c..48dfafea46a7 100644 #include #include #include -@@ -315,6 +316,7 @@ gcc: clock-controller@1800000 { +@@ -296,6 +297,7 @@ <0>; #clock-cells = <1>; #reset-cells = <1>; @@ -41,6 +39,3 @@ index 04ba09a9156c..48dfafea46a7 100644 }; tcsr_mutex: hwlock@1905000 { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/013-01-v6.7-cpufreq-qcom-nvmem-Enable-cpufreq-for-ipq53xx.patch b/lede/target/linux/qualcommbe/patches-6.6/013-01-v6.7-cpufreq-qcom-nvmem-Enable-cpufreq-for-ipq53xx.patch index ed97bca367..3aec1a91b6 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/013-01-v6.7-cpufreq-qcom-nvmem-Enable-cpufreq-for-ipq53xx.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/013-01-v6.7-cpufreq-qcom-nvmem-Enable-cpufreq-for-ipq53xx.patch @@ -27,23 +27,19 @@ Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-nvmem.c | 6 ++++++ 2 files changed, 7 insertions(+) -diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c -index 07181913448f..53da25589e5f 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c -@@ -180,6 +180,7 @@ static const struct of_device_id blocklist[] __initconst = { +@@ -177,6 +177,7 @@ static const struct of_device_id blockli + { .compatible = "ti,am625", }, { .compatible = "ti,am62a7", }, - { .compatible = "ti,am62p5", }, + { .compatible = "qcom,ipq5332", }, { .compatible = "qcom,ipq8064", }, { .compatible = "qcom,apq8064", }, { .compatible = "qcom,msm8974", }, -diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c -index 158c0e139185..4f7af70169e0 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c -@@ -183,6 +183,11 @@ static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev, +@@ -152,6 +152,11 @@ static int qcom_cpufreq_kryo_name_versio switch (msm_id) { case QCOM_ID_MSM8996: case QCOM_ID_APQ8096: @@ -55,7 +51,7 @@ index 158c0e139185..4f7af70169e0 100644 drv->versions = 1 << (unsigned int)(*speedbin); break; case QCOM_ID_MSM8996SG: -@@ -541,6 +546,7 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst = { +@@ -353,6 +358,7 @@ static const struct of_device_id qcom_cp { .compatible = "qcom,apq8096", .data = &match_data_kryo }, { .compatible = "qcom,msm8996", .data = &match_data_kryo }, { .compatible = "qcom,qcs404", .data = &match_data_qcs404 }, @@ -63,6 +59,3 @@ index 158c0e139185..4f7af70169e0 100644 { .compatible = "qcom,ipq8064", .data = &match_data_krait }, { .compatible = "qcom,apq8064", .data = &match_data_krait }, { .compatible = "qcom,msm8974", .data = &match_data_krait }, --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/013-02-v6.7-v6.8-cpufreq-qcom-nvmem-Introduce-cpufreq-for-ipq95xx.patch b/lede/target/linux/qualcommbe/patches-6.6/013-02-v6.7-v6.8-cpufreq-qcom-nvmem-Introduce-cpufreq-for-ipq95xx.patch index b3954d19b0..0b5e921c95 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/013-02-v6.7-v6.8-cpufreq-qcom-nvmem-Introduce-cpufreq-for-ipq95xx.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/013-02-v6.7-v6.8-cpufreq-qcom-nvmem-Introduce-cpufreq-for-ipq95xx.patch @@ -23,23 +23,19 @@ Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-nvmem.c | 6 ++++++ 2 files changed, 7 insertions(+) -diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c -index 53da25589e5f..bd1e1357cef8 100644 --- a/drivers/cpufreq/cpufreq-dt-platdev.c +++ b/drivers/cpufreq/cpufreq-dt-platdev.c -@@ -184,6 +184,7 @@ static const struct of_device_id blocklist[] __initconst = { +@@ -179,6 +179,7 @@ static const struct of_device_id blockli - { .compatible = "qcom,ipq5332", }, + { .compatible = "qcom,ipq5332", }, { .compatible = "qcom,ipq8064", }, + { .compatible = "qcom,ipq9574", }, { .compatible = "qcom,apq8064", }, { .compatible = "qcom,msm8974", }, { .compatible = "qcom,msm8960", }, -diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c -index 4f7af70169e0..6355a39418c5 100644 --- a/drivers/cpufreq/qcom-cpufreq-nvmem.c +++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c -@@ -188,6 +188,11 @@ static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev, +@@ -157,6 +157,11 @@ static int qcom_cpufreq_kryo_name_versio case QCOM_ID_IPQ5312: case QCOM_ID_IPQ5302: case QCOM_ID_IPQ5300: @@ -51,7 +47,7 @@ index 4f7af70169e0..6355a39418c5 100644 drv->versions = 1 << (unsigned int)(*speedbin); break; case QCOM_ID_MSM8996SG: -@@ -551,6 +556,7 @@ static const struct of_device_id qcom_cpufreq_match_list[] __initconst = { +@@ -361,6 +366,7 @@ static const struct of_device_id qcom_cp { .compatible = "qcom,ipq5332", .data = &match_data_kryo }, { .compatible = "qcom,ipq8064", .data = &match_data_krait }, { .compatible = "qcom,apq8064", .data = &match_data_krait }, @@ -59,6 +55,3 @@ index 4f7af70169e0..6355a39418c5 100644 { .compatible = "qcom,msm8974", .data = &match_data_krait }, { .compatible = "qcom,msm8960", .data = &match_data_krait }, {}, --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/014-v6.8-arm64-dts-qcom-ipq9574-populate-the-opp-table-based-.patch b/lede/target/linux/qualcommbe/patches-6.6/014-v6.8-arm64-dts-qcom-ipq9574-populate-the-opp-table-based-.patch index 8aaf117f58..9e546d33c3 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/014-v6.8-arm64-dts-qcom-ipq9574-populate-the-opp-table-based-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/014-v6.8-arm64-dts-qcom-ipq9574-populate-the-opp-table-based-.patch @@ -31,11 +31,9 @@ Signed-off-by: Bjorn Andersson arch/arm64/boot/dts/qcom/ipq9574.dtsi | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 8a72ad4afd03..d4b7e215fc92 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -106,42 +106,56 @@ memory@40000000 { +@@ -107,42 +107,56 @@ }; cpu_opp_table: opp-table-cpu { @@ -93,7 +91,7 @@ index 8a72ad4afd03..d4b7e215fc92 100644 clock-latency-ns = <200000>; }; }; -@@ -223,6 +237,11 @@ qfprom: efuse@a4000 { +@@ -234,6 +248,11 @@ reg = <0x000a4000 0x5a1>; #address-cells = <1>; #size-cells = <1>; @@ -105,6 +103,3 @@ index 8a72ad4afd03..d4b7e215fc92 100644 }; cryptobam: dma-controller@704000 { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/015-v6.8-regulator-qcom_smd-Add-LDO5-MP5496-regulator.patch b/lede/target/linux/qualcommbe/patches-6.6/015-v6.8-regulator-qcom_smd-Add-LDO5-MP5496-regulator.patch index 68f96ce62e..039c39c5c2 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/015-v6.8-regulator-qcom_smd-Add-LDO5-MP5496-regulator.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/015-v6.8-regulator-qcom_smd-Add-LDO5-MP5496-regulator.patch @@ -14,11 +14,9 @@ Signed-off-by: Mark Brown drivers/regulator/qcom_smd-regulator.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c -index 09c471a0ba2e..d1be9568025e 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c -@@ -796,6 +796,7 @@ static const struct rpm_regulator_data rpm_mp5496_regulators[] = { +@@ -796,6 +796,7 @@ static const struct rpm_regulator_data r { "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smps, "s1" }, { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smps, "s2" }, { "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2" }, @@ -26,6 +24,3 @@ index 09c471a0ba2e..d1be9568025e 100644 {} }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/018-v6.14-clk-qcom-Add-CMN-PLL-clock-controller-driver-for-IPQ.patch b/lede/target/linux/qualcommbe/patches-6.6/018-v6.14-clk-qcom-Add-CMN-PLL-clock-controller-driver-for-IPQ.patch index fedd582897..2b823d2fc9 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/018-v6.14-clk-qcom-Add-CMN-PLL-clock-controller-driver-for-IPQ.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/018-v6.14-clk-qcom-Add-CMN-PLL-clock-controller-driver-for-IPQ.patch @@ -32,11 +32,9 @@ Signed-off-by: Bjorn Andersson 3 files changed, 445 insertions(+) create mode 100644 drivers/clk/qcom/ipq-cmn-pll.c -diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig -index 42c257e4c433..2daff198aeb3 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig -@@ -199,6 +199,15 @@ config IPQ_APSS_6018 +@@ -141,6 +141,15 @@ config IPQ_APSS_6018 Say Y if you want to support CPU frequency scaling on ipq based devices. @@ -52,21 +50,16 @@ index 42c257e4c433..2daff198aeb3 100644 config IPQ_GCC_4019 tristate "IPQ4019 Global Clock Controller" help -diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile -index 1b749da9c13a..6665049cb8c8 100644 --- a/drivers/clk/qcom/Makefile +++ b/drivers/clk/qcom/Makefile -@@ -30,6 +30,7 @@ obj-$(CONFIG_CLK_X1P42100_GPUCC) += gpucc-x1p42100.o - obj-$(CONFIG_CLK_QCM2290_GPUCC) += gpucc-qcm2290.o +@@ -23,6 +23,7 @@ obj-$(CONFIG_APQ_MMCC_8084) += mmcc-apq8 + obj-$(CONFIG_CLK_GFM_LPASS_SM8250) += lpass-gfm-sm8250.o obj-$(CONFIG_IPQ_APSS_PLL) += apss-ipq-pll.o obj-$(CONFIG_IPQ_APSS_6018) += apss-ipq6018.o +obj-$(CONFIG_IPQ_CMN_PLL) += ipq-cmn-pll.o obj-$(CONFIG_IPQ_GCC_4019) += gcc-ipq4019.o obj-$(CONFIG_IPQ_GCC_5018) += gcc-ipq5018.o obj-$(CONFIG_IPQ_GCC_5332) += gcc-ipq5332.o -diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c -new file mode 100644 -index 000000000000..432d4c4b7aa6 --- /dev/null +++ b/drivers/clk/qcom/ipq-cmn-pll.c @@ -0,0 +1,435 @@ @@ -505,6 +498,3 @@ index 000000000000..432d4c4b7aa6 + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. IPQ CMN PLL Driver"); +MODULE_LICENSE("GPL"); --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/019-01-v6.14-dt-bindings-clock-qcom-Add-CMN-PLL-clock-controller-.patch b/lede/target/linux/qualcommbe/patches-6.6/019-01-v6.14-dt-bindings-clock-qcom-Add-CMN-PLL-clock-controller-.patch index 8d0d19945a..5c0b4e16f8 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/019-01-v6.14-dt-bindings-clock-qcom-Add-CMN-PLL-clock-controller-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/019-01-v6.14-dt-bindings-clock-qcom-Add-CMN-PLL-clock-controller-.patch @@ -25,9 +25,6 @@ Signed-off-by: Bjorn Andersson create mode 100644 Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml create mode 100644 include/dt-bindings/clock/qcom,ipq-cmn-pll.h -diff --git a/Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml b/Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml -new file mode 100644 -index 000000000000..f869b3739be8 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml @@ -0,0 +1,77 @@ @@ -108,9 +105,6 @@ index 000000000000..f869b3739be8 + assigned-clock-rates-u64 = /bits/ 64 <12000000000>; + }; +... -diff --git a/include/dt-bindings/clock/qcom,ipq-cmn-pll.h b/include/dt-bindings/clock/qcom,ipq-cmn-pll.h -new file mode 100644 -index 000000000000..936e92b3b62c --- /dev/null +++ b/include/dt-bindings/clock/qcom,ipq-cmn-pll.h @@ -0,0 +1,22 @@ @@ -136,6 +130,3 @@ index 000000000000..936e92b3b62c +#define ETH2_50MHZ_CLK 8 +#define ETH_25MHZ_CLK 9 +#endif --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/019-02-v6.14-arm64-dts-qcom-ipq9574-Add-CMN-PLL-node.patch b/lede/target/linux/qualcommbe/patches-6.6/019-02-v6.14-arm64-dts-qcom-ipq9574-Add-CMN-PLL-node.patch index 84f28cf83d..514df211ec 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/019-02-v6.14-arm64-dts-qcom-ipq9574-Add-CMN-PLL-node.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/019-02-v6.14-arm64-dts-qcom-ipq9574-Add-CMN-PLL-node.patch @@ -28,8 +28,6 @@ Signed-off-by: Bjorn Andersson arch/arm64/boot/dts/qcom/ipq9574.dtsi | 26 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -index 91e104b0f865..bb1ff79360d3 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi @@ -3,7 +3,7 @@ @@ -41,7 +39,7 @@ index 91e104b0f865..bb1ff79360d3 100644 */ /dts-v1/; -@@ -164,6 +164,21 @@ &usb3 { +@@ -120,6 +120,21 @@ status = "okay"; }; @@ -63,8 +61,6 @@ index 91e104b0f865..bb1ff79360d3 100644 +&xo_clk { + clock-frequency = <48000000>; +}; -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 00ee3290c181..c543c3492e93 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -3,10 +3,11 @@ @@ -80,7 +76,7 @@ index 00ee3290c181..c543c3492e93 100644 #include #include #include -@@ -19,6 +20,12 @@ / { +@@ -19,6 +20,12 @@ #size-cells = <2>; clocks { @@ -93,7 +89,7 @@ index 00ee3290c181..c543c3492e93 100644 sleep_clk: sleep-clk { compatible = "fixed-clock"; #clock-cells = <0>; -@@ -28,6 +35,11 @@ xo_board_clk: xo-board-clk { +@@ -28,6 +35,11 @@ compatible = "fixed-clock"; #clock-cells = <0>; }; @@ -105,7 +101,7 @@ index 00ee3290c181..c543c3492e93 100644 }; cpus { -@@ -335,6 +347,18 @@ pcie1_phy: phy@fc000 { +@@ -243,6 +255,18 @@ status = "disabled"; }; @@ -124,6 +120,3 @@ index 00ee3290c181..c543c3492e93 100644 qfprom: efuse@a4000 { compatible = "qcom,ipq9574-qfprom", "qcom,qfprom"; reg = <0x000a4000 0x5a1>; --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/019-03-v6.14-arm64-dts-qcom-ipq9574-Update-xo_board_clk-to-use-fi.patch b/lede/target/linux/qualcommbe/patches-6.6/019-03-v6.14-arm64-dts-qcom-ipq9574-Update-xo_board_clk-to-use-fi.patch index 0654895165..062e9ecabb 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/019-03-v6.14-arm64-dts-qcom-ipq9574-Update-xo_board_clk-to-use-fi.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/019-03-v6.14-arm64-dts-qcom-ipq9574-Update-xo_board_clk-to-use-fi.patch @@ -17,11 +17,9 @@ Signed-off-by: Bjorn Andersson arch/arm64/boot/dts/qcom/ipq9574.dtsi | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -index bb1ff79360d3..ae12f069f26f 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -@@ -175,8 +175,13 @@ &ref_48mhz_clk { +@@ -131,8 +131,13 @@ clock-mult = <1>; }; @@ -36,11 +34,9 @@ index bb1ff79360d3..ae12f069f26f 100644 }; &xo_clk { -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index c543c3492e93..3e93484e7e32 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -32,7 +32,8 @@ sleep_clk: sleep-clk { +@@ -32,7 +32,8 @@ }; xo_board_clk: xo-board-clk { @@ -50,6 +46,3 @@ index c543c3492e93..3e93484e7e32 100644 #clock-cells = <0>; }; --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/020-v6.11-PCI-qcom-Use-devm_clk_bulk_get_all-API.patch b/lede/target/linux/qualcommbe/patches-6.6/020-v6.11-PCI-qcom-Use-devm_clk_bulk_get_all-API.patch deleted file mode 100644 index 7fef84cfb7..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/020-v6.11-PCI-qcom-Use-devm_clk_bulk_get_all-API.patch +++ /dev/null @@ -1,393 +0,0 @@ -From 652935ba05860eadaa19ac9efe7aea61fb7a3aef Mon Sep 17 00:00:00 2001 -From: Manivannan Sadhasivam -Date: Wed, 17 Apr 2024 12:32:53 +0530 -Subject: [PATCH] PCI: qcom: Use devm_clk_bulk_get_all() API -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -There is no need for the device drivers to validate the clocks defined in -Devicetree. The validation should be performed by the DT schema and the -drivers should just get all the clocks from DT. Right now the driver -hardcodes the clock info and validates them against DT which is redundant. - -So use devm_clk_bulk_get_all() that just gets all the clocks defined in DT -and get rid of all static clocks info from the driver. This simplifies the -driver. - -Link: https://lore.kernel.org/linux-pci/20240417-pci-qcom-clk-bulk-v1-1-52ca19b3d6b2@linaro.org -Signed-off-by: Manivannan Sadhasivam -Signed-off-by: Krzysztof Wilczyński -Signed-off-by: Bjorn Helgaas ---- - drivers/pci/controller/dwc/pcie-qcom.c | 177 ++++++++----------------- - 1 file changed, 58 insertions(+), 119 deletions(-) - -diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c -index 14772edcf0d3..3d2eeff9a876 100644 ---- a/drivers/pci/controller/dwc/pcie-qcom.c -+++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -154,58 +154,56 @@ - #define QCOM_PCIE_LINK_SPEED_TO_BW(speed) \ - Mbps_to_icc(PCIE_SPEED2MBS_ENC(pcie_link_speed[speed])) - --#define QCOM_PCIE_1_0_0_MAX_CLOCKS 4 - struct qcom_pcie_resources_1_0_0 { -- struct clk_bulk_data clks[QCOM_PCIE_1_0_0_MAX_CLOCKS]; -+ struct clk_bulk_data *clks; -+ int num_clks; - struct reset_control *core; - struct regulator *vdda; - }; - --#define QCOM_PCIE_2_1_0_MAX_CLOCKS 5 - #define QCOM_PCIE_2_1_0_MAX_RESETS 6 - #define QCOM_PCIE_2_1_0_MAX_SUPPLY 3 - struct qcom_pcie_resources_2_1_0 { -- struct clk_bulk_data clks[QCOM_PCIE_2_1_0_MAX_CLOCKS]; -+ struct clk_bulk_data *clks; -+ int num_clks; - struct reset_control_bulk_data resets[QCOM_PCIE_2_1_0_MAX_RESETS]; - int num_resets; - struct regulator_bulk_data supplies[QCOM_PCIE_2_1_0_MAX_SUPPLY]; - }; - --#define QCOM_PCIE_2_3_2_MAX_CLOCKS 4 - #define QCOM_PCIE_2_3_2_MAX_SUPPLY 2 - struct qcom_pcie_resources_2_3_2 { -- struct clk_bulk_data clks[QCOM_PCIE_2_3_2_MAX_CLOCKS]; -+ struct clk_bulk_data *clks; -+ int num_clks; - struct regulator_bulk_data supplies[QCOM_PCIE_2_3_2_MAX_SUPPLY]; - }; - --#define QCOM_PCIE_2_3_3_MAX_CLOCKS 5 - #define QCOM_PCIE_2_3_3_MAX_RESETS 7 - struct qcom_pcie_resources_2_3_3 { -- struct clk_bulk_data clks[QCOM_PCIE_2_3_3_MAX_CLOCKS]; -+ struct clk_bulk_data *clks; -+ int num_clks; - struct reset_control_bulk_data rst[QCOM_PCIE_2_3_3_MAX_RESETS]; - }; - --#define QCOM_PCIE_2_4_0_MAX_CLOCKS 4 - #define QCOM_PCIE_2_4_0_MAX_RESETS 12 - struct qcom_pcie_resources_2_4_0 { -- struct clk_bulk_data clks[QCOM_PCIE_2_4_0_MAX_CLOCKS]; -+ struct clk_bulk_data *clks; - int num_clks; - struct reset_control_bulk_data resets[QCOM_PCIE_2_4_0_MAX_RESETS]; - int num_resets; - }; - --#define QCOM_PCIE_2_7_0_MAX_CLOCKS 15 - #define QCOM_PCIE_2_7_0_MAX_SUPPLIES 2 - struct qcom_pcie_resources_2_7_0 { -- struct clk_bulk_data clks[QCOM_PCIE_2_7_0_MAX_CLOCKS]; -+ struct clk_bulk_data *clks; - int num_clks; - struct regulator_bulk_data supplies[QCOM_PCIE_2_7_0_MAX_SUPPLIES]; - struct reset_control *rst; - }; - --#define QCOM_PCIE_2_9_0_MAX_CLOCKS 5 - struct qcom_pcie_resources_2_9_0 { -- struct clk_bulk_data clks[QCOM_PCIE_2_9_0_MAX_CLOCKS]; -+ struct clk_bulk_data *clks; -+ int num_clks; - struct reset_control *rst; - }; - -@@ -337,21 +335,11 @@ static int qcom_pcie_get_resources_2_1_0(struct qcom_pcie *pcie) - if (ret) - return ret; - -- res->clks[0].id = "iface"; -- res->clks[1].id = "core"; -- res->clks[2].id = "phy"; -- res->clks[3].id = "aux"; -- res->clks[4].id = "ref"; -- -- /* iface, core, phy are required */ -- ret = devm_clk_bulk_get(dev, 3, res->clks); -- if (ret < 0) -- return ret; -- -- /* aux, ref are optional */ -- ret = devm_clk_bulk_get_optional(dev, 2, res->clks + 3); -- if (ret < 0) -- return ret; -+ res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); -+ if (res->num_clks < 0) { -+ dev_err(dev, "Failed to get clocks\n"); -+ return res->num_clks; -+ } - - res->resets[0].id = "pci"; - res->resets[1].id = "axi"; -@@ -373,7 +361,7 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie) - { - struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0; - -- clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); -+ clk_bulk_disable_unprepare(res->num_clks, res->clks); - reset_control_bulk_assert(res->num_resets, res->resets); - - writel(1, pcie->parf + PARF_PHY_CTRL); -@@ -425,7 +413,7 @@ static int qcom_pcie_post_init_2_1_0(struct qcom_pcie *pcie) - val &= ~PHY_TEST_PWR_DOWN; - writel(val, pcie->parf + PARF_PHY_CTRL); - -- ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); -+ ret = clk_bulk_prepare_enable(res->num_clks, res->clks); - if (ret) - return ret; - -@@ -476,20 +464,16 @@ static int qcom_pcie_get_resources_1_0_0(struct qcom_pcie *pcie) - struct qcom_pcie_resources_1_0_0 *res = &pcie->res.v1_0_0; - struct dw_pcie *pci = pcie->pci; - struct device *dev = pci->dev; -- int ret; - - res->vdda = devm_regulator_get(dev, "vdda"); - if (IS_ERR(res->vdda)) - return PTR_ERR(res->vdda); - -- res->clks[0].id = "iface"; -- res->clks[1].id = "aux"; -- res->clks[2].id = "master_bus"; -- res->clks[3].id = "slave_bus"; -- -- ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); -- if (ret < 0) -- return ret; -+ res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); -+ if (res->num_clks < 0) { -+ dev_err(dev, "Failed to get clocks\n"); -+ return res->num_clks; -+ } - - res->core = devm_reset_control_get_exclusive(dev, "core"); - return PTR_ERR_OR_ZERO(res->core); -@@ -500,7 +484,7 @@ static void qcom_pcie_deinit_1_0_0(struct qcom_pcie *pcie) - struct qcom_pcie_resources_1_0_0 *res = &pcie->res.v1_0_0; - - reset_control_assert(res->core); -- clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); -+ clk_bulk_disable_unprepare(res->num_clks, res->clks); - regulator_disable(res->vdda); - } - -@@ -517,7 +501,7 @@ static int qcom_pcie_init_1_0_0(struct qcom_pcie *pcie) - return ret; - } - -- ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); -+ ret = clk_bulk_prepare_enable(res->num_clks, res->clks); - if (ret) { - dev_err(dev, "cannot prepare/enable clocks\n"); - goto err_assert_reset; -@@ -532,7 +516,7 @@ static int qcom_pcie_init_1_0_0(struct qcom_pcie *pcie) - return 0; - - err_disable_clks: -- clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); -+ clk_bulk_disable_unprepare(res->num_clks, res->clks); - err_assert_reset: - reset_control_assert(res->core); - -@@ -580,14 +564,11 @@ static int qcom_pcie_get_resources_2_3_2(struct qcom_pcie *pcie) - if (ret) - return ret; - -- res->clks[0].id = "aux"; -- res->clks[1].id = "cfg"; -- res->clks[2].id = "bus_master"; -- res->clks[3].id = "bus_slave"; -- -- ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); -- if (ret < 0) -- return ret; -+ res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); -+ if (res->num_clks < 0) { -+ dev_err(dev, "Failed to get clocks\n"); -+ return res->num_clks; -+ } - - return 0; - } -@@ -596,7 +577,7 @@ static void qcom_pcie_deinit_2_3_2(struct qcom_pcie *pcie) - { - struct qcom_pcie_resources_2_3_2 *res = &pcie->res.v2_3_2; - -- clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); -+ clk_bulk_disable_unprepare(res->num_clks, res->clks); - regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); - } - -@@ -613,7 +594,7 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie) - return ret; - } - -- ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); -+ ret = clk_bulk_prepare_enable(res->num_clks, res->clks); - if (ret) { - dev_err(dev, "cannot prepare/enable clocks\n"); - regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); -@@ -661,17 +642,11 @@ static int qcom_pcie_get_resources_2_4_0(struct qcom_pcie *pcie) - bool is_ipq = of_device_is_compatible(dev->of_node, "qcom,pcie-ipq4019"); - int ret; - -- res->clks[0].id = "aux"; -- res->clks[1].id = "master_bus"; -- res->clks[2].id = "slave_bus"; -- res->clks[3].id = "iface"; -- -- /* qcom,pcie-ipq4019 is defined without "iface" */ -- res->num_clks = is_ipq ? 3 : 4; -- -- ret = devm_clk_bulk_get(dev, res->num_clks, res->clks); -- if (ret < 0) -- return ret; -+ res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); -+ if (res->num_clks < 0) { -+ dev_err(dev, "Failed to get clocks\n"); -+ return res->num_clks; -+ } - - res->resets[0].id = "axi_m"; - res->resets[1].id = "axi_s"; -@@ -742,15 +717,11 @@ static int qcom_pcie_get_resources_2_3_3(struct qcom_pcie *pcie) - struct device *dev = pci->dev; - int ret; - -- res->clks[0].id = "iface"; -- res->clks[1].id = "axi_m"; -- res->clks[2].id = "axi_s"; -- res->clks[3].id = "ahb"; -- res->clks[4].id = "aux"; -- -- ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); -- if (ret < 0) -- return ret; -+ res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); -+ if (res->num_clks < 0) { -+ dev_err(dev, "Failed to get clocks\n"); -+ return res->num_clks; -+ } - - res->rst[0].id = "axi_m"; - res->rst[1].id = "axi_s"; -@@ -771,7 +742,7 @@ static void qcom_pcie_deinit_2_3_3(struct qcom_pcie *pcie) - { - struct qcom_pcie_resources_2_3_3 *res = &pcie->res.v2_3_3; - -- clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); -+ clk_bulk_disable_unprepare(res->num_clks, res->clks); - } - - static int qcom_pcie_init_2_3_3(struct qcom_pcie *pcie) -@@ -801,7 +772,7 @@ static int qcom_pcie_init_2_3_3(struct qcom_pcie *pcie) - */ - usleep_range(2000, 2500); - -- ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); -+ ret = clk_bulk_prepare_enable(res->num_clks, res->clks); - if (ret) { - dev_err(dev, "cannot prepare/enable clocks\n"); - goto err_assert_resets; -@@ -862,8 +833,6 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie) - struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0; - struct dw_pcie *pci = pcie->pci; - struct device *dev = pci->dev; -- unsigned int num_clks, num_opt_clks; -- unsigned int idx; - int ret; - - res->rst = devm_reset_control_array_get_exclusive(dev); -@@ -877,36 +846,11 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie) - if (ret) - return ret; - -- idx = 0; -- res->clks[idx++].id = "aux"; -- res->clks[idx++].id = "cfg"; -- res->clks[idx++].id = "bus_master"; -- res->clks[idx++].id = "bus_slave"; -- res->clks[idx++].id = "slave_q2a"; -- -- num_clks = idx; -- -- ret = devm_clk_bulk_get(dev, num_clks, res->clks); -- if (ret < 0) -- return ret; -- -- res->clks[idx++].id = "tbu"; -- res->clks[idx++].id = "ddrss_sf_tbu"; -- res->clks[idx++].id = "aggre0"; -- res->clks[idx++].id = "aggre1"; -- res->clks[idx++].id = "noc_aggr"; -- res->clks[idx++].id = "noc_aggr_4"; -- res->clks[idx++].id = "noc_aggr_south_sf"; -- res->clks[idx++].id = "cnoc_qx"; -- res->clks[idx++].id = "sleep"; -- res->clks[idx++].id = "cnoc_sf_axi"; -- -- num_opt_clks = idx - num_clks; -- res->num_clks = idx; -- -- ret = devm_clk_bulk_get_optional(dev, num_opt_clks, res->clks + num_clks); -- if (ret < 0) -- return ret; -+ res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); -+ if (res->num_clks < 0) { -+ dev_err(dev, "Failed to get clocks\n"); -+ return res->num_clks; -+ } - - return 0; - } -@@ -1101,17 +1045,12 @@ static int qcom_pcie_get_resources_2_9_0(struct qcom_pcie *pcie) - struct qcom_pcie_resources_2_9_0 *res = &pcie->res.v2_9_0; - struct dw_pcie *pci = pcie->pci; - struct device *dev = pci->dev; -- int ret; -- -- res->clks[0].id = "iface"; -- res->clks[1].id = "axi_m"; -- res->clks[2].id = "axi_s"; -- res->clks[3].id = "axi_bridge"; -- res->clks[4].id = "rchng"; - -- ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); -- if (ret < 0) -- return ret; -+ res->num_clks = devm_clk_bulk_get_all(dev, &res->clks); -+ if (res->num_clks < 0) { -+ dev_err(dev, "Failed to get clocks\n"); -+ return res->num_clks; -+ } - - res->rst = devm_reset_control_array_get_exclusive(dev); - if (IS_ERR(res->rst)) -@@ -1124,7 +1063,7 @@ static void qcom_pcie_deinit_2_9_0(struct qcom_pcie *pcie) - { - struct qcom_pcie_resources_2_9_0 *res = &pcie->res.v2_9_0; - -- clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); -+ clk_bulk_disable_unprepare(res->num_clks, res->clks); - } - - static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie) -@@ -1153,7 +1092,7 @@ static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie) - - usleep_range(2000, 2500); - -- return clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); -+ return clk_bulk_prepare_enable(res->num_clks, res->clks); - } - - static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/021-v6.12-PCI-qcom-Disable-mirroring-of-DBI-and-iATU-register-.patch b/lede/target/linux/qualcommbe/patches-6.6/021-v6.12-PCI-qcom-Disable-mirroring-of-DBI-and-iATU-register-.patch deleted file mode 100644 index fce5dfd19f..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/021-v6.12-PCI-qcom-Disable-mirroring-of-DBI-and-iATU-register-.patch +++ /dev/null @@ -1,286 +0,0 @@ -From 10ba0854c5e6165b58e17bda5fb671e729fecf9e Mon Sep 17 00:00:00 2001 -From: Prudhvi Yarlagadda -Date: Wed, 14 Aug 2024 15:03:38 -0700 -Subject: [PATCH] PCI: qcom: Disable mirroring of DBI and iATU register space - in BAR region -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -PARF hardware block which is a wrapper on top of DWC PCIe controller -mirrors the DBI and ATU register space. It uses PARF_SLV_ADDR_SPACE_SIZE -register to get the size of the memory block to be mirrored and uses -PARF_DBI_BASE_ADDR, PARF_ATU_BASE_ADDR registers to determine the base -address of DBI and ATU space inside the memory block that is being -mirrored. - -When a memory region which is located above the SLV_ADDR_SPACE_SIZE -boundary is used for BAR region then there could be an overlap of DBI and -ATU address space that is getting mirrored and the BAR region. This -results in DBI and ATU address space contents getting updated when a PCIe -function driver tries updating the BAR/MMIO memory region. Reference -memory map of the PCIe memory region with DBI and ATU address space -overlapping BAR region is as below. - - |---------------| - | | - | | - ------- --------|---------------| - | | |---------------| - | | | DBI | - | | |---------------|---->DBI_BASE_ADDR - | | | | - | | | | - | PCIe | |---->2*SLV_ADDR_SPACE_SIZE - | BAR/MMIO|---------------| - | Region | ATU | - | | |---------------|---->ATU_BASE_ADDR - | | | | - PCIe | |---------------| - Memory | | DBI | - Region | |---------------|---->DBI_BASE_ADDR - | | | | - | --------| | - | | |---->SLV_ADDR_SPACE_SIZE - | |---------------| - | | ATU | - | |---------------|---->ATU_BASE_ADDR - | | | - | |---------------| - | | DBI | - | |---------------|---->DBI_BASE_ADDR - | | | - | | | - ----------------|---------------| - | | - | | - | | - |---------------| - -Currently memory region beyond the SLV_ADDR_SPACE_SIZE boundary is not -used for BAR region which is why the above mentioned issue is not -encountered. This issue is discovered as part of internal testing when we -tried moving the BAR region beyond the SLV_ADDR_SPACE_SIZE boundary. Hence -we are trying to fix this. - -As PARF hardware block mirrors DBI and ATU register space after every -PARF_SLV_ADDR_SPACE_SIZE (default 0x1000000) boundary multiple, program -maximum possible size to this register by writing 0x80000000 to it(it -considers only powers of 2 as values) to avoid mirroring DBI and ATU to -BAR/MMIO region. Write the physical base address of DBI and ATU register -blocks to PARF_DBI_BASE_ADDR (default 0x0) and PARF_ATU_BASE_ADDR (default -0x1000) respectively to make sure DBI and ATU blocks are at expected -memory locations. - -The register offsets PARF_DBI_BASE_ADDR_V2, PARF_SLV_ADDR_SPACE_SIZE_V2 -and PARF_ATU_BASE_ADDR are applicable for platforms that use Qcom IP -rev 1.9.0, 2.7.0 and 2.9.0. PARF_DBI_BASE_ADDR_V2 and -PARF_SLV_ADDR_SPACE_SIZE_V2 are applicable for Qcom IP rev 2.3.3. -PARF_DBI_BASE_ADDR and PARF_SLV_ADDR_SPACE_SIZE are applicable for Qcom -IP rev 1.0.0, 2.3.2 and 2.4.0. Update init()/post_init() functions of the -respective Qcom IP versions to program applicable PARF_DBI_BASE_ADDR, -PARF_SLV_ADDR_SPACE_SIZE and PARF_ATU_BASE_ADDR register offsets. Update -the SLV_ADDR_SPACE_SZ macro to 0x80000000 to set highest bit in -PARF_SLV_ADDR_SPACE_SIZE register. - -Cache DBI and iATU physical addresses in 'struct dw_pcie' so that -pcie_qcom.c driver can program these addresses in the PARF_DBI_BASE_ADDR -and PARF_ATU_BASE_ADDR registers. - -Suggested-by: Manivannan Sadhasivam -Link: https://lore.kernel.org/linux-pci/20240814220338.1969668-1-quic_pyarlaga@quicinc.com -Signed-off-by: Prudhvi Yarlagadda -Signed-off-by: Krzysztof Wilczyński -Reviewed-by: Manivannan Sadhasivam -Reviewed-by: Mayank Rana ---- - drivers/pci/controller/dwc/pcie-designware.c | 2 + - drivers/pci/controller/dwc/pcie-designware.h | 2 + - drivers/pci/controller/dwc/pcie-qcom.c | 72 ++++++++++++++++---- - 3 files changed, 61 insertions(+), 15 deletions(-) - -diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c -index 1b5aba1f0c92..bc3a5d6b0177 100644 ---- a/drivers/pci/controller/dwc/pcie-designware.c -+++ b/drivers/pci/controller/dwc/pcie-designware.c -@@ -112,6 +112,7 @@ int dw_pcie_get_resources(struct dw_pcie *pci) - pci->dbi_base = devm_pci_remap_cfg_resource(pci->dev, res); - if (IS_ERR(pci->dbi_base)) - return PTR_ERR(pci->dbi_base); -+ pci->dbi_phys_addr = res->start; - } - - /* DBI2 is mainly useful for the endpoint controller */ -@@ -134,6 +135,7 @@ int dw_pcie_get_resources(struct dw_pcie *pci) - pci->atu_base = devm_ioremap_resource(pci->dev, res); - if (IS_ERR(pci->atu_base)) - return PTR_ERR(pci->atu_base); -+ pci->atu_phys_addr = res->start; - } else { - pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET; - } -diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h -index 53c4c8f399c8..e518f81ea80c 100644 ---- a/drivers/pci/controller/dwc/pcie-designware.h -+++ b/drivers/pci/controller/dwc/pcie-designware.h -@@ -407,8 +407,10 @@ struct dw_pcie_ops { - struct dw_pcie { - struct device *dev; - void __iomem *dbi_base; -+ resource_size_t dbi_phys_addr; - void __iomem *dbi_base2; - void __iomem *atu_base; -+ resource_size_t atu_phys_addr; - size_t atu_size; - u32 num_ib_windows; - u32 num_ob_windows; -diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c -index a1d678fe7fa5..1923266acea8 100644 ---- a/drivers/pci/controller/dwc/pcie-qcom.c -+++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -45,6 +45,7 @@ - #define PARF_PHY_REFCLK 0x4c - #define PARF_CONFIG_BITS 0x50 - #define PARF_DBI_BASE_ADDR 0x168 -+#define PARF_SLV_ADDR_SPACE_SIZE 0x16c - #define PARF_MHI_CLOCK_RESET_CTRL 0x174 - #define PARF_AXI_MSTR_WR_ADDR_HALT 0x178 - #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8 -@@ -55,7 +56,12 @@ - #define PARF_LTSSM 0x1b0 - #define PARF_SID_OFFSET 0x234 - #define PARF_BDF_TRANSLATE_CFG 0x24c --#define PARF_SLV_ADDR_SPACE_SIZE 0x358 -+#define PARF_DBI_BASE_ADDR_V2 0x350 -+#define PARF_DBI_BASE_ADDR_V2_HI 0x354 -+#define PARF_SLV_ADDR_SPACE_SIZE_V2 0x358 -+#define PARF_SLV_ADDR_SPACE_SIZE_V2_HI 0x35c -+#define PARF_ATU_BASE_ADDR 0x634 -+#define PARF_ATU_BASE_ADDR_HI 0x638 - #define PARF_DEVICE_TYPE 0x1000 - #define PARF_BDF_TO_SID_TABLE_N 0x2000 - #define PARF_BDF_TO_SID_CFG 0x2c00 -@@ -111,7 +117,7 @@ - #define PHY_RX0_EQ(x) FIELD_PREP(GENMASK(26, 24), x) - - /* PARF_SLV_ADDR_SPACE_SIZE register value */ --#define SLV_ADDR_SPACE_SZ 0x10000000 -+#define SLV_ADDR_SPACE_SZ 0x80000000 - - /* PARF_MHI_CLOCK_RESET_CTRL register fields */ - #define AHB_CLK_EN BIT(0) -@@ -330,6 +336,50 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci) - dw_pcie_dbi_ro_wr_dis(pci); - } - -+static void qcom_pcie_configure_dbi_base(struct qcom_pcie *pcie) -+{ -+ struct dw_pcie *pci = pcie->pci; -+ -+ if (pci->dbi_phys_addr) { -+ /* -+ * PARF_DBI_BASE_ADDR register is in CPU domain and require to -+ * be programmed with CPU physical address. -+ */ -+ writel(lower_32_bits(pci->dbi_phys_addr), pcie->parf + -+ PARF_DBI_BASE_ADDR); -+ writel(SLV_ADDR_SPACE_SZ, pcie->parf + -+ PARF_SLV_ADDR_SPACE_SIZE); -+ } -+} -+ -+static void qcom_pcie_configure_dbi_atu_base(struct qcom_pcie *pcie) -+{ -+ struct dw_pcie *pci = pcie->pci; -+ -+ if (pci->dbi_phys_addr) { -+ /* -+ * PARF_DBI_BASE_ADDR_V2 and PARF_ATU_BASE_ADDR registers are -+ * in CPU domain and require to be programmed with CPU -+ * physical addresses. -+ */ -+ writel(lower_32_bits(pci->dbi_phys_addr), pcie->parf + -+ PARF_DBI_BASE_ADDR_V2); -+ writel(upper_32_bits(pci->dbi_phys_addr), pcie->parf + -+ PARF_DBI_BASE_ADDR_V2_HI); -+ -+ if (pci->atu_phys_addr) { -+ writel(lower_32_bits(pci->atu_phys_addr), pcie->parf + -+ PARF_ATU_BASE_ADDR); -+ writel(upper_32_bits(pci->atu_phys_addr), pcie->parf + -+ PARF_ATU_BASE_ADDR_HI); -+ } -+ -+ writel(0x0, pcie->parf + PARF_SLV_ADDR_SPACE_SIZE_V2); -+ writel(SLV_ADDR_SPACE_SZ, pcie->parf + -+ PARF_SLV_ADDR_SPACE_SIZE_V2_HI); -+ } -+} -+ - static void qcom_pcie_2_1_0_ltssm_enable(struct qcom_pcie *pcie) - { - u32 val; -@@ -546,8 +596,7 @@ static int qcom_pcie_init_1_0_0(struct qcom_pcie *pcie) - - static int qcom_pcie_post_init_1_0_0(struct qcom_pcie *pcie) - { -- /* change DBI base address */ -- writel(0, pcie->parf + PARF_DBI_BASE_ADDR); -+ qcom_pcie_configure_dbi_base(pcie); - - if (IS_ENABLED(CONFIG_PCI_MSI)) { - u32 val = readl(pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT); -@@ -634,8 +683,7 @@ static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie) - val &= ~PHY_TEST_PWR_DOWN; - writel(val, pcie->parf + PARF_PHY_CTRL); - -- /* change DBI base address */ -- writel(0, pcie->parf + PARF_DBI_BASE_ADDR); -+ qcom_pcie_configure_dbi_base(pcie); - - /* MAC PHY_POWERDOWN MUX DISABLE */ - val = readl(pcie->parf + PARF_SYS_CTRL); -@@ -817,13 +865,11 @@ static int qcom_pcie_post_init_2_3_3(struct qcom_pcie *pcie) - u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); - u32 val; - -- writel(SLV_ADDR_SPACE_SZ, pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); -- - val = readl(pcie->parf + PARF_PHY_CTRL); - val &= ~PHY_TEST_PWR_DOWN; - writel(val, pcie->parf + PARF_PHY_CTRL); - -- writel(0, pcie->parf + PARF_DBI_BASE_ADDR); -+ qcom_pcie_configure_dbi_atu_base(pcie); - - writel(MST_WAKEUP_EN | SLV_WAKEUP_EN | MSTR_ACLK_CGC_DIS - | SLV_ACLK_CGC_DIS | CORE_CLK_CGC_DIS | -@@ -919,8 +965,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie) - val &= ~PHY_TEST_PWR_DOWN; - writel(val, pcie->parf + PARF_PHY_CTRL); - -- /* change DBI base address */ -- writel(0, pcie->parf + PARF_DBI_BASE_ADDR); -+ qcom_pcie_configure_dbi_atu_base(pcie); - - /* MAC PHY_POWERDOWN MUX DISABLE */ - val = readl(pcie->parf + PARF_SYS_CTRL); -@@ -1129,14 +1174,11 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) - u32 val; - int i; - -- writel(SLV_ADDR_SPACE_SZ, -- pcie->parf + PARF_SLV_ADDR_SPACE_SIZE); -- - val = readl(pcie->parf + PARF_PHY_CTRL); - val &= ~PHY_TEST_PWR_DOWN; - writel(val, pcie->parf + PARF_PHY_CTRL); - -- writel(0, pcie->parf + PARF_DBI_BASE_ADDR); -+ qcom_pcie_configure_dbi_atu_base(pcie); - - writel(DEVICE_TYPE_RC, pcie->parf + PARF_DEVICE_TYPE); - writel(BYPASS | MSTR_AXI_CLK_EN | AHB_CLK_EN, --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/022-01-v6.11-phy-qcom-qmp-Add-missing-offsets-for-Qserdes-PLL-reg.patch b/lede/target/linux/qualcommbe/patches-6.6/022-01-v6.11-phy-qcom-qmp-Add-missing-offsets-for-Qserdes-PLL-reg.patch deleted file mode 100644 index ee0aec6c92..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/022-01-v6.11-phy-qcom-qmp-Add-missing-offsets-for-Qserdes-PLL-reg.patch +++ /dev/null @@ -1,33 +0,0 @@ -From f1aaa788b997ba8a7810da0696e89fd3f79ecce3 Mon Sep 17 00:00:00 2001 -From: devi priya -Date: Thu, 16 May 2024 08:54:34 +0530 -Subject: [PATCH 1/3] phy: qcom-qmp: Add missing offsets for Qserdes PLL - registers. - -Add missing register offsets for Qserdes PLL. - -Reviewed-by: Abel Vesa -Signed-off-by: devi priya -Link: https://lore.kernel.org/r/20240516032436.2681828-3-quic_devipriy@quicinc.com -Signed-off-by: Vinod Koul ---- - drivers/phy/qualcomm/phy-qcom-qmp-qserdes-pll.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-pll.h b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-pll.h -index ad326e301a3a..231e59364e31 100644 ---- a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-pll.h -+++ b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-pll.h -@@ -8,6 +8,9 @@ - - /* QMP V2 PHY for PCIE gen3 ports - QSERDES PLL registers */ - #define QSERDES_PLL_BG_TIMER 0x00c -+#define QSERDES_PLL_SSC_EN_CENTER 0x010 -+#define QSERDES_PLL_SSC_ADJ_PER1 0x014 -+#define QSERDES_PLL_SSC_ADJ_PER2 0x018 - #define QSERDES_PLL_SSC_PER1 0x01c - #define QSERDES_PLL_SSC_PER2 0x020 - #define QSERDES_PLL_SSC_STEP_SIZE1_MODE0 0x024 --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/022-02-v6.11-phy-qcom-qmp-Add-missing-register-definitions-for-PC.patch b/lede/target/linux/qualcommbe/patches-6.6/022-02-v6.11-phy-qcom-qmp-Add-missing-register-definitions-for-PC.patch deleted file mode 100644 index dde0590be9..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/022-02-v6.11-phy-qcom-qmp-Add-missing-register-definitions-for-PC.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 71ae2acf1d7542ecd21c6933cae8fe65d550074b Mon Sep 17 00:00:00 2001 -From: devi priya -Date: Thu, 16 May 2024 08:54:35 +0530 -Subject: [PATCH 2/3] phy: qcom-qmp: Add missing register definitions for PCS - V5 - -Add missing register offsets for PCS V5 registers. - -Reviewed-by: Abel Vesa -Signed-off-by: devi priya -Link: https://lore.kernel.org/r/20240516032436.2681828-4-quic_devipriy@quicinc.com -Signed-off-by: Vinod Koul ---- - drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h -index a469ae2a10a1..fa15a03055de 100644 ---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h -+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h -@@ -11,8 +11,22 @@ - #define QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG2 0x0c - #define QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG4 0x14 - #define QPHY_V5_PCS_PCIE_ENDPOINT_REFCLK_DRIVE 0x20 -+#define QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L 0x44 -+#define QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H 0x48 -+#define QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L 0x4c -+#define QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H 0x50 - #define QPHY_V5_PCS_PCIE_INT_AUX_CLK_CONFIG1 0x54 -+#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG1 0x5c -+#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG2 0x60 -+#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG4 0x68 -+#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2 0x7c -+#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4 0x84 -+#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5 0x88 -+#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6 0x8c - #define QPHY_V5_PCS_PCIE_OSC_DTCT_ACTIONS 0x94 -+#define QPHY_V5_PCS_PCIE_EQ_CONFIG1 0xa4 - #define QPHY_V5_PCS_PCIE_EQ_CONFIG2 0xa8 -+#define QPHY_V5_PCS_PCIE_PRESET_P10_PRE 0xc0 -+#define QPHY_V5_PCS_PCIE_PRESET_P10_POST 0xe4 - - #endif --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/022-03-v6.11-phy-qcom-qmp-pcie-Add-support-for-IPQ9574-g3x1-and-g.patch b/lede/target/linux/qualcommbe/patches-6.6/022-03-v6.11-phy-qcom-qmp-pcie-Add-support-for-IPQ9574-g3x1-and-g.patch deleted file mode 100644 index 142466edea..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/022-03-v6.11-phy-qcom-qmp-pcie-Add-support-for-IPQ9574-g3x1-and-g.patch +++ /dev/null @@ -1,363 +0,0 @@ -From 2f2f5c13cc5ea87f1dd2debfd06fe5f624e5c0fd Mon Sep 17 00:00:00 2001 -From: devi priya -Date: Thu, 16 May 2024 08:54:36 +0530 -Subject: [PATCH 3/3] phy: qcom-qmp-pcie: Add support for IPQ9574 g3x1 and g3x2 - PCIEs - -Add support for a single-lane and two-lane PCIe PHYs -found on Qualcomm IPQ9574 platform. - -Reviewed-by: Abel Vesa -Co-developed-by: Anusha Rao -Signed-off-by: Anusha Rao -Signed-off-by: devi priya -Link: https://lore.kernel.org/r/20240516032436.2681828-5-quic_devipriy@quicinc.com -Signed-off-by: Vinod Koul ---- - drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 309 +++++++++++++++++++++++ - 1 file changed, 309 insertions(+) - -diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c -index 6c796723c8f5..8cb91b9114d6 100644 ---- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c -+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c -@@ -489,6 +489,243 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_gen3_pcs_misc_tbl[] = { - QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_ENDPOINT_REFCLK_DRIVE, 0xc1), - }; - -+static const struct qmp_phy_init_tbl ipq9574_gen3x1_pcie_serdes_tbl[] = { -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BIAS_EN_CLKBUFLR_EN, 0x18), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BIAS_EN_CTRL_BY_PSM, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_SELECT, 0x31), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_IVCO, 0x0f), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BG_TRIM, 0x0f), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CMN_CONFIG, 0x06), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP_EN, 0x42), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_RESETSM_CNTRL, 0x20), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_MAP, 0x04), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_TIMER1, 0xff), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_TIMER2, 0x3f), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x30), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x21), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DEC_START_MODE0, 0x68), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START3_MODE0, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START2_MODE0, 0xaa), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START1_MODE0, 0xab), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP2_MODE0, 0x14), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP1_MODE0, 0xd4), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CP_CTRL_MODE0, 0x09), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_RCTRL_MODE0, 0x16), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_CCTRL_MODE0, 0x28), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN1_MODE0, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN0_MODE0, 0xa0), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE2_MODE0, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE1_MODE0, 0x24), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x20), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORECLK_DIV, 0x0a), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_SELECT, 0x32), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SYS_CLK_CTRL, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SYSCLK_BUF_ENABLE, 0x07), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SYSCLK_EN_SEL, 0x08), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BG_TIMER, 0x0a), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DEC_START_MODE1, 0x53), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START3_MODE1, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START2_MODE1, 0x55), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START1_MODE1, 0x55), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP2_MODE1, 0x29), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP1_MODE1, 0xaa), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CP_CTRL_MODE1, 0x09), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_RCTRL_MODE1, 0x16), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_CCTRL_MODE1, 0x28), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN1_MODE1, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN0_MODE1, 0xa0), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE2_MODE1, 0x03), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE1_MODE1, 0xb4), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORECLK_DIV_MODE1, 0x08), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_EN_CENTER, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_PER1, 0x7d), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_PER2, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_ADJ_PER1, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_ADJ_PER2, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE1_MODE0, 0x0a), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE2_MODE0, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE1_MODE1, 0x08), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE2_MODE1, 0x04), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_EP_DIV_MODE0, 0x19), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_EP_DIV_MODE1, 0x28), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_ENABLE1, 0x90), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x89), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_ENABLE1, 0x10), -+}; -+ -+static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_serdes_tbl[] = { -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BIAS_EN_CLKBUFLR_EN, 0x18), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BIAS_EN_CTRL_BY_PSM, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_SELECT, 0x31), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_IVCO, 0x0f), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BG_TRIM, 0x0f), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CMN_CONFIG, 0x06), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP_EN, 0x42), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_RESETSM_CNTRL, 0x20), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_MAP, 0x04), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_TIMER1, 0xff), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_TIMER2, 0x3f), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x30), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x21), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DEC_START_MODE0, 0x68), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START3_MODE0, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START2_MODE0, 0xaa), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START1_MODE0, 0xab), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP2_MODE0, 0x14), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP1_MODE0, 0xd4), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CP_CTRL_MODE0, 0x09), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_RCTRL_MODE0, 0x16), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_CCTRL_MODE0, 0x28), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN1_MODE0, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN0_MODE0, 0xa0), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE2_MODE0, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE1_MODE0, 0x24), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORECLK_DIV, 0x0a), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_SELECT, 0x32), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SYS_CLK_CTRL, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SYSCLK_BUF_ENABLE, 0x07), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SYSCLK_EN_SEL, 0x08), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_BG_TIMER, 0x0a), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DEC_START_MODE1, 0x53), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START3_MODE1, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START2_MODE1, 0x55), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START1_MODE1, 0x55), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP2_MODE1, 0x29), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP1_MODE1, 0xaa), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CP_CTRL_MODE1, 0x09), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_RCTRL_MODE1, 0x16), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_CCTRL_MODE1, 0x28), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN1_MODE1, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN0_MODE1, 0xa0), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE2_MODE1, 0x03), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE1_MODE1, 0xb4), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CORECLK_DIV_MODE1, 0x08), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_EN_CENTER, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_PER1, 0x7d), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_PER2, 0x01), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_ADJ_PER1, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_ADJ_PER2, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE1_MODE0, 0x0a), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE2_MODE0, 0x05), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE1_MODE1, 0x08), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE2_MODE1, 0x04), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_EP_DIV_MODE0, 0x19), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_EP_DIV_MODE1, 0x28), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_ENABLE1, 0x90), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x89), -+ QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_ENABLE1, 0x10), -+}; -+ -+static const struct qmp_phy_init_tbl ipq9574_pcie_rx_tbl[] = { -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_CNTRL, 0x03), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_ENABLES, 0x1c), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_DEGLITCH_CNTRL, 0x14), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL2, 0x61), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL3, 0x04), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL4, 0x1e), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_DFE_EN_TIMER, 0x04), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FO_GAIN, 0x0c), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_GAIN, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x7f), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CONTROLS, 0x70), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL1, 0x73), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL2, 0x80), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_LOW, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH2, 0xc8), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH3, 0x09), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH4, 0xb1), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_LOW, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH2, 0xc8), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH3, 0x09), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH4, 0xb1), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_LOW, 0xf0), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH, 0x02), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH2, 0x2f), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH3, 0xd3), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH4, 0x40), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH, 0x00), -+ QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW, 0xc0), -+}; -+ -+static const struct qmp_phy_init_tbl ipq9574_gen3x1_pcie_pcs_tbl[] = { -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_RX_DCC_CAL_CONFIG, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_RX_SIGDET_LVL, 0xaa), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_REFGEN_REQ_CONFIG1, 0x0d), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_G12S1_TXDEEMPH_M3P5DB, 0x10), -+}; -+ -+static const struct qmp_phy_init_tbl ipq9574_gen3x1_pcie_pcs_misc_tbl[] = { -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_OSC_DTCT_ACTIONS, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_POWER_STATE_CONFIG2, 0x0d), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_EQ_CONFIG1, 0x14), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_EQ_CONFIG1, 0x10), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_EQ_CONFIG2, 0x0b), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_PRESET_P10_PRE, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_PRESET_P10_POST, 0x58), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_POWER_STATE_CONFIG4, 0x07), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_OSC_DTCT_CONFIG2, 0x52), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_INT_AUX_CLK_CONFIG1, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2, 0x50), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4, 0x1a), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5, 0x06), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6, 0x03), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_ENDPOINT_REFCLK_DRIVE, 0xc1), -+}; -+ -+static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_pcs_tbl[] = { -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_REFGEN_REQ_CONFIG1, 0x0d), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_G12S1_TXDEEMPH_M3P5DB, 0x10), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_RX_DCC_CAL_CONFIG, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V4_PCS_RX_SIGDET_LVL, 0xaa), -+}; -+ -+static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_pcs_misc_tbl[] = { -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_ACTIONS, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG2, 0x1d), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_EQ_CONFIG1, 0x14), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_EQ_CONFIG1, 0x10), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_EQ_CONFIG2, 0x0b), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_PRESET_P10_PRE, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_PRESET_P10_POST, 0x58), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG4, 0x07), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG1, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG2, 0x52), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG4, 0x19), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_INT_AUX_CLK_CONFIG1, 0x00), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2, 0x49), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4, 0x2a), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5, 0x02), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6, 0x03), -+ QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_ENDPOINT_REFCLK_DRIVE, 0xc1), -+}; -+ - static const struct qmp_phy_init_tbl sdm845_qmp_pcie_serdes_tbl[] = { - QMP_PHY_INIT_CFG(QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN, 0x14), - QMP_PHY_INIT_CFG(QSERDES_V3_COM_CLK_SELECT, 0x30), -@@ -2535,6 +2772,16 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v5 = { - .rx2 = 0x1800, - }; - -+static const struct qmp_pcie_offsets qmp_pcie_offsets_ipq9574 = { -+ .serdes = 0, -+ .pcs = 0x1000, -+ .pcs_misc = 0x1400, -+ .tx = 0x0200, -+ .rx = 0x0400, -+ .tx2 = 0x0600, -+ .rx2 = 0x0800, -+}; -+ - static const struct qmp_pcie_offsets qmp_pcie_offsets_v5_20 = { - .serdes = 0x1000, - .pcs = 0x1200, -@@ -2647,6 +2894,62 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { - .phy_status = PHYSTATUS, - }; - -+static const struct qmp_phy_cfg ipq9574_gen3x1_pciephy_cfg = { -+ .lanes = 1, -+ -+ .offsets = &qmp_pcie_offsets_v4x1, -+ -+ .tbls = { -+ .serdes = ipq9574_gen3x1_pcie_serdes_tbl, -+ .serdes_num = ARRAY_SIZE(ipq9574_gen3x1_pcie_serdes_tbl), -+ .tx = ipq8074_pcie_gen3_tx_tbl, -+ .tx_num = ARRAY_SIZE(ipq8074_pcie_gen3_tx_tbl), -+ .rx = ipq9574_pcie_rx_tbl, -+ .rx_num = ARRAY_SIZE(ipq9574_pcie_rx_tbl), -+ .pcs = ipq9574_gen3x1_pcie_pcs_tbl, -+ .pcs_num = ARRAY_SIZE(ipq9574_gen3x1_pcie_pcs_tbl), -+ .pcs_misc = ipq9574_gen3x1_pcie_pcs_misc_tbl, -+ .pcs_misc_num = ARRAY_SIZE(ipq9574_gen3x1_pcie_pcs_misc_tbl), -+ }, -+ .reset_list = ipq8074_pciephy_reset_l, -+ .num_resets = ARRAY_SIZE(ipq8074_pciephy_reset_l), -+ .vreg_list = NULL, -+ .num_vregs = 0, -+ .regs = pciephy_v4_regs_layout, -+ -+ .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, -+ .phy_status = PHYSTATUS, -+ .pipe_clock_rate = 250000000, -+}; -+ -+static const struct qmp_phy_cfg ipq9574_gen3x2_pciephy_cfg = { -+ .lanes = 2, -+ -+ .offsets = &qmp_pcie_offsets_ipq9574, -+ -+ .tbls = { -+ .serdes = ipq9574_gen3x2_pcie_serdes_tbl, -+ .serdes_num = ARRAY_SIZE(ipq9574_gen3x2_pcie_serdes_tbl), -+ .tx = ipq8074_pcie_gen3_tx_tbl, -+ .tx_num = ARRAY_SIZE(ipq8074_pcie_gen3_tx_tbl), -+ .rx = ipq9574_pcie_rx_tbl, -+ .rx_num = ARRAY_SIZE(ipq9574_pcie_rx_tbl), -+ .pcs = ipq9574_gen3x2_pcie_pcs_tbl, -+ .pcs_num = ARRAY_SIZE(ipq9574_gen3x2_pcie_pcs_tbl), -+ .pcs_misc = ipq9574_gen3x2_pcie_pcs_misc_tbl, -+ .pcs_misc_num = ARRAY_SIZE(ipq9574_gen3x2_pcie_pcs_misc_tbl), -+ }, -+ .reset_list = ipq8074_pciephy_reset_l, -+ .num_resets = ARRAY_SIZE(ipq8074_pciephy_reset_l), -+ .vreg_list = NULL, -+ .num_vregs = 0, -+ .regs = pciephy_v5_regs_layout, -+ -+ .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, -+ .phy_status = PHYSTATUS, -+ .pipe_clock_rate = 250000000, -+}; -+ - static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { - .lanes = 1, - -@@ -4030,6 +4333,12 @@ static const struct of_device_id qmp_pcie_of_match_table[] = { - }, { - .compatible = "qcom,ipq8074-qmp-pcie-phy", - .data = &ipq8074_pciephy_cfg, -+ }, { -+ .compatible = "qcom,ipq9574-qmp-gen3x1-pcie-phy", -+ .data = &ipq9574_gen3x1_pciephy_cfg, -+ }, { -+ .compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy", -+ .data = &ipq9574_gen3x2_pciephy_cfg, - }, { - .compatible = "qcom,msm8998-qmp-pcie-phy", - .data = &msm8998_pciephy_cfg, --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/023-01-v6.14-arm64-dts-qcom-ipq9574-Add-PCIe-PHYs-and-controller-.patch b/lede/target/linux/qualcommbe/patches-6.6/023-01-v6.14-arm64-dts-qcom-ipq9574-Add-PCIe-PHYs-and-controller-.patch deleted file mode 100644 index cd688e9c46..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/023-01-v6.14-arm64-dts-qcom-ipq9574-Add-PCIe-PHYs-and-controller-.patch +++ /dev/null @@ -1,473 +0,0 @@ -From d80c7fbfa908e3d893a1ea7fe178dfa82ed66bf1 Mon Sep 17 00:00:00 2001 -From: devi priya -Date: Thu, 1 Aug 2024 11:18:01 +0530 -Subject: [PATCH 1/2] arm64: dts: qcom: ipq9574: Add PCIe PHYs and controller - nodes - -Add PCIe0, PCIe1, PCIe2, PCIe3 (and corresponding PHY) devices -found on IPQ9574 platform. The PCIe0 & PCIe1 are 1-lane Gen3 -host whereas PCIe2 & PCIe3 are 2-lane Gen3 host. - -Signed-off-by: devi priya -Signed-off-by: Sricharan Ramabadhran -Link: https://lore.kernel.org/r/20240801054803.3015572-3-quic_srichara@quicinc.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq9574.dtsi | 420 +++++++++++++++++++++++++- - 1 file changed, 416 insertions(+), 4 deletions(-) - -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index d1fd35ebc4a2..00ee3290c181 100644 ---- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -226,6 +226,52 @@ rpm_msg_ram: sram@60000 { - reg = <0x00060000 0x6000>; - }; - -+ pcie0_phy: phy@84000 { -+ compatible = "qcom,ipq9574-qmp-gen3x1-pcie-phy"; -+ reg = <0x00084000 0x1000>; -+ -+ clocks = <&gcc GCC_PCIE0_AUX_CLK>, -+ <&gcc GCC_PCIE0_AHB_CLK>, -+ <&gcc GCC_PCIE0_PIPE_CLK>; -+ clock-names = "aux", "cfg_ahb", "pipe"; -+ -+ assigned-clocks = <&gcc GCC_PCIE0_AUX_CLK>; -+ assigned-clock-rates = <20000000>; -+ -+ resets = <&gcc GCC_PCIE0_PHY_BCR>, -+ <&gcc GCC_PCIE0PHY_PHY_BCR>; -+ reset-names = "phy", "common"; -+ -+ #clock-cells = <0>; -+ clock-output-names = "gcc_pcie0_pipe_clk_src"; -+ -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ -+ pcie2_phy: phy@8c000 { -+ compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy"; -+ reg = <0x0008c000 0x2000>; -+ -+ clocks = <&gcc GCC_PCIE2_AUX_CLK>, -+ <&gcc GCC_PCIE2_AHB_CLK>, -+ <&gcc GCC_PCIE2_PIPE_CLK>; -+ clock-names = "aux", "cfg_ahb", "pipe"; -+ -+ assigned-clocks = <&gcc GCC_PCIE2_AUX_CLK>; -+ assigned-clock-rates = <20000000>; -+ -+ resets = <&gcc GCC_PCIE2_PHY_BCR>, -+ <&gcc GCC_PCIE2PHY_PHY_BCR>; -+ reset-names = "phy", "common"; -+ -+ #clock-cells = <0>; -+ clock-output-names = "gcc_pcie2_pipe_clk_src"; -+ -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ - rng: rng@e3000 { - compatible = "qcom,prng-ee"; - reg = <0x000e3000 0x1000>; -@@ -243,6 +289,52 @@ mdio: mdio@90000 { - status = "disabled"; - }; - -+ pcie3_phy: phy@f4000 { -+ compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy"; -+ reg = <0x000f4000 0x2000>; -+ -+ clocks = <&gcc GCC_PCIE3_AUX_CLK>, -+ <&gcc GCC_PCIE3_AHB_CLK>, -+ <&gcc GCC_PCIE3_PIPE_CLK>; -+ clock-names = "aux", "cfg_ahb", "pipe"; -+ -+ assigned-clocks = <&gcc GCC_PCIE3_AUX_CLK>; -+ assigned-clock-rates = <20000000>; -+ -+ resets = <&gcc GCC_PCIE3_PHY_BCR>, -+ <&gcc GCC_PCIE3PHY_PHY_BCR>; -+ reset-names = "phy", "common"; -+ -+ #clock-cells = <0>; -+ clock-output-names = "gcc_pcie3_pipe_clk_src"; -+ -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ -+ pcie1_phy: phy@fc000 { -+ compatible = "qcom,ipq9574-qmp-gen3x1-pcie-phy"; -+ reg = <0x000fc000 0x1000>; -+ -+ clocks = <&gcc GCC_PCIE1_AUX_CLK>, -+ <&gcc GCC_PCIE1_AHB_CLK>, -+ <&gcc GCC_PCIE1_PIPE_CLK>; -+ clock-names = "aux", "cfg_ahb", "pipe"; -+ -+ assigned-clocks = <&gcc GCC_PCIE1_AUX_CLK>; -+ assigned-clock-rates = <20000000>; -+ -+ resets = <&gcc GCC_PCIE1_PHY_BCR>, -+ <&gcc GCC_PCIE1PHY_PHY_BCR>; -+ reset-names = "phy", "common"; -+ -+ #clock-cells = <0>; -+ clock-output-names = "gcc_pcie1_pipe_clk_src"; -+ -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ - qfprom: efuse@a4000 { - compatible = "qcom,ipq9574-qfprom", "qcom,qfprom"; - reg = <0x000a4000 0x5a1>; -@@ -309,10 +401,10 @@ gcc: clock-controller@1800000 { - clocks = <&xo_board_clk>, - <&sleep_clk>, - <0>, -- <0>, -- <0>, -- <0>, -- <0>, -+ <&pcie0_phy>, -+ <&pcie1_phy>, -+ <&pcie2_phy>, -+ <&pcie3_phy>, - <0>; - #clock-cells = <1>; - #reset-cells = <1>; -@@ -756,6 +848,326 @@ frame@b128000 { - status = "disabled"; - }; - }; -+ -+ pcie1: pcie@10000000 { -+ compatible = "qcom,pcie-ipq9574"; -+ reg = <0x10000000 0xf1d>, -+ <0x10000f20 0xa8>, -+ <0x10001000 0x1000>, -+ <0x000f8000 0x4000>, -+ <0x10100000 0x1000>; -+ reg-names = "dbi", "elbi", "atu", "parf", "config"; -+ device_type = "pci"; -+ linux,pci-domain = <1>; -+ bus-range = <0x00 0xff>; -+ num-lanes = <1>; -+ #address-cells = <3>; -+ #size-cells = <2>; -+ -+ ranges = <0x01000000 0x0 0x00000000 0x10200000 0x0 0x100000>, -+ <0x02000000 0x0 0x10300000 0x10300000 0x0 0x7d00000>; -+ -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ interrupt-names = "msi0", -+ "msi1", -+ "msi2", -+ "msi3", -+ "msi4", -+ "msi5", -+ "msi6", -+ "msi7"; -+ -+ #interrupt-cells = <1>; -+ interrupt-map-mask = <0 0 0 0x7>; -+ interrupt-map = <0 0 0 1 &intc 0 0 35 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 2 &intc 0 0 49 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 3 &intc 0 0 84 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 4 &intc 0 0 85 IRQ_TYPE_LEVEL_HIGH>; -+ -+ clocks = <&gcc GCC_PCIE1_AXI_M_CLK>, -+ <&gcc GCC_PCIE1_AXI_S_CLK>, -+ <&gcc GCC_PCIE1_AXI_S_BRIDGE_CLK>, -+ <&gcc GCC_PCIE1_RCHNG_CLK>, -+ <&gcc GCC_PCIE1_AHB_CLK>, -+ <&gcc GCC_PCIE1_AUX_CLK>; -+ clock-names = "axi_m", -+ "axi_s", -+ "axi_bridge", -+ "rchng", -+ "ahb", -+ "aux"; -+ -+ resets = <&gcc GCC_PCIE1_PIPE_ARES>, -+ <&gcc GCC_PCIE1_CORE_STICKY_ARES>, -+ <&gcc GCC_PCIE1_AXI_S_STICKY_ARES>, -+ <&gcc GCC_PCIE1_AXI_S_ARES>, -+ <&gcc GCC_PCIE1_AXI_M_STICKY_ARES>, -+ <&gcc GCC_PCIE1_AXI_M_ARES>, -+ <&gcc GCC_PCIE1_AUX_ARES>, -+ <&gcc GCC_PCIE1_AHB_ARES>; -+ reset-names = "pipe", -+ "sticky", -+ "axi_s_sticky", -+ "axi_s", -+ "axi_m_sticky", -+ "axi_m", -+ "aux", -+ "ahb"; -+ -+ phys = <&pcie1_phy>; -+ phy-names = "pciephy"; -+ interconnects = <&gcc MASTER_ANOC_PCIE1 &gcc SLAVE_ANOC_PCIE1>, -+ <&gcc MASTER_SNOC_PCIE1 &gcc SLAVE_SNOC_PCIE1>; -+ interconnect-names = "pcie-mem", "cpu-pcie"; -+ status = "disabled"; -+ }; -+ -+ pcie3: pcie@18000000 { -+ compatible = "qcom,pcie-ipq9574"; -+ reg = <0x18000000 0xf1d>, -+ <0x18000f20 0xa8>, -+ <0x18001000 0x1000>, -+ <0x000f0000 0x4000>, -+ <0x18100000 0x1000>; -+ reg-names = "dbi", "elbi", "atu", "parf", "config"; -+ device_type = "pci"; -+ linux,pci-domain = <3>; -+ bus-range = <0x00 0xff>; -+ num-lanes = <2>; -+ #address-cells = <3>; -+ #size-cells = <2>; -+ -+ ranges = <0x01000000 0x0 0x00000000 0x18200000 0x0 0x100000>, -+ <0x02000000 0x0 0x18300000 0x18300000 0x0 0x7d00000>; -+ -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ interrupt-names = "msi0", -+ "msi1", -+ "msi2", -+ "msi3", -+ "msi4", -+ "msi5", -+ "msi6", -+ "msi7"; -+ -+ #interrupt-cells = <1>; -+ interrupt-map-mask = <0 0 0 0x7>; -+ interrupt-map = <0 0 0 1 &intc 0 0 189 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 2 &intc 0 0 190 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 3 &intc 0 0 191 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 4 &intc 0 0 192 IRQ_TYPE_LEVEL_HIGH>; -+ -+ clocks = <&gcc GCC_PCIE3_AXI_M_CLK>, -+ <&gcc GCC_PCIE3_AXI_S_CLK>, -+ <&gcc GCC_PCIE3_AXI_S_BRIDGE_CLK>, -+ <&gcc GCC_PCIE3_RCHNG_CLK>, -+ <&gcc GCC_PCIE3_AHB_CLK>, -+ <&gcc GCC_PCIE3_AUX_CLK>; -+ clock-names = "axi_m", -+ "axi_s", -+ "axi_bridge", -+ "rchng", -+ "ahb", -+ "aux"; -+ -+ resets = <&gcc GCC_PCIE3_PIPE_ARES>, -+ <&gcc GCC_PCIE3_CORE_STICKY_ARES>, -+ <&gcc GCC_PCIE3_AXI_S_STICKY_ARES>, -+ <&gcc GCC_PCIE3_AXI_S_ARES>, -+ <&gcc GCC_PCIE3_AXI_M_STICKY_ARES>, -+ <&gcc GCC_PCIE3_AXI_M_ARES>, -+ <&gcc GCC_PCIE3_AUX_ARES>, -+ <&gcc GCC_PCIE3_AHB_ARES>; -+ reset-names = "pipe", -+ "sticky", -+ "axi_s_sticky", -+ "axi_s", -+ "axi_m_sticky", -+ "axi_m", -+ "aux", -+ "ahb"; -+ -+ phys = <&pcie3_phy>; -+ phy-names = "pciephy"; -+ interconnects = <&gcc MASTER_ANOC_PCIE3 &gcc SLAVE_ANOC_PCIE3>, -+ <&gcc MASTER_SNOC_PCIE3 &gcc SLAVE_SNOC_PCIE3>; -+ interconnect-names = "pcie-mem", "cpu-pcie"; -+ status = "disabled"; -+ }; -+ -+ pcie2: pcie@20000000 { -+ compatible = "qcom,pcie-ipq9574"; -+ reg = <0x20000000 0xf1d>, -+ <0x20000f20 0xa8>, -+ <0x20001000 0x1000>, -+ <0x00088000 0x4000>, -+ <0x20100000 0x1000>; -+ reg-names = "dbi", "elbi", "atu", "parf", "config"; -+ device_type = "pci"; -+ linux,pci-domain = <2>; -+ bus-range = <0x00 0xff>; -+ num-lanes = <2>; -+ #address-cells = <3>; -+ #size-cells = <2>; -+ -+ ranges = <0x01000000 0x0 0x00000000 0x20200000 0x0 0x100000>, -+ <0x02000000 0x0 0x20300000 0x20300000 0x0 0x7d00000>; -+ -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ interrupt-names = "msi0", -+ "msi1", -+ "msi2", -+ "msi3", -+ "msi4", -+ "msi5", -+ "msi6", -+ "msi7"; -+ -+ #interrupt-cells = <1>; -+ interrupt-map-mask = <0 0 0 0x7>; -+ interrupt-map = <0 0 0 1 &intc 0 0 164 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 2 &intc 0 0 165 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 3 &intc 0 0 186 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 4 &intc 0 0 187 IRQ_TYPE_LEVEL_HIGH>; -+ -+ clocks = <&gcc GCC_PCIE2_AXI_M_CLK>, -+ <&gcc GCC_PCIE2_AXI_S_CLK>, -+ <&gcc GCC_PCIE2_AXI_S_BRIDGE_CLK>, -+ <&gcc GCC_PCIE2_RCHNG_CLK>, -+ <&gcc GCC_PCIE2_AHB_CLK>, -+ <&gcc GCC_PCIE2_AUX_CLK>; -+ clock-names = "axi_m", -+ "axi_s", -+ "axi_bridge", -+ "rchng", -+ "ahb", -+ "aux"; -+ -+ resets = <&gcc GCC_PCIE2_PIPE_ARES>, -+ <&gcc GCC_PCIE2_CORE_STICKY_ARES>, -+ <&gcc GCC_PCIE2_AXI_S_STICKY_ARES>, -+ <&gcc GCC_PCIE2_AXI_S_ARES>, -+ <&gcc GCC_PCIE2_AXI_M_STICKY_ARES>, -+ <&gcc GCC_PCIE2_AXI_M_ARES>, -+ <&gcc GCC_PCIE2_AUX_ARES>, -+ <&gcc GCC_PCIE2_AHB_ARES>; -+ reset-names = "pipe", -+ "sticky", -+ "axi_s_sticky", -+ "axi_s", -+ "axi_m_sticky", -+ "axi_m", -+ "aux", -+ "ahb"; -+ -+ phys = <&pcie2_phy>; -+ phy-names = "pciephy"; -+ interconnects = <&gcc MASTER_ANOC_PCIE2 &gcc SLAVE_ANOC_PCIE2>, -+ <&gcc MASTER_SNOC_PCIE2 &gcc SLAVE_SNOC_PCIE2>; -+ interconnect-names = "pcie-mem", "cpu-pcie"; -+ status = "disabled"; -+ }; -+ -+ pcie0: pci@28000000 { -+ compatible = "qcom,pcie-ipq9574"; -+ reg = <0x28000000 0xf1d>, -+ <0x28000f20 0xa8>, -+ <0x28001000 0x1000>, -+ <0x00080000 0x4000>, -+ <0x28100000 0x1000>; -+ reg-names = "dbi", "elbi", "atu", "parf", "config"; -+ device_type = "pci"; -+ linux,pci-domain = <0>; -+ bus-range = <0x00 0xff>; -+ num-lanes = <1>; -+ #address-cells = <3>; -+ #size-cells = <2>; -+ -+ ranges = <0x01000000 0x0 0x00000000 0x28200000 0x0 0x100000>, -+ <0x02000000 0x0 0x28300000 0x28300000 0x0 0x7d00000>; -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ interrupt-names = "msi0", -+ "msi1", -+ "msi2", -+ "msi3", -+ "msi4", -+ "msi5", -+ "msi6", -+ "msi7"; -+ -+ #interrupt-cells = <1>; -+ interrupt-map-mask = <0 0 0 0x7>; -+ interrupt-map = <0 0 0 1 &intc 0 0 75 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 2 &intc 0 0 78 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 3 &intc 0 0 79 IRQ_TYPE_LEVEL_HIGH>, -+ <0 0 0 4 &intc 0 0 83 IRQ_TYPE_LEVEL_HIGH>; -+ -+ clocks = <&gcc GCC_PCIE0_AXI_M_CLK>, -+ <&gcc GCC_PCIE0_AXI_S_CLK>, -+ <&gcc GCC_PCIE0_AXI_S_BRIDGE_CLK>, -+ <&gcc GCC_PCIE0_RCHNG_CLK>, -+ <&gcc GCC_PCIE0_AHB_CLK>, -+ <&gcc GCC_PCIE0_AUX_CLK>; -+ clock-names = "axi_m", -+ "axi_s", -+ "axi_bridge", -+ "rchng", -+ "ahb", -+ "aux"; -+ -+ resets = <&gcc GCC_PCIE0_PIPE_ARES>, -+ <&gcc GCC_PCIE0_CORE_STICKY_ARES>, -+ <&gcc GCC_PCIE0_AXI_S_STICKY_ARES>, -+ <&gcc GCC_PCIE0_AXI_S_ARES>, -+ <&gcc GCC_PCIE0_AXI_M_STICKY_ARES>, -+ <&gcc GCC_PCIE0_AXI_M_ARES>, -+ <&gcc GCC_PCIE0_AUX_ARES>, -+ <&gcc GCC_PCIE0_AHB_ARES>; -+ reset-names = "pipe", -+ "sticky", -+ "axi_s_sticky", -+ "axi_s", -+ "axi_m_sticky", -+ "axi_m", -+ "aux", -+ "ahb"; -+ -+ phys = <&pcie0_phy>; -+ phy-names = "pciephy"; -+ interconnects = <&gcc MASTER_ANOC_PCIE0 &gcc SLAVE_ANOC_PCIE0>, -+ <&gcc MASTER_SNOC_PCIE0 &gcc SLAVE_SNOC_PCIE0>; -+ interconnect-names = "pcie-mem", "cpu-pcie"; -+ status = "disabled"; -+ }; -+ - }; - - thermal-zones { --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/023-02-v6.14-arm64-dts-qcom-ipq9574-Enable-PCIe-PHYs-and-controll.patch b/lede/target/linux/qualcommbe/patches-6.6/023-02-v6.14-arm64-dts-qcom-ipq9574-Enable-PCIe-PHYs-and-controll.patch deleted file mode 100644 index 5809a86c9f..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/023-02-v6.14-arm64-dts-qcom-ipq9574-Enable-PCIe-PHYs-and-controll.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 438d05fb9be6bcd565e713c7e8d9ffb97e5f8d1e Mon Sep 17 00:00:00 2001 -From: devi priya -Date: Thu, 1 Aug 2024 11:18:02 +0530 -Subject: [PATCH 2/2] arm64: dts: qcom: ipq9574: Enable PCIe PHYs and - controllers - -Enable the PCIe controller and PHY nodes corresponding to RDP 433. - -Signed-off-by: devi priya -Signed-off-by: Sricharan Ramabadhran -Link: https://lore.kernel.org/r/20240801054803.3015572-4-quic_srichara@quicinc.com -Signed-off-by: Bjorn Andersson ---- - arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 113 ++++++++++++++++++++ - 1 file changed, 113 insertions(+) - -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -index 1bb8d96c9a82..165ebbb59511 100644 ---- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -+++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -@@ -8,6 +8,7 @@ - - /dts-v1/; - -+#include - #include "ipq9574-rdp-common.dtsi" - - / { -@@ -15,6 +16,45 @@ / { - compatible = "qcom,ipq9574-ap-al02-c7", "qcom,ipq9574"; - }; - -+&pcie1_phy { -+ status = "okay"; -+}; -+ -+&pcie1 { -+ pinctrl-0 = <&pcie1_default>; -+ pinctrl-names = "default"; -+ -+ perst-gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; -+ wake-gpios = <&tlmm 27 GPIO_ACTIVE_LOW>; -+ status = "okay"; -+}; -+ -+&pcie2_phy { -+ status = "okay"; -+}; -+ -+&pcie2 { -+ pinctrl-0 = <&pcie2_default>; -+ pinctrl-names = "default"; -+ -+ perst-gpios = <&tlmm 29 GPIO_ACTIVE_LOW>; -+ wake-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; -+ status = "okay"; -+}; -+ -+&pcie3_phy { -+ status = "okay"; -+}; -+ -+&pcie3 { -+ pinctrl-0 = <&pcie3_default>; -+ pinctrl-names = "default"; -+ -+ perst-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>; -+ wake-gpios = <&tlmm 33 GPIO_ACTIVE_LOW>; -+ status = "okay"; -+}; -+ - &sdhc_1 { - pinctrl-0 = <&sdc_default_state>; - pinctrl-names = "default"; -@@ -28,6 +68,79 @@ &sdhc_1 { - }; - - &tlmm { -+ -+ pcie1_default: pcie1-default-state { -+ clkreq-n-pins { -+ pins = "gpio25"; -+ function = "pcie1_clk"; -+ drive-strength = <6>; -+ bias-pull-up; -+ }; -+ -+ perst-n-pins { -+ pins = "gpio26"; -+ function = "gpio"; -+ drive-strength = <8>; -+ bias-pull-down; -+ output-low; -+ }; -+ -+ wake-n-pins { -+ pins = "gpio27"; -+ function = "pcie1_wake"; -+ drive-strength = <6>; -+ bias-pull-up; -+ }; -+ }; -+ -+ pcie2_default: pcie2-default-state { -+ clkreq-n-pins { -+ pins = "gpio28"; -+ function = "pcie2_clk"; -+ drive-strength = <6>; -+ bias-pull-up; -+ }; -+ -+ perst-n-pins { -+ pins = "gpio29"; -+ function = "gpio"; -+ drive-strength = <8>; -+ bias-pull-down; -+ output-low; -+ }; -+ -+ wake-n-pins { -+ pins = "gpio30"; -+ function = "pcie2_wake"; -+ drive-strength = <6>; -+ bias-pull-up; -+ }; -+ }; -+ -+ pcie3_default: pcie3-default-state { -+ clkreq-n-pins { -+ pins = "gpio31"; -+ function = "pcie3_clk"; -+ drive-strength = <6>; -+ bias-pull-up; -+ }; -+ -+ perst-n-pins { -+ pins = "gpio32"; -+ function = "gpio"; -+ drive-strength = <8>; -+ bias-pull-up; -+ output-low; -+ }; -+ -+ wake-n-pins { -+ pins = "gpio33"; -+ function = "pcie3_wake"; -+ drive-strength = <6>; -+ bias-pull-up; -+ }; -+ }; -+ - sdc_default_state: sdc-default-state { - clk-pins { - pins = "gpio5"; --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/100-06-spi-spi-qpic-add-driver-for-QCOM-SPI-NAND-flash-Inte.patch b/lede/target/linux/qualcommbe/patches-6.6/100-06-spi-spi-qpic-add-driver-for-QCOM-SPI-NAND-flash-Inte.patch index d5babb1fea..62f29cba3c 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/100-06-spi-spi-qpic-add-driver-for-QCOM-SPI-NAND-flash-Inte.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/100-06-spi-spi-qpic-add-driver-for-QCOM-SPI-NAND-flash-Inte.patch @@ -209,11 +209,9 @@ Change in [v1] 5 files changed, 1654 insertions(+) create mode 100644 drivers/spi/spi-qpic-snand.c -diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile -index da1586a36574..db516a45f0c5 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile -@@ -3,7 +3,11 @@ +@@ -4,7 +4,11 @@ nandcore-objs := core.o bbt.o obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o obj-$(CONFIG_MTD_NAND_MTK_BMT) += mtk_bmt.o mtk_bmt_v2.o mtk_bmt_bbt.o mtk_bmt_nmbm.o @@ -225,11 +223,9 @@ index da1586a36574..db516a45f0c5 100644 obj-y += onenand/ obj-y += raw/ obj-y += spi/ -diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig -index f51f9466e518..1aaf93964429 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -920,6 +920,15 @@ config SPI_QCOM_QSPI +@@ -870,6 +870,15 @@ config SPI_QCOM_QSPI help QSPI(Quad SPI) driver for Qualcomm QSPI controller. @@ -245,11 +241,9 @@ index f51f9466e518..1aaf93964429 100644 config SPI_QUP tristate "Qualcomm SPI controller with QUP interface" depends on ARCH_QCOM || COMPILE_TEST -diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile -index aea5e54de195..3309b7bb2445 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile -@@ -115,6 +115,7 @@ obj-$(CONFIG_SPI_PXA2XX) += spi-pxa2xx-platform.o +@@ -110,6 +110,7 @@ obj-$(CONFIG_SPI_PXA2XX) += spi-pxa2xx- obj-$(CONFIG_SPI_PXA2XX_PCI) += spi-pxa2xx-pci.o obj-$(CONFIG_SPI_QCOM_GENI) += spi-geni-qcom.o obj-$(CONFIG_SPI_QCOM_QSPI) += spi-qcom-qspi.o @@ -257,9 +251,6 @@ index aea5e54de195..3309b7bb2445 100644 obj-$(CONFIG_SPI_QUP) += spi-qup.o obj-$(CONFIG_SPI_ROCKCHIP) += spi-rockchip.o obj-$(CONFIG_SPI_ROCKCHIP_SFC) += spi-rockchip-sfc.o -diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c -new file mode 100644 -index 000000000000..1ba562a9369e --- /dev/null +++ b/drivers/spi/spi-qpic-snand.c @@ -0,0 +1,1633 @@ @@ -1896,11 +1887,9 @@ index 000000000000..1ba562a9369e +MODULE_AUTHOR("Md Sadre Alam "); +MODULE_LICENSE("GPL"); + -diff --git a/include/linux/mtd/nand-qpic-common.h b/include/linux/mtd/nand-qpic-common.h -index e79c79775eb8..7dba89654d6c 100644 --- a/include/linux/mtd/nand-qpic-common.h +++ b/include/linux/mtd/nand-qpic-common.h -@@ -322,6 +322,10 @@ struct nandc_regs { +@@ -325,6 +325,10 @@ struct nandc_regs { __le32 read_location_last1; __le32 read_location_last2; __le32 read_location_last3; @@ -1911,7 +1900,7 @@ index e79c79775eb8..7dba89654d6c 100644 __le32 erased_cw_detect_cfg_clr; __le32 erased_cw_detect_cfg_set; -@@ -336,6 +340,7 @@ struct nandc_regs { +@@ -339,6 +343,7 @@ struct nandc_regs { * * @core_clk: controller clock * @aon_clk: another controller clock @@ -1919,7 +1908,7 @@ index e79c79775eb8..7dba89654d6c 100644 * * @regs: a contiguous chunk of memory for DMA register * writes. contains the register values to be -@@ -345,6 +350,7 @@ struct nandc_regs { +@@ -348,6 +353,7 @@ struct nandc_regs { * initialized via DT match data * * @controller: base controller structure @@ -1927,7 +1916,7 @@ index e79c79775eb8..7dba89654d6c 100644 * @host_list: list containing all the chips attached to the * controller * -@@ -389,6 +395,7 @@ struct qcom_nand_controller { +@@ -392,6 +398,7 @@ struct qcom_nand_controller { const struct qcom_nandc_props *props; struct nand_controller *controller; @@ -1935,5 +1924,3 @@ index e79c79775eb8..7dba89654d6c 100644 struct list_head host_list; union { --- -2.34.1 diff --git a/lede/target/linux/qualcommbe/patches-6.6/101-arm64-dts-qcom-ipq9574-Add-SPI-nand-support.patch b/lede/target/linux/qualcommbe/patches-6.6/101-arm64-dts-qcom-ipq9574-Add-SPI-nand-support.patch index 91b525aa0f..0b8eac37cb 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/101-arm64-dts-qcom-ipq9574-Add-SPI-nand-support.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/101-arm64-dts-qcom-ipq9574-Add-SPI-nand-support.patch @@ -1,40 +1,13 @@ +From 968c5e8220209eb2185654f01748c349515a3b8e Mon Sep 17 00:00:00 2001 From: Md Sadre Alam -To: , , , - , , - , , - , , - , - , , - , , - -Cc: , , - -Subject: [PATCH v14 7/8] arm64: dts: qcom: ipq9574: Add SPI nand support -Date: Wed, 20 Nov 2024 14:45:05 +0530 [thread overview] -Message-ID: <20241120091507.1404368-8-quic_mdalam@quicinc.com> (raw) -In-Reply-To: <20241120091507.1404368-1-quic_mdalam@quicinc.com> +Date: Thu, 15 Feb 2024 12:26:40 +0530 +Subject: [PATCH v10 7/8] arm64: dts: qcom: ipq9574: Add SPI nand support Add SPI NAND support for ipq9574 SoC. Signed-off-by: Md Sadre Alam --- -Change in [v14] - -* No change - -Change in [v13] - -* No change - -Change in [v12] - -* No change - -Change in [v11] - -* No change - Change in [v10] * No change @@ -81,13 +54,11 @@ Change in [v1] arch/arm64/boot/dts/qcom/ipq9574.dtsi | 27 ++++++++++++ 2 files changed, 70 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -index 91e104b0f865..6429a6b3b903 100644 ---- a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -@@ -139,6 +139,49 @@ gpio_leds_default: gpio-leds-default-state { - drive-strength = <8>; - bias-pull-up; +--- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts ++++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +@@ -59,4 +59,47 @@ + bias-pull-down; + }; }; + + qpic_snand_default_state: qpic-snand-default-state { @@ -133,13 +104,9 @@ index 91e104b0f865..6429a6b3b903 100644 + nand-ecc-step-size = <512>; + }; }; - - &usb_0_dwc3 { -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index d1fd35ebc4a2..45fb26bc9480 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -330,6 +330,33 @@ tcsr: syscon@1937000 { +@@ -355,6 +355,33 @@ reg = <0x01937000 0x21000>; }; @@ -155,7 +122,7 @@ index d1fd35ebc4a2..45fb26bc9480 100644 + }; + + qpic_nand: spi@79b0000 { -+ compatible = "qcom,ipq9574-snand"; ++ compatible = "qcom,spi-qpic-snand", "qcom,ipq9574-nand"; + reg = <0x79b0000 0x10000>; + #address-cells = <1>; + #size-cells = <0>; @@ -172,7 +139,4 @@ index d1fd35ebc4a2..45fb26bc9480 100644 + sdhc_1: mmc@7804000 { compatible = "qcom,ipq9574-sdhci", "qcom,sdhci-msm-v5"; - reg = <0x07804000 0x1000>, --- -2.34.1 - + reg = <0x07804000 0x1000>, <0x07805000 0x1000>; diff --git a/lede/target/linux/qualcommbe/patches-6.6/102-arm64-dts-qcom-ipq9574-Disable-eMMC-node.patch b/lede/target/linux/qualcommbe/patches-6.6/102-arm64-dts-qcom-ipq9574-Disable-eMMC-node.patch index 57a16f7467..8e362b8e60 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/102-arm64-dts-qcom-ipq9574-Disable-eMMC-node.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/102-arm64-dts-qcom-ipq9574-Disable-eMMC-node.patch @@ -54,7 +54,7 @@ Change in [v1] --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -@@ -82,7 +82,7 @@ +@@ -24,7 +24,7 @@ mmc-hs400-enhanced-strobe; max-frequency = <384000000>; bus-width = <8>; @@ -62,4 +62,4 @@ Change in [v1] + status = "disabled"; }; - &sleep_clk { + &tlmm { diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-01-dt-bindings-net-Document-Qualcomm-QCA8084-PHY-packag.patch b/lede/target/linux/qualcommbe/patches-6.6/103-01-dt-bindings-net-Document-Qualcomm-QCA8084-PHY-packag.patch index 260df88c80..6bd3f00b6c 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-01-dt-bindings-net-Document-Qualcomm-QCA8084-PHY-packag.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-01-dt-bindings-net-Document-Qualcomm-QCA8084-PHY-packag.patch @@ -24,9 +24,6 @@ Signed-off-by: Luo Jie create mode 100644 Documentation/devicetree/bindings/net/qcom,qca8084.yaml create mode 100644 include/dt-bindings/net/qcom,qca808x.h -diff --git a/Documentation/devicetree/bindings/net/qcom,qca8084.yaml b/Documentation/devicetree/bindings/net/qcom,qca8084.yaml -new file mode 100644 -index 000000000000..efa1fa4ebfdc --- /dev/null +++ b/Documentation/devicetree/bindings/net/qcom,qca8084.yaml @@ -0,0 +1,198 @@ @@ -228,9 +225,6 @@ index 000000000000..efa1fa4ebfdc + }; + }; + }; -diff --git a/include/dt-bindings/net/qcom,qca808x.h b/include/dt-bindings/net/qcom,qca808x.h -new file mode 100644 -index 000000000000..c3a2830445ea --- /dev/null +++ b/include/dt-bindings/net/qcom,qca808x.h @@ -0,0 +1,14 @@ @@ -248,6 +242,3 @@ index 000000000000..c3a2830445ea +#define QCA808X_PCS1_SGMII_MAC_PCS0_SGMII_PHY 2 + +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-02-net-phy-qca808x-Add-QCA8084-ethernet-phy-support.patch b/lede/target/linux/qualcommbe/patches-6.6/103-02-net-phy-qca808x-Add-QCA8084-ethernet-phy-support.patch index 0e84685af0..f1a7c992b1 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-02-net-phy-qca808x-Add-QCA8084-ethernet-phy-support.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-02-net-phy-qca808x-Add-QCA8084-ethernet-phy-support.patch @@ -24,8 +24,6 @@ Signed-off-by: Luo Jie drivers/net/phy/qcom/qca808x.c | 62 ++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) -diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c -index 5048304ccc9e..be46d16ca09f 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -86,9 +86,16 @@ @@ -46,7 +44,7 @@ index 5048304ccc9e..be46d16ca09f 100644 MODULE_LICENSE("GPL"); struct qca808x_priv { -@@ -153,7 +160,9 @@ static bool qca808x_is_prefer_master(struct phy_device *phydev) +@@ -153,7 +160,9 @@ static bool qca808x_is_prefer_master(str static bool qca808x_has_fast_retrain_or_slave_seed(struct phy_device *phydev) { @@ -57,7 +55,7 @@ index 5048304ccc9e..be46d16ca09f 100644 } static bool qca808x_is_1g_only(struct phy_device *phydev) -@@ -273,6 +282,23 @@ static int qca808x_read_status(struct phy_device *phydev) +@@ -273,6 +282,23 @@ static int qca808x_read_status(struct ph return ret; if (phydev->link) { @@ -81,7 +79,7 @@ index 5048304ccc9e..be46d16ca09f 100644 if (phydev->speed == SPEED_2500) phydev->interface = PHY_INTERFACE_MODE_2500BASEX; else -@@ -352,6 +378,18 @@ static int qca808x_cable_test_start(struct phy_device *phydev) +@@ -352,6 +378,18 @@ static int qca808x_cable_test_start(stru phy_write_mmd(phydev, MDIO_MMD_PCS, 0x807a, 0xc060); phy_write_mmd(phydev, MDIO_MMD_PCS, 0x807e, 0xb060); @@ -100,7 +98,7 @@ index 5048304ccc9e..be46d16ca09f 100644 return 0; } -@@ -651,12 +689,32 @@ static struct phy_driver qca808x_driver[] = { +@@ -651,12 +689,32 @@ static struct phy_driver qca808x_driver[ .led_hw_control_set = qca808x_led_hw_control_set, .led_hw_control_get = qca808x_led_hw_control_get, .led_polarity_set = qca808x_led_polarity_set, @@ -133,6 +131,3 @@ index 5048304ccc9e..be46d16ca09f 100644 { } }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-03-net-phy-qca808x-Add-config_init-function-for-QCA8084.patch b/lede/target/linux/qualcommbe/patches-6.6/103-03-net-phy-qca808x-Add-config_init-function-for-QCA8084.patch index f55e08dbe5..9b450d8a2f 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-03-net-phy-qca808x-Add-config_init-function-for-QCA8084.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-03-net-phy-qca808x-Add-config_init-function-for-QCA8084.patch @@ -22,8 +22,6 @@ Signed-off-by: Luo Jie drivers/net/phy/qcom/qca808x.c | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c -index be46d16ca09f..c88fa59d4029 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -94,6 +94,15 @@ @@ -42,7 +40,7 @@ index be46d16ca09f..c88fa59d4029 100644 MODULE_DESCRIPTION("Qualcomm Atheros QCA808X PHY driver"); MODULE_AUTHOR("Matus Ujhelyi, Luo Jie"); MODULE_LICENSE("GPL"); -@@ -660,6 +669,34 @@ static int qca808x_led_polarity_set(struct phy_device *phydev, int index, +@@ -660,6 +669,34 @@ static int qca808x_led_polarity_set(stru active_low ? 0 : QCA808X_LED_ACTIVE_HIGH); } @@ -77,7 +75,7 @@ index be46d16ca09f..c88fa59d4029 100644 static struct phy_driver qca808x_driver[] = { { /* Qualcomm QCA8081 */ -@@ -708,6 +745,7 @@ static struct phy_driver qca808x_driver[] = { +@@ -708,6 +745,7 @@ static struct phy_driver qca808x_driver[ .soft_reset = qca808x_soft_reset, .cable_test_start = qca808x_cable_test_start, .cable_test_get_status = qca808x_cable_test_get_status, @@ -85,6 +83,3 @@ index be46d16ca09f..c88fa59d4029 100644 }, }; module_phy_driver(qca808x_driver); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-04-net-phy-qca808x-Add-link_change_notify-function-for-.patch b/lede/target/linux/qualcommbe/patches-6.6/103-04-net-phy-qca808x-Add-link_change_notify-function-for-.patch index 2510ec327c..4a41a9d9a8 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-04-net-phy-qca808x-Add-link_change_notify-function-for-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-04-net-phy-qca808x-Add-link_change_notify-function-for-.patch @@ -13,8 +13,6 @@ Signed-off-by: Luo Jie drivers/net/phy/qcom/qca808x.c | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) -diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c -index c88fa59d4029..029d5f9de6b8 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -103,6 +103,14 @@ @@ -32,7 +30,7 @@ index c88fa59d4029..029d5f9de6b8 100644 MODULE_DESCRIPTION("Qualcomm Atheros QCA808X PHY driver"); MODULE_AUTHOR("Matus Ujhelyi, Luo Jie"); MODULE_LICENSE("GPL"); -@@ -697,6 +705,49 @@ static int qca8084_config_init(struct phy_device *phydev) +@@ -697,6 +705,49 @@ static int qca8084_config_init(struct ph QCA8084_MSE_THRESHOLD_2P5G_VAL); } @@ -82,7 +80,7 @@ index c88fa59d4029..029d5f9de6b8 100644 static struct phy_driver qca808x_driver[] = { { /* Qualcomm QCA8081 */ -@@ -746,6 +797,7 @@ static struct phy_driver qca808x_driver[] = { +@@ -746,6 +797,7 @@ static struct phy_driver qca808x_driver[ .cable_test_start = qca808x_cable_test_start, .cable_test_get_status = qca808x_cable_test_get_status, .config_init = qca8084_config_init, @@ -90,6 +88,3 @@ index c88fa59d4029..029d5f9de6b8 100644 }, }; module_phy_driver(qca808x_driver); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-05-net-phy-qca808x-Add-register-access-support-routines.patch b/lede/target/linux/qualcommbe/patches-6.6/103-05-net-phy-qca808x-Add-register-access-support-routines.patch index 7986a6c908..2612bc3940 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-05-net-phy-qca808x-Add-register-access-support-routines.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-05-net-phy-qca808x-Add-register-access-support-routines.patch @@ -19,8 +19,6 @@ Signed-off-by: Luo Jie drivers/net/phy/qcom/qca808x.c | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) -diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c -index 029d5f9de6b8..8873474146e8 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -111,6 +111,22 @@ @@ -125,6 +123,3 @@ index 029d5f9de6b8..8873474146e8 100644 static int qca808x_phy_fast_retrain_config(struct phy_device *phydev) { int ret; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-06-net-phy-qca808x-Add-QCA8084-probe-function.patch b/lede/target/linux/qualcommbe/patches-6.6/103-06-net-phy-qca808x-Add-QCA8084-probe-function.patch index ad8bc0294a..b4d79e7318 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-06-net-phy-qca808x-Add-QCA8084-probe-function.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-06-net-phy-qca808x-Add-QCA8084-probe-function.patch @@ -17,8 +17,6 @@ Signed-off-by: Luo Jie drivers/net/phy/qcom/qca808x.c | 91 ++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) -diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c -index 8873474146e8..85bb299fe0a3 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -2,6 +2,8 @@ @@ -52,7 +50,7 @@ index 8873474146e8..85bb299fe0a3 100644 MODULE_DESCRIPTION("Qualcomm Atheros QCA808X PHY driver"); MODULE_AUTHOR("Matus Ujhelyi, Luo Jie"); MODULE_LICENSE("GPL"); -@@ -836,6 +853,79 @@ static void qca8084_link_change_notify(struct phy_device *phydev) +@@ -836,6 +853,79 @@ static void qca8084_link_change_notify(s QCA8084_IPG_10_TO_11_EN : 0); } @@ -132,7 +130,7 @@ index 8873474146e8..85bb299fe0a3 100644 static struct phy_driver qca808x_driver[] = { { /* Qualcomm QCA8081 */ -@@ -886,6 +976,7 @@ static struct phy_driver qca808x_driver[] = { +@@ -886,6 +976,7 @@ static struct phy_driver qca808x_driver[ .cable_test_get_status = qca808x_cable_test_get_status, .config_init = qca8084_config_init, .link_change_notify = qca8084_link_change_notify, @@ -140,6 +138,3 @@ index 8873474146e8..85bb299fe0a3 100644 }, }; module_phy_driver(qca808x_driver); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-07-net-phy-qca808x-Add-package-clocks-and-resets-for-QC.patch b/lede/target/linux/qualcommbe/patches-6.6/103-07-net-phy-qca808x-Add-package-clocks-and-resets-for-QC.patch index 78111f7982..75fc7cc3cf 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-07-net-phy-qca808x-Add-package-clocks-and-resets-for-QC.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-07-net-phy-qca808x-Add-package-clocks-and-resets-for-QC.patch @@ -17,8 +17,6 @@ Signed-off-by: Luo Jie drivers/net/phy/qcom/qca808x.c | 67 ++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) -diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c -index 85bb299fe0a3..632cad1ad190 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -4,6 +4,7 @@ @@ -29,7 +27,7 @@ index 85bb299fe0a3..632cad1ad190 100644 #include "qcom.h" -@@ -148,10 +149,35 @@ MODULE_DESCRIPTION("Qualcomm Atheros QCA808X PHY driver"); +@@ -148,10 +149,35 @@ MODULE_DESCRIPTION("Qualcomm Atheros QCA MODULE_AUTHOR("Matus Ujhelyi, Luo Jie"); MODULE_LICENSE("GPL"); @@ -65,7 +63,7 @@ index 85bb299fe0a3..632cad1ad190 100644 static int __qca8084_set_page(struct mii_bus *bus, u16 sw_addr, u16 page) { return __mdiobus_write(bus, QCA8084_HIGH_ADDR_PREFIX | (sw_addr >> 5), -@@ -853,11 +879,24 @@ static void qca8084_link_change_notify(struct phy_device *phydev) +@@ -853,11 +879,24 @@ static void qca8084_link_change_notify(s QCA8084_IPG_10_TO_11_EN : 0); } @@ -91,7 +89,7 @@ index 85bb299fe0a3..632cad1ad190 100644 /* Program the MDIO address of PHY and PCS optionally, the MDIO * address 0-6 is used for PHY and PCS MDIO devices by default. -@@ -889,17 +928,39 @@ static int qca8084_phy_package_probe_once(struct phy_device *phydev) +@@ -889,17 +928,39 @@ static int qca8084_phy_package_probe_onc set |= FIELD_PREP(QCA8084_PCS_ADDR1_MASK, addr[5]); set |= FIELD_PREP(QCA8084_PCS_ADDR2_MASK, addr[6]); @@ -133,6 +131,3 @@ index 85bb299fe0a3..632cad1ad190 100644 if (ret) return ret; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-08-net-phy-qca808x-Add-QCA8084-package-init-function.patch b/lede/target/linux/qualcommbe/patches-6.6/103-08-net-phy-qca808x-Add-QCA8084-package-init-function.patch index fd951cebdd..aa71046c14 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-08-net-phy-qca808x-Add-QCA8084-package-init-function.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-08-net-phy-qca808x-Add-QCA8084-package-init-function.patch @@ -14,8 +14,6 @@ Signed-off-by: Luo Jie drivers/net/phy/qcom/qca808x.c | 115 +++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) -diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c -index 632cad1ad190..459f8e8a9749 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -1,5 +1,6 @@ @@ -47,7 +45,7 @@ index 632cad1ad190..459f8e8a9749 100644 struct clk *clk[PACKAGE_CLK_MAX]; }; -@@ -808,10 +817,107 @@ static int qca808x_led_polarity_set(struct phy_device *phydev, int index, +@@ -808,10 +817,107 @@ static int qca808x_led_polarity_set(stru active_low ? 0 : QCA808X_LED_ACTIVE_HIGH); } @@ -155,7 +153,7 @@ index 632cad1ad190..459f8e8a9749 100644 if (phydev->interface == PHY_INTERFACE_MODE_10G_QXGMII) __set_bit(PHY_INTERFACE_MODE_10G_QXGMII, phydev->possible_interfaces); -@@ -948,6 +1054,15 @@ static int qca8084_phy_package_probe_once(struct phy_device *phydev) +@@ -948,6 +1054,15 @@ static int qca8084_phy_package_probe_onc return dev_err_probe(&phydev->mdio.dev, PTR_ERR(rstc), "package reset not ready\n"); @@ -171,6 +169,3 @@ index 632cad1ad190..459f8e8a9749 100644 /* Deassert PHY package. */ return reset_control_deassert(rstc); } --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-11-net-pcs-Add-driver-for-Qualcomm-IPQ-UNIPHY-PCS.patch b/lede/target/linux/qualcommbe/patches-6.6/103-11-net-pcs-Add-driver-for-Qualcomm-IPQ-UNIPHY-PCS.patch index e463e69563..785b1dce56 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-11-net-pcs-Add-driver-for-Qualcomm-IPQ-UNIPHY-PCS.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-11-net-pcs-Add-driver-for-Qualcomm-IPQ-UNIPHY-PCS.patch @@ -42,11 +42,9 @@ Signed-off-by: Lei Wei # QUALCOMM NAND CONTROLLER DRIVER # M: Manivannan Sadhasivam # L: linux-mtd@lists.infradead.org -diff --git a/drivers/net/pcs/Kconfig b/drivers/net/pcs/Kconfig -index f6aa437473de..796004de6a31 100644 --- a/drivers/net/pcs/Kconfig +++ b/drivers/net/pcs/Kconfig -@@ -33,4 +33,14 @@ config PCS_RZN1_MIIC +@@ -44,4 +44,14 @@ config PCS_RZN1_MIIC on RZ/N1 SoCs. This PCS converts MII to RMII/RGMII or can be set in pass-through mode for MII. @@ -61,18 +59,13 @@ index f6aa437473de..796004de6a31 100644 + These modes help to support various combination of ethernet switch/PHY on + IPQ SoC based boards. endmenu -diff --git a/drivers/net/pcs/Makefile b/drivers/net/pcs/Makefile -index 4f7920618b90..f95cdff03c7f 100644 --- a/drivers/net/pcs/Makefile +++ b/drivers/net/pcs/Makefile -@@ -8,3 +8,4 @@ obj-$(CONFIG_PCS_XPCS) += pcs_xpcs.o +@@ -8,3 +8,4 @@ obj-$(CONFIG_PCS_LYNX) += pcs-lynx.o obj-$(CONFIG_PCS_MTK_LYNXI) += pcs-mtk-lynxi.o obj-$(CONFIG_PCS_RZN1_MIIC) += pcs-rzn1-miic.o obj-$(CONFIG_PCS_MTK_USXGMII) += pcs-mtk-usxgmii.o +obj-$(CONFIG_PCS_QCOM_IPQ_UNIPHY) += pcs-qcom-ipq-uniphy.o -diff --git a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c -new file mode 100644 -index 000000000000..837de629d0b2 --- /dev/null +++ b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c @@ -0,0 +1,943 @@ @@ -1019,9 +1012,6 @@ index 000000000000..837de629d0b2 +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Qualcomm IPQ UNIPHY PCS driver"); +MODULE_AUTHOR("Lei Wei "); -diff --git a/include/linux/pcs/pcs-qcom-ipq-uniphy.h b/include/linux/pcs/pcs-qcom-ipq-uniphy.h -new file mode 100644 -index 000000000000..4a617bcb32f4 --- /dev/null +++ b/include/linux/pcs/pcs-qcom-ipq-uniphy.h @@ -0,0 +1,13 @@ @@ -1038,6 +1028,3 @@ index 000000000000..4a617bcb32f4 +void ipq_unipcs_destroy(struct phylink_pcs *pcs); + +#endif /* __LINUX_PCS_QCOM_IPQ_UNIPHY_H */ --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-12-net-pcs-Add-10GBASER-interface-mode-support-to-IPQ-U.patch b/lede/target/linux/qualcommbe/patches-6.6/103-12-net-pcs-Add-10GBASER-interface-mode-support-to-IPQ-U.patch index ea1567590b..77029b6faa 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-12-net-pcs-Add-10GBASER-interface-mode-support-to-IPQ-U.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-12-net-pcs-Add-10GBASER-interface-mode-support-to-IPQ-U.patch @@ -12,8 +12,6 @@ Signed-off-by: Lei Wei drivers/net/pcs/pcs-qcom-ipq-uniphy.c | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) -diff --git a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c -index 837de629d0b2..68a1715531ef 100644 --- a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c +++ b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c @@ -57,6 +57,9 @@ @@ -26,7 +24,7 @@ index 837de629d0b2..68a1715531ef 100644 #define XPCS_DIG_CTRL 0x38000 #define XPCS_USXG_ADPT_RESET BIT(10) #define XPCS_USXG_EN BIT(9) -@@ -320,6 +323,23 @@ static void ipq_unipcs_get_state_usxgmii(struct ipq_uniphy_pcs *qunipcs, +@@ -320,6 +323,23 @@ static void ipq_unipcs_get_state_usxgmii state->duplex = DUPLEX_HALF; } @@ -50,7 +48,7 @@ index 837de629d0b2..68a1715531ef 100644 static int ipq_unipcs_config_mode(struct ipq_uniphy_pcs *qunipcs, phy_interface_t interface) { -@@ -354,6 +374,7 @@ static int ipq_unipcs_config_mode(struct ipq_uniphy_pcs *qunipcs, +@@ -354,6 +374,7 @@ static int ipq_unipcs_config_mode(struct PCS_MODE_PSGMII); break; case PHY_INTERFACE_MODE_USXGMII: @@ -58,7 +56,7 @@ index 837de629d0b2..68a1715531ef 100644 rate = 312500000; ipq_unipcs_reg_modify32(qunipcs, PCS_MODE_CTRL, PCS_MODE_SEL_MASK, -@@ -461,6 +482,25 @@ static int ipq_unipcs_config_usxgmii(struct ipq_uniphy_pcs *qunipcs, +@@ -461,6 +482,25 @@ static int ipq_unipcs_config_usxgmii(str return 0; } @@ -84,7 +82,7 @@ index 837de629d0b2..68a1715531ef 100644 static unsigned long ipq_unipcs_clock_rate_get_gmii(int speed) { unsigned long rate = 0; -@@ -527,6 +567,7 @@ ipq_unipcs_link_up_clock_rate_set(struct ipq_uniphy_pcs_ch *qunipcs_ch, +@@ -527,6 +567,7 @@ ipq_unipcs_link_up_clock_rate_set(struct rate = ipq_unipcs_clock_rate_get_gmii(speed); break; case PHY_INTERFACE_MODE_USXGMII: @@ -92,7 +90,7 @@ index 837de629d0b2..68a1715531ef 100644 rate = ipq_unipcs_clock_rate_get_xgmii(speed); break; default: -@@ -644,6 +685,9 @@ static void ipq_unipcs_get_state(struct phylink_pcs *pcs, +@@ -644,6 +685,9 @@ static void ipq_unipcs_get_state(struct case PHY_INTERFACE_MODE_USXGMII: ipq_unipcs_get_state_usxgmii(qunipcs, state); break; @@ -102,7 +100,7 @@ index 837de629d0b2..68a1715531ef 100644 default: break; } -@@ -675,6 +719,8 @@ static int ipq_unipcs_config(struct phylink_pcs *pcs, +@@ -675,6 +719,8 @@ static int ipq_unipcs_config(struct phyl case PHY_INTERFACE_MODE_USXGMII: return ipq_unipcs_config_usxgmii(qunipcs, neg_mode, interface); @@ -111,7 +109,7 @@ index 837de629d0b2..68a1715531ef 100644 default: dev_err(qunipcs->dev, "interface %s not supported\n", phy_modes(interface)); -@@ -705,6 +751,8 @@ static void ipq_unipcs_link_up(struct phylink_pcs *pcs, +@@ -705,6 +751,8 @@ static void ipq_unipcs_link_up(struct ph case PHY_INTERFACE_MODE_USXGMII: ipq_unipcs_link_up_config_usxgmii(qunipcs, speed); break; @@ -120,6 +118,3 @@ index 837de629d0b2..68a1715531ef 100644 default: dev_err(qunipcs->dev, "interface %s not supported\n", phy_modes(interface)); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-13-net-pcs-Add-2500BASEX-interface-mode-support-to-IPQ-.patch b/lede/target/linux/qualcommbe/patches-6.6/103-13-net-pcs-Add-2500BASEX-interface-mode-support-to-IPQ-.patch index ed58d927b9..c086216038 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-13-net-pcs-Add-2500BASEX-interface-mode-support-to-IPQ-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-13-net-pcs-Add-2500BASEX-interface-mode-support-to-IPQ-.patch @@ -15,8 +15,6 @@ Signed-off-by: Lei Wei drivers/net/pcs/pcs-qcom-ipq-uniphy.c | 95 +++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) -diff --git a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c -index 68a1715531ef..ed9c55a6c0fa 100644 --- a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c +++ b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c @@ -25,6 +25,7 @@ @@ -27,7 +25,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 #define PCS_MODE_XPCS FIELD_PREP(PCS_MODE_SEL_MASK, 0x10) #define PCS_MODE_AN_MODE BIT(0) -@@ -282,6 +283,24 @@ static void ipq_unipcs_get_state_sgmii(struct ipq_uniphy_pcs *qunipcs, +@@ -282,6 +283,24 @@ static void ipq_unipcs_get_state_sgmii(s state->pause |= MLO_PAUSE_RX; } @@ -52,7 +50,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 static void ipq_unipcs_get_state_usxgmii(struct ipq_uniphy_pcs *qunipcs, struct phylink_link_state *state) { -@@ -373,6 +392,12 @@ static int ipq_unipcs_config_mode(struct ipq_uniphy_pcs *qunipcs, +@@ -373,6 +392,12 @@ static int ipq_unipcs_config_mode(struct PCS_MODE_SEL_MASK | PCS_MODE_AN_MODE, PCS_MODE_PSGMII); break; @@ -65,7 +63,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 case PHY_INTERFACE_MODE_USXGMII: case PHY_INTERFACE_MODE_10GBASER: rate = 312500000; -@@ -450,6 +475,22 @@ static int ipq_unipcs_config_sgmii(struct ipq_uniphy_pcs *qunipcs, +@@ -450,6 +475,22 @@ err: return ret; } @@ -88,7 +86,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 static int ipq_unipcs_config_usxgmii(struct ipq_uniphy_pcs *qunipcs, unsigned int neg_mode, phy_interface_t interface) -@@ -522,6 +563,21 @@ static unsigned long ipq_unipcs_clock_rate_get_gmii(int speed) +@@ -522,6 +563,21 @@ static unsigned long ipq_unipcs_clock_ra return rate; } @@ -110,7 +108,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 static unsigned long ipq_unipcs_clock_rate_get_xgmii(int speed) { unsigned long rate = 0; -@@ -566,6 +622,9 @@ ipq_unipcs_link_up_clock_rate_set(struct ipq_uniphy_pcs_ch *qunipcs_ch, +@@ -566,6 +622,9 @@ ipq_unipcs_link_up_clock_rate_set(struct case PHY_INTERFACE_MODE_PSGMII: rate = ipq_unipcs_clock_rate_get_gmii(speed); break; @@ -120,7 +118,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 case PHY_INTERFACE_MODE_USXGMII: case PHY_INTERFACE_MODE_10GBASER: rate = ipq_unipcs_clock_rate_get_xgmii(speed); -@@ -627,6 +686,21 @@ static void ipq_unipcs_link_up_config_sgmii(struct ipq_uniphy_pcs *qunipcs, +@@ -627,6 +686,21 @@ pcs_adapter_reset: PCS_CHANNEL_ADPT_RESET); } @@ -142,7 +140,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 static void ipq_unipcs_link_up_config_usxgmii(struct ipq_uniphy_pcs *qunipcs, int speed) { -@@ -669,6 +743,17 @@ static void ipq_unipcs_link_up_config_usxgmii(struct ipq_uniphy_pcs *qunipcs, +@@ -669,6 +743,17 @@ static void ipq_unipcs_link_up_config_us XPCS_USXG_ADPT_RESET); } @@ -160,7 +158,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 static void ipq_unipcs_get_state(struct phylink_pcs *pcs, struct phylink_link_state *state) { -@@ -682,6 +767,9 @@ static void ipq_unipcs_get_state(struct phylink_pcs *pcs, +@@ -682,6 +767,9 @@ static void ipq_unipcs_get_state(struct case PHY_INTERFACE_MODE_PSGMII: ipq_unipcs_get_state_sgmii(qunipcs, channel, state); break; @@ -170,7 +168,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 case PHY_INTERFACE_MODE_USXGMII: ipq_unipcs_get_state_usxgmii(qunipcs, state); break; -@@ -716,6 +804,8 @@ static int ipq_unipcs_config(struct phylink_pcs *pcs, +@@ -716,6 +804,8 @@ static int ipq_unipcs_config(struct phyl case PHY_INTERFACE_MODE_PSGMII: return ipq_unipcs_config_sgmii(qunipcs, channel, neg_mode, interface); @@ -179,7 +177,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 case PHY_INTERFACE_MODE_USXGMII: return ipq_unipcs_config_usxgmii(qunipcs, neg_mode, interface); -@@ -748,6 +838,10 @@ static void ipq_unipcs_link_up(struct phylink_pcs *pcs, +@@ -748,6 +838,10 @@ static void ipq_unipcs_link_up(struct ph ipq_unipcs_link_up_config_sgmii(qunipcs, channel, neg_mode, speed); break; @@ -190,7 +188,7 @@ index 68a1715531ef..ed9c55a6c0fa 100644 case PHY_INTERFACE_MODE_USXGMII: ipq_unipcs_link_up_config_usxgmii(qunipcs, speed); break; -@@ -761,6 +855,7 @@ static void ipq_unipcs_link_up(struct phylink_pcs *pcs, +@@ -761,6 +855,7 @@ static void ipq_unipcs_link_up(struct ph } static const struct phylink_pcs_ops ipq_unipcs_phylink_ops = { @@ -198,6 +196,3 @@ index 68a1715531ef..ed9c55a6c0fa 100644 .pcs_get_state = ipq_unipcs_get_state, .pcs_config = ipq_unipcs_config, .pcs_link_up = ipq_unipcs_link_up, --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-14-net-pcs-Add-1000BASEX-interface-mode-support-to-IPQ-.patch b/lede/target/linux/qualcommbe/patches-6.6/103-14-net-pcs-Add-1000BASEX-interface-mode-support-to-IPQ-.patch index 4c0c9c31f8..12dfdfe6e5 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-14-net-pcs-Add-1000BASEX-interface-mode-support-to-IPQ-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-14-net-pcs-Add-1000BASEX-interface-mode-support-to-IPQ-.patch @@ -12,8 +12,6 @@ Signed-off-by: Lei Wei drivers/net/pcs/pcs-qcom-ipq-uniphy.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -diff --git a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c -index ed9c55a6c0fa..820d197744e8 100644 --- a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c +++ b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c @@ -27,6 +27,9 @@ @@ -26,7 +24,7 @@ index ed9c55a6c0fa..820d197744e8 100644 #define PCS_MODE_AN_MODE BIT(0) #define PCS_CHANNEL_CTRL(x) (0x480 + 0x18 * (x)) -@@ -392,6 +395,13 @@ static int ipq_unipcs_config_mode(struct ipq_uniphy_pcs *qunipcs, +@@ -392,6 +395,13 @@ static int ipq_unipcs_config_mode(struct PCS_MODE_SEL_MASK | PCS_MODE_AN_MODE, PCS_MODE_PSGMII); break; @@ -40,7 +38,7 @@ index ed9c55a6c0fa..820d197744e8 100644 case PHY_INTERFACE_MODE_2500BASEX: rate = 312500000; ipq_unipcs_reg_modify32(qunipcs, PCS_MODE_CTRL, -@@ -620,6 +630,7 @@ ipq_unipcs_link_up_clock_rate_set(struct ipq_uniphy_pcs_ch *qunipcs_ch, +@@ -620,6 +630,7 @@ ipq_unipcs_link_up_clock_rate_set(struct case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_PSGMII: @@ -48,7 +46,7 @@ index ed9c55a6c0fa..820d197744e8 100644 rate = ipq_unipcs_clock_rate_get_gmii(speed); break; case PHY_INTERFACE_MODE_2500BASEX: -@@ -765,6 +776,10 @@ static void ipq_unipcs_get_state(struct phylink_pcs *pcs, +@@ -765,6 +776,10 @@ static void ipq_unipcs_get_state(struct case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_PSGMII: @@ -59,7 +57,7 @@ index ed9c55a6c0fa..820d197744e8 100644 ipq_unipcs_get_state_sgmii(qunipcs, channel, state); break; case PHY_INTERFACE_MODE_2500BASEX: -@@ -802,6 +817,7 @@ static int ipq_unipcs_config(struct phylink_pcs *pcs, +@@ -802,6 +817,7 @@ static int ipq_unipcs_config(struct phyl case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_PSGMII: @@ -67,7 +65,7 @@ index ed9c55a6c0fa..820d197744e8 100644 return ipq_unipcs_config_sgmii(qunipcs, channel, neg_mode, interface); case PHY_INTERFACE_MODE_2500BASEX: -@@ -818,6 +834,11 @@ static int ipq_unipcs_config(struct phylink_pcs *pcs, +@@ -818,6 +834,11 @@ static int ipq_unipcs_config(struct phyl }; } @@ -79,7 +77,7 @@ index ed9c55a6c0fa..820d197744e8 100644 static void ipq_unipcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, phy_interface_t interface, -@@ -835,6 +856,7 @@ static void ipq_unipcs_link_up(struct phylink_pcs *pcs, +@@ -835,6 +856,7 @@ static void ipq_unipcs_link_up(struct ph case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_PSGMII: @@ -87,7 +85,7 @@ index ed9c55a6c0fa..820d197744e8 100644 ipq_unipcs_link_up_config_sgmii(qunipcs, channel, neg_mode, speed); break; -@@ -858,6 +880,7 @@ static const struct phylink_pcs_ops ipq_unipcs_phylink_ops = { +@@ -858,6 +880,7 @@ static const struct phylink_pcs_ops ipq_ .pcs_validate = ipq_unipcs_validate, .pcs_get_state = ipq_unipcs_get_state, .pcs_config = ipq_unipcs_config, @@ -95,6 +93,3 @@ index ed9c55a6c0fa..820d197744e8 100644 .pcs_link_up = ipq_unipcs_link_up, }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-15-net-pcs-Add-10G_QXGMII-interface-mode-support-to-IPQ.patch b/lede/target/linux/qualcommbe/patches-6.6/103-15-net-pcs-Add-10G_QXGMII-interface-mode-support-to-IPQ.patch index 7da55c07d5..f0136e5745 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-15-net-pcs-Add-10G_QXGMII-interface-mode-support-to-IPQ.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-15-net-pcs-Add-10G_QXGMII-interface-mode-support-to-IPQ.patch @@ -13,8 +13,6 @@ Signed-off-by: Lei Wei drivers/net/pcs/pcs-qcom-ipq-uniphy.c | 174 +++++++++++++++++++++----- 1 file changed, 142 insertions(+), 32 deletions(-) -diff --git a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c -index 820d197744e8..a98180c91632 100644 --- a/drivers/net/pcs/pcs-qcom-ipq-uniphy.c +++ b/drivers/net/pcs/pcs-qcom-ipq-uniphy.c @@ -50,6 +50,9 @@ @@ -81,7 +79,7 @@ index 820d197744e8..a98180c91632 100644 struct clk *clk[PCS_CLK_MAX]; struct reset_control *reset[PCS_RESET_MAX]; struct ipq_unipcs_raw_clk raw_clk[PCS_RAW_CLK_MAX]; -@@ -215,39 +237,55 @@ static const struct clk_ops ipq_unipcs_raw_clk_ops = { +@@ -215,39 +237,55 @@ static const struct clk_ops ipq_unipcs_r static u32 ipq_unipcs_reg_read32(struct ipq_uniphy_pcs *qunipcs, u32 reg) { @@ -151,7 +149,7 @@ index 820d197744e8..a98180c91632 100644 static void ipq_unipcs_get_state_sgmii(struct ipq_uniphy_pcs *qunipcs, int channel, struct phylink_link_state *state) -@@ -305,11 +343,15 @@ static void ipq_unipcs_get_state_2500basex(struct ipq_uniphy_pcs *qunipcs, +@@ -305,11 +343,15 @@ static void ipq_unipcs_get_state_2500bas } static void ipq_unipcs_get_state_usxgmii(struct ipq_uniphy_pcs *qunipcs, @@ -169,7 +167,7 @@ index 820d197744e8..a98180c91632 100644 state->link = !!(val & XPCS_USXG_AN_LINK_STS); -@@ -415,6 +457,15 @@ static int ipq_unipcs_config_mode(struct ipq_uniphy_pcs *qunipcs, +@@ -415,6 +457,15 @@ static int ipq_unipcs_config_mode(struct PCS_MODE_SEL_MASK, PCS_MODE_XPCS); break; @@ -185,7 +183,7 @@ index 820d197744e8..a98180c91632 100644 default: dev_err(qunipcs->dev, "interface %s not supported\n", phy_modes(interface)); -@@ -502,35 +553,82 @@ static int ipq_unipcs_config_2500basex(struct ipq_uniphy_pcs *qunipcs, +@@ -502,35 +553,82 @@ static int ipq_unipcs_config_2500basex(s } static int ipq_unipcs_config_usxgmii(struct ipq_uniphy_pcs *qunipcs, @@ -220,6 +218,9 @@ index 820d197744e8..a98180c91632 100644 - ipq_unipcs_reg_modify32(qunipcs, XPCS_MII_AN_CTRL, - XPCS_MII_AN_8BIT, - XPCS_MII_AN_8BIT); +- +- ipq_unipcs_reg_modify32(qunipcs, XPCS_MII_CTRL, +- XPCS_MII_AN_EN, XPCS_MII_AN_EN); + if (interface == PHY_INTERFACE_MODE_10G_QXGMII) { + ipq_unipcs_reg_modify32(qunipcs, XPCS_KR_CTRL, + XPCS_USXG_MODE_MASK, @@ -229,9 +230,7 @@ index 820d197744e8..a98180c91632 100644 + ipq_unipcs_reg_modify32(qunipcs, XPCS_DIG_STS, + XPCS_DIG_STS_AM_COUNT, + 0x6018); - -- ipq_unipcs_reg_modify32(qunipcs, XPCS_MII_CTRL, -- XPCS_MII_AN_EN, XPCS_MII_AN_EN); ++ + ipq_unipcs_reg_modify32(qunipcs, XPCS_DIG_CTRL, + XPCS_SOFT_RESET, + XPCS_SOFT_RESET); @@ -276,7 +275,7 @@ index 820d197744e8..a98180c91632 100644 } static int ipq_unipcs_config_10gbaser(struct ipq_uniphy_pcs *qunipcs, -@@ -638,6 +736,7 @@ ipq_unipcs_link_up_clock_rate_set(struct ipq_uniphy_pcs_ch *qunipcs_ch, +@@ -638,6 +736,7 @@ ipq_unipcs_link_up_clock_rate_set(struct break; case PHY_INTERFACE_MODE_USXGMII: case PHY_INTERFACE_MODE_10GBASER: @@ -284,7 +283,7 @@ index 820d197744e8..a98180c91632 100644 rate = ipq_unipcs_clock_rate_get_xgmii(speed); break; default: -@@ -713,9 +812,10 @@ static void ipq_unipcs_link_up_config_2500basex(struct ipq_uniphy_pcs *qunipcs, +@@ -713,9 +812,10 @@ static void ipq_unipcs_link_up_config_25 } static void ipq_unipcs_link_up_config_usxgmii(struct ipq_uniphy_pcs *qunipcs, @@ -296,7 +295,7 @@ index 820d197744e8..a98180c91632 100644 switch (speed) { case SPEED_10000: -@@ -744,14 +844,20 @@ static void ipq_unipcs_link_up_config_usxgmii(struct ipq_uniphy_pcs *qunipcs, +@@ -744,14 +844,20 @@ static void ipq_unipcs_link_up_config_us val |= XPCS_DUPLEX_FULL; /* Config XPCS speed */ @@ -321,7 +320,7 @@ index 820d197744e8..a98180c91632 100644 } static int ipq_unipcs_validate(struct phylink_pcs *pcs, -@@ -786,7 +892,8 @@ static void ipq_unipcs_get_state(struct phylink_pcs *pcs, +@@ -786,7 +892,8 @@ static void ipq_unipcs_get_state(struct ipq_unipcs_get_state_2500basex(qunipcs, channel, state); break; case PHY_INTERFACE_MODE_USXGMII: @@ -331,7 +330,7 @@ index 820d197744e8..a98180c91632 100644 break; case PHY_INTERFACE_MODE_10GBASER: ipq_unipcs_get_state_10gbaser(qunipcs, state); -@@ -823,7 +930,8 @@ static int ipq_unipcs_config(struct phylink_pcs *pcs, +@@ -823,7 +930,8 @@ static int ipq_unipcs_config(struct phyl case PHY_INTERFACE_MODE_2500BASEX: return ipq_unipcs_config_2500basex(qunipcs, interface); case PHY_INTERFACE_MODE_USXGMII: @@ -341,7 +340,7 @@ index 820d197744e8..a98180c91632 100644 neg_mode, interface); case PHY_INTERFACE_MODE_10GBASER: return ipq_unipcs_config_10gbaser(qunipcs, interface); -@@ -865,7 +973,8 @@ static void ipq_unipcs_link_up(struct phylink_pcs *pcs, +@@ -865,7 +973,8 @@ static void ipq_unipcs_link_up(struct ph channel, speed); break; case PHY_INTERFACE_MODE_USXGMII: @@ -351,7 +350,7 @@ index 820d197744e8..a98180c91632 100644 break; case PHY_INTERFACE_MODE_10GBASER: break; -@@ -1082,6 +1191,7 @@ static int ipq_uniphy_probe(struct platform_device *pdev) +@@ -1082,6 +1191,7 @@ static int ipq_uniphy_probe(struct platf return ret; mutex_init(&priv->shared_lock); @@ -359,6 +358,3 @@ index 820d197744e8..a98180c91632 100644 platform_set_drvdata(pdev, priv); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-18-net-ethernet-qualcomm-Add-PPE-driver-for-IPQ9574-SoC.patch b/lede/target/linux/qualcommbe/patches-6.6/103-18-net-ethernet-qualcomm-Add-PPE-driver-for-IPQ9574-SoC.patch index 8872005376..e660d33063 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-18-net-ethernet-qualcomm-Add-PPE-driver-for-IPQ9574-SoC.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-18-net-ethernet-qualcomm-Add-PPE-driver-for-IPQ9574-SoC.patch @@ -36,8 +36,6 @@ Signed-off-by: Luo Jie create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe.h -diff --git a/drivers/net/ethernet/qualcomm/Kconfig b/drivers/net/ethernet/qualcomm/Kconfig -index 9210ff360fdc..8cc24da48777 100644 --- a/drivers/net/ethernet/qualcomm/Kconfig +++ b/drivers/net/ethernet/qualcomm/Kconfig @@ -61,6 +61,21 @@ config QCOM_EMAC @@ -62,8 +60,6 @@ index 9210ff360fdc..8cc24da48777 100644 source "drivers/net/ethernet/qualcomm/rmnet/Kconfig" endif # NET_VENDOR_QUALCOMM -diff --git a/drivers/net/ethernet/qualcomm/Makefile b/drivers/net/ethernet/qualcomm/Makefile -index 9250976dd884..166a59aea363 100644 --- a/drivers/net/ethernet/qualcomm/Makefile +++ b/drivers/net/ethernet/qualcomm/Makefile @@ -11,4 +11,5 @@ qcauart-objs := qca_uart.o @@ -72,9 +68,6 @@ index 9250976dd884..166a59aea363 100644 +obj-$(CONFIG_QCOM_PPE) += ppe/ obj-$(CONFIG_RMNET) += rmnet/ -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -new file mode 100644 -index 000000000000..63d50d3b4f2e --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -0,0 +1,7 @@ @@ -85,9 +78,6 @@ index 000000000000..63d50d3b4f2e + +obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o +qcom-ppe-objs := ppe.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.c b/drivers/net/ethernet/qualcomm/ppe/ppe.c -new file mode 100644 -index 000000000000..14998ac771c7 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.c @@ -0,0 +1,225 @@ @@ -316,9 +306,6 @@ index 000000000000..14998ac771c7 + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("Qualcomm IPQ PPE driver"); -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.h b/drivers/net/ethernet/qualcomm/ppe/ppe.h -new file mode 100644 -index 000000000000..733d77f4063d --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.h @@ -0,0 +1,36 @@ @@ -358,6 +345,3 @@ index 000000000000..733d77f4063d + struct icc_bulk_data icc_paths[] __counted_by(num_icc_paths); +}; +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-19-net-ethernet-qualcomm-Add-PPE-buffer-manager-configu.patch b/lede/target/linux/qualcommbe/patches-6.6/103-19-net-ethernet-qualcomm-Add-PPE-buffer-manager-configu.patch index cc470b46b5..e72069c1fa 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-19-net-ethernet-qualcomm-Add-PPE-buffer-manager-configu.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-19-net-ethernet-qualcomm-Add-PPE-buffer-manager-configu.patch @@ -23,8 +23,6 @@ Signed-off-by: Luo Jie create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_config.h create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index 63d50d3b4f2e..410a7bb54cfe 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -4,4 +4,4 @@ @@ -33,8 +31,6 @@ index 63d50d3b4f2e..410a7bb54cfe 100644 obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o -qcom-ppe-objs := ppe.o +qcom-ppe-objs := ppe.o ppe_config.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.c b/drivers/net/ethernet/qualcomm/ppe/ppe.c -index 14998ac771c7..443706291ce0 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.c @@ -15,6 +15,7 @@ @@ -45,7 +41,7 @@ index 14998ac771c7..443706291ce0 100644 #define PPE_PORT_MAX 8 #define PPE_CLK_RATE 353000000 -@@ -201,6 +202,10 @@ static int qcom_ppe_probe(struct platform_device *pdev) +@@ -201,6 +202,10 @@ static int qcom_ppe_probe(struct platfor if (ret) return dev_err_probe(dev, ret, "PPE clock config failed\n"); @@ -56,9 +52,6 @@ index 14998ac771c7..443706291ce0 100644 platform_set_drvdata(pdev, ppe_dev); return 0; -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -new file mode 100644 -index 000000000000..0ba4efdfd509 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -0,0 +1,181 @@ @@ -243,9 +236,6 @@ index 000000000000..0ba4efdfd509 +{ + return ppe_config_bm(ppe_dev); +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h -new file mode 100644 -index 000000000000..7e66019de799 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -0,0 +1,10 @@ @@ -259,9 +249,6 @@ index 000000000000..7e66019de799 + +int ppe_hw_config(struct ppe_device *ppe_dev); +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -new file mode 100644 -index 000000000000..bf25e0acc0f6 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -0,0 +1,54 @@ @@ -319,6 +306,3 @@ index 000000000000..bf25e0acc0f6 + u32p_replace_bits((u32 *)(tbl_cfg) + 0x1, value, PPE_BM_PORT_FC_W1_PRE_ALLOC) + +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-20-net-ethernet-qualcomm-Add-PPE-queue-management-confi.patch b/lede/target/linux/qualcommbe/patches-6.6/103-20-net-ethernet-qualcomm-Add-PPE-queue-management-confi.patch index e24fb6987b..fb432a767f 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-20-net-ethernet-qualcomm-Add-PPE-queue-management-confi.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-20-net-ethernet-qualcomm-Add-PPE-queue-management-confi.patch @@ -18,8 +18,6 @@ Signed-off-by: Luo Jie drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 82 ++++++++ 2 files changed, 257 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index 0ba4efdfd509..4192fdc8d3a3 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -43,6 +43,27 @@ struct ppe_bm_port_config { @@ -50,7 +48,7 @@ index 0ba4efdfd509..4192fdc8d3a3 100644 static int ipq9574_ppe_bm_group_config = 1550; static struct ppe_bm_port_config ipq9574_ppe_bm_port_config[] = { { -@@ -91,6 +112,31 @@ static struct ppe_bm_port_config ipq9574_ppe_bm_port_config[] = { +@@ -91,6 +112,31 @@ static struct ppe_bm_port_config ipq9574 }, }; @@ -82,7 +80,7 @@ index 0ba4efdfd509..4192fdc8d3a3 100644 static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, struct ppe_bm_port_config port_cfg) { -@@ -175,7 +221,135 @@ static int ppe_config_bm(struct ppe_device *ppe_dev) +@@ -175,7 +221,135 @@ bm_config_fail: return ret; } @@ -219,8 +217,6 @@ index 0ba4efdfd509..4192fdc8d3a3 100644 + + return ppe_config_qm(ppe_dev); } -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index bf25e0acc0f6..0bc13979e5e2 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -11,6 +11,14 @@ @@ -317,6 +313,3 @@ index bf25e0acc0f6..0bc13979e5e2 100644 +#define PPE_ENQ_OPR_TBL_ENQ_DISABLE BIT(0) + #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-21-net-ethernet-qualcomm-Add-PPE-scheduler-config.patch b/lede/target/linux/qualcommbe/patches-6.6/103-21-net-ethernet-qualcomm-Add-PPE-scheduler-config.patch index 01716e322d..7a51c3e666 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-21-net-ethernet-qualcomm-Add-PPE-scheduler-config.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-21-net-ethernet-qualcomm-Add-PPE-scheduler-config.patch @@ -20,8 +20,6 @@ Signed-off-by: Luo Jie create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_api.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_api.h -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index 410a7bb54cfe..e4e5c94fde3e 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -4,4 +4,4 @@ @@ -30,9 +28,6 @@ index 410a7bb54cfe..e4e5c94fde3e 100644 obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o -qcom-ppe-objs := ppe.o ppe_config.o +qcom-ppe-objs := ppe.o ppe_config.o ppe_api.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_api.c b/drivers/net/ethernet/qualcomm/ppe/ppe_api.c -new file mode 100644 -index 000000000000..ba35fc151e2c --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_api.c @@ -0,0 +1,40 @@ @@ -76,9 +71,6 @@ index 000000000000..ba35fc151e2c + + return ppe_queue_scheduler_set(ppe_dev, node_id, level, port, sch_cfg); +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_api.h b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h -new file mode 100644 -index 000000000000..ee5b47d06991 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h @@ -0,0 +1,21 @@ @@ -103,8 +95,6 @@ index 000000000000..ee5b47d06991 +int ppe_queue_priority_set(struct ppe_device *ppe_dev, + int queue_id, int priority); +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index 4192fdc8d3a3..bdef26da6fd3 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -13,6 +13,7 @@ @@ -185,7 +175,7 @@ index 4192fdc8d3a3..bdef26da6fd3 100644 static int ipq9574_ppe_bm_group_config = 1550; static struct ppe_bm_port_config ipq9574_ppe_bm_port_config[] = { { -@@ -137,6 +192,707 @@ static struct ppe_qm_queue_config ipq9574_ppe_qm_queue_config[] = { +@@ -137,6 +192,707 @@ static struct ppe_qm_queue_config ipq957 }, }; @@ -893,7 +883,7 @@ index 4192fdc8d3a3..bdef26da6fd3 100644 static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, struct ppe_bm_port_config port_cfg) { -@@ -343,6 +1099,126 @@ static int ppe_config_qm(struct ppe_device *ppe_dev) +@@ -343,6 +1099,126 @@ qm_config_fail: return ret; } @@ -1020,7 +1010,7 @@ index 4192fdc8d3a3..bdef26da6fd3 100644 int ppe_hw_config(struct ppe_device *ppe_dev) { int ret; -@@ -351,5 +1227,9 @@ int ppe_hw_config(struct ppe_device *ppe_dev) +@@ -351,5 +1227,9 @@ int ppe_hw_config(struct ppe_device *ppe if (ret) return ret; @@ -1031,8 +1021,6 @@ index 4192fdc8d3a3..bdef26da6fd3 100644 + + return ppe_config_scheduler(ppe_dev); } -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h -index 7e66019de799..167a114031fd 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -6,5 +6,31 @@ @@ -1067,8 +1055,6 @@ index 7e66019de799..167a114031fd 100644 + int node_id, bool flow_level, int *port, + struct ppe_qos_scheduler_cfg *scheduler_cfg); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 0bc13979e5e2..0279f1023bcf 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -11,14 +11,108 @@ @@ -1180,6 +1166,3 @@ index 0bc13979e5e2..0279f1023bcf 100644 #define PPE_BM_PORT_FC_MODE_ADDR 0x600100 #define PPE_BM_PORT_FC_MODE_INC 0x4 #define PPE_BM_PORT_FC_MODE_EN BIT(0) --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-22-net-ethernet-qualcomm-Initialize-PPE-queue-settings.patch b/lede/target/linux/qualcommbe/patches-6.6/103-22-net-ethernet-qualcomm-Initialize-PPE-queue-settings.patch index 5b6bf5abcb..dd70cf29ee 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-22-net-ethernet-qualcomm-Initialize-PPE-queue-settings.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-22-net-ethernet-qualcomm-Initialize-PPE-queue-settings.patch @@ -20,11 +20,9 @@ Signed-off-by: Luo Jie drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 16 + 5 files changed, 496 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_api.c b/drivers/net/ethernet/qualcomm/ppe/ppe_api.c -index ba35fc151e2c..72d416e0ca44 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_api.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_api.c -@@ -38,3 +38,47 @@ int ppe_queue_priority_set(struct ppe_device *ppe_dev, +@@ -38,3 +38,47 @@ int ppe_queue_priority_set(struct ppe_de return ppe_queue_scheduler_set(ppe_dev, node_id, level, port, sch_cfg); } @@ -72,8 +70,6 @@ index ba35fc151e2c..72d416e0ca44 100644 + + return ppe_port_resource_get(ppe_dev, 0, type, res_start, res_end); +}; -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_api.h b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h -index ee5b47d06991..c8aa8945f90f 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_api.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h @@ -15,7 +15,41 @@ @@ -118,8 +114,6 @@ index ee5b47d06991..c8aa8945f90f 100644 +int ppe_edma_queue_resource_get(struct ppe_device *ppe_dev, int type, + int *res_start, int *res_end); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index bdef26da6fd3..ac90d33aecba 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -119,6 +119,34 @@ struct ppe_port_schedule_config { @@ -157,7 +151,7 @@ index bdef26da6fd3..ac90d33aecba 100644 static int ipq9574_ppe_bm_group_config = 1550; static struct ppe_bm_port_config ipq9574_ppe_bm_port_config[] = { { -@@ -648,6 +676,111 @@ static struct ppe_port_schedule_config ppe_qos_schedule_config[] = { +@@ -648,6 +676,111 @@ static struct ppe_port_schedule_config p }, }; @@ -269,7 +263,7 @@ index bdef26da6fd3..ac90d33aecba 100644 /* Set the first level scheduler configuration. */ static int ppe_scheduler_l0_queue_map_set(struct ppe_device *ppe_dev, int node_id, int port, -@@ -893,6 +1026,147 @@ int ppe_queue_scheduler_get(struct ppe_device *ppe_dev, +@@ -893,6 +1026,147 @@ int ppe_queue_scheduler_get(struct ppe_d port, scheduler_cfg); } @@ -417,7 +411,7 @@ index bdef26da6fd3..ac90d33aecba 100644 static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, struct ppe_bm_port_config port_cfg) { -@@ -1219,6 +1493,88 @@ static int ppe_config_scheduler(struct ppe_device *ppe_dev) +@@ -1219,6 +1493,88 @@ sch_config_fail: return ret; }; @@ -506,7 +500,7 @@ index bdef26da6fd3..ac90d33aecba 100644 int ppe_hw_config(struct ppe_device *ppe_dev) { int ret; -@@ -1231,5 +1587,9 @@ int ppe_hw_config(struct ppe_device *ppe_dev) +@@ -1231,5 +1587,9 @@ int ppe_hw_config(struct ppe_device *ppe if (ret) return ret; @@ -517,8 +511,6 @@ index bdef26da6fd3..ac90d33aecba 100644 + + return ppe_dev_hw_init(ppe_dev); } -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h -index 167a114031fd..676c4ec45f6f 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -6,6 +6,13 @@ @@ -562,7 +554,7 @@ index 167a114031fd..676c4ec45f6f 100644 int ppe_hw_config(struct ppe_device *ppe_dev); int ppe_queue_scheduler_set(struct ppe_device *ppe_dev, int node_id, bool flow_level, int port, -@@ -33,4 +60,18 @@ int ppe_queue_scheduler_set(struct ppe_device *ppe_dev, +@@ -33,4 +60,18 @@ int ppe_queue_scheduler_set(struct ppe_d int ppe_queue_scheduler_get(struct ppe_device *ppe_dev, int node_id, bool flow_level, int *port, struct ppe_qos_scheduler_cfg *scheduler_cfg); @@ -581,8 +573,6 @@ index 167a114031fd..676c4ec45f6f 100644 +int ppe_port_resource_get(struct ppe_device *ppe_dev, int port, int type, + int *res_start, int *res_end); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 0279f1023bcf..1f6828237f94 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -153,6 +153,22 @@ @@ -608,6 +598,3 @@ index 0279f1023bcf..1f6828237f94 100644 /* PPE unicast queue (0-255) configurations. */ #define PPE_AC_UNI_QUEUE_CFG_TBL_ADDR 0x848000 #define PPE_AC_UNI_QUEUE_CFG_TBL_NUM 256 --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-23-net-ethernet-qualcomm-Add-PPE-service-code-config.patch b/lede/target/linux/qualcommbe/patches-6.6/103-23-net-ethernet-qualcomm-Add-PPE-service-code-config.patch index 3a390ef229..d4b9cfc4d5 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-23-net-ethernet-qualcomm-Add-PPE-service-code-config.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-23-net-ethernet-qualcomm-Add-PPE-service-code-config.patch @@ -20,8 +20,6 @@ Signed-off-by: Luo Jie drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 48 ++++++ 4 files changed, 290 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_api.h b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h -index c8aa8945f90f..ecdae4b95667 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_api.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h @@ -18,6 +18,9 @@ @@ -34,8 +32,6 @@ index c8aa8945f90f..ecdae4b95667 100644 /** * enum ppe_queue_class_type - PPE queue class type * @PPE_QUEUE_CLASS_PRIORITY: Queue offset configured from internal priority -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index ac90d33aecba..a8e7a536a6e0 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c @@ -8,6 +8,7 @@ @@ -46,7 +42,7 @@ index ac90d33aecba..a8e7a536a6e0 100644 #include #include #include -@@ -1167,6 +1168,76 @@ int ppe_port_resource_get(struct ppe_device *ppe_dev, int port, int type, +@@ -1167,6 +1168,76 @@ int ppe_port_resource_get(struct ppe_dev return 0; } @@ -123,7 +119,7 @@ index ac90d33aecba..a8e7a536a6e0 100644 static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, struct ppe_bm_port_config port_cfg) { -@@ -1569,10 +1640,35 @@ static int ppe_queue_dest_init(struct ppe_device *ppe_dev) +@@ -1569,10 +1640,35 @@ static int ppe_queue_dest_init(struct pp return 0; } @@ -160,8 +156,6 @@ index ac90d33aecba..a8e7a536a6e0 100644 } int ppe_hw_config(struct ppe_device *ppe_dev) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h -index 676c4ec45f6f..dcb557ed843c 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -6,6 +6,8 @@ @@ -317,7 +311,7 @@ index 676c4ec45f6f..dcb557ed843c 100644 int ppe_hw_config(struct ppe_device *ppe_dev); int ppe_queue_scheduler_set(struct ppe_device *ppe_dev, int node_id, bool flow_level, int port, -@@ -74,4 +213,7 @@ int ppe_queue_ucast_hash_class_set(struct ppe_device *ppe_dev, +@@ -74,4 +213,7 @@ int ppe_queue_ucast_hash_class_set(struc int class_offset); int ppe_port_resource_get(struct ppe_device *ppe_dev, int port, int type, int *res_start, int *res_end); @@ -325,8 +319,6 @@ index 676c4ec45f6f..dcb557ed843c 100644 + int servcode, + struct ppe_servcode_cfg cfg); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 1f6828237f94..3122743af98d 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -27,9 +27,57 @@ @@ -387,6 +379,3 @@ index 1f6828237f94..3122743af98d 100644 #define PPE_PSCH_SCH_DEPTH_CFG_ADDR 0x400000 #define PPE_PSCH_SCH_DEPTH_CFG_NUM 1 #define PPE_PSCH_SCH_DEPTH_CFG_INC 4 --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-24-net-ethernet-qualcomm-Add-PPE-port-control-config.patch b/lede/target/linux/qualcommbe/patches-6.6/103-24-net-ethernet-qualcomm-Add-PPE-port-control-config.patch index a55b09b2bf..2751e2bc20 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-24-net-ethernet-qualcomm-Add-PPE-port-control-config.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-24-net-ethernet-qualcomm-Add-PPE-port-control-config.patch @@ -15,11 +15,9 @@ Signed-off-by: Luo Jie drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 50 ++++++++++ 3 files changed, 151 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index a8e7a536a6e0..18296a449d4e 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -@@ -1238,6 +1238,50 @@ int ppe_servcode_config_set(struct ppe_device *ppe_dev, int servcode, +@@ -1238,6 +1238,50 @@ int ppe_servcode_config_set(struct ppe_d return regmap_write(ppe_dev->regmap, reg, val); } @@ -70,7 +68,7 @@ index a8e7a536a6e0..18296a449d4e 100644 static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, struct ppe_bm_port_config port_cfg) { -@@ -1659,6 +1703,47 @@ static int ppe_servcode_init(struct ppe_device *ppe_dev) +@@ -1659,6 +1703,47 @@ static int ppe_servcode_init(struct ppe_ return ppe_servcode_config_set(ppe_dev, PPE_EDMA_SC_BYPASS_ID, servcode_cfg); } @@ -118,7 +116,7 @@ index a8e7a536a6e0..18296a449d4e 100644 /* Initialize PPE device to handle traffic correctly. */ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) { -@@ -1668,7 +1753,11 @@ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) +@@ -1668,7 +1753,11 @@ static int ppe_dev_hw_init(struct ppe_de if (ret) return ret; @@ -131,8 +129,6 @@ index a8e7a536a6e0..18296a449d4e 100644 } int ppe_hw_config(struct ppe_device *ppe_dev) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h -index dcb557ed843c..7f5d92c39dd3 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -192,6 +192,16 @@ struct ppe_servcode_cfg { @@ -152,14 +148,12 @@ index dcb557ed843c..7f5d92c39dd3 100644 int ppe_hw_config(struct ppe_device *ppe_dev); int ppe_queue_scheduler_set(struct ppe_device *ppe_dev, int node_id, bool flow_level, int port, -@@ -216,4 +226,5 @@ int ppe_port_resource_get(struct ppe_device *ppe_dev, int port, int type, +@@ -216,4 +226,5 @@ int ppe_port_resource_get(struct ppe_dev int ppe_servcode_config_set(struct ppe_device *ppe_dev, int servcode, struct ppe_servcode_cfg cfg); +int ppe_counter_set(struct ppe_device *ppe_dev, int port, bool enable); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 3122743af98d..e981a1c0e670 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -18,6 +18,11 @@ @@ -233,6 +227,3 @@ index 3122743af98d..e981a1c0e670 100644 #define PPE_IN_L2_SERVICE_TBL_ADDR 0x66000 #define PPE_IN_L2_SERVICE_TBL_NUM 256 #define PPE_IN_L2_SERVICE_TBL_INC 0x10 --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-25-net-ethernet-qualcomm-Add-PPE-RSS-hash-config.patch b/lede/target/linux/qualcommbe/patches-6.6/103-25-net-ethernet-qualcomm-Add-PPE-RSS-hash-config.patch index 6ee4e340fd..eaefbf0905 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-25-net-ethernet-qualcomm-Add-PPE-RSS-hash-config.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-25-net-ethernet-qualcomm-Add-PPE-RSS-hash-config.patch @@ -15,11 +15,9 @@ Signed-off-by: Luo Jie drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 47 +++++ 3 files changed, 263 insertions(+), 2 deletions(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index 18296a449d4e..4363ea3cfb90 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -@@ -1282,6 +1282,143 @@ int ppe_counter_set(struct ppe_device *ppe_dev, int port, bool enable) +@@ -1282,6 +1282,143 @@ int ppe_counter_set(struct ppe_device *p val); } @@ -163,7 +161,7 @@ index 18296a449d4e..4363ea3cfb90 100644 static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, struct ppe_bm_port_config port_cfg) { -@@ -1324,7 +1461,7 @@ static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, +@@ -1324,7 +1461,7 @@ static int ppe_config_bm_threshold(struc return regmap_update_bits(ppe_dev->regmap, reg, PPE_BM_PORT_FC_MODE_EN, val); @@ -172,7 +170,7 @@ index 18296a449d4e..4363ea3cfb90 100644 /* Configure the buffer threshold for the port flow control function. */ static int ppe_config_bm(struct ppe_device *ppe_dev) -@@ -1744,6 +1881,43 @@ static int ppe_port_ctrl_init(struct ppe_device *ppe_dev) +@@ -1744,6 +1881,43 @@ static int ppe_port_ctrl_init(struct ppe return ppe_counter_set(ppe_dev, 0, true); } @@ -216,7 +214,7 @@ index 18296a449d4e..4363ea3cfb90 100644 /* Initialize PPE device to handle traffic correctly. */ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) { -@@ -1757,7 +1931,11 @@ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) +@@ -1757,7 +1931,11 @@ static int ppe_dev_hw_init(struct ppe_de if (ret) return ret; @@ -229,8 +227,6 @@ index 18296a449d4e..4363ea3cfb90 100644 } int ppe_hw_config(struct ppe_device *ppe_dev) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h -index 7f5d92c39dd3..6dd91bc45908 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -15,6 +15,11 @@ @@ -281,15 +277,13 @@ index 7f5d92c39dd3..6dd91bc45908 100644 int ppe_hw_config(struct ppe_device *ppe_dev); int ppe_queue_scheduler_set(struct ppe_device *ppe_dev, int node_id, bool flow_level, int port, -@@ -227,4 +261,6 @@ int ppe_servcode_config_set(struct ppe_device *ppe_dev, +@@ -227,4 +261,6 @@ int ppe_servcode_config_set(struct ppe_d int servcode, struct ppe_servcode_cfg cfg); int ppe_counter_set(struct ppe_device *ppe_dev, int port, bool enable); +int ppe_rss_hash_config_set(struct ppe_device *ppe_dev, int mode, + struct ppe_rss_hash_cfg hash_cfg); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index e981a1c0e670..29001a2599d8 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -23,6 +23,53 @@ @@ -346,6 +340,3 @@ index e981a1c0e670..29001a2599d8 100644 #define PPE_BM_SCH_CFG_TBL_ADDR 0xc000 #define PPE_BM_SCH_CFG_TBL_NUM 128 #define PPE_BM_SCH_CFG_TBL_INC 0x10 --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-26-net-ethernet-qualcomm-Add-PPE-queue-map-function.patch b/lede/target/linux/qualcommbe/patches-6.6/103-26-net-ethernet-qualcomm-Add-PPE-queue-map-function.patch index c390be4b82..38405cc7fe 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-26-net-ethernet-qualcomm-Add-PPE-queue-map-function.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-26-net-ethernet-qualcomm-Add-PPE-queue-map-function.patch @@ -18,11 +18,9 @@ Signed-off-by: Luo Jie drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 5 +++ 5 files changed, 79 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_api.c b/drivers/net/ethernet/qualcomm/ppe/ppe_api.c -index 72d416e0ca44..6199c7025f66 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_api.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_api.c -@@ -82,3 +82,26 @@ int ppe_edma_queue_resource_get(struct ppe_device *ppe_dev, int type, +@@ -82,3 +82,26 @@ int ppe_edma_queue_resource_get(struct p return ppe_port_resource_get(ppe_dev, 0, type, res_start, res_end); }; @@ -49,22 +47,18 @@ index 72d416e0ca44..6199c7025f66 100644 + + return ppe_ring_queue_map_set(ppe_dev, ring_id, queue_bmap); +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_api.h b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h -index ecdae4b95667..2135b5383bcd 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_api.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_api.h -@@ -55,4 +55,6 @@ int ppe_edma_queue_offset_config(struct ppe_device *ppe_dev, +@@ -55,4 +55,6 @@ int ppe_edma_queue_offset_config(struct int index, int queue_offset); int ppe_edma_queue_resource_get(struct ppe_device *ppe_dev, int type, int *res_start, int *res_end); +int ppe_edma_ring_to_queues_config(struct ppe_device *ppe_dev, int ring_id, + int num, int queues[] __counted_by(num)); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index 4363ea3cfb90..a19a6472e4ed 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -@@ -1419,6 +1419,28 @@ int ppe_rss_hash_config_set(struct ppe_device *ppe_dev, int mode, +@@ -1419,6 +1419,28 @@ int ppe_rss_hash_config_set(struct ppe_d return 0; } @@ -93,7 +87,7 @@ index 4363ea3cfb90..a19a6472e4ed 100644 static int ppe_config_bm_threshold(struct ppe_device *ppe_dev, int bm_port_id, struct ppe_bm_port_config port_cfg) { -@@ -1918,6 +1940,23 @@ static int ppe_rss_hash_init(struct ppe_device *ppe_dev) +@@ -1918,6 +1940,23 @@ static int ppe_rss_hash_init(struct ppe_ return ppe_rss_hash_config_set(ppe_dev, PPE_RSS_HASH_MODE_IPV6, hash_cfg); } @@ -117,7 +111,7 @@ index 4363ea3cfb90..a19a6472e4ed 100644 /* Initialize PPE device to handle traffic correctly. */ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) { -@@ -1935,7 +1974,11 @@ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) +@@ -1935,7 +1974,11 @@ static int ppe_dev_hw_init(struct ppe_de if (ret) return ret; @@ -130,8 +124,6 @@ index 4363ea3cfb90..a19a6472e4ed 100644 } int ppe_hw_config(struct ppe_device *ppe_dev) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h -index 6dd91bc45908..9be749800f14 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.h @@ -20,6 +20,8 @@ @@ -143,7 +135,7 @@ index 6dd91bc45908..9be749800f14 100644 /** * struct ppe_qos_scheduler_cfg - PPE QoS scheduler configuration. * @flow_id: PPE flow ID. -@@ -263,4 +265,7 @@ int ppe_servcode_config_set(struct ppe_device *ppe_dev, +@@ -263,4 +265,7 @@ int ppe_servcode_config_set(struct ppe_d int ppe_counter_set(struct ppe_device *ppe_dev, int port, bool enable); int ppe_rss_hash_config_set(struct ppe_device *ppe_dev, int mode, struct ppe_rss_hash_cfg hash_cfg); @@ -151,8 +143,6 @@ index 6dd91bc45908..9be749800f14 100644 + int ring_id, + u32 *queue_map); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 29001a2599d8..8c6cd6b52b0f 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -212,6 +212,11 @@ @@ -167,6 +157,3 @@ index 29001a2599d8..8c6cd6b52b0f 100644 #define PPE_DEQ_OPR_TBL_ADDR 0x430000 #define PPE_DEQ_OPR_TBL_NUM 300 #define PPE_DEQ_OPR_TBL_INC 0x10 --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-27-net-ethernet-qualcomm-Add-PPE-L2-bridge-initializati.patch b/lede/target/linux/qualcommbe/patches-6.6/103-27-net-ethernet-qualcomm-Add-PPE-L2-bridge-initializati.patch index 99845d3a59..24e1edf23a 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-27-net-ethernet-qualcomm-Add-PPE-L2-bridge-initializati.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-27-net-ethernet-qualcomm-Add-PPE-L2-bridge-initializati.patch @@ -17,11 +17,9 @@ Signed-off-by: Lei Wei drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 54 +++++++++++++++ 2 files changed, 121 insertions(+), 1 deletion(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -index a19a6472e4ed..621f4f0ba9e2 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c -@@ -1957,6 +1957,68 @@ static int ppe_queues_to_ring_init(struct ppe_device *ppe_dev) +@@ -1957,6 +1957,68 @@ static int ppe_queues_to_ring_init(struc return ppe_ring_queue_map_set(ppe_dev, 0, queue_bmap); } @@ -90,7 +88,7 @@ index a19a6472e4ed..621f4f0ba9e2 100644 /* Initialize PPE device to handle traffic correctly. */ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) { -@@ -1978,7 +2040,11 @@ static int ppe_dev_hw_init(struct ppe_device *ppe_dev) +@@ -1978,7 +2040,11 @@ static int ppe_dev_hw_init(struct ppe_de if (ret) return ret; @@ -103,8 +101,6 @@ index a19a6472e4ed..621f4f0ba9e2 100644 } int ppe_hw_config(struct ppe_device *ppe_dev) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 8c6cd6b52b0f..7f06843e4151 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -126,6 +126,18 @@ @@ -182,6 +178,3 @@ index 8c6cd6b52b0f..7f06843e4151 100644 #define PPE_TL_SERVICE_TBL_ADDR 0x306000 #define PPE_TL_SERVICE_TBL_NUM 256 #define PPE_TL_SERVICE_TBL_INC 4 --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-28-net-ethernet-qualcomm-Add-PPE-debugfs-support.patch b/lede/target/linux/qualcommbe/patches-6.6/103-28-net-ethernet-qualcomm-Add-PPE-debugfs-support.patch index 314771763c..6c3f408cee 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-28-net-ethernet-qualcomm-Add-PPE-debugfs-support.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-28-net-ethernet-qualcomm-Add-PPE-debugfs-support.patch @@ -19,8 +19,6 @@ Signed-off-by: Luo Jie create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.h -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index e4e5c94fde3e..227af2168224 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -4,4 +4,4 @@ @@ -29,8 +27,6 @@ index e4e5c94fde3e..227af2168224 100644 obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o -qcom-ppe-objs := ppe.o ppe_config.o ppe_api.o +qcom-ppe-objs := ppe.o ppe_config.o ppe_api.o ppe_debugfs.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.c b/drivers/net/ethernet/qualcomm/ppe/ppe.c -index 443706291ce0..8cf6c1161c4b 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.c @@ -16,6 +16,7 @@ @@ -41,7 +37,7 @@ index 443706291ce0..8cf6c1161c4b 100644 #define PPE_PORT_MAX 8 #define PPE_CLK_RATE 353000000 -@@ -206,11 +207,20 @@ static int qcom_ppe_probe(struct platform_device *pdev) +@@ -206,11 +207,20 @@ static int qcom_ppe_probe(struct platfor if (ret) return dev_err_probe(dev, ret, "PPE HW config failed\n"); @@ -62,7 +58,7 @@ index 443706291ce0..8cf6c1161c4b 100644 static const struct of_device_id qcom_ppe_of_match[] = { { .compatible = "qcom,ipq9574-ppe" }, {}, -@@ -223,6 +233,7 @@ static struct platform_driver qcom_ppe_driver = { +@@ -223,6 +233,7 @@ static struct platform_driver qcom_ppe_d .of_match_table = qcom_ppe_of_match, }, .probe = qcom_ppe_probe, @@ -70,8 +66,6 @@ index 443706291ce0..8cf6c1161c4b 100644 }; module_platform_driver(qcom_ppe_driver); -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.h b/drivers/net/ethernet/qualcomm/ppe/ppe.h -index 733d77f4063d..a2a5d1901547 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.h @@ -11,6 +11,7 @@ @@ -98,9 +92,6 @@ index 733d77f4063d..a2a5d1901547 100644 unsigned int num_icc_paths; struct icc_bulk_data icc_paths[] __counted_by(num_icc_paths); }; -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c -new file mode 100644 -index 000000000000..1cd4c491e724 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c @@ -0,0 +1,725 @@ @@ -829,9 +820,6 @@ index 000000000000..1cd4c491e724 + debugfs_remove_recursive(ppe_dev->debugfs_root); + ppe_dev->debugfs_root = NULL; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.h -new file mode 100644 -index 000000000000..a979fcf9d742 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.h @@ -0,0 +1,16 @@ @@ -851,8 +839,6 @@ index 000000000000..a979fcf9d742 +void ppe_debugfs_teardown(struct ppe_device *ppe_dev); + +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 7f06843e4151..e84633d0f572 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -23,6 +23,43 @@ @@ -981,6 +967,3 @@ index 7f06843e4151..e84633d0f572 100644 #define PPE_ENQ_OPR_TBL_ADDR 0x85c000 #define PPE_ENQ_OPR_TBL_NUM 300 #define PPE_ENQ_OPR_TBL_INC 0x10 --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-32-net-ethernet-qualcomm-Add-phylink-support-for-PPE-MA.patch b/lede/target/linux/qualcommbe/patches-6.6/103-32-net-ethernet-qualcomm-Add-phylink-support-for-PPE-MA.patch index d89ae3af54..c791719926 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-32-net-ethernet-qualcomm-Add-phylink-support-for-PPE-MA.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-32-net-ethernet-qualcomm-Add-phylink-support-for-PPE-MA.patch @@ -20,8 +20,6 @@ Signed-off-by: Lei Wei create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_port.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/ppe_port.h -diff --git a/drivers/net/ethernet/qualcomm/Kconfig b/drivers/net/ethernet/qualcomm/Kconfig -index 8cc24da48777..a96f6acd4561 100644 --- a/drivers/net/ethernet/qualcomm/Kconfig +++ b/drivers/net/ethernet/qualcomm/Kconfig @@ -66,6 +66,9 @@ config QCOM_PPE @@ -34,8 +32,6 @@ index 8cc24da48777..a96f6acd4561 100644 help This driver supports the Qualcomm Technologies, Inc. packet process engine (PPE) available with IPQ SoC. The PPE houses -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index 227af2168224..76cdc423a8cc 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -4,4 +4,4 @@ @@ -44,8 +40,6 @@ index 227af2168224..76cdc423a8cc 100644 obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o -qcom-ppe-objs := ppe.o ppe_config.o ppe_api.o ppe_debugfs.o +qcom-ppe-objs := ppe.o ppe_config.o ppe_api.o ppe_debugfs.o ppe_port.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.c b/drivers/net/ethernet/qualcomm/ppe/ppe.c -index 8cf6c1161c4b..bcf21c838e05 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.c @@ -17,6 +17,7 @@ @@ -56,7 +50,7 @@ index 8cf6c1161c4b..bcf21c838e05 100644 #define PPE_PORT_MAX 8 #define PPE_CLK_RATE 353000000 -@@ -207,6 +208,11 @@ static int qcom_ppe_probe(struct platform_device *pdev) +@@ -207,6 +208,11 @@ static int qcom_ppe_probe(struct platfor if (ret) return dev_err_probe(dev, ret, "PPE HW config failed\n"); @@ -68,7 +62,7 @@ index 8cf6c1161c4b..bcf21c838e05 100644 ppe_debugfs_setup(ppe_dev); platform_set_drvdata(pdev, ppe_dev); -@@ -219,6 +225,9 @@ static void qcom_ppe_remove(struct platform_device *pdev) +@@ -219,6 +225,9 @@ static void qcom_ppe_remove(struct platf ppe_dev = platform_get_drvdata(pdev); ppe_debugfs_teardown(ppe_dev); @@ -78,8 +72,6 @@ index 8cf6c1161c4b..bcf21c838e05 100644 } static const struct of_device_id qcom_ppe_of_match[] = { -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.h b/drivers/net/ethernet/qualcomm/ppe/ppe.h -index a2a5d1901547..020d5df2c5e3 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.h @@ -20,6 +20,7 @@ struct dentry; @@ -98,9 +90,6 @@ index a2a5d1901547..020d5df2c5e3 100644 unsigned int num_icc_paths; struct icc_bulk_data icc_paths[] __counted_by(num_icc_paths); }; -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c -new file mode 100644 -index 000000000000..dcc13889089e --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c @@ -0,0 +1,728 @@ @@ -832,9 +821,6 @@ index 000000000000..dcc13889089e + ppe_port_clock_deinit(ppe_port); + } +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.h b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h -new file mode 100644 -index 000000000000..194f65815011 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h @@ -0,0 +1,76 @@ @@ -914,8 +900,6 @@ index 000000000000..194f65815011 + struct net_device *netdev); +void ppe_port_phylink_destroy(struct ppe_port *ppe_port); +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index e84633d0f572..34b659ac0c37 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -7,6 +7,17 @@ @@ -1053,6 +1037,3 @@ index e84633d0f572..34b659ac0c37 100644 +#define XGMAC_CNTRST BIT(0) + #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-33-net-ethernet-qualcomm-Add-PPE-port-MAC-MIB-statistic.patch b/lede/target/linux/qualcommbe/patches-6.6/103-33-net-ethernet-qualcomm-Add-PPE-port-MAC-MIB-statistic.patch index e3a57a976f..edf62dd057 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-33-net-ethernet-qualcomm-Add-PPE-port-MAC-MIB-statistic.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-33-net-ethernet-qualcomm-Add-PPE-port-MAC-MIB-statistic.patch @@ -16,8 +16,6 @@ Signed-off-by: Lei Wei drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 91 ++++ 3 files changed, 569 insertions(+) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c -index dcc13889089e..284ee14b8d03 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c @@ -23,6 +23,122 @@ @@ -143,7 +141,7 @@ index dcc13889089e..284ee14b8d03 100644 /* PPE port clock and reset name */ static const char * const ppe_port_clk_rst_name[] = { [PPE_PORT_CLK_RST_MAC] = "port_mac", -@@ -30,6 +146,322 @@ static const char * const ppe_port_clk_rst_name[] = { +@@ -30,6 +146,322 @@ static const char * const ppe_port_clk_r [PPE_PORT_CLK_RST_TX] = "port_tx", }; @@ -466,7 +464,7 @@ index dcc13889089e..284ee14b8d03 100644 /* PPE port and MAC reset */ static int ppe_port_mac_reset(struct ppe_port *ppe_port) { -@@ -261,6 +693,9 @@ static void ppe_port_mac_link_up(struct phylink_config *config, +@@ -261,6 +693,9 @@ static void ppe_port_mac_link_up(struct int ret, port = ppe_port->port_id; u32 reg, val; @@ -476,7 +474,7 @@ index dcc13889089e..284ee14b8d03 100644 if (mac_type == PPE_MAC_TYPE_GMAC) ret = ppe_port_gmac_link_up(ppe_port, speed, duplex, tx_pause, rx_pause); -@@ -306,6 +741,9 @@ static void ppe_port_mac_link_down(struct phylink_config *config, +@@ -306,6 +741,9 @@ static void ppe_port_mac_link_down(struc int ret, port = ppe_port->port_id; u32 reg; @@ -486,7 +484,7 @@ index dcc13889089e..284ee14b8d03 100644 /* Disable PPE port TX */ reg = PPE_PORT_BRIDGE_CTRL_ADDR + PPE_PORT_BRIDGE_CTRL_INC * port; ret = regmap_update_bits(ppe_dev->regmap, reg, -@@ -627,6 +1065,27 @@ static int ppe_port_mac_hw_init(struct ppe_port *ppe_port) +@@ -627,6 +1065,27 @@ static int ppe_port_mac_hw_init(struct p return ret; } @@ -514,7 +512,7 @@ index dcc13889089e..284ee14b8d03 100644 /** * ppe_port_mac_init() - Initialization of PPE ports for the PPE device * @ppe_dev: PPE device -@@ -693,6 +1152,12 @@ int ppe_port_mac_init(struct ppe_device *ppe_dev) +@@ -693,6 +1152,12 @@ int ppe_port_mac_init(struct ppe_device goto err_port_node; } @@ -527,8 +525,6 @@ index dcc13889089e..284ee14b8d03 100644 i++; } -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.h b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h -index 194f65815011..a524d90e1446 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_port.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h @@ -8,6 +8,8 @@ @@ -560,7 +556,7 @@ index 194f65815011..a524d90e1446 100644 }; /** -@@ -73,4 +81,9 @@ void ppe_port_mac_deinit(struct ppe_device *ppe_dev); +@@ -73,4 +81,9 @@ void ppe_port_mac_deinit(struct ppe_devi int ppe_port_phylink_setup(struct ppe_port *ppe_port, struct net_device *netdev); void ppe_port_phylink_destroy(struct ppe_port *ppe_port); @@ -570,8 +566,6 @@ index 194f65815011..a524d90e1446 100644 +void ppe_port_get_stats64(struct ppe_port *ppe_port, + struct rtnl_link_stats64 *s); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 34b659ac0c37..2cd5bd9fa446 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -606,6 +606,48 @@ @@ -677,6 +671,3 @@ index 34b659ac0c37..2cd5bd9fa446 100644 +#define XGMAC_RXDISCARDBYTE_GB_ADDR 0x9B4 + #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-34-net-ethernet-qualcomm-Add-PPE-port-MAC-address-and-E.patch b/lede/target/linux/qualcommbe/patches-6.6/103-34-net-ethernet-qualcomm-Add-PPE-port-MAC-address-and-E.patch index fc8f955666..110c6c6e47 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-34-net-ethernet-qualcomm-Add-PPE-port-MAC-address-and-E.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-34-net-ethernet-qualcomm-Add-PPE-port-MAC-address-and-E.patch @@ -15,11 +15,9 @@ Signed-off-by: Lei Wei drivers/net/ethernet/qualcomm/ppe/ppe_regs.h | 29 ++++++++ 3 files changed, 107 insertions(+) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c -index 284ee14b8d03..a9781e1197f7 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c -@@ -462,6 +462,81 @@ void ppe_port_get_stats64(struct ppe_port *ppe_port, +@@ -462,6 +462,81 @@ void ppe_port_get_stats64(struct ppe_por } } @@ -101,8 +99,6 @@ index 284ee14b8d03..a9781e1197f7 100644 /* PPE port and MAC reset */ static int ppe_port_mac_reset(struct ppe_port *ppe_port) { -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.h b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h -index a524d90e1446..2234c9bfbd9a 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_port.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h @@ -8,6 +8,7 @@ @@ -113,15 +109,13 @@ index a524d90e1446..2234c9bfbd9a 100644 struct rtnl_link_stats64; /** -@@ -86,4 +87,6 @@ void ppe_port_get_strings(struct ppe_port *ppe_port, u32 stringset, u8 *data); +@@ -86,4 +87,6 @@ void ppe_port_get_strings(struct ppe_por void ppe_port_get_ethtool_stats(struct ppe_port *ppe_port, u64 *data); void ppe_port_get_stats64(struct ppe_port *ppe_port, struct rtnl_link_stats64 *s); +int ppe_port_set_mac_address(struct ppe_port *ppe_port, const u8 *addr); +int ppe_port_set_mac_eee(struct ppe_port *ppe_port, struct ethtool_eee *eee); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 2cd5bd9fa446..6e6e469247c8 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -18,6 +18,16 @@ @@ -174,6 +168,3 @@ index 2cd5bd9fa446..6e6e469247c8 100644 /* XGMAC management counters control register */ #define XGMAC_MMC_CTRL_ADDR 0x800 #define XGMAC_MCF BIT(3) --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-35-net-ethernet-qualcomm-Add-API-to-configure-PPE-port-.patch b/lede/target/linux/qualcommbe/patches-6.6/103-35-net-ethernet-qualcomm-Add-API-to-configure-PPE-port-.patch index e75a9c027c..9d19e5eca8 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-35-net-ethernet-qualcomm-Add-API-to-configure-PPE-port-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-35-net-ethernet-qualcomm-Add-API-to-configure-PPE-port-.patch @@ -15,11 +15,9 @@ Signed-off-by: Luo Jie drivers/net/ethernet/qualcomm/ppe/ppe_port.h | 1 + 2 files changed, 45 insertions(+) -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c -index a9781e1197f7..52820e2eedf8 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c -@@ -537,6 +537,50 @@ int ppe_port_set_mac_eee(struct ppe_port *ppe_port, struct ethtool_keee *eee) +@@ -537,6 +537,50 @@ int ppe_port_set_mac_eee(struct ppe_port return ret; } @@ -70,16 +68,11 @@ index a9781e1197f7..52820e2eedf8 100644 /* PPE port and MAC reset */ static int ppe_port_mac_reset(struct ppe_port *ppe_port) { -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.h b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h -index 2234c9bfbd9a..8234e86fb401 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_port.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.h -@@ -89,4 +89,5 @@ void ppe_port_get_stats64(struct ppe_port *ppe_port, +@@ -89,4 +89,5 @@ void ppe_port_get_stats64(struct ppe_por struct rtnl_link_stats64 *s); int ppe_port_set_mac_address(struct ppe_port *ppe_port, const u8 *addr); int ppe_port_set_mac_eee(struct ppe_port *ppe_port, struct ethtool_eee *eee); +int ppe_port_set_maxframe(struct ppe_port *ppe_port, int maxframe_size); #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-38-net-ethernet-qualcomm-Add-EDMA-support-for-QCOM-IPQ9.patch b/lede/target/linux/qualcommbe/patches-6.6/103-38-net-ethernet-qualcomm-Add-EDMA-support-for-QCOM-IPQ9.patch index 8aab02bb04..ae52143282 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-38-net-ethernet-qualcomm-Add-EDMA-support-for-QCOM-IPQ9.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-38-net-ethernet-qualcomm-Add-EDMA-support-for-QCOM-IPQ9.patch @@ -21,8 +21,6 @@ Signed-off-by: Suruchi Agarwal create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma.h -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index 76cdc423a8cc..7fea135ceb36 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -5,3 +5,6 @@ @@ -33,9 +31,6 @@ index 76cdc423a8cc..7fea135ceb36 100644 +#EDMA +qcom-ppe-objs += edma.o \ No newline at end of file -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.c b/drivers/net/ethernet/qualcomm/ppe/edma.c -new file mode 100644 -index 000000000000..d7bf1f39e9e1 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma.c @@ -0,0 +1,456 @@ @@ -495,9 +490,6 @@ index 000000000000..d7bf1f39e9e1 + + return 0; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h -new file mode 100644 -index 000000000000..6bad51c976dd --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma.h @@ -0,0 +1,99 @@ @@ -600,8 +592,6 @@ index 000000000000..6bad51c976dd +int edma_setup(struct ppe_device *ppe_dev); + +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe.c b/drivers/net/ethernet/qualcomm/ppe/ppe.c -index bcf21c838e05..93f92be9dc41 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe.c @@ -14,6 +14,7 @@ @@ -612,7 +602,7 @@ index bcf21c838e05..93f92be9dc41 100644 #include "ppe.h" #include "ppe_config.h" #include "ppe_debugfs.h" -@@ -208,10 +209,16 @@ static int qcom_ppe_probe(struct platform_device *pdev) +@@ -208,10 +209,16 @@ static int qcom_ppe_probe(struct platfor if (ret) return dev_err_probe(dev, ret, "PPE HW config failed\n"); @@ -630,7 +620,7 @@ index bcf21c838e05..93f92be9dc41 100644 ppe_debugfs_setup(ppe_dev); platform_set_drvdata(pdev, ppe_dev); -@@ -226,6 +233,7 @@ static void qcom_ppe_remove(struct platform_device *pdev) +@@ -226,6 +233,7 @@ static void qcom_ppe_remove(struct platf ppe_dev = platform_get_drvdata(pdev); ppe_debugfs_teardown(ppe_dev); ppe_port_mac_deinit(ppe_dev); @@ -638,8 +628,6 @@ index bcf21c838e05..93f92be9dc41 100644 platform_set_drvdata(pdev, NULL); } -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h -index 6e6e469247c8..f2a60776a40a 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_regs.h @@ -788,4 +788,257 @@ @@ -900,6 +888,3 @@ index 6e6e469247c8..f2a60776a40a 100644 +#define EDMA_RXDESC2FILL_MAP_RXDESC_MASK 0x7 + #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-39-net-ethernet-qualcomm-Add-netdevice-support-for-QCOM.patch b/lede/target/linux/qualcommbe/patches-6.6/103-39-net-ethernet-qualcomm-Add-netdevice-support-for-QCOM.patch index 4d89b875a3..487364242b 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-39-net-ethernet-qualcomm-Add-netdevice-support-for-QCOM.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-39-net-ethernet-qualcomm-Add-netdevice-support-for-QCOM.patch @@ -20,8 +20,6 @@ Signed-off-by: Suruchi Agarwal create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_port.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_port.h -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index 7fea135ceb36..e26677644aa9 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o @@ -32,8 +30,6 @@ index 7fea135ceb36..e26677644aa9 100644 \ No newline at end of file +qcom-ppe-objs += edma.o edma_port.o \ No newline at end of file -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h -index 6bad51c976dd..5261002f883d 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma.h @@ -26,6 +26,9 @@ @@ -46,9 +42,6 @@ index 6bad51c976dd..5261002f883d 100644 /** * struct edma_ring_info - EDMA ring data structure. * @max_rings: Maximum number of rings -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.c b/drivers/net/ethernet/qualcomm/ppe/edma_port.c -new file mode 100644 -index 000000000000..6292b83d746d --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.c @@ -0,0 +1,270 @@ @@ -322,9 +315,6 @@ index 000000000000..6292b83d746d + + return ret; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.h b/drivers/net/ethernet/qualcomm/ppe/edma_port.h -new file mode 100644 -index 000000000000..0f2deb39556e --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.h @@ -0,0 +1,31 @@ @@ -359,8 +349,6 @@ index 000000000000..0f2deb39556e +void edma_port_destroy(struct ppe_port *port); +int edma_port_setup(struct ppe_port *port); +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c -index 52820e2eedf8..05c52ba07aef 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_port.c @@ -13,6 +13,7 @@ @@ -371,7 +359,7 @@ index 52820e2eedf8..05c52ba07aef 100644 #include "ppe.h" #include "ppe_port.h" #include "ppe_regs.h" -@@ -1277,12 +1278,26 @@ int ppe_port_mac_init(struct ppe_device *ppe_dev) +@@ -1277,12 +1278,26 @@ int ppe_port_mac_init(struct ppe_device goto err_port_node; } @@ -398,7 +386,7 @@ index 52820e2eedf8..05c52ba07aef 100644 err_port_clk: for (j = 0; j < i; j++) ppe_port_clock_deinit(&ppe_ports->port[j]); -@@ -1307,6 +1322,10 @@ void ppe_port_mac_deinit(struct ppe_device *ppe_dev) +@@ -1307,6 +1322,10 @@ void ppe_port_mac_deinit(struct ppe_devi for (i = 0; i < ppe_dev->ports->num; i++) { ppe_port = &ppe_dev->ports->port[i]; @@ -409,6 +397,3 @@ index 52820e2eedf8..05c52ba07aef 100644 ppe_port_clock_deinit(ppe_port); } } --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-40-net-ethernet-qualcomm-Add-Rx-Ethernet-DMA-support.patch b/lede/target/linux/qualcommbe/patches-6.6/103-40-net-ethernet-qualcomm-Add-Rx-Ethernet-DMA-support.patch index 9392ed8b58..621a5f5359 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-40-net-ethernet-qualcomm-Add-Rx-Ethernet-DMA-support.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-40-net-ethernet-qualcomm-Add-Rx-Ethernet-DMA-support.patch @@ -26,8 +26,6 @@ Signed-off-by: Suruchi Agarwal create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_rx.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_rx.h -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index e26677644aa9..3fd607ce42de 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o @@ -38,8 +36,6 @@ index e26677644aa9..3fd607ce42de 100644 \ No newline at end of file +qcom-ppe-objs += edma.o edma_cfg_rx.o edma_port.o edma_rx.o \ No newline at end of file -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.c b/drivers/net/ethernet/qualcomm/ppe/edma.c -index d7bf1f39e9e1..134f6b95c294 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma.c @@ -18,12 +18,23 @@ @@ -66,7 +62,7 @@ index d7bf1f39e9e1..134f6b95c294 100644 /* Priority to multi-queue mapping. */ static u8 edma_pri_map[PPE_QUEUE_INTER_PRI_NUM] = { -@@ -178,6 +189,59 @@ static int edma_configure_ucast_prio_map_tbl(void) +@@ -178,6 +189,59 @@ static int edma_configure_ucast_prio_map return ret; } @@ -262,7 +258,7 @@ index d7bf1f39e9e1..134f6b95c294 100644 kfree(edma_ctx->netdev_arr); } -@@ -428,6 +584,7 @@ int edma_setup(struct ppe_device *ppe_dev) +@@ -428,6 +584,7 @@ int edma_setup(struct ppe_device *ppe_de edma_ctx->hw_info = &ipq9574_hw_info; edma_ctx->ppe_dev = ppe_dev; @@ -270,7 +266,7 @@ index d7bf1f39e9e1..134f6b95c294 100644 /* Configure the EDMA common clocks. */ ret = edma_clock_init(); -@@ -450,6 +607,16 @@ int edma_setup(struct ppe_device *ppe_dev) +@@ -450,6 +607,16 @@ int edma_setup(struct ppe_device *ppe_de return ret; } @@ -287,8 +283,6 @@ index d7bf1f39e9e1..134f6b95c294 100644 dev_info(dev, "EDMA configuration successful\n"); return 0; -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h -index 5261002f883d..778df7997d9f 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma.h @@ -6,6 +6,7 @@ @@ -341,9 +335,6 @@ index 5261002f883d..778df7997d9f 100644 extern struct edma_context *edma_ctx; void edma_destroy(struct ppe_device *ppe_dev); -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c -new file mode 100644 -index 000000000000..18e4ada6a076 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c @@ -0,0 +1,964 @@ @@ -1311,9 +1302,6 @@ index 000000000000..18e4ada6a076 + + return 0; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h -new file mode 100644 -index 000000000000..3c84ef4ea85c --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h @@ -0,0 +1,48 @@ @@ -1365,8 +1353,6 @@ index 000000000000..3c84ef4ea85c +int edma_cfg_rx_rps(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos); +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.c b/drivers/net/ethernet/qualcomm/ppe/edma_port.c -index 6292b83d746d..bbb5823408fd 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.c @@ -12,12 +12,39 @@ @@ -1409,7 +1395,7 @@ index 6292b83d746d..bbb5823408fd 100644 static u16 __maybe_unused edma_port_select_queue(__maybe_unused struct net_device *netdev, __maybe_unused struct sk_buff *skb, __maybe_unused struct net_device *sb_dev) -@@ -172,6 +199,7 @@ void edma_port_destroy(struct ppe_port *port) +@@ -172,6 +199,7 @@ void edma_port_destroy(struct ppe_port * int port_id = port->port_id; struct net_device *netdev = edma_ctx->netdev_arr[port_id - 1]; @@ -1417,7 +1403,7 @@ index 6292b83d746d..bbb5823408fd 100644 unregister_netdev(netdev); free_netdev(netdev); ppe_port_phylink_destroy(port); -@@ -232,6 +260,13 @@ int edma_port_setup(struct ppe_port *port) +@@ -232,6 +260,13 @@ int edma_port_setup(struct ppe_port *por port_id, netdev->dev_addr); } @@ -1431,7 +1417,7 @@ index 6292b83d746d..bbb5823408fd 100644 netdev_dbg(netdev, "Configuring the port %s(qcom-id:%d)\n", netdev->name, port_id); -@@ -263,8 +298,10 @@ int edma_port_setup(struct ppe_port *port) +@@ -263,8 +298,10 @@ int edma_port_setup(struct ppe_port *por register_netdev_fail: ppe_port_phylink_destroy(port); port_phylink_setup_fail: @@ -1443,15 +1429,12 @@ index 6292b83d746d..bbb5823408fd 100644 return ret; } -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.h b/drivers/net/ethernet/qualcomm/ppe/edma_port.h -index 0f2deb39556e..75f544a4f324 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_port.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.h -@@ -14,15 +14,46 @@ - | NETIF_F_TSO \ +@@ -15,14 +15,45 @@ | NETIF_F_TSO6) -+/** + /** + * struct edma_port_rx_stats - EDMA RX per CPU stats for the port. + * @rx_pkts: Number of Rx packets + * @rx_bytes: Number of Rx bytes @@ -1479,7 +1462,7 @@ index 0f2deb39556e..75f544a4f324 100644 + struct edma_port_rx_stats __percpu *rx_stats; +}; + - /** ++/** * struct edma_port_priv - EDMA port priv structure. * @ppe_port: Pointer to PPE port * @netdev: Corresponding netdevice @@ -1494,9 +1477,6 @@ index 0f2deb39556e..75f544a4f324 100644 unsigned long flags; }; -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_rx.c b/drivers/net/ethernet/qualcomm/ppe/edma_rx.c -new file mode 100644 -index 000000000000..a1eb533410ce --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_rx.c @@ -0,0 +1,622 @@ @@ -2122,9 +2102,6 @@ index 000000000000..a1eb533410ce + + return IRQ_HANDLED; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_rx.h b/drivers/net/ethernet/qualcomm/ppe/edma_rx.h -new file mode 100644 -index 000000000000..4a262a066808 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_rx.h @@ -0,0 +1,287 @@ @@ -2415,6 +2392,3 @@ index 000000000000..4a262a066808 +int edma_rx_alloc_buffer(struct edma_rxfill_ring *rxfill_ring, int alloc_count); +int edma_rx_napi_poll(struct napi_struct *napi, int budget); +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-41-net-ethernet-qualcomm-Add-Tx-Ethernet-DMA-support.patch b/lede/target/linux/qualcommbe/patches-6.6/103-41-net-ethernet-qualcomm-Add-Tx-Ethernet-DMA-support.patch index 9a190c72f3..1e842fabda 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-41-net-ethernet-qualcomm-Add-Tx-Ethernet-DMA-support.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-41-net-ethernet-qualcomm-Add-Tx-Ethernet-DMA-support.patch @@ -26,8 +26,6 @@ Signed-off-by: Suruchi Agarwal create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_tx.c create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_tx.h -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index 3fd607ce42de..b358bfd781fb 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o @@ -37,8 +35,6 @@ index 3fd607ce42de..b358bfd781fb 100644 -qcom-ppe-objs += edma.o edma_cfg_rx.o edma_port.o edma_rx.o \ No newline at end of file +qcom-ppe-objs += edma.o edma_cfg_rx.o edma_cfg_tx.o edma_port.o edma_rx.o edma_tx.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.c b/drivers/net/ethernet/qualcomm/ppe/edma.c -index 134f6b95c294..739fcfbde0f9 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma.c @@ -18,6 +18,7 @@ @@ -57,7 +53,7 @@ index 134f6b95c294..739fcfbde0f9 100644 static char **edma_rxdesc_irq_name; /* Module params. */ -@@ -192,22 +194,59 @@ static int edma_configure_ucast_prio_map_tbl(void) +@@ -192,22 +194,59 @@ static int edma_configure_ucast_prio_map static int edma_irq_register(void) { struct edma_hw_info *hw_info = edma_ctx->hw_info; @@ -192,7 +188,7 @@ index 134f6b95c294..739fcfbde0f9 100644 ret = edma_cfg_rx_rings(); if (ret) { -@@ -520,6 +586,7 @@ static int edma_hw_configure(void) +@@ -520,6 +586,7 @@ configure_ucast_prio_map_tbl_failed: edma_cfg_rx_napi_delete(); edma_cfg_rx_rings_disable(); edma_cfg_rx_rings_failed: @@ -200,7 +196,7 @@ index 134f6b95c294..739fcfbde0f9 100644 edma_cfg_rx_rings_cleanup(); edma_alloc_rings_failed: free_netdev(edma_ctx->dummy_dev); -@@ -538,13 +605,27 @@ static int edma_hw_configure(void) +@@ -538,13 +605,27 @@ dummy_dev_alloc_failed: void edma_destroy(struct ppe_device *ppe_dev) { struct edma_hw_info *hw_info = edma_ctx->hw_info; @@ -229,7 +225,7 @@ index 134f6b95c294..739fcfbde0f9 100644 for (i = 0; i < rx->num_rings; i++) { synchronize_irq(edma_ctx->intr_info.intr_rx[i]); free_irq(edma_ctx->intr_info.intr_rx[i], -@@ -560,6 +641,7 @@ void edma_destroy(struct ppe_device *ppe_dev) +@@ -560,6 +641,7 @@ void edma_destroy(struct ppe_device *ppe edma_cfg_rx_napi_delete(); edma_cfg_rx_rings_disable(); edma_cfg_rx_rings_cleanup(); @@ -237,7 +233,7 @@ index 134f6b95c294..739fcfbde0f9 100644 free_netdev(edma_ctx->dummy_dev); kfree(edma_ctx->netdev_arr); -@@ -585,6 +667,7 @@ int edma_setup(struct ppe_device *ppe_dev) +@@ -585,6 +667,7 @@ int edma_setup(struct ppe_device *ppe_de edma_ctx->hw_info = &ipq9574_hw_info; edma_ctx->ppe_dev = ppe_dev; edma_ctx->rx_buf_size = rx_buff_size; @@ -245,8 +241,6 @@ index 134f6b95c294..739fcfbde0f9 100644 /* Configure the EDMA common clocks. */ ret = edma_clock_init(); -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h -index 778df7997d9f..fb8ccbfbaf41 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma.h @@ -7,6 +7,7 @@ @@ -281,9 +275,6 @@ index 778df7997d9f..fb8ccbfbaf41 100644 }; /* Global EDMA context */ -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c -new file mode 100644 -index 000000000000..f704c654b2cd --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c @@ -0,0 +1,648 @@ @@ -935,9 +926,6 @@ index 000000000000..f704c654b2cd + + netdev_dbg(netdev, "Tx NAPI budget: %d\n", hw_info->napi_budget_tx); +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h -new file mode 100644 -index 000000000000..4840c601fc86 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h @@ -0,0 +1,28 @@ @@ -969,8 +957,6 @@ index 000000000000..4840c601fc86 +void edma_cfg_tx_rings_disable(u32 port_id); +void edma_cfg_tx_fill_per_port_tx_map(struct net_device *netdev, u32 macid); +#endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.c b/drivers/net/ethernet/qualcomm/ppe/edma_port.c -index bbb5823408fd..afa2b6479822 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.c @@ -13,6 +13,7 @@ @@ -981,7 +967,7 @@ index bbb5823408fd..afa2b6479822 100644 #include "edma_port.h" #include "ppe_regs.h" -@@ -35,6 +36,15 @@ static int edma_port_stats_alloc(struct net_device *netdev) +@@ -35,6 +36,15 @@ static int edma_port_stats_alloc(struct return -ENOMEM; } @@ -997,7 +983,7 @@ index bbb5823408fd..afa2b6479822 100644 return 0; } -@@ -43,6 +53,28 @@ static void edma_port_stats_free(struct net_device *netdev) +@@ -43,6 +53,28 @@ static void edma_port_stats_free(struct struct edma_port_priv *port_priv = (struct edma_port_priv *)netdev_priv(netdev); free_percpu(port_priv->pcpu_stats.rx_stats); @@ -1026,7 +1012,7 @@ index bbb5823408fd..afa2b6479822 100644 } static u16 __maybe_unused edma_port_select_queue(__maybe_unused struct net_device *netdev, -@@ -60,6 +92,7 @@ static int edma_port_open(struct net_device *netdev) +@@ -60,6 +92,7 @@ static int edma_port_open(struct net_dev { struct edma_port_priv *port_priv = (struct edma_port_priv *)netdev_priv(netdev); struct ppe_port *ppe_port; @@ -1034,7 +1020,7 @@ index bbb5823408fd..afa2b6479822 100644 if (!port_priv) return -EINVAL; -@@ -74,10 +107,14 @@ static int edma_port_open(struct net_device *netdev) +@@ -74,10 +107,14 @@ static int edma_port_open(struct net_dev netdev->wanted_features |= EDMA_NETDEV_FEATURES; ppe_port = port_priv->ppe_port; @@ -1049,7 +1035,7 @@ index bbb5823408fd..afa2b6479822 100644 netif_start_queue(netdev); return 0; -@@ -87,13 +124,21 @@ static int edma_port_close(struct net_device *netdev) +@@ -87,13 +124,21 @@ static int edma_port_close(struct net_de { struct edma_port_priv *port_priv = (struct edma_port_priv *)netdev_priv(netdev); struct ppe_port *ppe_port; @@ -1071,7 +1057,7 @@ index bbb5823408fd..afa2b6479822 100644 /* Phylink close. */ if (ppe_port->phylink) -@@ -137,6 +182,92 @@ static netdev_features_t edma_port_feature_check(__maybe_unused struct sk_buff * +@@ -137,6 +182,92 @@ static netdev_features_t edma_port_featu return features; } @@ -1164,7 +1150,7 @@ index bbb5823408fd..afa2b6479822 100644 static void edma_port_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) { -@@ -179,6 +310,7 @@ static int edma_port_set_mac_address(struct net_device *netdev, void *macaddr) +@@ -179,6 +310,7 @@ static int edma_port_set_mac_address(str static const struct net_device_ops edma_port_netdev_ops = { .ndo_open = edma_port_open, .ndo_stop = edma_port_close, @@ -1172,7 +1158,7 @@ index bbb5823408fd..afa2b6479822 100644 .ndo_get_stats64 = edma_port_get_stats64, .ndo_set_mac_address = edma_port_set_mac_address, .ndo_validate_addr = eth_validate_addr, -@@ -199,6 +331,7 @@ void edma_port_destroy(struct ppe_port *port) +@@ -199,6 +331,7 @@ void edma_port_destroy(struct ppe_port * int port_id = port->port_id; struct net_device *netdev = edma_ctx->netdev_arr[port_id - 1]; @@ -1180,7 +1166,7 @@ index bbb5823408fd..afa2b6479822 100644 edma_port_stats_free(netdev); unregister_netdev(netdev); free_netdev(netdev); -@@ -276,6 +409,8 @@ int edma_port_setup(struct ppe_port *port) +@@ -276,6 +409,8 @@ int edma_port_setup(struct ppe_port *por */ edma_ctx->netdev_arr[port_id - 1] = netdev; @@ -1189,7 +1175,7 @@ index bbb5823408fd..afa2b6479822 100644 /* Setup phylink. */ ret = ppe_port_phylink_setup(port, netdev); if (ret) { -@@ -298,6 +433,7 @@ int edma_port_setup(struct ppe_port *port) +@@ -298,6 +433,7 @@ int edma_port_setup(struct ppe_port *por register_netdev_fail: ppe_port_phylink_destroy(port); port_phylink_setup_fail: @@ -1197,8 +1183,6 @@ index bbb5823408fd..afa2b6479822 100644 edma_ctx->netdev_arr[port_id - 1] = NULL; edma_port_stats_free(netdev); stats_alloc_fail: -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.h b/drivers/net/ethernet/qualcomm/ppe/edma_port.h -index 75f544a4f324..b67eddabd41c 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_port.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.h @@ -7,6 +7,8 @@ @@ -1210,11 +1194,10 @@ index 75f544a4f324..b67eddabd41c 100644 #define EDMA_NETDEV_FEATURES (NETIF_F_FRAGLIST \ | NETIF_F_SG \ | NETIF_F_RXCSUM \ -@@ -34,12 +36,44 @@ struct edma_port_rx_stats { - struct u64_stats_sync syncp; +@@ -35,11 +37,43 @@ struct edma_port_rx_stats { }; -+/** + /** + * struct edma_port_tx_stats - EDMA TX port per CPU stats for the port. + * @tx_pkts: Number of Tx packets + * @tx_bytes: Number of Tx bytes @@ -1244,7 +1227,7 @@ index 75f544a4f324..b67eddabd41c 100644 + struct u64_stats_sync syncp; +}; + - /** ++/** * struct edma_port_pcpu_stats - EDMA per cpu stats data structure for the port. * @rx_stats: Per CPU Rx statistics + * @tx_stats: Per CPU Tx statistics @@ -1263,9 +1246,6 @@ index 75f544a4f324..b67eddabd41c 100644 unsigned long flags; }; -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_tx.c b/drivers/net/ethernet/qualcomm/ppe/edma_tx.c -new file mode 100644 -index 000000000000..47876c142df5 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_tx.c @@ -0,0 +1,808 @@ @@ -2077,9 +2057,6 @@ index 000000000000..47876c142df5 + + return EDMA_TX_OK; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_tx.h b/drivers/net/ethernet/qualcomm/ppe/edma_tx.h -new file mode 100644 -index 000000000000..c09a4e0f6a42 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_tx.h @@ -0,0 +1,302 @@ @@ -2385,6 +2362,3 @@ index 000000000000..c09a4e0f6a42 + struct net_device *netdev, struct sk_buff **segs); + +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-42-net-ethernet-qualcomm-Add-miscellaneous-error-interr.patch b/lede/target/linux/qualcommbe/patches-6.6/103-42-net-ethernet-qualcomm-Add-miscellaneous-error-interr.patch index df61e9f83f..a841ed2846 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-42-net-ethernet-qualcomm-Add-miscellaneous-error-interr.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-42-net-ethernet-qualcomm-Add-miscellaneous-error-interr.patch @@ -20,8 +20,6 @@ Signed-off-by: Suruchi Agarwal 5 files changed, 580 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_debugfs.c -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index b358bfd781fb..45e1b103ec7a 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o @@ -30,15 +28,12 @@ index b358bfd781fb..45e1b103ec7a 100644 #EDMA -qcom-ppe-objs += edma.o edma_cfg_rx.o edma_cfg_tx.o edma_port.o edma_rx.o edma_tx.o +qcom-ppe-objs += edma.o edma_cfg_rx.o edma_cfg_tx.o edma_debugfs.o edma_port.o edma_rx.o edma_tx.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.c b/drivers/net/ethernet/qualcomm/ppe/edma.c -index 739fcfbde0f9..0e16f8ab545f 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma.c -@@ -151,6 +151,42 @@ static int edma_clock_init(void) - return 0; +@@ -152,6 +152,42 @@ static int edma_clock_init(void) } -+/** + /** + * edma_err_stats_alloc - Allocate stats memory + * + * Allocate memory for per-CPU error stats. @@ -74,10 +69,11 @@ index 739fcfbde0f9..0e16f8ab545f 100644 + } +} + - /** ++/** * edma_configure_ucast_prio_map_tbl - Configure unicast priority map table. * -@@ -191,11 +227,113 @@ static int edma_configure_ucast_prio_map_tbl(void) + * Map int_priority values to priority class and initialize +@@ -191,11 +227,113 @@ static int edma_configure_ucast_prio_map return ret; } @@ -225,7 +221,7 @@ index 739fcfbde0f9..0e16f8ab545f 100644 edma_cfg_rx_rings_disable(); -@@ -614,6 +770,7 @@ void edma_destroy(struct ppe_device *ppe_dev) +@@ -614,6 +770,7 @@ void edma_destroy(struct ppe_device *ppe edma_cfg_tx_disable_interrupts(i); edma_cfg_rx_disable_interrupts(); @@ -233,7 +229,7 @@ index 739fcfbde0f9..0e16f8ab545f 100644 /* Free IRQ for TXCMPL rings. */ for (i = 0; i < txcmpl->num_rings; i++) { -@@ -634,6 +791,10 @@ void edma_destroy(struct ppe_device *ppe_dev) +@@ -634,6 +791,10 @@ void edma_destroy(struct ppe_device *ppe } kfree(edma_rxdesc_irq_name); @@ -244,7 +240,7 @@ index 739fcfbde0f9..0e16f8ab545f 100644 kfree(edma_ctx->intr_info.intr_rx); kfree(edma_ctx->intr_info.intr_txcmpl); -@@ -699,6 +860,7 @@ int edma_setup(struct ppe_device *ppe_dev) +@@ -699,6 +860,7 @@ int edma_setup(struct ppe_device *ppe_de } edma_cfg_rx_enable_interrupts(); @@ -252,15 +248,12 @@ index 739fcfbde0f9..0e16f8ab545f 100644 dev_info(dev, "EDMA configuration successful\n"); -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h -index fb8ccbfbaf41..6500d21b9eba 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma.h -@@ -36,6 +36,30 @@ - ((((head) - (tail)) + \ +@@ -37,6 +37,30 @@ (max)) & ((max) - 1)); }) -+/** + /** + * struct edma_err_stats - EDMA error stats + * @edma_axi_read_err: AXI read error + * @edma_axi_write_err: AXI write error @@ -284,9 +277,10 @@ index fb8ccbfbaf41..6500d21b9eba 100644 + struct u64_stats_sync syncp; +}; + - /** ++/** * struct edma_ring_info - EDMA ring data structure. * @max_rings: Maximum number of rings + * @ring_start: Ring start ID @@ -97,6 +121,7 @@ struct edma_intr_info { * @rx_rings: Rx Desc Rings, SW is consumer * @tx_rings: Tx Descriptor Ring, SW is producer @@ -315,9 +309,6 @@ index fb8ccbfbaf41..6500d21b9eba 100644 +void edma_debugfs_teardown(void); +int edma_debugfs_setup(struct ppe_device *ppe_dev); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_debugfs.c b/drivers/net/ethernet/qualcomm/ppe/edma_debugfs.c -new file mode 100644 -index 000000000000..671062d4ee72 --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_debugfs.c @@ -0,0 +1,370 @@ @@ -691,8 +682,6 @@ index 000000000000..671062d4ee72 + stats_dentry = NULL; + return -ENOMEM; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c -index 1cd4c491e724..f325fcf1e17e 100644 --- a/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_debugfs.c @@ -6,9 +6,11 @@ @@ -707,7 +696,7 @@ index 1cd4c491e724..f325fcf1e17e 100644 #include "ppe.h" #include "ppe_config.h" #include "ppe_debugfs.h" -@@ -711,15 +713,30 @@ static const struct file_operations ppe_debugfs_packet_counter_fops = { +@@ -711,15 +713,30 @@ static const struct file_operations ppe_ void ppe_debugfs_setup(struct ppe_device *ppe_dev) { @@ -738,6 +727,3 @@ index 1cd4c491e724..f325fcf1e17e 100644 debugfs_remove_recursive(ppe_dev->debugfs_root); ppe_dev->debugfs_root = NULL; } --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-43-net-ethernet-qualcomm-Add-ethtool-support-for-EDMA.patch b/lede/target/linux/qualcommbe/patches-6.6/103-43-net-ethernet-qualcomm-Add-ethtool-support-for-EDMA.patch index c4fd0aefcd..bbd0746a03 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-43-net-ethernet-qualcomm-Add-ethtool-support-for-EDMA.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-43-net-ethernet-qualcomm-Add-ethtool-support-for-EDMA.patch @@ -15,8 +15,6 @@ Signed-off-by: Pavithra R 4 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_ethtool.c -diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile -index 45e1b103ec7a..cb9d30889d06 100644 --- a/drivers/net/ethernet/qualcomm/ppe/Makefile +++ b/drivers/net/ethernet/qualcomm/ppe/Makefile @@ -7,4 +7,4 @@ obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o @@ -25,19 +23,14 @@ index 45e1b103ec7a..cb9d30889d06 100644 #EDMA -qcom-ppe-objs += edma.o edma_cfg_rx.o edma_cfg_tx.o edma_debugfs.o edma_port.o edma_rx.o edma_tx.o +qcom-ppe-objs += edma.o edma_cfg_rx.o edma_cfg_tx.o edma_debugfs.o edma_port.o edma_rx.o edma_tx.o edma_ethtool.o -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h -index 6500d21b9eba..ac6d2fcc2983 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma.h -@@ -151,4 +151,5 @@ void edma_destroy(struct ppe_device *ppe_dev); +@@ -151,4 +151,5 @@ void edma_destroy(struct ppe_device *ppe int edma_setup(struct ppe_device *ppe_dev); void edma_debugfs_teardown(void); int edma_debugfs_setup(struct ppe_device *ppe_dev); +void edma_set_ethtool_ops(struct net_device *netdev); #endif -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_ethtool.c b/drivers/net/ethernet/qualcomm/ppe/edma_ethtool.c -new file mode 100644 -index 000000000000..eabc1e11b16f --- /dev/null +++ b/drivers/net/ethernet/qualcomm/ppe/edma_ethtool.c @@ -0,0 +1,294 @@ @@ -335,11 +328,9 @@ index 000000000000..eabc1e11b16f +{ + netdev->ethtool_ops = &edma_ethtool_ops; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.c b/drivers/net/ethernet/qualcomm/ppe/edma_port.c -index afa2b6479822..0b3b769a4a49 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.c -@@ -380,6 +380,7 @@ int edma_port_setup(struct ppe_port *port) +@@ -380,6 +380,7 @@ int edma_port_setup(struct ppe_port *por netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE; netdev->netdev_ops = &edma_port_netdev_ops; netdev->gso_max_segs = GSO_MAX_SEGS; @@ -347,6 +338,3 @@ index afa2b6479822..0b3b769a4a49 100644 maddr = mac_addr; if (of_get_mac_address(np, maddr)) --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-44-net-ethernet-qualcomm-Add-module-parameters-for-driv.patch b/lede/target/linux/qualcommbe/patches-6.6/103-44-net-ethernet-qualcomm-Add-module-parameters-for-driv.patch index 48bca9dd30..91fc8082e9 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-44-net-ethernet-qualcomm-Add-module-parameters-for-driv.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-44-net-ethernet-qualcomm-Add-module-parameters-for-driv.patch @@ -19,8 +19,6 @@ Signed-off-by: Pavithra R drivers/net/ethernet/qualcomm/ppe/edma_tx.h | 4 +++ 7 files changed, 134 insertions(+), 4 deletions(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.c b/drivers/net/ethernet/qualcomm/ppe/edma.c -index 0e16f8ab545f..ae9ca528fd55 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma.c @@ -38,6 +38,38 @@ static int rx_buff_size; @@ -62,7 +60,7 @@ index 0e16f8ab545f..ae9ca528fd55 100644 /* Priority to multi-queue mapping. */ static u8 edma_pri_map[PPE_QUEUE_INTER_PRI_NUM] = { 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7}; -@@ -828,7 +860,10 @@ int edma_setup(struct ppe_device *ppe_dev) +@@ -828,7 +860,10 @@ int edma_setup(struct ppe_device *ppe_de edma_ctx->hw_info = &ipq9574_hw_info; edma_ctx->ppe_dev = ppe_dev; edma_ctx->rx_buf_size = rx_buff_size; @@ -73,11 +71,9 @@ index 0e16f8ab545f..ae9ca528fd55 100644 /* Configure the EDMA common clocks. */ ret = edma_clock_init(); -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c -index 18e4ada6a076..bf8854976328 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c -@@ -166,6 +166,24 @@ static void edma_cfg_rx_desc_ring_configure(struct edma_rxdesc_ring *rxdesc_ring +@@ -166,6 +166,24 @@ static void edma_cfg_rx_desc_ring_config reg = EDMA_BASE_OFFSET + EDMA_REG_RXDESC_RING_SIZE(rxdesc_ring->ring_id); regmap_write(regmap, reg, data); @@ -102,7 +98,7 @@ index 18e4ada6a076..bf8854976328 100644 /* Configure the Mitigation timer */ data = EDMA_MICROSEC_TO_TIMER_UNIT(EDMA_RX_MITIGATION_TIMER_DEF, ppe_dev->clk_rate / MHZ); -@@ -176,7 +194,7 @@ static void edma_cfg_rx_desc_ring_configure(struct edma_rxdesc_ring *rxdesc_ring +@@ -176,7 +194,7 @@ static void edma_cfg_rx_desc_ring_config regmap_write(regmap, reg, data); /* Configure the Mitigation packet count */ @@ -134,8 +130,6 @@ index 18e4ada6a076..bf8854976328 100644 } /** -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h -index 3c84ef4ea85c..bd897dba286a 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h @@ -5,6 +5,15 @@ @@ -176,11 +170,9 @@ index 3c84ef4ea85c..bd897dba286a 100644 /* Default bitmap of cores for RPS to ARM cores */ #define EDMA_RX_DEFAULT_BITMAP ((1 << EDMA_MAX_CORE) - 1) -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c -index f704c654b2cd..771acebdaf75 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c -@@ -170,6 +170,24 @@ static void edma_cfg_txcmpl_ring_configure(struct edma_txcmpl_ring *txcmpl_ring) +@@ -170,6 +170,24 @@ static void edma_cfg_txcmpl_ring_configu reg = EDMA_BASE_OFFSET + EDMA_REG_TXCMPL_CTRL(txcmpl_ring->id); regmap_write(regmap, reg, EDMA_TXCMPL_RETMODE_OPAQUE); @@ -205,7 +197,7 @@ index f704c654b2cd..771acebdaf75 100644 /* Configure the Mitigation timer. */ data = EDMA_MICROSEC_TO_TIMER_UNIT(EDMA_TX_MITIGATION_TIMER_DEF, ppe_dev->clk_rate / MHZ); -@@ -180,7 +198,7 @@ static void edma_cfg_txcmpl_ring_configure(struct edma_txcmpl_ring *txcmpl_ring) +@@ -180,7 +198,7 @@ static void edma_cfg_txcmpl_ring_configu regmap_write(regmap, reg, data); /* Configure the Mitigation packet count. */ @@ -214,7 +206,7 @@ index f704c654b2cd..771acebdaf75 100644 << EDMA_TXCMPL_LOW_THRE_SHIFT; pr_debug("EDMA Tx mitigation packet count value: %d\n", data); reg = EDMA_BASE_OFFSET + EDMA_REG_TXCMPL_UGT_THRE(txcmpl_ring->id); -@@ -634,6 +652,13 @@ void edma_cfg_tx_napi_add(struct net_device *netdev, u32 port_id) +@@ -634,6 +652,13 @@ void edma_cfg_tx_napi_add(struct net_dev struct edma_txcmpl_ring *txcmpl_ring; u32 i, ring_idx; @@ -228,15 +220,13 @@ index f704c654b2cd..771acebdaf75 100644 /* Adding tx napi for a interface with each queue. */ for_each_possible_cpu(i) { ring_idx = ((port_id - 1) * num_possible_cpus()) + i; -@@ -644,5 +669,5 @@ void edma_cfg_tx_napi_add(struct net_device *netdev, u32 port_id) +@@ -644,5 +669,5 @@ void edma_cfg_tx_napi_add(struct net_dev netdev_dbg(netdev, "Napi added for txcmpl ring: %u\n", txcmpl_ring->id); } - netdev_dbg(netdev, "Tx NAPI budget: %d\n", hw_info->napi_budget_tx); + netdev_dbg(netdev, "Tx NAPI budget: %d\n", edma_tx_napi_budget); } -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h -index 4840c601fc86..608bbc5f93e8 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h @@ -5,12 +5,28 @@ @@ -268,8 +258,6 @@ index 4840c601fc86..608bbc5f93e8 100644 void edma_cfg_tx_rings(void); int edma_cfg_tx_rings_alloc(void); void edma_cfg_tx_rings_cleanup(void); -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_rx.h b/drivers/net/ethernet/qualcomm/ppe/edma_rx.h -index 4a262a066808..0ef8138b4530 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_rx.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma_rx.h @@ -281,6 +281,10 @@ struct edma_rxdesc_ring { @@ -283,8 +271,6 @@ index 4a262a066808..0ef8138b4530 100644 irqreturn_t edma_rx_handle_irq(int irq, void *ctx); int edma_rx_alloc_buffer(struct edma_rxfill_ring *rxfill_ring, int alloc_count); int edma_rx_napi_poll(struct napi_struct *napi, int budget); -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_tx.h b/drivers/net/ethernet/qualcomm/ppe/edma_tx.h -index c09a4e0f6a42..c4fa63321d1f 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_tx.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma_tx.h @@ -288,6 +288,10 @@ struct edma_txcmpl_ring { @@ -298,6 +284,3 @@ index c09a4e0f6a42..c4fa63321d1f 100644 enum edma_tx_status edma_tx_ring_xmit(struct net_device *netdev, struct sk_buff *skb, struct edma_txdesc_ring *txdesc_ring, --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/103-45-net-ethernet-qualcomm-Add-sysctl-for-RPS-bitmap.patch b/lede/target/linux/qualcommbe/patches-6.6/103-45-net-ethernet-qualcomm-Add-sysctl-for-RPS-bitmap.patch index a591b3fe99..75851e889d 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/103-45-net-ethernet-qualcomm-Add-sysctl-for-RPS-bitmap.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/103-45-net-ethernet-qualcomm-Add-sysctl-for-RPS-bitmap.patch @@ -16,11 +16,9 @@ Signed-off-by: Pavithra R .../net/ethernet/qualcomm/ppe/edma_cfg_rx.h | 4 +++ 4 files changed, 56 insertions(+) -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.c b/drivers/net/ethernet/qualcomm/ppe/edma.c -index ae9ca528fd55..428c7b134feb 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma.c -@@ -797,6 +797,11 @@ void edma_destroy(struct ppe_device *ppe_dev) +@@ -797,6 +797,11 @@ void edma_destroy(struct ppe_device *ppe struct edma_ring_info *rx = hw_info->rx; u32 i; @@ -32,7 +30,7 @@ index ae9ca528fd55..428c7b134feb 100644 /* Disable interrupts. */ for (i = 1; i <= hw_info->max_ports; i++) edma_cfg_tx_disable_interrupts(i); -@@ -840,6 +845,17 @@ void edma_destroy(struct ppe_device *ppe_dev) +@@ -840,6 +845,17 @@ void edma_destroy(struct ppe_device *ppe kfree(edma_ctx->netdev_arr); } @@ -50,7 +48,7 @@ index ae9ca528fd55..428c7b134feb 100644 /** * edma_setup - EDMA Setup. * @ppe_dev: PPE device -@@ -865,6 +881,13 @@ int edma_setup(struct ppe_device *ppe_dev) +@@ -865,6 +881,13 @@ int edma_setup(struct ppe_device *ppe_de if (tx_requeue_stop != 0) edma_ctx->tx_requeue_stop = true; @@ -64,8 +62,6 @@ index ae9ca528fd55..428c7b134feb 100644 /* Configure the EDMA common clocks. */ ret = edma_clock_init(); if (ret) { -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h -index ac6d2fcc2983..3f3d253476f6 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma.h @@ -122,6 +122,7 @@ struct edma_intr_info { @@ -84,11 +80,9 @@ index ac6d2fcc2983..3f3d253476f6 100644 u32 rx_page_mode; u32 rx_buf_size; bool tx_requeue_stop; -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c -index bf8854976328..58021df6c950 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.c -@@ -43,6 +43,8 @@ static u32 edma_rx_ring_queue_map[][EDMA_MAX_CORE] = {{ 0, 8, 16, 24 }, +@@ -43,6 +43,8 @@ static u32 edma_rx_ring_queue_map[][EDMA { 6, 14, 22, 30 }, { 7, 15, 23, 31 }}; @@ -126,8 +120,6 @@ index bf8854976328..58021df6c950 100644 + + return ret; +} -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h -index bd897dba286a..53d2e6b39794 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h +++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_rx.h @@ -49,6 +49,8 @@ @@ -146,6 +138,3 @@ index bd897dba286a..53d2e6b39794 100644 +int edma_cfg_rx_rps_bitmap(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos); #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/105-02-dt-bindings-clock-gcc-ipq9574-Add-definition-for-GPL.patch b/lede/target/linux/qualcommbe/patches-6.6/105-02-dt-bindings-clock-gcc-ipq9574-Add-definition-for-GPL.patch index 4cb241c939..cfd923f064 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/105-02-dt-bindings-clock-gcc-ipq9574-Add-definition-for-GPL.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/105-02-dt-bindings-clock-gcc-ipq9574-Add-definition-for-GPL.patch @@ -13,8 +13,6 @@ Signed-off-by: Manikanta Mylavarapu include/dt-bindings/clock/qcom,ipq9574-gcc.h | 1 + 1 file changed, 1 insertion(+) -diff --git a/include/dt-bindings/clock/qcom,ipq9574-gcc.h b/include/dt-bindings/clock/qcom,ipq9574-gcc.h -index 52123c5a09fa..05ef3074c9da 100644 --- a/include/dt-bindings/clock/qcom,ipq9574-gcc.h +++ b/include/dt-bindings/clock/qcom,ipq9574-gcc.h @@ -220,4 +220,5 @@ @@ -23,6 +21,3 @@ index 52123c5a09fa..05ef3074c9da 100644 #define GCC_PCIE3_PIPE_CLK 213 +#define GPLL0_OUT_AUX 214 #endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/105-03-clk-qcom-gcc-ipq9574-Add-support-for-gpll0_out_aux-c.patch b/lede/target/linux/qualcommbe/patches-6.6/105-03-clk-qcom-gcc-ipq9574-Add-support-for-gpll0_out_aux-c.patch index e90b855aae..512f842ddc 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/105-03-clk-qcom-gcc-ipq9574-Add-support-for-gpll0_out_aux-c.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/105-03-clk-qcom-gcc-ipq9574-Add-support-for-gpll0_out_aux-c.patch @@ -14,11 +14,9 @@ Signed-off-by: Manikanta Mylavarapu drivers/clk/qcom/gcc-ipq9574.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c -index 645109f75b46..a458d69e1a98 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c -@@ -108,6 +108,20 @@ static struct clk_alpha_pll_postdiv gpll0 = { +@@ -108,6 +108,20 @@ static struct clk_alpha_pll_postdiv gpll }, }; @@ -39,7 +37,7 @@ index 645109f75b46..a458d69e1a98 100644 static struct clk_alpha_pll gpll4_main = { .offset = 0x22000, .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT_EVO], -@@ -4222,6 +4236,7 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { +@@ -4222,6 +4236,7 @@ static struct clk_regmap *gcc_ipq9574_cl [GCC_PCIE1_PIPE_CLK] = &gcc_pcie1_pipe_clk.clkr, [GCC_PCIE2_PIPE_CLK] = &gcc_pcie2_pipe_clk.clkr, [GCC_PCIE3_PIPE_CLK] = &gcc_pcie3_pipe_clk.clkr, @@ -47,6 +45,3 @@ index 645109f75b46..a458d69e1a98 100644 }; static const struct qcom_reset_map gcc_ipq9574_resets[] = { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/105-04-dt-bindings-clock-Add-ipq9574-NSSCC-clock-and-reset-.patch b/lede/target/linux/qualcommbe/patches-6.6/105-04-dt-bindings-clock-Add-ipq9574-NSSCC-clock-and-reset-.patch index 1efd6ac098..edc0bf6a8c 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/105-04-dt-bindings-clock-Add-ipq9574-NSSCC-clock-and-reset-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/105-04-dt-bindings-clock-Add-ipq9574-NSSCC-clock-and-reset-.patch @@ -18,9 +18,6 @@ Reviewed-by: Krzysztof Kozlowski create mode 100644 include/dt-bindings/clock/qcom,ipq9574-nsscc.h create mode 100644 include/dt-bindings/reset/qcom,ipq9574-nsscc.h -diff --git a/Documentation/devicetree/bindings/clock/qcom,ipq9574-nsscc.yaml b/Documentation/devicetree/bindings/clock/qcom,ipq9574-nsscc.yaml -new file mode 100644 -index 000000000000..14a320079dbf --- /dev/null +++ b/Documentation/devicetree/bindings/clock/qcom,ipq9574-nsscc.yaml @@ -0,0 +1,73 @@ @@ -97,9 +94,6 @@ index 000000000000..14a320079dbf + #power-domain-cells = <1>; + }; +... -diff --git a/include/dt-bindings/clock/qcom,ipq9574-nsscc.h b/include/dt-bindings/clock/qcom,ipq9574-nsscc.h -new file mode 100644 -index 000000000000..59d57d9c788c --- /dev/null +++ b/include/dt-bindings/clock/qcom,ipq9574-nsscc.h @@ -0,0 +1,152 @@ @@ -255,9 +249,6 @@ index 000000000000..59d57d9c788c +#define UBI32_PLL_MAIN 141 + +#endif -diff --git a/include/dt-bindings/reset/qcom,ipq9574-nsscc.h b/include/dt-bindings/reset/qcom,ipq9574-nsscc.h -new file mode 100644 -index 000000000000..6910db0cff51 --- /dev/null +++ b/include/dt-bindings/reset/qcom,ipq9574-nsscc.h @@ -0,0 +1,134 @@ @@ -395,6 +386,3 @@ index 000000000000..6910db0cff51 +#define NSSPORT6_RESET 123 + +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/105-05-clk-qcom-Add-NSS-clock-Controller-driver-for-IPQ9574.patch b/lede/target/linux/qualcommbe/patches-6.6/105-05-clk-qcom-Add-NSS-clock-Controller-driver-for-IPQ9574.patch index 5f22b697f1..f4111456d4 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/105-05-clk-qcom-Add-NSS-clock-Controller-driver-for-IPQ9574.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/105-05-clk-qcom-Add-NSS-clock-Controller-driver-for-IPQ9574.patch @@ -17,11 +17,9 @@ Signed-off-by: Manikanta Mylavarapu 3 files changed, 3088 insertions(+) create mode 100644 drivers/clk/qcom/nsscc-ipq9574.c -diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig -index a3e2a09e2105..b9a5cc9fd8c8 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig -@@ -255,6 +255,13 @@ config IPQ_GCC_9574 +@@ -215,6 +215,13 @@ config IPQ_GCC_9574 i2c, USB, SD/eMMC, etc. Select this for the root clock of ipq9574. @@ -34,12 +32,10 @@ index a3e2a09e2105..b9a5cc9fd8c8 100644 + config IPQ_NSSCC_QCA8K tristate "QCA8K(QCA8386 or QCA8084) NSS Clock Controller" - depends on MDIO_BUS -diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile -index 2b378667a63f..65b825a54c45 100644 + depends on MDIO_BUS || COMPILE_TEST --- a/drivers/clk/qcom/Makefile +++ b/drivers/clk/qcom/Makefile -@@ -36,6 +36,7 @@ obj-$(CONFIG_IPQ_GCC_6018) += gcc-ipq6018.o +@@ -31,6 +31,7 @@ obj-$(CONFIG_IPQ_GCC_6018) += gcc-ipq601 obj-$(CONFIG_IPQ_GCC_806X) += gcc-ipq806x.o obj-$(CONFIG_IPQ_GCC_8074) += gcc-ipq8074.o obj-$(CONFIG_IPQ_GCC_9574) += gcc-ipq9574.o @@ -47,9 +43,6 @@ index 2b378667a63f..65b825a54c45 100644 obj-$(CONFIG_IPQ_LCC_806X) += lcc-ipq806x.o obj-$(CONFIG_IPQ_NSSCC_QCA8K) += nsscc-qca8k.o obj-$(CONFIG_MDM_GCC_9607) += gcc-mdm9607.o -diff --git a/drivers/clk/qcom/nsscc-ipq9574.c b/drivers/clk/qcom/nsscc-ipq9574.c -new file mode 100644 -index 000000000000..d3e9aa391236 --- /dev/null +++ b/drivers/clk/qcom/nsscc-ipq9574.c @@ -0,0 +1,3080 @@ @@ -3125,7 +3118,7 @@ index 000000000000..d3e9aa391236 + .driver = { + .name = "qcom,nsscc-ipq9574", + .of_match_table = nss_cc_ipq9574_match_table, -+ .sync_state = icc_sync_state, ++ .sync_state = icc_sync_state, /* TODO seems to cause hang */ + }, +}; + @@ -3133,6 +3126,3 @@ index 000000000000..d3e9aa391236 + +MODULE_DESCRIPTION("QTI NSS_CC IPQ9574 Driver"); +MODULE_LICENSE("GPL"); --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/105-06-arm64-dts-qcom-ipq9574-Add-nsscc-node.patch b/lede/target/linux/qualcommbe/patches-6.6/105-06-arm64-dts-qcom-ipq9574-Add-nsscc-node.patch index 539f998b00..fd5ed0504b 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/105-06-arm64-dts-qcom-ipq9574-Add-nsscc-node.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/105-06-arm64-dts-qcom-ipq9574-Add-nsscc-node.patch @@ -11,11 +11,9 @@ Signed-off-by: Manikanta Mylavarapu arch/arm64/boot/dts/qcom/ipq9574.dtsi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 08a82a5cf667..c113fff22f73 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -11,6 +11,8 @@ +@@ -12,6 +12,8 @@ #include #include #include @@ -24,10 +22,11 @@ index 08a82a5cf667..c113fff22f73 100644 #include / { -@@ -756,6 +758,25 @@ frame@b128000 { - status = "disabled"; +@@ -804,6 +806,26 @@ + status = "disabled"; + }; }; - ++ + nsscc: clock-controller@39b00000 { + compatible = "qcom,ipq9574-nsscc"; + reg = <0x39b00000 0x80000>; @@ -50,6 +49,3 @@ index 08a82a5cf667..c113fff22f73 100644 }; thermal-zones { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/106-arm64-dts-qcom-fix-USB-vdda-pll-supply-for-ipq9574-r.patch b/lede/target/linux/qualcommbe/patches-6.6/106-arm64-dts-qcom-fix-USB-vdda-pll-supply-for-ipq9574-r.patch index cd33abda68..0f36d32cfa 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/106-arm64-dts-qcom-fix-USB-vdda-pll-supply-for-ipq9574-r.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/106-arm64-dts-qcom-fix-USB-vdda-pll-supply-for-ipq9574-r.patch @@ -13,11 +13,9 @@ Signed-off-by: Christian Marangi arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -index 13b623603d37..68b71437c2b9 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -@@ -249,7 +249,7 @@ ipq9574_s1: s1 { +@@ -75,7 +75,7 @@ regulator-max-microvolt = <1075000>; }; @@ -26,7 +24,7 @@ index 13b623603d37..68b71437c2b9 100644 regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-always-on; -@@ -290,7 +290,7 @@ &usb_0_dwc3 { +@@ -102,7 +102,7 @@ }; &usb_0_qmpphy { @@ -35,7 +33,7 @@ index 13b623603d37..68b71437c2b9 100644 vdda-phy-supply = <®ulator_fixed_0p925>; status = "okay"; -@@ -298,7 +298,7 @@ &usb_0_qmpphy { +@@ -110,7 +110,7 @@ &usb_0_qusbphy { vdd-supply = <®ulator_fixed_0p925>; @@ -44,6 +42,3 @@ index 13b623603d37..68b71437c2b9 100644 vdda-phy-dpdm-supply = <®ulator_fixed_3p3>; status = "okay"; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/200-01-arm64-dts-qcom-ipq9574-Add-PCS-UNIPHY-device-tree-su.patch b/lede/target/linux/qualcommbe/patches-6.6/200-01-arm64-dts-qcom-ipq9574-Add-PCS-UNIPHY-device-tree-su.patch index 6f4a69a6ae..c020957aa7 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/200-01-arm64-dts-qcom-ipq9574-Add-PCS-UNIPHY-device-tree-su.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/200-01-arm64-dts-qcom-ipq9574-Add-PCS-UNIPHY-device-tree-su.patch @@ -19,8 +19,6 @@ Signed-off-by: Lei Wei arch/arm64/boot/dts/qcom/ipq9574.dtsi | 110 +++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 02cf318e3d17..ce3a1b5d70ea 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -3,7 +3,7 @@ @@ -32,7 +30,7 @@ index 02cf318e3d17..ce3a1b5d70ea 100644 */ #include -@@ -776,6 +776,114 @@ frame@b128000 { +@@ -826,6 +826,114 @@ #power-domain-cells = <1>; #interconnect-cells = <1>; }; @@ -147,6 +145,3 @@ index 02cf318e3d17..ce3a1b5d70ea 100644 }; thermal-zones { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/200-02-arm64-dts-qcom-Add-IPQ9574-MDIO-device-node.patch b/lede/target/linux/qualcommbe/patches-6.6/200-02-arm64-dts-qcom-Add-IPQ9574-MDIO-device-node.patch index 01ed26dacd..ff16521d91 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/200-02-arm64-dts-qcom-Add-IPQ9574-MDIO-device-node.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/200-02-arm64-dts-qcom-Add-IPQ9574-MDIO-device-node.patch @@ -13,11 +13,9 @@ Signed-off-by: Luo Jie arch/arm64/boot/dts/qcom/ipq9574.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 07a96d26b359..ef82935e7ef5 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -256,6 +256,8 @@ rng: rng@e3000 { +@@ -251,6 +251,8 @@ mdio: mdio@90000 { compatible = "qcom,ipq9574-mdio", "qcom,ipq4019-mdio"; reg = <0x00090000 0x64>; @@ -26,7 +24,7 @@ index 07a96d26b359..ef82935e7ef5 100644 #address-cells = <1>; #size-cells = <0>; clocks = <&gcc GCC_MDIO_AHB_CLK>; -@@ -315,6 +317,22 @@ tlmm: pinctrl@1000000 { +@@ -322,6 +324,22 @@ interrupt-controller; #interrupt-cells = <2>; @@ -49,6 +47,3 @@ index 07a96d26b359..ef82935e7ef5 100644 uart2_pins: uart2-state { pins = "gpio34", "gpio35"; function = "blsp2_uart"; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/200-03-arm64-dts-qcom-Add-IPQ9574-PPE-base-device-node.patch b/lede/target/linux/qualcommbe/patches-6.6/200-03-arm64-dts-qcom-Add-IPQ9574-PPE-base-device-node.patch index 49c1ef3fa2..f33bb0ebdd 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/200-03-arm64-dts-qcom-Add-IPQ9574-PPE-base-device-node.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/200-03-arm64-dts-qcom-Add-IPQ9574-PPE-base-device-node.patch @@ -13,11 +13,9 @@ Signed-off-by: Luo Jie arch/arm64/boot/dts/qcom/ipq9574.dtsi | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index ce3a1b5d70ea..07a96d26b359 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -884,6 +884,44 @@ pcsuniphy2_ch0: uniphy-ch@0 { +@@ -952,6 +952,44 @@ "ch_tx"; }; }; @@ -62,6 +60,3 @@ index ce3a1b5d70ea..07a96d26b359 100644 }; thermal-zones { --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/200-04-arm64-dts-qcom-Add-EDMA-node-for-IPQ9574.patch b/lede/target/linux/qualcommbe/patches-6.6/200-04-arm64-dts-qcom-Add-EDMA-node-for-IPQ9574.patch index 61f7d376d8..8c3a0ac6e4 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/200-04-arm64-dts-qcom-Add-EDMA-node-for-IPQ9574.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/200-04-arm64-dts-qcom-Add-EDMA-node-for-IPQ9574.patch @@ -12,11 +12,9 @@ Signed-off-by: Pavithra R arch/arm64/boot/dts/qcom/ipq9574.dtsi | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index ef82935e7ef5..61f9a7ee7282 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -939,6 +939,74 @@ &gcc SLAVE_NSSNOC_MEMNOC>, +@@ -989,6 +989,74 @@ "nssnoc_memnoc", "memnoc_nssnoc", "memnoc_nssnoc_1"; @@ -91,6 +89,3 @@ index ef82935e7ef5..61f9a7ee7282 100644 }; }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/200-05-arm64-dts-qcom-Add-IPQ9574-RDP433-port-node.patch b/lede/target/linux/qualcommbe/patches-6.6/200-05-arm64-dts-qcom-Add-IPQ9574-RDP433-port-node.patch index a79022939d..d48b34293d 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/200-05-arm64-dts-qcom-Add-IPQ9574-RDP433-port-node.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/200-05-arm64-dts-qcom-Add-IPQ9574-RDP433-port-node.patch @@ -16,11 +16,9 @@ Signed-off-by: Lei Wei arch/arm64/boot/dts/qcom/ipq9574.dtsi | 2 +- 2 files changed, 169 insertions(+), 2 deletions(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -index 1bb8d96c9a82..1bbe4c258c15 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -@@ -3,7 +3,7 @@ +@@ -3,11 +3,13 @@ * IPQ9574 RDP433 board device tree source * * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. @@ -29,7 +27,13 @@ index 1bb8d96c9a82..1bbe4c258c15 100644 */ /dts-v1/; -@@ -15,6 +15,46 @@ / { + ++#include ++ + #include "ipq9574-rdp-common.dtsi" + + / { +@@ -15,6 +17,46 @@ compatible = "qcom,ipq9574-ap-al02-c7", "qcom,ipq9574"; }; @@ -76,8 +80,8 @@ index 1bb8d96c9a82..1bbe4c258c15 100644 &sdhc_1 { pinctrl-0 = <&sdc_default_state>; pinctrl-names = "default"; -@@ -60,3 +100,130 @@ rclk-pins { - }; +@@ -103,3 +145,130 @@ + nand-ecc-step-size = <512>; }; }; + @@ -207,11 +211,9 @@ index 1bb8d96c9a82..1bbe4c258c15 100644 + }; + }; +}; -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 61f9a7ee7282..5c7b47979b79 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -903,7 +903,7 @@ pcsuniphy2_ch0: uniphy-ch@0 { +@@ -953,7 +953,7 @@ }; }; @@ -220,6 +222,3 @@ index 61f9a7ee7282..5c7b47979b79 100644 compatible = "qcom,ipq9574-ppe"; reg = <0x3a000000 0xbef800>; ranges; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/300-dt-bindings-clock-Add-clock-ID-for-IPQ-PCS-UNIPHY.patch b/lede/target/linux/qualcommbe/patches-6.6/300-dt-bindings-clock-Add-clock-ID-for-IPQ-PCS-UNIPHY.patch index c33bee9f02..a4aafc2fea 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/300-dt-bindings-clock-Add-clock-ID-for-IPQ-PCS-UNIPHY.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/300-dt-bindings-clock-Add-clock-ID-for-IPQ-PCS-UNIPHY.patch @@ -13,9 +13,6 @@ Signed-off-by: Christian Marangi 1 file changed, 13 insertions(+) create mode 100644 include/dt-bindings/clock/qcom,ipq-pcs-uniphy.h -diff --git a/include/dt-bindings/clock/qcom,ipq-pcs-uniphy.h b/include/dt-bindings/clock/qcom,ipq-pcs-uniphy.h -new file mode 100644 -index 000000000000..c47d7191cda5 --- /dev/null +++ b/include/dt-bindings/clock/qcom,ipq-pcs-uniphy.h @@ -0,0 +1,13 @@ @@ -32,6 +29,3 @@ index 000000000000..c47d7191cda5 +#define UNIPHY_NSS_TX_CLK 1 + +#endif --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/301-net-ethernet-qualcomm-Add-support-for-label-property.patch b/lede/target/linux/qualcommbe/patches-6.6/301-net-ethernet-qualcomm-Add-support-for-label-property.patch index 2fb1260256..85a7bd6cd3 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/301-net-ethernet-qualcomm-Add-support-for-label-property.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/301-net-ethernet-qualcomm-Add-support-for-label-property.patch @@ -15,11 +15,9 @@ Signed-off-by: Christian Marangi drivers/net/ethernet/qualcomm/ppe/edma_port.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) -diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.c b/drivers/net/ethernet/qualcomm/ppe/edma_port.c -index 0b3b769a4a49..6730cee5d6c9 100644 --- a/drivers/net/ethernet/qualcomm/ppe/edma_port.c +++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.c -@@ -355,13 +355,25 @@ int edma_port_setup(struct ppe_port *port) +@@ -355,13 +355,25 @@ int edma_port_setup(struct ppe_port *por int port_id = port->port_id; struct net_device *netdev; u8 mac_addr[ETH_ALEN]; @@ -48,6 +46,3 @@ index 0b3b769a4a49..6730cee5d6c9 100644 return -ENOMEM; } --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/302-arm64-dts-qcom-Add-missing-clock-for-nsscc-from-pcs-.patch b/lede/target/linux/qualcommbe/patches-6.6/302-arm64-dts-qcom-Add-missing-clock-for-nsscc-from-pcs-.patch index 34247e9c72..c7b7ea14b6 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/302-arm64-dts-qcom-Add-missing-clock-for-nsscc-from-pcs-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/302-arm64-dts-qcom-Add-missing-clock-for-nsscc-from-pcs-.patch @@ -11,8 +11,6 @@ Signed-off-by: Christian Marangi arch/arm64/boot/dts/qcom/ipq9574.dtsi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 5aa456bc0e03..2785e1ba1ca9 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -14,6 +14,7 @@ @@ -23,7 +21,7 @@ index 5aa456bc0e03..2785e1ba1ca9 100644 #include / { -@@ -809,12 +810,12 @@ nsscc: clock-controller@39b00000 { +@@ -832,12 +833,12 @@ <&cmn_pll NSS_1200MHZ_CLK>, <&cmn_pll PPE_353MHZ_CLK>, <&gcc GPLL0_OUT_AUX>, @@ -42,6 +40,3 @@ index 5aa456bc0e03..2785e1ba1ca9 100644 <&gcc GCC_NSSCC_CLK>; #clock-cells = <1>; #reset-cells = <1>; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/303-arm64-dts-qcom-add-partition-table-for-ipq9574-rdp-c.patch b/lede/target/linux/qualcommbe/patches-6.6/303-arm64-dts-qcom-add-partition-table-for-ipq9574-rdp-c.patch index 21e53b3ed2..526d559e34 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/303-arm64-dts-qcom-add-partition-table-for-ipq9574-rdp-c.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/303-arm64-dts-qcom-add-partition-table-for-ipq9574-rdp-c.patch @@ -11,11 +11,9 @@ Signed-off-by: Christian Marangi .../boot/dts/qcom/ipq9574-rdp-common.dtsi | 146 +++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -index 9a8692377176..13b623603d37 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -@@ -74,11 +74,155 @@ &blsp1_spi0 { +@@ -44,11 +44,155 @@ status = "okay"; flash@0 { @@ -106,7 +104,7 @@ index 9a8692377176..13b623603d37 100644 + partition@4d0000 { + label = "0:rpm"; + reg = <0x4d0000 0x20000>; -+ read-only; ++ // read-only; + }; + + partition@4f0000 { @@ -172,6 +170,3 @@ index 9a8692377176..13b623603d37 100644 }; }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/304-dts-qcom-add-AQR-NVMEM-node-for-IPQ9574-RDP433-board.patch b/lede/target/linux/qualcommbe/patches-6.6/304-dts-qcom-add-AQR-NVMEM-node-for-IPQ9574-RDP433-board.patch index b37a9d3bb7..4de13b73ab 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/304-dts-qcom-add-AQR-NVMEM-node-for-IPQ9574-RDP433-board.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/304-dts-qcom-add-AQR-NVMEM-node-for-IPQ9574-RDP433-board.patch @@ -11,11 +11,9 @@ Signed-off-by: Christian Marangi arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -index d56abe92c24e..44407ebbe06a 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -@@ -49,11 +49,17 @@ phy3: ethernet-phy@13 { +@@ -49,11 +49,17 @@ phy4: ethernet-phy@8 { compatible ="ethernet-phy-ieee802.3-c45"; reg = <8>; @@ -33,6 +31,3 @@ index d56abe92c24e..44407ebbe06a 100644 }; }; --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/305-net-ethernet-qualcomm-ppe-Fix-unmet-dependency-with-.patch b/lede/target/linux/qualcommbe/patches-6.6/305-net-ethernet-qualcomm-ppe-Fix-unmet-dependency-with-.patch index a2c7061438..8cb83ae4dc 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/305-net-ethernet-qualcomm-ppe-Fix-unmet-dependency-with-.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/305-net-ethernet-qualcomm-ppe-Fix-unmet-dependency-with-.patch @@ -18,8 +18,6 @@ Signed-off-by: Christian Marangi drivers/net/ethernet/qualcomm/Kconfig | 1 - 1 file changed, 1 deletion(-) -diff --git a/drivers/net/ethernet/qualcomm/Kconfig b/drivers/net/ethernet/qualcomm/Kconfig -index a96f6acd4561..364d7e8ea7bf 100644 --- a/drivers/net/ethernet/qualcomm/Kconfig +++ b/drivers/net/ethernet/qualcomm/Kconfig @@ -68,7 +68,6 @@ config QCOM_PPE @@ -30,6 +28,3 @@ index a96f6acd4561..364d7e8ea7bf 100644 help This driver supports the Qualcomm Technologies, Inc. packet process engine (PPE) available with IPQ SoC. The PPE houses --- -2.45.2 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/306-spi-spi-qpic-fix-broken-driver-with-SPINAND_SET_FEAT.patch b/lede/target/linux/qualcommbe/patches-6.6/306-spi-spi-qpic-fix-broken-driver-with-SPINAND_SET_FEAT.patch deleted file mode 100644 index c812792ea1..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/306-spi-spi-qpic-fix-broken-driver-with-SPINAND_SET_FEAT.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 8716f3c03d9f71ed0bd12a26f6e9d1e85cff0d12 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Thu, 30 Jan 2025 00:27:22 +0100 -Subject: [PATCH 1/2] spi: spi-qpic: fix broken driver with SPINAND_SET_FEATURE - command - -The driver always return probe error with SPINAND_SET_FEATURE command: - -spi-nand: probe of spi0.0 failed with error -1207959538 - -The error doesn't match any expected negative error but instead seems to -be an u32 converted to an int. Investigating the entire codeflow I -reached the culprit: qcom_spi_cmd_mapping. - -Such function can return -EOPNOTSUPP or the cmd to run. Problem is that -in the specific context of SPINAND_SET_FEATURE, BIT(31) is set that in -the context of an integer, it gets treated as a negative value. - -To correctly handle this, rework the function to return 0 or a "correct" -negative error and pass a pointer to store the cmd. - -Signed-off-by: Christian Marangi ---- - drivers/spi/spi-qpic-snand.c | 40 +++++++++++++++++------------------- - 1 file changed, 19 insertions(+), 21 deletions(-) - -diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c -index fcec48434776..b0e8aac043f5 100644 ---- a/drivers/spi/spi-qpic-snand.c -+++ b/drivers/spi/spi-qpic-snand.c -@@ -1200,64 +1200,64 @@ static int qcom_spi_program_execute(struct qcom_nand_controller *snandc, - return 0; - } - --static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode) -+static int qcom_spi_cmd_mapping(struct qcom_nand_controller *snandc, u32 opcode, -+ u32 *cmd) - { -- int cmd = 0x0; -- - switch (opcode) { - case SPINAND_RESET: -- cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE); -+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_RESET_DEVICE); - break; - case SPINAND_READID: -- cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID); -+ *cmd = (SPI_WP | SPI_HOLD | SPI_TRANSFER_MODE_x1 | OP_FETCH_ID); - break; - case SPINAND_GET_FEATURE: -- cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE); -+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE); - break; - case SPINAND_SET_FEATURE: -- cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE | -+ *cmd = (SPI_TRANSFER_MODE_x1 | SPI_WP | SPI_HOLD | ACC_FEATURE | - QPIC_SET_FEATURE); - break; - case SPINAND_READ: - if (snandc->qspi->raw_rw) { -- cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 | -+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 | - SPI_WP | SPI_HOLD | OP_PAGE_READ); - } else { -- cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 | -+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 | - SPI_WP | SPI_HOLD | OP_PAGE_READ_WITH_ECC); - } - - break; - case SPINAND_ERASE: -- cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP | -+ *cmd = OP_BLOCK_ERASE | PAGE_ACC | LAST_PAGE | SPI_WP | - SPI_HOLD | SPI_TRANSFER_MODE_x1; - break; - case SPINAND_WRITE_EN: -- cmd = SPINAND_WRITE_EN; -+ *cmd = SPINAND_WRITE_EN; - break; - case SPINAND_PROGRAM_EXECUTE: -- cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 | -+ *cmd = (PAGE_ACC | LAST_PAGE | SPI_TRANSFER_MODE_x1 | - SPI_WP | SPI_HOLD | OP_PROGRAM_PAGE); - break; - case SPINAND_PROGRAM_LOAD: -- cmd = SPINAND_PROGRAM_LOAD; -+ *cmd = SPINAND_PROGRAM_LOAD; - break; - default: - dev_err(snandc->dev, "Opcode not supported: %u\n", opcode); - return -EOPNOTSUPP; - } - -- return cmd; -+ return 0; - } - - static int qcom_spi_write_page(struct qcom_nand_controller *snandc, - const struct spi_mem_op *op) - { -- int cmd; -+ u32 cmd; -+ int ret; - -- cmd = qcom_spi_cmd_mapping(snandc, op->cmd.opcode); -- if (cmd < 0) -- return cmd; -+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd); -+ if (ret < 0) -+ return ret; - - if (op->cmd.opcode == SPINAND_PROGRAM_LOAD) - snandc->qspi->data_buf = (u8 *)op->data.buf.out; -@@ -1272,12 +1272,10 @@ static int qcom_spi_send_cmdaddr(struct qcom_nand_controller *snandc, - u32 cmd; - int ret, opcode; - -- ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode); -+ ret = qcom_spi_cmd_mapping(snandc, op->cmd.opcode, &cmd); - if (ret < 0) - return ret; - -- cmd = ret; -- - s_op.cmd_reg = cmd; - s_op.addr1_reg = op->addr.val; - s_op.addr2_reg = 0; --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/307-arm64-dts-qcom-ipq9574-add-QPIC-SPI-NAND-default-par.patch b/lede/target/linux/qualcommbe/patches-6.6/307-arm64-dts-qcom-ipq9574-add-QPIC-SPI-NAND-default-par.patch deleted file mode 100644 index be42d04260..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/307-arm64-dts-qcom-ipq9574-add-QPIC-SPI-NAND-default-par.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 2f328bd852cbb27cf0d2cad1727d8fb7a69abe87 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Thu, 30 Jan 2025 00:39:30 +0100 -Subject: [PATCH 2/2] arm64: dts: qcom: ipq9574: add QPIC SPI NAND default - partition nodes - -Add QPIC SPI NAND default partition nodes for RDP reference board. - -Signed-off-by: Christian Marangi ---- - .../boot/dts/qcom/ipq9574-rdp-common.dtsi | 28 +++++++++++++++++++ - 1 file changed, 28 insertions(+) - -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -index 8d2a22c3c49d..f34e9791f3f3 100644 ---- a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi -@@ -325,6 +325,34 @@ flash@0 { - nand-ecc-engine = <&qpic_nand>; - nand-ecc-strength = <4>; - nand-ecc-step-size = <512>; -+ -+ partitions { -+ compatible = "fixed-partitions"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ partition@0 { -+ label = "0:training"; -+ reg = <0x0 0x80000>; -+ read-only; -+ }; -+ -+ partition@80000 { -+ label = "0:license"; -+ reg = <0x80000 0x40000>; -+ read-only; -+ }; -+ -+ partition@c0000 { -+ label = "rootfs"; -+ reg = <0xc0000 0x3c00000>; -+ }; -+ -+ partition@3cc0000 { -+ label = "rootfs_1"; -+ reg = <0x3cc0000 0x3c00000>; -+ }; -+ }; - }; - }; - --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/308-01-PM-runtime-add-of_pm_clk_add_clk_index-OP-variant.patch b/lede/target/linux/qualcommbe/patches-6.6/308-01-PM-runtime-add-of_pm_clk_add_clk_index-OP-variant.patch deleted file mode 100644 index 8105aa5326..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/308-01-PM-runtime-add-of_pm_clk_add_clk_index-OP-variant.patch +++ /dev/null @@ -1,73 +0,0 @@ -From afba5111aed03a05aa7fd46d3d9911319fa87a29 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Thu, 30 Jan 2025 16:07:14 +0100 -Subject: [PATCH 1/3] PM: runtime: add of_pm_clk_add_clk_index OP variant - -Add of_pm_clk_add_clk_index OP variant of of_pm_clk_add_clk to take as -argument the clock index in DT instead of the name. This is to handle -case where clock-names property is not used by the node but clocks are -referenced with a dt-binding header or internally in the driver. - -Signed-off-by: Christian Marangi ---- - drivers/base/power/clock_ops.c | 31 +++++++++++++++++++++++++++++++ - include/linux/pm_clock.h | 1 + - 2 files changed, 32 insertions(+) - -diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c -index e18ba676cdf6..49af639a1b7d 100644 ---- a/drivers/base/power/clock_ops.c -+++ b/drivers/base/power/clock_ops.c -@@ -259,6 +259,37 @@ int pm_clk_add_clk(struct device *dev, struct clk *clk) - } - EXPORT_SYMBOL_GPL(pm_clk_add_clk); - -+/** -+ * of_pm_clk_add_clk_index - Start using a device clock for power management. -+ * @dev: Device whose clock is going to be used for power management. -+ * @index: Index of clock that is going to be used for power management. -+ * -+ * Add the clock described in the 'clocks' device-tree node at the index -+ * provided, to the list of clocks used for the power management of @dev. -+ * On success, returns 0. Returns a negative error code if the clock is not -+ * found or cannot be added. -+ */ -+int of_pm_clk_add_clk_index(struct device *dev, int index) -+{ -+ struct clk *clk; -+ int ret; -+ -+ if (!dev || !dev->of_node || index < 0) -+ return -EINVAL; -+ -+ clk = of_clk_get(dev->of_node, index); -+ if (IS_ERR(clk)) -+ return PTR_ERR(clk); -+ -+ ret = pm_clk_add_clk(dev, clk); -+ if (ret) { -+ clk_put(clk); -+ return ret; -+ } -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(of_pm_clk_add_clk_index); - - /** - * of_pm_clk_add_clk - Start using a device clock for power management. -diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h -index 68669ce18720..4005898007a1 100644 ---- a/include/linux/pm_clock.h -+++ b/include/linux/pm_clock.h -@@ -41,6 +41,7 @@ extern int pm_clk_create(struct device *dev); - extern void pm_clk_destroy(struct device *dev); - extern int pm_clk_add(struct device *dev, const char *con_id); - extern int pm_clk_add_clk(struct device *dev, struct clk *clk); -+extern int of_pm_clk_add_clk_index(struct device *dev, int index); - extern int of_pm_clk_add_clk(struct device *dev, const char *name); - extern int of_pm_clk_add_clks(struct device *dev); - extern void pm_clk_remove(struct device *dev, const char *con_id); --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/308-02-clk-qcom-nsscc-Attach-required-NSSNOC-clock-to-PM-do.patch b/lede/target/linux/qualcommbe/patches-6.6/308-02-clk-qcom-nsscc-Attach-required-NSSNOC-clock-to-PM-do.patch deleted file mode 100644 index cf90309f9d..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/308-02-clk-qcom-nsscc-Attach-required-NSSNOC-clock-to-PM-do.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 9408076fd9e4d41876af41523cad9bfa77b3a557 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Thu, 30 Jan 2025 16:11:14 +0100 -Subject: [PATCH 2/3] clk: qcom: nsscc: Attach required NSSNOC clock to PM - domain - -There is currently a problem with ICC clock disabling the NSSNOC clock -as there isn't any user for them on calling sync_state. -This cause the kernel to stall if NSS is enabled and reboot with the watchdog. - -This is caused by the fact that the NSSNOC clock nsscc, snoc and snoc_1 -are actually required to make the NSS work and make the system continue -booting. - -To attach these clock, setup pm-clk in nsscc and setup the correct -resume/suspend OPs. - -With this change, the clock gets correctly attached and are not disabled -when ICC call the sync_state. - -Suggested-by: Dmitry Baryshkov -Signed-off-by: Christian Marangi ---- - drivers/clk/qcom/nsscc-ipq9574.c | 49 +++++++++++++++++++++++++++++++- - 1 file changed, 48 insertions(+), 1 deletion(-) - -diff --git a/drivers/clk/qcom/nsscc-ipq9574.c b/drivers/clk/qcom/nsscc-ipq9574.c -index d3e9aa391236..f10ace5176ee 100644 ---- a/drivers/clk/qcom/nsscc-ipq9574.c -+++ b/drivers/clk/qcom/nsscc-ipq9574.c -@@ -12,6 +12,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - -@@ -41,6 +43,9 @@ enum { - DT_UNIPHY1_NSS_TX_CLK, - DT_UNIPHY2_NSS_RX_CLK, - DT_UNIPHY2_NSS_TX_CLK, -+ DT_GCC_NSSNOC_NSSCC_CLK, -+ DT_GCC_NSSNOC_SNOC_CLK, -+ DT_GCC_NSSNOC_SNOC_1_CLK, - }; - - enum { -@@ -3046,6 +3051,10 @@ static const struct qcom_cc_desc nss_cc_ipq9574_desc = { - .icc_first_node_id = IPQ_NSSCC_ID, - }; - -+static const struct dev_pm_ops nsscc_pm_ops = { -+ SET_RUNTIME_PM_OPS(pm_clk_suspend, pm_clk_resume, NULL) -+}; -+ - static const struct of_device_id nss_cc_ipq9574_match_table[] = { - { .compatible = "qcom,ipq9574-nsscc" }, - { } -@@ -3054,7 +3063,33 @@ MODULE_DEVICE_TABLE(of, nss_cc_ipq9574_match_table); - - static int nss_cc_ipq9574_probe(struct platform_device *pdev) - { -+ struct device *dev = &pdev->dev; - struct regmap *regmap; -+ int ret; -+ -+ ret = devm_pm_runtime_enable(dev); -+ if (ret) -+ return ret; -+ -+ ret = devm_pm_clk_create(dev); -+ if (ret) -+ return ret; -+ -+ ret = of_pm_clk_add_clk_index(dev, DT_GCC_NSSNOC_NSSCC_CLK); -+ if (ret) -+ return dev_err_probe(dev, ret,"failed to acquire nssnoc clock\n"); -+ -+ ret = of_pm_clk_add_clk_index(dev, DT_GCC_NSSNOC_SNOC_CLK); -+ if (ret) -+ return dev_err_probe(dev, ret,"failed to acquire snoc clock\n"); -+ -+ ret = of_pm_clk_add_clk_index(dev, DT_GCC_NSSNOC_SNOC_1_CLK); -+ if (ret) -+ return dev_err_probe(dev, ret,"failed to acquire snoc_1 clock\n"); -+ -+ ret = pm_runtime_resume_and_get(dev); -+ if (ret) -+ return ret; - - regmap = qcom_cc_map(pdev, &nss_cc_ipq9574_desc); - if (IS_ERR(regmap)) -@@ -3062,7 +3097,18 @@ static int nss_cc_ipq9574_probe(struct platform_device *pdev) - - clk_alpha_pll_configure(&ubi32_pll_main, regmap, &ubi32_pll_config); - -- return qcom_cc_really_probe(&pdev->dev, &nss_cc_ipq9574_desc, regmap); -+ ret = qcom_cc_really_probe(dev, &nss_cc_ipq9574_desc, regmap); -+ if (ret) -+ goto err_put_pm; -+ -+ pm_runtime_put(dev); -+ -+ return 0; -+ -+err_put_pm: -+ pm_runtime_put_sync(dev); -+ -+ return ret; - } - - static struct platform_driver nss_cc_ipq9574_driver = { -@@ -3071,6 +3117,7 @@ static struct platform_driver nss_cc_ipq9574_driver = { - .name = "qcom,nsscc-ipq9574", - .of_match_table = nss_cc_ipq9574_match_table, - .sync_state = icc_sync_state, -+ .pm = &nsscc_pm_ops, - }, - }; - --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/308-03-arm64-dts-qcom-ipq9574-add-NSSNOC-clock-to-nss-node.patch b/lede/target/linux/qualcommbe/patches-6.6/308-03-arm64-dts-qcom-ipq9574-add-NSSNOC-clock-to-nss-node.patch deleted file mode 100644 index 66e872eb1a..0000000000 --- a/lede/target/linux/qualcommbe/patches-6.6/308-03-arm64-dts-qcom-ipq9574-add-NSSNOC-clock-to-nss-node.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 893fda72edd2a0b3d92be41af417d315c9c5c253 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Thu, 30 Jan 2025 16:23:03 +0100 -Subject: [PATCH 3/3] arm64: dts: qcom: ipq9574: add NSSNOC clock to nss node - -Add NSSNOC clock to nss node to attach the clock with PM clock and fix -the boot stall after ICC sync_state. - -Signed-off-by: Christian Marangi ---- - arch/arm64/boot/dts/qcom/ipq9574.dtsi | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -index 14a719a8d661..500e8f6733b1 100644 ---- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi -+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi -@@ -843,7 +843,9 @@ nsscc: clock-controller@39b00000 { - <&pcsuniphy1 UNIPHY_NSS_TX_CLK>, - <&pcsuniphy2 UNIPHY_NSS_RX_CLK>, - <&pcsuniphy2 UNIPHY_NSS_TX_CLK>, -- <&gcc GCC_NSSCC_CLK>; -+ <&gcc GCC_NSSNOC_NSSCC_CLK>, -+ <&gcc GCC_NSSNOC_SNOC_CLK>, -+ <&gcc GCC_NSSNOC_SNOC_1_CLK>; - #clock-cells = <1>; - #reset-cells = <1>; - #power-domain-cells = <1>; --- -2.47.1 - diff --git a/lede/target/linux/qualcommbe/patches-6.6/900-arm64-dts-qcom-Add-label-to-EDMA-port-for-IPQ9574-RD.patch b/lede/target/linux/qualcommbe/patches-6.6/900-arm64-dts-qcom-Add-label-to-EDMA-port-for-IPQ9574-RD.patch index c5815a407d..f8c95d28d6 100644 --- a/lede/target/linux/qualcommbe/patches-6.6/900-arm64-dts-qcom-Add-label-to-EDMA-port-for-IPQ9574-RD.patch +++ b/lede/target/linux/qualcommbe/patches-6.6/900-arm64-dts-qcom-Add-label-to-EDMA-port-for-IPQ9574-RD.patch @@ -10,11 +10,9 @@ Signed-off-by: Christian Marangi arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -index f835ff9f4b28..d56abe92c24e 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp433.dts -@@ -112,6 +112,7 @@ port@1 { +@@ -161,6 +161,7 @@ reg = <1>; phy-mode = "qsgmii"; managed = "in-band-status"; @@ -22,7 +20,7 @@ index f835ff9f4b28..d56abe92c24e 100644 phy-handle = <&phy0>; pcs-handle = <&pcsuniphy0_ch0>; clocks = <&nsscc NSS_CC_PORT1_MAC_CLK>, -@@ -132,6 +133,7 @@ port@2 { +@@ -181,6 +182,7 @@ reg = <2>; phy-mode = "qsgmii"; managed = "in-band-status"; @@ -30,7 +28,7 @@ index f835ff9f4b28..d56abe92c24e 100644 phy-handle = <&phy1>; pcs-handle = <&pcsuniphy0_ch1>; clocks = <&nsscc NSS_CC_PORT2_MAC_CLK>, -@@ -152,6 +154,7 @@ port@3 { +@@ -201,6 +203,7 @@ reg = <3>; phy-mode = "qsgmii"; managed = "in-band-status"; @@ -38,7 +36,7 @@ index f835ff9f4b28..d56abe92c24e 100644 phy-handle = <&phy2>; pcs-handle = <&pcsuniphy0_ch2>; clocks = <&nsscc NSS_CC_PORT3_MAC_CLK>, -@@ -172,6 +175,7 @@ port@4 { +@@ -221,6 +224,7 @@ reg = <4>; phy-mode = "qsgmii"; managed = "in-band-status"; @@ -46,7 +44,7 @@ index f835ff9f4b28..d56abe92c24e 100644 phy-handle = <&phy3>; pcs-handle = <&pcsuniphy0_ch3>; clocks = <&nsscc NSS_CC_PORT4_MAC_CLK>, -@@ -192,6 +196,7 @@ port@5 { +@@ -241,6 +245,7 @@ reg = <5>; phy-mode = "usxgmii"; managed = "in-band-status"; @@ -54,7 +52,7 @@ index f835ff9f4b28..d56abe92c24e 100644 phy-handle = <&phy4>; pcs-handle = <&pcsuniphy1_ch0>; clocks = <&nsscc NSS_CC_PORT5_MAC_CLK>, -@@ -212,6 +217,7 @@ port@6 { +@@ -261,6 +266,7 @@ reg = <6>; phy-mode = "usxgmii"; managed = "in-band-status"; @@ -62,6 +60,3 @@ index f835ff9f4b28..d56abe92c24e 100644 phy-handle = <&phy5>; pcs-handle = <&pcsuniphy2_ch0>; clocks = <&nsscc NSS_CC_PORT6_MAC_CLK>, --- -2.45.2 - diff --git a/sing-box/.goreleaser.yaml b/sing-box/.goreleaser.yaml index 4d7fd50282..15e2fa3acf 100644 --- a/sing-box/.goreleaser.yaml +++ b/sing-box/.goreleaser.yaml @@ -24,6 +24,7 @@ builds: - with_tailscale env: - CGO_ENABLED=0 + - GOTOOLCHAIN=local targets: - linux_386 - linux_amd64_v1 @@ -62,6 +63,7 @@ builds: <<: *template env: - CGO_ENABLED=1 + - GOTOOLCHAIN=local overrides: - goos: android goarch: arm diff --git a/sing-box/Makefile b/sing-box/Makefile index ab399a29d8..1a084b0196 100644 --- a/sing-box/Makefile +++ b/sing-box/Makefile @@ -18,14 +18,17 @@ PREFIX ?= $(shell go env GOPATH) .PHONY: test release docs build build: + export GOTOOLCHAIN=local && \ go build $(MAIN_PARAMS) $(MAIN) ci_build_go120: - go build $(PARAMS) $(MAIN) + export GOTOOLCHAIN=local && \ + go build $(PARAMS) $(MAIN) && \ go build $(PARAMS) -tags "$(TAGS_GO120)" $(MAIN) ci_build: - go build $(PARAMS) $(MAIN) + export GOTOOLCHAIN=local && \ + go build $(PARAMS) $(MAIN) && \ go build $(MAIN_PARAMS) $(MAIN) generate_completions: diff --git a/sing-box/adapter/outbound.go b/sing-box/adapter/outbound.go index 86a3bf5fb1..2c2b109100 100644 --- a/sing-box/adapter/outbound.go +++ b/sing-box/adapter/outbound.go @@ -5,7 +5,6 @@ import ( "github.com/sagernet/sing-box/log" "github.com/sagernet/sing-box/option" - "github.com/sagernet/sing-tun" N "github.com/sagernet/sing/common/network" ) @@ -19,11 +18,6 @@ type Outbound interface { N.Dialer } -type DirectRouteOutbound interface { - Outbound - NewDirectRouteConnection(metadata InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) -} - type OutboundRegistry interface { option.OutboundOptionsRegistry CreateOutbound(ctx context.Context, router Router, logger log.ContextLogger, tag string, outboundType string, options any) (Outbound, error) diff --git a/sing-box/adapter/router.go b/sing-box/adapter/router.go index 14a8f791c7..b82cb5d8f2 100644 --- a/sing-box/adapter/router.go +++ b/sing-box/adapter/router.go @@ -8,7 +8,6 @@ import ( "sync" C "github.com/sagernet/sing-box/constant" - "github.com/sagernet/sing-tun" M "github.com/sagernet/sing/common/metadata" N "github.com/sagernet/sing/common/network" "github.com/sagernet/sing/common/ntp" @@ -20,7 +19,7 @@ import ( type Router interface { Lifecycle ConnectionRouter - PreMatch(metadata InboundContext, context tun.DirectRouteContext) (tun.DirectRouteDestination, error) + PreMatch(metadata InboundContext) error ConnectionRouterEx RuleSet(tag string) (RuleSet, bool) NeedWIFIState() bool diff --git a/sing-box/common/sniff/quic_test.go b/sing-box/common/sniff/quic_test.go index e75e86a5d2..1fbf60961c 100644 --- a/sing-box/common/sniff/quic_test.go +++ b/sing-box/common/sniff/quic_test.go @@ -12,6 +12,26 @@ import ( "github.com/stretchr/testify/require" ) +func TestSniffQUICChromeNew(t *testing.T) { + t.Parallel() + pkt, err := hex.DecodeString("ca0000000108e241a0c601413b4f004046006d8f15dae9999edf39d58df6762822b9a2ab996d7f6a10044338af3b51b1814bc4ac0fa5a87c34c6ae604af8cabc5957c5240174deefc8e378719ffdab2ae4e15bf4514bea4489ad89c322f75f9a383c90d126a0b21104cb519c2bb32e6a134e86896452e942b26c519b8c7ac9e4c99fae5e1f65cf08fb98443b30e4567932e8fb0789820d8f33037b59ac8113530258c9467dfb52489396dae01f099d28b234efa107fa411f2a1ffa2abe74988e03d662d4296024e95ce0fe1671724937157f77b84990478a2d4060676cf0827b4e8c600654111750414dafa0cccb332f3020c2922a015f445df5edc9c7d2d1ceea9fddcc9ff821c9183aa39a70da20fcc057579e1051c1c899148d6cf9d08b4919822082d040d1ce03ca4f216be6cb7ef03db6df0993ef1ccce5c8c648980554f41704526e1809d2545739f5872e75ec797db1c99f5682e2eda9363cb32aa367b7b363c782ddbacf874183cc15c8a2db068dd4093eebdd096ad33832a7939deb0a872279744f5a56dc001ba62fac973bf680f3b362bdd336add4dd102f462b773bf70bfce1921070a802a92025273a177186d1a643081b42175eb789ccddadb71033ef4feacbf6fd282ab622cf61669d73cda559e411c6ccdd8f003443b6933b7729b7a357aa4aa2fba0f365f829a4d497afb5dc2648a53bc9f3e786d955069d0a4781088a5463747dfe9958ea19ea444eae947ec6a67640955f710f93640084f3fbb8ad259b68dbc0ee0b7fab2d81bffd83ed8a6d33522dbfef43bec0a0fb4bdf1cb712dc4ced0680c0687fa240fd157baa232b1c84e14adce6421cf9270f9b3972f98fc67b344b8a4f1fb551e26f7f76d484ed9f8197f231dc5d9a44cc0ddce73d7f810a620851f4e97eb5037ab5135d7c3be5b80cc32d19910b8387aca64c93c02dc3e35238b78e6aff470722078982e58802844932b6041446bfdcc97ba640cbb86721bcd0f40f27b77aa6287ce5674ec1720134b9302875482c3269787e004b9edb483d44f326eef38c0e83cb46af96488c2e696bc2524567fb29c1e8edcd5a73615496d172d46a9d29e0505c0018b7bbb00165eca0389e09c4b1d73b6cc4a2f735a720650134a2e98e8105e20695cf231b92586237dfe0f99c897414e51c21627496276535f07abb53fb2b554376fe520fa45a3e944fd91dfe7a72aead08842b6b63d8edf861fb911954c83bd9a896eb9da4af5eff646455069d747facd4e77c254096843bff7c3e9031dbdf8dc37ea45f1122922fcbc322ec1378f3c7c1af0da62e1052e6210f1b23073f93a82d90e14cb20bc4501d487a1c848674d57a7c269b13590b3a99d8b8b4f6d0dfbd1d2cbbe7a32c0d5c84ae7ec438b0b19f3862d8fabaa828d06c7e3c6967405cd56a1ae90f38633e2ee0e3ecfca3df399fe12f029e0860a1a30da010300d0c94f0bf56091d00011488c1429928b21c739ebf50ba8be91116315d3173f6d2c56735722478c4d74392ba84d1727036b3d64e8c2263b0f33cb8086be587ca6b3940259c06afa2683868856529303ae12e91d7ca874568be7f2bfaa0656dfab0ed31ed90eaea10fb7f3433ec59a334abe6211d547fa0c825ac45d3691e749d15432008de83e9f6d98f368359137ae803d9189b3386f800c7c0cf4b615d1983cf82d9981a8105b60a80fe66c9b0d439b5ba153dd19e9e7483a01cf3b02b4597540b38e658d4eb8455e030b2bf2690bdd78c23f16fe5") + require.NoError(t, err) + var metadata adapter.InboundContext + err = sniff.QUICClientHello(context.Background(), &metadata, pkt) + require.Equal(t, metadata.Protocol, C.ProtocolQUIC) + require.Equal(t, metadata.Client, C.ClientChromium) + require.ErrorIs(t, err, sniff.ErrClientHelloFragmented) + pkt, err = hex.DecodeString("cc0000000108e241a0c601413b4f004046006d8f15dae9999edf39d58df6762822b9a2ab996d7f6a10044338af3b51b1814bc4ac0fa5a87c34c6ae604af8cabc5957c5240174deefc8e378719ffdab2ae4e15bf4514bea44894b626c685cd5d5c965f7e97b3a1bdc520b75813e747f37a3ae83ad38b9ca2acb0de4fc9424839a50c8fb815a62b498609fbbc59145698860e0509cc08a04d1b119daef844ba2f09c16e2665e5cc0b47624b71f7b950c54fd56b4a1fbb826cba44eeeee3949ced8f5de60d4c81b19ee59f75aa1abb33f22c6b13c27095eb1e99cff01fdc93e6e88da2622ee18c08a79f508befd7e33e99bca60e64bef9a47b764384bd93823daeeb6fcb4d7cfbc4ab53eff59b3636f6dcaaf229b5a94941b5712807166b9bd5e82cb4a9708a71451c4cd6f6e33fb2fe40c8c70dd51a30b37ff9c5e35783debde0093fde19ce074b4887b3c90980b107b9c0f32cf61a66f37c251b789abc4d27fc421207966846c8cc7faa42d9af6ad355a6bc94cb78223b612be8b3e2a4df61fee83a674a0ceb8b7c3a29b97102cda22fecdf6a4628e5b612bc17eab64d6f75feedd0b106c0419e484e66725759964cb5935ac5125e5ae920cd280bd40df57c1d7ae1845700bd4eb7b7ab12bc0850950bfe6e69edd6ac1daa5db2c2b07484327196e561c513462d72872dc6771c39f6b60d46a1f2c92343b7338450a0ef8e39f97fa70652b3a12cd04043698951627aaaa82cc95e76df92021d30e8014c984f12eea0143de8b17e5e4a36ec07bf4814251b391f168a59ef75afcd2319249aaba930f06bb7a11b9491e6f71b3d5774a6503a965e94edd0a67737282fc9cb0271779ff14151b7aa9267bb8f7d643185512515aeea513c0c98bfae782381a3317064195d8825cf8b25c17cdab5fced02612a3f2870e40df57e6ca3f08228a2b04e8de1425eb4b970118f9bbdc212223ff86a5d6b648cdf2366722f21de4b14a1014879eadb69215cdb1aa2a9f4f310ecfe3116214fe3ab0a23f4775a0a54b48d7dfd8f7283ed687b3ac7e1a7e42a0bdc3478aba8651c03e1e9cc9df17d106b8130afe854269b0103b7a696f452721887b19d8181830073c9f10684c65f96d3a6c6efbae044eec03d6399e001fa44d54635dc72f9b8ea6b87d0f452cad1e1e32273e2b47c40f2730235adcae8523b8282f86b8cf1ab63ae54aaa06130df3bbf6ecac7d7d1d43d2a87aea837267ff8ccfaa4b7e47b7ded909e6603d0b928a304f8915c839153598adc4178eb48bc0e98ad7793d7980275e1e491ba4847a4a04ae30fe7f5cc7d4b6f4f63a525e9964d72245860ca76a668a4654adb6619f16e9db79131e5675b93cafb96c92f1da8464d4fef2a22e7f9db695965fe2cc27ea30974629c8fe17cfa2f860179e1eb9faaa88a91ec9ce6da28c1a2894c3b932b5e1c807146718cc77ca13c61eaae00c7c99e019f599772064b198c5c2c5e863336367673630b417ac845ddb7c93b0856317e5d64bab208c5730abc2c63536784fbeaaec139dffc917e775715f1e42164ddef5138d4d163609ab3fbdcab968f8738385c0e7e34ff3cf7771a1dc5ba25a8850fdf96dabafa21f9065f307457ce9af4b7a73450c9d20a3b46fa8d3a1163d22bd01a7d17f0ec274181bf9640fa941427694bfeb1346089f7a851efe0fbb7a2041fa6bb6541ccbad77dd3e1a97999fc05f1fef070e7b5c4b385b8b2a8cc32483fdeba6a373970de2fa4139ba18e5916f949aab0aab2894") + require.NoError(t, err) + err = sniff.QUICClientHello(context.Background(), &metadata, pkt) + require.ErrorIs(t, err, sniff.ErrClientHelloFragmented) + pkt, err = hex.DecodeString("c20000000108e241a0c601413b4f004046006d8f15dae9999edf39d58df6762822b9a2ab996d7f6a10044338af3b51b1814bc4ac0fa5a87c34c6ae604af8cabc5957c5240174deefc8e378719ffdab2ae4e15bf4514bea4489e2ff30c43a5f63beb2e4501ce7754085bcbe838003a0b4bccb53863c0766df7eac073c2bdc170772b157997945acdc2ab2e84750cc9aa0ffa0fdc023da7fc565a14f87f7c563dbc9183dd226aab79957d263f66e64b85a1b15a24516bd2c7c04eea4fa0a34ef9849c21585db2e4adb7c05e265c4f38d8ffe4cbed0f3b0e68f3693bf1f726c3fb135b8e32a5d22931d7c55fc2ff4b9a354933ab14544df3cdaf3e3217dfb8d7feb3465dc34df6320ea486f12e5b2d609aaa5f4515c20c86fc440f8087be0ee3d339835746ae2573c2afdee6bb6ef7e9eb541feae9209391b2902cfb0bdaccd9da8d290714638b7da588d4a656ca6eabba78b7363922d6037cf060b161a42019d4feb4156459103cffdeefd0e63114af2b0e0c39e70ebc7fecb8dd1ebb8d60b2137f509bb7dcef5f1d3e06ab1d391466652d57440a410fb4f58a6ce1fb62feb453241f64e110709f59a3d9ebdac94f811337d0e4a80fd6b56b2a70cd6eebbf98e1661291da6bf5beb8b8afc376dfd20eb76afe709e8e8f28e0ef82105954e346546ad25973df43f4acddbec0ffd9b215f62abebebf71305b5ea993560316f69430bf5afe50420340622f802b5830f3bcebffff04980c75a59d28902879e5d51a4fb21062a4ae13c42297075b21d54ee04303879c1157e7470c1451673c98a2f3921f2f3e8f6acfe85b01caaca66b59e5ebffbfe68e5e9ab17e9a1b857eb409df91cb76767fc1814fd3c522a9b117edd0b02526e469cb4afb291a4dcc74c79b47ec6e7ce558c597129366f83ec306b11d2598c705fd4ee9ee99df6b7039bef13b08fc6f26853ad213829d24f895747d45a47414f931c583fb6c3e4f6c27d0c2b81a5f3cee390ec6314e1fec637e8d28b675e97caafdfbf8c25d34a635083a7553d219dd80dbb39087d74c6ad6192ca6f48a3ff8d47db41b2a492c63fcd780012780931dae0a325f9dcbd772d09a700f132c4bc1d9809b25b9751b694eb72a8ba4db7208d2b1bab63e1845208e4f841ea30218a559db98751589716b6d059ca673378f5fe7c7d8a1c82e14a561c47313bbcc278412ba86ffb2b87ec308eab9df696f5b4b54f8e361731bf232820a02a35fda7e5d4bf01b8f005ad299a055116e7b23c181f15a66442cf6032ca477bccc55b79d424eb4f245847bd81a581dc369dd20b1a4892733bde3c38e492c0039f69f2b947a4dc251a49ee7ccc0f36b3b75a555fa1d126db75f94dab60f52f6b15a877a0c380b59f82d35c570bc5f8051e9ef87db51f52383d47b50829b7f9e947ccc67aa280566aa48b4a85c1c7eca6f542789d8abcc050f1aa3cc221b6859656a21454aa21c7bfb9d12115f61c3ed46263ade68a8d3679fa62a659a5da7817406bd16618fccf33ed208ada1b03584e8b485d3cb6ed80a0774e60b6cd55aff64169ea998cf8235997049515abac58e0169ca07fb1c8c4c8b2803ba9d27b44c045d0a1cac86e5e188195c68001f53eb44851b6d821fc01ccbb41e27f38e6ddd66540c2d62ed6e0d551e22c0f26b60078c74a6302a1ed3d9e8fc0861257a63f6ac4e759fd54bff088becd28e30944a6c15db4fc8ae6244346869add946d9d92c430d737e042fa18b28a8ed64d1e8987ad9061cdc1335f") + require.NoError(t, err) + err = sniff.QUICClientHello(context.Background(), &metadata, pkt) + require.NoError(t, err) + require.Equal(t, "www.google.com", metadata.Domain) +} + func TestSniffQUICChromium(t *testing.T) { t.Parallel() pkt, err := hex.DecodeString("c30000000108f40d654cc09b27f5000044d08a94548e57e43cc5483f129986187c432d58d46674830442988f869566a6e31e2ae37c9f7acbf61cc81621594fab0b3dfdc1635460b32389563dc8e74006315661cd22694114612973c1c45910621713a48b375854f095e8a77ccf3afa64e972f0f7f7002f50e0b014b1b146ea47c07fb20b73ad5587872b51a0b3fafdf1c4cf4fe6f8b112142392efa25d993abe2f42582be145148bdfe12edcd96c3655b65a4781b093e5594ba8e3ae5320f12e8314fc3ca374128cc43381046c322b964681ed4395c813b28534505118201459665a44b8f0abead877de322e9040631d20b05f15b81fa7ff785d4041aecc37c7e2ccdc5d1532787ce566517e8985fd5c200dbfd1e67bc255efaba94cfc07bb52fea4a90887413b134f2715b5643542aa897c6116486f428d82da64d2a2c1e1bdd40bd592558901a554b003d6966ac5a7b8b9413eddbf6ef21f28386c74981e3ce1d724c341e95494907626659692720c81114ca4acea35a14c402cfa3dc2228446e78dc1b81fa4325cf7e314a9cad6a6bdff33b3351dcba74eb15fae67f1227283aa4cdd64bcadf8f19358333f8549b596f4350297b5c65274565869d497398339947b9d3d064e5b06d39d34b436d8a41c1a3880de10bd26c3b1c5b4e2a49b0d4d07b8d90cd9e92bc611564d19ea8ec33099e92033caf21f5307dbeaa4708b99eb313bff99e2081ac25fd12d6a72e8335e0724f6718fe023cd0ad0d6e6a6309f09c9c391eec2bc08e9c3210a043c08e1759f354c121f6517fff4d6e20711a871e41285d48d930352fddffb92c96ba57df045ce99f8bfdfa8edc0969ce68a51e9fbb4f54b956d9df74a9e4af27ed2b27839bce1cffeca8333c0aaee81a570217442f9029ba8fedb84a2cf4be4d910982d891ea00e816c7fb98e8020e896a9c6fdd9106611da0a99dde18df1b7a8f6327acb1eed9ad93314451e48cb0dfb9571728521ca3db2ac0968159d5622556a55d51a422d11995b650949aaefc5d24c16080446dfc4fbc10353f9f93ce161ab513367bb89ab83988e0630b689e174e27bcfcc31996ee7b0bca909e251b82d69a28fee5a5d662e127508cd19dbbe5097b7d5b62a49203d66764197a527e472e2627e44a93d44177dace9d60e7d0e03305ddf4cfe47cdf2362e14de79ef46a6763ce696cd7854a48d9419a0817507a4713ffd4977b906d4f2b5fb6dbe1bd15bc505d5fea582190bf531a45d5ee026da8918547fd5105f15e5d061c7b0cf80a34990366ed8e91e13c2f0d85e5dad537298808d193cf54b7eaac33f10051f74cb6b75e52f81618c36f03d86aef613ba237a1a793ba1539938a38f62ccaf7bd5f6c5e0ce53cde4012fcf2b758214a0422d2faaa798e86e19d7481b42df2b36a73d287ff28c20cce01ce598771fec16a8f1f00305c06010126013a6c1de9f589b4e79d693717cd88ad1c42a2d99fa96617ba0bc6365b68e21a70ebc447904aa27979e1514433cfd83bfec09f137c747d47582cb63eb28f873fb94cf7a59ff764ddfbb687d79a58bb10f85949269f7f72c611a5e0fbb52adfa298ff060ec2eb7216fd7302ea8fb07798cbb3be25cb53ac8161aac2b5bbcfbcfb01c113d28bd1cb0333fb89ac82a95930f7abded0a2f5a623cc6a1f62bf3f38ef1b81c1e50a634f657dbb6770e4af45879e2fb1e00c742e7b52205c8015b5c0f5b1e40186ff9aa7288ab3e01a51fb87761f9bc6837082af109b39cc9f620") diff --git a/sing-box/dns/transport/fakeip/fakeip.go b/sing-box/dns/transport/fakeip/fakeip.go index 74e3e549f0..07f0fd0973 100644 --- a/sing-box/dns/transport/fakeip/fakeip.go +++ b/sing-box/dns/transport/fakeip/fakeip.go @@ -55,7 +55,7 @@ func (t *Transport) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg, if question.Qtype != mDNS.TypeA && question.Qtype != mDNS.TypeAAAA { return nil, E.New("only IP queries are supported by fakeip") } - address, err := t.store.Create(question.Name, question.Qtype == mDNS.TypeAAAA) + address, err := t.store.Create(dns.FqdnToDomain(question.Name), question.Qtype == mDNS.TypeAAAA) if err != nil { return nil, err } diff --git a/sing-box/dns/transport/quic/http3.go b/sing-box/dns/transport/quic/http3.go index 43f284d2bd..a5181ae08b 100644 --- a/sing-box/dns/transport/quic/http3.go +++ b/sing-box/dns/transport/quic/http3.go @@ -72,7 +72,7 @@ func NewHTTP3(ctx context.Context, logger log.ContextLogger, tag string, options } } destinationURL := url.URL{ - Scheme: "HTTP3", + Scheme: "https", Host: host, } if destinationURL.Host == "" { diff --git a/sing-box/docs/changelog.md b/sing-box/docs/changelog.md index 3a06a02cc7..1d89b3931c 100644 --- a/sing-box/docs/changelog.md +++ b/sing-box/docs/changelog.md @@ -2,7 +2,7 @@ icon: material/alert-decagram --- -#### 1.12.0-alpha.8 +#### 1.12.0-alpha.9 * Fixes and improvements diff --git a/sing-box/experimental/clashapi/server.go b/sing-box/experimental/clashapi/server.go index 459d205d43..e6d8c4cfad 100644 --- a/sing-box/experimental/clashapi/server.go +++ b/sing-box/experimental/clashapi/server.go @@ -131,7 +131,7 @@ func NewServer(ctx context.Context, logFactory log.ObservableFactory, options op s.externalUI = filemanager.BasePath(ctx, os.ExpandEnv(options.ExternalUI)) chiRouter.Group(func(r chi.Router) { r.Get("/ui", http.RedirectHandler("/ui/", http.StatusMovedPermanently).ServeHTTP) - r.Handle("/ui/*", http.StripPrefix("/ui/", http.FileServer(http.Dir(s.externalUI)))) + r.Handle("/ui/*", http.StripPrefix("/ui/", http.FileServer(Dir(s.externalUI)))) }) } return s, nil diff --git a/sing-box/experimental/clashapi/server_fs.go b/sing-box/experimental/clashapi/server_fs.go new file mode 100644 index 0000000000..afb4cca5e2 --- /dev/null +++ b/sing-box/experimental/clashapi/server_fs.go @@ -0,0 +1,18 @@ +package clashapi + +import "net/http" + +type Dir http.Dir + +func (d Dir) Open(name string) (http.File, error) { + file, err := http.Dir(d).Open(name) + if err != nil { + return nil, err + } + return &fileWrapper{file}, nil +} + +// workaround for #2345 #2596 +type fileWrapper struct { + http.File +} diff --git a/sing-box/experimental/clashapi/server_resources.go b/sing-box/experimental/clashapi/server_resources.go index 974ad52e4d..f480ebf0a2 100644 --- a/sing-box/experimental/clashapi/server_resources.go +++ b/sing-box/experimental/clashapi/server_resources.go @@ -43,7 +43,6 @@ func (s *Server) downloadExternalUI() error { } else { downloadURL = "https://github.com/MetaCubeX/Yacd-meta/archive/gh-pages.zip" } - s.logger.Info("downloading external ui") var detour adapter.Outbound if s.externalUIDownloadDetour != "" { outbound, loaded := s.outbound.Outbound(s.externalUIDownloadDetour) @@ -55,6 +54,7 @@ func (s *Server) downloadExternalUI() error { outbound := s.outbound.Default() detour = outbound } + s.logger.Info("downloading external ui using outbound/", detour.Type(), "[", detour.Tag(), "]") httpClient := &http.Client{ Transport: &http.Transport{ ForceAttemptHTTP2: true, diff --git a/sing-box/go.mod b/sing-box/go.mod index 5792424b11..18c253005d 100644 --- a/sing-box/go.mod +++ b/sing-box/go.mod @@ -2,8 +2,6 @@ module github.com/sagernet/sing-box go 1.23.1 -toolchain go1.24.0 - require ( github.com/caddyserver/certmagic v0.21.7 github.com/cloudflare/circl v1.6.0 @@ -25,16 +23,16 @@ require ( github.com/sagernet/cors v1.2.1 github.com/sagernet/fswatch v0.1.1 github.com/sagernet/gomobile v0.1.4 - github.com/sagernet/gvisor v0.0.0-20250217052116-ed66b6946f72 + github.com/sagernet/gvisor v0.0.0-20241123041152-536d05261cff github.com/sagernet/quic-go v0.49.0-beta.1 github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 - github.com/sagernet/sing v0.6.2-0.20250210105917-3464ed3babc0 + github.com/sagernet/sing v0.6.2-0.20250210072154-8dff604468ff github.com/sagernet/sing-mux v0.3.1 github.com/sagernet/sing-quic v0.4.1-beta.1 github.com/sagernet/sing-shadowsocks v0.2.7 github.com/sagernet/sing-shadowsocks2 v0.2.0 github.com/sagernet/sing-shadowtls v0.2.0 - github.com/sagernet/sing-tun v0.6.2-0.20250217135654-784bb584392f + github.com/sagernet/sing-tun v0.6.1 github.com/sagernet/sing-vmess v0.2.0 github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 github.com/sagernet/tailscale v1.79.0-mod.1 diff --git a/sing-box/go.sum b/sing-box/go.sum index 8a6c3cc378..ebbe57cd6d 100644 --- a/sing-box/go.sum +++ b/sing-box/go.sum @@ -171,8 +171,8 @@ github.com/sagernet/fswatch v0.1.1 h1:YqID+93B7VRfqIH3PArW/XpJv5H4OLEVWDfProGoRQ github.com/sagernet/fswatch v0.1.1/go.mod h1:nz85laH0mkQqJfaOrqPpkwtU1znMFNVTpT/5oRsVz/o= github.com/sagernet/gomobile v0.1.4 h1:WzX9ka+iHdupMgy2Vdich+OAt7TM8C2cZbIbzNjBrJY= github.com/sagernet/gomobile v0.1.4/go.mod h1:Pqq2+ZVvs10U7xK+UwJgwYWUykewi8H6vlslAO73n9E= -github.com/sagernet/gvisor v0.0.0-20250217052116-ed66b6946f72 h1:Jgv6N59yiVMEwimTcFV1EVcu2Aa7R2Wh1ZAYNzWP2qA= -github.com/sagernet/gvisor v0.0.0-20250217052116-ed66b6946f72/go.mod h1:ehZwnT2UpmOWAHFL48XdBhnd4Qu4hN2O3Ji0us3ZHMw= +github.com/sagernet/gvisor v0.0.0-20241123041152-536d05261cff h1:mlohw3360Wg1BNGook/UHnISXhUx4Gd/3tVLs5T0nSs= +github.com/sagernet/gvisor v0.0.0-20241123041152-536d05261cff/go.mod h1:ehZwnT2UpmOWAHFL48XdBhnd4Qu4hN2O3Ji0us3ZHMw= github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZNjr6sGeT00J8uU7JF4cNUdb44/Duis= github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM= github.com/sagernet/nftables v0.3.0-beta.4 h1:kbULlAwAC3jvdGAC1P5Fa3GSxVwQJibNenDW2zaXr8I= @@ -182,8 +182,8 @@ github.com/sagernet/quic-go v0.49.0-beta.1/go.mod h1:uesWD1Ihrldq1M3XtjuEvIUqi8W github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byLGkEnIYp6grlXfo1QYUfiYFGjewIdc= github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU= github.com/sagernet/sing v0.2.18/go.mod h1:OL6k2F0vHmEzXz2KW19qQzu172FDgSbUSODylighuVo= -github.com/sagernet/sing v0.6.2-0.20250210105917-3464ed3babc0 h1:8gTBdpb2JeNq4oAb8AHCisUI+mZlrpD0qMRrsb9EnAo= -github.com/sagernet/sing v0.6.2-0.20250210105917-3464ed3babc0/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= +github.com/sagernet/sing v0.6.2-0.20250210072154-8dff604468ff h1:5UGghwx8cI14qFa0ienrLekAYfhdKAiWvJUkY7rHmsI= +github.com/sagernet/sing v0.6.2-0.20250210072154-8dff604468ff/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= github.com/sagernet/sing-mux v0.3.1 h1:kvCc8HyGAskDHDQ0yQvoTi/7J4cZPB/VJMsAM3MmdQI= github.com/sagernet/sing-mux v0.3.1/go.mod h1:Mkdz8LnDstthz0HWuA/5foncnDIdcNN5KZ6AdJX+x78= github.com/sagernet/sing-quic v0.4.1-beta.1 h1:V2VfMckT3EQR3ZdfSzJgZZDsvfZZH42QAZpnOnHKa0s= @@ -194,8 +194,8 @@ github.com/sagernet/sing-shadowsocks2 v0.2.0 h1:wpZNs6wKnR7mh1wV9OHwOyUr21VkS3wK github.com/sagernet/sing-shadowsocks2 v0.2.0/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ= github.com/sagernet/sing-shadowtls v0.2.0 h1:cLKe4OAOFwuhmAIuPLj//CIL7Q9js+pIDardhJ+/osk= github.com/sagernet/sing-shadowtls v0.2.0/go.mod h1:agU+Fw5X+xnWVyRHyFthoZCX3MfWKCFPm4JUf+1oaxo= -github.com/sagernet/sing-tun v0.6.2-0.20250217135654-784bb584392f h1:VEtmCNfk8RuZcYz/Xx63F2QjcgG3z/7Pa0uiJciQo+Y= -github.com/sagernet/sing-tun v0.6.2-0.20250217135654-784bb584392f/go.mod h1:UiOi1ombGaAzWkGSgH4qcP7Zpq8FjWc1uQmleK8oPCE= +github.com/sagernet/sing-tun v0.6.1 h1:4l0+gnEKcGjlWfUVTD+W0BRApqIny/lU2ZliurE+VMo= +github.com/sagernet/sing-tun v0.6.1/go.mod h1:fisFCbC4Vfb6HqQNcwPJi2CDK2bf0Xapyz3j3t4cnHE= github.com/sagernet/sing-vmess v0.2.0 h1:pCMGUXN2k7RpikQV65/rtXtDHzb190foTfF9IGTMZrI= github.com/sagernet/sing-vmess v0.2.0/go.mod h1:jDAZ0A0St1zVRkyvhAPRySOFfhC+4SQtO5VYyeFotgA= github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 h1:DImB4lELfQhplLTxeq2z31Fpv8CQqqrUwTbrIRumZqQ= diff --git a/sing-box/option/dns_record.go b/sing-box/option/dns_record.go index 90c2573052..190f548334 100644 --- a/sing-box/option/dns_record.go +++ b/sing-box/option/dns_record.go @@ -8,6 +8,7 @@ import ( E "github.com/sagernet/sing/common/exceptions" "github.com/sagernet/sing/common/json" "github.com/sagernet/sing/common/json/badoption" + M "github.com/sagernet/sing/common/metadata" "github.com/miekg/dns" ) @@ -135,6 +136,9 @@ func (o *DNSRecordOptions) UnmarshalJSON(data []byte) error { if err != nil { return err } + if a, isA := record.(*dns.A); isA { + a.A = M.AddrFromIP(a.A).Unmap().AsSlice() + } o.RR = record return nil } diff --git a/sing-box/protocol/tun/inbound.go b/sing-box/protocol/tun/inbound.go index fc655d0de3..00cc0561e4 100644 --- a/sing-box/protocol/tun/inbound.go +++ b/sing-box/protocol/tun/inbound.go @@ -8,7 +8,6 @@ import ( "runtime" "strconv" "strings" - "syscall" "time" "github.com/sagernet/sing-box/adapter" @@ -439,21 +438,15 @@ func (t *Inbound) Close() error { ) } -func (t *Inbound) PrepareConnection(network string, source M.Socksaddr, destination M.Socksaddr, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) { - routeDestination, err := t.router.PreMatch(adapter.InboundContext{ +func (t *Inbound) PrepareConnection(network string, source M.Socksaddr, destination M.Socksaddr) error { + return t.router.PreMatch(adapter.InboundContext{ Inbound: t.tag, InboundType: C.TypeTun, Network: network, Source: source, Destination: destination, InboundOptions: t.inboundOptions, - }, routeContext) - if err != nil { - if !E.IsMulti(err, tun.ErrDrop, syscall.ECONNREFUSED) { - t.logger.Warn(err) - } - } - return routeDestination, err + }) } func (t *Inbound) NewConnectionEx(ctx context.Context, conn net.Conn, source M.Socksaddr, destination M.Socksaddr, onClose N.CloseHandlerFunc) { diff --git a/sing-box/protocol/wireguard/endpoint.go b/sing-box/protocol/wireguard/endpoint.go index 88e5458e32..e167bec166 100644 --- a/sing-box/protocol/wireguard/endpoint.go +++ b/sing-box/protocol/wireguard/endpoint.go @@ -13,7 +13,6 @@ import ( "github.com/sagernet/sing-box/log" "github.com/sagernet/sing-box/option" "github.com/sagernet/sing-box/transport/wireguard" - "github.com/sagernet/sing-tun" "github.com/sagernet/sing/common" "github.com/sagernet/sing/common/bufio" E "github.com/sagernet/sing/common/exceptions" @@ -44,7 +43,7 @@ type Endpoint struct { func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.WireGuardEndpointOptions) (adapter.Endpoint, error) { ep := &Endpoint{ - Adapter: endpoint.NewAdapterWithDialerOptions(C.TypeWireGuard, tag, []string{N.NetworkTCP, N.NetworkUDP, N.NetworkICMPv4, N.NetworkICMPv6}, options.DialerOptions), + Adapter: endpoint.NewAdapterWithDialerOptions(C.TypeWireGuard, tag, []string{N.NetworkTCP, N.NetworkUDP}, options.DialerOptions), ctx: ctx, router: router, dnsRouter: service.FromContext[adapter.DNSRouter](ctx), @@ -133,14 +132,14 @@ func (w *Endpoint) InterfaceUpdated() { return } -func (w *Endpoint) PrepareConnection(network string, source M.Socksaddr, destination M.Socksaddr, context tun.DirectRouteContext) (tun.DirectRouteDestination, error) { +func (w *Endpoint) PrepareConnection(network string, source M.Socksaddr, destination M.Socksaddr) error { return w.router.PreMatch(adapter.InboundContext{ Inbound: w.Tag(), InboundType: w.Type(), Network: network, Source: source, Destination: destination, - }, context) + }) } func (w *Endpoint) NewConnectionEx(ctx context.Context, conn net.Conn, source M.Socksaddr, destination M.Socksaddr, onClose N.CloseHandlerFunc) { @@ -221,12 +220,3 @@ func (w *Endpoint) ListenPacket(ctx context.Context, destination M.Socksaddr) (n } return w.endpoint.ListenPacket(ctx, destination) } - -func (w *Endpoint) NewDirectRouteConnection(metadata adapter.InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) { - destination, err := w.endpoint.NewDirectRouteConnection(metadata, routeContext) - if err != nil { - return nil, err - } - w.logger.Info("linked ", metadata.Network, " connection to ", metadata.Destination.AddrString()) - return destination, nil -} diff --git a/sing-box/route/route.go b/sing-box/route/route.go index 9ccf216ad5..2b15d65066 100644 --- a/sing-box/route/route.go +++ b/sing-box/route/route.go @@ -18,7 +18,6 @@ import ( "github.com/sagernet/sing-box/option" "github.com/sagernet/sing-box/route/rule" "github.com/sagernet/sing-mux" - "github.com/sagernet/sing-tun" "github.com/sagernet/sing-vmess" "github.com/sagernet/sing/common" "github.com/sagernet/sing/common/buf" @@ -272,36 +271,19 @@ func (r *Router) routePacketConnection(ctx context.Context, conn N.PacketConn, m return nil } -func (r *Router) PreMatch(metadata adapter.InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) { +func (r *Router) PreMatch(metadata adapter.InboundContext) error { selectedRule, _, _, _, err := r.matchRule(r.ctx, &metadata, true, nil, nil) if err != nil { - return nil, err + return err } if selectedRule == nil { - defaultOutbound := r.outbound.Default() - if !common.Contains(defaultOutbound.Network(), metadata.Network) { - return nil, E.New(metadata.Network, " is not supported by default outbound: ", defaultOutbound.Tag()) - } - return defaultOutbound.(adapter.DirectRouteOutbound).NewDirectRouteConnection(metadata, routeContext) + return nil } - switch action := selectedRule.Action().(type) { - case *rule.RuleActionReject: - return nil, action.Error(context.Background()) - case *rule.RuleActionRoute: - if routeContext == nil { - return nil, nil - } - outbound, loaded := r.outbound.Outbound(action.Outbound) - if !loaded { - return nil, E.New("outbound not found: ", action.Outbound) - } - if !common.Contains(outbound.Network(), metadata.Network) { - return nil, E.New(metadata.Network, " is not supported by outbound: ", action.Outbound) - } - return outbound.(adapter.DirectRouteOutbound).NewDirectRouteConnection(metadata, routeContext) - default: - return nil, nil + rejectAction, isReject := selectedRule.Action().(*rule.RuleActionReject) + if !isReject { + return nil } + return rejectAction.Error(context.Background()) } func (r *Router) matchRule( @@ -644,7 +626,7 @@ func (r *Router) actionSniff( Destination: destination, } packetBuffers = append(packetBuffers, packetBuffer) - if E.IsMulti(err, sniff.ErrClientHelloFragmented) && len(packetBuffers) == 0 { + if E.IsMulti(err, sniff.ErrClientHelloFragmented) { r.logger.DebugContext(ctx, "attempt to sniff fragmented QUIC client hello") continue } diff --git a/sing-box/transport/wireguard/device.go b/sing-box/transport/wireguard/device.go index 4e2d6a249c..7a17b8f35c 100644 --- a/sing-box/transport/wireguard/device.go +++ b/sing-box/transport/wireguard/device.go @@ -5,7 +5,6 @@ import ( "net/netip" "time" - "github.com/sagernet/sing-box/adapter" "github.com/sagernet/sing-tun" "github.com/sagernet/sing/common/logger" N "github.com/sagernet/sing/common/network" @@ -18,8 +17,6 @@ type Device interface { N.Dialer Start() error SetDevice(device *device.Device) - Inet4Address() netip.Addr - Inet6Address() netip.Addr } type DeviceOptions struct { @@ -44,8 +41,3 @@ func NewDevice(options DeviceOptions) (Device, error) { return newSystemStackDevice(options) } } - -type NatDevice interface { - Device - CreateDestination(metadata adapter.InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) -} diff --git a/sing-box/transport/wireguard/device_nat.go b/sing-box/transport/wireguard/device_nat.go deleted file mode 100644 index 2c482d30f4..0000000000 --- a/sing-box/transport/wireguard/device_nat.go +++ /dev/null @@ -1,85 +0,0 @@ -package wireguard - -import ( - "github.com/sagernet/sing-box/adapter" - "github.com/sagernet/sing-tun" - "github.com/sagernet/sing/common/buf" -) - -var _ Device = (*natDeviceWrapper)(nil) - -type natDeviceWrapper struct { - Device - gVisorOutbound - packetOutbound chan *buf.Buffer - mapping *tun.NatMapping - writer *tun.NatWriter - buffer [][]byte -} - -func NewNATDevice(upstream Device, ipRewrite bool) NatDevice { - wrapper := &natDeviceWrapper{ - Device: upstream, - gVisorOutbound: newGVisorOutbound(), - packetOutbound: make(chan *buf.Buffer, 256), - mapping: tun.NewNatMapping(ipRewrite), - } - if ipRewrite { - wrapper.writer = tun.NewNatWriter(upstream.Inet4Address(), upstream.Inet6Address()) - } - return wrapper -} - -func (d *natDeviceWrapper) Write(bufs [][]byte, offset int) (int, error) { - for _, buffer := range bufs { - handled, err := d.mapping.WritePacket(buffer[offset:]) - if handled { - if err != nil { - return 0, err - } - } else { - d.buffer = append(d.buffer, buffer) - } - } - if len(d.buffer) > 0 { - _, err := d.Device.Write(d.buffer, offset) - if err != nil { - return 0, err - } - d.buffer = d.buffer[:0] - } - return 0, nil -} - -func (d *natDeviceWrapper) CreateDestination(metadata adapter.InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) { - session := tun.DirectRouteSession{ - Source: metadata.Source.Addr, - Destination: metadata.Destination.Addr, - } - d.mapping.CreateSession(session, routeContext) - return &natDestinationWrapper{d, session}, nil -} - -var _ tun.DirectRouteDestination = (*natDestinationWrapper)(nil) - -type natDestinationWrapper struct { - device *natDeviceWrapper - session tun.DirectRouteSession -} - -func (d *natDestinationWrapper) WritePacket(buffer *buf.Buffer) error { - if d.device.writer != nil { - d.device.writer.RewritePacket(buffer.Bytes()) - } - d.device.packetOutbound <- buffer - return nil -} - -func (d *natDestinationWrapper) Close() error { - d.device.mapping.DeleteSession(d.session) - return nil -} - -func (d *natDestinationWrapper) Timeout() bool { - return false -} diff --git a/sing-box/transport/wireguard/device_nat_gvisor.go b/sing-box/transport/wireguard/device_nat_gvisor.go deleted file mode 100644 index edecba3491..0000000000 --- a/sing-box/transport/wireguard/device_nat_gvisor.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build with_gvisor - -package wireguard - -import ( - "github.com/sagernet/gvisor/pkg/tcpip/stack" -) - -type gVisorOutbound struct { - outbound chan *stack.PacketBuffer -} - -func newGVisorOutbound() gVisorOutbound { - return gVisorOutbound{ - outbound: make(chan *stack.PacketBuffer, 256), - } -} - -func (d *natDeviceWrapper) Read(bufs [][]byte, sizes []int, offset int) (n int, err error) { - select { - case packet := <-d.outbound: - defer packet.DecRef() - var copyN int - /*rangeIterate(packet.Data().AsRange(), func(view *buffer.View) { - copyN += copy(bufs[0][offset+copyN:], view.AsSlice()) - })*/ - for _, view := range packet.AsSlices() { - copyN += copy(bufs[0][offset+copyN:], view) - } - sizes[0] = copyN - return 1, nil - case packet := <-d.packetOutbound: - defer packet.Release() - sizes[0] = copy(bufs[0][offset:], packet.Bytes()) - return 1, nil - default: - } - return d.Device.Read(bufs, sizes, offset) -} - -func (d *natDestinationWrapper) WritePacketBuffer(packetBuffer *stack.PacketBuffer) error { - println("read from wg") - if d.device.writer != nil { - d.device.writer.RewritePacketBuffer(packetBuffer) - } - d.device.outbound <- packetBuffer - return nil -} diff --git a/sing-box/transport/wireguard/device_nat_non_gvisor.go b/sing-box/transport/wireguard/device_nat_non_gvisor.go deleted file mode 100644 index e81e1e3187..0000000000 --- a/sing-box/transport/wireguard/device_nat_non_gvisor.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build !with_gvisor - -package wireguard - -type gVisorOutbound struct{} - -func newGVisorOutbound() gVisorOutbound { - return gVisorOutbound{} -} - -func (d *natDeviceWrapper) Read(bufs [][]byte, sizes []int, offset int) (n int, err error) { - select { - case packet := <-d.packetOutbound: - defer packet.Release() - sizes[0] = copy(bufs[0][offset:], packet.Bytes()) - return 1, nil - default: - } - return d.Device.Read(bufs, sizes, offset) -} diff --git a/sing-box/transport/wireguard/device_stack.go b/sing-box/transport/wireguard/device_stack.go index eb759a2bf0..f9440f02fa 100644 --- a/sing-box/transport/wireguard/device_stack.go +++ b/sing-box/transport/wireguard/device_stack.go @@ -5,7 +5,6 @@ package wireguard import ( "context" "net" - "net/netip" "os" "github.com/sagernet/gvisor/pkg/buffer" @@ -15,12 +14,9 @@ import ( "github.com/sagernet/gvisor/pkg/tcpip/network/ipv4" "github.com/sagernet/gvisor/pkg/tcpip/network/ipv6" "github.com/sagernet/gvisor/pkg/tcpip/stack" - "github.com/sagernet/gvisor/pkg/tcpip/transport/icmp" "github.com/sagernet/gvisor/pkg/tcpip/transport/tcp" "github.com/sagernet/gvisor/pkg/tcpip/transport/udp" - "github.com/sagernet/sing-box/adapter" "github.com/sagernet/sing-tun" - "github.com/sagernet/sing/common/buf" E "github.com/sagernet/sing/common/exceptions" M "github.com/sagernet/sing/common/metadata" N "github.com/sagernet/sing/common/network" @@ -28,30 +24,25 @@ import ( wgTun "github.com/sagernet/wireguard-go/tun" ) -var _ NatDevice = (*stackDevice)(nil) +var _ Device = (*stackDevice)(nil) type stackDevice struct { - stack *stack.Stack - mtu uint32 - events chan wgTun.Event - outbound chan *stack.PacketBuffer - packetOutbound chan *buf.Buffer - done chan struct{} - dispatcher stack.NetworkDispatcher - addr4 tcpip.Address - addr6 tcpip.Address - mapping *tun.NatMapping - writer *tun.NatWriter + stack *stack.Stack + mtu uint32 + events chan wgTun.Event + outbound chan *stack.PacketBuffer + done chan struct{} + dispatcher stack.NetworkDispatcher + addr4 tcpip.Address + addr6 tcpip.Address } func newStackDevice(options DeviceOptions) (*stackDevice, error) { tunDevice := &stackDevice{ - mtu: options.MTU, - events: make(chan wgTun.Event, 1), - outbound: make(chan *stack.PacketBuffer, 256), - packetOutbound: make(chan *buf.Buffer, 256), - done: make(chan struct{}), - mapping: tun.NewNatMapping(true), + mtu: options.MTU, + events: make(chan wgTun.Event, 1), + outbound: make(chan *stack.PacketBuffer, 256), + done: make(chan struct{}), } ipStack, err := tun.NewGVisorStack((*wireEndpoint)(tunDevice)) if err != nil { @@ -77,14 +68,10 @@ func newStackDevice(options DeviceOptions) (*stackDevice, error) { return nil, E.New("parse local address ", protoAddr.AddressWithPrefix, ": ", gErr.String()) } } - tunDevice.writer = tun.NewNatWriter(tunDevice.Inet4Address(), tunDevice.Inet6Address()) tunDevice.stack = ipStack if options.Handler != nil { ipStack.SetTransportProtocolHandler(tcp.ProtocolNumber, tun.NewTCPForwarder(options.Context, ipStack, options.Handler).HandlePacket) ipStack.SetTransportProtocolHandler(udp.ProtocolNumber, tun.NewUDPForwarder(options.Context, ipStack, options.Handler, options.UDPTimeout).HandlePacket) - icmpForwarder := tun.NewICMPForwarder(options.Context, ipStack, options.Handler, options.UDPTimeout) - ipStack.SetTransportProtocolHandler(icmp.ProtocolNumber4, icmpForwarder.HandlePacket) - ipStack.SetTransportProtocolHandler(icmp.ProtocolNumber6, icmpForwarder.HandlePacket) } return tunDevice, nil } @@ -143,14 +130,6 @@ func (w *stackDevice) ListenPacket(ctx context.Context, destination M.Socksaddr) return udpConn, nil } -func (w *stackDevice) Inet4Address() netip.Addr { - return netip.AddrFrom4(w.addr4.As4()) -} - -func (w *stackDevice) Inet6Address() netip.Addr { - return netip.AddrFrom16(w.addr6.As16()) -} - func (w *stackDevice) SetDevice(device *device.Device) { } @@ -165,24 +144,20 @@ func (w *stackDevice) File() *os.File { func (w *stackDevice) Read(bufs [][]byte, sizes []int, offset int) (count int, err error) { select { - case packet, ok := <-w.outbound: + case packetBuffer, ok := <-w.outbound: if !ok { return 0, os.ErrClosed } - defer packet.DecRef() - var copyN int - /*rangeIterate(packet.Data().AsRange(), func(view *buffer.View) { - copyN += copy(bufs[0][offset+copyN:], view.AsSlice()) - })*/ - for _, view := range packet.AsSlices() { - copyN += copy(bufs[0][offset+copyN:], view) + defer packetBuffer.DecRef() + p := bufs[0] + p = p[offset:] + n := 0 + for _, slice := range packetBuffer.AsSlices() { + n += copy(p[n:], slice) } - sizes[0] = copyN - return 1, nil - case packet := <-w.packetOutbound: - defer packet.Release() - sizes[0] = copy(bufs[0][offset:], packet.Bytes()) - return 1, nil + sizes[0] = n + count = 1 + return case <-w.done: return 0, os.ErrClosed } @@ -194,14 +169,6 @@ func (w *stackDevice) Write(bufs [][]byte, offset int) (count int, err error) { if len(b) == 0 { continue } - handled, err := w.mapping.WritePacket(b) - if handled { - if err != nil { - return count, err - } - count++ - continue - } var networkProtocol tcpip.NetworkProtocolNumber switch header.IPVersion(b) { case header.IPv4Version: @@ -315,157 +282,3 @@ func (ep *wireEndpoint) Close() { func (ep *wireEndpoint) SetOnCloseAction(f func()) { } - -func (w *stackDevice) CreateDestination(metadata adapter.InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) { - /* var wq waiter.Queue - ep, err := raw.NewEndpoint(w.stack, ipv4.ProtocolNumber, icmp.ProtocolNumber4, &wq) - if err != nil { - return nil, E.Cause(gonet.TranslateNetstackError(err), "create endpoint") - } - err = ep.Connect(tcpip.FullAddress{ - NIC: tun.DefaultNIC, - Port: metadata.Destination.Port, - Addr: tun.AddressFromAddr(metadata.Destination.Addr), - }) - if err != nil { - ep.Close() - return nil, E.Cause(gonet.TranslateNetstackError(err), "ICMP connect ", metadata.Destination) - } - fmt.Println("linked ", metadata.Network, " connection to ", metadata.Destination.AddrString()) - destination := &endpointNatDestination{ - ep: ep, - wq: &wq, - context: routeContext, - } - go destination.loopRead() - return destination, nil*/ - session := tun.DirectRouteSession{ - Source: metadata.Source.Addr, - Destination: metadata.Destination.Addr, - } - w.mapping.CreateSession(session, routeContext) - return &stackNatDestination{ - device: w, - session: session, - }, nil -} - -type stackNatDestination struct { - device *stackDevice - session tun.DirectRouteSession -} - -func (d *stackNatDestination) WritePacket(buffer *buf.Buffer) error { - if d.device.writer != nil { - d.device.writer.RewritePacket(buffer.Bytes()) - } - d.device.packetOutbound <- buffer - return nil -} - -func (d *stackNatDestination) WritePacketBuffer(buffer *stack.PacketBuffer) error { - if d.device.writer != nil { - d.device.writer.RewritePacketBuffer(buffer) - } - d.device.outbound <- buffer - return nil -} - -func (d *stackNatDestination) Close() error { - d.device.mapping.DeleteSession(d.session) - return nil -} - -func (d *stackNatDestination) Timeout() bool { - return false -} - -/*type endpointNatDestination struct { - ep tcpip.Endpoint - wq *waiter.Queue - networkProto tcpip.NetworkProtocolNumber - context tun.DirectRouteContext - done chan struct{} -} - -func (d *endpointNatDestination) loopRead() { - for { - println("start read") - buffer, err := commonRead(d.ep, d.wq, d.done) - if err != nil { - log.Error(err) - return - } - println("done read") - ipHdr := header.IPv4(buffer.Bytes()) - if ipHdr.TransportProtocol() != header.ICMPv4ProtocolNumber { - buffer.Release() - continue - } - icmpHdr := header.ICMPv4(ipHdr.Payload()) - if icmpHdr.Type() != header.ICMPv4EchoReply { - buffer.Release() - continue - } - fmt.Println("read echo reply") - _ = d.context.WritePacket(ipHdr) - buffer.Release() - } -} - -func commonRead(ep tcpip.Endpoint, wq *waiter.Queue, done chan struct{}) (*buf.Buffer, error) { - buffer := buf.NewPacket() - result, err := ep.Read(buffer, tcpip.ReadOptions{}) - if err != nil { - if _, ok := err.(*tcpip.ErrWouldBlock); ok { - waitEntry, notifyCh := waiter.NewChannelEntry(waiter.ReadableEvents) - wq.EventRegister(&waitEntry) - defer wq.EventUnregister(&waitEntry) - for { - result, err = ep.Read(buffer, tcpip.ReadOptions{}) - if _, ok := err.(*tcpip.ErrWouldBlock); !ok { - break - } - select { - case <-notifyCh: - case <-done: - buffer.Release() - return nil, context.DeadlineExceeded - } - } - } - return nil, gonet.TranslateNetstackError(err) - } - buffer.Truncate(result.Count) - return buffer, nil -} - -func (d *endpointNatDestination) WritePacket(buffer *buf.Buffer) error { - _, err := d.ep.Write(buffer, tcpip.WriteOptions{}) - if err != nil { - return gonet.TranslateNetstackError(err) - } - return nil -} - -func (d *endpointNatDestination) WritePacketBuffer(buffer *stack.PacketBuffer) error { - data := buffer.ToView().AsSlice() - println("write echo request buffer :" + fmt.Sprint(data)) - _, err := d.ep.Write(bytes.NewReader(data), tcpip.WriteOptions{}) - if err != nil { - log.Error(err) - return gonet.TranslateNetstackError(err) - } - return nil -} - -func (d *endpointNatDestination) Close() error { - d.ep.Abort() - close(d.done) - return nil -} - -func (d *endpointNatDestination) Timeout() bool { - return false -} -*/ diff --git a/sing-box/transport/wireguard/device_system.go b/sing-box/transport/wireguard/device_system.go index 90abee4b43..fa54f33293 100644 --- a/sing-box/transport/wireguard/device_system.go +++ b/sing-box/transport/wireguard/device_system.go @@ -28,36 +28,16 @@ type systemDevice struct { batchDevice tun.LinuxTUN events chan wgTun.Event closeOnce sync.Once - addr4 netip.Addr - addr6 netip.Addr } func newSystemDevice(options DeviceOptions) (*systemDevice, error) { if options.Name == "" { options.Name = tun.CalculateInterfaceName("wg") } - var inet4Address netip.Addr - var inet6Address netip.Addr - if len(options.Address) > 0 { - if prefix := common.Find(options.Address, func(it netip.Prefix) bool { - return it.Addr().Is4() - }); prefix.IsValid() { - inet4Address = prefix.Addr() - } - } - if len(options.Address) > 0 { - if prefix := common.Find(options.Address, func(it netip.Prefix) bool { - return it.Addr().Is6() - }); prefix.IsValid() { - inet6Address = prefix.Addr() - } - } return &systemDevice{ options: options, dialer: options.CreateDialer(options.Name), events: make(chan wgTun.Event, 1), - addr4: inet4Address, - addr6: inet6Address, }, nil } @@ -69,14 +49,6 @@ func (w *systemDevice) ListenPacket(ctx context.Context, destination M.Socksaddr return w.dialer.ListenPacket(ctx, destination) } -func (w *systemDevice) Inet4Address() netip.Addr { - return w.addr4 -} - -func (w *systemDevice) Inet6Address() netip.Addr { - return w.addr6 -} - func (w *systemDevice) SetDevice(device *device.Device) { } diff --git a/sing-box/transport/wireguard/endpoint.go b/sing-box/transport/wireguard/endpoint.go index af982948c2..69ce917020 100644 --- a/sing-box/transport/wireguard/endpoint.go +++ b/sing-box/transport/wireguard/endpoint.go @@ -10,8 +10,6 @@ import ( "os" "strings" - "github.com/sagernet/sing-box/adapter" - "github.com/sagernet/sing-tun" "github.com/sagernet/sing/common" E "github.com/sagernet/sing/common/exceptions" F "github.com/sagernet/sing/common/format" @@ -31,7 +29,6 @@ type Endpoint struct { ipcConf string allowedAddress []netip.Prefix tunDevice Device - natDevice NatDevice device *device.Device pauseManager pause.Manager pauseCallback *list.Element[pause.Callback] @@ -114,17 +111,12 @@ func NewEndpoint(options EndpointOptions) (*Endpoint, error) { if err != nil { return nil, E.Cause(err, "create WireGuard device") } - natDevice, isNatDevice := tunDevice.(NatDevice) - if !isNatDevice { - natDevice = NewNATDevice(tunDevice, true) - } return &Endpoint{ options: options, peers: peers, ipcConf: ipcConf, allowedAddress: allowedAddresses, tunDevice: tunDevice, - natDevice: natDevice, }, nil } @@ -184,13 +176,7 @@ func (e *Endpoint) Start(resolve bool) error { e.options.Logger.Error(fmt.Sprintf(strings.ToLower(format), args...)) }, } - var deviceInput Device - if e.natDevice != nil { - deviceInput = e.natDevice - } else { - deviceInput = e.tunDevice - } - wgDevice := device.NewDevice(e.options.Context, deviceInput, bind, logger, e.options.Workers) + wgDevice := device.NewDevice(e.options.Context, e.tunDevice, bind, logger, e.options.Workers) e.tunDevice.SetDevice(wgDevice) ipcConf := e.ipcConf for _, peer := range e.peers { @@ -208,20 +194,6 @@ func (e *Endpoint) Start(resolve bool) error { return nil } -func (e *Endpoint) Close() error { - if e.device != nil { - e.device.Close() - } - if e.pauseCallback != nil { - e.pauseManager.UnregisterCallback(e.pauseCallback) - } - return nil -} - -func (e *Endpoint) BindUpdate() error { - return e.device.BindUpdate() -} - func (e *Endpoint) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error) { if !destination.Addr.IsValid() { return nil, E.Cause(os.ErrInvalid, "invalid non-IP destination") @@ -236,11 +208,18 @@ func (e *Endpoint) ListenPacket(ctx context.Context, destination M.Socksaddr) (n return e.tunDevice.ListenPacket(ctx, destination) } -func (e *Endpoint) NewDirectRouteConnection(metadata adapter.InboundContext, routeContext tun.DirectRouteContext) (tun.DirectRouteDestination, error) { - if e.natDevice == nil { - return nil, os.ErrInvalid +func (e *Endpoint) BindUpdate() error { + return e.device.BindUpdate() +} + +func (e *Endpoint) Close() error { + if e.device != nil { + e.device.Close() } - return e.natDevice.CreateDestination(metadata, routeContext) + if e.pauseCallback != nil { + e.pauseManager.UnregisterCallback(e.pauseCallback) + } + return nil } func (e *Endpoint) onPauseUpdated(event int) { diff --git a/small/nikki/Makefile b/small/nikki/Makefile index 6cd7de656f..ba9d0e0b31 100644 --- a/small/nikki/Makefile +++ b/small/nikki/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/MetaCubeX/mihomo.git -PKG_SOURCE_DATE:=2025-02-13 -PKG_SOURCE_VERSION:=eaaccbc6ddb9e85a832ae420874b993810734629 -PKG_MIRROR_HASH:=62a6a992e0651aca2764bd3617d2c19bb040aba0aaf47a06c7fcc1a9e9fa5e56 +PKG_SOURCE_DATE:=2025-02-17 +PKG_SOURCE_VERSION:=dc1145a48432fad80e5d640931464cef506c9d49 +PKG_MIRROR_HASH:=d72e616dd425c8d679425ad5986fac29de09b75e72dfb6352ae14fcf4acbe958 PKG_LICENSE:=GPL3.0+ PKG_MAINTAINER:=Joseph Mory @@ -16,7 +16,7 @@ PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 PKG_BUILD_FLAGS:=no-mips16 -PKG_BUILD_VERSION:=alpha-eaaccbc +PKG_BUILD_VERSION:=alpha-dc1145a PKG_BUILD_TIME:=$(shell date -u -Iseconds) GO_PKG:=github.com/metacubex/mihomo diff --git a/v2rayn/v2rayN/Directory.Build.props b/v2rayn/v2rayN/Directory.Build.props index 1755c5c626..3159a733c6 100644 --- a/v2rayn/v2rayN/Directory.Build.props +++ b/v2rayn/v2rayN/Directory.Build.props @@ -1,7 +1,7 @@ - 7.9.0 + 7.9.1 diff --git a/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index efff619569..7990f219bc 100644 --- a/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayn/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -60,6 +60,9 @@ namespace ServiceLib.ViewModels [Reactive] public int SystemProxySelected { get; set; } + [Reactive] + public bool BlSystemProxyPacVisible { get; set; } + #endregion System Proxy #region UI @@ -96,6 +99,7 @@ namespace ServiceLib.ViewModels SelectedRouting = new(); SelectedServer = new(); RunningServerToolTipText = "-"; + BlSystemProxyPacVisible = Utils.IsWindows(); if (_config.TunModeItem.EnableTun && AllowEnableTun()) { diff --git a/v2rayn/v2rayN/v2rayN.Desktop/App.axaml b/v2rayn/v2rayN/v2rayN.Desktop/App.axaml index 99852cd21b..9dc9dd4a29 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/App.axaml +++ b/v2rayn/v2rayN/v2rayN.Desktop/App.axaml @@ -46,6 +46,12 @@ Header="{x:Static resx:ResUI.menuSystemProxyNothing}" IsChecked="{Binding BlSystemProxyNothing}" ToggleType="Radio" /> + @@ -61,4 +67,4 @@ - \ No newline at end of file + diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml b/v2rayn/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml index aaeec2c53a..a0fc3d5725 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml +++ b/v2rayn/v2rayN/v2rayN.Desktop/Assets/GlobalStyles.axaml @@ -20,4 +20,7 @@ - \ No newline at end of file + + diff --git a/v2rayn/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs b/v2rayn/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs index 6a68095664..b2f134e1b5 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs +++ b/v2rayn/v2rayN/v2rayN.Desktop/ViewModels/ThemeSettingViewModel.cs @@ -119,6 +119,17 @@ namespace v2rayN.Desktop.ViewModels Value = size, }); Application.Current?.Styles.Add(style); + + ModifyFontSizeEx(size); + } + + private void ModifyFontSizeEx(double size) + { + //DataGrid + var rowHeight = 20 + (size / 2); + var style = new Style(x => x.OfType()); + style.Add(new Setter(DataGrid.RowHeightProperty, rowHeight)); + Application.Current?.Styles.Add(style); } private void ModifyFontFamily() diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 65cd331065..0bcfc214d2 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -787,6 +787,7 @@ Classes="Margin8" /> + - \ No newline at end of file + diff --git a/v2rayn/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs b/v2rayn/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs index 2ecd3ae609..7512ce8041 100644 --- a/v2rayn/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs +++ b/v2rayn/v2rayN/v2rayN.Desktop/Views/StatusBarView.axaml.cs @@ -43,6 +43,11 @@ namespace v2rayN.Desktop.Views }); //spEnableTun.IsVisible = (Utils.IsWindows() || AppHandler.Instance.IsAdministrator); + + if (Utils.IsNonWindows() && cmbSystemProxy.Items.IsReadOnly == false) + { + cmbSystemProxy.Items.RemoveAt(cmbSystemProxy.Items.Count - 1); + } } private async Task UpdateViewHandler(EViewAction action, object? obj) diff --git a/v2rayn/v2rayN/v2rayN/Views/StatusBarView.xaml.cs b/v2rayn/v2rayN/v2rayN/Views/StatusBarView.xaml.cs index ed6177beff..90e5c5b6d6 100644 --- a/v2rayn/v2rayN/v2rayN/Views/StatusBarView.xaml.cs +++ b/v2rayn/v2rayN/v2rayN/Views/StatusBarView.xaml.cs @@ -32,8 +32,8 @@ namespace v2rayN.Views this.OneWayBind(ViewModel, vm => vm.BlSystemProxyPac, v => v.menuSystemProxyPac2.Visibility, conversionHint: BooleanToVisibilityHint.UseHidden, vmToViewConverterOverride: new BooleanToVisibilityTypeConverter()).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SystemProxyClearCmd, v => v.menuSystemProxyClear).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SystemProxySetCmd, v => v.menuSystemProxySet).DisposeWith(disposables); - this.BindCommand(ViewModel, vm => vm.SystemProxyPacCmd, v => v.menuSystemProxyPac).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SystemProxyNothingCmd, v => v.menuSystemProxyNothing).DisposeWith(disposables); + this.BindCommand(ViewModel, vm => vm.SystemProxyPacCmd, v => v.menuSystemProxyPac).DisposeWith(disposables); //routings and servers this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.cmbRoutings.ItemsSource).DisposeWith(disposables); diff --git a/xray-core/.github/workflows/release-win7.yml b/xray-core/.github/workflows/release-win7.yml index 0d00634a53..239de1b56a 100644 --- a/xray-core/.github/workflows/release-win7.yml +++ b/xray-core/.github/workflows/release-win7.yml @@ -1,11 +1,5 @@ name: Build and Release for Windows 7 -# NOTE: This Github Actions file depends on the Makefile. -# Building the correct package requires the correct binaries generated by the Makefile. To -# ensure the correct output, the Makefile must accept the appropriate input and compile the -# correct file with the correct name. If you need to modify this file, please ensure it won't -# disrupt the Makefile. - on: workflow_dispatch: release: @@ -37,6 +31,9 @@ jobs: GOARCH: ${{ matrix.goarch }} CGO_ENABLED: 0 steps: + - name: Checkout codebase + uses: actions/checkout@v4 + - name: Show workflow information run: | _NAME=${{ matrix.assetname }} @@ -46,18 +43,17 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: stable + go-version-file: go.mod check-latest: true - name: Setup patched builder run: | GOSDK=$(go env GOROOT) - curl -O -L https://github.com/XTLS/go-win7/releases/latest/download/go-for-win7-linux-amd64.zip rm -r $GOSDK/* + cd $GOSDK + curl -O -L https://github.com/XTLS/go-win7/releases/latest/download/go-for-win7-linux-amd64.zip unzip ./go-for-win7-linux-amd64.zip -d $GOSDK - - - name: Checkout codebase - uses: actions/checkout@v4 + rm ./go-for-win7-linux-amd64.zip - name: Get project dependencies run: go mod download @@ -65,8 +61,13 @@ jobs: - name: Build Xray run: | mkdir -p build_assets - make - find . -maxdepth 1 -type f -regex './\(wxray\|xray\).exe' -exec mv {} ./build_assets/ \; + COMMID=$(git describe --always --dirty) + echo 'Building Xray for Windows 7...' + go build -o build_assets/xray.exe -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + echo 'CreateObject("Wscript.Shell").Run "xray.exe -config config.json",0' > build_assets/xray_no_window.vbs + echo 'Start-Process -FilePath ".\xray.exe" -ArgumentList "-config .\config.json" -WindowStyle Hidden' > build_assets/xray_no_window.ps1 + # The line below is for without running conhost.exe version. Commented for not being used. Provided for reference. + # go build -o build_assets/wxray.exe -trimpath -buildvcs=false -ldflags="-H windowsgui -X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main - name: Restore Geodat Cache uses: actions/cache/restore@v4 diff --git a/xray-core/.github/workflows/release.yml b/xray-core/.github/workflows/release.yml index 7bc8c51d18..4de01e48c3 100644 --- a/xray-core/.github/workflows/release.yml +++ b/xray-core/.github/workflows/release.yml @@ -1,11 +1,5 @@ name: Build and Release -# NOTE: This Github Actions file depends on the Makefile. -# Building the correct package requires the correct binaries generated by the Makefile. To -# ensure the correct output, the Makefile must accept the appropriate input and compile the -# correct file with the correct name. If you need to modify this file, please ensure it won't -# disrupt the Makefile. - on: workflow_dispatch: release: @@ -129,8 +123,22 @@ jobs: - name: Build Xray run: | mkdir -p build_assets - make - find . -maxdepth 1 -type f -regex './\(wxray\|xray\|xray_softfloat\)\(\|.exe\)' -exec mv {} ./build_assets/ \; + COMMID=$(git describe --always --dirty) + if [[ ${GOOS} == 'windows' ]]; then + echo 'Building Xray for Windows...' + go build -o build_assets/xray.exe -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + echo 'CreateObject("Wscript.Shell").Run "xray.exe -config config.json",0' > build_assets/xray_no_window.vbs + echo 'Start-Process -FilePath ".\xray.exe" -ArgumentList "-config .\config.json" -WindowStyle Hidden' > build_assets/xray_no_window.ps1 + # The line below is for without running conhost.exe version. Commented for not being used. Provided for reference. + # go build -o build_assets/wxray.exe -trimpath -buildvcs=false -ldflags="-H windowsgui -X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + else + echo 'Building Xray...' + go build -o build_assets/xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + if [[ ${GOARCH} == 'mips' || ${GOARCH} == 'mipsle' ]]; then + echo 'Building soft-float Xray for MIPS/MIPSLE 32-bit...' + GOMIPS=softfloat go build -o build_assets/xray_softfloat -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main + fi + fi - name: Restore Geodat Cache uses: actions/cache/restore@v4 diff --git a/xray-core/Makefile b/xray-core/Makefile deleted file mode 100644 index 7653e30658..0000000000 --- a/xray-core/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -NAME = xray - -VERSION=$(shell git describe --always --dirty) - -# NOTE: This MAKEFILE can be used to build Xray-core locally and in Automatic workflows. It is \ - provided for convenience in automatic building and functions as a part of it. -# NOTE: If you need to modify this file, please be aware that:\ - - This file is not the main Makefile; it only accepts environment variables and builds the \ - binary.\ - - Automatic building expects the correct binaries to be built by this Makefile. If you \ - intend to propose a change to this Makefile, carefully review the file below and ensure \ - that the change will not accidentally break the automatic building:\ - .github/workflows/release.yml \ - Otherwise it is recommended to contact the project maintainers. - -LDFLAGS = -X github.com/xtls/xray-core/core.build=$(VERSION) -s -w -buildid= -PARAMS = -trimpath -ldflags "$(LDFLAGS)" -v -MAIN = ./main -PREFIX ?= $(shell go env GOPATH) -ifeq ($(GOOS),windows) -OUTPUT = $(NAME).exe -ADDITION = go build -o w$(NAME).exe -trimpath -ldflags "-H windowsgui $(LDFLAGS)" -v $(MAIN) -else -OUTPUT = $(NAME) -endif -ifeq ($(shell echo "$(GOARCH)" | grep -Eq "(mips|mipsle)" && echo true),true) # -ADDITION = GOMIPS=softfloat go build -o $(NAME)_softfloat -trimpath -ldflags "$(LDFLAGS)" -v $(MAIN) -endif -.PHONY: clean build - -build: - go build -o $(OUTPUT) $(PARAMS) $(MAIN) - $(ADDITION) - -clean: - go clean -v -i $(PWD) - rm -f xray xray.exe wxray.exe xray_softfloat diff --git a/xray-core/README.md b/xray-core/README.md index 2f78f78d20..7b258cff26 100644 --- a/xray-core/README.md +++ b/xray-core/README.md @@ -126,25 +126,27 @@ - [Xray-core v1.0.0](https://github.com/XTLS/Xray-core/releases/tag/v1.0.0) was forked from [v2fly-core 9a03cc5](https://github.com/v2fly/v2ray-core/commit/9a03cc5c98d04cc28320fcee26dbc236b3291256), and we have made & accumulated a huge number of enhancements over time, check [the release notes for each version](https://github.com/XTLS/Xray-core/releases). - For third-party projects used in [Xray-core](https://github.com/XTLS/Xray-core), check your local or [the latest go.mod](https://github.com/XTLS/Xray-core/blob/main/go.mod). -## Compilation +## One-line Compilation ### Windows (PowerShell) ```powershell $env:CGO_ENABLED=0 -go build -o xray.exe -trimpath -ldflags "-s -w -buildid=" ./main +go build -o xray.exe -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -v ./main ``` ### Linux / macOS ```bash -CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main +CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -v ./main ``` ### Reproducible Releases +Make sure that you are using the same Go version, and remember to set the git commit id (7 bytes): + ```bash -make +CGO_ENABLED=0 go build -o xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=REPLACE -s -w -buildid=" -v ./main ``` ## Stargazers over time diff --git a/xray-core/app/metrics/config.pb.go b/xray-core/app/metrics/config.pb.go index d62dcef91c..b0874b3b8c 100644 --- a/xray-core/app/metrics/config.pb.go +++ b/xray-core/app/metrics/config.pb.go @@ -27,7 +27,8 @@ type Config struct { unknownFields protoimpl.UnknownFields // Tag of the outbound handler that handles metrics http connections. - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` + Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` + Listen string `protobuf:"bytes,2,opt,name=listen,proto3" json:"listen,omitempty"` } func (x *Config) Reset() { @@ -67,20 +68,28 @@ func (x *Config) GetTag() string { return "" } +func (x *Config) GetListen() string { + if x != nil { + return x.Listen + } + return "" +} + var File_app_metrics_config_proto protoreflect.FileDescriptor var file_app_metrics_config_proto_rawDesc = []byte{ 0x0a, 0x18, 0x61, 0x70, 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x1a, 0x0a, 0x06, + 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x32, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, - 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, - 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, - 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, + 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/xray-core/app/metrics/config.proto b/xray-core/app/metrics/config.proto index 5e6880f176..0441df0336 100644 --- a/xray-core/app/metrics/config.proto +++ b/xray-core/app/metrics/config.proto @@ -10,4 +10,5 @@ option java_multiple_files = true; message Config { // Tag of the outbound handler that handles metrics http connections. string tag = 1; + string listen = 2; } diff --git a/xray-core/app/metrics/metrics.go b/xray-core/app/metrics/metrics.go index 757d673d78..1dc5b2f5d2 100644 --- a/xray-core/app/metrics/metrics.go +++ b/xray-core/app/metrics/metrics.go @@ -24,12 +24,15 @@ type MetricsHandler struct { statsManager feature_stats.Manager observatory extension.Observatory tag string + listen string + tcpListener net.Listener } // NewMetricsHandler creates a new MetricsHandler based on the given config. func NewMetricsHandler(ctx context.Context, config *Config) (*MetricsHandler, error) { c := &MetricsHandler{ - tag: config.Tag, + tag: config.Tag, + listen: config.Listen, } common.Must(core.RequireFeatures(ctx, func(om outbound.Manager, sm feature_stats.Manager) { c.statsManager = sm @@ -87,6 +90,23 @@ func (p *MetricsHandler) Type() interface{} { } func (p *MetricsHandler) Start() error { + + // direct listen a port if listen is set + if p.listen != "" { + TCPlistener, err := net.Listen("tcp", p.listen) + if err != nil { + return err + } + p.tcpListener = TCPlistener + errors.LogInfo(context.Background(), "Metrics server listening on ", p.listen) + + go func() { + if err := http.Serve(TCPlistener, http.DefaultServeMux); err != nil { + errors.LogErrorInner(context.Background(), err, "failed to start metrics server") + } + }() + } + listener := &OutboundListener{ buffer: make(chan net.Conn, 4), done: done.New(), diff --git a/xray-core/app/observatory/burst/healthping.go b/xray-core/app/observatory/burst/healthping.go index f08426022a..0d8cab9f27 100644 --- a/xray-core/app/observatory/burst/healthping.go +++ b/xray-core/app/observatory/burst/healthping.go @@ -66,10 +66,10 @@ func NewHealthPing(ctx context.Context, dispatcher routing.Dispatcher, config *H settings.Timeout = time.Duration(5) * time.Second } return &HealthPing{ - ctx: ctx, + ctx: ctx, dispatcher: dispatcher, - Settings: settings, - Results: nil, + Settings: settings, + Results: nil, } } diff --git a/xray-core/app/observatory/observer.go b/xray-core/app/observatory/observer.go index 657396f628..a6fba3adb4 100644 --- a/xray-core/app/observatory/observer.go +++ b/xray-core/app/observatory/observer.go @@ -32,7 +32,7 @@ type Observer struct { finished *done.Instance - ohm outbound.Manager + ohm outbound.Manager dispatcher routing.Dispatcher } @@ -226,9 +226,9 @@ func New(ctx context.Context, config *Config) (*Observer, error) { return nil, errors.New("Cannot get depended features").Base(err) } return &Observer{ - config: config, - ctx: ctx, - ohm: outboundManager, + config: config, + ctx: ctx, + ohm: outboundManager, dispatcher: dispatcher, }, nil } diff --git a/xray-core/common/net/system.go b/xray-core/common/net/system.go index e5bded04ca..7e1c4b01a3 100644 --- a/xray-core/common/net/system.go +++ b/xray-core/common/net/system.go @@ -76,8 +76,9 @@ type ( ) var ( - ResolveUnixAddr = net.ResolveUnixAddr + ResolveTCPAddr = net.ResolveTCPAddr ResolveUDPAddr = net.ResolveUDPAddr + ResolveUnixAddr = net.ResolveUnixAddr ) type Resolver = net.Resolver diff --git a/xray-core/core/core.go b/xray-core/core/core.go index 5a52683ee1..5db6fd45f5 100644 --- a/xray-core/core/core.go +++ b/xray-core/core/core.go @@ -18,8 +18,8 @@ import ( var ( Version_x byte = 25 - Version_y byte = 1 - Version_z byte = 30 + Version_y byte = 2 + Version_z byte = 18 ) var ( diff --git a/xray-core/core/xray.go b/xray-core/core/xray.go index f6ccc27d61..0cc56daa12 100644 --- a/xray-core/core/xray.go +++ b/xray-core/core/xray.go @@ -359,7 +359,7 @@ func (s *Instance) AddFeature(feature features.Feature) error { } s.pendingOptionalResolutions = pendingOptional s.resolveLock.Unlock() - + var err error for _, r := range availableResolution { err = r.callbackResolution(s.features) // only return the last error for now diff --git a/xray-core/infra/conf/metrics.go b/xray-core/infra/conf/metrics.go index 3f550e88ea..75965206e3 100644 --- a/xray-core/infra/conf/metrics.go +++ b/xray-core/infra/conf/metrics.go @@ -6,15 +6,21 @@ import ( ) type MetricsConfig struct { - Tag string `json:"tag"` + Tag string `json:"tag"` + Listen string `json:"listen"` } func (c *MetricsConfig) Build() (*metrics.Config, error) { + if c.Listen == "" && c.Tag == "" { + return nil, errors.New("Metrics must have a tag or listen address.") + } + // If the tag is empty but have "listen" set a default "Metrics" for compatibility. if c.Tag == "" { - return nil, errors.New("metrics tag can't be empty.") + c.Tag = "Metrics" } return &metrics.Config{ - Tag: c.Tag, + Tag: c.Tag, + Listen: c.Listen, }, nil } diff --git a/xray-core/main/commands/all/api/balancer_info.go b/xray-core/main/commands/all/api/balancer_info.go index 0d376d63d6..f5b6804c69 100644 --- a/xray-core/main/commands/all/api/balancer_info.go +++ b/xray-core/main/commands/all/api/balancer_info.go @@ -13,25 +13,20 @@ import ( var cmdBalancerInfo = &base.Command{ CustomFlags: true, UsageLine: "{{.Exec}} api bi [--server=127.0.0.1:8080] [balancer]...", - Short: "balancer information", + Short: "Retrieve balancer information", Long: ` -Get information of specified balancers, including health, strategy -and selecting. If no balancer tag specified, get information of -all balancers. +Retrieve information of specified balancers, including health, strategy and selecting. +If no balancer tag specified, information for all balancers is returned. -> Make sure you have "RoutingService" set in "config.api.services" -of server config. +> Ensure that "RoutingService" is enabled under "config.api.services" in the server configuration. Arguments: - -json - Use json output. - -s, -server The API server address. Default 127.0.0.1:8080 -t, -timeout - Timeout seconds to call API. Default 3 + Timeout in seconds for calling API. Default 3 Example: diff --git a/xray-core/main/commands/all/api/balancer_override.go b/xray-core/main/commands/all/api/balancer_override.go index 3ac013e985..7386b1a585 100644 --- a/xray-core/main/commands/all/api/balancer_override.go +++ b/xray-core/main/commands/all/api/balancer_override.go @@ -7,31 +7,27 @@ import ( var cmdBalancerOverride = &base.Command{ CustomFlags: true, - UsageLine: "{{.Exec}} api bo [--server=127.0.0.1:8080] <-b balancer> outboundTag", - Short: "balancer override", + UsageLine: "{{.Exec}} api bo [--server=127.0.0.1:8080] <-b balancer> outboundTag <-r>", + Short: "Override balancer", Long: ` -Override a balancer's selection. +Override the selection target of a balancer. -> Make sure you have "RoutingService" set in "config.api.services" -of server config. +> Ensure that the "RoutingService" is properly configured under "config.api.services" in the server configuration. -Once a balancer's selecting is overridden: +Once the balancer's selection is overridden: - The balancer's selection result will always be outboundTag Arguments: - -r, -remove - Remove the overridden - - -r, -remove - Remove the override - - -s, -server + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + -t, -timeout + Timeout in seconds for calling API. Default 3 + + -r, -remove + Remove the existing override. Example: diff --git a/xray-core/main/commands/all/api/inbound_user.go b/xray-core/main/commands/all/api/inbound_user.go index 7a443183b6..23c191d51b 100644 --- a/xray-core/main/commands/all/api/inbound_user.go +++ b/xray-core/main/commands/all/api/inbound_user.go @@ -8,20 +8,28 @@ import ( var cmdInboundUser = &base.Command{ CustomFlags: true, UsageLine: "{{.Exec}} api inbounduser [--server=127.0.0.1:8080] -tag=tag [-email=email]", - Short: "Get Inbound User", + Short: "Retrieve inbound user(s)", Long: ` Get User info from an inbound. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + -tag Inbound tag - -email - User email. If email is not given, will get all users + + -email + The user's email address. If not provided, all users will be retrieved. + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -tag="tag name" -email="xray@love.com" + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -tag="tag name" + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -tag="tag name" -email="xray@love.com" `, Run: executeInboundUser, } diff --git a/xray-core/main/commands/all/api/inbound_user_count.go b/xray-core/main/commands/all/api/inbound_user_count.go index 18cab7e80f..8c7c0fc396 100644 --- a/xray-core/main/commands/all/api/inbound_user_count.go +++ b/xray-core/main/commands/all/api/inbound_user_count.go @@ -8,18 +8,24 @@ import ( var cmdInboundUserCount = &base.Command{ CustomFlags: true, UsageLine: "{{.Exec}} api inboundusercount [--server=127.0.0.1:8080] -tag=tag", - Short: "Get Inbound User Count", + Short: "Retrieve inbound user count", Long: ` -Get User count from an inbound. +Retrieve the user count for a specified inbound tag. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + -tag - Inbound tag + Inbound tag + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -tag="tag name" + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -tag="tag name" `, Run: executeInboundUserCount, } diff --git a/xray-core/main/commands/all/api/inbounds_add.go b/xray-core/main/commands/all/api/inbounds_add.go index dad8b0f9c0..9bad6f87d5 100644 --- a/xray-core/main/commands/all/api/inbounds_add.go +++ b/xray-core/main/commands/all/api/inbounds_add.go @@ -15,13 +15,18 @@ var cmdAddInbounds = &base.Command{ Short: "Add inbounds", Long: ` Add inbounds to Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json `, Run: executeAddInbounds, } diff --git a/xray-core/main/commands/all/api/inbounds_remove.go b/xray-core/main/commands/all/api/inbounds_remove.go index 9ab83e20d6..400a239e17 100644 --- a/xray-core/main/commands/all/api/inbounds_remove.go +++ b/xray-core/main/commands/all/api/inbounds_remove.go @@ -14,13 +14,18 @@ var cmdRemoveInbounds = &base.Command{ Short: "Remove inbounds", Long: ` Remove inbounds from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" `, Run: executeRemoveInbounds, } diff --git a/xray-core/main/commands/all/api/logger_restart.go b/xray-core/main/commands/all/api/logger_restart.go index 7bd6f10dbf..15dacc156c 100644 --- a/xray-core/main/commands/all/api/logger_restart.go +++ b/xray-core/main/commands/all/api/logger_restart.go @@ -11,11 +11,18 @@ var cmdRestartLogger = &base.Command{ Short: "Restart the logger", Long: ` Restart the logger of Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + +Example: + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 `, Run: executeRestartLogger, } diff --git a/xray-core/main/commands/all/api/outbounds_add.go b/xray-core/main/commands/all/api/outbounds_add.go index 5066e5439f..8d36f75a4e 100644 --- a/xray-core/main/commands/all/api/outbounds_add.go +++ b/xray-core/main/commands/all/api/outbounds_add.go @@ -15,13 +15,18 @@ var cmdAddOutbounds = &base.Command{ Short: "Add outbounds", Long: ` Add outbounds to Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json `, Run: executeAddOutbounds, } diff --git a/xray-core/main/commands/all/api/outbounds_remove.go b/xray-core/main/commands/all/api/outbounds_remove.go index 9fdbc07838..a081bc6237 100644 --- a/xray-core/main/commands/all/api/outbounds_remove.go +++ b/xray-core/main/commands/all/api/outbounds_remove.go @@ -14,13 +14,18 @@ var cmdRemoveOutbounds = &base.Command{ Short: "Remove outbounds", Long: ` Remove outbounds from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" `, Run: executeRemoveOutbounds, } diff --git a/xray-core/main/commands/all/api/rules_add.go b/xray-core/main/commands/all/api/rules_add.go index 11ec1e0176..2e1404e603 100644 --- a/xray-core/main/commands/all/api/rules_add.go +++ b/xray-core/main/commands/all/api/rules_add.go @@ -16,16 +16,21 @@ var cmdAddRules = &base.Command{ Short: "Add routing rules", Long: ` Add routing rules to Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout + + -t, -timeout Timeout seconds to call API. Default 3 + -append - append or replace config. Default false + Append to the existing configuration instead of replacing it. Default false Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json `, Run: executeAddRules, } diff --git a/xray-core/main/commands/all/api/rules_remove.go b/xray-core/main/commands/all/api/rules_remove.go index 4904022ae5..ac9a8d097b 100644 --- a/xray-core/main/commands/all/api/rules_remove.go +++ b/xray-core/main/commands/all/api/rules_remove.go @@ -9,17 +9,22 @@ import ( var cmdRemoveRules = &base.Command{ CustomFlags: true, - UsageLine: "{{.Exec}} api rmrules [--server=127.0.0.1:8080] ruleTag1 ruleTag2...", + UsageLine: "{{.Exec}} api rmrules [--server=127.0.0.1:8080] [ruleTag]...", Short: "Remove routing rules by ruleTag", Long: ` Remove routing rules by ruleTag from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 ruleTag1 ruleTag2 + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 ruleTag1 ruleTag2 `, Run: executeRemoveRules, } diff --git a/xray-core/main/commands/all/api/source_ip_block.go b/xray-core/main/commands/all/api/source_ip_block.go index 1f7731872e..11f3d55d49 100644 --- a/xray-core/main/commands/all/api/source_ip_block.go +++ b/xray-core/main/commands/all/api/source_ip_block.go @@ -14,25 +14,34 @@ import ( var cmdSourceIpBlock = &base.Command{ CustomFlags: true, UsageLine: "{{.Exec}} api sib [--server=127.0.0.1:8080] -outbound=blocked -inbound=socks 1.2.3.4", - Short: "Drop connections by source ip", + Short: "Block connections by source IP", Long: ` -Drop connections by source ip. +Block connections by source IP address. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + -outbound - route traffic to specific outbound. + Specifies the outbound tag. + -inbound - target traffig from specific inbound. + Specifies the inbound tag. + -ruletag - set ruleTag. Default sourceIpBlock + The ruleTag. Default sourceIpBlock + -reset remove ruletag and apply new source IPs. Default false - Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json +Example: + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -outbound=blocked -inbound=socks 1.2.3.4 + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -outbound=blocked -inbound=socks 1.2.3.4 -reset `, Run: executeSourceIpBlock, } diff --git a/xray-core/main/commands/all/api/stats_get.go b/xray-core/main/commands/all/api/stats_get.go index c03fe5f8c5..9b5d82f9ec 100644 --- a/xray-core/main/commands/all/api/stats_get.go +++ b/xray-core/main/commands/all/api/stats_get.go @@ -8,19 +8,26 @@ import ( var cmdGetStats = &base.Command{ CustomFlags: true, UsageLine: "{{.Exec}} api stats [--server=127.0.0.1:8080] [-name '']", - Short: "Get statistics", + Short: "Retrieve statistics", Long: ` -Get statistics from Xray. +Retrieve the statistics from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + -name - Name of the stat counter. + Name of the counter. + -reset - Reset the counter to fetching its value. + Reset the counter after fetching their values. Default false + Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -name "inbound>>>statin>>>traffic>>>downlink" `, Run: executeGetStats, diff --git a/xray-core/main/commands/all/api/stats_online.go b/xray-core/main/commands/all/api/stats_online.go index 9359280753..aca547a6f3 100644 --- a/xray-core/main/commands/all/api/stats_online.go +++ b/xray-core/main/commands/all/api/stats_online.go @@ -7,21 +7,25 @@ import ( var cmdOnlineStats = &base.Command{ CustomFlags: true, - UsageLine: "{{.Exec}} api statsonline [--server=127.0.0.1:8080] [-name '']", - Short: "Get online user", + UsageLine: "{{.Exec}} api statsonline [--server=127.0.0.1:8080] [-email '']", + Short: "Retrieve the online session count for a user", Long: ` -Get statistics from Xray. +Retrieve the current number of active sessions for a user from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + -email - email of the user. - -reset - Reset the counter to fetching its value. + The user's email address. + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -email "user1@test.com" + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -email "xray@love.com" `, Run: executeOnlineStats, } diff --git a/xray-core/main/commands/all/api/stats_online_ip_list.go b/xray-core/main/commands/all/api/stats_online_ip_list.go index 45b0ed517e..74e066f99e 100644 --- a/xray-core/main/commands/all/api/stats_online_ip_list.go +++ b/xray-core/main/commands/all/api/stats_online_ip_list.go @@ -7,21 +7,25 @@ import ( var cmdOnlineStatsIpList = &base.Command{ CustomFlags: true, - UsageLine: "{{.Exec}} api statsonlineiplist [--server=127.0.0.1:8080] [-name '']", - Short: "Get online user ips list and access times", + UsageLine: "{{.Exec}} api statsonlineiplist [--server=127.0.0.1:8080] [-email '']", + Short: "Retrieve a user's online IP addresses and access times", Long: ` -Get statistics from Xray. +Retrieve the online IP addresses and corresponding access timestamps for a user from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + -email - email of the user. - -reset - Reset the counter to fetching its value (not used). + The user's email address. + Example: - {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -email "user1@test.com" + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -email "xray@love.com" `, Run: executeOnlineStatsIpList, } diff --git a/xray-core/main/commands/all/api/stats_query.go b/xray-core/main/commands/all/api/stats_query.go index f31631990f..99d644378b 100644 --- a/xray-core/main/commands/all/api/stats_query.go +++ b/xray-core/main/commands/all/api/stats_query.go @@ -11,16 +11,23 @@ var cmdQueryStats = &base.Command{ Short: "Query statistics", Long: ` Query statistics from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + -pattern - Pattern of the query. + Filter pattern for the statistics query. + -reset - Reset the counter to fetching its value. + Reset the counter after fetching their values. Default false + Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -pattern "counter_" `, Run: executeQueryStats, diff --git a/xray-core/main/commands/all/api/stats_sys.go b/xray-core/main/commands/all/api/stats_sys.go index de7a8ce249..e34d056e29 100644 --- a/xray-core/main/commands/all/api/stats_sys.go +++ b/xray-core/main/commands/all/api/stats_sys.go @@ -8,14 +8,21 @@ import ( var cmdSysStats = &base.Command{ CustomFlags: true, UsageLine: "{{.Exec}} api statssys [--server=127.0.0.1:8080]", - Short: "Get system statistics", + Short: "Retrieve system statistics", Long: ` -Get system statistics from Xray. +Retrieve system statistics from Xray. + Arguments: - -s, -server + + -s, -server The API server address. Default 127.0.0.1:8080 - -t, -timeout - Timeout seconds to call API. Default 3 + + -t, -timeout + Timeout in seconds for calling API. Default 3 + +Example: + + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 `, Run: executeSysStats, } diff --git a/xray-core/proxy/http/client.go b/xray-core/proxy/http/client.go index 862ca418eb..b1326bec91 100644 --- a/xray-core/proxy/http/client.go +++ b/xray-core/proxy/http/client.go @@ -151,6 +151,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter return buf.Copy(link.Reader, buf.NewWriter(conn), buf.UpdateActivity(timer)) } responseFunc := func() error { + ob.CanSpliceCopy = 1 defer timer.SetTimeout(p.Timeouts.UplinkOnly) return buf.Copy(buf.NewReader(conn), link.Writer, buf.UpdateActivity(timer)) } diff --git a/xray-core/proxy/http/server.go b/xray-core/proxy/http/server.go index 01216513e6..24708e69c6 100644 --- a/xray-core/proxy/http/server.go +++ b/xray-core/proxy/http/server.go @@ -207,6 +207,7 @@ func (s *Server) handleConnect(ctx context.Context, _ *http.Request, reader *buf } responseDone := func() error { + inbound.CanSpliceCopy = 1 defer timer.SetTimeout(plcy.Timeouts.UplinkOnly) v2writer := buf.NewWriter(conn) diff --git a/xray-core/proxy/proxy.go b/xray-core/proxy/proxy.go index a3d3fccb54..5764979595 100644 --- a/xray-core/proxy/proxy.go +++ b/xray-core/proxy/proxy.go @@ -107,41 +107,65 @@ type TrafficState struct { IsTLS bool Cipher uint16 RemainingServerHello int32 + Inbound InboundState + Outbound OutboundState +} +type InboundState struct { + // reader link state + WithinPaddingBuffers bool + UplinkReaderDirectCopy bool + RemainingCommand int32 + RemainingContent int32 + RemainingPadding int32 + CurrentCommand int + // write link state + IsPadding bool + DownlinkWriterDirectCopy bool +} + +type OutboundState struct { // reader link state WithinPaddingBuffers bool DownlinkReaderDirectCopy bool - UplinkReaderDirectCopy bool RemainingCommand int32 RemainingContent int32 RemainingPadding int32 CurrentCommand int - // write link state - IsPadding bool - DownlinkWriterDirectCopy bool - UplinkWriterDirectCopy bool + IsPadding bool + UplinkWriterDirectCopy bool } func NewTrafficState(userUUID []byte) *TrafficState { return &TrafficState{ - UserUUID: userUUID, - NumberOfPacketToFilter: 8, - EnableXtls: false, - IsTLS12orAbove: false, - IsTLS: false, - Cipher: 0, - RemainingServerHello: -1, - WithinPaddingBuffers: true, - DownlinkReaderDirectCopy: false, - UplinkReaderDirectCopy: false, - RemainingCommand: -1, - RemainingContent: -1, - RemainingPadding: -1, - CurrentCommand: 0, - IsPadding: true, - DownlinkWriterDirectCopy: false, - UplinkWriterDirectCopy: false, + UserUUID: userUUID, + NumberOfPacketToFilter: 8, + EnableXtls: false, + IsTLS12orAbove: false, + IsTLS: false, + Cipher: 0, + RemainingServerHello: -1, + Inbound: InboundState{ + WithinPaddingBuffers: true, + UplinkReaderDirectCopy: false, + RemainingCommand: -1, + RemainingContent: -1, + RemainingPadding: -1, + CurrentCommand: 0, + IsPadding: true, + DownlinkWriterDirectCopy: false, + }, + Outbound: OutboundState{ + WithinPaddingBuffers: true, + DownlinkReaderDirectCopy: false, + RemainingCommand: -1, + RemainingContent: -1, + RemainingPadding: -1, + CurrentCommand: 0, + IsPadding: true, + UplinkWriterDirectCopy: false, + }, } } @@ -166,28 +190,43 @@ func NewVisionReader(reader buf.Reader, state *TrafficState, isUplink bool, cont func (w *VisionReader) ReadMultiBuffer() (buf.MultiBuffer, error) { buffer, err := w.Reader.ReadMultiBuffer() if !buffer.IsEmpty() { - if w.trafficState.WithinPaddingBuffers || w.trafficState.NumberOfPacketToFilter > 0 { + var withinPaddingBuffers *bool + var remainingContent *int32 + var remainingPadding *int32 + var currentCommand *int + var switchToDirectCopy *bool + if w.isUplink { + withinPaddingBuffers = &w.trafficState.Inbound.WithinPaddingBuffers + remainingContent = &w.trafficState.Inbound.RemainingContent + remainingPadding = &w.trafficState.Inbound.RemainingPadding + currentCommand = &w.trafficState.Inbound.CurrentCommand + switchToDirectCopy = &w.trafficState.Inbound.UplinkReaderDirectCopy + } else { + withinPaddingBuffers = &w.trafficState.Outbound.WithinPaddingBuffers + remainingContent = &w.trafficState.Outbound.RemainingContent + remainingPadding = &w.trafficState.Outbound.RemainingPadding + currentCommand = &w.trafficState.Outbound.CurrentCommand + switchToDirectCopy = &w.trafficState.Outbound.DownlinkReaderDirectCopy + } + + if *withinPaddingBuffers || w.trafficState.NumberOfPacketToFilter > 0 { mb2 := make(buf.MultiBuffer, 0, len(buffer)) for _, b := range buffer { - newbuffer := XtlsUnpadding(b, w.trafficState, w.ctx) + newbuffer := XtlsUnpadding(b, w.trafficState, w.isUplink, w.ctx) if newbuffer.Len() > 0 { mb2 = append(mb2, newbuffer) } } buffer = mb2 - if w.trafficState.RemainingContent > 0 || w.trafficState.RemainingPadding > 0 || w.trafficState.CurrentCommand == 0 { - w.trafficState.WithinPaddingBuffers = true - } else if w.trafficState.CurrentCommand == 1 { - w.trafficState.WithinPaddingBuffers = false - } else if w.trafficState.CurrentCommand == 2 { - w.trafficState.WithinPaddingBuffers = false - if w.isUplink { - w.trafficState.UplinkReaderDirectCopy = true - } else { - w.trafficState.DownlinkReaderDirectCopy = true - } + if *remainingContent > 0 || *remainingPadding > 0 || *currentCommand == 0 { + *withinPaddingBuffers = true + } else if *currentCommand == 1 { + *withinPaddingBuffers = false + } else if *currentCommand == 2 { + *withinPaddingBuffers = false + *switchToDirectCopy = true } else { - errors.LogInfo(w.ctx, "XtlsRead unknown command ", w.trafficState.CurrentCommand, buffer.Len()) + errors.LogInfo(w.ctx, "XtlsRead unknown command ", *currentCommand, buffer.Len()) } } if w.trafficState.NumberOfPacketToFilter > 0 { @@ -223,7 +262,16 @@ func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { if w.trafficState.NumberOfPacketToFilter > 0 { XtlsFilterTls(mb, w.trafficState, w.ctx) } - if w.trafficState.IsPadding { + var isPadding *bool + var switchToDirectCopy *bool + if w.isUplink { + isPadding = &w.trafficState.Outbound.IsPadding + switchToDirectCopy = &w.trafficState.Outbound.UplinkWriterDirectCopy + } else { + isPadding = &w.trafficState.Inbound.IsPadding + switchToDirectCopy = &w.trafficState.Inbound.DownlinkWriterDirectCopy + } + if *isPadding { if len(mb) == 1 && mb[0] == nil { mb[0] = XtlsPadding(nil, CommandPaddingContinue, &w.writeOnceUserUUID, true, w.ctx) // we do a long padding to hide vless header return w.Writer.WriteMultiBuffer(mb) @@ -233,11 +281,7 @@ func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { for i, b := range mb { if w.trafficState.IsTLS && b.Len() >= 6 && bytes.Equal(TlsApplicationDataStart, b.BytesTo(3)) { if w.trafficState.EnableXtls { - if w.isUplink { - w.trafficState.UplinkWriterDirectCopy = true - } else { - w.trafficState.DownlinkWriterDirectCopy = true - } + *switchToDirectCopy = true } var command byte = CommandPaddingContinue if i == len(mb)-1 { @@ -247,16 +291,16 @@ func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { } } mb[i] = XtlsPadding(b, command, &w.writeOnceUserUUID, true, w.ctx) - w.trafficState.IsPadding = false // padding going to end + *isPadding = false // padding going to end longPadding = false continue } else if !w.trafficState.IsTLS12orAbove && w.trafficState.NumberOfPacketToFilter <= 1 { // For compatibility with earlier vision receiver, we finish padding 1 packet early - w.trafficState.IsPadding = false + *isPadding = false mb[i] = XtlsPadding(b, CommandPaddingEnd, &w.writeOnceUserUUID, longPadding, w.ctx) break } var command byte = CommandPaddingContinue - if i == len(mb)-1 && !w.trafficState.IsPadding { + if i == len(mb)-1 && !*isPadding { command = CommandPaddingEnd if w.trafficState.EnableXtls { command = CommandPaddingDirect @@ -343,38 +387,53 @@ func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool } // XtlsUnpadding remove padding and parse command -func XtlsUnpadding(b *buf.Buffer, s *TrafficState, ctx context.Context) *buf.Buffer { - if s.RemainingCommand == -1 && s.RemainingContent == -1 && s.RemainingPadding == -1 { // initial state +func XtlsUnpadding(b *buf.Buffer, s *TrafficState, isUplink bool, ctx context.Context) *buf.Buffer { + var remainingCommand *int32 + var remainingContent *int32 + var remainingPadding *int32 + var currentCommand *int + if isUplink { + remainingCommand = &s.Inbound.RemainingCommand + remainingContent = &s.Inbound.RemainingContent + remainingPadding = &s.Inbound.RemainingPadding + currentCommand = &s.Inbound.CurrentCommand + } else { + remainingCommand = &s.Outbound.RemainingCommand + remainingContent = &s.Outbound.RemainingContent + remainingPadding = &s.Outbound.RemainingPadding + currentCommand = &s.Outbound.CurrentCommand + } + if *remainingCommand == -1 && *remainingContent == -1 && *remainingPadding == -1 { // initial state if b.Len() >= 21 && bytes.Equal(s.UserUUID, b.BytesTo(16)) { b.Advance(16) - s.RemainingCommand = 5 + *remainingCommand = 5 } else { return b } } newbuffer := buf.New() for b.Len() > 0 { - if s.RemainingCommand > 0 { + if *remainingCommand > 0 { data, err := b.ReadByte() if err != nil { return newbuffer } - switch s.RemainingCommand { + switch *remainingCommand { case 5: - s.CurrentCommand = int(data) + *currentCommand = int(data) case 4: - s.RemainingContent = int32(data) << 8 + *remainingContent = int32(data) << 8 case 3: - s.RemainingContent = s.RemainingContent | int32(data) + *remainingContent = *remainingContent | int32(data) case 2: - s.RemainingPadding = int32(data) << 8 + *remainingPadding = int32(data) << 8 case 1: - s.RemainingPadding = s.RemainingPadding | int32(data) - errors.LogInfo(ctx, "Xtls Unpadding new block, content ", s.RemainingContent, " padding ", s.RemainingPadding, " command ", s.CurrentCommand) + *remainingPadding = *remainingPadding | int32(data) + errors.LogInfo(ctx, "Xtls Unpadding new block, content ", *remainingContent, " padding ", *remainingPadding, " command ", *currentCommand) } - s.RemainingCommand-- - } else if s.RemainingContent > 0 { - len := s.RemainingContent + *remainingCommand-- + } else if *remainingContent > 0 { + len := *remainingContent if b.Len() < len { len = b.Len() } @@ -383,22 +442,22 @@ func XtlsUnpadding(b *buf.Buffer, s *TrafficState, ctx context.Context) *buf.Buf return newbuffer } newbuffer.Write(data) - s.RemainingContent -= len + *remainingContent -= len } else { // remainingPadding > 0 - len := s.RemainingPadding + len := *remainingPadding if b.Len() < len { len = b.Len() } b.Advance(len) - s.RemainingPadding -= len + *remainingPadding -= len } - if s.RemainingCommand <= 0 && s.RemainingContent <= 0 && s.RemainingPadding <= 0 { // this block done - if s.CurrentCommand == 0 { - s.RemainingCommand = 5 + if *remainingCommand <= 0 && *remainingContent <= 0 && *remainingPadding <= 0 { // this block done + if *currentCommand == 0 { + *remainingCommand = 5 } else { - s.RemainingCommand = -1 // set to initial state - s.RemainingContent = -1 - s.RemainingPadding = -1 + *remainingCommand = -1 // set to initial state + *remainingContent = -1 + *remainingPadding = -1 if b.Len() > 0 { // shouldn't happen newbuffer.Write(b.Bytes()) } @@ -465,7 +524,7 @@ func XtlsFilterTls(buffer buf.MultiBuffer, trafficState *TrafficState, ctx conte } } -// UnwrapRawConn support unwrap stats, tls, utls, reality and proxyproto conn and get raw tcp conn from it +// UnwrapRawConn support unwrap stats, tls, utls, reality, proxyproto, uds-wrapper conn and get raw tcp/uds conn from it func UnwrapRawConn(conn net.Conn) (net.Conn, stats.Counter, stats.Counter) { var readCounter, writerCounter stats.Counter if conn != nil { @@ -488,6 +547,9 @@ func UnwrapRawConn(conn net.Conn) (net.Conn, stats.Counter, stats.Counter) { conn = pc.Raw() // 8192 > 4096, there is no need to process pc's bufReader } + if uc, ok := conn.(*internet.UDSWrapperConn); ok { + conn = uc.Conn + } } return conn, readCounter, writerCounter } diff --git a/xray-core/proxy/socks/client.go b/xray-core/proxy/socks/client.go index 2ed5740a4f..232215ece5 100644 --- a/xray-core/proxy/socks/client.go +++ b/xray-core/proxy/socks/client.go @@ -146,6 +146,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter return buf.Copy(link.Reader, buf.NewWriter(conn), buf.UpdateActivity(timer)) } responseFunc = func() error { + ob.CanSpliceCopy = 1 defer timer.SetTimeout(p.Timeouts.UplinkOnly) return buf.Copy(buf.NewReader(conn), link.Writer, buf.UpdateActivity(timer)) } @@ -161,6 +162,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter return buf.Copy(link.Reader, writer, buf.UpdateActivity(timer)) } responseFunc = func() error { + ob.CanSpliceCopy = 1 defer timer.SetTimeout(p.Timeouts.UplinkOnly) reader := &UDPReader{Reader: udpConn} return buf.Copy(reader, link.Writer, buf.UpdateActivity(timer)) diff --git a/xray-core/proxy/socks/server.go b/xray-core/proxy/socks/server.go index 472b23a066..dd6f39533f 100644 --- a/xray-core/proxy/socks/server.go +++ b/xray-core/proxy/socks/server.go @@ -199,6 +199,7 @@ func (s *Server) transport(ctx context.Context, reader io.Reader, writer io.Writ } responseDone := func() error { + inbound.CanSpliceCopy = 1 defer timer.SetTimeout(plcy.Timeouts.UplinkOnly) v2writer := buf.NewWriter(writer) @@ -256,6 +257,7 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn stat.Connection, dis if inbound != nil && inbound.Source.IsValid() { errors.LogInfo(ctx, "client UDP connection from ", inbound.Source) } + inbound.CanSpliceCopy = 1 var dest *net.Destination diff --git a/xray-core/proxy/vless/encoding/encoding.go b/xray-core/proxy/vless/encoding/encoding.go index 3fce329042..38043e683c 100644 --- a/xray-core/proxy/vless/encoding/encoding.go +++ b/xray-core/proxy/vless/encoding/encoding.go @@ -175,16 +175,16 @@ func DecodeResponseHeader(reader io.Reader, request *protocol.RequestHeader) (*A func XtlsRead(reader buf.Reader, writer buf.Writer, timer *signal.ActivityTimer, conn net.Conn, input *bytes.Reader, rawInput *bytes.Buffer, trafficState *proxy.TrafficState, ob *session.Outbound, isUplink bool, ctx context.Context) error { err := func() error { for { - if isUplink && trafficState.UplinkReaderDirectCopy || !isUplink && trafficState.DownlinkReaderDirectCopy { + if isUplink && trafficState.Inbound.UplinkReaderDirectCopy || !isUplink && trafficState.Outbound.DownlinkReaderDirectCopy { var writerConn net.Conn var inTimer *signal.ActivityTimer if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Conn != nil { writerConn = inbound.Conn inTimer = inbound.Timer - if inbound.CanSpliceCopy == 2 { + if isUplink && inbound.CanSpliceCopy == 2 { inbound.CanSpliceCopy = 1 } - if ob != nil && ob.CanSpliceCopy == 2 { // ob need to be passed in due to context can change + if !isUplink && ob != nil && ob.CanSpliceCopy == 2 { // ob need to be passed in due to context can change ob.CanSpliceCopy = 1 } } @@ -193,7 +193,7 @@ func XtlsRead(reader buf.Reader, writer buf.Writer, timer *signal.ActivityTimer, buffer, err := reader.ReadMultiBuffer() if !buffer.IsEmpty() { timer.Update() - if isUplink && trafficState.UplinkReaderDirectCopy || !isUplink && trafficState.DownlinkReaderDirectCopy { + if isUplink && trafficState.Inbound.UplinkReaderDirectCopy || !isUplink && trafficState.Outbound.DownlinkReaderDirectCopy { // XTLS Vision processes struct TLS Conn's input and rawInput if inputBuffer, err := buf.ReadFrom(input); err == nil { if !inputBuffer.IsEmpty() { @@ -227,12 +227,12 @@ func XtlsWrite(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdate var ct stats.Counter for { buffer, err := reader.ReadMultiBuffer() - if isUplink && trafficState.UplinkWriterDirectCopy || !isUplink && trafficState.DownlinkWriterDirectCopy { + if isUplink && trafficState.Outbound.UplinkWriterDirectCopy || !isUplink && trafficState.Inbound.DownlinkWriterDirectCopy { if inbound := session.InboundFromContext(ctx); inbound != nil { - if inbound.CanSpliceCopy == 2 { + if !isUplink && inbound.CanSpliceCopy == 2 { inbound.CanSpliceCopy = 1 } - if ob != nil && ob.CanSpliceCopy == 2 { + if isUplink && ob != nil && ob.CanSpliceCopy == 2 { ob.CanSpliceCopy = 1 } } @@ -240,9 +240,9 @@ func XtlsWrite(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdate writer = buf.NewWriter(rawConn) ct = writerCounter if isUplink { - trafficState.UplinkWriterDirectCopy = false + trafficState.Outbound.UplinkWriterDirectCopy = false } else { - trafficState.DownlinkWriterDirectCopy = false + trafficState.Inbound.DownlinkWriterDirectCopy = false } } if !buffer.IsEmpty() { diff --git a/xray-core/transport/internet/splithttp/config.go b/xray-core/transport/internet/splithttp/config.go index f1ccc4932f..f160db318b 100644 --- a/xray-core/transport/internet/splithttp/config.go +++ b/xray-core/transport/internet/splithttp/config.go @@ -34,13 +34,12 @@ func (c *Config) GetNormalizedQuery() string { query = pathAndQuery[1] } - if query != "" { - query += "&" - } - - // query += "x_version=" + core.Version() - - query += "x_padding=" + strings.Repeat("X", int(c.GetNormalizedXPaddingBytes().From)) + /* + if query != "" { + query += "&" + } + query += "x_version=" + core.Version() + */ return query } diff --git a/xray-core/transport/internet/splithttp/hub.go b/xray-core/transport/internet/splithttp/hub.go index 1c5ace05fc..86a750f73b 100644 --- a/xray-core/transport/internet/splithttp/hub.go +++ b/xray-core/transport/internet/splithttp/hub.go @@ -3,9 +3,8 @@ package splithttp import ( "bytes" "context" - "crypto/tls" + gotls "crypto/tls" "io" - gonet "net" "net/http" "net/url" "strconv" @@ -24,7 +23,7 @@ import ( "github.com/xtls/xray-core/transport/internet" "github.com/xtls/xray-core/transport/internet/reality" "github.com/xtls/xray-core/transport/internet/stat" - v2tls "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/tls" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" ) @@ -36,7 +35,7 @@ type requestHandler struct { ln *Listener sessionMu *sync.Mutex sessions sync.Map - localAddr gonet.TCPAddr + localAddr net.Addr } type httpSession struct { @@ -144,14 +143,25 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req } forwardedAddrs := http_proto.ParseXForwardedFor(request.Header) - remoteAddr, err := gonet.ResolveTCPAddr("tcp", request.RemoteAddr) + var remoteAddr net.Addr + var err error + remoteAddr, err = net.ResolveTCPAddr("tcp", request.RemoteAddr) if err != nil { - remoteAddr = &gonet.TCPAddr{} + remoteAddr = &net.TCPAddr{ + IP: []byte{0, 0, 0, 0}, + Port: 0, + } + } + if request.ProtoMajor == 3 { + remoteAddr = &net.UDPAddr{ + IP: remoteAddr.(*net.TCPAddr).IP, + Port: remoteAddr.(*net.TCPAddr).Port, + } } if len(forwardedAddrs) > 0 && forwardedAddrs[0].Family().IsIP() { remoteAddr = &net.TCPAddr{ IP: forwardedAddrs[0].IP(), - Port: int(0), + Port: 0, } } @@ -289,6 +299,7 @@ func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Req responseFlusher: responseFlusher, }, reader: request.Body, + localAddr: h.localAddr, remoteAddr: remoteAddr, } if sessionId != "" { // if not stream-one @@ -362,34 +373,30 @@ type Listener struct { isH3 bool } -func ListenSH(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, addConn internet.ConnHandler) (internet.Listener, error) { +func ListenXH(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, addConn internet.ConnHandler) (internet.Listener, error) { l := &Listener{ addConn: addConn, } - shSettings := streamSettings.ProtocolSettings.(*Config) - l.config = shSettings + l.config = streamSettings.ProtocolSettings.(*Config) if l.config != nil { if streamSettings.SocketSettings == nil { streamSettings.SocketSettings = &internet.SocketConfig{} } } - var listener net.Listener - var err error - var localAddr = gonet.TCPAddr{} handler := &requestHandler{ - config: shSettings, - host: shSettings.Host, - path: shSettings.GetNormalizedPath(), + config: l.config, + host: l.config.Host, + path: l.config.GetNormalizedPath(), ln: l, sessionMu: &sync.Mutex{}, sessions: sync.Map{}, - localAddr: localAddr, } tlsConfig := getTLSConfig(streamSettings) l.isH3 = len(tlsConfig.NextProtos) == 1 && tlsConfig.NextProtos[0] == "h3" + var err error if port == net.Port(0) { // unix - listener, err = internet.ListenSystem(ctx, &net.UnixAddr{ + l.listener, err = internet.ListenSystem(ctx, &net.UnixAddr{ Name: address.Domain(), Net: "unix", }, streamSettings.SocketSettings) @@ -405,27 +412,24 @@ func ListenSH(ctx context.Context, address net.Address, port net.Port, streamSet if err != nil { return nil, errors.New("failed to listen UDP for XHTTP/3 on ", address, ":", port).Base(err) } - h3listener, err := quic.ListenEarly(Conn, tlsConfig, nil) + l.h3listener, err = quic.ListenEarly(Conn, tlsConfig, nil) if err != nil { return nil, errors.New("failed to listen QUIC for XHTTP/3 on ", address, ":", port).Base(err) } - l.h3listener = h3listener errors.LogInfo(ctx, "listening QUIC for XHTTP/3 on ", address, ":", port) + handler.localAddr = l.h3listener.Addr() + l.h3server = &http3.Server{ Handler: handler, } go func() { if err := l.h3server.ServeListener(l.h3listener); err != nil { - errors.LogWarningInner(ctx, err, "failed to serve HTTP/3 for XHTTP/3") + errors.LogErrorInner(ctx, err, "failed to serve HTTP/3 for XHTTP/3") } }() } else { // tcp - localAddr = gonet.TCPAddr{ - IP: address.IP(), - Port: int(port), - } - listener, err = internet.ListenSystem(ctx, &net.TCPAddr{ + l.listener, err = internet.ListenSystem(ctx, &net.TCPAddr{ IP: address.IP(), Port: int(port), }, streamSettings.SocketSettings) @@ -436,29 +440,27 @@ func ListenSH(ctx context.Context, address net.Address, port net.Port, streamSet } // tcp/unix (h1/h2) - if listener != nil { - if config := v2tls.ConfigFromStreamSettings(streamSettings); config != nil { + if l.listener != nil { + if config := tls.ConfigFromStreamSettings(streamSettings); config != nil { if tlsConfig := config.GetTLSConfig(); tlsConfig != nil { - listener = tls.NewListener(listener, tlsConfig) + l.listener = gotls.NewListener(l.listener, tlsConfig) } } - if config := reality.ConfigFromStreamSettings(streamSettings); config != nil { - listener = goreality.NewListener(listener, config.GetREALITYConfig()) + l.listener = goreality.NewListener(l.listener, config.GetREALITYConfig()) } + handler.localAddr = l.listener.Addr() + // h2cHandler can handle both plaintext HTTP/1.1 and h2c - h2cHandler := h2c.NewHandler(handler, &http2.Server{}) - l.listener = listener l.server = http.Server{ - Handler: h2cHandler, + Handler: h2c.NewHandler(handler, &http2.Server{}), ReadHeaderTimeout: time.Second * 4, MaxHeaderBytes: 8192, } - go func() { if err := l.server.Serve(l.listener); err != nil { - errors.LogWarningInner(ctx, err, "failed to serve HTTP for XHTTP") + errors.LogErrorInner(ctx, err, "failed to serve HTTP for XHTTP") } }() } @@ -488,13 +490,13 @@ func (ln *Listener) Close() error { } return errors.New("listener does not have an HTTP/3 server or a net.listener") } -func getTLSConfig(streamSettings *internet.MemoryStreamConfig) *tls.Config { - config := v2tls.ConfigFromStreamSettings(streamSettings) +func getTLSConfig(streamSettings *internet.MemoryStreamConfig) *gotls.Config { + config := tls.ConfigFromStreamSettings(streamSettings) if config == nil { - return &tls.Config{} + return &gotls.Config{} } return config.GetTLSConfig() } func init() { - common.Must(internet.RegisterTransportListener(protocolName, ListenSH)) + common.Must(internet.RegisterTransportListener(protocolName, ListenXH)) } diff --git a/xray-core/transport/internet/splithttp/splithttp_test.go b/xray-core/transport/internet/splithttp/splithttp_test.go index 20043b4a07..f566ecc48d 100644 --- a/xray-core/transport/internet/splithttp/splithttp_test.go +++ b/xray-core/transport/internet/splithttp/splithttp_test.go @@ -26,9 +26,9 @@ import ( "golang.org/x/net/http2" ) -func Test_listenSHAndDial(t *testing.T) { +func Test_ListenXHAndDial(t *testing.T) { listenPort := tcp.PickPort() - listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, &internet.MemoryStreamConfig{ + listen, err := ListenXH(context.Background(), net.LocalHostIP, listenPort, &internet.MemoryStreamConfig{ ProtocolName: "splithttp", ProtocolSettings: &Config{ Path: "/sh", @@ -85,7 +85,7 @@ func Test_listenSHAndDial(t *testing.T) { func TestDialWithRemoteAddr(t *testing.T) { listenPort := tcp.PickPort() - listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, &internet.MemoryStreamConfig{ + listen, err := ListenXH(context.Background(), net.LocalHostIP, listenPort, &internet.MemoryStreamConfig{ ProtocolName: "splithttp", ProtocolSettings: &Config{ Path: "sh", @@ -125,7 +125,7 @@ func TestDialWithRemoteAddr(t *testing.T) { common.Must(listen.Close()) } -func Test_listenSHAndDial_TLS(t *testing.T) { +func Test_ListenXHAndDial_TLS(t *testing.T) { if runtime.GOARCH == "arm64" { return } @@ -145,7 +145,7 @@ func Test_listenSHAndDial_TLS(t *testing.T) { Certificate: []*tls.Certificate{tls.ParseCertificate(cert.MustGenerate(nil, cert.CommonName("localhost")))}, }, } - listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { + listen, err := ListenXH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { go func() { defer conn.Close() @@ -180,7 +180,7 @@ func Test_listenSHAndDial_TLS(t *testing.T) { } } -func Test_listenSHAndDial_H2C(t *testing.T) { +func Test_ListenXHAndDial_H2C(t *testing.T) { if runtime.GOARCH == "arm64" { return } @@ -193,7 +193,7 @@ func Test_listenSHAndDial_H2C(t *testing.T) { Path: "shs", }, } - listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { + listen, err := ListenXH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { go func() { _ = conn.Close() }() @@ -227,7 +227,7 @@ func Test_listenSHAndDial_H2C(t *testing.T) { } } -func Test_listenSHAndDial_QUIC(t *testing.T) { +func Test_ListenXHAndDial_QUIC(t *testing.T) { if runtime.GOARCH == "arm64" { return } @@ -250,7 +250,7 @@ func Test_listenSHAndDial_QUIC(t *testing.T) { } serverClosed := false - listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { + listen, err := ListenXH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { go func() { defer conn.Close() @@ -309,11 +309,11 @@ func Test_listenSHAndDial_QUIC(t *testing.T) { } } -func Test_listenSHAndDial_Unix(t *testing.T) { +func Test_ListenXHAndDial_Unix(t *testing.T) { tempDir := t.TempDir() tempSocket := tempDir + "/server.sock" - listen, err := ListenSH(context.Background(), net.DomainAddress(tempSocket), 0, &internet.MemoryStreamConfig{ + listen, err := ListenXH(context.Background(), net.DomainAddress(tempSocket), 0, &internet.MemoryStreamConfig{ ProtocolName: "splithttp", ProtocolSettings: &Config{ Path: "/sh", @@ -373,7 +373,7 @@ func Test_listenSHAndDial_Unix(t *testing.T) { func Test_queryString(t *testing.T) { listenPort := tcp.PickPort() - listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, &internet.MemoryStreamConfig{ + listen, err := ListenXH(context.Background(), net.LocalHostIP, listenPort, &internet.MemoryStreamConfig{ ProtocolName: "splithttp", ProtocolSettings: &Config{ // this querystring does not have any effect, but sometimes people blindly copy it from websocket config. make sure the outbound doesn't break @@ -431,7 +431,7 @@ func Test_maxUpload(t *testing.T) { } var uploadSize int - listen, err := ListenSH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { + listen, err := ListenXH(context.Background(), net.LocalHostIP, listenPort, streamSettings, func(conn stat.Connection) { go func(c stat.Connection) { defer c.Close() var b [10240]byte diff --git a/xray-core/transport/internet/system_listener.go b/xray-core/transport/internet/system_listener.go index cdabd3bf38..1086aef596 100644 --- a/xray-core/transport/internet/system_listener.go +++ b/xray-core/transport/internet/system_listener.go @@ -54,7 +54,7 @@ func (l *listenUDSWrapper) Accept() (net.Conn, error) { if err != nil { return nil, err } - return &listenUDSWrapperConn{Conn: conn}, nil + return &UDSWrapperConn{Conn: conn}, nil } func (l *listenUDSWrapper) Close() error { @@ -65,11 +65,11 @@ func (l *listenUDSWrapper) Close() error { return l.Listener.Close() } -type listenUDSWrapperConn struct { +type UDSWrapperConn struct { net.Conn } -func (conn *listenUDSWrapperConn) RemoteAddr() net.Addr { +func (conn *UDSWrapperConn) RemoteAddr() net.Addr { return &net.TCPAddr{ IP: []byte{0, 0, 0, 0}, }