Update On Thu Sep 19 20:35:54 CEST 2024

This commit is contained in:
github-action[bot]
2024-09-19 20:35:54 +02:00
parent a98c03bce3
commit 0bc2f74993
432 changed files with 194477 additions and 232409 deletions

1
.github/update.log vendored
View File

@@ -768,3 +768,4 @@ Update On Sun Sep 15 20:33:53 CEST 2024
Update On Mon Sep 16 20:36:05 CEST 2024
Update On Tue Sep 17 20:34:06 CEST 2024
Update On Wed Sep 18 20:34:25 CEST 2024
Update On Thu Sep 19 20:35:43 CEST 2024

View File

@@ -1,6 +1,7 @@
package provider
import (
"encoding"
"errors"
"fmt"
"time"
@@ -10,6 +11,8 @@ import (
"github.com/metacubex/mihomo/component/resource"
C "github.com/metacubex/mihomo/constant"
types "github.com/metacubex/mihomo/constant/provider"
"github.com/dlclark/regexp2"
)
var (
@@ -28,11 +31,13 @@ type healthCheckSchema struct {
type OverrideProxyNameSchema struct {
// matching expression for regex replacement
Pattern string `provider:"pattern"`
Pattern *regexp2.Regexp `provider:"pattern"`
// the new content after regex matching
Target string `provider:"target"`
}
var _ encoding.TextUnmarshaler = (*regexp2.Regexp)(nil) // ensure *regexp2.Regexp can decode direct by structure package
type OverrideSchema struct {
TFO *bool `provider:"tfo,omitempty"`
MPTcp *bool `provider:"mptcp,omitempty"`

View File

@@ -404,18 +404,10 @@ func proxiesParseAndFilter(filter string, excludeFilter string, excludeTypeArray
name := mapping["name"].(string)
mapping["name"] = name + *field.Interface().(*string)
case "proxy-name":
exprList, ok := field.Interface().([]OverrideProxyNameSchema)
if !ok {
return nil, fmt.Errorf("can't parse proxy-provider override proxy-name, please see the docs example config")
}
// Iterate through all naming replacement rules and perform the replacements.
for _, expr := range exprList {
for _, expr := range override.ProxyName {
name := mapping["name"].(string)
nameReg, err := regexp2.Compile(expr.Pattern, regexp2.None)
if err != nil {
return nil, fmt.Errorf("parse proxy name regular expression %q error: %w", expr.Pattern, err)
}
newName, err := nameReg.Replace(name, expr.Target, 0, -1)
newName, err := expr.Pattern.Replace(name, expr.Target, 0, -1)
if err != nil {
return nil, fmt.Errorf("proxy name replace error: %w", err)
}

View File

@@ -3,6 +3,7 @@ package structure
// references: https://github.com/mitchellh/mapstructure
import (
"encoding"
"encoding/base64"
"fmt"
"reflect"
@@ -86,7 +87,14 @@ func (d *Decoder) Decode(src map[string]any, dst any) error {
}
func (d *Decoder) decode(name string, data any, val reflect.Value) error {
for {
kind := val.Kind()
if kind == reflect.Pointer && val.IsNil() {
val.Set(reflect.New(val.Type().Elem()))
}
if ok, err := d.decodeTextUnmarshaller(name, data, val); ok {
return err
}
switch {
case isInt(kind):
return d.decodeInt(name, data, val)
@@ -97,10 +105,8 @@ func (d *Decoder) decode(name string, data any, val reflect.Value) error {
}
switch kind {
case reflect.Pointer:
if val.IsNil() {
val.Set(reflect.New(val.Type().Elem()))
}
return d.decode(name, data, val.Elem())
val = val.Elem()
continue
case reflect.String:
return d.decodeString(name, data, val)
case reflect.Bool:
@@ -117,6 +123,7 @@ func (d *Decoder) decode(name string, data any, val reflect.Value) error {
return fmt.Errorf("type %s not support", val.Kind().String())
}
}
}
func isInt(kind reflect.Kind) bool {
switch kind {
@@ -553,3 +560,25 @@ func (d *Decoder) setInterface(name string, data any, val reflect.Value) (err er
val.Set(dataVal)
return nil
}
func (d *Decoder) decodeTextUnmarshaller(name string, data any, val reflect.Value) (bool, error) {
if !val.CanAddr() {
return false, nil
}
valAddr := val.Addr()
if !valAddr.CanInterface() {
return false, nil
}
unmarshaller, ok := valAddr.Interface().(encoding.TextUnmarshaler)
if !ok {
return false, nil
}
var str string
if err := d.decodeString(name, data, reflect.Indirect(reflect.ValueOf(&str))); err != nil {
return false, err
}
if err := unmarshaller.UnmarshalText([]byte(str)); err != nil {
return true, fmt.Errorf("cannot parse '%s' as %s: %s", name, val.Type(), err)
}
return true, nil
}

View File

@@ -1,6 +1,7 @@
package structure
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
@@ -179,3 +180,90 @@ func TestStructure_SliceNilValueComplex(t *testing.T) {
err = decoder.Decode(rawMap, ss)
assert.NotNil(t, err)
}
func TestStructure_SliceCap(t *testing.T) {
rawMap := map[string]any{
"foo": []string{},
}
s := &struct {
Foo []string `test:"foo,omitempty"`
Bar []string `test:"bar,omitempty"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.NotNil(t, s.Foo) // structure's Decode will ensure value not nil when input has value even it was set an empty array
assert.Nil(t, s.Bar)
}
func TestStructure_Base64(t *testing.T) {
rawMap := map[string]any{
"foo": "AQID",
}
s := &struct {
Foo []byte `test:"foo"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.Equal(t, []byte{1, 2, 3}, s.Foo)
}
func TestStructure_Pointer(t *testing.T) {
rawMap := map[string]any{
"foo": "foo",
}
s := &struct {
Foo *string `test:"foo,omitempty"`
Bar *string `test:"bar,omitempty"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.NotNil(t, s.Foo)
assert.Equal(t, "foo", *s.Foo)
assert.Nil(t, s.Bar)
}
type num struct {
a int
}
func (n *num) UnmarshalText(text []byte) (err error) {
n.a, err = strconv.Atoi(string(text))
return
}
func TestStructure_TextUnmarshaller(t *testing.T) {
rawMap := map[string]any{
"num": "255",
"num_p": "127",
}
s := &struct {
Num num `test:"num"`
NumP *num `test:"num_p"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.Equal(t, 255, s.Num.a)
assert.NotNil(t, s.NumP)
assert.Equal(t, s.NumP.a, 127)
// test WeaklyTypedInput
rawMap["num"] = 256
err = decoder.Decode(rawMap, s)
assert.NotNilf(t, err, "should throw error: %#v", s)
err = weakTypeDecoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.Equal(t, 256, s.Num.a)
// test invalid input
rawMap["num_p"] = "abc"
err = decoder.Decode(rawMap, s)
assert.NotNilf(t, err, "should throw error: %#v", s)
}

View File

@@ -3,6 +3,7 @@ package constant
import (
"encoding/json"
"errors"
"strings"
)
// DNSModeMapping is a mapping for EnhancedMode enum
@@ -27,7 +28,7 @@ func (e *DNSMode) UnmarshalYAML(unmarshal func(any) error) error {
if err := unmarshal(&tp); err != nil {
return err
}
mode, exist := DNSModeMapping[tp]
mode, exist := DNSModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -46,7 +47,7 @@ func (e *DNSMode) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(data, &tp); err != nil {
return err
}
mode, exist := DNSModeMapping[tp]
mode, exist := DNSModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -59,6 +60,21 @@ func (e DNSMode) MarshalJSON() ([]byte, error) {
return json.Marshal(e.String())
}
// UnmarshalText unserialize EnhancedMode
func (e *DNSMode) UnmarshalText(data []byte) error {
mode, exist := DNSModeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}
*e = mode
return nil
}
// MarshalText serialize EnhancedMode
func (e DNSMode) MarshalText() ([]byte, error) {
return []byte(e.String()), nil
}
func (e DNSMode) String() string {
switch e {
case DNSNormal:
@@ -150,7 +166,7 @@ func (e *FilterMode) UnmarshalYAML(unmarshal func(interface{}) error) error {
if err := unmarshal(&tp); err != nil {
return err
}
mode, exist := FilterModeMapping[tp]
mode, exist := FilterModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -167,7 +183,20 @@ func (e *FilterMode) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(data, &tp); err != nil {
return err
}
mode, exist := FilterModeMapping[tp]
mode, exist := FilterModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*e = mode
return nil
}
func (e FilterMode) MarshalText() ([]byte, error) {
return []byte(e.String()), nil
}
func (e *FilterMode) UnmarshalText(data []byte) error {
mode, exist := FilterModeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}

View File

@@ -56,6 +56,21 @@ func (e TUNStack) MarshalJSON() ([]byte, error) {
return json.Marshal(e.String())
}
// UnmarshalText unserialize TUNStack
func (e *TUNStack) UnmarshalText(data []byte) error {
mode, exist := StackTypeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid tun stack")
}
*e = mode
return nil
}
// MarshalText serialize TUNStack with json
func (e TUNStack) MarshalText() ([]byte, error) {
return []byte(e.String()), nil
}
func (e TUNStack) String() string {
switch e {
case TunGvisor:

View File

@@ -3,6 +3,7 @@ package log
import (
"encoding/json"
"errors"
"strings"
)
// LogLevelMapping is a mapping for LogLevel enum
@@ -28,7 +29,7 @@ type LogLevel int
func (l *LogLevel) UnmarshalYAML(unmarshal func(any) error) error {
var tp string
unmarshal(&tp)
level, exist := LogLevelMapping[tp]
level, exist := LogLevelMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -40,7 +41,7 @@ func (l *LogLevel) UnmarshalYAML(unmarshal func(any) error) error {
func (l *LogLevel) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
level, exist := LogLevelMapping[tp]
level, exist := LogLevelMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -48,9 +49,14 @@ func (l *LogLevel) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON serialize LogLevel with json
func (l LogLevel) MarshalJSON() ([]byte, error) {
return json.Marshal(l.String())
// UnmarshalText unserialize LogLevel
func (l *LogLevel) UnmarshalText(data []byte) error {
level, exist := LogLevelMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}
*l = level
return nil
}
// MarshalYAML serialize LogLevel with yaml
@@ -58,6 +64,16 @@ func (l LogLevel) MarshalYAML() (any, error) {
return l.String(), nil
}
// MarshalJSON serialize LogLevel with json
func (l LogLevel) MarshalJSON() ([]byte, error) {
return json.Marshal(l.String())
}
// MarshalText serialize LogLevel
func (l LogLevel) MarshalText() ([]byte, error) {
return []byte(l.String()), nil
}
func (l LogLevel) String() string {
switch l {
case INFO:

View File

@@ -21,18 +21,6 @@ const (
Direct
)
// UnmarshalJSON unserialize Mode
func (m *TunnelMode) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
mode, exist := ModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*m = mode
return nil
}
// UnmarshalYAML unserialize Mode with yaml
func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error {
var tp string
@@ -45,9 +33,26 @@ func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error {
return nil
}
// MarshalJSON serialize Mode
func (m TunnelMode) MarshalJSON() ([]byte, error) {
return json.Marshal(m.String())
// UnmarshalJSON unserialize Mode
func (m *TunnelMode) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
mode, exist := ModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*m = mode
return nil
}
// UnmarshalText unserialize Mode
func (m *TunnelMode) UnmarshalText(data []byte) error {
mode, exist := ModeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}
*m = mode
return nil
}
// MarshalYAML serialize TunnelMode with yaml
@@ -55,6 +60,16 @@ func (m TunnelMode) MarshalYAML() (any, error) {
return m.String(), nil
}
// MarshalJSON serialize Mode
func (m TunnelMode) MarshalJSON() ([]byte, error) {
return json.Marshal(m.String())
}
// MarshalText serialize Mode
func (m TunnelMode) MarshalText() ([]byte, error) {
return []byte(m.String()), nil
}
func (m TunnelMode) String() string {
switch m {
case Global:

View File

@@ -22,18 +22,6 @@ const (
Running
)
// UnmarshalJSON unserialize Status
func (s *TunnelStatus) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
status, exist := StatusMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*s = status
return nil
}
// UnmarshalYAML unserialize Status with yaml
func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error {
var tp string
@@ -46,9 +34,26 @@ func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error {
return nil
}
// MarshalJSON serialize Status
func (s TunnelStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(s.String())
// UnmarshalJSON unserialize Status
func (s *TunnelStatus) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
status, exist := StatusMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid status")
}
*s = status
return nil
}
// UnmarshalText unserialize Status
func (s *TunnelStatus) UnmarshalText(data []byte) error {
status, exist := StatusMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid status")
}
*s = status
return nil
}
// MarshalYAML serialize TunnelMode with yaml
@@ -56,6 +61,16 @@ func (s TunnelStatus) MarshalYAML() (any, error) {
return s.String(), nil
}
// MarshalJSON serialize Status
func (s TunnelStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(s.String())
}
// MarshalText serialize Status
func (s TunnelStatus) MarshalText() ([]byte, error) {
return []byte(s.String()), nil
}
func (s TunnelStatus) String() string {
switch s {
case Suspend:

View File

@@ -189,7 +189,7 @@ checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4"
dependencies = [
"clipboard-win",
"core-graphics 0.23.2",
"image 0.25.2",
"image",
"log",
"objc2",
"objc2-app-kit",
@@ -245,6 +245,27 @@ dependencies = [
"zbus",
]
[[package]]
name = "ashpd"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfe7e0dd0ac5a401dc116ed9f9119cf9decc625600474cb41f0fc0a0050abc9a"
dependencies = [
"enumflags2",
"futures-channel",
"futures-util",
"rand 0.8.5",
"raw-window-handle",
"serde",
"serde_repr",
"tokio",
"url",
"wayland-backend",
"wayland-client",
"wayland-protocols 0.32.4",
"zbus",
]
[[package]]
name = "assert-unchecked"
version = "0.1.2"
@@ -696,7 +717,7 @@ dependencies = [
"bitflags 2.6.0",
"cexpr",
"clang-sys",
"itertools 0.11.0",
"itertools 0.12.1",
"lazy_static",
"lazycell",
"log",
@@ -1129,9 +1150,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.19"
version = "1.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800"
checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0"
dependencies = [
"jobserver",
"libc",
@@ -1302,7 +1323,7 @@ dependencies = [
"glob",
"hex",
"humansize",
"image 0.25.2",
"image",
"indexmap 2.5.0",
"log",
"md-5",
@@ -1331,7 +1352,7 @@ dependencies = [
"regex",
"relative-path",
"reqwest",
"rfd",
"rfd 0.14.1",
"rs-snowflake",
"runas",
"rust-i18n",
@@ -2051,7 +2072,7 @@ dependencies = [
[[package]]
name = "dirs-utils"
version = "0.1.0"
source = "git+https://github.com/LibNyanpasu/nyanpasu-utils.git#42a2e1a2b8768d3cad47344baa152964c5e9a6b4"
source = "git+https://github.com/LibNyanpasu/nyanpasu-utils.git#87ef4dd8b0d9cdbcb0ae7ee5d925dd5c277b729e"
dependencies = [
"dirs-next",
"thiserror",
@@ -3324,9 +3345,9 @@ dependencies = [
[[package]]
name = "iana-time-zone"
version = "0.1.60"
version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141"
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [
"android_system_properties",
"core-foundation-sys",
@@ -3505,24 +3526,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "image"
version = "0.24.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d"
dependencies = [
"bytemuck",
"byteorder",
"color_quant",
"exr",
"gif",
"jpeg-decoder",
"num-traits",
"png",
"qoi",
"tiff",
]
[[package]]
name = "image"
version = "0.25.2"
@@ -3864,9 +3867,6 @@ name = "jpeg-decoder"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
dependencies = [
"rayon",
]
[[package]]
name = "js-sys"
@@ -4725,7 +4725,7 @@ dependencies = [
[[package]]
name = "nyanpasu-ipc"
version = "1.0.6"
source = "git+https://github.com/LibNyanpasu/nyanpasu-service.git#ac0534a0e3f64a87566eba01f2c96e4cbd5de22f"
source = "git+https://github.com/LibNyanpasu/nyanpasu-service.git#06b52b490e1ef9fce7f798d45dff4c01faa54d5b"
dependencies = [
"anyhow",
"axum",
@@ -4750,7 +4750,7 @@ dependencies = [
[[package]]
name = "nyanpasu-utils"
version = "0.1.0"
source = "git+https://github.com/LibNyanpasu/nyanpasu-utils.git#42a2e1a2b8768d3cad47344baa152964c5e9a6b4"
source = "git+https://github.com/LibNyanpasu/nyanpasu-utils.git#87ef4dd8b0d9cdbcb0ae7ee5d925dd5c277b729e"
dependencies = [
"constcat",
"derive_builder",
@@ -4861,6 +4861,7 @@ checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"
dependencies = [
"bitflags 2.6.0",
"block2",
"dispatch",
"libc",
"objc2",
]
@@ -4919,9 +4920,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.20.0"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ea5043e58958ee56f3e15a90aee535795cd7dfd319846288d93c5b57d85cbe"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "opaque-debug"
@@ -5022,7 +5023,7 @@ dependencies = [
[[package]]
name = "os-utils"
version = "0.1.0"
source = "git+https://github.com/LibNyanpasu/nyanpasu-utils.git#42a2e1a2b8768d3cad47344baa152964c5e9a6b4"
source = "git+https://github.com/LibNyanpasu/nyanpasu-utils.git#87ef4dd8b0d9cdbcb0ae7ee5d925dd5c277b729e"
dependencies = [
"nix 0.29.0",
"shared_child",
@@ -6156,7 +6157,7 @@ version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25a73a7337fc24366edfca76ec521f51877b114e42dab584008209cca6719251"
dependencies = [
"ashpd",
"ashpd 0.8.1",
"block",
"dispatch",
"glib-sys",
@@ -6174,6 +6175,29 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "rfd"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8af382a047821a08aa6bfc09ab0d80ff48d45d8726f7cd8e44891f7cb4a4278e"
dependencies = [
"ashpd 0.9.1",
"block2",
"glib-sys",
"gobject-sys",
"gtk-sys",
"js-sys",
"log",
"objc2",
"objc2-app-kit",
"objc2-foundation",
"raw-window-handle",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"windows-sys 0.48.0",
]
[[package]]
name = "rgb"
version = "0.8.50"
@@ -6935,7 +6959,7 @@ dependencies = [
"wayland-client",
"wayland-csd-frame",
"wayland-cursor",
"wayland-protocols",
"wayland-protocols 0.31.2",
"wayland-protocols-wlr",
"wayland-scanner",
"xkeysym",
@@ -7337,7 +7361,7 @@ dependencies = [
"gtk",
"heck 0.5.0",
"http 1.1.0",
"image 0.25.2",
"image",
"jni",
"libc",
"log",
@@ -7437,9 +7461,9 @@ dependencies = [
[[package]]
name = "tauri-plugin"
version = "2.0.0-rc.11"
version = "2.0.0-rc.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d82a2adea16b8a71b7a5ad23f720bb13f8d2830b820cc1c266512314ba99bf67"
checksum = "5e3368e91a98aa55ea4e3e8ccff516bc1ed2f85872c335ec35e9b345469032e0"
dependencies = [
"anyhow",
"glob",
@@ -7455,10 +7479,10 @@ dependencies = [
[[package]]
name = "tauri-plugin-clipboard-manager"
version = "2.0.0-rc.4"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"arboard",
"image 0.24.9",
"image",
"log",
"serde",
"serde_json",
@@ -7485,11 +7509,11 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.0.0-rc.7"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"log",
"raw-window-handle",
"rfd",
"rfd 0.15.0",
"serde",
"serde_json",
"tauri",
@@ -7502,7 +7526,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.0.0-rc.5"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"anyhow",
"dunce",
@@ -7522,7 +7546,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-global-shortcut"
version = "2.0.0-rc.2"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"global-hotkey",
"log",
@@ -7536,7 +7560,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-notification"
version = "2.0.0-rc.5"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"log",
"notify-rust",
@@ -7554,7 +7578,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-os"
version = "2.0.0-rc.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"gethostname 0.5.0",
"log",
@@ -7571,7 +7595,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-process"
version = "2.0.0-rc.1"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"tauri",
"tauri-plugin",
@@ -7580,7 +7604,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-shell"
version = "2.0.0-rc.3"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"encoding_rs",
"log",
@@ -7600,7 +7624,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-updater"
version = "2.0.0-rc.3"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#5d39ddcf227a4579fe0f4027ee55b9459142944f"
source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#6bf1bd8d44bb95618590aa066e638509b014e0f9"
dependencies = [
"base64 0.22.1",
"dirs 5.0.1",
@@ -8401,9 +8425,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
[[package]]
name = "unicode-id-start"
version = "1.2.0"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc3882f69607a2ac8cc4de3ee7993d8f68bb06f2974271195065b3bd07f2edea"
checksum = "97e2a3c5fc9de285c0e805d98eba666adb4b2d9e1049ce44821ff7707cc34e91"
[[package]]
name = "unicode-ident"
@@ -8419,9 +8443,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
[[package]]
name = "unicode-normalization"
version = "0.1.23"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956"
dependencies = [
"tinyvec",
]
@@ -8787,6 +8811,18 @@ dependencies = [
"wayland-scanner",
]
[[package]]
name = "wayland-protocols"
version = "0.32.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b5755d77ae9040bb872a25026555ce4cb0ae75fd923e90d25fba07d81057de0"
dependencies = [
"bitflags 2.6.0",
"wayland-backend",
"wayland-client",
"wayland-scanner",
]
[[package]]
name = "wayland-protocols-wlr"
version = "0.2.0"
@@ -8796,7 +8832,7 @@ dependencies = [
"bitflags 2.6.0",
"wayland-backend",
"wayland-client",
"wayland-protocols",
"wayland-protocols 0.31.2",
"wayland-scanner",
]
@@ -8878,9 +8914,9 @@ dependencies = [
[[package]]
name = "webpki-roots"
version = "0.26.5"
version = "0.26.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a"
checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958"
dependencies = [
"rustls-pki-types",
]

View File

@@ -242,6 +242,7 @@ impl Tray {
.on_tray_icon_event(|tray_icon, event| {
Tray::on_system_tray_event(tray_icon, event);
})
.menu_on_left_click(false)
.build(app_handle)?
}
Some(tray) => {

View File

@@ -444,7 +444,7 @@ mod platform_impl {
}).map(|item| item.as_check_menuitem_unchecked().clone())
}
let from_item = find_check_item(&menu, actions[0].0.clone(), actions[0].1.clone());
let from_item = find_check_item(&menu, action.0.clone(), action.1.clone());
match from_item {
Some(item) => {
let _ = item.set_checked(false);
@@ -452,12 +452,12 @@ mod platform_impl {
None => {
warn!(
"failed to deselect, item not found: {} {}",
actions[0].0, actions[0].1
action.0, action.1
);
}
}
let to_item = find_check_item(&menu, actions[0].0.clone(), actions[0].2.clone());
let to_item = find_check_item(&menu, action.0.clone(), action.2.clone());
match to_item {
Some(item) => {
let _ = item.set_checked(true);
@@ -465,13 +465,12 @@ mod platform_impl {
None => {
warn!(
"failed to select, item not found: {} {}",
actions[0].0, actions[0].2
action.0, action.2
);
}
}
TRAY_ITEM_UPDATE_BARRIER.store(false, std::sync::atomic::Ordering::Release);
}
TRAY_ITEM_UPDATE_BARRIER.store(false, std::sync::atomic::Ordering::Release);
}
}

View File

@@ -140,6 +140,7 @@ pub async fn enhance() -> (Mapping, Vec<String>, IndexMap<String, Logs>) {
config = use_filter(config, &clash_fields, enable_filter);
config = use_tun(config, enable_tun);
config = use_cache(config);
config = use_sort(config, enable_filter);
let mut exists_set = HashSet::new();
@@ -148,3 +149,13 @@ pub async fn enhance() -> (Mapping, Vec<String>, IndexMap<String, Logs>) {
(config, exists_keys, result_map)
}
fn use_cache(mut config: Mapping) -> Mapping {
if !config.contains_key("profile") {
let mut profile = Mapping::new();
profile.insert("store-selected".into(), true.into());
profile.insert("store-fake-ip".into(), true.into());
config.insert("profile".into(), profile.into());
}
config
}

View File

@@ -18,6 +18,6 @@
"swr": "2.2.5"
},
"devDependencies": {
"@types/react": "18.3.5"
"@types/react": "18.3.7"
}
}

View File

@@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"build": "vite build",
"bundle:visualize": "vite-bundle-visualizer",
"dev": "vite",
"serve": "vite preview"
},
@@ -15,12 +16,12 @@
"@emotion/styled": "11.13.0",
"@juggle/resize-observer": "3.4.0",
"@material/material-color-utilities": "0.3.0",
"@mui/icons-material": "6.1.0",
"@mui/lab": "6.0.0-beta.9",
"@mui/material": "6.1.0",
"@mui/icons-material": "6.1.1",
"@mui/lab": "6.0.0-beta.10",
"@mui/material": "6.1.1",
"@nyanpasu/interface": "workspace:^",
"@nyanpasu/ui": "workspace:^",
"@tanstack/router-zod-adapter": "1.57.18",
"@tanstack/router-zod-adapter": "1.58.3",
"@tauri-apps/api": "2.0.0-rc.5",
"@types/json-schema": "7.0.15",
"ahooks": "3.8.1",
@@ -45,7 +46,8 @@
"react-split-grid": "1.0.4",
"react-use": "17.5.1",
"swr": "2.2.5",
"virtua": "0.34.2"
"virtua": "0.34.2",
"vite-bundle-visualizer": "1.2.1"
},
"devDependencies": {
"@csstools/normalize.css": "12.1.1",
@@ -53,9 +55,9 @@
"@emotion/react": "11.13.3",
"@iconify/json": "2.2.250",
"@monaco-editor/react": "4.6.0",
"@tanstack/react-router": "1.57.18",
"@tanstack/router-devtools": "1.57.18",
"@tanstack/router-plugin": "1.57.15",
"@tanstack/react-router": "1.58.3",
"@tanstack/router-devtools": "1.58.3",
"@tanstack/router-plugin": "1.58.4",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-rc.2",
"@tauri-apps/plugin-dialog": "2.0.0-rc.1",
"@tauri-apps/plugin-fs": "2.0.0-rc.2",
@@ -64,9 +66,9 @@
"@tauri-apps/plugin-process": "2.0.0-rc.1",
"@tauri-apps/plugin-shell": "2.0.0-rc.1",
"@tauri-apps/plugin-updater": "2.0.0-rc.2",
"@types/react": "18.3.5",
"@types/react": "18.3.7",
"@types/react-dom": "18.3.0",
"@types/validator": "^13.12.1",
"@types/validator": "13.12.2",
"@vitejs/plugin-react": "4.3.1",
"@vitejs/plugin-react-swc": "3.7.0",
"clsx": "2.1.1",

View File

@@ -5,7 +5,7 @@ import {
useMaterialReactTable,
type MRT_ColumnDef,
} from "material-react-table";
import { useMemo, useRef } from "react";
import { useDeferredValue, useMemo, useRef } from "react";
import { useTranslation } from "react-i18next";
import { containsSearchTerm } from "@/utils";
import parseTraffic from "@/utils/parse-traffic";
@@ -77,6 +77,7 @@ export const ConnectionsTable = ({ searchTerm }: { searchTerm?: string }) => {
return data;
}, [latestMessage?.data, searchTerm]);
const deferredTableData = useDeferredValue(connectionsMessage?.connections);
const columns: MRT_ColumnDef<TableConnection>[] = [
{
@@ -165,7 +166,7 @@ export const ConnectionsTable = ({ searchTerm }: { searchTerm?: string }) => {
const table = useMaterialReactTable({
columns,
data: connectionsMessage?.connections ?? [],
data: deferredTableData ?? [],
initialState: {
density: "compact",
},

View File

@@ -6,7 +6,7 @@ import OpenInNewRounded from "@mui/icons-material/OpenInNewRounded";
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
import IconButton from "@mui/material/IconButton";
import Paper from "@mui/material/Paper";
import Paper, { PaperProps } from "@mui/material/Paper";
import { alpha, styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import { openThat } from "@nyanpasu/interface";
@@ -120,14 +120,14 @@ export const openWebUrl = (
* @author keiko233 <i@elaina.moe>
* @copyright LibNyanpasu org. 2024
*/
export const Item = styled(Paper)(({ theme }) => ({
export const Item = styled(Paper)<PaperProps>(({ theme }) => ({
backgroundColor: alpha(theme.palette.primary.main, 0.1),
padding: 16,
borderRadius: 16,
display: "flex",
flexDirection: "column",
gap: 8,
}));
})) as typeof Paper;
export interface ClashWebItemProps {
label: ReactNode;

View File

@@ -16,11 +16,11 @@ const HOTKEY_FUNC = [
"clash_mode_direct",
"clash_mode_script",
"toggle_system_proxy",
"enable_system_proxy",
"disable_system_proxy",
// "enable_system_proxy",
// "disable_system_proxy",
"toggle_tun_mode",
"enable_tun_mode",
"disable_tun_mode",
// "enable_tun_mode",
// "disable_tun_mode",
];
export default function HotkeyDialog({

View File

@@ -4,7 +4,7 @@ import {
Outlet,
} from "@tanstack/react-router";
export const Catch = ({ error }: ErrorComponentProps) => {
const Catch = ({ error }: ErrorComponentProps) => {
return (
<div style={{ backgroundColor: "#fff" }}>
<h1>Oops!</h1>
@@ -14,7 +14,7 @@ export const Catch = ({ error }: ErrorComponentProps) => {
);
};
export const Pending = () => <div>Loading from _layout...</div>;
const Pending = () => <div>Loading from _layout...</div>;
export const Route = createFileRoute("/_layout")({
component: Layout,
@@ -22,6 +22,6 @@ export const Route = createFileRoute("/_layout")({
pendingComponent: Pending,
});
export default function Layout() {
function Layout() {
return <Outlet />;
}

View File

@@ -1,10 +1,10 @@
import { useThrottle } from "ahooks";
import { lazy, useState } from "react";
import { lazy, useDeferredValue, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { SearchTermCtx } from "@/components/connections/connection-search-term";
import HeaderSearch from "@/components/connections/header-search";
import { BasePage } from "@nyanpasu/ui";
import { createFileRoute } from "@tanstack/react-router";
import { createFileRoute, useBlocker } from "@tanstack/react-router";
const Component = lazy(
() => import("@/components/connections/connection-page"),
@@ -14,13 +14,25 @@ export const Route = createFileRoute("/connections")({
component: Connections,
});
export default function Connections() {
function Connections() {
const { t } = useTranslation();
const [searchTerm, setSearchTerm] = useState<string>();
const throttledSearchTerm = useThrottle(searchTerm, { wait: 150 });
const [mountTable, setMountTable] = useState(true);
const deferredMountTable = useDeferredValue(mountTable);
const { proceed } = useBlocker({
blockerFn: () => setMountTable(false),
condition: !mountTable,
});
useEffect(() => {
if (!deferredMountTable) {
proceed();
}
}, [proceed, deferredMountTable]);
return (
<SearchTermCtx.Provider value={throttledSearchTerm}>
<BasePage
@@ -35,7 +47,7 @@ export default function Connections() {
</div>
}
>
<Component />
{mountTable && <Component />}
</BasePage>
</SearchTermCtx.Provider>
);

View File

@@ -11,7 +11,7 @@ export const Route = createFileRoute("/dashboard")({
component: Dashboard,
});
export default function Dashboard() {
function Dashboard() {
const { t } = useTranslation();
return (

View File

@@ -7,7 +7,7 @@ export const Route = createFileRoute("/")({
component: IndexPage,
});
export default function IndexPage() {
function IndexPage() {
const navigate = useNavigate();
const memorizedNavigate = useAtomValue(memorizedRoutePathAtom);
useEffect(() => {

View File

@@ -8,7 +8,7 @@ export const Route = createFileRoute("/logs")({
component: LogPage,
});
export default function LogPage() {
function LogPage() {
const { t } = useTranslation();
const viewportRef = useRef<HTMLDivElement>(null);

View File

@@ -1,3 +1,4 @@
import MdiTextBoxCheckOutline from "~icons/mdi/text-box-check-outline";
import { AnimatePresence, motion } from "framer-motion";
import { useAtom } from "jotai";
import { useMemo, useState } from "react";
@@ -37,7 +38,7 @@ export const Route = createFileRoute("/profiles")({
component: ProfilePage,
});
export default function ProfilePage() {
function ProfilePage() {
const { t } = useTranslation();
const { getProfiles, getRuntimeLogs } = useClash();
const maxLogLevelTriggered = useMemo(() => {
@@ -136,7 +137,7 @@ export default function ProfilePage() {
setRuntimeConfigViewerOpen(true);
}}
>
<IconMdiTextBoxCheckOutline
<MdiTextBoxCheckOutline
// style={{
// color: theme.palette.text.primary,
// }}

View File

@@ -13,7 +13,7 @@ export const Route = createFileRoute("/providers")({
component: ProvidersPage,
});
export default function ProvidersPage() {
function ProvidersPage() {
const { t } = useTranslation();
const { getRulesProviders, getProxiesProviders } = useClashCore();

View File

@@ -62,7 +62,7 @@ function SideBar() {
);
}
export default function ProxyPage() {
function ProxyPage() {
const { t } = useTranslation();
const { getCurrentMode, setCurrentMode } = useNyanpasu();

View File

@@ -12,7 +12,7 @@ export const Route = createFileRoute("/rules")({
component: RulesPage,
});
export default function RulesPage() {
function RulesPage() {
const { t } = useTranslation();
const { palette } = useTheme();

View File

@@ -82,7 +82,7 @@ const TrayIconButton = () => {
);
};
export default function SettingPage() {
function SettingPage() {
const { t } = useTranslation();
const Component = lazy(() => import("@/components/setting/setting-page"));

View File

@@ -10,240 +10,240 @@
// Import Routes
import { Route as rootRoute } from "./pages/__root";
import { Route as LayoutImport } from "./pages/_layout";
import { Route as ConnectionsImport } from "./pages/connections";
import { Route as DashboardImport } from "./pages/dashboard";
import { Route as IndexImport } from "./pages/index";
import { Route as LogsImport } from "./pages/logs";
import { Route as ProfilesImport } from "./pages/profiles";
import { Route as ProvidersImport } from "./pages/providers";
import { Route as ProxiesImport } from "./pages/proxies";
import { Route as RulesImport } from "./pages/rules";
import { Route as SettingsImport } from "./pages/settings";
import { Route as rootRoute } from './pages/__root'
import { Route as SettingsImport } from './pages/settings'
import { Route as RulesImport } from './pages/rules'
import { Route as ProxiesImport } from './pages/proxies'
import { Route as ProvidersImport } from './pages/providers'
import { Route as ProfilesImport } from './pages/profiles'
import { Route as LogsImport } from './pages/logs'
import { Route as DashboardImport } from './pages/dashboard'
import { Route as ConnectionsImport } from './pages/connections'
import { Route as LayoutImport } from './pages/_layout'
import { Route as IndexImport } from './pages/index'
// Create/Update Routes
const SettingsRoute = SettingsImport.update({
path: "/settings",
path: '/settings',
getParentRoute: () => rootRoute,
} as any);
} as any)
const RulesRoute = RulesImport.update({
path: "/rules",
path: '/rules',
getParentRoute: () => rootRoute,
} as any);
} as any)
const ProxiesRoute = ProxiesImport.update({
path: "/proxies",
path: '/proxies',
getParentRoute: () => rootRoute,
} as any);
} as any)
const ProvidersRoute = ProvidersImport.update({
path: "/providers",
path: '/providers',
getParentRoute: () => rootRoute,
} as any);
} as any)
const ProfilesRoute = ProfilesImport.update({
path: "/profiles",
path: '/profiles',
getParentRoute: () => rootRoute,
} as any);
} as any)
const LogsRoute = LogsImport.update({
path: "/logs",
path: '/logs',
getParentRoute: () => rootRoute,
} as any);
} as any)
const DashboardRoute = DashboardImport.update({
path: "/dashboard",
path: '/dashboard',
getParentRoute: () => rootRoute,
} as any);
} as any)
const ConnectionsRoute = ConnectionsImport.update({
path: "/connections",
path: '/connections',
getParentRoute: () => rootRoute,
} as any);
} as any)
const LayoutRoute = LayoutImport.update({
id: "/_layout",
id: '/_layout',
getParentRoute: () => rootRoute,
} as any);
} as any)
const IndexRoute = IndexImport.update({
path: "/",
path: '/',
getParentRoute: () => rootRoute,
} as any);
} as any)
// Populate the FileRoutesByPath interface
declare module "@tanstack/react-router" {
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
"/": {
id: "/";
path: "/";
fullPath: "/";
preLoaderRoute: typeof IndexImport;
parentRoute: typeof rootRoute;
};
"/_layout": {
id: "/_layout";
path: "";
fullPath: "";
preLoaderRoute: typeof LayoutImport;
parentRoute: typeof rootRoute;
};
"/connections": {
id: "/connections";
path: "/connections";
fullPath: "/connections";
preLoaderRoute: typeof ConnectionsImport;
parentRoute: typeof rootRoute;
};
"/dashboard": {
id: "/dashboard";
path: "/dashboard";
fullPath: "/dashboard";
preLoaderRoute: typeof DashboardImport;
parentRoute: typeof rootRoute;
};
"/logs": {
id: "/logs";
path: "/logs";
fullPath: "/logs";
preLoaderRoute: typeof LogsImport;
parentRoute: typeof rootRoute;
};
"/profiles": {
id: "/profiles";
path: "/profiles";
fullPath: "/profiles";
preLoaderRoute: typeof ProfilesImport;
parentRoute: typeof rootRoute;
};
"/providers": {
id: "/providers";
path: "/providers";
fullPath: "/providers";
preLoaderRoute: typeof ProvidersImport;
parentRoute: typeof rootRoute;
};
"/proxies": {
id: "/proxies";
path: "/proxies";
fullPath: "/proxies";
preLoaderRoute: typeof ProxiesImport;
parentRoute: typeof rootRoute;
};
"/rules": {
id: "/rules";
path: "/rules";
fullPath: "/rules";
preLoaderRoute: typeof RulesImport;
parentRoute: typeof rootRoute;
};
"/settings": {
id: "/settings";
path: "/settings";
fullPath: "/settings";
preLoaderRoute: typeof SettingsImport;
parentRoute: typeof rootRoute;
};
'/': {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
'/_layout': {
id: '/_layout'
path: ''
fullPath: ''
preLoaderRoute: typeof LayoutImport
parentRoute: typeof rootRoute
}
'/connections': {
id: '/connections'
path: '/connections'
fullPath: '/connections'
preLoaderRoute: typeof ConnectionsImport
parentRoute: typeof rootRoute
}
'/dashboard': {
id: '/dashboard'
path: '/dashboard'
fullPath: '/dashboard'
preLoaderRoute: typeof DashboardImport
parentRoute: typeof rootRoute
}
'/logs': {
id: '/logs'
path: '/logs'
fullPath: '/logs'
preLoaderRoute: typeof LogsImport
parentRoute: typeof rootRoute
}
'/profiles': {
id: '/profiles'
path: '/profiles'
fullPath: '/profiles'
preLoaderRoute: typeof ProfilesImport
parentRoute: typeof rootRoute
}
'/providers': {
id: '/providers'
path: '/providers'
fullPath: '/providers'
preLoaderRoute: typeof ProvidersImport
parentRoute: typeof rootRoute
}
'/proxies': {
id: '/proxies'
path: '/proxies'
fullPath: '/proxies'
preLoaderRoute: typeof ProxiesImport
parentRoute: typeof rootRoute
}
'/rules': {
id: '/rules'
path: '/rules'
fullPath: '/rules'
preLoaderRoute: typeof RulesImport
parentRoute: typeof rootRoute
}
'/settings': {
id: '/settings'
path: '/settings'
fullPath: '/settings'
preLoaderRoute: typeof SettingsImport
parentRoute: typeof rootRoute
}
}
}
// Create and export the route tree
export interface FileRoutesByFullPath {
"/": typeof IndexRoute;
"": typeof LayoutRoute;
"/connections": typeof ConnectionsRoute;
"/dashboard": typeof DashboardRoute;
"/logs": typeof LogsRoute;
"/profiles": typeof ProfilesRoute;
"/providers": typeof ProvidersRoute;
"/proxies": typeof ProxiesRoute;
"/rules": typeof RulesRoute;
"/settings": typeof SettingsRoute;
'/': typeof IndexRoute
'': typeof LayoutRoute
'/connections': typeof ConnectionsRoute
'/dashboard': typeof DashboardRoute
'/logs': typeof LogsRoute
'/profiles': typeof ProfilesRoute
'/providers': typeof ProvidersRoute
'/proxies': typeof ProxiesRoute
'/rules': typeof RulesRoute
'/settings': typeof SettingsRoute
}
export interface FileRoutesByTo {
"/": typeof IndexRoute;
"": typeof LayoutRoute;
"/connections": typeof ConnectionsRoute;
"/dashboard": typeof DashboardRoute;
"/logs": typeof LogsRoute;
"/profiles": typeof ProfilesRoute;
"/providers": typeof ProvidersRoute;
"/proxies": typeof ProxiesRoute;
"/rules": typeof RulesRoute;
"/settings": typeof SettingsRoute;
'/': typeof IndexRoute
'': typeof LayoutRoute
'/connections': typeof ConnectionsRoute
'/dashboard': typeof DashboardRoute
'/logs': typeof LogsRoute
'/profiles': typeof ProfilesRoute
'/providers': typeof ProvidersRoute
'/proxies': typeof ProxiesRoute
'/rules': typeof RulesRoute
'/settings': typeof SettingsRoute
}
export interface FileRoutesById {
__root__: typeof rootRoute;
"/": typeof IndexRoute;
"/_layout": typeof LayoutRoute;
"/connections": typeof ConnectionsRoute;
"/dashboard": typeof DashboardRoute;
"/logs": typeof LogsRoute;
"/profiles": typeof ProfilesRoute;
"/providers": typeof ProvidersRoute;
"/proxies": typeof ProxiesRoute;
"/rules": typeof RulesRoute;
"/settings": typeof SettingsRoute;
__root__: typeof rootRoute
'/': typeof IndexRoute
'/_layout': typeof LayoutRoute
'/connections': typeof ConnectionsRoute
'/dashboard': typeof DashboardRoute
'/logs': typeof LogsRoute
'/profiles': typeof ProfilesRoute
'/providers': typeof ProvidersRoute
'/proxies': typeof ProxiesRoute
'/rules': typeof RulesRoute
'/settings': typeof SettingsRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath;
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths:
| "/"
| ""
| "/connections"
| "/dashboard"
| "/logs"
| "/profiles"
| "/providers"
| "/proxies"
| "/rules"
| "/settings";
fileRoutesByTo: FileRoutesByTo;
| '/'
| ''
| '/connections'
| '/dashboard'
| '/logs'
| '/profiles'
| '/providers'
| '/proxies'
| '/rules'
| '/settings'
fileRoutesByTo: FileRoutesByTo
to:
| "/"
| ""
| "/connections"
| "/dashboard"
| "/logs"
| "/profiles"
| "/providers"
| "/proxies"
| "/rules"
| "/settings";
| '/'
| ''
| '/connections'
| '/dashboard'
| '/logs'
| '/profiles'
| '/providers'
| '/proxies'
| '/rules'
| '/settings'
id:
| "__root__"
| "/"
| "/_layout"
| "/connections"
| "/dashboard"
| "/logs"
| "/profiles"
| "/providers"
| "/proxies"
| "/rules"
| "/settings";
fileRoutesById: FileRoutesById;
| '__root__'
| '/'
| '/_layout'
| '/connections'
| '/dashboard'
| '/logs'
| '/profiles'
| '/providers'
| '/proxies'
| '/rules'
| '/settings'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute;
LayoutRoute: typeof LayoutRoute;
ConnectionsRoute: typeof ConnectionsRoute;
DashboardRoute: typeof DashboardRoute;
LogsRoute: typeof LogsRoute;
ProfilesRoute: typeof ProfilesRoute;
ProvidersRoute: typeof ProvidersRoute;
ProxiesRoute: typeof ProxiesRoute;
RulesRoute: typeof RulesRoute;
SettingsRoute: typeof SettingsRoute;
IndexRoute: typeof IndexRoute
LayoutRoute: typeof LayoutRoute
ConnectionsRoute: typeof ConnectionsRoute
DashboardRoute: typeof DashboardRoute
LogsRoute: typeof LogsRoute
ProfilesRoute: typeof ProfilesRoute
ProvidersRoute: typeof ProvidersRoute
ProxiesRoute: typeof ProxiesRoute
RulesRoute: typeof RulesRoute
SettingsRoute: typeof SettingsRoute
}
const rootRouteChildren: RootRouteChildren = {
@@ -257,11 +257,11 @@ const rootRouteChildren: RootRouteChildren = {
ProxiesRoute: ProxiesRoute,
RulesRoute: RulesRoute,
SettingsRoute: SettingsRoute,
};
}
export const routeTree = rootRoute
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>();
._addFileTypes<FileRouteTypes>()
/* prettier-ignore-end */

View File

@@ -0,0 +1,5 @@
{
"routeFileIgnorePrefix": "-",
"routesDirectory": "./src/pages",
"autoCodeSplitting": true
}

View File

@@ -48,12 +48,8 @@ export default defineConfig(({ command }) => {
},
plugins: [
tsconfigPaths(),
TanStackRouterVite(),
svgr(),
TanStackRouterVite({
autoCodeSplitting: true,
routeFileIgnorePrefix: "-",
routesDirectory: "./src/pages",
}),
react({
// babel: {
// plugins: ["@emotion/babel-plugin"],

View File

@@ -17,14 +17,14 @@
},
"dependencies": {
"@material/material-color-utilities": "0.3.0",
"@mui/icons-material": "6.1.0",
"@mui/lab": "6.0.0-beta.9",
"@mui/material": "6.1.0",
"@mui/icons-material": "6.1.1",
"@mui/lab": "6.0.0-beta.10",
"@mui/material": "6.1.1",
"@radix-ui/react-portal": "1.1.1",
"@radix-ui/react-scroll-area": "1.1.0",
"@tauri-apps/api": "2.0.0-rc.5",
"@types/d3": "7.4.3",
"@types/react": "18.3.5",
"@types/react": "18.3.7",
"@vitejs/plugin-react": "4.3.1",
"ahooks": "3.8.1",
"d3": "7.9.0",

View File

@@ -2,7 +2,7 @@
"manifest_version": 1,
"latest": {
"mihomo": "v1.18.8",
"mihomo_alpha": "alpha-fb4d3c4",
"mihomo_alpha": "alpha-3676d1b",
"clash_rs": "v0.3.2",
"clash_premium": "2023-09-05-gdcc8d87"
},
@@ -52,5 +52,5 @@
"linux-armv7hf": "clash-linux-armv7-n{}.gz"
}
},
"updated_at": "2024-09-17T22:20:28.511Z"
"updated_at": "2024-09-18T22:20:35.900Z"
}

View File

@@ -17,6 +17,7 @@
"web:dev": "pnpm --filter=@nyanpasu/nyanpasu dev",
"web:build": "pnpm --filter=@nyanpasu/nyanpasu build",
"web:serve": "pnpm --filter=@nyanpasu/nyanpasu preview",
"web:visualize": "pnpm --filter=@nyanpasu/nyanpasu bundle:visualize",
"web:devtools": "pnpm react-devtools",
"lint": "run-s lint:*",
"lint:prettier": "prettier --check .",
@@ -52,37 +53,37 @@
"prepare:preview": "tsx scripts/prepare-preview.ts"
},
"dependencies": {
"husky": "9.1.5",
"husky": "9.1.6",
"lodash-es": "4.17.21"
},
"devDependencies": {
"@commitlint/cli": "19.4.1",
"@commitlint/config-conventional": "19.4.1",
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@ianvs/prettier-plugin-sort-imports": "4.3.1",
"@tauri-apps/cli": "2.0.0-rc.16",
"@types/fs-extra": "11.0.4",
"@types/lodash-es": "4.17.12",
"@types/node": "22.5.4",
"@typescript-eslint/eslint-plugin": "8.3.0",
"@typescript-eslint/parser": "8.3.0",
"@types/node": "22.5.5",
"@typescript-eslint/eslint-plugin": "8.6.0",
"@typescript-eslint/parser": "8.6.0",
"autoprefixer": "10.4.20",
"conventional-changelog-conventionalcommits": "8.0.0",
"cross-env": "7.0.3",
"dedent": "1.5.3",
"eslint": "8.57.0",
"eslint": "8.57.1",
"eslint-config-prettier": "9.1.0",
"eslint-config-standard": "17.1.0",
"eslint-import-resolver-alias": "1.1.2",
"eslint-plugin-html": "8.1.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "17.10.2",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-n": "17.10.3",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-promise": "7.1.0",
"eslint-plugin-react": "7.35.0",
"eslint-plugin-react-compiler": "0.0.0-experimental-f8a5409-20240829",
"eslint-plugin-react": "7.36.1",
"eslint-plugin-react-compiler": "0.0.0-experimental-7670337-20240918",
"eslint-plugin-react-hooks": "4.6.2",
"knip": "5.30.2",
"lint-staged": "15.2.9",
"lint-staged": "15.2.10",
"npm-run-all2": "6.2.3",
"postcss": "8.4.47",
"postcss-html": "1.7.0",
@@ -98,10 +99,10 @@
"stylelint-config-standard": "36.0.1",
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
"stylelint-order": "6.0.4",
"stylelint-scss": "6.5.1",
"stylelint-scss": "6.7.0",
"tailwindcss": "3.4.12",
"tsx": "4.19.0",
"typescript": "5.5.4"
"tsx": "4.19.1",
"typescript": "5.6.2"
},
"packageManager": "pnpm@9.10.0+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c",
"engines": {

File diff suppressed because it is too large Load Diff

View File

@@ -98,19 +98,53 @@ const repoInfo = {
}
resourceMapping.forEach((item) => {
consola.log(`exited ${item}:`, existsSync(item));
consola.log(`existed ${item}:`, existsSync(item));
});
consola.start("Staring upload tasks (nightly)");
// upload windows binary
await pRetry(
() =>
client.sendFile(TELEGRAM_TO_NIGHTLY, {
file: resourceMapping,
file: resourceMapping.filter(
(item) => item.endsWith(".exe") || item.endsWith("portable.zip"),
),
forceDocument: true,
caption: `Clash Nyanpasu Nightly Build ${GIT_SHORT_HASH}`,
caption: `Clash Nyanpasu Nightly Build ${GIT_SHORT_HASH} for Windows`,
workers: 16,
progressCallback: (...args) => {
console.log("progressCallback", args);
},
}),
{ retries: 5 },
);
// upload macOS binary
await pRetry(
() =>
client.sendFile(TELEGRAM_TO_NIGHTLY, {
file: resourceMapping.filter((item) => item.endsWith(".dmg")),
forceDocument: true,
caption: `Clash Nyanpasu Nightly Build ${GIT_SHORT_HASH} for macOS`,
workers: 16,
}),
{ retries: 5 },
);
// upload linux binary
await pRetry(
() =>
client.sendFile(TELEGRAM_TO_NIGHTLY, {
file: resourceMapping.filter(
(item) =>
item.endsWith(".rpm") ||
item.endsWith(".deb") ||
item.endsWith(".AppImage"),
),
forceDocument: true,
caption: `Clash Nyanpasu Nightly Build ${GIT_SHORT_HASH} for Linux`,
workers: 16,
progressCallback: (progress) => consola.debug(`Uploading ${progress}`),
}),
{ retries: 5 },
);

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-5.4 = .278
LINUX_KERNEL_HASH-5.4.278 = 77221ab9aebeac746915c755ec3b7d320f85cd219c63d9c501820fbca1e3b32b
LINUX_KERNEL_HASH-5.4.278 = e5a00606115545f444ef2766af5652f5539e3c96f46a9778bede89b98ffb8588

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-6.1 = .100
LINUX_KERNEL_HASH-6.1.100 = b9aa6ec1a00f234d6c6f2d428fbb0a6bf459606c259263df978f86685b65a8b9
LINUX_VERSION-6.1 = .111
LINUX_KERNEL_HASH-6.1.111 = c47298fa1d410bc5dcfb0662bc2cdbe86f5b0d12a1baac297e1ded7b6722edb0

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .51
LINUX_KERNEL_HASH-6.6.51 = 1c0c9a14650879c4913efdbac428ba31a540c3d987155ddf34d33e11eca008b3
LINUX_VERSION-6.6 = .52
LINUX_KERNEL_HASH-6.6.52 = 1591ab348399d4aa53121158525056a69c8cf0fe0e90935b0095e9a58e37b4b8

View File

@@ -1,32 +0,0 @@
From c67d90e058550403a3e6f9b05bfcdcfa12b1815c Mon Sep 17 00:00:00 2001
From: Vincent Tremblay <vincent@vtremblay.dev>
Date: Mon, 26 Dec 2022 21:35:48 -0500
Subject: [PATCH] spidev: Add Silicon Labs EM3581 device compatible
Add compatible string for Silicon Labs EM3581 device.
Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
Link: https://lore.kernel.org/r/20221227023550.569547-2-vincent@vtremblay.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/spi/spidev.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -700,6 +700,7 @@ static const struct spi_device_id spidev
{ .name = "m53cpld" },
{ .name = "spi-petra" },
{ .name = "spi-authenta" },
+ { .name = "em3581" },
{},
};
MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
@@ -726,6 +727,7 @@ static const struct of_device_id spidev_
{ .compatible = "menlo,m53cpld", .data = &spidev_of_check },
{ .compatible = "cisco,spi-petra", .data = &spidev_of_check },
{ .compatible = "micron,spi-authenta", .data = &spidev_of_check },
+ { .compatible = "silabs,em3581", .data = &spidev_of_check },
{},
};
MODULE_DEVICE_TABLE(of, spidev_dt_ids);

View File

@@ -1,33 +0,0 @@
From 30001cf3a19a2f676a0e23c2c3a511c4a8903284 Mon Sep 17 00:00:00 2001
From: Daniele Palmas <dnlplm@gmail.com>
Date: Fri, 4 Aug 2023 11:40:39 +0200
Subject: [PATCH 11/13] bus: mhi: host: pci_generic: add support for Telit
FE990 modem
Add support for Telit FE990 that has the same configuration as FN990:
$ lspci -vv
04:00.0 Unassigned class [ff00]: Qualcomm Device 0308
Subsystem: Device 1c5d:2015
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20230804094039.365102-1-dnlplm@gmail.com
[mani: minor update to commit subject and adjusted comment]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/bus/mhi/host/pci_generic.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -595,6 +595,9 @@ static const struct pci_device_id mhi_pc
/* Telit FN990 */
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2010),
.driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
+ /* Telit FE990 */
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2015),
+ .driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308),
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx65_info },
{ PCI_DEVICE(PCI_VENDOR_ID_QUECTEL, 0x1001), /* EM120R-GL (sdx24) */

View File

@@ -42,7 +42,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return of_get_child_by_name(nvmem->dev.of_node, "nvmem-layout");
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -241,7 +241,6 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -242,7 +242,6 @@ struct nvmem_cell *of_nvmem_cell_get(str
const char *id);
struct nvmem_device *of_nvmem_device_get(struct device_node *np,
const char *name);
@@ -50,7 +50,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#else
static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
const char *id)
@@ -254,12 +253,6 @@ static inline struct nvmem_device *of_nv
@@ -255,12 +254,6 @@ static inline struct nvmem_device *of_nv
{
return ERR_PTR(-EOPNOTSUPP);
}

View File

@@ -330,7 +330,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
EXPORT_SYMBOL_GPL(nvmem_cell_put);
@@ -2103,11 +2044,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_name);
@@ -2116,11 +2057,22 @@ EXPORT_SYMBOL_GPL(nvmem_dev_size);
static int __init nvmem_init(void)
{

View File

@@ -1,53 +0,0 @@
From 33cf42e68efc8ff529a7eee08a4f0ba8c8d0a207 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Thu, 21 Dec 2023 18:34:17 +0100
Subject: [PATCH] nvmem: core: add nvmem_dev_size() helper
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is required by layouts that need to read whole NVMEM content. It's
especially useful for NVMEM devices without hardcoded layout (like
U-Boot environment data block).
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20231221173421.13737-2-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvmem/core.c | 13 +++++++++++++
include/linux/nvmem-consumer.h | 1 +
2 files changed, 14 insertions(+)
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -2162,6 +2162,19 @@ const char *nvmem_dev_name(struct nvmem_
}
EXPORT_SYMBOL_GPL(nvmem_dev_name);
+/**
+ * nvmem_dev_size() - Get the size of a given nvmem device.
+ *
+ * @nvmem: nvmem device.
+ *
+ * Return: size of the nvmem device.
+ */
+size_t nvmem_dev_size(struct nvmem_device *nvmem)
+{
+ return nvmem->size;
+}
+EXPORT_SYMBOL_GPL(nvmem_dev_size);
+
static int __init nvmem_init(void)
{
int ret;
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -81,6 +81,7 @@ int nvmem_device_cell_write(struct nvmem
struct nvmem_cell_info *info, void *buf);
const char *nvmem_dev_name(struct nvmem_device *nvmem);
+size_t nvmem_dev_size(struct nvmem_device *nvmem);
void nvmem_add_cell_lookups(struct nvmem_cell_lookup *entries,
size_t nentries);

View File

@@ -1,126 +0,0 @@
From 7c8979b42b1a9c5604f431ba804928e55919263c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Thu, 21 Dec 2023 18:34:18 +0100
Subject: [PATCH] nvmem: u-boot-env: use nvmem_add_one_cell() nvmem subsystem
helper
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Simplify adding NVMEM cells.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20231221173421.13737-3-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvmem/u-boot-env.c | 55 +++++++++++++++-----------------------
1 file changed, 21 insertions(+), 34 deletions(-)
--- a/drivers/nvmem/u-boot-env.c
+++ b/drivers/nvmem/u-boot-env.c
@@ -23,13 +23,10 @@ enum u_boot_env_format {
struct u_boot_env {
struct device *dev;
+ struct nvmem_device *nvmem;
enum u_boot_env_format format;
struct mtd_info *mtd;
-
- /* Cells */
- struct nvmem_cell_info *cells;
- int ncells;
};
struct u_boot_env_image_single {
@@ -94,43 +91,36 @@ static int u_boot_env_read_post_process_
static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
size_t data_offset, size_t data_len)
{
+ struct nvmem_device *nvmem = priv->nvmem;
struct device *dev = priv->dev;
char *data = buf + data_offset;
char *var, *value, *eq;
- int idx;
-
- priv->ncells = 0;
- for (var = data; var < data + data_len && *var; var += strlen(var) + 1)
- priv->ncells++;
-
- priv->cells = devm_kcalloc(dev, priv->ncells, sizeof(*priv->cells), GFP_KERNEL);
- if (!priv->cells)
- return -ENOMEM;
- for (var = data, idx = 0;
+ for (var = data;
var < data + data_len && *var;
- var = value + strlen(value) + 1, idx++) {
+ var = value + strlen(value) + 1) {
+ struct nvmem_cell_info info = {};
+
eq = strchr(var, '=');
if (!eq)
break;
*eq = '\0';
value = eq + 1;
- priv->cells[idx].name = devm_kstrdup(dev, var, GFP_KERNEL);
- if (!priv->cells[idx].name)
+ info.name = devm_kstrdup(dev, var, GFP_KERNEL);
+ if (!info.name)
return -ENOMEM;
- priv->cells[idx].offset = data_offset + value - data;
- priv->cells[idx].bytes = strlen(value);
- priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
+ info.offset = data_offset + value - data;
+ info.bytes = strlen(value);
+ info.np = of_get_child_by_name(dev->of_node, info.name);
if (!strcmp(var, "ethaddr")) {
- priv->cells[idx].raw_len = strlen(value);
- priv->cells[idx].bytes = ETH_ALEN;
- priv->cells[idx].read_post_process = u_boot_env_read_post_process_ethaddr;
+ info.raw_len = strlen(value);
+ info.bytes = ETH_ALEN;
+ info.read_post_process = u_boot_env_read_post_process_ethaddr;
}
- }
- if (WARN_ON(idx != priv->ncells))
- priv->ncells = idx;
+ nvmem_add_one_cell(nvmem, &info);
+ }
return 0;
}
@@ -209,7 +199,6 @@ static int u_boot_env_probe(struct platf
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct u_boot_env *priv;
- int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
@@ -224,17 +213,15 @@ static int u_boot_env_probe(struct platf
return PTR_ERR(priv->mtd);
}
- err = u_boot_env_parse(priv);
- if (err)
- return err;
-
config.dev = dev;
- config.cells = priv->cells;
- config.ncells = priv->ncells;
config.priv = priv;
config.size = priv->mtd->size;
- return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config));
+ priv->nvmem = devm_nvmem_register(dev, &config);
+ if (IS_ERR(priv->nvmem))
+ return PTR_ERR(priv->nvmem);
+
+ return u_boot_env_parse(priv);
}
static const struct of_device_id u_boot_env_of_match_table[] = {

View File

@@ -1,81 +0,0 @@
From a832556d23c5a11115f300011a5874d6107a0d62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Thu, 21 Dec 2023 18:34:19 +0100
Subject: [PATCH] nvmem: u-boot-env: use nvmem device helpers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Use nvmem_dev_size() and nvmem_device_read() to make this driver less
mtd dependent.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20231221173421.13737-4-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvmem/u-boot-env.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
--- a/drivers/nvmem/u-boot-env.c
+++ b/drivers/nvmem/u-boot-env.c
@@ -127,27 +127,34 @@ static int u_boot_env_add_cells(struct u
static int u_boot_env_parse(struct u_boot_env *priv)
{
+ struct nvmem_device *nvmem = priv->nvmem;
struct device *dev = priv->dev;
size_t crc32_data_offset;
size_t crc32_data_len;
size_t crc32_offset;
size_t data_offset;
size_t data_len;
+ size_t dev_size;
uint32_t crc32;
uint32_t calc;
- size_t bytes;
uint8_t *buf;
+ int bytes;
int err;
- buf = kcalloc(1, priv->mtd->size, GFP_KERNEL);
+ dev_size = nvmem_dev_size(nvmem);
+
+ buf = kcalloc(1, dev_size, GFP_KERNEL);
if (!buf) {
err = -ENOMEM;
goto err_out;
}
- err = mtd_read(priv->mtd, 0, priv->mtd->size, &bytes, buf);
- if ((err && !mtd_is_bitflip(err)) || bytes != priv->mtd->size) {
- dev_err(dev, "Failed to read from mtd: %d\n", err);
+ bytes = nvmem_device_read(nvmem, 0, dev_size, buf);
+ if (bytes < 0) {
+ err = bytes;
+ goto err_kfree;
+ } else if (bytes != dev_size) {
+ err = -EIO;
goto err_kfree;
}
@@ -169,8 +176,8 @@ static int u_boot_env_parse(struct u_boo
break;
}
crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset));
- crc32_data_len = priv->mtd->size - crc32_data_offset;
- data_len = priv->mtd->size - data_offset;
+ crc32_data_len = dev_size - crc32_data_offset;
+ data_len = dev_size - data_offset;
calc = crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L;
if (calc != crc32) {
@@ -179,7 +186,7 @@ static int u_boot_env_parse(struct u_boo
goto err_kfree;
}
- buf[priv->mtd->size - 1] = '\0';
+ buf[dev_size - 1] = '\0';
err = u_boot_env_add_cells(priv, buf, data_offset, data_len);
if (err)
dev_err(dev, "Failed to add cells: %d\n", err);

View File

@@ -1,62 +0,0 @@
From 6bafe07c930676d6430be471310958070816a595 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Thu, 21 Dec 2023 18:34:20 +0100
Subject: [PATCH] nvmem: u-boot-env: improve coding style
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1. Prefer kzalloc() over kcalloc()
See memory-allocation.rst which says: "to be on the safe side it's
best to use routines that set memory to zero, like kzalloc()"
2. Drop dev_err() for u_boot_env_add_cells() fail
It can fail only on -ENOMEM. We don't want to print error then.
3. Add extra "crc32_addr" variable
It makes code reading header's crc32 easier to understand / review.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20231221173421.13737-5-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvmem/u-boot-env.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/nvmem/u-boot-env.c
+++ b/drivers/nvmem/u-boot-env.c
@@ -132,6 +132,7 @@ static int u_boot_env_parse(struct u_boo
size_t crc32_data_offset;
size_t crc32_data_len;
size_t crc32_offset;
+ __le32 *crc32_addr;
size_t data_offset;
size_t data_len;
size_t dev_size;
@@ -143,7 +144,7 @@ static int u_boot_env_parse(struct u_boo
dev_size = nvmem_dev_size(nvmem);
- buf = kcalloc(1, dev_size, GFP_KERNEL);
+ buf = kzalloc(dev_size, GFP_KERNEL);
if (!buf) {
err = -ENOMEM;
goto err_out;
@@ -175,7 +176,8 @@ static int u_boot_env_parse(struct u_boo
data_offset = offsetof(struct u_boot_env_image_broadcom, data);
break;
}
- crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset));
+ crc32_addr = (__le32 *)(buf + crc32_offset);
+ crc32 = le32_to_cpu(*crc32_addr);
crc32_data_len = dev_size - crc32_data_offset;
data_len = dev_size - data_offset;
@@ -188,8 +190,6 @@ static int u_boot_env_parse(struct u_boo
buf[dev_size - 1] = '\0';
err = u_boot_env_add_cells(priv, buf, data_offset, data_len);
- if (err)
- dev_err(dev, "Failed to add cells: %d\n", err);
err_kfree:
kfree(buf);

View File

@@ -22,7 +22,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
#include <linux/crc32.h>
#include <linux/if_vlan.h>
#include <linux/uaccess.h>
@@ -7035,6 +7036,22 @@ static void rtl_tally_reset(struct r8152
@@ -7044,6 +7045,22 @@ static void rtl_tally_reset(struct r8152
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
}
@@ -45,7 +45,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
static void r8152b_init(struct r8152 *tp)
{
u32 ocp_data;
@@ -7076,6 +7093,8 @@ static void r8152b_init(struct r8152 *tp
@@ -7085,6 +7102,8 @@ static void r8152b_init(struct r8152 *tp
ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
@@ -54,7 +54,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
}
static void r8153_init(struct r8152 *tp)
@@ -7216,6 +7235,8 @@ static void r8153_init(struct r8152 *tp)
@@ -7225,6 +7244,8 @@ static void r8153_init(struct r8152 *tp)
tp->coalesce = COALESCE_SLOW;
break;
}
@@ -63,7 +63,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
}
static void r8153b_init(struct r8152 *tp)
@@ -7298,6 +7319,8 @@ static void r8153b_init(struct r8152 *tp
@@ -7307,6 +7328,8 @@ static void r8153b_init(struct r8152 *tp
rtl_tally_reset(tp);
tp->coalesce = 15000; /* 15 us */

View File

@@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *,
u32));
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *,
@@ -2247,9 +2264,11 @@ static void __sk_free(struct sock *sk)
@@ -2239,9 +2256,11 @@ static void __sk_free(struct sock *sk)
if (likely(sk->sk_net_refcnt))
sock_inuse_add(sock_net(sk), -1);

View File

@@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -4148,6 +4148,8 @@ static __net_initdata struct pernet_oper
@@ -4140,6 +4140,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{

View File

@@ -1,28 +0,0 @@
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1433,6 +1433,9 @@ static const struct usb_device_id produc
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
{QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
+ {QMI_FIXED_INTF(0x2077, 0x2002, 4)}, /* T&W TW04C */
+ {QMI_FIXED_INTF(0x2077, 0x2003, 4)}, /* T&W TW12G */
+ {QMI_FIXED_INTF(0x2077, 0x2004, 4)}, /* T&W TW510M */
/* 4. Gobi 1000 devices */
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -2322,9 +2322,13 @@ static const struct usb_device_id option
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a06, 0xff) }, /* Fibocom FM650-CN (RNDIS mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0a07, 0xff) }, /* Fibocom FM650-CN (MBIM mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1402, 0xff) }, /* GosunCn GM800 (Download mode) */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1403, 0xff) }, /* GosunCn GM800 (rmnet, old) */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
{ USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1421, 0xff) }, /* GosunCn GM800 (rmnet) */
+ { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1422, 0xff) }, /* GosunCn GM800 (EAP) */
{ USB_DEVICE(0x33f8, 0x0104), /* Rolling RW101-GL (laptop RMNET) */
.driver_info = RSVD(4) | RSVD(5) },
{ USB_DEVICE_INTERFACE_CLASS(0x33f8, 0x01a2, 0xff) }, /* Rolling RW101-GL (laptop MBIM) */

View File

@@ -1,129 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Thu, 15 Aug 2024 21:15:13 +0200
Subject: [PATCH] net: remove NETIF_F_GSO_FRAGLIST from NETIF_F_GSO_SOFTWARE
Several drivers set NETIF_F_GSO_SOFTWARE, but mangle fraglist GRO packets
in a way that they can't be properly segmented anymore.
In order to properly deal with this, remove fraglist GSO from
NETIF_F_GSO_SOFTWARE and switch to NETIF_F_GSO_SOFTWARE_ALL (which includes
fraglist GSO) in places where it's safe to add.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -118,7 +118,7 @@ static void dummy_setup(struct net_devic
dev->flags &= ~IFF_MULTICAST;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST;
- dev->features |= NETIF_F_GSO_SOFTWARE;
+ dev->features |= NETIF_F_GSO_SOFTWARE_ALL;
dev->features |= NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_LLTX;
dev->features |= NETIF_F_GSO_ENCAP_ALL;
dev->hw_features |= dev->features;
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -176,7 +176,7 @@ static void gen_lo_setup(struct net_devi
dev->flags = IFF_LOOPBACK;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
netif_keep_dst(dev);
- dev->hw_features = NETIF_F_GSO_SOFTWARE;
+ dev->hw_features = NETIF_F_GSO_SOFTWARE_ALL;
dev->features = NETIF_F_SG | NETIF_F_FRAGLIST
| NETIF_F_GSO_SOFTWARE
| NETIF_F_HW_CSUM
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -896,7 +896,7 @@ static int macvlan_hwtstamp_set(struct n
static struct lock_class_key macvlan_netdev_addr_lock_key;
#define ALWAYS_ON_OFFLOADS \
- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | \
+ (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE_ALL | \
NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL)
#define ALWAYS_ON_FEATURES (ALWAYS_ON_OFFLOADS | NETIF_F_LLTX)
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -219,13 +219,14 @@ static inline int find_next_netdev_featu
/* List of features with software fallbacks. */
#define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP | \
- NETIF_F_GSO_UDP_L4 | NETIF_F_GSO_FRAGLIST)
+ NETIF_F_GSO_UDP_L4)
+#define NETIF_F_GSO_SOFTWARE_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_FRAGLIST)
/*
* If one device supports one of these features, then enable them
* for all in netdev_increment_features.
*/
-#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
+#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE_ALL | NETIF_F_GSO_ROBUST | \
NETIF_F_SG | NETIF_F_HIGHDMA | \
NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED)
--- a/net/8021q/vlan.h
+++ b/net/8021q/vlan.h
@@ -108,7 +108,7 @@ static inline netdev_features_t vlan_tnl
netdev_features_t ret;
ret = real_dev->hw_enc_features &
- (NETIF_F_CSUM_MASK | NETIF_F_GSO_SOFTWARE |
+ (NETIF_F_CSUM_MASK | NETIF_F_GSO_SOFTWARE_ALL |
NETIF_F_GSO_ENCAP_ALL);
if ((ret & NETIF_F_GSO_ENCAP_ALL) && (ret & NETIF_F_CSUM_MASK))
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -583,7 +583,7 @@ static int vlan_dev_init(struct net_devi
dev->state |= (1 << __LINK_STATE_NOCARRIER);
dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG |
- NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE |
+ NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE_ALL |
NETIF_F_GSO_ENCAP_ALL |
NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC |
NETIF_F_ALL_FCOE;
@@ -676,7 +676,7 @@ static netdev_features_t vlan_dev_fix_fe
if (lower_features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
lower_features |= NETIF_F_HW_CSUM;
features = netdev_intersect_features(features, lower_features);
- features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE);
+ features |= old_features & (NETIF_F_SOFT_FEATURES | NETIF_F_GSO_SOFTWARE_ALL);
features |= NETIF_F_LLTX;
return features;
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2441,7 +2441,7 @@ void sk_setup_caps(struct sock *sk, stru
if (sk_is_tcp(sk))
sk->sk_route_caps |= NETIF_F_GSO;
if (sk->sk_route_caps & NETIF_F_GSO)
- sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
+ sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE_ALL;
if (unlikely(sk->sk_gso_disabled))
sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
if (sk_can_gso(sk)) {
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1996,7 +1996,7 @@ void ieee80211_color_collision_detection
/* interface handling */
#define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
NETIF_F_HW_CSUM | NETIF_F_SG | \
- NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE | \
+ NETIF_F_HIGHDMA | NETIF_F_GSO_SOFTWARE_ALL | \
NETIF_F_HW_TC)
#define MAC80211_SUPPORTED_FEATURES_RX (NETIF_F_RXCSUM)
#define MAC80211_SUPPORTED_FEATURES (MAC80211_SUPPORTED_FEATURES_TX | \
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -110,7 +110,7 @@ static void do_setup(struct net_device *
netdev->features = NETIF_F_LLTX | NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
- NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ENCAP_ALL;
+ NETIF_F_GSO_SOFTWARE_ALL | NETIF_F_GSO_ENCAP_ALL;
netdev->vlan_features = netdev->features;
netdev->hw_enc_features = netdev->features;

File diff suppressed because it is too large Load Diff

View File

@@ -1,28 +0,0 @@
From 8857b0ab6a562c473c5bded0efda9390b82a84d4 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Tue, 27 Sep 2022 22:12:17 +0200
Subject: [PATCH] arm64: dts: qcom: ipq6018: fix NAND node name
Per schema it should be nand-controller@79b0000 instead of nand@79b0000.
Fix it to match nand-controller.yaml requirements.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220927201218.1264506-1-robimarko@gmail.com
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -348,7 +348,7 @@
status = "disabled";
};
- qpic_nand: nand@79b0000 {
+ qpic_nand: nand-controller@79b0000 {
compatible = "qcom,ipq6018-nand";
reg = <0x0 0x079b0000 0x0 0x10000>;
#address-cells = <1>;

View File

@@ -35,22 +35,3 @@ Link: https://lore.kernel.org/r/20221006124659.217540-3-krzysztof.kozlowski@lina
pins = "gpio38", "gpio39", "gpio40", "gpio41";
function = "blsp0_spi";
drive-strength = <8>;
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -218,14 +218,14 @@
interrupt-controller;
#interrupt-cells = <2>;
- serial_3_pins: serial3-pinmux {
+ serial_3_pins: serial3-state {
pins = "gpio44", "gpio45";
function = "blsp2_uart";
drive-strength = <8>;
bias-pull-down;
};
- qpic_pins: qpic-pins {
+ qpic_pins: qpic-state {
pins = "gpio1", "gpio3", "gpio4",
"gpio5", "gpio6", "gpio7",
"gpio8", "gpio10", "gpio11",

View File

@@ -1,52 +0,0 @@
From feeef118fda562cf9081edef8ad464d89db070f4 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Tue, 27 Sep 2022 22:12:18 +0200
Subject: [PATCH] arm64: dts: qcom: ipq6018: move ARMv8 timer out of SoC node
The ARM timer is usually considered not part of SoC node, just like
other ARM designed blocks (PMU, PSCI). This fixes dtbs_check warning:
arch/arm64/boot/dts/qcom/ipq6018-cp01-c1.dtb: soc: timer: {'compatible': ['arm,armv8-timer'], 'interrupts': [[1, 2, 3848], [1, 3, 3848], [1, 4, 3848], [1, 1, 3848]]} should not be valid under {'type': 'object'}
From schema: dtschema/schemas/simple-bus.yaml
Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220927201218.1264506-2-robimarko@gmail.com
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -510,14 +510,6 @@
clock-names = "xo";
};
- timer {
- compatible = "arm,armv8-timer";
- interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
- <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
- <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
- <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
- };
-
timer@b120000 {
#address-cells = <1>;
#size-cells = <1>;
@@ -769,6 +761,14 @@
};
};
+ timer {
+ compatible = "arm,armv8-timer";
+ interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+ <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+ };
+
wcss: wcss-smp2p {
compatible = "qcom,smp2p";
qcom,smem = <435>, <428>;

View File

@@ -1,605 +0,0 @@
From 2c6e322a41c5e1ca45be50b9d5fbcda62dc23a0d Mon Sep 17 00:00:00 2001
From: Konrad Dybcio <konrad.dybcio@linaro.org>
Date: Mon, 2 Jan 2023 10:46:28 +0100
Subject: [PATCH] arm64: dts: qcom: ipq6018: Sort nodes properly
Order nodes by unit address if one exists and alphabetically otherwise.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230102094642.74254-4-konrad.dybcio@linaro.org
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 562 +++++++++++++-------------
1 file changed, 281 insertions(+), 281 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -87,6 +87,12 @@
};
};
+ firmware {
+ scm {
+ compatible = "qcom,scm-ipq6018", "qcom,scm";
+ };
+ };
+
cpu_opp_table: opp-table-cpu {
compatible = "operating-points-v2";
opp-shared;
@@ -123,12 +129,6 @@
};
};
- firmware {
- scm {
- compatible = "qcom,scm-ipq6018", "qcom,scm";
- };
- };
-
pmuv8: pmu {
compatible = "arm,cortex-a53-pmu";
interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
@@ -166,6 +166,28 @@
};
};
+ rpm-glink {
+ compatible = "qcom,glink-rpm";
+ interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
+ qcom,rpm-msg-ram = <&rpm_msg_ram>;
+ mboxes = <&apcs_glb 0>;
+
+ rpm_requests: glink-channel {
+ compatible = "qcom,rpm-ipq6018";
+ qcom,glink-channels = "rpm_requests";
+
+ regulators {
+ compatible = "qcom,rpm-mp5496-regulators";
+
+ ipq6018_s2: s2 {
+ regulator-min-microvolt = <725000>;
+ regulator-max-microvolt = <1062500>;
+ regulator-always-on;
+ };
+ };
+ };
+ };
+
smem {
compatible = "qcom,smem";
memory-region = <&smem_region>;
@@ -179,6 +201,102 @@
dma-ranges;
compatible = "simple-bus";
+ qusb_phy_1: qusb@59000 {
+ compatible = "qcom,ipq6018-qusb2-phy";
+ reg = <0x0 0x00059000 0x0 0x180>;
+ #phy-cells = <0>;
+
+ clocks = <&gcc GCC_USB1_PHY_CFG_AHB_CLK>,
+ <&xo>;
+ clock-names = "cfg_ahb", "ref";
+
+ resets = <&gcc GCC_QUSB2_1_PHY_BCR>;
+ status = "disabled";
+ };
+
+ ssphy_0: ssphy@78000 {
+ compatible = "qcom,ipq6018-qmp-usb3-phy";
+ reg = <0x0 0x00078000 0x0 0x1c4>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ clocks = <&gcc GCC_USB0_AUX_CLK>,
+ <&gcc GCC_USB0_PHY_CFG_AHB_CLK>, <&xo>;
+ clock-names = "aux", "cfg_ahb", "ref";
+
+ resets = <&gcc GCC_USB0_PHY_BCR>,
+ <&gcc GCC_USB3PHY_0_PHY_BCR>;
+ reset-names = "phy","common";
+ status = "disabled";
+
+ usb0_ssphy: phy@78200 {
+ reg = <0x0 0x00078200 0x0 0x130>, /* Tx */
+ <0x0 0x00078400 0x0 0x200>, /* Rx */
+ <0x0 0x00078800 0x0 0x1f8>, /* PCS */
+ <0x0 0x00078600 0x0 0x044>; /* PCS misc */
+ #phy-cells = <0>;
+ #clock-cells = <0>;
+ clocks = <&gcc GCC_USB0_PIPE_CLK>;
+ clock-names = "pipe0";
+ clock-output-names = "gcc_usb0_pipe_clk_src";
+ };
+ };
+
+ qusb_phy_0: qusb@79000 {
+ compatible = "qcom,ipq6018-qusb2-phy";
+ reg = <0x0 0x00079000 0x0 0x180>;
+ #phy-cells = <0>;
+
+ clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>,
+ <&xo>;
+ clock-names = "cfg_ahb", "ref";
+
+ resets = <&gcc GCC_QUSB2_0_PHY_BCR>;
+ status = "disabled";
+ };
+
+ pcie_phy: phy@84000 {
+ compatible = "qcom,ipq6018-qmp-pcie-phy";
+ reg = <0x0 0x00084000 0x0 0x1bc>; /* Serdes PLL */
+ status = "disabled";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ clocks = <&gcc GCC_PCIE0_AUX_CLK>,
+ <&gcc GCC_PCIE0_AHB_CLK>;
+ clock-names = "aux", "cfg_ahb";
+
+ resets = <&gcc GCC_PCIE0_PHY_BCR>,
+ <&gcc GCC_PCIE0PHY_PHY_BCR>;
+ reset-names = "phy",
+ "common";
+
+ pcie_phy0: phy@84200 {
+ reg = <0x0 0x00084200 0x0 0x16c>, /* Serdes Tx */
+ <0x0 0x00084400 0x0 0x200>, /* Serdes Rx */
+ <0x0 0x00084800 0x0 0x1f0>, /* PCS: Lane0, COM, PCIE */
+ <0x0 0x00084c00 0x0 0xf4>; /* pcs_misc */
+ #phy-cells = <0>;
+
+ clocks = <&gcc GCC_PCIE0_PIPE_CLK>;
+ clock-names = "pipe0";
+ clock-output-names = "gcc_pcie0_pipe_clk_src";
+ #clock-cells = <0>;
+ };
+ };
+
+ mdio: mdio@90000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "qcom,ipq6018-mdio", "qcom,ipq4019-mdio";
+ reg = <0x0 0x00090000 0x0 0x64>;
+ clocks = <&gcc GCC_MDIO_AHB_CLK>;
+ clock-names = "gcc_mdio_ahb_clk";
+ status = "disabled";
+ };
+
prng: qrng@e1000 {
compatible = "qcom,prng-ee";
reg = <0x0 0x000e3000 0x0 0x1000>;
@@ -257,6 +375,41 @@
reg = <0x0 0x01937000 0x0 0x21000>;
};
+ usb2: usb@70f8800 {
+ compatible = "qcom,ipq6018-dwc3", "qcom,dwc3";
+ reg = <0x0 0x070F8800 0x0 0x400>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+ clocks = <&gcc GCC_USB1_MASTER_CLK>,
+ <&gcc GCC_USB1_SLEEP_CLK>,
+ <&gcc GCC_USB1_MOCK_UTMI_CLK>;
+ clock-names = "core",
+ "sleep",
+ "mock_utmi";
+
+ assigned-clocks = <&gcc GCC_USB1_MASTER_CLK>,
+ <&gcc GCC_USB1_MOCK_UTMI_CLK>;
+ assigned-clock-rates = <133330000>,
+ <24000000>;
+ resets = <&gcc GCC_USB1_BCR>;
+ status = "disabled";
+
+ dwc_1: usb@7000000 {
+ compatible = "snps,dwc3";
+ reg = <0x0 0x07000000 0x0 0xcd00>;
+ interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
+ phys = <&qusb_phy_1>;
+ phy-names = "usb2-phy";
+ tx-fifo-resize;
+ snps,is-utmi-l1-suspend;
+ snps,hird-threshold = /bits/ 8 <0x0>;
+ snps,dis_u2_susphy_quirk;
+ snps,dis_u3_susphy_quirk;
+ dr_mode = "host";
+ };
+ };
+
blsp_dma: dma-controller@7884000 {
compatible = "qcom,bam-v1.7.0";
reg = <0x0 0x07884000 0x0 0x2b000>;
@@ -366,6 +519,49 @@
status = "disabled";
};
+ usb3: usb@8af8800 {
+ compatible = "qcom,ipq6018-dwc3", "qcom,dwc3";
+ reg = <0x0 0x08af8800 0x0 0x400>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
+ <&gcc GCC_USB0_MASTER_CLK>,
+ <&gcc GCC_USB0_SLEEP_CLK>,
+ <&gcc GCC_USB0_MOCK_UTMI_CLK>;
+ clock-names = "cfg_noc",
+ "core",
+ "sleep",
+ "mock_utmi";
+
+ assigned-clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
+ <&gcc GCC_USB0_MASTER_CLK>,
+ <&gcc GCC_USB0_MOCK_UTMI_CLK>;
+ assigned-clock-rates = <133330000>,
+ <133330000>,
+ <24000000>;
+
+ resets = <&gcc GCC_USB0_BCR>;
+ status = "disabled";
+
+ dwc_0: usb@8a00000 {
+ compatible = "snps,dwc3";
+ reg = <0x0 0x08a00000 0x0 0xcd00>;
+ interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+ phys = <&qusb_phy_0>, <&usb0_ssphy>;
+ phy-names = "usb2-phy", "usb3-phy";
+ clocks = <&xo>;
+ clock-names = "ref";
+ tx-fifo-resize;
+ snps,is-utmi-l1-suspend;
+ snps,hird-threshold = /bits/ 8 <0x0>;
+ snps,dis_u2_susphy_quirk;
+ snps,dis_u3_susphy_quirk;
+ dr_mode = "host";
+ };
+ };
+
intc: interrupt-controller@b000000 {
compatible = "qcom,msm-qgic2";
#address-cells = <2>;
@@ -386,105 +582,6 @@
};
};
- pcie_phy: phy@84000 {
- compatible = "qcom,ipq6018-qmp-pcie-phy";
- reg = <0x0 0x00084000 0x0 0x1bc>; /* Serdes PLL */
- status = "disabled";
- #address-cells = <2>;
- #size-cells = <2>;
- ranges;
-
- clocks = <&gcc GCC_PCIE0_AUX_CLK>,
- <&gcc GCC_PCIE0_AHB_CLK>;
- clock-names = "aux", "cfg_ahb";
-
- resets = <&gcc GCC_PCIE0_PHY_BCR>,
- <&gcc GCC_PCIE0PHY_PHY_BCR>;
- reset-names = "phy",
- "common";
-
- pcie_phy0: phy@84200 {
- reg = <0x0 0x00084200 0x0 0x16c>, /* Serdes Tx */
- <0x0 0x00084400 0x0 0x200>, /* Serdes Rx */
- <0x0 0x00084800 0x0 0x1f0>, /* PCS: Lane0, COM, PCIE */
- <0x0 0x00084c00 0x0 0xf4>; /* pcs_misc */
- #phy-cells = <0>;
-
- clocks = <&gcc GCC_PCIE0_PIPE_CLK>;
- clock-names = "pipe0";
- clock-output-names = "gcc_pcie0_pipe_clk_src";
- #clock-cells = <0>;
- };
- };
-
- pcie0: pci@20000000 {
- compatible = "qcom,pcie-ipq6018";
- reg = <0x0 0x20000000 0x0 0xf1d>,
- <0x0 0x20000f20 0x0 0xa8>,
- <0x0 0x20001000 0x0 0x1000>,
- <0x0 0x80000 0x0 0x4000>,
- <0x0 0x20100000 0x0 0x1000>;
- reg-names = "dbi", "elbi", "atu", "parf", "config";
-
- device_type = "pci";
- linux,pci-domain = <0>;
- bus-range = <0x00 0xff>;
- num-lanes = <1>;
- max-link-speed = <3>;
- #address-cells = <3>;
- #size-cells = <2>;
-
- phys = <&pcie_phy0>;
- phy-names = "pciephy";
-
- ranges = <0x81000000 0x0 0x00000000 0x0 0x20200000 0x0 0x10000>,
- <0x82000000 0x0 0x20220000 0x0 0x20220000 0x0 0xfde0000>;
-
- interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "msi";
-
- #interrupt-cells = <1>;
- interrupt-map-mask = <0 0 0 0x7>;
- interrupt-map = <0 0 0 1 &intc 0 75
- IRQ_TYPE_LEVEL_HIGH>, /* int_a */
- <0 0 0 2 &intc 0 78
- IRQ_TYPE_LEVEL_HIGH>, /* int_b */
- <0 0 0 3 &intc 0 79
- IRQ_TYPE_LEVEL_HIGH>, /* int_c */
- <0 0 0 4 &intc 0 83
- IRQ_TYPE_LEVEL_HIGH>; /* int_d */
-
- clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>,
- <&gcc GCC_PCIE0_AXI_M_CLK>,
- <&gcc GCC_PCIE0_AXI_S_CLK>,
- <&gcc GCC_PCIE0_AXI_S_BRIDGE_CLK>,
- <&gcc PCIE0_RCHNG_CLK>;
- clock-names = "iface",
- "axi_m",
- "axi_s",
- "axi_bridge",
- "rchng";
-
- resets = <&gcc GCC_PCIE0_PIPE_ARES>,
- <&gcc GCC_PCIE0_SLEEP_ARES>,
- <&gcc GCC_PCIE0_CORE_STICKY_ARES>,
- <&gcc GCC_PCIE0_AXI_MASTER_ARES>,
- <&gcc GCC_PCIE0_AXI_SLAVE_ARES>,
- <&gcc GCC_PCIE0_AHB_ARES>,
- <&gcc GCC_PCIE0_AXI_MASTER_STICKY_ARES>,
- <&gcc GCC_PCIE0_AXI_SLAVE_STICKY_ARES>;
- reset-names = "pipe",
- "sleep",
- "sticky",
- "axi_m",
- "axi_s",
- "ahb",
- "axi_m_sticky",
- "axi_s_sticky";
-
- status = "disabled";
- };
-
watchdog@b017000 {
compatible = "qcom,kpss-wdt";
interrupts = <GIC_SPI 3 IRQ_TYPE_EDGE_RISING>;
@@ -617,147 +714,74 @@
};
};
- mdio: mdio@90000 {
- #address-cells = <1>;
- #size-cells = <0>;
- compatible = "qcom,ipq6018-mdio", "qcom,ipq4019-mdio";
- reg = <0x0 0x00090000 0x0 0x64>;
- clocks = <&gcc GCC_MDIO_AHB_CLK>;
- clock-names = "gcc_mdio_ahb_clk";
- status = "disabled";
- };
-
- qusb_phy_1: qusb@59000 {
- compatible = "qcom,ipq6018-qusb2-phy";
- reg = <0x0 0x00059000 0x0 0x180>;
- #phy-cells = <0>;
-
- clocks = <&gcc GCC_USB1_PHY_CFG_AHB_CLK>,
- <&xo>;
- clock-names = "cfg_ahb", "ref";
-
- resets = <&gcc GCC_QUSB2_1_PHY_BCR>;
- status = "disabled";
- };
-
- usb2: usb@70f8800 {
- compatible = "qcom,ipq6018-dwc3", "qcom,dwc3";
- reg = <0x0 0x070F8800 0x0 0x400>;
- #address-cells = <2>;
- #size-cells = <2>;
- ranges;
- clocks = <&gcc GCC_USB1_MASTER_CLK>,
- <&gcc GCC_USB1_SLEEP_CLK>,
- <&gcc GCC_USB1_MOCK_UTMI_CLK>;
- clock-names = "core",
- "sleep",
- "mock_utmi";
-
- assigned-clocks = <&gcc GCC_USB1_MASTER_CLK>,
- <&gcc GCC_USB1_MOCK_UTMI_CLK>;
- assigned-clock-rates = <133330000>,
- <24000000>;
- resets = <&gcc GCC_USB1_BCR>;
- status = "disabled";
-
- dwc_1: usb@7000000 {
- compatible = "snps,dwc3";
- reg = <0x0 0x07000000 0x0 0xcd00>;
- interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
- phys = <&qusb_phy_1>;
- phy-names = "usb2-phy";
- tx-fifo-resize;
- snps,is-utmi-l1-suspend;
- snps,hird-threshold = /bits/ 8 <0x0>;
- snps,dis_u2_susphy_quirk;
- snps,dis_u3_susphy_quirk;
- dr_mode = "host";
- };
- };
+ pcie0: pci@20000000 {
+ compatible = "qcom,pcie-ipq6018";
+ reg = <0x0 0x20000000 0x0 0xf1d>,
+ <0x0 0x20000f20 0x0 0xa8>,
+ <0x0 0x20001000 0x0 0x1000>,
+ <0x0 0x80000 0x0 0x4000>,
+ <0x0 0x20100000 0x0 0x1000>;
+ reg-names = "dbi", "elbi", "atu", "parf", "config";
- ssphy_0: ssphy@78000 {
- compatible = "qcom,ipq6018-qmp-usb3-phy";
- reg = <0x0 0x00078000 0x0 0x1c4>;
- #address-cells = <2>;
+ device_type = "pci";
+ linux,pci-domain = <0>;
+ bus-range = <0x00 0xff>;
+ num-lanes = <1>;
+ max-link-speed = <3>;
+ #address-cells = <3>;
#size-cells = <2>;
- ranges;
-
- clocks = <&gcc GCC_USB0_AUX_CLK>,
- <&gcc GCC_USB0_PHY_CFG_AHB_CLK>, <&xo>;
- clock-names = "aux", "cfg_ahb", "ref";
-
- resets = <&gcc GCC_USB0_PHY_BCR>,
- <&gcc GCC_USB3PHY_0_PHY_BCR>;
- reset-names = "phy","common";
- status = "disabled";
-
- usb0_ssphy: phy@78200 {
- reg = <0x0 0x00078200 0x0 0x130>, /* Tx */
- <0x0 0x00078400 0x0 0x200>, /* Rx */
- <0x0 0x00078800 0x0 0x1f8>, /* PCS */
- <0x0 0x00078600 0x0 0x044>; /* PCS misc */
- #phy-cells = <0>;
- #clock-cells = <0>;
- clocks = <&gcc GCC_USB0_PIPE_CLK>;
- clock-names = "pipe0";
- clock-output-names = "gcc_usb0_pipe_clk_src";
- };
- };
- qusb_phy_0: qusb@79000 {
- compatible = "qcom,ipq6018-qusb2-phy";
- reg = <0x0 0x00079000 0x0 0x180>;
- #phy-cells = <0>;
+ phys = <&pcie_phy0>;
+ phy-names = "pciephy";
- clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>,
- <&xo>;
- clock-names = "cfg_ahb", "ref";
+ ranges = <0x81000000 0 0x20200000 0 0x20200000
+ 0 0x10000>, /* downstream I/O */
+ <0x82000000 0 0x20220000 0 0x20220000
+ 0 0xfde0000>; /* non-prefetchable memory */
- resets = <&gcc GCC_QUSB2_0_PHY_BCR>;
- status = "disabled";
- };
+ interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "msi";
- usb3: usb@8af8800 {
- compatible = "qcom,ipq6018-dwc3", "qcom,dwc3";
- reg = <0x0 0x8af8800 0x0 0x400>;
- #address-cells = <2>;
- #size-cells = <2>;
- ranges;
+ #interrupt-cells = <1>;
+ interrupt-map-mask = <0 0 0 0x7>;
+ interrupt-map = <0 0 0 1 &intc 0 75
+ IRQ_TYPE_LEVEL_HIGH>, /* int_a */
+ <0 0 0 2 &intc 0 78
+ IRQ_TYPE_LEVEL_HIGH>, /* int_b */
+ <0 0 0 3 &intc 0 79
+ IRQ_TYPE_LEVEL_HIGH>, /* int_c */
+ <0 0 0 4 &intc 0 83
+ IRQ_TYPE_LEVEL_HIGH>; /* int_d */
- clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
- <&gcc GCC_USB0_MASTER_CLK>,
- <&gcc GCC_USB0_SLEEP_CLK>,
- <&gcc GCC_USB0_MOCK_UTMI_CLK>;
- clock-names = "cfg_noc",
- "core",
- "sleep",
- "mock_utmi";
+ clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>,
+ <&gcc GCC_PCIE0_AXI_M_CLK>,
+ <&gcc GCC_PCIE0_AXI_S_CLK>,
+ <&gcc GCC_PCIE0_AXI_S_BRIDGE_CLK>,
+ <&gcc PCIE0_RCHNG_CLK>;
+ clock-names = "iface",
+ "axi_m",
+ "axi_s",
+ "axi_bridge",
+ "rchng";
- assigned-clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
- <&gcc GCC_USB0_MASTER_CLK>,
- <&gcc GCC_USB0_MOCK_UTMI_CLK>;
- assigned-clock-rates = <133330000>,
- <133330000>,
- <24000000>;
+ resets = <&gcc GCC_PCIE0_PIPE_ARES>,
+ <&gcc GCC_PCIE0_SLEEP_ARES>,
+ <&gcc GCC_PCIE0_CORE_STICKY_ARES>,
+ <&gcc GCC_PCIE0_AXI_MASTER_ARES>,
+ <&gcc GCC_PCIE0_AXI_SLAVE_ARES>,
+ <&gcc GCC_PCIE0_AHB_ARES>,
+ <&gcc GCC_PCIE0_AXI_MASTER_STICKY_ARES>,
+ <&gcc GCC_PCIE0_AXI_SLAVE_STICKY_ARES>;
+ reset-names = "pipe",
+ "sleep",
+ "sticky",
+ "axi_m",
+ "axi_s",
+ "ahb",
+ "axi_m_sticky",
+ "axi_s_sticky";
- resets = <&gcc GCC_USB0_BCR>;
status = "disabled";
-
- dwc_0: usb@8a00000 {
- compatible = "snps,dwc3";
- reg = <0x0 0x8a00000 0x0 0xcd00>;
- interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
- phys = <&qusb_phy_0>, <&usb0_ssphy>;
- phy-names = "usb2-phy", "usb3-phy";
- clocks = <&xo>;
- clock-names = "ref";
- tx-fifo-resize;
- snps,is-utmi-l1-suspend;
- snps,hird-threshold = /bits/ 8 <0x0>;
- snps,dis_u2_susphy_quirk;
- snps,dis_u3_susphy_quirk;
- dr_mode = "host";
- };
};
};
@@ -792,26 +816,4 @@
#interrupt-cells = <2>;
};
};
-
- rpm-glink {
- compatible = "qcom,glink-rpm";
- interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
- qcom,rpm-msg-ram = <&rpm_msg_ram>;
- mboxes = <&apcs_glb 0>;
-
- rpm_requests: glink-channel {
- compatible = "qcom,rpm-ipq6018";
- qcom,glink-channels = "rpm_requests";
-
- regulators {
- compatible = "qcom,rpm-mp5496-regulators";
-
- ipq6018_s2: s2 {
- regulator-min-microvolt = <725000>;
- regulator-max-microvolt = <1062500>;
- regulator-always-on;
- };
- };
- };
- };
};

View File

@@ -1,92 +0,0 @@
From 6db9ed9a128cbae1423d043f3debd8bfa77783fd Mon Sep 17 00:00:00 2001
From: Konrad Dybcio <konrad.dybcio@linaro.org>
Date: Mon, 2 Jan 2023 10:46:29 +0100
Subject: [PATCH] arm64: dts: qcom: ipq6018: Add/remove some newlines
Some lines were broken very aggresively, presumably to fit under 80 chars
and some places could have used a newline, particularly between subsequent
nodes. Address all that and remove redundant comments near PCIe ranges
while at it so as not to exceed 100 chars needlessly.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230102094642.74254-5-konrad.dybcio@linaro.org
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -102,26 +102,31 @@
opp-microvolt = <725000>;
clock-latency-ns = <200000>;
};
+
opp-1056000000 {
opp-hz = /bits/ 64 <1056000000>;
opp-microvolt = <787500>;
clock-latency-ns = <200000>;
};
+
opp-1320000000 {
opp-hz = /bits/ 64 <1320000000>;
opp-microvolt = <862500>;
clock-latency-ns = <200000>;
};
+
opp-1440000000 {
opp-hz = /bits/ 64 <1440000000>;
opp-microvolt = <925000>;
clock-latency-ns = <200000>;
};
+
opp-1608000000 {
opp-hz = /bits/ 64 <1608000000>;
opp-microvolt = <987500>;
clock-latency-ns = <200000>;
};
+
opp-1800000000 {
opp-hz = /bits/ 64 <1800000000>;
opp-microvolt = <1062500>;
@@ -131,8 +136,7 @@
pmuv8: pmu {
compatible = "arm,cortex-a53-pmu";
- interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
- IRQ_TYPE_LEVEL_HIGH)>;
+ interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
};
psci: psci {
@@ -734,24 +738,18 @@
phys = <&pcie_phy0>;
phy-names = "pciephy";
- ranges = <0x81000000 0 0x20200000 0 0x20200000
- 0 0x10000>, /* downstream I/O */
- <0x82000000 0 0x20220000 0 0x20220000
- 0 0xfde0000>; /* non-prefetchable memory */
+ ranges = <0x81000000 0 0x20200000 0 0x20200000 0 0x10000>,
+ <0x82000000 0 0x20220000 0 0x20220000 0 0xfde0000>;
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "msi";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0x7>;
- interrupt-map = <0 0 0 1 &intc 0 75
- IRQ_TYPE_LEVEL_HIGH>, /* int_a */
- <0 0 0 2 &intc 0 78
- IRQ_TYPE_LEVEL_HIGH>, /* int_b */
- <0 0 0 3 &intc 0 79
- IRQ_TYPE_LEVEL_HIGH>, /* int_c */
- <0 0 0 4 &intc 0 83
- IRQ_TYPE_LEVEL_HIGH>; /* int_d */
+ interrupt-map = <0 0 0 1 &intc 0 75 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
+ <0 0 0 2 &intc 0 78 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
+ <0 0 0 3 &intc 0 79 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
+ <0 0 0 4 &intc 0 83 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>,
<&gcc GCC_PCIE0_AXI_M_CLK>,

View File

@@ -1,25 +0,0 @@
From 7356ae3e10abd1d71f06ff0b8a8e72aa7c955c57 Mon Sep 17 00:00:00 2001
From: Konrad Dybcio <konrad.dybcio@linaro.org>
Date: Mon, 2 Jan 2023 10:46:30 +0100
Subject: [PATCH] arm64: dts: qcom: ipq6018: Use lowercase hex
One value escaped my previous lowercase hexification. Take care of it.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230102094642.74254-6-konrad.dybcio@linaro.org
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -381,7 +381,7 @@
usb2: usb@70f8800 {
compatible = "qcom,ipq6018-dwc3", "qcom,dwc3";
- reg = <0x0 0x070F8800 0x0 0x400>;
+ reg = <0x0 0x070f8800 0x0 0x400>;
#address-cells = <2>;
#size-cells = <2>;
ranges;

View File

@@ -1,28 +0,0 @@
From 679ee73bbee28cab441008f8cca38160cc8f3d05 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date: Wed, 8 Feb 2023 11:15:39 +0100
Subject: [PATCH] arm64: dts: qcom: ipq6018: align RPM G-Link node with
bindings
Bindings expect (and most of DTS use) the RPM G-Link node name to be
"rpm-requests".
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230208101545.45711-1-krzysztof.kozlowski@linaro.org
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -176,7 +176,7 @@
qcom,rpm-msg-ram = <&rpm_msg_ram>;
mboxes = <&apcs_glb 0>;
- rpm_requests: glink-channel {
+ rpm_requests: rpm-requests {
compatible = "qcom,rpm-ipq6018";
qcom,glink-channels = "rpm_requests";

View File

@@ -24,40 +24,6 @@ Link: https://lore.kernel.org/r/20230526110653.27777-4-quic_viswanat@quicinc.com
arch/arm64/boot/dts/qcom/ipq8074.dtsi | 14 ++++++++++++--
2 files changed, 25 insertions(+), 5 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -154,18 +154,28 @@
no-map;
};
+ bootloader@4a100000 {
+ reg = <0x0 0x4a100000 0x0 0x400000>;
+ no-map;
+ };
+
+ sbl@4a500000 {
+ reg = <0x0 0x4a500000 0x0 0x100000>;
+ no-map;
+ };
+
tz: memory@4a600000 {
- reg = <0x0 0x4a600000 0x0 0x00400000>;
+ reg = <0x0 0x4a600000 0x0 0x400000>;
no-map;
};
smem_region: memory@4aa00000 {
- reg = <0x0 0x4aa00000 0x0 0x00100000>;
+ reg = <0x0 0x4aa00000 0x0 0x100000>;
no-map;
};
q6_region: memory@4ab00000 {
- reg = <0x0 0x4ab00000 0x0 0x05500000>;
+ reg = <0x0 0x4ab00000 0x0 0x5500000>;
no-map;
};
};
--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
@@ -85,17 +85,27 @@

View File

@@ -15,16 +15,6 @@ Link: https://lore.kernel.org/r/20230526110653.27777-3-quic_viswanat@quicinc.com
arch/arm64/boot/dts/qcom/ipq8074.dtsi | 6 ++++++
2 files changed, 7 insertions(+)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -90,6 +90,7 @@
firmware {
scm {
compatible = "qcom,scm-ipq6018", "qcom,scm";
+ qcom,dload-mode = <&tcsr 0x6100>;
};
};
--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
@@ -112,6 +112,7 @@

View File

@@ -1,29 +0,0 @@
From 085058786a7890dd44ec623fe5ac74db870f6b93 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date: Wed, 19 Apr 2023 23:18:39 +0200
Subject: [PATCH] arm64: dts: qcom: ipq6018: correct qrng unit address
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc/qrng@e1000: simple-bus unit address format error, expected "e3000"
Fixes: 5bf635621245 ("arm64: dts: ipq6018: Add a few device nodes")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230419211856.79332-1-krzysztof.kozlowski@linaro.org
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -312,7 +312,7 @@
status = "disabled";
};
- prng: qrng@e1000 {
+ prng: qrng@e3000 {
compatible = "qcom,prng-ee";
reg = <0x0 0x000e3000 0x0 0x1000>;
clocks = <&gcc GCC_PRNG_AHB_CLK>;

View File

@@ -1,28 +0,0 @@
From 393595d4ffbd0a1fafd5548f8de1b8487a037cf2 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date: Thu, 20 Apr 2023 08:36:04 +0200
Subject: [PATCH] arm64: dts: qcom: ipq6018: add unit address to soc node
"soc" node is supposed to have unit address:
Warning (unit_address_vs_reg): /soc: node has a reg or ranges property, but no unit name
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230420063610.11068-1-krzysztof.kozlowski@linaro.org
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -209,7 +209,7 @@
hwlocks = <&tcsr_mutex 3>;
};
- soc: soc {
+ soc: soc@0 {
#address-cells = <2>;
#size-cells = <2>;
ranges = <0 0 0 0 0x0 0xffffffff>;

View File

@@ -1,34 +0,0 @@
From 546f0617a22a481f3ca1f7e058aea0c40517c64e Mon Sep 17 00:00:00 2001
From: Kathiravan T <quic_kathirav@quicinc.com>
Date: Fri, 26 May 2023 18:23:04 +0530
Subject: [PATCH] arm64: dts: qcom: ipq6018: add QFPROM node
IPQ6018 has efuse region to determine the various HW quirks. Lets
add the initial support and the individual fuses will be added as they
are required.
Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230526125305.19626-4-quic_kathirav@quicinc.com
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -312,6 +312,13 @@
status = "disabled";
};
+ qfprom: efuse@a4000 {
+ compatible = "qcom,ipq6018-qfprom", "qcom,qfprom";
+ reg = <0x0 0x000a4000 0x0 0x2000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ };
+
prng: qrng@e3000 {
compatible = "qcom,prng-ee";
reg = <0x0 0x000e3000 0x0 0x1000>;

View File

@@ -1,37 +0,0 @@
From b8420d478aa3fc739fcdba6b4b945850b356cb3b Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date: Sun, 16 Apr 2023 14:37:25 +0200
Subject: [PATCH] arm64: dts: qcom: ipq6018: drop incorrect SPI bus
spi-max-frequency
The spi-max-frequency property belongs to SPI devices, not SPI
controller:
ipq6018-cp01-c1.dtb: spi@78b5000: Unevaluated properties are not allowed ('spi-max-frequency' was unexpected)
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230416123730.300863-1-krzysztof.kozlowski@linaro.org
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 --
1 file changed, 2 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -458,7 +458,6 @@
#size-cells = <0>;
reg = <0x0 0x078b5000 0x0 0x600>;
interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
- spi-max-frequency = <50000000>;
clocks = <&gcc GCC_BLSP1_QUP1_SPI_APPS_CLK>,
<&gcc GCC_BLSP1_AHB_CLK>;
clock-names = "core", "iface";
@@ -473,7 +472,6 @@
#size-cells = <0>;
reg = <0x0 0x078b6000 0x0 0x600>;
interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
- spi-max-frequency = <50000000>;
clocks = <&gcc GCC_BLSP1_QUP2_SPI_APPS_CLK>,
<&gcc GCC_BLSP1_AHB_CLK>;
clock-names = "core", "iface";

View File

@@ -1,93 +0,0 @@
From 7e1acc8b92a3b67db1e5255adae2851d58d74434 Mon Sep 17 00:00:00 2001
From: Stephan Gerhold <stephan@gerhold.net>
Date: Thu, 15 Jun 2023 18:50:44 +0200
Subject: [PATCH] arm64: dts: qcom: Add rpm-proc node for GLINK gplatforms
Rather than having the RPM GLINK channels as the only child of a dummy
top-level rpm-glink node, switch to representing the RPM as remoteproc
like all the other remoteprocs (modem DSP, ...).
This allows assigning additional subdevices to it like the MPM
interrupt-controller or rpm-master-stats.
Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org> # SM6375
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20230531-rpm-rproc-v3-11-a07dcdefd918@gerhold.net
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 48 ++++----
arch/arm64/boot/dts/qcom/ipq9574.dtsi | 28 +++--
arch/arm64/boot/dts/qcom/msm8996.dtsi | 113 +++++++++----------
arch/arm64/boot/dts/qcom/msm8998.dtsi | 102 ++++++++---------
arch/arm64/boot/dts/qcom/qcm2290.dtsi | 126 ++++++++++-----------
arch/arm64/boot/dts/qcom/qcs404.dtsi | 152 +++++++++++++-------------
arch/arm64/boot/dts/qcom/sdm630.dtsi | 132 +++++++++++-----------
arch/arm64/boot/dts/qcom/sm6115.dtsi | 128 +++++++++++-----------
arch/arm64/boot/dts/qcom/sm6125.dtsi | 140 ++++++++++++------------
arch/arm64/boot/dts/qcom/sm6375.dtsi | 126 ++++++++++-----------
10 files changed, 566 insertions(+), 529 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -145,6 +145,32 @@
method = "smc";
};
+ rpm: remoteproc {
+ compatible = "qcom,ipq6018-rpm-proc", "qcom,rpm-proc";
+
+ glink-edge {
+ compatible = "qcom,glink-rpm";
+ interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
+ qcom,rpm-msg-ram = <&rpm_msg_ram>;
+ mboxes = <&apcs_glb 0>;
+
+ rpm_requests: rpm-requests {
+ compatible = "qcom,rpm-ipq6018";
+ qcom,glink-channels = "rpm_requests";
+
+ regulators {
+ compatible = "qcom,rpm-mp5496-regulators";
+
+ ipq6018_s2: s2 {
+ regulator-min-microvolt = <725000>;
+ regulator-max-microvolt = <1062500>;
+ regulator-always-on;
+ };
+ };
+ };
+ };
+ };
+
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
@@ -181,28 +207,6 @@
};
};
- rpm-glink {
- compatible = "qcom,glink-rpm";
- interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
- qcom,rpm-msg-ram = <&rpm_msg_ram>;
- mboxes = <&apcs_glb 0>;
-
- rpm_requests: rpm-requests {
- compatible = "qcom,rpm-ipq6018";
- qcom,glink-channels = "rpm_requests";
-
- regulators {
- compatible = "qcom,rpm-mp5496-regulators";
-
- ipq6018_s2: s2 {
- regulator-min-microvolt = <725000>;
- regulator-max-microvolt = <1062500>;
- regulator-always-on;
- };
- };
- };
- };
-
smem {
compatible = "qcom,smem";
memory-region = <&smem_region>;

View File

@@ -1,35 +0,0 @@
From 0133c7af3aa0420778d106cb90db708cfa45f2c6 Mon Sep 17 00:00:00 2001
From: Kathiravan Thirumoorthy <quic_kathirav@quicinc.com>
Date: Thu, 14 Sep 2023 12:29:59 +0530
Subject: [PATCH] arm64: dts: qcom: ipq6018: include the GPLL0 as clock
provider for mailbox
While the kernel is booting up, APSS clock / CPU clock will be running
at 800MHz with GPLL0 as source. Once the cpufreq driver is available,
APSS PLL will be configured to the rate based on the opp table and the
source also will be changed to APSS_PLL_EARLY. So allow the mailbox to
consume the GPLL0, with this inclusion, CPU Freq correctly reports that
CPU is running at 800MHz rather than 24MHz.
Signed-off-by: Kathiravan Thirumoorthy <quic_kathirav@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230913-gpll_cleanup-v2-9-c8ceb1a37680@quicinc.com
[bjorn: Updated commit message, as requested by Kathiravan]
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -618,8 +618,8 @@
compatible = "qcom,ipq6018-apcs-apps-global";
reg = <0x0 0x0b111000 0x0 0x1000>;
#clock-cells = <1>;
- clocks = <&a53pll>, <&xo>;
- clock-names = "pll", "xo";
+ clocks = <&a53pll>, <&xo>, <&gcc GPLL0>;
+ clock-names = "pll", "xo", "gpll0";
#mbox-cells = <1>;
};

View File

@@ -1,85 +0,0 @@
From 83afcf14edb9217e58837eb119da96d734a4b3b1 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Sat, 21 Oct 2023 14:00:07 +0200
Subject: [PATCH] arm64: dts: qcom: ipq6018: use CPUFreq NVMEM
IPQ6018 comes in multiple SKU-s and some of them dont support all of the
OPP-s that are current set, so lets utilize CPUFreq NVMEM to allow only
supported OPP-s based on the SoC dynamically.
As an example, IPQ6018 is generaly rated at 1.8GHz but some silicon only
goes up to 1.5GHz and is marked as such via an eFuse.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20231021120048.231239-1-robimarko@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -95,42 +95,49 @@
};
cpu_opp_table: opp-table-cpu {
- compatible = "operating-points-v2";
+ compatible = "operating-points-v2-kryo-cpu";
+ nvmem-cells = <&cpu_speed_bin>;
opp-shared;
opp-864000000 {
opp-hz = /bits/ 64 <864000000>;
opp-microvolt = <725000>;
+ opp-supported-hw = <0xf>;
clock-latency-ns = <200000>;
};
opp-1056000000 {
opp-hz = /bits/ 64 <1056000000>;
opp-microvolt = <787500>;
+ opp-supported-hw = <0xf>;
clock-latency-ns = <200000>;
};
opp-1320000000 {
opp-hz = /bits/ 64 <1320000000>;
opp-microvolt = <862500>;
+ opp-supported-hw = <0x3>;
clock-latency-ns = <200000>;
};
opp-1440000000 {
opp-hz = /bits/ 64 <1440000000>;
opp-microvolt = <925000>;
+ opp-supported-hw = <0x3>;
clock-latency-ns = <200000>;
};
opp-1608000000 {
opp-hz = /bits/ 64 <1608000000>;
opp-microvolt = <987500>;
+ opp-supported-hw = <0x1>;
clock-latency-ns = <200000>;
};
opp-1800000000 {
opp-hz = /bits/ 64 <1800000000>;
opp-microvolt = <1062500>;
+ opp-supported-hw = <0x1>;
clock-latency-ns = <200000>;
};
};
@@ -321,6 +328,11 @@
reg = <0x0 0x000a4000 0x0 0x2000>;
#address-cells = <1>;
#size-cells = <1>;
+
+ cpu_speed_bin: cpu-speed-bin@135 {
+ reg = <0x135 0x1>;
+ bits = <7 1>;
+ };
};
prng: qrng@e3000 {

View File

@@ -1,45 +0,0 @@
From b4a32d218d424b81a58fbd419e1114b1c1f76168 Mon Sep 17 00:00:00 2001
From: Devi Priya <quic_devipriy@quicinc.com>
Date: Thu, 5 Oct 2023 21:35:50 +0530
Subject: [PATCH] pwm: driver for qualcomm ipq6018 pwm block
Describe the PWM block on IPQ6018.
The PWM is in the TCSR area. Make &tcsr "simple-mfd" compatible, and add
&pwm as child of &tcsr.
Add also ipq6018 specific compatible string.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Co-developed-by: Baruch Siach <baruch.siach@siklu.com>
Signed-off-by: Baruch Siach <baruch.siach@siklu.com>
Signed-off-by: Devi Priya <quic_devipriy@quicinc.com>
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -409,8 +409,21 @@
};
tcsr: syscon@1937000 {
- compatible = "qcom,tcsr-ipq6018", "syscon";
+ compatible = "qcom,tcsr-ipq6018", "syscon", "simple-mfd";
reg = <0x0 0x01937000 0x0 0x21000>;
+ ranges = <0x0 0x0 0x01937000 0x21000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ pwm: pwm@a010 {
+ compatible = "qcom,ipq6018-pwm";
+ reg = <0xa010 0x20>;
+ clocks = <&gcc GCC_ADSS_PWM_CLK>;
+ assigned-clocks = <&gcc GCC_ADSS_PWM_CLK>;
+ assigned-clock-rates = <100000000>;
+ #pwm-cells = <2>;
+ status = "disabled";
+ };
};
usb2: usb@70f8800 {

View File

@@ -1,66 +0,0 @@
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -471,6 +471,26 @@
qcom,ee = <0>;
};
+ blsp1_uart1: serial@78af000 {
+ compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+ reg = <0x0 0x78af000 0x0 0x200>;
+ interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>,
+ <&gcc GCC_BLSP1_AHB_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+ };
+
+ blsp1_uart2: serial@78b0000 {
+ compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+ reg = <0x0 0x78b0000 0x0 0x200>;
+ interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>,
+ <&gcc GCC_BLSP1_AHB_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+ };
+
blsp1_uart3: serial@78b1000 {
compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
reg = <0x0 0x078b1000 0x0 0x200>;
@@ -479,6 +499,36 @@
<&gcc GCC_BLSP1_AHB_CLK>;
clock-names = "core", "iface";
status = "disabled";
+ };
+
+ blsp1_uart4: serial@78b2000 {
+ compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+ reg = <0x0 0x078b2000 0x0 0x200>;
+ interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&gcc GCC_BLSP1_UART4_APPS_CLK>,
+ <&gcc GCC_BLSP1_AHB_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+ };
+
+ blsp1_uart5: serial@78b3000 {
+ compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+ reg = <0x0 0x78b3000 0x0 0x200>;
+ interrupts = <GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&gcc GCC_BLSP1_UART5_APPS_CLK>,
+ <&gcc GCC_BLSP1_AHB_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
+ };
+
+ blsp1_uart6: serial@78b4000 {
+ compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
+ reg = <0x0 0x078b4000 0x0 0x200>;
+ interrupts = <GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&gcc GCC_BLSP1_UART6_APPS_CLK>,
+ <&gcc GCC_BLSP1_AHB_CLK>;
+ clock-names = "core", "iface";
+ status = "disabled";
};
blsp1_spi1: spi@78b5000 {

View File

@@ -12,35 +12,6 @@ Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
drivers/remoteproc/qcom_q6v5_wcss.c | 235 +++++++++++++++++++++++---
2 files changed, 232 insertions(+), 23 deletions(-)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -789,8 +789,24 @@
"wcss_reset",
"wcss_q6_reset";
- clocks = <&gcc GCC_PRNG_AHB_CLK>;
- clock-names = "prng";
+ clocks = <&gcc GCC_PRNG_AHB_CLK>,
+ <&gcc GCC_SYS_NOC_WCSS_AHB_CLK>,
+ <&gcc GCC_Q6SS_ATBM_CLK>,
+ <&gcc GCC_Q6SS_PCLKDBG_CLK>,
+ <&gcc GCC_Q6_TSCTR_1TO2_CLK>;
+ clock-names = "prng",
+ "gcc_sys_noc_wcss_ahb_clk",
+ "gcc_q6ss_atbm_clk",
+ "gcc_q6ss_pclkdbg_clk",
+ "gcc_q6_tsctr_1to2_clk";
+ assigned-clocks = <&gcc GCC_SYS_NOC_WCSS_AHB_CLK>,
+ <&gcc GCC_Q6SS_PCLKDBG_CLK>,
+ <&gcc GCC_Q6_TSCTR_1TO2_CLK>,
+ <&gcc GCC_Q6SS_ATBM_CLK>;
+ assigned-clock-rates = <133333333>,
+ <600000000>,
+ <600000000>,
+ <240000000>;
qcom,halt-regs = <&tcsr 0x18000 0x1b000 0xe000>;
--- a/drivers/remoteproc/qcom_q6v5_wcss.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss.c
@@ -12,6 +12,7 @@

View File

@@ -1,122 +0,0 @@
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -764,6 +764,119 @@
};
};
+ wifi: wifi@c000000 {
+ compatible = "qcom,ipq6018-wifi";
+ reg = <0x0 0xc000000 0x0 0x1000000>;
+
+ interrupts = <0 320 IRQ_TYPE_EDGE_RISING>,
+ <0 319 IRQ_TYPE_EDGE_RISING>,
+ <0 318 IRQ_TYPE_EDGE_RISING>,
+ <0 316 IRQ_TYPE_EDGE_RISING>,
+ <0 315 IRQ_TYPE_EDGE_RISING>,
+ <0 314 IRQ_TYPE_EDGE_RISING>,
+ <0 311 IRQ_TYPE_EDGE_RISING>,
+ <0 310 IRQ_TYPE_EDGE_RISING>,
+ <0 411 IRQ_TYPE_EDGE_RISING>,
+ <0 410 IRQ_TYPE_EDGE_RISING>,
+ <0 40 IRQ_TYPE_EDGE_RISING>,
+ <0 39 IRQ_TYPE_EDGE_RISING>,
+ <0 302 IRQ_TYPE_EDGE_RISING>,
+ <0 301 IRQ_TYPE_EDGE_RISING>,
+ <0 37 IRQ_TYPE_EDGE_RISING>,
+ <0 36 IRQ_TYPE_EDGE_RISING>,
+ <0 296 IRQ_TYPE_EDGE_RISING>,
+ <0 295 IRQ_TYPE_EDGE_RISING>,
+ <0 294 IRQ_TYPE_EDGE_RISING>,
+ <0 293 IRQ_TYPE_EDGE_RISING>,
+ <0 292 IRQ_TYPE_EDGE_RISING>,
+ <0 291 IRQ_TYPE_EDGE_RISING>,
+ <0 290 IRQ_TYPE_EDGE_RISING>,
+ <0 289 IRQ_TYPE_EDGE_RISING>,
+ <0 288 IRQ_TYPE_EDGE_RISING>,
+ <0 239 IRQ_TYPE_EDGE_RISING>,
+ <0 236 IRQ_TYPE_EDGE_RISING>,
+ <0 235 IRQ_TYPE_EDGE_RISING>,
+ <0 234 IRQ_TYPE_EDGE_RISING>,
+ <0 233 IRQ_TYPE_EDGE_RISING>,
+ <0 232 IRQ_TYPE_EDGE_RISING>,
+ <0 231 IRQ_TYPE_EDGE_RISING>,
+ <0 230 IRQ_TYPE_EDGE_RISING>,
+ <0 229 IRQ_TYPE_EDGE_RISING>,
+ <0 228 IRQ_TYPE_EDGE_RISING>,
+ <0 224 IRQ_TYPE_EDGE_RISING>,
+ <0 223 IRQ_TYPE_EDGE_RISING>,
+ <0 203 IRQ_TYPE_EDGE_RISING>,
+ <0 183 IRQ_TYPE_EDGE_RISING>,
+ <0 180 IRQ_TYPE_EDGE_RISING>,
+ <0 179 IRQ_TYPE_EDGE_RISING>,
+ <0 178 IRQ_TYPE_EDGE_RISING>,
+ <0 177 IRQ_TYPE_EDGE_RISING>,
+ <0 176 IRQ_TYPE_EDGE_RISING>,
+ <0 163 IRQ_TYPE_EDGE_RISING>,
+ <0 162 IRQ_TYPE_EDGE_RISING>,
+ <0 160 IRQ_TYPE_EDGE_RISING>,
+ <0 414 IRQ_TYPE_EDGE_RISING>,
+ <0 159 IRQ_TYPE_EDGE_RISING>,
+ <0 158 IRQ_TYPE_EDGE_RISING>,
+ <0 157 IRQ_TYPE_EDGE_RISING>,
+ <0 156 IRQ_TYPE_EDGE_RISING>;
+
+ interrupt-names = "misc-pulse1",
+ "misc-latch",
+ "sw-exception",
+ "ce0",
+ "ce1",
+ "ce2",
+ "ce3",
+ "ce4",
+ "ce5",
+ "ce6",
+ "ce7",
+ "ce8",
+ "ce9",
+ "ce10",
+ "ce11",
+ "host2wbm-desc-feed",
+ "host2reo-re-injection",
+ "host2reo-command",
+ "host2rxdma-monitor-ring3",
+ "host2rxdma-monitor-ring2",
+ "host2rxdma-monitor-ring1",
+ "reo2ost-exception",
+ "wbm2host-rx-release",
+ "reo2host-status",
+ "reo2host-destination-ring4",
+ "reo2host-destination-ring3",
+ "reo2host-destination-ring2",
+ "reo2host-destination-ring1",
+ "rxdma2host-monitor-destination-mac3",
+ "rxdma2host-monitor-destination-mac2",
+ "rxdma2host-monitor-destination-mac1",
+ "ppdu-end-interrupts-mac3",
+ "ppdu-end-interrupts-mac2",
+ "ppdu-end-interrupts-mac1",
+ "rxdma2host-monitor-status-ring-mac3",
+ "rxdma2host-monitor-status-ring-mac2",
+ "rxdma2host-monitor-status-ring-mac1",
+ "host2rxdma-host-buf-ring-mac3",
+ "host2rxdma-host-buf-ring-mac2",
+ "host2rxdma-host-buf-ring-mac1",
+ "rxdma2host-destination-ring-mac3",
+ "rxdma2host-destination-ring-mac2",
+ "rxdma2host-destination-ring-mac1",
+ "host2tcl-input-ring4",
+ "host2tcl-input-ring3",
+ "host2tcl-input-ring2",
+ "host2tcl-input-ring1",
+ "wbm2host-tx-completions-ring4",
+ "wbm2host-tx-completions-ring3",
+ "wbm2host-tx-completions-ring2",
+ "wbm2host-tx-completions-ring1",
+ "tcl2host-status-ring";
+ qcom,rproc = <&q6v5_wcss>;
+ status = "disabled";
+ };
+
q6v5_wcss: remoteproc@cd00000 {
compatible = "qcom,ipq6018-wcss-pil";
reg = <0x0 0x0cd00000 0x0 0x4040>,

View File

@@ -1,24 +0,0 @@
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -212,6 +212,21 @@
reg = <0x0 0x4ab00000 0x0 0x5500000>;
no-map;
};
+
+ nss_region: nss@40000000 {
+ no-map;
+ reg = <0x0 0x40000000 0x0 0x01000000>;
+ };
+
+ q6_etr_region: q6_etr_dump@50000000 {
+ reg = <0x0 0x50000000 0x0 0x100000>;
+ no-map;
+ };
+
+ m3_dump_region: m3_dump@50100000 {
+ reg = <0x0 0x50100000 0x0 0x100000>;
+ no-map;
+ };
};
smem {

View File

@@ -1,29 +0,0 @@
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -476,6 +476,26 @@
};
};
+ sdhc: mmc@7804000 {
+ compatible = "qcom,ipq6018-sdhci", "qcom,sdhci-msm-v5";
+ reg = <0x0 0x7804000 0x0 0x1000>,
+ <0x0 0x7805000 0x0 0x1000>;
+ reg-names = "hc", "cqhci";
+
+ interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "hc_irq", "pwr_irq";
+
+ clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+ <&gcc GCC_SDCC1_APPS_CLK>,
+ <&xo>;
+ clock-names = "iface", "core", "xo";
+ resets = <&gcc GCC_SDCC1_BCR>;
+ max-frequency = <192000000>;
+
+ status = "disabled";
+ };
+
blsp_dma: dma-controller@7884000 {
compatible = "qcom,bam-v1.7.0";
reg = <0x0 0x07884000 0x0 0x2b000>;

View File

@@ -1,146 +0,0 @@
From d2e727bd0a259de2d6d329e3c659b8a1b6fbbc8b Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Sun, 15 Oct 2023 22:55:43 +0200
Subject: [PATCH] arm64: dts: qcom: ipq6018: add thermal nodes
IPQ6018 has a tsens v2.3.1 peripheral which monitors temperatures around
the various subsystems on the die.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 117 ++++++++++++++++++++++++++
1 file changed, 117 insertions(+)
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -357,6 +357,16 @@
clock-names = "core";
};
+ tsens: thermal-sensor@4a9000 {
+ compatible = "qcom,ipq6018-tsens", "qcom,ipq8074-tsens";
+ reg = <0x0 0x4a9000 0x0 0x1000>, /* TM */
+ <0x0 0x4a8000 0x0 0x1000>; /* SROT */
+ interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "combined";
+ #qcom,sensors = <16>;
+ #thermal-sensor-cells = <1>;
+ };
+
cryptobam: dma-controller@704000 {
compatible = "qcom,bam-v1.7.0";
reg = <0x0 0x00704000 0x0 0x20000>;
@@ -1042,6 +1052,113 @@
};
};
+ thermal-zones {
+ nss-top-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+
+ thermal-sensors = <&tsens 4>;
+
+ trips {
+ nss-top-crit {
+ temperature = <110000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ nss0-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+
+ thermal-sensors = <&tsens 5>;
+
+ trips {
+ nss-0-crit {
+ temperature = <110000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ wcss-phya0-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+
+ thermal-sensors = <&tsens 7>;
+
+ trips {
+ wcss-phya0-crit {
+ temperature = <110000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ wcss-phya1-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+
+ thermal-sensors = <&tsens 8>;
+
+ trips {
+ wcss-phya1-crit {
+ temperature = <110000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ cluster_thermal: cluster-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+
+ thermal-sensors = <&tsens 13>;
+
+ trips {
+ cluster-crit {
+ temperature = <110000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ lpass-qsdp6-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+
+ thermal-sensors = <&tsens 14>;
+
+ trips {
+ lpass-qsdp6-crit {
+ temperature = <110000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ package-top-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
+
+ thermal-sensors = <&tsens 15>;
+
+ trips {
+ package-top-crit {
+ temperature = <110000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,

View File

@@ -1,82 +1,3 @@
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -42,7 +42,6 @@
clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
clock-names = "cpu";
operating-points-v2 = <&cpu_opp_table>;
- cpu-supply = <&ipq6018_s2>;
};
CPU1: cpu@1 {
@@ -54,7 +53,6 @@
clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
clock-names = "cpu";
operating-points-v2 = <&cpu_opp_table>;
- cpu-supply = <&ipq6018_s2>;
};
CPU2: cpu@2 {
@@ -66,7 +64,6 @@
clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
clock-names = "cpu";
operating-points-v2 = <&cpu_opp_table>;
- cpu-supply = <&ipq6018_s2>;
};
CPU3: cpu@3 {
@@ -78,7 +75,6 @@
clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
clock-names = "cpu";
operating-points-v2 = <&cpu_opp_table>;
- cpu-supply = <&ipq6018_s2>;
};
L2_0: l2-cache {
@@ -113,6 +109,13 @@
clock-latency-ns = <200000>;
};
+ opp-1200000000 {
+ opp-hz = /bits/ 64 <1200000000>;
+ opp-microvolt = <850000>;
+ opp-supported-hw = <0x4>;
+ clock-latency-ns = <200000>;
+ };
+
opp-1320000000 {
opp-hz = /bits/ 64 <1320000000>;
opp-microvolt = <862500>;
@@ -127,6 +130,13 @@
clock-latency-ns = <200000>;
};
+ opp-1512000000 {
+ opp-hz = /bits/ 64 <1512000000>;
+ opp-microvolt = <937500>;
+ opp-supported-hw = <0x2>;
+ clock-latency-ns = <200000>;
+ };
+
opp-1608000000 {
opp-hz = /bits/ 64 <1608000000>;
opp-microvolt = <987500>;
@@ -164,16 +174,6 @@
rpm_requests: rpm-requests {
compatible = "qcom,rpm-ipq6018";
qcom,glink-channels = "rpm_requests";
-
- regulators {
- compatible = "qcom,rpm-mp5496-regulators";
-
- ipq6018_s2: s2 {
- regulator-min-microvolt = <725000>;
- regulator-max-microvolt = <1062500>;
- regulator-always-on;
- };
- };
};
};
};
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/ipq6018-mp5496.dtsi
@@ -0,0 +1,39 @@

View File

@@ -1,11 +0,0 @@
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -15,7 +15,7 @@
#size-cells = <2>;
interrupt-parent = <&intc>;
- clocks {
+ clocks: clocks {
sleep_clk: sleep-clk {
compatible = "fixed-clock";
clock-frequency = <32000>;

View File

@@ -3,6 +3,7 @@
preinit_reorder_eth() {
case $(board_name) in
lyt,t68m)
modprobe r8125 || true
ip link set eth0 name lan1
ip link set eth1 name lan2
ip link set eth2 name lan4

View File

@@ -165,8 +165,6 @@
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_usb_host_en>;
regulator-name = "vcc5v0_usb_host";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
vin-supply = <&vcc5v0_usb>;
@@ -179,8 +177,6 @@
pinctrl-names = "default";
pinctrl-0 = <&vcc5v0_usb_host2_en>;
regulator-name = "vcc5v0_usb_host2";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
vin-supply = <&vcc5v0_usb>;
@@ -302,10 +298,6 @@
vcc9-supply = <&vcc3v3_sys>;
wakeup-source;
codec {
rockchip,mic-in-differential;
};
regulators {
vdd_logic: DCDC_REG1 {
regulator-name = "vdd_logic";
@@ -502,7 +494,6 @@
pinctrl-names = "default";
pinctrl-0 = <&usbc1_int>;
vbus-supply = <&vcc3v3_sys>;
status = "okay";
};
vdd_cpu: regulator@40 {
@@ -561,20 +552,9 @@
};
&pcie2x1 {
reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>;
vpcie3v3-supply = <&vcc3v3_pcie30>;
status = "okay";
pcie@0,0 {
reg = <0x00000000 0 0 0 0>;
#address-cells = <3>;
#size-cells = <2>;
rtl8125: pcie@1,0 {
compatible = "pci10ec,8125";
reg = <0x000000 0 0 0 0>;
realtek,led-data = <0x200 0x2b 0x0 0x0>;
};
};
};
&pcie30phy {

View File

@@ -38,8 +38,8 @@ define Device/armsom_sige3
SOC := rk3568
DEVICE_DTS := rockchip/rk3568-armsom-sige3
UBOOT_DEVICE_NAME := sige3-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script vop | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-brcmfmac kmod-r8125 wpad-openssl brcmfmac-firmware-43752-sdio brcmfmac-nvram-43752-sdio -urngd
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := brcmfmac-firmware-43752-sdio kmod-brcmfmac kmod-r8125-rss wpad
endef
TARGET_DEVICES += armsom_sige3
@@ -342,7 +342,6 @@ define Device/rumu3f_fine-3399
endef
TARGET_DEVICES += rumu3f_fine-3399
define Device/scensmart_sv901-eaio
DEVICE_VENDOR := ScenSmart
DEVICE_MODEL := SV901 EAIO

View File

@@ -1,6 +1,7 @@
package provider
import (
"encoding"
"errors"
"fmt"
"time"
@@ -10,6 +11,8 @@ import (
"github.com/metacubex/mihomo/component/resource"
C "github.com/metacubex/mihomo/constant"
types "github.com/metacubex/mihomo/constant/provider"
"github.com/dlclark/regexp2"
)
var (
@@ -28,11 +31,13 @@ type healthCheckSchema struct {
type OverrideProxyNameSchema struct {
// matching expression for regex replacement
Pattern string `provider:"pattern"`
Pattern *regexp2.Regexp `provider:"pattern"`
// the new content after regex matching
Target string `provider:"target"`
}
var _ encoding.TextUnmarshaler = (*regexp2.Regexp)(nil) // ensure *regexp2.Regexp can decode direct by structure package
type OverrideSchema struct {
TFO *bool `provider:"tfo,omitempty"`
MPTcp *bool `provider:"mptcp,omitempty"`

View File

@@ -404,18 +404,10 @@ func proxiesParseAndFilter(filter string, excludeFilter string, excludeTypeArray
name := mapping["name"].(string)
mapping["name"] = name + *field.Interface().(*string)
case "proxy-name":
exprList, ok := field.Interface().([]OverrideProxyNameSchema)
if !ok {
return nil, fmt.Errorf("can't parse proxy-provider override proxy-name, please see the docs example config")
}
// Iterate through all naming replacement rules and perform the replacements.
for _, expr := range exprList {
for _, expr := range override.ProxyName {
name := mapping["name"].(string)
nameReg, err := regexp2.Compile(expr.Pattern, regexp2.None)
if err != nil {
return nil, fmt.Errorf("parse proxy name regular expression %q error: %w", expr.Pattern, err)
}
newName, err := nameReg.Replace(name, expr.Target, 0, -1)
newName, err := expr.Pattern.Replace(name, expr.Target, 0, -1)
if err != nil {
return nil, fmt.Errorf("proxy name replace error: %w", err)
}

View File

@@ -3,6 +3,7 @@ package structure
// references: https://github.com/mitchellh/mapstructure
import (
"encoding"
"encoding/base64"
"fmt"
"reflect"
@@ -86,7 +87,14 @@ func (d *Decoder) Decode(src map[string]any, dst any) error {
}
func (d *Decoder) decode(name string, data any, val reflect.Value) error {
for {
kind := val.Kind()
if kind == reflect.Pointer && val.IsNil() {
val.Set(reflect.New(val.Type().Elem()))
}
if ok, err := d.decodeTextUnmarshaller(name, data, val); ok {
return err
}
switch {
case isInt(kind):
return d.decodeInt(name, data, val)
@@ -97,10 +105,8 @@ func (d *Decoder) decode(name string, data any, val reflect.Value) error {
}
switch kind {
case reflect.Pointer:
if val.IsNil() {
val.Set(reflect.New(val.Type().Elem()))
}
return d.decode(name, data, val.Elem())
val = val.Elem()
continue
case reflect.String:
return d.decodeString(name, data, val)
case reflect.Bool:
@@ -117,6 +123,7 @@ func (d *Decoder) decode(name string, data any, val reflect.Value) error {
return fmt.Errorf("type %s not support", val.Kind().String())
}
}
}
func isInt(kind reflect.Kind) bool {
switch kind {
@@ -553,3 +560,25 @@ func (d *Decoder) setInterface(name string, data any, val reflect.Value) (err er
val.Set(dataVal)
return nil
}
func (d *Decoder) decodeTextUnmarshaller(name string, data any, val reflect.Value) (bool, error) {
if !val.CanAddr() {
return false, nil
}
valAddr := val.Addr()
if !valAddr.CanInterface() {
return false, nil
}
unmarshaller, ok := valAddr.Interface().(encoding.TextUnmarshaler)
if !ok {
return false, nil
}
var str string
if err := d.decodeString(name, data, reflect.Indirect(reflect.ValueOf(&str))); err != nil {
return false, err
}
if err := unmarshaller.UnmarshalText([]byte(str)); err != nil {
return true, fmt.Errorf("cannot parse '%s' as %s: %s", name, val.Type(), err)
}
return true, nil
}

View File

@@ -1,6 +1,7 @@
package structure
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
@@ -179,3 +180,90 @@ func TestStructure_SliceNilValueComplex(t *testing.T) {
err = decoder.Decode(rawMap, ss)
assert.NotNil(t, err)
}
func TestStructure_SliceCap(t *testing.T) {
rawMap := map[string]any{
"foo": []string{},
}
s := &struct {
Foo []string `test:"foo,omitempty"`
Bar []string `test:"bar,omitempty"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.NotNil(t, s.Foo) // structure's Decode will ensure value not nil when input has value even it was set an empty array
assert.Nil(t, s.Bar)
}
func TestStructure_Base64(t *testing.T) {
rawMap := map[string]any{
"foo": "AQID",
}
s := &struct {
Foo []byte `test:"foo"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.Equal(t, []byte{1, 2, 3}, s.Foo)
}
func TestStructure_Pointer(t *testing.T) {
rawMap := map[string]any{
"foo": "foo",
}
s := &struct {
Foo *string `test:"foo,omitempty"`
Bar *string `test:"bar,omitempty"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.NotNil(t, s.Foo)
assert.Equal(t, "foo", *s.Foo)
assert.Nil(t, s.Bar)
}
type num struct {
a int
}
func (n *num) UnmarshalText(text []byte) (err error) {
n.a, err = strconv.Atoi(string(text))
return
}
func TestStructure_TextUnmarshaller(t *testing.T) {
rawMap := map[string]any{
"num": "255",
"num_p": "127",
}
s := &struct {
Num num `test:"num"`
NumP *num `test:"num_p"`
}{}
err := decoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.Equal(t, 255, s.Num.a)
assert.NotNil(t, s.NumP)
assert.Equal(t, s.NumP.a, 127)
// test WeaklyTypedInput
rawMap["num"] = 256
err = decoder.Decode(rawMap, s)
assert.NotNilf(t, err, "should throw error: %#v", s)
err = weakTypeDecoder.Decode(rawMap, s)
assert.Nil(t, err)
assert.Equal(t, 256, s.Num.a)
// test invalid input
rawMap["num_p"] = "abc"
err = decoder.Decode(rawMap, s)
assert.NotNilf(t, err, "should throw error: %#v", s)
}

View File

@@ -3,6 +3,7 @@ package constant
import (
"encoding/json"
"errors"
"strings"
)
// DNSModeMapping is a mapping for EnhancedMode enum
@@ -27,7 +28,7 @@ func (e *DNSMode) UnmarshalYAML(unmarshal func(any) error) error {
if err := unmarshal(&tp); err != nil {
return err
}
mode, exist := DNSModeMapping[tp]
mode, exist := DNSModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -46,7 +47,7 @@ func (e *DNSMode) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(data, &tp); err != nil {
return err
}
mode, exist := DNSModeMapping[tp]
mode, exist := DNSModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -59,6 +60,21 @@ func (e DNSMode) MarshalJSON() ([]byte, error) {
return json.Marshal(e.String())
}
// UnmarshalText unserialize EnhancedMode
func (e *DNSMode) UnmarshalText(data []byte) error {
mode, exist := DNSModeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}
*e = mode
return nil
}
// MarshalText serialize EnhancedMode
func (e DNSMode) MarshalText() ([]byte, error) {
return []byte(e.String()), nil
}
func (e DNSMode) String() string {
switch e {
case DNSNormal:
@@ -150,7 +166,7 @@ func (e *FilterMode) UnmarshalYAML(unmarshal func(interface{}) error) error {
if err := unmarshal(&tp); err != nil {
return err
}
mode, exist := FilterModeMapping[tp]
mode, exist := FilterModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -167,7 +183,20 @@ func (e *FilterMode) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(data, &tp); err != nil {
return err
}
mode, exist := FilterModeMapping[tp]
mode, exist := FilterModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*e = mode
return nil
}
func (e FilterMode) MarshalText() ([]byte, error) {
return []byte(e.String()), nil
}
func (e *FilterMode) UnmarshalText(data []byte) error {
mode, exist := FilterModeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}

View File

@@ -56,6 +56,21 @@ func (e TUNStack) MarshalJSON() ([]byte, error) {
return json.Marshal(e.String())
}
// UnmarshalText unserialize TUNStack
func (e *TUNStack) UnmarshalText(data []byte) error {
mode, exist := StackTypeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid tun stack")
}
*e = mode
return nil
}
// MarshalText serialize TUNStack with json
func (e TUNStack) MarshalText() ([]byte, error) {
return []byte(e.String()), nil
}
func (e TUNStack) String() string {
switch e {
case TunGvisor:

View File

@@ -3,6 +3,7 @@ package log
import (
"encoding/json"
"errors"
"strings"
)
// LogLevelMapping is a mapping for LogLevel enum
@@ -28,7 +29,7 @@ type LogLevel int
func (l *LogLevel) UnmarshalYAML(unmarshal func(any) error) error {
var tp string
unmarshal(&tp)
level, exist := LogLevelMapping[tp]
level, exist := LogLevelMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -40,7 +41,7 @@ func (l *LogLevel) UnmarshalYAML(unmarshal func(any) error) error {
func (l *LogLevel) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
level, exist := LogLevelMapping[tp]
level, exist := LogLevelMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
@@ -48,9 +49,14 @@ func (l *LogLevel) UnmarshalJSON(data []byte) error {
return nil
}
// MarshalJSON serialize LogLevel with json
func (l LogLevel) MarshalJSON() ([]byte, error) {
return json.Marshal(l.String())
// UnmarshalText unserialize LogLevel
func (l *LogLevel) UnmarshalText(data []byte) error {
level, exist := LogLevelMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}
*l = level
return nil
}
// MarshalYAML serialize LogLevel with yaml
@@ -58,6 +64,16 @@ func (l LogLevel) MarshalYAML() (any, error) {
return l.String(), nil
}
// MarshalJSON serialize LogLevel with json
func (l LogLevel) MarshalJSON() ([]byte, error) {
return json.Marshal(l.String())
}
// MarshalText serialize LogLevel
func (l LogLevel) MarshalText() ([]byte, error) {
return []byte(l.String()), nil
}
func (l LogLevel) String() string {
switch l {
case INFO:

View File

@@ -21,18 +21,6 @@ const (
Direct
)
// UnmarshalJSON unserialize Mode
func (m *TunnelMode) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
mode, exist := ModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*m = mode
return nil
}
// UnmarshalYAML unserialize Mode with yaml
func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error {
var tp string
@@ -45,9 +33,26 @@ func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error {
return nil
}
// MarshalJSON serialize Mode
func (m TunnelMode) MarshalJSON() ([]byte, error) {
return json.Marshal(m.String())
// UnmarshalJSON unserialize Mode
func (m *TunnelMode) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
mode, exist := ModeMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*m = mode
return nil
}
// UnmarshalText unserialize Mode
func (m *TunnelMode) UnmarshalText(data []byte) error {
mode, exist := ModeMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid mode")
}
*m = mode
return nil
}
// MarshalYAML serialize TunnelMode with yaml
@@ -55,6 +60,16 @@ func (m TunnelMode) MarshalYAML() (any, error) {
return m.String(), nil
}
// MarshalJSON serialize Mode
func (m TunnelMode) MarshalJSON() ([]byte, error) {
return json.Marshal(m.String())
}
// MarshalText serialize Mode
func (m TunnelMode) MarshalText() ([]byte, error) {
return []byte(m.String()), nil
}
func (m TunnelMode) String() string {
switch m {
case Global:

View File

@@ -22,18 +22,6 @@ const (
Running
)
// UnmarshalJSON unserialize Status
func (s *TunnelStatus) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
status, exist := StatusMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid mode")
}
*s = status
return nil
}
// UnmarshalYAML unserialize Status with yaml
func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error {
var tp string
@@ -46,9 +34,26 @@ func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error {
return nil
}
// MarshalJSON serialize Status
func (s TunnelStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(s.String())
// UnmarshalJSON unserialize Status
func (s *TunnelStatus) UnmarshalJSON(data []byte) error {
var tp string
json.Unmarshal(data, &tp)
status, exist := StatusMapping[strings.ToLower(tp)]
if !exist {
return errors.New("invalid status")
}
*s = status
return nil
}
// UnmarshalText unserialize Status
func (s *TunnelStatus) UnmarshalText(data []byte) error {
status, exist := StatusMapping[strings.ToLower(string(data))]
if !exist {
return errors.New("invalid status")
}
*s = status
return nil
}
// MarshalYAML serialize TunnelMode with yaml
@@ -56,6 +61,16 @@ func (s TunnelStatus) MarshalYAML() (any, error) {
return s.String(), nil
}
// MarshalJSON serialize Status
func (s TunnelStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(s.String())
}
// MarshalText serialize Status
func (s TunnelStatus) MarshalText() ([]byte, error) {
return []byte(s.String()), nil
}
func (s TunnelStatus) String() string {
switch s {
case Suspend:

View File

@@ -2,8 +2,8 @@
name: Compile The New Clash Dev Core
on:
schedule:
- cron: "0 19 * * 1,3,5,6"
#schedule:
# - cron: "0 19 * * 1,3,5,6"
workflow_dispatch:
jobs:

View File

@@ -110,7 +110,7 @@ jobs:
- name: Setup loongarch abi1 Go
run: |
wget -q https://github.com/xishang0128/loongarch64-golang/releases/download/1.21.5/go1.21.5.linux-amd64-abi1.tar.gz
wget -q https://github.com/MetaCubeX/loongarch64-golang/releases/download/1.22.4/go1.22.4.linux-amd64-abi1.tar.gz
sudo tar zxf go1.21.5.linux-amd64-abi1.tar.gz -C /usr/local
echo "/usr/local/go/bin" >> $GITHUB_PATH
@@ -126,7 +126,7 @@ jobs:
- name: Setup loongarch abi2 Go
run: |
wget -q https://github.com/xishang0128/loongarch64-golang/releases/download/1.21.5/go1.21.5.linux-amd64-abi2.tar.gz
wget -q https://github.com/MetaCubeX/loongarch64-golang/releases/download/1.22.4/go1.22.4.linux-amd64-abi2.tar.gz
sudo tar zxf go1.21.5.linux-amd64-abi2.tar.gz -C /usr/local
- name: Compile Meta loongarch abi2 Clash

View File

@@ -2,8 +2,8 @@
name: Compile The New Clash Premium Core
on:
schedule:
- cron: "0 21 * * 1,3,5"
#schedule:
# - cron: "0 21 * * 1,3,5"
workflow_dispatch:
jobs:

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 vernesong
Copyright (c) 2019-2024 vernesong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.46.014
PKG_VERSION:=0.46.031
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
@@ -64,7 +64,6 @@ define Build/Prepare
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns.list" >/dev/null 2>&1
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns_policy.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns_policy.list" >/dev/null 2>&1
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_fallback_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_fallback_filter.yaml" >/dev/null 2>&1
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_netflix_domains.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_netflix_domains.list" >/dev/null 2>&1
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_force_sniffing_domain.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_force_sniffing_domain.yaml" >/dev/null 2>&1
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_domain_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_domain_filter.yaml" >/dev/null 2>&1
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_ports_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_ports_filter.yaml" >/dev/null 2>&1
@@ -132,11 +131,9 @@ define Package/$(PKG_NAME)/postrm
rm -rf ${dnsmasqconfdir}/dnsmasq_openclash_custom_domain.conf >/dev/null 2>&1
rm -rf ${dnsmasqconfdir}/dnsmasq_openclash_chnroute_pass.conf >/dev/null 2>&1
rm -rf ${dnsmasqconfdir}/dnsmasq_openclash_chnroute6_pass.conf >/dev/null 2>&1
rm -rf ${dnsmasqconfdir}/dnsmasq_accelerated-domains.china.conf >/dev/null 2>&1
rm -rf /tmp/dler* >/dev/null 2>&1
rm -rf /tmp/etc/openclash >/dev/null 2>&1
rm -rf /tmp/openclash_edit_file_name >/dev/null 2>&1
rm -rf /tmp/openclash_*_region>/dev/null 2>&1
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
sed -i '/.*kB maximum content size*/c\HTTP_MAX_CONTENT = 1024*100 -- 100 kB maximum content size' /usr/lib/lua/luci/http.lua >/dev/null 2>&1
sed -i '/.*kB maximum content size*/c\export let HTTP_MAX_CONTENT = 1024*100; // 100 kB maximum content size' /usr/share/ucode/luci/http.uc >/dev/null 2>&1

View File

@@ -32,10 +32,6 @@ function index()
entry({"admin", "services", "openclash", "coreupdate"},call("action_coreupdate"))
entry({"admin", "services", "openclash", "flush_fakeip_cache"}, call("action_flush_fakeip_cache"))
entry({"admin", "services", "openclash", "download_rule"}, call("action_download_rule"))
entry({"admin", "services", "openclash", "download_netflix_domains"}, call("action_download_netflix_domains"))
entry({"admin", "services", "openclash", "download_disney_domains"}, call("action_download_disney_domains"))
entry({"admin", "services", "openclash", "catch_netflix_domains"}, call("action_catch_netflix_domains"))
entry({"admin", "services", "openclash", "write_netflix_domains"}, call("action_write_netflix_domains"))
entry({"admin", "services", "openclash", "restore"}, call("action_restore_config"))
entry({"admin", "services", "openclash", "backup"}, call("action_backup"))
entry({"admin", "services", "openclash", "backup_ex_core"}, call("action_backup_ex_core"))
@@ -103,18 +99,17 @@ local json = require "luci.jsonc"
local uci = require("luci.model.uci").cursor()
local datatype = require "luci.cbi.datatypes"
local opkg
local device_name = uci:get("system", "@system[0]", "hostname")
local device_arh = luci.sys.exec("uname -m |tr -d '\n'")
if pcall(require, "luci.model.ipkg") then
opkg = require "luci.model.ipkg"
end
local core_path_mode = uci:get("openclash", "config", "small_flash_memory")
if core_path_mode ~= "1" then
dev_core_path="/etc/openclash/core/clash"
tun_core_path="/etc/openclash/core/clash_tun"
meta_core_path="/etc/openclash/core/clash_meta"
else
dev_core_path="/tmp/etc/openclash/core/clash"
tun_core_path="/tmp/etc/openclash/core/clash_tun"
meta_core_path="/tmp/etc/openclash/core/clash_meta"
end
@@ -126,10 +121,6 @@ local function is_web()
return luci.sys.call("pidof clash >/dev/null") == 0
end
local function restricted_mode()
return uci:get("openclash", "config", "restricted_mode")
end
local function is_watchdog()
return process_status("openclash_watchdog.sh")
end
@@ -158,14 +149,6 @@ local function lhie1()
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/usr/share/openclash/res/lhie1.yaml"))
end
local function ConnersHua()
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/usr/share/openclash/res/ConnersHua.yaml"))
end
local function ConnersHua_return()
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/usr/share/openclash/res/ConnersHua_return.yaml"))
end
local function chnroute()
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/etc/openclash/china_ip_route.ipset"))
end
@@ -238,29 +221,13 @@ local function coremodel()
end
local function check_core()
if not nixio.fs.access(dev_core_path) and not nixio.fs.access(tun_core_path) and not nixio.fs.access(meta_core_path) then
if not nixio.fs.access(meta_core_path) then
return "0"
else
return "1"
end
end
local function corecv()
if not nixio.fs.access(dev_core_path) then
return "0"
else
return luci.sys.exec(string.format("%s -v 2>/dev/null |awk -F ' ' '{print $2}'", dev_core_path))
end
end
local function coretuncv()
if not nixio.fs.access(tun_core_path) then
return "0"
else
return luci.sys.exec(string.format("%s -v 2>/dev/null |awk -F ' ' '{print $2}'", tun_core_path))
end
end
local function coremetacv()
if not nixio.fs.access(meta_core_path) then
return "0"
@@ -271,10 +238,8 @@ end
local function corelv()
luci.sys.call("bash /usr/share/openclash/clash_version.sh")
local core_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null")
local core_tun_lv = luci.sys.exec("sed -n 2p /tmp/clash_last_version 2>/dev/null")
local core_meta_lv = luci.sys.exec("sed -n 3p /tmp/clash_last_version 2>/dev/null")
return core_lv .. "," .. core_tun_lv .. "," .. core_meta_lv
return core_meta_lv
end
local function opcv()
@@ -354,13 +319,9 @@ function core_download()
local cdn_url = luci.http.formvalue("url")
if cdn_url then
luci.sys.call(string.format("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh '%s' >/dev/null 2>&1", cdn_url))
luci.sys.call(string.format("bash /usr/share/openclash/openclash_core.sh 'Dev' '%s' >/dev/null 2>&1 &", cdn_url))
luci.sys.call(string.format("bash /usr/share/openclash/openclash_core.sh 'TUN' '%s' >/dev/null 2>&1 &", cdn_url))
luci.sys.call(string.format("bash /usr/share/openclash/openclash_core.sh 'Meta' '%s' >/dev/null 2>&1 &", cdn_url))
else
luci.sys.call("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Dev' >/dev/null 2>&1 &")
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'TUN' >/dev/null 2>&1 &")
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &")
end
@@ -372,16 +333,6 @@ function download_rule()
return state
end
function download_disney_domains()
local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_rule_list.sh "%s" >/dev/null 2>&1',"disney_domains"))
return state
end
function download_netflix_domains()
local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_rule_list.sh "%s" >/dev/null 2>&1',"netflix_domains"))
return state
end
function action_flush_fakeip_cache()
local state = 0
if is_running() then
@@ -751,7 +702,7 @@ function action_rule_mode()
local daip = daip()
local dase = dase() or ""
local cn_port = cn_port()
core_type = uci:get("openclash", "config", "core_type") or "Dev"
core_type = uci:get("openclash", "config", "core_type") or "Meta"
if not daip or not cn_port then return end
info = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/configs', dase, daip, cn_port)))
if info then
@@ -773,9 +724,7 @@ function action_switch_rule_mode()
local daip = daip()
local dase = dase() or ""
local cn_port = cn_port()
local core_type = uci:get("openclash", "config", "core_type") or "Dev"
mode = luci.http.formvalue("rule_mode")
if mode == script and core_type ~= "TUN" then luci.http.status(500, "Switch Faild") return end
if not daip or not cn_port then luci.http.status(500, "Switch Faild") return end
info = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XPATCH http://"%s":"%s"/configs -d \'{\"mode\": \"%s\"}\'', dase, daip, cn_port, mode))
if info ~= "" then
@@ -1081,8 +1030,7 @@ function action_status()
db_forward_ssl = db_foward_ssl(),
web = is_web(),
cn_port = cn_port(),
restricted_mode = restricted_mode(),
core_type = uci:get("openclash", "config", "core_type") or "Dev";
core_type = uci:get("openclash", "config", "core_type") or "Meta";
})
end
@@ -1090,8 +1038,6 @@ function action_state()
luci.http.prepare_content("application/json")
luci.http.write_json({
lhie1 = lhie1(),
ConnersHua = ConnersHua(),
ConnersHua_return = ConnersHua_return(),
ipdb = ipdb(),
geosite = geosite(),
historychecktime = historychecktime(),
@@ -1117,8 +1063,6 @@ end
function action_update()
luci.http.prepare_content("application/json")
luci.http.write_json({
corecv = corecv(),
coretuncv = coretuncv(),
coremetacv = coremetacv(),
coremodel = coremodel(),
opcv = opcv(),
@@ -1198,20 +1142,6 @@ function action_download_rule()
})
end
function action_download_netflix_domains()
luci.http.prepare_content("application/json")
luci.http.write_json({
rule_download_status = download_netflix_domains();
})
end
function action_download_disney_domains()
luci.http.prepare_content("application/json")
luci.http.write_json({
rule_download_status = download_disney_domains();
})
end
function action_refresh_log()
luci.http.prepare_content("application/json")
local logfile="/tmp/openclash.log"
@@ -1326,38 +1256,6 @@ function split(str,delimiter)
return arr
end
function action_write_netflix_domains()
local domains = luci.http.formvalue("domains")
local dustom_file = "/etc/openclash/custom/openclash_custom_netflix_domains.list"
local file = io.open(dustom_file, "a+")
file:seek("set")
local domain = file:read("*a")
for v, k in pairs(split(domains,"\n")) do
if not string.find(domain,k,1,true) then
file:write(k.."\n")
end
end
file:close()
return
end
function action_catch_netflix_domains()
local cmd = "/usr/share/openclash/openclash_debug_getcon.lua 'netflix-nflxvideo'"
luci.http.prepare_content("text/plain")
local util = io.popen(cmd)
if util and util ~= "" then
while true do
local ln = util:read("*l")
if not ln then break end
luci.http.write(ln)
luci.http.write(",")
end
util:close()
return
end
luci.http.status(500, "Bad address")
end
function action_diag_connection()
local addr = luci.http.formvalue("addr")
if addr and (datatype.hostname(addr) or datatype.ipaddr(addr)) then
@@ -1425,8 +1323,8 @@ function action_backup()
local reader = ltn12_popen("tar -C '/etc/openclash/' -cz . 2>/dev/null")
luci.http.header(
'Content-Disposition', 'attachment; filename="Backup-OpenClash-%s.tar.gz"' %{
os.date("%Y-%m-%d-%H-%M-%S")
'Content-Disposition', 'attachment; filename="Backup-OpenClash-%s-%s-%s.tar.gz"' %{
device_name, device_arh, os.date("%Y-%m-%d-%H-%M-%S")
})
luci.http.prepare_content("application/x-targz")
@@ -1439,8 +1337,8 @@ function action_backup_ex_core()
local reader = ltn12_popen("echo 'core' > /tmp/oc_exclude.txt && tar -C '/etc/openclash/' -X '/tmp/oc_exclude.txt' -cz . 2>/dev/null")
luci.http.header(
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Exclude-Cores-%s.tar.gz"' %{
os.date("%Y-%m-%d-%H-%M-%S")
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Exclude-Cores-%s-%s-%s.tar.gz"' %{
device_name, device_arh, os.date("%Y-%m-%d-%H-%M-%S")
})
luci.http.prepare_content("application/x-targz")
@@ -1452,8 +1350,8 @@ function action_backup_only_config()
local reader = ltn12_popen("tar -C '/etc/openclash' -cz './config' 2>/dev/null")
luci.http.header(
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Config-%s.tar.gz"' %{
os.date("%Y-%m-%d-%H-%M-%S")
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Config-%s-%s-%s.tar.gz"' %{
device_name, device_arh, os.date("%Y-%m-%d-%H-%M-%S")
})
luci.http.prepare_content("application/x-targz")
@@ -1464,8 +1362,8 @@ function action_backup_only_core()
local reader = ltn12_popen("tar -C '/etc/openclash' -cz './core' 2>/dev/null")
luci.http.header(
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Cores-%s.tar.gz"' %{
os.date("%Y-%m-%d-%H-%M-%S")
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Cores-%s-%s-%s.tar.gz"' %{
device_name, device_arh, os.date("%Y-%m-%d-%H-%M-%S")
})
luci.http.prepare_content("application/x-targz")
@@ -1476,8 +1374,8 @@ function action_backup_only_rule()
local reader = ltn12_popen("tar -C '/etc/openclash' -cz './rule_provider' 2>/dev/null")
luci.http.header(
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Only-Rule-Provider-%s.tar.gz"' %{
os.date("%Y-%m-%d-%H-%M-%S")
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Only-Rule-Provider-%s-%s-%s.tar.gz"' %{
device_name, device_arh, os.date("%Y-%m-%d-%H-%M-%S")
})
luci.http.prepare_content("application/x-targz")
@@ -1488,8 +1386,8 @@ function action_backup_only_proxy()
local reader = ltn12_popen("tar -C '/etc/openclash' -cz './proxy_provider' 2>/dev/null")
luci.http.header(
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Proxy-Provider-%s.tar.gz"' %{
os.date("%Y-%m-%d-%H-%M-%S")
'Content-Disposition', 'attachment; filename="Backup-OpenClash-Proxy-Provider-%s-%s-%s.tar.gz"' %{
device_name, device_arh, os.date("%Y-%m-%d-%H-%M-%S")
})
luci.http.prepare_content("application/x-targz")

View File

@@ -18,6 +18,7 @@ bold_off = [[</strong>]]
local op_mode = string.sub(luci.sys.exec('uci get openclash.config.operation_mode 2>/dev/null'),0,-2)
if not op_mode then op_mode = "redir-host" end
local lan_int_name = uci:get("openclash", "config", "lan_interface_name") or "0"
local lan_ip
if lan_int_name == "0" then
lan_ip = SYS.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n'")
@@ -146,26 +147,9 @@ o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate("
o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off
o.default = 0
---- Fallback DNS Proxy Group
o = s:taboption("dns", Value, "proxy_dns_group", font_red..bold_on..translate("Fallback DNS Proxy Group (Support Regex)")..bold_off..font_off)
o.description = translate("Group Use For Proxy The Fallback DNS, Preventing DNS Lookup Failures")..translate("(Only Meta Core)")
local groupnames,filename
filename = m.uci:get("openclash", "config", "config_path")
if filename then
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
o:value(groupname)
end
end
end
end
o:value("DIRECT")
o:value("Disable", translate("Disable"))
o.default = "Disable"
o.rempty = false
o = s:taboption("dns", Flag, "enable_respect_rules", font_red..bold_on..translate("Respect Rules")..bold_off..font_off)
o.description = font_red..bold_on..translate("Whether or not The Connection to the DNS Server Follow the Rules in Config")..bold_off..font_off
o.default = 0
o = s:taboption("dns", Flag, "append_wan_dns", translate("Append Upstream DNS"))
o.description = translate("Append The Upstream Assigned DNS And Gateway IP To The Nameserver")
@@ -225,6 +209,13 @@ if op_mode == "fake-ip" then
o = s:taboption("dns", Flag, "custom_fakeip_filter", translate("Fake-IP-Filter"))
o.default = 0
o = s:taboption("dns", ListValue, "custom_fakeip_filter_mode", translate("Fake-IP-Filter-Mode"))
o.description = translate("Fake-IP is not returned if the matching succeeds when blacklist mode or Fake-IP is returned if the matching succeeds when whitelist mode")
o.default = "blacklist"
o:value("blacklist", translate("Blacklist Mode"))
o:value("whitelist", translate("Whitelist Mode"))
o:depends("custom_fakeip_filter", "1")
custom_fake_black = s:taboption("dns", Value, "custom_fake_filter")
custom_fake_black.template = "cbi/tvalue"
custom_fake_black.description = translate("Domain Names In The List Do Not Return Fake-IP, One rule per line")
@@ -432,7 +423,7 @@ o.default = 0
custom_rules = s:taboption("rules", Value, "custom_rules")
custom_rules:depends("enable_custom_clash_rules", 1)
custom_rules.template = "cbi/tvalue"
custom_rules.description = font_green..bold_on..translate("(Priority)")..bold_off..font_off.." "..translate("Custom Rules Here, For More Go:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://lancellc.gitbook.io/clash/clash-config-file/rules\")'>https://lancellc.gitbook.io/clash/clash-config-file/rules</a>".." ,"..translate("IP To CIDR:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"http://ip2cidr.com\")'>http://ip2cidr.com</a>"
custom_rules.description = font_green..bold_on..translate("(Priority)")..bold_off..font_off.." "..translate("Custom Rules Here, For More Go:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rules/\")'>https://wiki.metacubex.one/config/rules/</a>".." ,"..translate("IP To CIDR:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"http://ip2cidr.com\")'>http://ip2cidr.com</a>"
custom_rules.rows = 20
custom_rules.wrap = "off"
@@ -452,7 +443,7 @@ end
custom_rules_2 = s:taboption("rules", Value, "custom_rules_2")
custom_rules_2:depends("enable_custom_clash_rules", 1)
custom_rules_2.template = "cbi/tvalue"
custom_rules_2.description = font_green..bold_on..translate("(Extended)")..bold_off..font_off.." "..translate("Custom Rules Here, For More Go:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://lancellc.gitbook.io/clash/clash-config-file/rules\")'>https://lancellc.gitbook.io/clash/clash-config-file/rules</a>".." ,"..translate("IP To CIDR:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"http://ip2cidr.com\")'>http://ip2cidr.com</a>"
custom_rules_2.description = font_green..bold_on..translate("(Extended)")..bold_off..font_off.." "..translate("Custom Rules Here, For More Go:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/config/rules/\")'>https://wiki.metacubex.one/config/rules/</a>".." ,"..translate("IP To CIDR:").." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"http://ip2cidr.com\")'>http://ip2cidr.com</a>"
custom_rules_2.rows = 20
custom_rules_2.wrap = "off"
@@ -572,10 +563,6 @@ o = ss:option(DummyValue, "rule_name", translate("Other Rules Name"))
function o.cfgvalue(...)
if Value.cfgvalue(...) == "lhie1" then
return translate("lhie1 Rules")
elseif Value.cfgvalue(...) == "ConnersHua" then
return translate("ConnersHua(Provider-type) Rules")
elseif Value.cfgvalue(...) == "ConnersHua_return" then
return translate("ConnersHua Return Rules")
else
return translate("None")
end

View File

@@ -177,6 +177,12 @@ o:value("true", translate("Enable"))
o.default = "false"
o:depends("sub_convert", "1")
---- custom params
o = s:option(DynamicList, "custom_params", translate("Custom Params"))
o.description = font_red..bold_on..translate("eg: \"rename=\\s+([2-9])[xX]@ (HIGH:$1)\"")..bold_off..font_off
o.rmempty = false
o:depends("sub_convert", "1")
---- key
o = s:option(DynamicList, "keyword", font_red..bold_on..translate("Keyword Match")..bold_off..font_off)
o.description = font_red..bold_on..translate("eg: hk or tw&bgp")..bold_off..font_off

View File

@@ -79,6 +79,20 @@ o:depends("type", "https")
o.rmempty = false
o.default = o.disbled
---- ECS Subnet
o = s:option(Value, "ecs_subnet", translate("ECS Subnet"),translate("Specify the ECS Subnet Address")..translate("(Only Meta Core)"))
o:depends("type", "https")
o.rmempty = true
o.datatype = "ipaddr"
o:value("1.1.1.1/24")
---- ECS Override
o = s:option(Flag, "ecs_override", translate("ECS Override"),translate("Override the ECS Subnet Address")..translate("(Only Meta Core)"))
o:depends("type", "https")
o.rmempty = false
o.datatype = "ipaddr"
o.default = o.disbled
---- Proxy group
o = s:option(Value, "specific_group", translate("Specific Group (Support Regex)"))
o.description = translate("Group Use For Proxy The DNS")..translate("(Only Meta Core)")

Some files were not shown because too many files have changed in this diff Show More