Commit Graph

28288 Commits

Author SHA1 Message Date
David Bauer
7890dd75ad ramips: fix mt7621 kernel compilation
The OF LED configuration patch fails on MT7621, as the necessary headers
were only included for the mediatek subtarget with an additional patch.

Fixes: 242fe8634e ("generic: add hack for MT753x LED configuration")

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-05-12 09:38:58 +02:00
Christian Marangi
2d0125bd85
ath79: rb91x_nand: fix compilation warning for dev_err
Fix compilation warning for dev_err in rb91x_nand driver.
Fix compilation warning:
drivers/mtd/nand/raw/rb91x_nand.c:289:25: note: in expansion of macro 'dev_err'
  289 |                         dev_err(dev, "failed to get gpios: %d\n",
      |                         ^~~~~~~
drivers/mtd/nand/raw/rb91x_nand.c:289:61: note: format string is defined here
  289 |                         dev_err(dev, "failed to get gpios: %d\n",
      |                                                            ~^
      |                                                             |
      |                                                             int
      |                                                            %ld
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:43 +02:00
Christian Marangi
150508e47c
bmips: 5.15: comment unused macronix_nand_block_protection_support
Comment unused function macronix_nand_block_protection_support since it
does cause boot problem
Fix compilation error:
drivers/mtd/nand/raw/nand_macronix.c:220:13: error: 'macronix_nand_block_protection_support' defined but not used [-Werror=unused-function]
  220 | static void macronix_nand_block_protection_support(struct nand_chip *chip)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:42 +02:00
Christian Marangi
f47c378113
bcm63xx: 5.15: comment unused macronix_nand_block_protection_support
Comment unused macronix_nand_block_protection_support due to workaround
needed to fix booting
Fix compilation warning:
drivers/mtd/nand/raw/nand_macronix.c:220:13: error: 'macronix_nand_block_protection_support' defined but not used [-Werror=unused-function]
  220 | static void macronix_nand_block_protection_support(struct nand_chip *chip)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:42 +02:00
Christian Marangi
4d702a5399
ath79: gpio-latch: fix compilation warning for wrong dev_err %
Fix compilation warning for using %d instead of %ld for gpio-latch in
dev_err.
Fix compilation warning:
In file included from ./include/linux/device.h:15,
                 from ./include/linux/gpio/driver.h:5,
                 from drivers/gpio/gpio-latch.c:13:
drivers/gpio/gpio-latch.c: In function 'gpio_latch_probe':
drivers/gpio/gpio-latch.c:137:46: error: format '%d' expects argument of type 'int', but argument 4 has type 'long int' [-Werror=format=]
  137 |                                 dev_err(dev, "failed to get gpio %d: %d\n", i,
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
  110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
      |                              ^~~
./include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt'
  144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
      |                                                        ^~~~~~~
drivers/gpio/gpio-latch.c:137:33: note: in expansion of macro 'dev_err'
  137 |                                 dev_err(dev, "failed to get gpio %d: %d\n", i,
      |                                 ^~~~~~~
drivers/gpio/gpio-latch.c:137:71: note: format string is defined here
  137 |                                 dev_err(dev, "failed to get gpio %d: %d\n", i,
      |                                                                      ~^
      |                                                                       |
      |                                                                       int
      |                                                                      %ld
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:42 +02:00
Christian Marangi
2f9bc747cb
mvebu: 5.15: fix compilation warning for mangle bootargs patch
Fix compilation warning for mangle bootargs patch.
Fix compilation warning:
arch/arm/boot/compressed/atags_to_fdt.c: In function 'append_rootblock':
arch/arm/boot/compressed/atags_to_fdt.c:84:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
   84 |         ptr = str - 1;
      |             ^
arch/arm/boot/compressed/atags_to_fdt.c: In function 'atags_to_fdt':
arch/arm/boot/compressed/atags_to_fdt.c:213:18: error: unused variable 'memsize' [-Werror=unused-variable]
  213 |         int ret, memsize;
      |                  ^~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:212:13: error: unused variable 'memcount' [-Werror=unused-variable]
  212 |         int memcount = 0;
      |             ^~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:211:16: error: unused variable 'mem_reg_property' [-Werror=unused-variable]
  211 |         __be32 mem_reg_property[2 * 2 * NR_BANKS];
      |                ^~~~~~~~~~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c: At top level:
arch/arm/boot/compressed/atags_to_fdt.c:180:13: error: 'hex_str' defined but not used [-Werror=unused-function]
  180 | static void hex_str(char *out, uint32_t value)
      |             ^~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:63:17: error: 'get_cell_size' defined but not used [-Werror=unused-function]
   63 | static uint32_t get_cell_size(const void *fdt)
      |                 ^~~~~~~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:43:12: error: 'setprop_cell' defined but not used [-Werror=unused-function]
   43 | static int setprop_cell(void *fdt, const char *node_path,
      |            ^~~~~~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:25:12: error: 'setprop' defined but not used [-Werror=unused-function]
   25 | static int setprop(void *fdt, const char *node_path, const char *property,
      |            ^~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:42 +02:00
Christian Marangi
bec927c70f
ipq40xx: 5.15: add patch commenting unused sdhci function
Add patch commenting unused sdhci function, hopin this will be dropped
when the problem is actually found.
Fix compilation warning:
drivers/mmc/host/sdhci-msm.c:1781:13: error: 'sdhci_msm_set_clock' defined but not used [-Werror=unused-function]
 1781 | static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)
      |             ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:41 +02:00
Christian Marangi
0d4a547905
layerscape: 5.15: fix compilation warning for fsl ppfe driver
Rework some desc dump and dummy pkt function to fix compilation warning.
Fix compilation warning:
drivers/staging/fsl_ppfe/pfe_hif.c: In function 'send_dummy_pkt_to_hif':
drivers/staging/fsl_ppfe/pfe_hif.c:118:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  118 |         ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL));
      |                   ^
drivers/staging/fsl_ppfe/pfe_hif.c:122:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  122 |         lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL));
      |                    ^
drivers/staging/fsl_ppfe/pfe_hif.c: In function 'pfe_hif_desc_dump':
drivers/staging/fsl_ppfe/pfe_hif.c:195:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  195 |         desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
      |                        ^
drivers/staging/fsl_ppfe/pfe_hif.c:195:36: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  195 |         desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
      |                                    ^
drivers/staging/fsl_ppfe/pfe_hif.c:207:19: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  207 |         desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
      |                   ^
drivers/staging/fsl_ppfe/pfe_hif.c:207:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  207 |         desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
      |                               ^
cc1: all warnings being treated as errors

In file included from ./include/linux/kernel.h:19,
                 from ./include/linux/list.h:9,
                 from ./include/linux/wait.h:7,
                 from ./include/linux/eventfd.h:13,
                 from drivers/staging/fsl_ppfe/pfe_cdev.c:11:
drivers/staging/fsl_ppfe/pfe_cdev.c: In function 'pfe_cdev_read':
./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Werror=format=]
    5 | #define KERN_SOH        "\001"          /* ASCII Start Of Header */
      |                         ^~~~~~
./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
  422 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
      |                         ^~~~
./include/linux/printk.h:132:17: note: in expansion of macro 'printk'
  132 |                 printk(fmt, ##__VA_ARGS__);             \
      |                 ^~~~~~
./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk'
  580 |         no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
      |         ^~~~~~~~~
./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH'
   15 | #define KERN_DEBUG      KERN_SOH "7"    /* debug-level messages */
      |                         ^~~~~~~~
./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG'
  580 |         no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
      |                   ^~~~~~~~~~
drivers/staging/fsl_ppfe/pfe_cdev.c:42:17: note: in expansion of macro 'pr_debug'
   42 |                 pr_debug("%u  %lu", link_states[ret].phy_id,
      |                 ^~~~~~~~
./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
    5 | #define KERN_SOH        "\001"          /* ASCII Start Of Header */
      |                         ^~~~~~
./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
  422 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
      |                         ^~~~
./include/linux/printk.h:493:9: note: in expansion of macro 'printk'
  493 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
      |         ^~~~~~
./include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH'
   11 | #define KERN_ERR        KERN_SOH "3"    /* error conditions */
      |                         ^~~~~~~~
./include/linux/printk.h:493:16: note: in expansion of macro 'KERN_ERR'
  493 |         printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
      |                ^~~~~~~~
drivers/staging/fsl_ppfe/pfe_cdev.c:50:17: note: in expansion of macro 'pr_err'
   50 |                 pr_err("Failed to send (%d)bytes of (%lu) requested.\n",
      |                 ^~~~~~
./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'unsigned int' [-Werror=format=]
    5 | #define KERN_SOH        "\001"          /* ASCII Start Of Header */
      |                         ^~~~~~
./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
  422 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
      |                         ^~~~
./include/linux/printk.h:132:17: note: in expansion of macro 'printk'
  132 |                 printk(fmt, ##__VA_ARGS__);             \
      |                 ^~~~~~
./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk'
  580 |         no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
      |         ^~~~~~~~~
./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH'
   15 | #define KERN_DEBUG      KERN_SOH "7"    /* debug-level messages */
      |                         ^~~~~~~~
./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG'
  580 |         no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
      |                   ^~~~~~~~~~
drivers/staging/fsl_ppfe/pfe_cdev.c:57:9: note: in expansion of macro 'pr_debug'
   57 |         pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states));
      |         ^~~~~~~~
cc1: all warnings being treated as errors

In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from ./include/linux/list.h:5,
                 from ./include/linux/module.h:12,
                 from drivers/staging/fsl_ppfe/pfe_sysfs.c:7:
drivers/staging/fsl_ppfe/pfe_sysfs.c: In function 'pfe_set_util':
./include/linux/stddef.h:8:14: error: passing argument 2 of 'kstrtoul' makes integer from pointer without a cast [-Werror=int-conversion]
    8 | #define NULL ((void *)0)
      |              ^~~~~~~~~~~
      |              |
      |              void *
drivers/staging/fsl_ppfe/pfe_sysfs.c:538:39: note: in expansion of macro 'NULL'
  538 |         util_do_clear = kstrtoul(buf, NULL, 0);
      |                                       ^~~~
In file included from ./include/linux/kernel.h:13,
                 from ./include/linux/list.h:9:
./include/linux/kstrtox.h:30:69: note: expected 'unsigned int' but argument is of type 'void *'
   30 | static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
      |                                                        ~~~~~~~~~~~~~^~~~
cc1: all warnings being treated as errors

With UTIL compiled on, fix compilation warning:
drivers/staging/fsl_ppfe/pfe_hal.c: In function 'pe_load_ddr_section':
drivers/staging/fsl_ppfe/pfe_hal.c:617:19: error: 'else' without a previous 'if'
  617 |                 } else {
      |                   ^~~~
drivers/staging/fsl_ppfe/pfe_hal.c:622:17: error: break statement not within loop or switch
  622 |                 break;
      |                 ^~~~~
drivers/staging/fsl_ppfe/pfe_hal.c:624:9: error: case label not within a switch statement
  624 |         case SHT_NOBITS:
      |         ^~~~
drivers/staging/fsl_ppfe/pfe_hal.c:627:17: error: break statement not within loop or switch
  627 |                 break;
      |                 ^~~~~
drivers/staging/fsl_ppfe/pfe_hal.c:629:9: error: 'default' label not within a switch statement
  629 |         default:
      |         ^~~~~~~
drivers/staging/fsl_ppfe/pfe_hal.c: At top level:
drivers/staging/fsl_ppfe/pfe_hal.c:635:9: error: expected identifier or '(' before 'return'
  635 |         return 0;
      |         ^~~~~~
drivers/staging/fsl_ppfe/pfe_hal.c:636:1: error: expected identifier or '(' before '}' token
  636 | }

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:41 +02:00
Christian Marangi
e28196c4aa
layerscape: 5.15: fix compilation warning for PHY_INTERFACE_MODE_2500SGMII
Fix compilation warning for PHY_INTERFACE_MODE_2500SGMII patch.
Fix compilation warning:
drivers/net/phy/phylink.c: In function 'phylink_get_linkmodes':
drivers/net/phy/phylink.c:360:9: error: enumeration value 'PHY_INTERFACE_MODE_2500SGMII' not handled in switch [-Werror=switch]
  360 |         switch (interface) {
      |         ^~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:41 +02:00
Christian Marangi
ade9eba149
ipq806x: 5.15: drop arm override compile patch
Drop arm override compile patch. The use is dubious and at times (2016)
it was never explained why this was required.
Krait CPU and Cortex-a15 may be similar but they have some intrinsic
difference. While very similar they differ a lot in additional feature
and also cache configuration.

Also these conflict with raid6 libraty compilation that use specific
workaround not compatible with cortex-a15 and produce compilation
warning.
Fix compilation warning:
cc1: error: switch '-mcpu=cortex-a15' conflicts with switch '-march=armv7-a+simd' [-Werror]
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:41 +02:00
Christian Marangi
c7bca5883d
realtek: 5.15: replace fallthrough comment for rtl838x ethernet driver
Replace fallthrough comment with fallthrough macro for rtl838x ethernet
driver.
Fix compilarion warning:
drivers/net/ethernet/rtl838x_eth.c: In function 'rtl930x_mdio_reset':
drivers/net/ethernet/rtl838x_eth.c:1959:43: error: this statement may fall through [-Werror=implicit-fallthrough=]
 1959 |                         private_poll_mask |= BIT(i);
drivers/net/ethernet/rtl838x_eth.c:1961:17: note: here
 1961 |                 case PHY_INTERFACE_MODE_USXGMII:
      |                 ^~~~

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:40 +02:00
Christian Marangi
8aa786d9a7
realtek: 5.15: fix uninizialized variable in rtl83xx qos driver
Fix uninizialized variable in rtl83xx qos driver
Fix compilation error:
drivers/net/dsa/rtl83xx/qos.c: In function 'rtl838x_setup_prio2queue_matrix':
drivers/net/dsa/rtl83xx/qos.c:298:19: error: 'v' is used uninitialized [-Werror=uninitialized]
  298 |                 v |= i << (min_queues[i] * 3);
      |                 ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl83xx/qos.c:294:13: note: 'v' was declared here
  294 |         u32 v;
      |             ^
drivers/net/dsa/rtl83xx/qos.c: In function 'rtl83xx_setup_prio2queue_cpu_matrix':
drivers/net/dsa/rtl83xx/qos.c:320:19: error: 'v' is used uninitialized [-Werror=uninitialized]
  320 |                 v |= max_queues[i] << (i * 3);
      |                 ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl83xx/qos.c:316:13: note: 'v' was declared here
  316 |         u32 v;
      |             ^
cc1: all warnings being treated as errors
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:40 +02:00
Christian Marangi
1a0e9bc3b8
realtek: 5.15: comment unused part of realtek ethernet driver
Comment unused part of realtek phy driver.
Fix compilation warning:
drivers/net/phy/rtl83xx-phy.c: In function 'rtl8380_configure_int_rtl8218b':
drivers/net/phy/rtl83xx-phy.c:747:21: error: unused variable 'ipd_flag' [-Werror=unused-variable]
  747 |                 int ipd_flag = 1;
      |                     ^~~~~~~~
drivers/net/phy/rtl83xx-phy.c: At top level:
drivers/net/phy/rtl83xx-phy.c:3333:13: error: 'rtl931x_sds_disable' defined but not used [-Werror=unused-function]
 3333 | static void rtl931x_sds_disable(u32 sds)
      |             ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Comment unused part of realtek dsa driver.
Fix compilation warning:
drivers/net/dsa/rtl83xx/common.c: In function 'rtl83xx_fib_event':
drivers/net/dsa/rtl83xx/common.c:1430:58: error: unused variable 'fen6_info' [-Werror=unused-variable]
 1430 |                         struct fib6_entry_notifier_info *fen6_info = ptr;
      |                                                          ^~~~~~~~~
drivers/net/dsa/rtl83xx/common.c: At top level:
drivers/net/dsa/rtl83xx/common.c:531:12: error: 'rtl83xx_octet_cntr_alloc' defined but not used [-Werror=unused-function]
  531 | static int rtl83xx_octet_cntr_alloc(struct rtl838x_switch_priv *priv)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Drop unused priv in realtek dsa driver.
Fix compilation warning:
drivers/net/dsa/rtl83xx/dsa.c: In function 'rtl83xx_port_lag_change':
drivers/net/dsa/rtl83xx/dsa.c:2016:37: error: unused variable 'priv' [-Werror=unused-variable]
 2016 |         struct rtl838x_switch_priv *priv = ds->priv;
      |                                     ^~~~
cc1: all warnings being treated as errors

Comment rtl838x_pie_rule_dump in realtek dsa driver for rtl83xx
Fix compilation warning:
drivers/net/dsa/rtl83xx/rtl838x.c:1294:13: error: 'rtl838x_pie_rule_dump' defined but not used [-Werror=unused-function]
 1294 | static void rtl838x_pie_rule_dump(struct  pie_rule *pr)
      |             ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Comment multiple function in realtek dsa driver for rtl930x
Fix compilation warning:
drivers/net/dsa/rtl83xx/rtl930x.c:1463:12: error: 'rtl930x_l3_intf_add' defined but not used [-Werror=unused-function]
 1463 | static int rtl930x_l3_intf_add(struct rtl838x_switch_priv *priv, struct rtl838x_l3_intf *intf)
      |            ^~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl83xx/rtl930x.c:1414:12: error: 'rtl930x_l3_mtu_del' defined but not used [-Werror=unused-function]
 1414 | static int rtl930x_l3_mtu_del(struct rtl838x_switch_priv *priv, int mtu)
      |            ^~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl83xx/rtl930x.c:995:12: error: 'rtl930x_l3_hash6' defined but not used [-Werror=unused-function]
  995 | static u32 rtl930x_l3_hash6(struct in6_addr *ip6, int algorithm, bool move_dip)
      |            ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

drivers/net/dsa/rtl83xx/rtl930x.c:1690:13: error: 'rtl930x_read_pie_fixed_fields' defined but not used [-Werror=unused-function]
 1690 | static void rtl930x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl83xx/rtl930x.c:1432:12: error: 'rtl930x_l3_mtu_add' defined but not used [-Werror=unused-function]
 1432 | static int rtl930x_l3_mtu_add(struct rtl838x_switch_priv *priv, int mtu)
      |            ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Comment rtl931x_read_pie_fixed_fields in realtek dsa driver for rtl931x
Fix compilation warning:
drivers/net/dsa/rtl83xx/rtl931x.c:1116:13: error: 'rtl931x_read_pie_fixed_fields' defined but not used [-Werror=unused-function]
 1116 | static void rtl931x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Comment rtl93xx_header_vlan_set in realtek ethernet driver for rtl838x
Fix compilation warning:
drivers/net/ethernet/rtl838x_eth.c: At top level:
drivers/net/ethernet/rtl838x_eth.c:164:13: error: 'rtl93xx_header_vlan_set' defined but not used [-Werror=unused-function]
  164 | static void rtl93xx_header_vlan_set(struct p_hdr *h, int vlan)
      |             ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:40 +02:00
Christian Marangi
f938826a65
realtek: 5.15: fix warning for i2c_mii_valid_phy_id and i2c_mii_phy_addr
Rework exposing i2c_mii_valid_phy_id and i2c_mii_phy_addr in global
include.
Fix compilation warning:
In file included from drivers/net/phy/sfp.c:11:
./include/linux/mdio/mdio-i2c.h:27:21: error: 'i2c_mii_phy_addr' defined but not used [-Werror=unused-function]
   27 | static unsigned int i2c_mii_phy_addr(int phy_id)
      |                     ^~~~~~~~~~~~~~~~
./include/linux/mdio/mdio-i2c.h:22:13: error: 'i2c_mii_valid_phy_id' defined but not used [-Werror=unused-function]
   22 | static bool i2c_mii_valid_phy_id(int phy_id)
      |             ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:40 +02:00
Christian Marangi
7fa7cbc0b9
realtek: 5.15: fix compilation warning with PHY_INTERFACE_MODE_HSGMII
PHY_INTERFACE_MODE_HSGMII was not handled in phylink_get_linkmodes and
phylink_parse_mode.
Fix compilation warning by adding it in the enum:
drivers/net/phy/phylink.c: In function 'phylink_get_linkmodes':
drivers/net/phy/phylink.c:360:9: error: enumeration value 'PHY_INTERFACE_MODE_HSGMII' not handled in switch [-Werror=switch]
  360 |         switch (interface) {
      |         ^~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:39 +02:00
Christian Marangi
da2f5e8776
ramips: 5.15: add patch fixing compilation warning for hsdma-mt7621
Add patch fixing compilation warning for hsdma-mt7621:
drivers/staging/mt7621-dma/hsdma-mt7621.c: In function 'mtk_hsdma_probe':
drivers/staging/mt7621-dma/hsdma-mt7621.c:685:9: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  685 |         device_reset(&pdev->dev);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:39 +02:00
Christian Marangi
82afdf6056
ralink: rt3833: fix compilation warning from device_reset in fe_probe
Fix compilation warning from device_reset in fe_probe. On fail print a
warning but don't fail probe.
Fix compilation warning:
drivers/net/ethernet/ralink/mtk_eth_soc.c: In function 'fe_probe':
drivers/net/ethernet/ralink/mtk_eth_soc.c:1564:9: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result]
 1564 |         device_reset(&pdev->dev);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:39 +02:00
Christian Marangi
4ea21e3161
ralink: mt76x8: fix compilation warning in esw driver
Fix compilation warning for debug string in esw driver:
drivers/net/ethernet/ralink/esw_rt3050.c:1535:9: note: in expansion of macro 'dev_info'
 1535 |         dev_info(&pdev->dev, "mediatek esw at 0x%08lx, irq %d initialized\n",
      |         ^~~~~~~~
drivers/net/ethernet/ralink/esw_rt3050.c:1535:53: note: format string is defined here
 1535 |         dev_info(&pdev->dev, "mediatek esw at 0x%08lx, irq %d initialized\n",
      |                                                 ~~~~^
      |                                                     |
      |                                                     long unsigned int
      |                                                 %08p
cc1: all warnings being treated as errors

Fix unused variable causing compilation warning:
drivers/net/ethernet/ralink/esw_rt3050.c: In function 'esw_interrupt':
drivers/net/ethernet/ralink/esw_rt3050.c:769:13: error: unused variable 'i' [-Werror=unused-variable]
  769 |         int i;
      |             ^
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:39 +02:00
Christian Marangi
3fa87858a7
ramips: mtk-mcc: move cmd_buf for dbg under ifdef
Move cmd_buf for dbg under ifdef to fix compilation warning:
drivers/mmc/host/mtk-mmc/dbg.c:51:13: error: 'cmd_buf' defined but not used [-Werror=unused-variable]
   51 | static char cmd_buf[256];
      |             ^~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:38 +02:00
Christian Marangi
aa7a2d971e
ralink: mt7620: fix compilation warning for device_reset in i2s driver
Fix compilation warning for device_reset in i2s driver.
Fix compilation warning:
sound/soc/ralink/ralink-i2s.c: In function 'ralink_i2s_probe':
sound/soc/ralink/ralink-i2s.c:885:9: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  885 |         device_reset(&pdev->dev);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errorralink: mt7620: fix compilation
warning for device_reset in i2s driver

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:38 +02:00
Christian Marangi
b8345bb5d4
oxnas: 5.15: fix mangle bootargs patch compilation warning
Fix mangle bootargs patch compilation warning due to defined but not
used functions.
Fix compilation warning:
arch/arm/boot/compressed/atags_to_fdt.c:63:17: error: 'get_cell_size' defined but not used [-Werror=unused-function]
   63 | static uint32_t get_cell_size(const void *fdt)
      |                 ^~~~~~~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:43:12: error: 'setprop_cell' defined but not used [-Werror=unused-function]
   43 | static int setprop_cell(void *fdt, const char *node_path,
      |            ^~~~~~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:25:12: error: 'setprop' defined but not used [-Werror=unused-function]
   25 | static int setprop(void *fdt, const char *node_path, const char *property,
      |            ^~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c: In function 'atags_to_fdt':
arch/arm/boot/compressed/atags_to_fdt.c:207:18: error: unused variable 'memsize' [-Werror=unused-variable]
  207 |         int ret, memsize;
      |                  ^~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:206:13: error: unused variable 'memcount' [-Werror=unused-variable]
  206 |         int memcount = 0;
      |             ^~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c:205:16: error: unused variable 'mem_reg_property' [-Werror=unused-variable]
  205 |         __be32 mem_reg_property[2 * 2 * NR_BANKS];
      |                ^~~~~~~~~~~~~~~~
arch/arm/boot/compressed/atags_to_fdt.c: At top level:
arch/arm/boot/compressed/atags_to_fdt.c:174:13: error: 'hex_str' defined but not used [-Werror=unused-function]
  174 | static void hex_str(char *out, uint32_t value)
      |             ^~~~~~~
cc1: all warnings being treated as errors

Also make some variable const to fix compilation warning:
arch/arm/boot/compressed/atags_to_fdt.c: In function 'append_rootblock':
arch/arm/boot/compressed/atags_to_fdt.c:91:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
   91 |         ptr = str - 1;
      |             ^

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:38 +02:00
Christian Marangi
b786d744ef
ramips: 5.15: handle return from device_reset in I2C driver
Handle return from device reset in I2C driver. Don't fail on
device_reset error but print a warning.

Fix compilation warning:
sound/soc/ralink/ralink-i2s.c: In function 'ralink_i2s_probe':
sound/soc/ralink/ralink-i2s.c:885:9: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  885 |         device_reset(&pdev->dev);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:38 +02:00
Christian Marangi
7f54fa575b
ramips: mt7620: handle request_irq fail in gsw ethernet driver
Handle return from request_irq in gsw ethernet driver.
Fix compilation warning:
drivers/net/ethernet/ralink/gsw_mt7620.c: In function 'mtk_gsw_init':
drivers/net/ethernet/ralink/gsw_mt7620.c:236:17: error: ignoring return value of 'request_irq' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  236 |                 request_irq(gsw->irq, gsw_interrupt_mt7620, 0,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  237 |                             "gsw", priv);
      |                             ~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:37 +02:00
Christian Marangi
3e9c471525
bcm47xx: 5.15: fix compilation warning for yenta socket patchi
Rework the patch to completely disable yenta_probe_irq function.
The generated mask is zero by lack due to the fact that probe_irq_mask
use a val never initialized. Correctly rework the ifdef to make the
function always return 0.

Fix compilation warning:
drivers/pcmcia/yenta_socket.c:926:13: error: unused variable 'i' [-Werror=unused-variable]
  926 |         int i;
      |             ^
drivers/pcmcia/yenta_socket.c:954:16: error: 'val' is used uninitialized [-Werror=uninitialized]
  954 |         mask = probe_irq_mask(val) & 0xffff;
      |                ^~~~~~~~~~~~~~~~~~~
drivers/pcmcia/yenta_socket.c:927:23: note: 'val' was declared here
  927 |         unsigned long val;
      |                       ^~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:37 +02:00
Aleksander Jan Bajkowski
0e2a332252
lantiq: fix compilation warning in lantiq_etop_init
Commit c5cc3d9610 ("lantiq: Change the data-type of mac address in ETOP driver")
changed the type of the mac variable. Since then, the priv->mac check always evaluates
as true, so this check can be removed.

This fix compilation warning:
drivers/net/ethernet/lantiq_etop.c: In function 'ltq_etop_init':
drivers/net/ethernet/lantiq_etop.c:775:13: warning: the comparison will always evaluate as 'true' for the address of 'mac' will never be NULL [-Waddress]
  775 |         if (priv->mac && !is_valid_ether_addr(mac.sa_data))
      |             ^~~~
drivers/net/ethernet/lantiq_etop.c:157:23: note: 'mac' declared here
  157 |         unsigned char mac[6];
      |
cc1: all warnings being treated as errors

Fixes: c5cc3d9610 ("lantiq: Change the data-type of mac address in ETOP driver")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
[ fix wrong fixes tag format ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:36 +02:00
Aleksander Jan Bajkowski
f1287e9bc6
lantiq: lzma-loader: fix mismatched function declaration
This fix compilation warning:
printf.c:14:13: warning: type of 'board_putc' does not match original declaration [-Wlto-type-mismatch]
   14 | extern void board_putc(int ch);
      |             ^
board-lantiq.c:24:6: note: type mismatch in parameter 1
   24 | void board_putc(char c)
      |      ^
board-lantiq.c:24:6: note: type 'char' should match type 'int'
board-lantiq.c:24:6: note: 'board_putc' was previously declared here

Fixes: a328b6831c ("lantiq: bring back okli loader")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2023-05-12 03:15:36 +02:00
Aleksander Jan Bajkowski
dc6b55e21f
kernel: psb6970: drop unused variable in psb6970_config_init
Drop unused variable in psb6970_config_init. This variable should have
been dropped in 0806f8fc80 ("lantiq: add Linux 5.10 support as testing kernel").

This fix compilation warning:
drivers/net/phy/psb6970.c: In function 'psb6970_config_init':
drivers/net/phy/psb6970.c:310:28: warning: unused variable 'dev' [-Wunused-variable]
  310 |         struct net_device *dev = pdev->attached_dev;
      |
cc1: all warnings being treated as errors

Fixes: 0806f8fc80 ("lantiq: add Linux 5.10 support as testing kernel")
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2023-05-12 03:15:36 +02:00
Aleksander Jan Bajkowski
4935cdbd69
lantiq: fix compilation warning in cfi_mtdset_0001
Some write buffer functions are not used when FORCE_WORD_WRITE is set to 1.
So the compile warning messages are output if FORCE_WORD_WRITE is 1. To
resolve this disable the write buffer functions if FORCE_WORD_WRITE is 1.

This fix compilation warning:
drivers/mtd/chips/cfi_cmdset_0001.c:307:13: warning: 'fixup_use_write_buffers' defined but not used [-Wunused-function]
  307 | static void fixup_use_write_buffers(struct mtd_info *mtd)
      |             ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2023-05-12 03:15:35 +02:00
Christian Marangi
77ecc2844b
generic: 5.15: backport bcm63xx wdt patch fixing fallthrough warning
Backport patch present upstream fixing error for bcm63xx:
drivers/watchdog/bcm63xx_wdt.c: In function 'bcm63xx_wdt_ioctl':
drivers/watchdog/bcm63xx_wdt.c:208:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
  208 |                 bcm63xx_wdt_pet();
      |                 ^~~~~~~~~~~~~~~~~
drivers/watchdog/bcm63xx_wdt.c:210:9: note: here
  210 |         case WDIOC_GETTIMEOUT:
      |         ^~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:35 +02:00
Christian Marangi
5913ea1ba2
generic: 5.15: add pending patch fixing binfmt compilation warning
Add pending patch fixing binfmt compilation warning on some arch.
This fix compilation warning:
fs/binfmt_elf.c: In function 'parse_elf_properties.isra':
fs/binfmt_elf.c:821:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
  821 | }
      | ^
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:35 +02:00
Christian Marangi
2b1de625eb
bcm4908: 5.15: fix compilation error for BCM4908 pinmux patch
Fix compilation warning:
drivers/pinctrl/bcm/pinctrl-bcm4908.c: In function 'bcm4908_pinctrl_probe':
drivers/pinctrl/bcm/pinctrl-bcm4908.c:541:53: error: passing argument 3 of 'pinmux_generic_add_function' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  541 |                                             function->groups,
      |                                             ~~~~~~~~^~~~~~~~
In file included from drivers/pinctrl/bcm/pinctrl-bcm4908.c:16:
drivers/pinctrl/bcm/../pinmux.h:153:46: note: expected 'const char **' but argument is of type 'const char * const*'
  153 |                                 const char **groups,
      |                                 ~~~~~~~~~~~~~^~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:34 +02:00
Christian Marangi
58a8fe7cb0
generic: 5.15: add pending patch fixing compilation warning in jffs2
Current gcc set a limit for each stack and complain if this limit is not
followed. JFSS2 in build_xattr function currently exceed the limit by
allocating a massive array of struct of 128 elements. Introduce a
pending patch that allocate this temp array dynamically fixing the
compilation warning:

fs/jffs2/xattr.c: In function 'jffs2_build_xattr_subsystem':
fs/jffs2/xattr.c:887:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
  887 | }
      | ^

Affecting many target that require jffs2 support.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:34 +02:00
Christian Marangi
b93d2d7c38
ath79: 5.15: drop unused res variable from pci ar724x OF convert patch
Drop unused res variable from pci ar724x OF convert patch fixing
compilation warning:

arch/mips/pci/pci-ar724x.c: In function 'ar724x_pci_probe':
arch/mips/pci/pci-ar724x.c:387:26: error: unused variable 'res' [-Werror=unused-variable]
  387 |         struct resource *res;
      |                          ^~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:34 +02:00
Robert Marko
1f8c8bca5e
ipq40xx: add PSGMII PHY mode to phylink_get_linkmodes()
Upstream commit ("net: phylink: add generic validate implementation") was
backported, however PSGMII PHY mode patch for ipq40xx was not updated to
add PSGMII to phylink_get_linkmodes() so the following warning would be
printed during kernel compilation:
drivers/net/phy/phylink.c: In function 'phylink_get_linkmodes':
drivers/net/phy/phylink.c:360:9: error: enumeration value 'PHY_INTERFACE_MODE_PSGMII' not handled in switch [-Werror=switch]
  360 |         switch (interface) {
      |         ^~~~~~

Resolve the warning by adding the PSGMII mode to phylink_get_linkmodes().

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-12 03:15:34 +02:00
Christian Marangi
7a2a645801
ramips: 5.15: handle error from device_reset in SPI ralink driver
Handle error from device reset in SPI ralink driver fixing compilation
warning:

drivers/spi/spi-rt2880.c: In function 'rt2880_spi_probe':
drivers/spi/spi-rt2880.c:474:17: error: ignoring return value of 'device_reset' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  474 |                 device_reset(&pdev->dev);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:33 +02:00
Christian Marangi
40c7429083
ath79: 5.15: drop unused res variable from pci ar71xx OF convert patch
Drop unused res variable from pci ar71xx OF convert patch fixing
compilation warning:

arch/mips/pci/pci-ar71xx.c: In function 'ar71xx_pci_probe':
arch/mips/pci/pci-ar71xx.c:287:26: error: unused variable 'res' [-Werror=unused-variable]
  287 |         struct resource *res;
      |                          ^~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:33 +02:00
Christian Marangi
d96a0dbf3e
ipq806x: 5.15: fix compilation warning from mangle bootargs patch
Fix compilation warning from mangle bootargs patch. Now that we flag
warning as error these cause compilation error.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:33 +02:00
Christian Marangi
b2d1eb717b
generic: 5.15: enable Werror by default for kernel compile
From 5.15 and up linux kernel introduced CONFIG_WERROR to flag any
warning as error. To improve code quality, enable this by default to
catch any warning and fix it.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-05-12 03:15:32 +02:00
Daniel Golle
43417aef84 Revert "ath79: add empty squashfs-lzma filesystem"
This reverts commit 91e3419a33.
Now that squashfs3-lzma generates reproducible output we can drop the
empty binary. Having a binary file in the tree is not nice and we actually
also use squashfs3-lzma for devices which expect the kernel to be loaded
from a squashfs3...

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-05-12 02:27:17 +02:00
David Bauer
0ce356bbba mediatek: apply stock configuration for WAN-LED
Apply the same LED configuration used by the vendor-firmware for the
GPY211 controlled WAN LED in OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-05-11 23:09:04 +02:00
David Bauer
3492517f37 mediatek: configure TUF-AX4200 LAN LEDs
As we can now configure the switch LED configuration, write the switch
LED configuration values from the vendor firmware to the switch-IC.

Previously, the switch-LEDs did not show any acitvity or link-status
whatsoever.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-05-11 23:09:04 +02:00
David Bauer
242fe8634e generic: add hack for MT753x LED configuration
This adds a small hack similar to the one used for ar8xxx switches to
read a reg:value map for configuring the LED configuration registers.

This allows OpenWrt to write device-specific LED action as well as blink
configurations. It is unlikely to be accepted upstream, as upstream
plans on integrating their own framework for handling these LEDs.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-05-11 23:09:04 +02:00
David Bauer
523c392fe6 generic: mt7530: enable PHY configuration using OF
The MT753x switches provide a switch-internal MDIO bus for the embedded
PHYs.

Register a OF sub-node on the switch OF-node for this internal MDIO bus.
This allows to configure the embedded PHYs using device-tree.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-05-11 23:09:04 +02:00
Lu jicong
1645c34d56
generic: enable CONFIG_ARM_CRYPTO for 32bit arm targets
Fix following error when building 32bit arm targets with kmod-crypto-sha512
ERROR: module '/home/user/openwrt/build_dir/target-arm_xscale_musl_eabi/linux-kirkwood_generic/linux-5.15.109/arch/arm/crypto/sha512-arm.ko' is missing.

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
2023-05-10 19:01:45 +02:00
Lu jicong
d246cb89da
generic: refresh 5.15 kernel config
prepare for enabling CONFIG_ARM_CRYPTO on these targets

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
2023-05-10 19:01:45 +02:00
Christoph Krapp
e882af2850 ramips: add support for Linksys RE7000
Hardware specification:

- SoC: MediaTek MT7621AT (880 MHz)
- Flash: 16 MB (Macronix MX25L12835FM2I-10G)
- RAM: 128 MB (Nanya NT5CC64M16GP-DI)
- WLAN 2.4 GHz: 2x2 MediaTek MT7603EN
- WLAN 5 GHz: 2x2 MediaTek MT7615N
- Ethernet: 1x 10/100/1000 Mbps
- LED: Power, Wifi, WPS
- Button: Reset, WPS
- UART: 1:VCC, 2:GND, 3:TX, 4:RX (from LAN port)
  Serial console @ 57600,8n1

Flash instructions:

Connect to serial console and start up the device. As the bootloader got
locked you need to type in a password to unlock U-Boot access.
When you see the following output on the console:

relocate_code Pointer at: 87f1c000

type in the super secure password:

1234567890

Then select TFTP boot from RAM by selecting option 1 in the boot menu.
As Linksys decided to leave out a basic TFTP configuration you need to
set server- & client ip as well as the image filename the device will
search for. You need to use the initramfs openwrt image for the TFTP
boot process.

Once openwrt has booted up, upload the sysupgrade image via scp and run
sysupgrade as normal.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
2023-05-09 11:52:53 +02:00
Tianling Shen
b0e869501a rockchip: disable UHS speed for ROC-RK3328-CC
The previously stated speed of sdr-104 in is too high for the hardware
to reliably communicate with some fast SD cards.
Rockchip boards have a common bug when operating uhs speed, which will
hang the system during a soft reboot.

To be on the safe side, lower the speed to workaround.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-09 13:30:22 +08:00
Tianling Shen
395de5103a rockchip: enable rk805 pinctrl driver
This is required for ROC-RK3328-CC to light up the LED-s which are
connected to rk805's gpio.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-09 13:30:22 +08:00
Tianling Shen
a7d6cf0bb3 rockchip: add Firefly ROC-RK3328-CC support
Hardware
--------
RockChip RK3328 ARM64 (4 cores)
4GB DDR4 RAM
1x 1000 Base-T
2 LEDs (POWER / USER)
HDMI 2.0
3.5mm TRRS AV jack
Micro-SD slot
eMMC slot
1x USB 3.0 Port
2x USB 2.0 Port

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card using
dd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-09 13:30:22 +08:00
Michael Pratt
7bfe7e0676
sdk: do not exclude all doc directories
Some packages which are using local gnulib source
are expecting files to exist in the directory:

staging_dir/host/share/gnulib/doc

so delete the other doc directories directly
instead of excluding all of them.

Fixes: d167adbc4 ("gettext-full: bootstrap to local gnulib source")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-05-09 00:52:31 +02:00
Paul Spooren
91e3419a33 ath79: add empty squashfs-lzma filesystem
The filesystem is currently created on every build to trick the boot
loader of some FRITZ! devices into accepting the image. Sadly the
resulting squashfs-lzma filesystem is not reproducible. To fix this,
create a squashfs filesystem once and include it into the repository.

Creation happend as shown below

    rm -rf empty_dir
    mkdir empty_dir
    ./staging_dir/host/bin/mksquashfs-lzma \
    	empty_dir/ empty-squashfs-lzma \
    	-noappend -root-owned -be -nopad -b 65536 -fixed-time 0

Signed-off-by: Paul Spooren <mail@aparcar.org>
2023-05-08 20:03:44 +02:00
Maximilian Weinmann
36dd3ab7db ramips: fix dts file name for SNR-CPE-ME1
Rename file mt7621_snr_snr-spe-me-1.dts

Fixes: #12562
Fixes: ecdb248 ("ramips: add support for SNR-CPE-ME1")
Tested-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Maximilian Weinmann <x1@disroot.org>
2023-05-08 18:44:26 +02:00
Jan Hoffmann
a872570c04 realtek: remove redundant is_lagmember checks
All callers of the rtl83xx_mc_group_* functions already do the same
check, so these aren't needed.

For rtl83xx_mc_group_alloc, this branch also incorrectly returned 0
instead of a negative value. If the branch wasn't effectively dead code
anyway, this could potentially have caused bugs, as 0 is a valid
multicast group entry index.

Fixes: cde31976e3 ("realtek: Add support for Layer 2 Multicast")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:16:07 +02:00
Jan Hoffmann
98a3b52380 realtek: remove store_mcgroups/load_mcgroups
The current implementation only works when store and load are called for
the same port without any other calls in between. This is because the
store function only saves a single port number instead of a portmask for
each group. It also doesn't take into account that the allocation of
multicast group entries might change between store/load calls.

As a result, the multicast port mask table gets corrupted. This also
includes the reserved entry for unknown multicast, which gets corrupted
even when no other mdb entries have been added.

Remove the code for storing/loading multicast groups entirely, as the
original commit message doesn't offer a convincing reason why this would
be necessary in the first place.

Fixes: 724e4af530 ("realtek: Store and Restore MC memberships for port enable/disable")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:15:34 +02:00
Jan Hoffmann
6772ae1172 realtek: don't add CPU port to multicast portmasks
There shouldn't be any reason to forward all multicast to the CPU. The
original commit message also doesn't provide a reason for this seemingly
unrelated change.

The current implementation of the delete method is also broken, as it
entirely removes any entry when the portmask contains only the CPU port,
even if it was explicitly created.

Fixes: 724e4af530 ("realtek: Store and Restore MC memberships for port enable/disable")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:09:02 +02:00
Jan Hoffmann
3356126b82 realtek: actually remove port from multicast portmask
Fixes: 724e4af530 ("realtek: Store and Restore MC memberships for port enable/disable")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:09:01 +02:00
Jan Hoffmann
57df840670 realtek: don't treat first multicast portmask entry as reserved
There doesn't appear to be a reason to do this, as only the last entry
is actually reserved for unknown multicast.

This also fixes two issues:
 - As the increment happened after the bounds check, the value of the
   actually reserved last entry could be overwritten.
 - On deletion of entries, a corresponding decrement was missing,
   causing the wrong entry to be marked as free.

Fixes: cde31976e3 ("realtek: Add support for Layer 2 Multicast")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:09:00 +02:00
Jan Hoffmann
81931756e1 realtek: fix writing/deletion of CAM entries
Actually use the index returned by rtl83xx_find_l2_cam_entry.

Fixes: cde31976e3 ("realtek: Add support for Layer 2 Multicast")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:08:59 +02:00
Jan Hoffmann
8ea27bb959 realtek: handle changed flags in VLAN configuration
The port_vlan_add method may be called while a port is already a member
of that VLAN, so it needs to be able to handle changed flags. Fix it to
properly handle when the PVID or UNTAGGED flag was previously set, but
now no longer is.

To reduce duplication, move PVID configuration to a separate function.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:07:34 +02:00
Jan Hoffmann
5d34fc92ec realtek: fix standalone ports in presence of static fdb entries
The registers L2_PORT_STATIC_MV_ACT seem to specify the action to take
when the source address of a packet exists as a static fdb entry on
another port. By default the configured action is to drop such packets.

For standalone ports, this behaviour is undesired, as all traffic should
be forwarded to the CPU. So change the action to forward on standalone
ports.

A situation where this issue can occur is when a non-offloaded bond
interface is part of a bridge. In that case, the CPU port will have fdb
entries for devices connected to the bond interface, which are managed
by the assisted learning feature.

For now, this is only implemented for RTL838x/RTL839x, as the available
set of registers differs for the other devices.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:07:34 +02:00
Jan Hoffmann
4c0a1667f3 realtek: initialize port masks to match the default state
All ports are disabled by default, so configure the port isolation masks
and the pm field accordingly in the setup function. When port_enable is
called for a port, the isolation masks will be set up so that traffic
can flow between the port and the CPU.

While at it, change the code to also use the traffic_set method in
rtl83xx_setup, instead of writing to the RTL838x_PORT_ISO_CTRL(i)
registers directly.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:07:34 +02:00
Jan Hoffmann
3af984e46e realtek: properly update port masks when port leaves bridge
Correctly update the isolation mask of the port being configured. The
port_bitmap variable should contain all other bridge members and needs
to be actually removed from the isolation mask instead of added to it.

Also actually remove the port being configured from the pm field of the
other ports, so that any other ports that are currently disabled will be
configured correctly when they are enabled.

Fixes: df8e6be59a ("rtl838x: add new architecture")
[fixed updating pm field of other ports]
Fixes: 2b88563ee5 ("realtek: update the tree to the latest refactored version")
[reintroduced incorrect pm field update]
Fixes: 27029277f9 ("realtek: add switch driver support for the RTL93XX based switches")
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-05-07 19:07:34 +02:00
Wojciech Dubowik
326eb6e482 layerscape: Add support for Felix DSA switch
It's present on LS1028ARDB reference board from NXP.

Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@protonmail.ch>
2023-05-07 14:50:50 +02:00
Wojciech Dubowik
924a5aabc7 layerscape: Add ls1028ardb support
Add support for NXP LS1028ARDB reference board. It's a dual core
Coretex-A53 board with 4G RAM and 5 Eternet ports (4 ports are
connected to MSCC Felix switch).

The original layout of NXP board has been kept but firmware
images are adapted to be more sysupgrade friendly. At the moment
NOR and SD boots are supported.

NOR flash instructions:
* make sd card with sdboot image
* boot
* write firmware image to spi flash
$ mtd write /tmp/openwrt-layerscape-armv8_64b-fsl_ls1028a-rdb-
squashfs-firmware.bin /dev/mtd0
* change jumper to NOR boot and reset

V3:
 * Added board specific network defaults for lan/wan

v2:
 * Added INA220 curent monitor, PCF2129 RTC clock and NXP
   SA56004ED temperature sensor to default packages
 * removed compat fixups for thist board

Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@protonmail.ch>
2023-05-07 14:50:50 +02:00
Maximilian Weinmann
ecdb24814f ramips: add support for SNR-CPE-ME1
SNR-CPE-ME1 is a wireless WiFi 5 router manufactured by SNR/NAG company.

Specification:
    - SoC           : MediaTek MT7621A
    - RAM           : DDR3 256 MiB
    - Flash         : SPI-NOR 16 MiB (GD25Q128CSIG)
    - WLAN          : 2.4 GHz (MediaTek MT7603EN)
                      5 GHz (MediaTek MT7610EN)
    - Ethernet      : 10/100/1000 Mbps x5
      - Switch      : MediaTek MT7530 (in SoC)
    - USB           : 3.0 x1
    - UART          : through-hole on PCB
      - [J4] 3.3V, RX, TX, GND (57600n8)
    - Power         : 12 VDC, 2 A

Flash instruction via TFTP:
    1. Boot SNR-CPE-ME1 to recovery mode
        (hold the reset button while power on)
    2. Send firmware via TFTP client:
       TFTP Server address: 192.168.1.1
       TFTP Client address: 192.168.1.131
    3. Wait ~120 seconds to complete flashing
    4. Do sysupgrade using web-interface

Signed-off-by: Maximilian Weinmann <x1@disroot.org>
2023-05-07 14:44:54 +02:00
Andreas Böhler
590d1fd0e6 ath79: add support for ZTE MF282
The ZTE MF282 is a LTE router used (exclusively?) by the network operator
"3".

Specifications
==============

SoC: QCA9563 (775MHz)
RAM: 128MiB
Flash: 8MiB SPI-NOR + 128MiB SPI-NAND
LAN: 1x GBit LAN
LTE: ZTE MF270 (Cat4), detected as P685M
WiFi: QCA9880ac + QCA9560bgn

MAC addresses
=============

LAN: from config
WiFi 1: from config
WiFi 2: +1

Installation
============

TFTP installation using UART is preferred. Disassemble the device and
connect serial. Put the initramfs image as openwrt.bin to your TFTP server
and configure a static IP of 192.168.1.100. Load the initramfs image by
typing:

  setenv serverip 192.168.1.100
  setenv ipaddr 192.168.1.1
  tftpboot 0x82000000 openwrt.bin
  bootm 0x82000000

From this intiramfs boot you can take a backup of the currently installed
partitions as no vendor firmware is available for download.

Once booted, transfer the sysupgrade image and run sysupgrade.

LTE Modem
=========

The LTE modem is probably the same as in the MF283+, all instructions
apply.

Configuring the connection using modemmanager works properly, the modem
provides three serial ports and a QMI CDC ethernet interface.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
2023-05-06 20:59:46 +02:00
Andreas Böhler
8bc4aaf45c ath79: refactor ZTE MF28x dts files
Move common dts entries of ZTE MF281 and ZTE MF286 to a common .dtsi file
to reduce redundancies.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
2023-05-06 20:59:46 +02:00
Felix Baumann
ed1217eac1 ramips: mt7621: rename Asus RT-AC57U to v1
rename RT-AC57U to avoid confusion with unsupported revisions 2 and 3

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-05-06 20:55:59 +02:00
Nick Hainke
ae417de437
realtek: adapt patch description to it's current use
The patch is not doing anymore what the descriptions says. Update it.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-05-06 07:15:37 +02:00
Nick Hainke
bbc7de3b16
generic: 5.15: remove outdated symbols
Remove symbols that are no longer present in 5.15:
- CONFIG_CRYPTO_RMD128
- CONFIG_CRYPTO_RMD256
- CONFIG_CRYPTO_RMD320
- CONFIG_CRYPTO_SALSA20
- CONFIG_CRYPTO_TGR192
- CONFIG_RAW_DRIVER
- CONFIG_ENABLE_MUST_CHECK

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-05-05 15:48:21 +02:00
Nick Hainke
638a10e175
generic: 5.15: add patch fixing compiling mvebu with gcc-13
Fixes errors in the form of:
drivers/ata/libahci.c: In function 'ahci_led_store':
././include/linux/compiler_types.h:334:45: error: call to '__compiletime_assert_363' declared with attribute error: BUILD_BUG_ON failed: sizeof(_s) > sizeof(long)
  334 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |                                             ^
././include/linux/compiler_types.h:315:25: note: in definition of macro '__compiletime_assert'
  315 |                         prefix ## suffix();                             \
      |                         ^~~~~~
././include/linux/compiler_types.h:334:9: note: in expansion of macro '_compiletime_assert'
  334 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
      |         ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
   39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
      |                                     ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   50 |         BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
      |         ^~~~~~~~~~~~~~~~
./include/linux/nospec.h:62:9: note: in expansion of macro 'BUILD_BUG_ON'
   62 |         BUILD_BUG_ON(sizeof(_s) > sizeof(long));                        \
      |         ^~~~~~~~~~~~
drivers/ata/libahci.c:1143:23: note: in expansion of macro 'array_index_nospec'
 1143 |                 pmp = array_index_nospec(pmp, EM_MAX_SLOTS);
      |                       ^~~~~~~~~~~~~~~~~~

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-05-05 15:46:38 +02:00
Paul Spooren
c6419d1946
lantiq: switch to Kernel 5.15 by default
Getting ready for the next release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2023-05-04 07:00:37 +02:00
Nick Hainke
9464e9e209
lantiq: xway: use capital letters in Fritz!Box name
Rename to Fritz!Box to keep naming uniform.

Fixes: ceac4ae3b4 ("lantiq: xway: add support for AVM FRITZ!Box 7330")
Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-05-04 06:09:11 +02:00
Aleksander Jan Bajkowski
0c117e1f6c
lantiq: xrx200: mark subtarget as source-only
The current problems blocking the switch to the kernel 5.15 are
related to the GSWIP driver. This driver is only used by the
xrx200 subtarget. The other subtargets are unaffected by this
problem.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2023-05-04 05:55:02 +02:00
Aleksander Jan Bajkowski
8469e1968b
Revert "lantiq: mark source only"
This reverts commit c306385474.

It should be sufficient to disable only the xrx200 subtarget.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2023-05-04 05:54:51 +02:00
Tony Ambardar
3d66f55161 kernel: improve handling of CONFIG_IO_URING
Kernel setting CONFIG_IO_URING supports high-performance I/O for file
access and servers, generally for more performant platforms, and adds
~45 KB to kernel sizes. The need for this on less "beefy" devices is
questionable, as is the size cost considering many platforms have kernel
size limits which require tricky repartitioning if outgrown. The size
cost is also large relative to the ~180 KB bump expected between major
OpenWRT kernel releases.

No OpenWrt packages have hard dependencies on this; samba4 and mariadb
can take advantage if available (+KERNEL_IO_URING:liburing) but
otherwise build and work fine.

Since CONFIG_IO_URING is already managed via the KERNEL_IO_URING setting
in Config-kernel.in (default Y), remove it from those target configs
which unconditionally enable it, and update the defaults to enable it
conditionally only on more powerful 64-bit x86 and arm devices. It may
still be manually enabled as needed for high-performance custom builds.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2023-05-03 10:26:17 -07:00
Tony Ambardar
3980dfcd05 kernel: fix handling of CONFIG_DYNAMIC_DEBUG
Since CONFIG_DYNAMIC_DEBUG is already managed via the KERNEL_DYNAMIC_DEBUG
setting in Config-kernel.in (default N), remove or disable it in target
configs which unconditionally enable it, along with the related setting
CONFIG_DYNAMIC_DEBUG_CORE. This saves several KB in the kernels for
ipq40xx, ipq806x, filogic, mt7622, qoriq, and sunxi.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2023-05-03 10:26:17 -07:00
John Audia
4fa9ec125a
kernel: bump 5.15 to 5.15.110
All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-05-03 16:32:26 +02:00
Nick Hainke
3cac52f9a1
ipq40xx: convert AVM FRITZ!Repeater 3000 to DSA
Convert the repeater to DSA.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-05-03 16:16:19 +02:00
Hauke Mehrtens
467aa08f8a
kernel: Activate CONFIG_SLAB_FREELIST_RANDOM
This activates CONFIG_SLAB_FREELIST_RANDOM.
This option make the free list less predictable. This makes it harder to
exploit heap based security vulnerabilities.

This adds a little bit more code to the kernel and a small additional
compute overhead.

This option is activated in Debian by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-05-03 15:13:26 +02:00
Paul Spooren
626f5f77f7
omap: mark source only
The target is currently broken with Kernel 5.15 and no one in sight to
fix it. Instead of stalling the next release indefinitely, make it
source only and see if someone steps up to fix it.

Signed-off-by: Paul Spooren <paul.spooren@rhebo.com>
2023-05-03 14:49:44 +02:00
Paul Spooren
c306385474
lantiq: mark source only
The target is currently broken with Kernel 5.15 and no one in sight to
fix it. Instead of stalling the next release indefinitely, make it
source only and see if someone steps up to fix it.

Signed-off-by: Paul Spooren <paul.spooren@rhebo.com>
2023-05-03 14:47:55 +02:00
Felix Baumann
e38de40f8d ramips: mt7621: add support for Cudy X6 v2
Rename existing device to v1 and create common .dtsi
Difference to v1: 16MB Flash

Specifications:

SoC: MediaTek MT7621
RAM: 256 MB
Flash: 16 MB (SPI NOR, XM25QH128C on my device)
WiFi: MediaTek MT7915E
Switch: 1 WAN, 4 LAN (Gigabit)
Buttons: Reset, WPS
LEDs: Two Power LEDs (blue and red; together they form purple)
Power: DC 12V 1A center positive
Serial: 115200 8N1
        C440 - (3V3 - GND - RX - TX) - C41 | v1 and v2
               (P   - G   - R  - T)        | v2 labels them on the board
Installation:

Download and flash the manufacturer's built OpenWrt image available at
http://www.cudytech.com/openwrt_software_download
Install the new OpenWrt image via luci (System -> Backup/Flash firmware)
Be sure to NOT keep settings.

Recovery:

Loads only signed manufacture firmware due to bootloader RSA verification
Serve tftp-recovery image as /recovery.bin on 192.168.1.88/24
Connect to any lan ethernet port
Power on the device while holding the reset button
Wait at least 8 seconds before releasing reset button for image to
download

MAC addresses as verified by OEM firmware:

use   address             source
LAN   f4:a4:54:86:75:a2   label
WAN   f4:a4:54:86:75:a3   label + 1
2g    f4:a4:54:86:75:a2   label
5g    f6:a4:54:b6:75:a2   label + LA-Bit set + 4th oktet increased

The label MAC address is found in bdinfo 0xde00.

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-05-02 18:24:52 +02:00
Jan Hoffmann
cf8d861978 realtek: hpe_1920-8g: add phy-handle for SFP ports
The switch driver actually expects every port to have a PHY handle, and
several branches in the code determine if a port is valid by checking
for a non-zero phy field.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2023-04-30 21:59:26 +02:00
Daniel Golle
3221128639 mediatek: no longer hard-code WAN PHY of Netgear WAX206
The RealTek 2.5G PHY providing the WAN port of the Netgear WAX206 has
previously been hard-coded in the device tree. Now that the PHY can be
probed correctly also via Clause-45 MDIO, use that instead.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-30 17:27:00 +01:00
Daniel Golle
28b3a5e6b5 generic: net: phy: realtek: detect early version of RTL8221B
Early versions (?) of the RTL8221B PHY cannot be identified in a regular
Clause-45 bus scan as the PHY doesn't report the implemented MMDs
correctly but returns 0 instead.
Implement custom identify function using the PKGID instead of iterating
over the implemented MMDs to work-around this problem.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-30 17:27:00 +01:00
John Audia
45f5115253 kernel: bump 5.15 to 5.15.109
Removed upstreamed:
	backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.109&id=357fa038d93d0e9159a0f0d45bae0f8654e2ade5

Build system: x86_64
Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-30 00:02:47 +02:00
John Audia
80c1105b03 kernel: bump 5.10 to 5.10.179
All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-30 00:01:12 +02:00
Mikhail Zhilkin
4a043dc9d4 ramips: add factory image for TP-Link EC330-G5u v1
This commit adds factory.bin image for TP-Link EC330-G5u v1. This allows
to install OpenWrt without connecting a serial cable (UART).

Installation using factory image
--------------------------------

Tested with "3.16.0 0.9.1 v6037.0 Build 191016 Rel.30619nb" TP-Link
firmware.

1.  Login to the router web interface (http://192.168.0.1/ by default) and
    save running config to "conf.bin" file
2.  Open configuration file in any TP-Link config editor (e.g.
    https://jahed.github.io/tp-link-config-editor/)
3.  Find "DeviceInfo" section and insert a new string "<Description
    val="Modem Router`telnetd -p 1023 -l login`" />" according to the
    following example:
       <DeviceInfo>
          ...
          <Description val="Modem Router`telnetd -p 1023 -l login`" />
          ...
       </DeviceInfo>
4.  Save configuration file and upload changed configuration using stock
    firmware interface
5.  Login using telnet to IP:192.168.0.1 (Username:admin, password:1234)
6.  Run "cat /proc/mtd | grep mtd7"
       a. If the result is 'mtd7: 03000000 00020000 "rootfs" 03400000',
          then install stock firmware using web interface to toggle booted
          firmware image from "os1" to "os0"
       b. If the result is 'mtd7: 03000000 00020000 "rootfs" 00400000',
          then all is ok, go to the next step
7.  Set up a tftp server with OpenWrt factory.bin image (IP:192.168.0.100
    in this example)
8.  Login using telnet to 192.168.0.1
9.  Download OpenWrt factory.bin image from the tftp server:
       cd /tmp
       tftp -g -r factory.bin 192.168.0.100
10. Write OpenWrt factory.bin image:
       dd if=/tmp/factory.bin of=/dev/mtdblock1
11. Power cycle the router

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-04-29 22:34:51 +02:00
Mikhail Zhilkin
15e21d373b ramips: TP-Link EC330-G5u v1: switch to mac-address-ascii
The TP-Link EC330-G5u v1 router has MAC address that stored in factory mtd
in ascii format. This commit makes the router use of "mac-address-ascii"
in dts.

After the change:
1. All MAC addresses are explicitly assigned in dts (the workarounds in
   network scripts are no longer needed);
2. gmac0 (eth0) MAC address is no longer random.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-04-29 22:34:51 +02:00
Antonio Vázquez
c31319b669 ramips: lzma-loader: Refactor loader
* Delete unused lantiq makefile
* Delete redundant makefiles and unify them into the main makefile
* Refactor and unify board code into a single file
* Add support and review subtarget specific board support

Signed-off-by: Antonio Vázquez <antoniovazquezblanco@gmail.com>
2023-04-29 22:32:27 +02:00
Rani Hod
e4c7703d2a ramips: add support for D-Link DAP-1620 B1
The DAP-1620 rev B is a wall-plug AC1300 repeater.

Specifications:
- MT7621AT, 256 MiB RAM, 16 MiB SPI NOR
- MT7615DN 2x2 802.11n +2x2 802.11ac (DBDC)
- Ethernet: 1 port 10/100/1000
- Status LEDs (1x red+green)
- LED RSSI bargraph (2x green, 1x red+green)

Installation:
- Keep reset button pressed during plug-in
- Web Recovery Updater is at 192.168.0.50
- Upload factory.bin, confirm flashing
  (seems to work best with Chromium-based browsers)

Revert to OEM firmware:
- tail -c+117 DAP1620B1_FW212B03.bin | \
  openssl aes-256-cbc -d -md md5 -out decrypted.bin \
  -k 905503a4e0c3cd3c1ce062246de427a68962347e
- flash decrypted.bin via D-Link Web Recovery

Signed-off-by: Rani Hod <rani.hod@gmail.com>
2023-04-29 22:05:20 +02:00
Hauke Mehrtens
829a50d242 bcm27xx: Deactivate CONFIG_OABI_COMPAT
This deactivates the kernel option CONFIG_OABI_COMPAT.

The old arm OABI is not needed any more, we compile all applications for
the new ARM EABI.

This reduces the attack surface of the kernel syscall interface.

On all other targets CONFIG_OABI_COMPAT is already deactivated.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Hauke Mehrtens
7815c55f7d kernel: Deactivate CONFIG_COMPAT
This deactivates the CONFIG_COMPAT kernel option.
With CONFIG_COMPAT the kernel will provide syscall interfaces for arm32
binaries in addition to the interfaces needed for arm64 binaries.

In OpenWrt the complete userspace is compiled for this specific
architecture and support for 32 bit ARM applications is not needed.
This reduces the size and the attack surface for the systems.

On all other targets CONFIG_COMPAT is already deactivated.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Hauke Mehrtens
0fc3a4aa10 kernel: Deactivate CONFIG_LEGACY_PTYS
The legacy (BSD) PTY support could open security problems in a system,
We do not need them in OpenWrt, deactivate this option in all targets.

Debian also deactivates this option.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Hauke Mehrtens
ca5555d27e kernel: Activate CONFIG_ARM64_SW_TTBR0_PAN
This activates the CONFIG_ARM64_SW_TTBR0_PAN option for all arm64
kernels by default.

The CONFIG_ARM64_SW_TTBR0_PAN option prevents the kernel form accessing
user space memory directly. This makes it harder to exploit the kernel.

This is activated by default and was already activate on all other arm64
targets before.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Hauke Mehrtens
626b37d70a kernel: Activate CONFIG_HARDENED_USERCOPY for all targets
This activates CONFIG_HARDENED_USERCOPY for the remaining targets. This
adds additional checks in the copy_from_user() and copy_to_user()
functions.

This was not activated for ARCHS38 before because of a bug in the Linux
kernel 5.4 till 5.14, which as fixed and is described here:
https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/15

I do not know why this was deactivated for mt7629 and rockchip.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 21:56:53 +02:00
Andreas Böhler
28df7f7ff2 ramips: mt7621: add support for ZyXEL WSM20
The ZyXEL WSM20 aka Multy M1 is a cheap mesh router system by ZyXEL
based on the MT7621 CPU.

Specifications
==============

SoC: MediaTek MT7621AT (880MHz)
RAM: 256MiB
Flash: 128MiB NAND
Wireless: 802.11ax (2x2 MT7915E DBDC)
Ethernet: 4x 10/100/1000 (MT7530)
Button: 1x WPS, 1x Reset, 1x LED On/Off
LED: 7 LEDs (3x white, 2x red, 2x green)

MAC address assignment
======================

The MAC address assignment follows stock: The label MAC address is the LAN
MAC address, the WAN address is read from flash.

The WiFi MAC addresses are set in userspace to label MAC + 1 and label MAC
+ 2.

Installation (web interface)
============================

The device is cloud-managed, but there is a hidden local firmware upgrade
page in the OEM web interface. The device has to be registered in the
cloud in order to be able to access this page.

The system has a dual firmware design, there is no way to tell which
firmware is currently booted. Therefore, an -initramfs version is flashed
first.

1. Log into the OEM web GUI
2. Access the hidden upgrade page by navigating to
   https://192.168.212.1/gui/#/main/debug/firmwareupgrade
3. Upload the -initramfs-kernel.bin file and flash it
4. Wait for OpenWrt to boot and log in via SSH
5. Transfer the sysupgrade file via SCP
6. Run sysupgrade to install the image
7. Reboot and enjoy

NB: If the initramfs version was installed in RAS2, the sysupgrade script
sets the boot number to the first partition. A backup has to be performed
manually in case the OEM firwmare should be kept.

Installation (UART method)
==========================

The UART method is more difficult, as the boot loader does not have a
timeout set. A semi-working stock firmware is required to configure it:

1. Attach UART
2. Boot the stock firmware until the message about failsafe mode appears
3. Enter failsafe mode by pressing "f" and "Enter"
4. Type "mount_root"
5. Run "fw_setenv bootmenu_delay 3"
6. Reboot, U-Boot now presents a menu
7. The -initramfs-kernel.bin image can be flashed using the menu
8. Run the regular sysupgrade for a permanent installation

Changing the partition to boot is a bit cumbersome in U-Boot, as there is
no menu to select it. It can only be checked using mstc_bootnum. To change
it, issue the following commands in U-Boot:

   nand read 1800000 53c0000 800
   mw.b 1800004 1 1
   nand erase 53c0000 800
   nand write 1800000 53c0000 800

This selects FW1. Replace "mw.b 1800004 1 1" by "mw.b 1800004 2 1" to
change to the second slot.

Back to stock
=============

It is possible to flash back to stock, but a OEM firmware upgrade is
required. ZyXEL does not provide the link on its website, but the link
can be acquired from the OEM web GUI by analyzing the transferred JSON
objects.

It is then a matter of writing the firmware to Kernel2 and setting the
boot partition to FW2:

   mtd write zyxel.bin Kernel2
   echo -ne "\x02" | dd of=/dev/mtdblock7 count=1 bs=1 seek=4 conv=notrunc

Signed-off-by: Andreas Böhler <dev@aboehler.at>
Credits to forum users Annick and SirLouen for their initial work on this
device
2023-04-29 21:53:34 +02:00
Michał Kępień
626c84340d kernel: mtk_bmt: refactor to avoid deep recursion
A Linksys E8450 (mt7622) device running current master has recently
started crashing:

    [    0.562900] mtk-ecc 1100e000.ecc: probed
    [    0.570254] spi-nand spi2.0: Fidelix SPI NAND was found.
    [    0.575576] spi-nand spi2.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
    [    0.583780] mtk-snand 1100d000.spi: ECC strength: 4 bits per 512 bytes
    [    0.682930] Insufficient stack space to handle exception!
    [    0.682939] ESR: 0x0000000096000047 -- DABT (current EL)
    [    0.682946] FAR: 0xffffffc008c47fe0
    [    0.682948] Task stack:     [0xffffffc008c48000..0xffffffc008c4c000]
    [    0.682951] IRQ stack:      [0xffffffc008008000..0xffffffc00800c000]
    [    0.682954] Overflow stack: [0xffffff801feb00a0..0xffffff801feb10a0]
    [    0.682959] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G S                5.15.107 #0
    [    0.682966] Hardware name: Linksys E8450 (DT)
    [    0.682969] pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [    0.682975] pc : dequeue_entity+0x0/0x250
    [    0.682988] lr : dequeue_task_fair+0x98/0x290
    [    0.682992] sp : ffffffc008c48030
    [    0.682994] x29: ffffffc008c48030 x28: 0000000000000001 x27: ffffff801feb6380
    [    0.683004] x26: 0000000000000001 x25: ffffff801feb6300 x24: ffffff8000068000
    [    0.683011] x23: 0000000000000001 x22: 0000000000000009 x21: 0000000000000000
    [    0.683017] x20: ffffff801feb6380 x19: ffffff8000068080 x18: 0000000017a740a6
    [    0.683024] x17: ffffffc008bae748 x16: ffffffc008bae6d8 x15: ffffffffffffffff
    [    0.683031] x14: ffffffffffffffff x13: 0000000000000000 x12: 0000000f00000101
    [    0.683038] x11: 0000000000000449 x10: 0000000000000127 x9 : 0000000000000000
    [    0.683044] x8 : 0000000000000125 x7 : 0000000000116da1 x6 : 0000000000116da1
    [    0.683051] x5 : 00000000001165a1 x4 : ffffff801feb6e00 x3 : 0000000000000000
    [    0.683058] x2 : 0000000000000009 x1 : ffffff8000068080 x0 : ffffff801feb6380
    [    0.683066] Kernel panic - not syncing: kernel stack overflow
    [    0.683069] SMP: stopping secondary CPUs
    [    1.648361] SMP: failed to stop secondary CPUs 0-1
    [    1.648366] Kernel Offset: disabled
    [    1.648368] CPU features: 0x00003000,00000802
    [    1.648372] Memory Limit: none

Several factors contributed to this issue:

 1. The mtk_bmt driver recursively calls its scan_bmt() helper function
    during device initialization, while looking for a valid block
    mapping table (BMT).

 2. Commit fa4dc86e98 ("kernel: backport MEMREAD ioctl"):

      - increased the size of some stack-allocated structures (like
	struct mtd_oob_ops, used in bbt_nand_read(), which is indirectly
	called from scan_bmt()),

      - increased the stack size for some functions (for example,
	spinand_mtd_read(), which is indirectly called from scan_bmt(),
	now uses an extra stack-allocated struct mtd_ecc_stats).

 3. OpenWrt currently compiles the kernel with the
    -fno-optimize-sibling-calls flag, which prevents tail-call
    optimization.

Collectively, all of these factors caused stack usage in the mtk_bmt
driver to grow excessively large, triggering stack overflows.

Recursion is not really necessary in scan_bmt() as it simply iterates
over flash memory blocks in reverse order, looking for a valid BMT.
Refactor the logic contained in the scan_bmt() and read_bmt() functions
in target/linux/generic/files/drivers/mtd/nand/mtk_bmt_v2.c so that deep
recursion is prevented (and therefore also any potential stack overflows
it may cause).

Link: https://lists.openwrt.org/pipermail/openwrt-devel/2023-April/040872.html
Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
2023-04-29 12:58:48 +02:00
Hauke Mehrtens
1f41b6bb83 kernel: Activate CONFIG_SCHED_STACK_END_CHECK
This activates the CONFIG_SCHED_STACK_END_CHECK option.

The kernel will check if the kernel stack overflowed in the schedule()
function. This just adds a very small computational overhead.

This option is activated in Debian by default.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 12:40:10 +02:00
Hauke Mehrtens
ff536eca58 kernel: Activate CONFIG_SLAB_FREELIST_HARDENED
This activates some extra checks in SLAB or SLUB to make it harder to
execute kernel heap exploits. This adds a minor performance
degradation which I haven't measured-.

Many mainstream Linux distributions also activate this option.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 12:38:09 +02:00
Hauke Mehrtens
2bab7d273e kernel: Initialize RNG using CPU RNG and bootloader
This activates the following kernel options by default:
* CONFIG_RANDOM_TRUST_CPU
* CONFIG_RANDOM_TRUST_BOOTLOADER

With these option Linux will also use data from the CPU RNG e.g. RDRAND
and the bootloader to initialize the Linux RNG if such sources are
available.
These random bits are used in addition to the other sources, no other
sources are getting deactivated. I read that the Chacha mixer isn't
vulnerable to injected entropy, so this should not be a problem even if
these sources might inject bad random data.

The Linux kernel suggests to activate both options, Debian also
activates them. This does not increase kernel code size.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-04-29 12:35:44 +02:00
Felix Fietkau
ec6f80663e mediatek: remove mt753x driver
It is unused

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-29 10:25:43 +02:00
David Bauer
2c530fcb97 ramips: reduce Archer AX23 / MR70X SPI-frequency
It was brought to attention the Archer AX23 v1 fails to read jffs2 data
from time to time. While this is not reproducible on my unit, it is on
others.

Reducing the SPI frequency does the trick. While it worked with at lest
40 MHz, opt for the cautious side and choose a save frequency of 25 MHz.

Apply the same treatment to the Mercusys MR70X which uses a similar
design just in case.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-27 22:26:58 +02:00
Olliver Schinagl
de0ed4ffbf generic: Convert incorrect generic/5.15 patches again
OpenWrt's developer guide prefers having actual patches so they an be
sent upstream more easily.

However, in the case of hack-5.15 patches which are not meant for
upstream, adding proper fields allows for `git am` to properly function.

This commit tries to rectify that, by digging in the history to find
where and how it was first added.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-27 16:18:44 +01:00
Álvaro Fernández Rojas
c3549b9319 bmips: fix external interrupt controller
- irq_domain_add_simple() can't be used on bmips since interrupts aren't
hardcoded with specific offsets for internal and external as opposed to
bcm63xx. This is needed to avoid collisions with other interrupts.
- remove unused bcm63xx-specific code.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-27 15:39:09 +02:00
Álvaro Fernández Rojas
e9f5b773d2 bmips: document GPIO external interrupts
BCM63xx SoCs have an external interrupt controller which can be used for
specific GPIO keys.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-27 15:39:09 +02:00
Álvaro Fernández Rojas
11de53729a bmips: increment polled keys interval to 100
There's no need to poll the gpio keys every 20 ms and the linux kernel
documentation suggests 100 ms.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-27 15:39:09 +02:00
Álvaro Fernández Rojas
1129b226f7 kernel: ssb: fallback-sprom: check bustype
host_pci is only defined when bustype is SSB_BUSTYPE_PCI.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-24 21:02:29 +02:00
Álvaro Fernández Rojas
60acbbb1af kernel: bcma: fallback-sprom: check hosttype
host_pci is only defined when hosttype is BCMA_HOSTTYPE_PCI.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-24 21:02:29 +02:00
Álvaro Fernández Rojas
52e5a8b5cd kernel: bcma: fallback-sprom: align extraction with upstream
The current bcma SPROM extraction from upstream only supports SPROMs with
revisions from 8 to 11.
Let's align the downstream fallback driver with upstream.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-24 21:02:15 +02:00
Álvaro Fernández Rojas
2c234474a2 kernel: ssb: fallback-sprom: drop mac leftovers
This was left behind when removing the MAC extractions from PCI SPROMs.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-24 20:13:13 +02:00
Álvaro Fernández Rojas
d5c93d2b85 kernel: ssb: fallback-sprom: optimize struct data
- Remove unneeded mac bytes from struct (it's already present in the SPROM).
- Convert devid_override to boolean.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-24 20:10:48 +02:00
Álvaro Fernández Rojas
70e88044d5 kernel: bcma: fallback-sprom: optimize struct data
- Remove unneeded mac bytes from struct (it's already present in the SPROM).
- Convert devid_override to boolean.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-24 20:10:28 +02:00
Nick Hainke
0f269554e4
ipq40xx: convert GL-AP1300 to DSA
Convert GL-AP1300 to DSA and enable it.

While working on it rename the GL-AP1300 leds from green to white.

Tested-by: Rob White <rob@blue-wave.net>
Tested-by: Robert Sommer <frauhottelmann@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-04-24 18:32:26 +02:00
Martin Kennedy
90ad13c763 ath79: create APBoot-compatible image for Aruba AP-175
As was done in commit e11d00d44c ("ath79: create Aruba AP-105 APBoot
compatible image"), alter the Aruba AP-175 image generation process so
OpenWrt can be loaded with the vendor Aruba APBoot. Since the
remainder of the explanation and installation process is identical,
continuing the quote from that commit:

This works by prepending the OpenWrt LZMA loader to the uImage and
jumping directly to the loader. Aruba does not offer bootm on these
boards.

This approach keeps compatibility to devices which had their U-Boot
replaced. Both bootloaders can boot the same image.

With this patch, new installations do not require replacing the
bootloader and can be performed from the serial console without
opening the case.

Installation
------------

1. Attach to the serial console of the AP-175.
   Interrupt autoboot and change the U-Boot env.

   $ setenv apb_rb_openwrt "setenv ipaddr 192.168.1.1;
     setenv serverip 192.168.1.66;
     netget 0x84000000 ap175.bin; go 0x84000040"
   $ setenv apb_fb_openwrt "cp.b 0xbf040000 0x84000000 0x10000;
     go 0x84000040"
   $ setenv bootcmd "run apb_fb_openwrt"
   $ saveenv

2. Load the OpenWrt initramfs image on the device using TFTP.
   Place the initramfs image as "ap175.bin" in the TFTP server
   root directory, connect it to the AP and make the server reachable
   at 192.168.1.66/24.

   $ run apb_rb_openwrt

3. Once OpenWrt booted, transfer the sysupgrade image to the device
   using scp and use sysupgrade to install the firmware.

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
2023-04-24 10:44:49 +02:00
Daniel Golle
6d33afd2b6 kernel: net: phy: realtek: fix NULL pointer dereference
The previous attempt to replace an open coded paged read in the RealTek
Ethernet PHY driver was too naive and resulted in breaking the r8169
PCIe Ethernet driver which also makes use of the RealTek Ethernet PHY
driver.
Fix this by instead of using the (not yet populated) paged operations
rather use rtl821x_write_page and protect the whole paged read operation
using the MDIO bus mutex.

Fixes: 998b973157 ("kernel: net: phy: realtek: improve RealTek 2.5G PHY driver")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-24 03:16:26 +01:00
Sebastian Schaper
0601f7134d ramips: fix green LED for D-Link DAP-X1860
It was found this device uses a single tri-color power/status LED
rather than individual red/orange LEDs, which also supports green.

Add GPIO for green color and use with `boot` and `running` aliases.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-24 03:06:39 +02:00
Felix Baumann
45cf200b2e ramips: Cudy X6 fixes / improvements
- Correct WiFi MACs, they didn't match oem firmware
- Move nvmem-cells to bdinfo partition and remove &bdinfo reference
- Add OEM device model name R13 to SUPPORTED_DEVICES
  This allows sysupgrading from Cudy's OpenWrt fork without force
- Label red_led and use it during failsafe mode and upgrades

MAC addresses as verified by OEM firmware:

use   address             source
LAN   b4:4b:d6:2d:c8:4a   label
WAN   b4:4b:d6:2d:c8:4b   label + 1
2g    b4:4b:d6:2d:c8:4a   label
5g    b6:4b:d6:3d:c8:4a   label + LA-Bit set + 4th oktet increased

The label MAC address is found in bdinfo 0xde00.

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
[read wifi mac from flash offset]
Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-24 02:57:26 +02:00
Andreas Böhler
097f350aeb ath79: add support for Alcatel HH40V
The Alcatel HH40V is a CAT4 LTE router used by various ISPs.

Specifications
==============

SoC: QCA9531 650MHz
RAM: 128MiB
Flash: 32MiB SPI NOR
LAN: 1x 10/100MBit
WAN: 1x 10/100MBit
LTE: MDM9607 USB 2.0 (rndis configuration)
WiFi: 802.11n (SoC integrated)

MAC address assignment
======================

There are three MAC addresses stored in the flash ROM, the assignment
follows stock. The MAC on the label is the WiFi MAC address.

Installation (TFTP)
===================

1. Connect serial console
2. Configure static IP to 192.168.1.112
3. Put OpenWrt factory.bin file as firmware-system.bin
4. Press Power + WPS and plug in power
5. Keep buttons pressed until TFTP requests are visible
6. Wait for the system to finish flashing and wait for reboot
7. Bootup will fail as the kernel offset is wrong
8. Run "setenv bootcmd bootm 0x9f150000"
9. Reset board and enjoy OpenWrt

Installation (without UART)
===========================

Installation without UART is a bit tricky and requires several steps too
long for the commit message. Basic steps:

1. Create configure backup
2. Patch backup file to enable SSH
3. Login via SSH and configure the new bootcmd
3. Flash OpenWrt factory.bin image manually (sysupgrade doesn't work)

More detailed instructions will be provided on the Wiki page.

Tested by: Christian Heuff <christian@heuff.at>
Signed-off-by: Andreas Böhler <dev@aboehler.at>
2023-04-23 19:32:18 +02:00
Tony Ambardar
70000ab509 ath79: use gpios for switch management in WZR-HP-G300NH variants
The RTL8366S/RB switch node in DTS defines "mii-bus = <&mdio0>" to permit
management via SMI but this has likely never worked, instead falling back
to using GPIOs in the past:

     rtl8366s switch: cannot find mdio bus from bus handle (yet)
     rtl8366s switch: using GPIO pins 19 (SDA) and 20 (SCK)
     rtl8366s switch: RTL8366 ver. 1 chip found

Recently, the rtl8366s and rtl8366_smi drivers were changed from built-in
to loadable modules. This affected driver probing order and caused switch
initialization (and network access) to fail:

     rtl8366s switch: using MDIO bus 'ag71xx_mdio'
     rtl8366s switch: unknown chip id (ffff)
     rtl8366s switch: chip detection failed, err=-19

Force using GPIOs to manage the switch by dropping the "mii-bus" DTS
definition, which works for both built-in and loadable switch drivers.

Fixes: 6e0f0eae5b ("ath79: use rtl8366s and rtl8366_smi as a module")
Fixes: 575ec7a4b1 ("ath79: use rtl8366rb as a module")
Tested-by: Tony Ambardar <itugrok@yahoo.com> # WZR-HP-G300NH (RTL8366S)
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2023-04-23 18:57:29 +02:00
Tony Ambardar
f3bb1eea32 ath79: fix switch support for WZR-HP-G300NH devices
Switch drivers for RTL8366S/RB were packaged as modules but not properly
added to device definitions for WZR-HP-G300NH router variants, breaking
network access to both after installation or upgrade.

Assign the correct switch driver package for each router.

Fixes: 6e0f0eae5b ("ath79: use rtl8366s and rtl8366_smi as a module")
Fixes: 575ec7a4b1 ("ath79: use rtl8366rb as a module")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2023-04-23 18:57:29 +02:00
Haoan Li
c7b484f364 ramips: fix lzma-loader for buffalo_WSR_600DHP
This fixes a well known "LZMA ERROR 1" error, reported previously on
numerous of similar devices.

Fixes: #11919
Signed-off-by: Haoan Li <lihaoan1001@163.com>
2023-04-23 14:12:11 +02:00
Álvaro Fernández Rojas
3132eff000 bmips: shg2500: add BCM4360 fallback SPROM
Apart from the embedded BCM63268 wireless, this device has an external BCM4360
connected by PCIe which needs a fallback SPROM.
b43 isn't enabled for this device because BCM4360 isn't supported (AC PHY).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:19:02 +02:00
Álvaro Fernández Rojas
0cecebd413 bmips: dgnd3700v2: add b43 wireless driver
Apart from the embedded BCM6362 wireless, Netgear DGND3700v2 has external
BCM43228 wireless connected by PCIe.
Fallback SPROM isn't needed for this one because it has a physical SPROM.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:19:02 +02:00
Álvaro Fernández Rojas
7f285b9c1d bmips: leds-sercomm-msp430: improve driver
- Add missing module functions.
- Fix infinite pattern trigger by converting negative values to 0.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:19:02 +02:00
Álvaro Fernández Rojas
f6f4db6e4d bmips: enet: add missing module functions
- Add missing MODULE_DEVICE_TABLE().
- Switch bcm6348-iudma to module_platform_driver().
- Add missing MODULE_AUTHOR, MODULE_DESCRIPTION, MODULE_LICENSE and
MODULE_ALIAS.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:19:02 +02:00
Álvaro Fernández Rojas
b98955c623 bmips: pci: use standard module functions
late_initcall_sync() is no longer needed so standard module functions can be
used on all bmips PCI/PCIe drivers.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:19:02 +02:00
Álvaro Fernández Rojas
7872a0ee2c bmips: drop custom b43-sprom fixups
b43-sprom fixups and no longer used and can be removed from bmips targets.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:18:36 +02:00
Álvaro Fernández Rojas
7122609082 bmips: switch to generic bcma/ssb fallback SPROM
Stop using bmips b43-sprom fixups and switch to generic bcma/ssb fallback
SPROMs. This way we don't need to include the b43-sprom fixups on devices
without Broadcom wireless.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:18:35 +02:00
Álvaro Fernández Rojas
e656bcbab0 kernel: add bcma/ssb fallback SPROM support
This adds generic kernel support for Broadcom Fallback SPROMs so that it can be
used in any target, even non Broadcom ones.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-23 12:18:35 +02:00
Daniel Kestrel
e1242fc339
generic: 5.15: replace ramips AR8033 fiber patch with 5.18 patches
A patch was added in kernel 5.4 to support the fiber operation of
AR8033 with ramips devices. In kernel 5.18 similar enhancements
were added to the kernel. Those patches are required for other
fiber based devices but when added, build fails for ramips targets.
This commit removes the ramips patch and adds the kernel 5.18 ones.

Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
[ split commit,refresh patch and improve commit message ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-22 17:21:29 +02:00
Daniel Kestrel
85b2f213c5
generic: 5.10: replace ramips AR8033 fiber patch with 5.18 patches
A patch was added in kernel 5.4 to support the fiber operation of
AR8033 with ramips devices. In kernel 5.18 similar enhancements
were added to the kernel. Those patches are required for other
fiber based devices but when added, build fails for ramips targets.
This commit removes the ramips patch and adds the kernel 5.18 ones.

Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
[ split commit, refresh patch and improve commit title ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-22 17:21:29 +02:00
Christian Marangi
aa8ba5166e
generic: 5.10: replace pending 730-net-phy-at803x-fix... with upstream
Replace pending 730-net-phy-at803x-fix-feature-detection.patch with
upstream version and move it to backport.

Refresh other related patch while moving it.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-22 17:21:28 +02:00
Daniel Golle
bf3b876a63 kernel: refresh 729-net-phy-realtek-introduce-rtl822x_probe.patch
The patch needs to be refreshed to apply cleanly.

Fixes: 998b973157 ("kernel: net: phy: realtek: improve RealTek 2.5G PHY driver")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-22 12:25:14 +01:00
Chukun Pan
21be2c26d5 mediatek: add support for TP-Link TL-XDR4288/608x
Hardware specification:
  SoC: MediaTek MT7986A 4x A53
  Flash: ESMT F50L1G41LB 128MB
  RAM: ESMT M15T4G16256A 512MB
  Ethernet (Max Speed):
    XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
    XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan
    XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan
  WiFi:
    XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R)
    XDR6086/XDR6088:
      WiFi1: MT7976GN 2.4GHz 4T4R
      WiFi2: MT7976AN 5GHz 4T4R
  Button: Reset, WPS, Turbo
  USB: 1 x USB 3.0
  Power: DC 12V 4A

Flash instructions:
  1. Execute the following operation to open nc shell:
     https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting
  2. Replace the stock bootloader to OpenWrt's:
     dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin
     dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip
  3. Connect to your PC via the Gigabit port of the router,
     set a static ip on the ethernet interface of your PC.
     (ip 192.168.1.254, gateway 192.168.1.1)
  4. Download the initramfs image, and restart the router,
     waiting for tftp recovery to complete.
  5. After openwrt boots up, perform sysupgrade.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
[Add uboot build, fit and sysupgrade support, fix RealTek PHYs]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-22 04:10:19 +01:00
Daniel Golle
998b973157 kernel: net: phy: realtek: improve RealTek 2.5G PHY driver
* use interface mode switching only when operating in C45 mode
   Linux prevents switching the interface mode when using C22 MDIO,
   hence use rate-adapter mode in case the PHY controlled via C22.

 * use phy_read_paged where appropriate

 * use existing generic inline functions to handle 10GbE advertisements
   instead of redundantly defining register macros in realtek.c which
   are not actually vendor-specific.

 * make sure 10GbE advertisement is valid, preventing false-positive
   warning "Downshift occurred from negotiated speed 2.5Gbps to actual
   speed 1Gbps, check cabling!" with some link-partners using 1G mode.

 * Support Link Down Power Saving Mode (ALDPS)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-22 04:08:41 +01:00
John Audia
126c64df2b kernel: bump 5.10 to 5.10.178
Removed upstreamed:
	backport-5.10/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch[1]

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.178&id=0279e82e148407feec88466990de14bcba9e12c0

All other patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-22 01:15:03 +02:00
John Audia
3887a55909 kernel: bump 5.15 to 5.15.108
Removed upstreamed:
	backport-5.15/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch[1]
	backport-5.15/612-v6.3-skbuff-Fix-a-race-between-coalescing-and-releasing-S.patch[2]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.108&id=85d7a7044b759d865d10395a357632af00de5867
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.108&id=906a6689bb0191ad2a44131a3377006aa098af59

Build system: x86_64
Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-22 01:10:24 +02:00
Chukun Pan
28ce677fa7
generic: update nvmem cell mac-address-ascii support
Instead of use mac-address-ascii in nvmem_get_mac_address
function, move it into of_get_mac_addr_nvmem function to
support more devices.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-04-21 21:35:45 +02:00
Chukun Pan
31c15813f9
ramips: MSG1500 X.00: switch to mac-address-ascii dts
The Config partition of some machines is special, and the openwrt script
cannot read the protest_lan_mac correctly. This problem can be solved by
reading the mac address (ascii) in dts.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-04-21 21:35:41 +02:00
Chukun Pan
1f68baf5f0
mediatek: filogic: remove redundant code for tuf-ax4200
Remove redundant code in 02_network.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-04-21 18:44:40 +02:00
Chukun Pan
30d84684cf
mediatek: filogic: move mac address setting together
Simultaneously sort in the order of letters.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-04-21 18:44:40 +02:00
Chukun Pan
800ce7f7b4
mediatek: filogic: fix network config for mt7986a-rfb
Fix the network configuration according to the device tree.

Fixes: 5faff99 ("mediatek: filogic: fix mt7986a ethernet devicetree entries")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2023-04-21 18:44:36 +02:00
Daniel Golle
9f2ede5551 mediatek: filogic: update kernel config-5.15
Expose thermal-zone as hwmon sensor, remove thermal emulation driver
and add some missing symbols.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-20 01:05:30 +01:00
Daniel Golle
929634c4de mediatek: bpi-r3: allow up to 3W per SFP module
According to SinoVoip up to 3A @ 3.3V are available for both
SFP modules together. Raise energy limit from 1W (default) to 3W,
however, be aware that using modules consuming more than 1W will
require active cooling!

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-20 01:03:56 +01:00
John Audia
f4989239cc kernel: bump 5.15 to 5.15.107
All  patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-19 00:55:58 +02:00
Álvaro Fernández Rojas
5ec781c444 bmips: pci-bcm6348: load IO resource from DT ranges
Correctly load IO resource from DT ranges and remove the specific IO resource.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-18 20:11:28 +02:00
Álvaro Fernández Rojas
16b0cbbde0 bmips: drop unneeded ath9k fixup
We no longer need the custom ath9k fixup now that we're using the standard
kmod-owl-loader.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-18 19:45:04 +02:00
Álvaro Fernández Rojas
db4f158c03 bmips: hg556a: switch to kmod-owl-loader
Stop using custom ath9k fixup and switch to standard kmod-owl-loader

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-18 19:45:04 +02:00
Michał Kępień
5264296ce4
ath79: mikrotik: update kernel on NAND using Yafut
Instead of erasing the entire NAND partition holding the kernel during
every system upgrade and then flashing a Yaffs file system image
prepared using kernel2minor (not accounting for bad blocks in the
process), use the Yafut utility to replace the kernel executable on
MikroTik NAND devices, preserving the existing Yaffs file system
(including bad block information) on the partition holding the kernel.

Add Yafut to DEFAULT_PACKAGES for the ath79/mikrotik target, so that the
tool is included in the initramfs images created when building for
multiple profiles.  However, exclude Yafut from the images built for
MikroTik devices with NOR flash as the tool is currently only meant to
be used on devices with NAND flash.

As this addresses the concerns for MikroTik NAND devices discussed in
commit 9d96b6fb72 ("ath79/mikrotik: disable building NAND images"),
re-enable building images for these devices.

Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
2023-04-18 13:53:04 +02:00
Michał Kępień
fa4dc86e98
kernel: backport MEMREAD ioctl
MEMREAD is a new ioctl for MTD character devices that was first included
in Linux 6.1.  It allows userspace applications to use the Linux
kernel's OOB autoplacement mechanism while reading data from NAND
devices.  The Yafut tool needs this ioctl to do its job.

Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
2023-04-18 13:53:03 +02:00
Michał Kępień
3d110053f8
ath79: mikrotik: drop unused files from ramdisk
The ramdisk used by sysupgrade on MikroTik devices currently includes
U-Boot fw_* files that are not necessary for performing a system upgrade
on that platform.  The relevant lines were added to
target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh by commit
a66eee6336 ("ath79: add mikrotik subtarget"), likely because they also
existed in target/linux/ath79/nand/base-files/lib/upgrade/platform.sh,
where the platform_do_upgrade_mikrotik_nand() function moved by commit
a66eee6336 originally lived.  However, these lines were added to
target/linux/ath79/nand/base-files/lib/upgrade/platform.sh by commit
55e6c903ae ("ath79: GL-AR300M: provide NAND support; increase to 4 MB
kernel"), which is not related to MikroTik devices in any way.

Remove the code adding unused U-Boot fw_* files to the ramdisk used by
sysupgrade on MikroTik devices.

Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
2023-04-18 13:53:00 +02:00
David Bauer
e11d00d44c ath79: create Aruba AP-105 APBoot compatible image
Alter the Aruba AP-105 image generation process so OpenWrt can be loaded
with the vendor Aruba APBoot.

This works by prepending the OpenWrt LZMA loader to the uImage and
jumping directly to the loader. Aruba does not offer bootm on these
boards.

This approach keeps compatibility to devices which had their U-Boot
replaced. Both bootloaders can boot the same image.

The same modification is most likely also possible for the Aruba AP-175.

With this patch, new installations do not require replacing the
bootloader and can be performed from the serial console without opening
the case.

Installation
------------

1. Attach to the serial console of the AP-105.
   Interrupt autoboot and change the U-Boot env.

   $ setenv apb_rb_openwrt "setenv ipaddr 192.168.1.1;
     setenv serverip 192.168.1.66;
     netget 0x84000000 ap105.bin; go 0x84000040"
   $ setenv apb_fb_openwrt "cp.b 0xbf040000 0x84000000 0x10000;
     go 0x84000040"
   $ setenv bootcmd "run apb_fb_openwrt"
   $ saveenv

2. Load the OpenWrt initramfs image on the device using TFTP.
   Place the initramfs image as "ap105.bin" in the TFTP server
   root directory, connect it to the AP and make the server reachable
   at 192.168.1.66/24.

   $ run apb_rb_openwrt

3. Once OpenWrt booted, transfer the sysupgrade image to the device
   using scp and use sysupgrade to install the firmware.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-18 00:11:22 +02:00
Mark Onstid
5811db1d0b
ath79: fix LED pinout for Comfast CF-E314N v2
In addition to standardizing LED names to match the rest of the systems, this
commit fixes a possibly erroneous pinout for LEDs in Comfast CF-E314N v2.

In particular, rssimediumhigh and rssihigh are moved from pins 13 and 14 to
14 and 16 respectively. In addition to working on a test device, this pinout
better matches the one set out in the prototype support patch for the device
in Github PR #1873.

Signed-off-by: Mark Onstid <turretkeeper@mail.com>
2023-04-17 19:02:25 +02:00
Oleksandr Zharov
998c34d3fe
ramips: add Xiaomi RA75 red signal led
RA75 has 5 physical LEDs under 2 indicators, mixed with light pipes:
Indicator "System":
  GPIO0: blue
  GPIO2: amber
Indicator "Signal":
  GPIO44: blue
  GPIO37: amber
  GPIO46: red

All except GPIO46 were already added by Jo Deisenhofer. GPIO46 is used for UART1 by
default, so it needs additional pin control change in devicetree to be operational.
Verified on my RA75.

Signed-off-by: Oleksandr Zharov <alex.zeed@gmail.com>
2023-04-17 18:59:28 +02:00
David Bauer
72780e3eac ipq40xx: convert AP-365 to DSA
Re-enable the Aruba AP-365 with DSA support. Changes are trvivial, as
the board design is pretty much the already updated AP-303.

Run-tested on the device.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-15 14:15:42 +02:00
Daniel Golle
aad34818b5 kernel: backport fix for recently introduced UBI bug
Import commit "ubi: Fix failure attaching when vid_hdr offset equals to
(sub)page size" which did not yet make it to stable upstream Linux trees.

Fixes: #12232
Fixes: #12339
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-15 03:23:42 +01:00
Felix Fietkau
8ecf160c47 kernel: backport fix for a page pool related race condition
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-04-14 10:27:09 +02:00
Daniel Golle
b8e1fcad38 generic: move accepted patch to backport-5.15
The patch adding SFP quirk for MXPD 483II was accepted upstream and
will be part of Linux v6.3:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=ad651d68cee75e9ac20002254c4e5d09ee67a84b

Move the patch from pending-5.15 to backport-5.15.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-13 20:16:05 +01:00
Daniel Golle
f4f8c0e8de mediatek: sync pinctrl-mt7981 and pinctrl-mt7986 drivers
Now that new pinconf features have been backported sync pinctrl-mt7981
and pinctrl-m7986 with bleeding-edge upstream versions.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-13 20:01:33 +01:00
Daniel Golle
3cb2fddd30 mediatek: backport new pinctrl features
Backport new features for MediaTek pinctrl/pinconf drivers from upstream.
This will serve as the base to improve pinconf bias/pull-up/pull-down on
MT7981 and MT7986, and also prepare for upcoming support for MT7988.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-04-13 20:01:33 +01:00
Ian Chang
877ec78e23 mvebu: puzzle-mcu: add mcu write retry function
Avoid MCU getting "command reply receive timed out" message when LED
configuration setting trigger function is enabled in heartbeat mode.

Signed-off-by: Ian Chang <ianchang@ieiworld.com>
2023-04-13 01:07:54 +01:00
Michael Trinidad
ff91a12c8d base-files: fix Linksys upgrade, restore config step
It appears that the refactor of the upgrade process for NAND devices                                                                                                                            resulted in the nand_do_upgrade_success step not being called for
devices using the linksys.sh script. As a result, configuration was
not preserved over sysupgrade steps.

This corrects a typo in the call of nand_do_upgrade_failed for ipq40xx
and ipq806x devices using the linksys.sh script.

Fixes: 8634c1080d ("ipq40xx: Fix Linksys upgrade, restore config step")
Fixes: 2715aff5df ("ipq806x: Fix Linksys upgrade, restore config step")
Signed-off-by: Michael Trinidad <trinidude4@hotmail.com>
2023-04-11 12:22:35 +02:00
Michael Trinidad
d1c1e10e89 mvebu: cortexa9: fix Linksys upgrade, restore config step
It appears that the refactor of the upgrade process for NAND devices                                                                                                                            resulted in the nand_do_upgrade_success step not being called for
devices using the linksys.sh script. As a result, configuration was
not preserved over sysupgrade steps.

This restores the preservation of configs for mvebu/cortexa9 devices using the
linksys.sh script.

Fixes: e25e6d8e54 ("base-files: fix and clean up nand sysupgrade code")
Signed-off-by: Michael Trinidad <trinidude4@hotmail.com>
2023-04-11 12:22:09 +02:00
Michael Trinidad
65f8089b7a kirkwood: fix Linksys upgrade, restore config step
It appears that the refactor of the upgrade process for NAND devices
resulted in the nand_do_upgrade_success step not being called for
devices using the linksys.sh script. As a result, configuration was
not preserved over sysupgrade steps.

This restores the preservation of configs for kirkwood devices using the
linksys.sh script.

Fixes: e25e6d8e54 ("base-files: fix and clean up nand sysupgrade code")
Fixes: #12298
Signed-off-by: Michael Trinidad <trinidude4@hotmail.com>
2023-04-11 12:21:15 +02:00
Paul Spooren
9cbc83726e bcm53xx: switch to Kernel 5.15 by default
Getting ready for the next release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
2023-04-10 23:13:12 +02:00
Paul Spooren
d10503060b bcm4908: switch to Kernel 5.15 by default
Getting ready for the next release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[rmilecki: tested on GT-AC5300: boot, sysupgrade & 940 Mbps NAT]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-04-10 21:21:03 +02:00
Álvaro Fernández Rojas
457549665f bmips: dts: add missing phy modes
PHY modes should be defined in the device tree for the bcm63xx internal switch.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-10 10:06:22 +02:00
Álvaro Fernández Rojas
2c824b4615 bmips: remove source-only flag
bmips target is now more stable and it's time to start generating buildbot
images in order to receive a wider testing, which will be essential to replace
bcm63xx target in the future.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-10 10:04:08 +02:00
Álvaro Fernández Rojas
6fd8e0f943 bmips: add subtargets for each SoC
BMIPS is a generic arch that can be used for multiple Broadcom SoCs, each one
with its own specific drivers, so instead of having a huge kernel supporting
all of them, let's switch to a subtarget per SoC like other OpenWrt targets.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-10 10:04:08 +02:00
Álvaro Fernández Rojas
e76556d967 bmips: b43-sprom: fix build when SSB/BCMA disabled
Fix build of B43 SPROM fallback when SSB or BCMA are disabled.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-10 10:04:08 +02:00
Álvaro Fernández Rojas
95b846fbc0 bmips: allow disabling mdio-mux-bcm6368
This controller is only present on SoCs with B53 MMAP switch.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-10 10:04:08 +02:00
Álvaro Fernández Rojas
f5adc5bafb kernel: disable CONFIG_HW_RANDOM_BCM2835
This HW RNG is present on some Broadcom 63XX SoCs, but not all of them.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-10 10:04:08 +02:00
John Audia
32f134fbdf kernel: bump 5.15 to 5.15.106
Removed upstreamed:
        generic/735-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch[1]
        pending-5.15/350-mips-bmips-BCM6358-disable-RAC-flush-for-TP1.patch[2]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.106&id=76f09582a191dcf11118fd4bdbf50f538c90fa8d

2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/mips/bmips?h=v5.15.106&id=65b723644294f1d79770704162c0e8d1f700b6f1

Build system: x86_64
Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod, ipq806x/R7800
Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod, ipq806x/R7800

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-09 14:48:34 +02:00
Álvaro Fernández Rojas
8bee6a9f1d bmips: switch to LED kernel modules
Disable LED controllers from kernel config and switch to per device kernel
modules.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 10:52:32 +02:00
Álvaro Fernández Rojas
6e081e1778 bmips: add LED kernel modules
Add BCM6328 and BCM6358 LED kernel modules.
This allows selecting the LED controllers only for those devices using them.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 10:34:05 +02:00
Álvaro Fernández Rojas
aefeb34223 bmips: add support for Sercomm SHG2500
Sercomm SHG2500 is a BCM63168 with 128M of RAM, 256M of NAND, an external
BCM53124S switch for the LAN ports and internal/external Broadcom wifi.
LEDs are connected to an external MSP430G2513 MCU controlled via SPI.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 10:33:13 +02:00
Álvaro Fernández Rojas
d11a7c4d95 bmips: use sercomm-pid script
Make use of sercomm-pid script for generating the Sercomm PID, which avoids
having to add an array of hex bytes for every new Sercomm device.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 10:21:58 +02:00
Álvaro Fernández Rojas
d309160d30 bmips: image: rename SERCOMM_VERSION to SERCOMM_FSVER
SERCOMM_VERSION is ambiguous and it should be more clear that it refers to the
version used for the filesystem.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 10:06:26 +02:00
Álvaro Fernández Rojas
8758438c27 ramips: sercomm-payload: use pide-file argument
Instead of passing an array of hex bytes for the Sercomm PID we can now use
the --pid-file parameter.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 09:59:21 +02:00
John Audia
78a468f690 kernel: bump 5.10 to 5.10.177
All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-08 15:32:01 +02:00
Joe Mullally
2122c80b32 ramips: lower re305-v3 spi-max-frequency
Fix flash I/O instability observed in newer devices with cFeon
QH64A-104HIP (detected as en25qh64).

Ref: https://forum.openwrt.org/t/support-for-tp-link-re305-v3/75893/91

Reported-by: Dimitri Souza <dimitri.souza@gmail.com>
Tested-by: Dimitri Souza <dimitri.souza@gmail.com>
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
[alter commit-message - target master]
Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
827a40502f mpc85xx: refresh patches
Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
765f66810a mpc85xx: add support for Enterasys WS-AP3715i
Hardware
--------

SoC:   NXP P1010 (1x e500 @ 800MHz)
RAM:   256M DDR3 (2x Samsung K4B1G1646G-BCH9)
FLASH: 32M NOR (Spansion S25FL256S)
BTN:   1x Reset
WiFi:  1x Atheros AR9590 2.4 bgn 3x3
       2x Atheros AR9590 5.0 an 3x3
ETH:   2x Gigabit Ethernet (Atheros AR8033 / AR8035)
UART:  115200 8N1 (RJ-45 Cisco)

Installation
------------
1. Grab the OpenWrt initramfs, rename it to ap3715.bin. Place it in
   the root directory of a TFTP server and serve it at
   192.168.1.66/24.

2. Connect to the serial port and boot the AP. Stop autoboot in U-Boot
   by pressing Enter when prompted. Credentials are identical to the one
   in the APs interface. By default it is admin / new2day.

3. Alter the bootcmd in U-Boot:

 $ setenv ramboot_openwrt "setenv ipaddr 192.168.1.1;
   setenv serverip 192.168.1.66; tftpboot 0x2000000 ap3715.bin; bootm"

 $ setenv boot_openwrt "sf probe 0; sf read 0x2000000 0x140000 0x1000000;
   bootm 0x2000000"

 $ setenv bootcmd "run boot_openwrt"

 $ saveenv

4. Boot the initramfs image

 $ run ramboot_openwrt

5. Transfer the OpenWrt sysupgrade image to the AP using SCP. Install
   using sysupgrade.

 $ sysupgrade -n <path-to-sysupgrade.bin>

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
f058dad1b6 mpc85xx: don't compress kernel image for WS-AP3825i
The kernel is already compressed with XZ by the bootwrapper, thus we
gain nothing by compressing it a second time.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
1d4d21481f mpc85xx: reserve upper 1MB of RAM for WS-AP3825i
The bootpage for the second core is placed by U-Boot in the upper 128k
of syste-memory.

This could either be a reserved-area or deducted from the total
system-memory. As only the latter is parsed by the bootwrapper, reduce
the available system memory for linux in order to preserve the bootpage
from being overwritten.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
e3f31ff20d mpc85xx: backport bootwrapper patch to kernel 5.10
Kernel 5.10 builds currently fail because the patch for using the
simpleImage bootwrapper were not added to 5.10.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
51046da7be mpc85xx: add properties normally added by U-Boot
This adds properties to PCIe as well as ethernet nodes which are
normally added by the Extreme Networks U-Boot.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
16e1bf509c mpc85xx: fix incorrect CPU node / properties
This adds properties normally filled by U-Boot. Also it fixes the node
name, which is incorrectly referring to a P1010 core.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
3d43d68333 mpc85xx: add localbus frequency for WS-AP3825i
This is normally filled by U-Boot.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
e81709af13 mpc85xx: add linux,stdout-path for WS-AP3825i
This is normally filled by U-Boot. Prevents double-printing of early
console messages. Also enables debug-output by the zImage wrapper.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
David Bauer
076da59f17 ramips: define remapping-range for DAP-X1860
Prevent the BBT translation layer from remapping the UBI used for
storing rootfs.

Explicitly define the number of blocks reserved for remapping.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-04-08 14:41:01 +02:00
Paul Spooren
c8934099bf octeon: switch to Kernel 5.15 by default
Getting ready for the next release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2023-04-08 00:47:12 +02:00
Paul Spooren
596059266a kirkwood: switch to Kernel 5.15 by default
Getting ready for the next release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2023-04-08 00:43:25 +02:00
Paul Spooren
16565bc1ce tegra: switch to Kernel 5.15 by default
Getting ready for the next release.

Acked-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2023-04-08 00:30:22 +02:00
Raylynn Knight
036372c769
realtek: Fix typo for EnGenius EWS2910P
Fix mis-typed DEVICE-MODEL in mk file for EnGenius EWS2910P.

Signed-off-by: Raylynn Knight <rayknight@me.com>
[ fix wrong SoB format and improve commit title/description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-04-07 11:22:37 +02:00
Rafał Miłecki
9a62b3977f kernel: backport NVMEM patch for U-Boot env data "ethaddr" cell
Adjust our local code to avoid breakage.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-04-06 12:21:29 +02:00
Rafał Miłecki
323072f3a6 kernel: backport NVMEM patches queued for the v6.4
They add NVMEM layouts support. It allows handling NVMEM content
independently of NVMEM device access.

Skip U-Boot env data patch for now as it break our downstream MAC hacks.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-04-06 12:13:22 +02:00
Rafał Miłecki
b67ba02fc8 kernel: backport mtd fixes for nvmem
They are needed for NVMEM changes pending for v6.4.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-04-06 07:26:11 +02:00