Refresh patches to make them apply to kernel 5.4.
The removed patches have been merged upstream.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
+++ b/arch/mips/bcm63xx/Kconfig
@@ -7,10 +7,17 @@ config BCM63XX_CPU_3368
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
+config BCM63XX_OHCI
+ bool
config BCM63XX_CPU_6328
bool "support 6328 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
+ select BCM63XX_OHCI
config BCM63XX_CPU_6338
@@ -25,21 +32,25 @@ config BCM63XX_CPU_6348
bool "support 6348 CPU"
select SYS_HAS_CPU_BMIPS32_3300
- select HW_HAS_PCI
+ select HAVE_PCI
+ select BCM63XX_OHCI
config BCM63XX_CPU_6358
bool "support 6358 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
+ select BCM63XX_OHCI
config BCM63XX_CPU_6362
bool "support 6362 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
+ select BCM63XX_OHCI
config BCM63XX_CPU_6368
bool "support 6368 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
+ select BCM63XX_OHCI
endmenu
config BCM63XX_CPU_6328
bool "support 6328 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
+ select BCM63XX_EHCI
bool "support 6338 CPU"
@@ -39,18 +46,21 @@ config BCM63XX_CPU_6358
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
+ select BCM63XX_EHCI
config BCM63XX_CPU_6362
bool "support 6362 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
+ select BCM63XX_EHCI
config BCM63XX_CPU_6368
bool "support 6368 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
+ select BCM63XX_EHCI
endmenu
+++ /dev/null
-From a2b8c7f648e168573905818dbb4cb90ca3957c65 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 28 Jun 2017 18:29:43 +0200
-Subject: [PATCH] mtd: bcm63xxpart: move imagetag parsing to its own parser
-
-Move the bcm963xx Image Tag parsing into its own partition parser. This
-Allows reusing the parser with different full flash parsers.
-
-While moving it, rename it to bcm963* to better reflect it isn't chip
-but board specific.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
-I tried to keep the code as-is, to keep the changes as small as
-possible.
-
-One side effect is that the partitions get renumbered, which means any
-root=/dev/mtdblock* will now point to the wrong mtd device. But since
-bcm963xx boards will require these hardcoded in the kernel commandline
-anyway this should b a non issue, as it can be easily updated.
-
-There is no such thing in the mips/bcm63xx defconfig, so nothing to update
-there.
-
- drivers/mtd/Kconfig | 1 +
- drivers/mtd/bcm63xxpart.c | 155 ++----------------------
- drivers/mtd/parsers/Kconfig | 11 ++
- drivers/mtd/parsers/Makefile | 1 +
- drivers/mtd/parsers/parser_imagetag.c | 214 ++++++++++++++++++++++++++++++++++
- 5 files changed, 235 insertions(+), 147 deletions(-)
- create mode 100644 drivers/mtd/parsers/parser_imagetag.c
-
---- a/drivers/mtd/Kconfig
-+++ b/drivers/mtd/Kconfig
-@@ -162,6 +162,7 @@ config MTD_BCM63XX_PARTS
- tristate "BCM63XX CFE partitioning support"
- depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
- select CRC32
-+ select MTD_PARSER_IMAGETAG
- help
- This provides partions parsing for BCM63xx devices with CFE
- bootloaders.
---- a/drivers/mtd/bcm63xxpart.c
-+++ b/drivers/mtd/bcm63xxpart.c
-@@ -93,51 +93,19 @@ static int bcm63xx_read_nvram(struct mtd
- return 0;
- }
-
--static int bcm63xx_read_image_tag(struct mtd_info *master, const char *name,
-- loff_t tag_offset, struct bcm_tag *buf)
--{
-- int ret;
-- size_t retlen;
-- u32 computed_crc;
--
-- ret = mtd_read(master, tag_offset, sizeof(*buf), &retlen, (void *)buf);
-- if (ret)
-- return ret;
--
-- if (retlen != sizeof(*buf))
-- return -EIO;
--
-- computed_crc = crc32_le(IMAGETAG_CRC_START, (u8 *)buf,
-- offsetof(struct bcm_tag, header_crc));
-- if (computed_crc == buf->header_crc) {
-- STR_NULL_TERMINATE(buf->board_id);
-- STR_NULL_TERMINATE(buf->tag_version);
--
-- pr_info("%s: CFE image tag found at 0x%llx with version %s, board type %s\n",
-- name, tag_offset, buf->tag_version, buf->board_id);
--
-- return 0;
-- }
--
-- pr_warn("%s: CFE image tag at 0x%llx CRC invalid (expected %08x, actual %08x)\n",
-- name, tag_offset, buf->header_crc, computed_crc);
-- return 1;
--}
-+static const char * const bcm63xx_cfe_part_types[] = {
-+ "bcm963xx-imagetag",
-+ NULL,
-+};
-
- static int bcm63xx_parse_cfe_nor_partitions(struct mtd_info *master,
- const struct mtd_partition **pparts, struct bcm963xx_nvram *nvram)
- {
-- /* CFE, NVRAM and global Linux are always present */
-- int nrparts = 3, curpart = 0;
-- struct bcm_tag *buf = NULL;
- struct mtd_partition *parts;
-- int ret;
-- unsigned int rootfsaddr, kerneladdr, spareaddr;
-- unsigned int rootfslen, kernellen, sparelen, totallen;
-+ int nrparts = 3, curpart = 0;
- unsigned int cfelen, nvramlen;
- unsigned int cfe_erasesize;
- int i;
-- bool rootfs_first = false;
-
- cfe_erasesize = max_t(uint32_t, master->erasesize,
- BCM963XX_CFE_BLOCK_SIZE);
-@@ -146,83 +114,9 @@ static int bcm63xx_parse_cfe_nor_partiti
- nvramlen = nvram->psi_size * SZ_1K;
- nvramlen = roundup(nvramlen, cfe_erasesize);
-
-- buf = vmalloc(sizeof(struct bcm_tag));
-- if (!buf)
-- return -ENOMEM;
--
-- /* Get the tag */
-- ret = bcm63xx_read_image_tag(master, "rootfs", cfelen, buf);
-- if (!ret) {
-- STR_NULL_TERMINATE(buf->flash_image_start);
-- if (kstrtouint(buf->flash_image_start, 10, &rootfsaddr) ||
-- rootfsaddr < BCM963XX_EXTENDED_SIZE) {
-- pr_err("invalid rootfs address: %*ph\n",
-- (int)sizeof(buf->flash_image_start),
-- buf->flash_image_start);
-- goto invalid_tag;
-- }
--
-- STR_NULL_TERMINATE(buf->kernel_address);
-- if (kstrtouint(buf->kernel_address, 10, &kerneladdr) ||
-- kerneladdr < BCM963XX_EXTENDED_SIZE) {
-- pr_err("invalid kernel address: %*ph\n",
-- (int)sizeof(buf->kernel_address),
-- buf->kernel_address);
-- goto invalid_tag;
-- }
--
-- STR_NULL_TERMINATE(buf->kernel_length);
-- if (kstrtouint(buf->kernel_length, 10, &kernellen)) {
-- pr_err("invalid kernel length: %*ph\n",
-- (int)sizeof(buf->kernel_length),
-- buf->kernel_length);
-- goto invalid_tag;
-- }
--
-- STR_NULL_TERMINATE(buf->total_length);
-- if (kstrtouint(buf->total_length, 10, &totallen)) {
-- pr_err("invalid total length: %*ph\n",
-- (int)sizeof(buf->total_length),
-- buf->total_length);
-- goto invalid_tag;
-- }
--
-- kerneladdr = kerneladdr - BCM963XX_EXTENDED_SIZE;
-- rootfsaddr = rootfsaddr - BCM963XX_EXTENDED_SIZE;
-- spareaddr = roundup(totallen, master->erasesize) + cfelen;
--
-- if (rootfsaddr < kerneladdr) {
-- /* default Broadcom layout */
-- rootfslen = kerneladdr - rootfsaddr;
-- rootfs_first = true;
-- } else {
-- /* OpenWrt layout */
-- rootfsaddr = kerneladdr + kernellen;
-- rootfslen = spareaddr - rootfsaddr;
-- }
-- } else if (ret > 0) {
--invalid_tag:
-- kernellen = 0;
-- rootfslen = 0;
-- rootfsaddr = 0;
-- spareaddr = cfelen;
-- } else {
-- goto out;
-- }
-- sparelen = master->size - spareaddr - nvramlen;
--
-- /* Determine number of partitions */
-- if (rootfslen > 0)
-- nrparts++;
--
-- if (kernellen > 0)
-- nrparts++;
--
- parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
-- if (!parts) {
-- ret = -ENOMEM;
-- goto out;
-- }
-+ if (!parts)
-+ return -ENOMEM;
-
- /* Start building partition list */
- parts[curpart].name = "CFE";
-@@ -230,30 +124,6 @@ invalid_tag:
- parts[curpart].size = cfelen;
- curpart++;
-
-- if (kernellen > 0) {
-- int kernelpart = curpart;
--
-- if (rootfslen > 0 && rootfs_first)
-- kernelpart++;
-- parts[kernelpart].name = "kernel";
-- parts[kernelpart].offset = kerneladdr;
-- parts[kernelpart].size = kernellen;
-- curpart++;
-- }
--
-- if (rootfslen > 0) {
-- int rootfspart = curpart;
--
-- if (kernellen > 0 && rootfs_first)
-- rootfspart--;
-- parts[rootfspart].name = "rootfs";
-- parts[rootfspart].offset = rootfsaddr;
-- parts[rootfspart].size = rootfslen;
-- if (sparelen > 0 && !rootfs_first)
-- parts[rootfspart].size += sparelen;
-- curpart++;
-- }
--
- parts[curpart].name = "nvram";
- parts[curpart].offset = master->size - nvramlen;
- parts[curpart].size = nvramlen;
-@@ -263,22 +133,13 @@ invalid_tag:
- parts[curpart].name = "linux";
- parts[curpart].offset = cfelen;
- parts[curpart].size = master->size - cfelen - nvramlen;
-+ parts[curpart].types = bcm63xx_cfe_part_types;
-
- for (i = 0; i < nrparts; i++)
- pr_info("Partition %d is %s offset %llx and length %llx\n", i,
- parts[i].name, parts[i].offset, parts[i].size);
-
-- pr_info("Spare partition is offset %x and length %x\n", spareaddr,
-- sparelen);
--
- *pparts = parts;
-- ret = 0;
--
--out:
-- vfree(buf);
--
-- if (ret)
-- return ret;
-
- return nrparts;
- }
---- a/drivers/mtd/parsers/Kconfig
-+++ b/drivers/mtd/parsers/Kconfig
-@@ -1,3 +1,14 @@
-+config MTD_PARSER_IMAGETAG
-+ tristate "Parser for BCM963XX Image Tag format partitions"
-+ depends on BCM63XX || BMIPS || COMPILE_TEST
-+ select CRC32
-+ help
-+ Image Tag is the firmware header used by broadcom on their xDSL line
-+ of devices. It is used to describe the offsets and lengths of kernel
-+ and rootfs partitions.
-+ This driver adds support for parsing a partition with an Image Tag
-+ header and creates up to two partitions, kernel and rootfs.
-+
- config MTD_PARSER_TRX
- tristate "Parser for TRX format partitions"
- depends on MTD && (BCM47XX || ARCH_BCM_5301X || COMPILE_TEST)
---- a/drivers/mtd/parsers/Makefile
-+++ b/drivers/mtd/parsers/Makefile
-@@ -1,2 +1,3 @@
-+obj-$(CONFIG_MTD_PARSER_IMAGETAG) += parser_imagetag.o
- obj-$(CONFIG_MTD_PARSER_TRX) += parser_trx.o
- obj-$(CONFIG_MTD_SHARPSL_PARTS) += sharpslpart.o
---- /dev/null
-+++ b/drivers/mtd/parsers/parser_imagetag.c
-@@ -0,0 +1,214 @@
-+/*
-+ * BCM63XX CFE image tag parser
-+ *
-+ * Copyright © 2006-2008 Florian Fainelli <florian@openwrt.org>
-+ * Mike Albon <malbon@openwrt.org>
-+ * Copyright © 2009-2010 Daniel Dickinson <openwrt@cshore.neomailbox.net>
-+ * Copyright © 2011-2013 Jonas Gorski <jonas.gorski@gmail.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ */
-+
-+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-+
-+#include <linux/bcm963xx_tag.h>
-+#include <linux/crc32.h>
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/sizes.h>
-+#include <linux/slab.h>
-+#include <linux/vmalloc.h>
-+#include <linux/mtd/mtd.h>
-+#include <linux/mtd/partitions.h>
-+
-+/* Ensure strings read from flash structs are null terminated */
-+#define STR_NULL_TERMINATE(x) \
-+ do { char *_str = (x); _str[sizeof(x) - 1] = 0; } while (0)
-+
-+static int bcm963xx_read_imagetag(struct mtd_info *master, const char *name,
-+ loff_t tag_offset, struct bcm_tag *buf)
-+{
-+ int ret;
-+ size_t retlen;
-+ u32 computed_crc;
-+
-+ ret = mtd_read(master, tag_offset, sizeof(*buf), &retlen, (void *)buf);
-+ if (ret)
-+ return ret;
-+
-+ if (retlen != sizeof(*buf))
-+ return -EIO;
-+
-+ computed_crc = crc32_le(IMAGETAG_CRC_START, (u8 *)buf,
-+ offsetof(struct bcm_tag, header_crc));
-+ if (computed_crc == buf->header_crc) {
-+ STR_NULL_TERMINATE(buf->board_id);
-+ STR_NULL_TERMINATE(buf->tag_version);
-+
-+ pr_info("%s: CFE image tag found at 0x%llx with version %s, board type %s\n",
-+ name, tag_offset, buf->tag_version, buf->board_id);
-+
-+ return 0;
-+ }
-+
-+ pr_warn("%s: CFE image tag at 0x%llx CRC invalid (expected %08x, actual %08x)\n",
-+ name, tag_offset, buf->header_crc, computed_crc);
-+ return -EINVAL;
-+}
-+
-+static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
-+ const struct mtd_partition **pparts,
-+ struct mtd_part_parser_data *data)
-+{
-+ /* CFE, NVRAM and global Linux are always present */
-+ int nrparts = 0, curpart = 0;
-+ struct bcm_tag *buf = NULL;
-+ struct mtd_partition *parts;
-+ int ret;
-+ unsigned int rootfsaddr, kerneladdr, spareaddr, offset;
-+ unsigned int rootfslen, kernellen, sparelen, totallen;
-+ int i;
-+ bool rootfs_first = false;
-+
-+ buf = vmalloc(sizeof(struct bcm_tag));
-+ if (!buf)
-+ return -ENOMEM;
-+
-+ /* Get the tag */
-+ ret = bcm963xx_read_imagetag(master, "rootfs", 0, buf);
-+ if (!ret) {
-+ STR_NULL_TERMINATE(buf->flash_image_start);
-+ if (kstrtouint(buf->flash_image_start, 10, &rootfsaddr) ||
-+ rootfsaddr < BCM963XX_EXTENDED_SIZE) {
-+ pr_err("invalid rootfs address: %*ph\n",
-+ (int)sizeof(buf->flash_image_start),
-+ buf->flash_image_start);
-+ goto out;
-+ }
-+
-+ STR_NULL_TERMINATE(buf->kernel_address);
-+ if (kstrtouint(buf->kernel_address, 10, &kerneladdr) ||
-+ kerneladdr < BCM963XX_EXTENDED_SIZE) {
-+ pr_err("invalid kernel address: %*ph\n",
-+ (int)sizeof(buf->kernel_address),
-+ buf->kernel_address);
-+ goto out;
-+ }
-+
-+ STR_NULL_TERMINATE(buf->kernel_length);
-+ if (kstrtouint(buf->kernel_length, 10, &kernellen)) {
-+ pr_err("invalid kernel length: %*ph\n",
-+ (int)sizeof(buf->kernel_length),
-+ buf->kernel_length);
-+ goto out;
-+ }
-+
-+ STR_NULL_TERMINATE(buf->total_length);
-+ if (kstrtouint(buf->total_length, 10, &totallen)) {
-+ pr_err("invalid total length: %*ph\n",
-+ (int)sizeof(buf->total_length),
-+ buf->total_length);
-+ goto out;
-+ }
-+
-+ /*
-+ * Addresses are flash absolute, so convert to partition
-+ * relative addresses. Assume either kernel or rootfs will
-+ * directly follow the image tag.
-+ */
-+ if (rootfsaddr < kerneladdr)
-+ offset = rootfsaddr - sizeof(struct bcm_tag);
-+ else
-+ offset = kerneladdr - sizeof(struct bcm_tag);
-+
-+ kerneladdr = kerneladdr - offset;
-+ rootfsaddr = rootfsaddr - offset;
-+ spareaddr = roundup(totallen, master->erasesize);
-+
-+ if (rootfsaddr < kerneladdr) {
-+ /* default Broadcom layout */
-+ rootfslen = kerneladdr - rootfsaddr;
-+ rootfs_first = true;
-+ } else {
-+ /* OpenWrt layout */
-+ rootfsaddr = kerneladdr + kernellen;
-+ rootfslen = spareaddr - rootfsaddr;
-+ }
-+ } else {
-+ goto out;
-+ }
-+ sparelen = master->size - spareaddr;
-+
-+ /* Determine number of partitions */
-+ if (rootfslen > 0)
-+ nrparts++;
-+
-+ if (kernellen > 0)
-+ nrparts++;
-+
-+ parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
-+ if (!parts) {
-+ ret = -ENOMEM;
-+ goto out;
-+ }
-+
-+ /* Start building partition list */
-+ if (kernellen > 0) {
-+ int kernelpart = curpart;
-+
-+ if (rootfslen > 0 && rootfs_first)
-+ kernelpart++;
-+ parts[kernelpart].name = "kernel";
-+ parts[kernelpart].offset = kerneladdr;
-+ parts[kernelpart].size = kernellen;
-+ curpart++;
-+ }
-+
-+ if (rootfslen > 0) {
-+ int rootfspart = curpart;
-+
-+ if (kernellen > 0 && rootfs_first)
-+ rootfspart--;
-+ parts[rootfspart].name = "rootfs";
-+ parts[rootfspart].offset = rootfsaddr;
-+ parts[rootfspart].size = rootfslen;
-+ if (sparelen > 0 && !rootfs_first)
-+ parts[rootfspart].size += sparelen;
-+ curpart++;
-+ }
-+
-+ for (i = 0; i < nrparts; i++)
-+ pr_info("Partition %d is %s offset %llx and length %llx\n", i,
-+ parts[i].name, parts[i].offset, parts[i].size);
-+
-+ pr_info("Spare partition is offset %x and length %x\n", spareaddr,
-+ sparelen);
-+
-+ *pparts = parts;
-+ ret = 0;
-+
-+out:
-+ vfree(buf);
-+
-+ if (ret)
-+ return ret;
-+
-+ return nrparts;
-+}
-+
-+static struct mtd_part_parser bcm963xx_imagetag_parser = {
-+ .parse_fn = bcm963xx_parse_imagetag_partitions,
-+ .name = "bcm963xx-imagetag",
-+};
-+module_mtd_part_parser(bcm963xx_imagetag_parser);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Daniel Dickinson <openwrt@cshore.neomailbox.net>");
-+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
-+MODULE_AUTHOR("Mike Albon <malbon@openwrt.org>");
-+MODULE_AUTHOR("Jonas Gorski <jonas.gorski@gmail.com");
-+MODULE_DESCRIPTION("MTD parser for BCM963XX CFE Image Tag partitions");
+++ /dev/null
-From 89cd5efa4a0d342b860a726bb1d382e4db4b96a4 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 28 Jun 2017 18:34:42 +0200
-Subject: [PATCH 1/2] mtd: bcm63xxpart: add of_match_table
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/mtd/bcm63xxpart.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/drivers/mtd/bcm63xxpart.c
-+++ b/drivers/mtd/bcm63xxpart.c
-@@ -34,6 +34,7 @@
- #include <linux/vmalloc.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
-+#include <linux/of.h>
-
- #define BCM963XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */
-
-@@ -172,9 +173,16 @@ out:
- return ret;
- };
-
-+static const struct of_device_id parse_bcm63xx_cfe_match_table[] = {
-+ { .compatible = "brcm,bcm963xx-cfe-nor-partitions" },
-+ {},
-+};
-+MODULE_DEVICE_TABLE(of, parse_bcm63xx_cfe_match_table);
-+
- static struct mtd_part_parser bcm63xx_cfe_parser = {
- .parse_fn = bcm63xx_parse_cfe_partitions,
- .name = "bcm63xxpart",
-+ .of_match_table = parse_bcm63xx_cfe_match_table,
- };
- module_mtd_part_parser(bcm63xx_cfe_parser);
-
+++ /dev/null
-From 3303dd9f5b197cc2efd9cbd7b9b45fc1e510a393 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 28 Jun 2017 18:37:12 +0200
-Subject: [PATCH 2/2] mtd: parser_bcm63xx_imagetag: add of_match_table support
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/mtd/parsers/parser_imagetag.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/drivers/mtd/parsers/parser_imagetag.c
-+++ b/drivers/mtd/parsers/parser_imagetag.c
-@@ -24,6 +24,7 @@
- #include <linux/vmalloc.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
-+#include <linux/of.h>
-
- /* Ensure strings read from flash structs are null terminated */
- #define STR_NULL_TERMINATE(x) \
-@@ -200,9 +201,16 @@ out:
- return nrparts;
- }
-
-+static const struct of_device_id parse_bcm963xx_imagetag_match_table[] = {
-+ { .compatible = "brcm,bcm963xx-imagetag" },
-+ {},
-+};
-+MODULE_DEVICE_TABLE(of, parse_bcm963xx_imagetag_match_table);
-+
- static struct mtd_part_parser bcm963xx_imagetag_parser = {
- .parse_fn = bcm963xx_parse_imagetag_partitions,
- .name = "bcm963xx-imagetag",
-+ .of_match_table = parse_bcm963xx_imagetag_match_table,
- };
- module_mtd_part_parser(bcm963xx_imagetag_parser);
-
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
-@@ -341,6 +341,7 @@ config PINCTRL_OCELOT
+@@ -387,6 +387,7 @@ config PINCTRL_OCELOT
source "drivers/pinctrl/actions/Kconfig"
source "drivers/pinctrl/aspeed/Kconfig"
source "drivers/pinctrl/bcm/Kconfig"
source "drivers/pinctrl/intel/Kconfig"
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
-@@ -46,6 +46,7 @@ obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-
+@@ -50,6 +50,7 @@ obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-
obj-y += actions/
obj-$(CONFIG_ARCH_ASPEED) += aspeed/
obj-y += bcm/
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
-@@ -363,12 +363,15 @@ static struct gpio_desc *of_parse_own_gp
+@@ -621,12 +621,15 @@ static struct gpio_desc *of_parse_own_gp
/**
* of_gpiochip_scan_gpios - Scan gpio-controller for gpio definitions
* @chip: gpio chip to act on
{
struct gpio_desc *desc = NULL;
struct device_node *np;
-@@ -376,7 +379,7 @@ static int of_gpiochip_scan_gpios(struct
- enum gpio_lookup_flags lflags;
+@@ -634,7 +637,7 @@ static int of_gpiochip_scan_gpios(struct
+ unsigned long lflags;
enum gpiod_flags dflags;
unsigned int i;
- int ret;
for_each_available_child_of_node(chip->of_node, np) {
if (!of_property_read_bool(np, "gpio-hog"))
-@@ -388,6 +391,10 @@ static int of_gpiochip_scan_gpios(struct
+@@ -646,6 +649,10 @@ static int of_gpiochip_scan_gpios(struct
if (IS_ERR(desc))
break;
ret = gpiod_hog(desc, name, lflags, dflags);
if (ret < 0) {
of_node_put(np);
-@@ -646,12 +653,13 @@ int of_gpiochip_add(struct gpio_chip *ch
+@@ -904,9 +911,11 @@ int of_gpiochip_add(struct gpio_chip *ch
of_node_get(chip->of_node);
-- status = of_gpiochip_scan_gpios(chip);
-- if (status) {
+- ret = of_gpiochip_scan_gpios(chip);
+- if (ret)
- of_node_put(chip->of_node);
-- gpiochip_remove_pin_ranges(chip);
+ if (!chip->request) {
-+ status = of_gpiochip_scan_gpios(chip, 0, chip->ngpio);
-+ if (status) {
++ ret = of_gpiochip_scan_gpios(chip, 0, chip->ngpio);
++ if (ret)
+ of_node_put(chip->of_node);
-+ gpiochip_remove_pin_ranges(chip);
-+ }
- }
--
- return status;
- }
++ }
+ return ret;
+ }
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
-@@ -2205,7 +2205,8 @@ int gpiochip_add_pingroup_range(struct g
+@@ -2580,7 +2580,8 @@ int gpiochip_add_pingroup_range(struct g
list_add_tail(&pin_range->node, &gdev->pin_ranges);
}
EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range);
-@@ -2262,7 +2263,7 @@ int gpiochip_add_pin_range(struct gpio_c
+@@ -2637,7 +2638,7 @@ int gpiochip_add_pin_range(struct gpio_c
list_add_tail(&pin_range->node, &gdev->pin_ranges);
}
EXPORT_SYMBOL_GPL(gpiochip_add_pin_range);
---- a/drivers/gpio/gpiolib.h
-+++ b/drivers/gpio/gpiolib.h
-@@ -103,6 +103,8 @@ struct gpio_desc *of_get_named_gpiod_fla
- const char *list_name, int index, enum of_gpio_flags *flags);
+--- a/drivers/gpio/gpiolib-of.h
++++ b/drivers/gpio/gpiolib-of.h
+@@ -13,6 +13,8 @@ struct gpio_desc *of_find_gpio(struct de
+ unsigned long *lookupflags);
int of_gpiochip_add(struct gpio_chip *gc);
void of_gpiochip_remove(struct gpio_chip *gc);
+int of_gpiochip_scan_gpios(struct gpio_chip *chip, unsigned int start,
+ unsigned int num);
+ int of_gpio_get_count(struct device *dev, const char *con_id);
+ bool of_gpio_need_valid_mask(const struct gpio_chip *gc);
#else
- static inline struct gpio_desc *of_find_gpio(struct device *dev,
- const char *con_id,
-@@ -118,6 +120,12 @@ static inline struct gpio_desc *of_get_n
+@@ -25,6 +27,12 @@ static inline struct gpio_desc *of_find_
}
static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
+{
+ return 0;
+}
- #endif /* CONFIG_OF_GPIO */
-
- #ifdef CONFIG_ACPI
+ static inline int of_gpio_get_count(struct device *dev, const char *con_id)
+ {
+ return 0;
--- a/arch/mips/bcm63xx/boards/Makefile
+++ b/arch/mips/bcm63xx/boards/Makefile
-@@ -1 +1,2 @@
+@@ -1,2 +1,3 @@
+ # SPDX-License-Identifier: GPL-2.0-only
+obj-y += board_common.o
obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
---- a/drivers/mtd/bcm63xxpart.c
-+++ b/drivers/mtd/bcm63xxpart.c
-@@ -35,6 +35,8 @@
+--- a/drivers/mtd/parsers/bcm63xxpart.c
++++ b/drivers/mtd/parsers/bcm63xxpart.c
+@@ -21,6 +21,8 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/of.h>
#define BCM963XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */
-@@ -46,30 +48,6 @@
+@@ -32,30 +34,6 @@
#define STR_NULL_TERMINATE(x) \
do { char *_str = (x); _str[sizeof(x) - 1] = 0; } while (0)
static int bcm63xx_read_nvram(struct mtd_info *master,
struct bcm963xx_nvram *nvram)
{
-@@ -152,7 +130,7 @@ static int bcm63xx_parse_cfe_partitions(
+@@ -138,7 +116,7 @@ static int bcm63xx_parse_cfe_partitions(
struct bcm963xx_nvram *nvram = NULL;
int ret;
+};
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
-@@ -129,6 +129,10 @@ config BRCMSTB_L2_IRQ
+@@ -145,6 +145,10 @@ config DAVINCI_CP_INTC
select GENERIC_IRQ_CHIP
select IRQ_DOMAIN
select GENERIC_IRQ_CHIP
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
-@@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_MMP) += irq-mmp.o
+@@ -17,6 +17,7 @@ obj-$(CONFIG_ARCH_MMP) += irq-mmp.o
obj-$(CONFIG_IRQ_MXS) += irq-mxs.o
obj-$(CONFIG_ARCH_TEGRA) += irq-tegra.o
obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
+};
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
-@@ -129,6 +129,10 @@ config BRCMSTB_L2_IRQ
+@@ -145,6 +145,10 @@ config DAVINCI_CP_INTC
select GENERIC_IRQ_CHIP
select IRQ_DOMAIN
select IRQ_DOMAIN
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
-@@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_MMP) += irq-mmp.o
+@@ -17,6 +17,7 @@ obj-$(CONFIG_ARCH_MMP) += irq-mmp.o
obj-$(CONFIG_IRQ_MXS) += irq-mxs.o
obj-$(CONFIG_ARCH_TEGRA) += irq-tegra.o
obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
-@@ -283,6 +283,9 @@ config BCM63XX
+@@ -290,6 +290,9 @@ config BCM63XX
select SYNC_R4K
select DMA_NONCOHERENT
select IRQ_MIPS_CPU
--- a/arch/mips/bcm63xx/Kconfig
+++ b/arch/mips/bcm63xx/Kconfig
@@ -61,6 +61,11 @@ config BCM63XX_CPU_6368
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+
+config BCM63XX_CPU_63268
+ bool "support 63268 CPU"
+ select SYS_HAS_CPU_BMIPS4350
-+ select HW_HAS_PCI
++ select HAVE_PCI
endmenu
source "arch/mips/bcm63xx/boards/Kconfig"
break;
--- a/arch/mips/bcm63xx/dev-flash.c
+++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -94,6 +94,12 @@ static int __init bcm63xx_detect_flash_t
- case STRAPBUS_6368_BOOT_SEL_PARALLEL:
- return BCM63XX_FLASH_TYPE_PARALLEL;
- }
+@@ -84,6 +84,12 @@ static int __init bcm63xx_detect_flash_t
+ return BCM63XX_FLASH_TYPE_SERIAL;
+ else
+ return BCM63XX_FLASH_TYPE_NAND;
+ case BCM63268_CPU_ID:
+ val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
+ if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
+ return BCM63XX_FLASH_TYPE_SERIAL;
+ else
+ return BCM63XX_FLASH_TYPE_NAND;
- default:
- return -EINVAL;
- }
+ case BCM6368_CPU_ID:
+ val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
+ switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
--- a/arch/mips/bcm63xx/dev-spi.c
+++ b/arch/mips/bcm63xx/dev-spi.c
@@ -51,7 +51,7 @@ int __init bcm63xx_spi_register(void)
+config BCM63XX_CPU_6318
+ bool "support 6318 CPU"
+ select SYS_HAS_CPU_BMIPS32_3300
-+ select HW_HAS_PCI
++ select HAVE_PCI
+
config BCM63XX_CPU_6328
bool "support 6328 CPU"
* _REG relative to RSET_OTP
--- a/arch/mips/pci/ops-bcm63xx.c
+++ b/arch/mips/pci/ops-bcm63xx.c
-@@ -488,8 +488,12 @@ static int bcm63xx_pcie_read(struct pci_
+@@ -489,8 +489,12 @@ static int bcm63xx_pcie_read(struct pci_
if (!bcm63xx_pcie_can_access(bus, devfn))
return PCIBIOS_DEVICE_NOT_FOUND;
data = bcm_pcie_readl(reg);
-@@ -508,8 +512,12 @@ static int bcm63xx_pcie_write(struct pci
+@@ -509,8 +513,12 @@ static int bcm63xx_pcie_write(struct pci
if (!bcm63xx_pcie_can_access(bus, devfn))
return PCIBIOS_DEVICE_NOT_FOUND;
static struct mtd_partition mtd_partitions[] = {
{
.name = "cfe",
-@@ -108,13 +110,15 @@ static int __init bcm63xx_detect_flash_t
+@@ -109,13 +111,15 @@ static int __init bcm63xx_detect_flash_t
}
}
#include <bcm63xx_cpu.h>
#include <bcm63xx_dev_flash.h>
-@@ -110,9 +111,59 @@ static int __init bcm63xx_detect_flash_t
+@@ -111,9 +112,59 @@ static int __init bcm63xx_detect_flash_t
}
}
@@ -23,6 +23,8 @@ config BCM63XX_CPU_6318
bool "support 6318 CPU"
select SYS_HAS_CPU_BMIPS32_3300
- select HW_HAS_PCI
+ select HAVE_PCI
+ select BCM63XX_OHCI
+ select BCM63XX_EHCI
@@ -73,6 +73,8 @@ config BCM63XX_CPU_63268
bool "support 63268 CPU"
select SYS_HAS_CPU_BMIPS4350
- select HW_HAS_PCI
+ select HAVE_PCI
+ select BCM63XX_OHCI
+ select BCM63XX_EHCI
endmenu
- default BOARD_BCM963XX
config BOARD_BCM963XX
- bool "Generic Broadcom 963xx boards"
+ bool "Generic Broadcom 963xx boards"
select SSB
+ default y
static int __init bcm63xx_detect_flash_type(void)
{
u32 val;
-@@ -172,12 +178,15 @@ int __init bcm63xx_flash_register(void)
+@@ -173,12 +179,15 @@ int __init bcm63xx_flash_register(void)
switch (flash_type) {
case BCM63XX_FLASH_TYPE_PARALLEL:
+++ b/arch/mips/bcm63xx/boards/Kconfig
@@ -5,6 +5,7 @@ menu "Board support"
config BOARD_BCM963XX
- bool "Generic Broadcom 963xx boards"
+ bool "Generic Broadcom 963xx boards"
select SSB
+ select BCMA
default y
+ select USE_OF
+
config BOARD_BCM963XX
- bool "Generic Broadcom 963xx boards"
+ bool "Generic Broadcom 963xx boards"
select SSB
--- a/arch/mips/bcm63xx/boards/board_common.c
+++ b/arch/mips/bcm63xx/boards/board_common.c
@@ -8,6 +8,7 @@
#include <linux/init.h>
- #include <linux/bootmem.h>
+ #include <linux/memblock.h>
+#include <linux/of_fdt.h>
#include <linux/smp.h>
#include <asm/bootinfo.h>
static int flash_type;
static struct mtd_partition mtd_partitions[] = {
-@@ -178,6 +180,9 @@ int __init bcm63xx_flash_register(void)
+@@ -179,6 +181,9 @@ int __init bcm63xx_flash_register(void)
switch (flash_type) {
case BCM63XX_FLASH_TYPE_PARALLEL:
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
-@@ -151,6 +151,13 @@ config GPIO_BCM_KONA
+@@ -147,6 +147,13 @@ config GPIO_BCM_KONA
help
Turn on GPIO support for Broadcom "Kona" chips.
default y if (ARCH_BRCMSTB || BMIPS_GENERIC)
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
-@@ -34,6 +34,7 @@ obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o
- obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o
- obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o
- obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o
-+obj-$(CONFIG_GPIO_BCM63XX) += gpio-bcm63xx.o
- obj-$(CONFIG_GPIO_BD9571MWV) += gpio-bd9571mwv.o
- obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o
- obj-$(CONFIG_GPIO_BT8XX) += gpio-bt8xx.o
+@@ -34,6 +34,7 @@ obj-$(CONFIG_GPIO_ARIZONA) += gpio-ariz
+ obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o
+ obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o
+ obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o
++obj-$(CONFIG_GPIO_BCM63XX) += gpio-bcm63xx.o
+ obj-$(CONFIG_GPIO_BD70528) += gpio-bd70528.o
+ obj-$(CONFIG_GPIO_BD9571MWV) += gpio-bd9571mwv.o
+ obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o
--- /dev/null
+++ b/drivers/gpio/gpio-bcm63xx.c
@@ -0,0 +1,135 @@
--- a/arch/mips/bcm63xx/Kconfig
+++ b/arch/mips/bcm63xx/Kconfig
@@ -25,6 +25,8 @@ config BCM63XX_CPU_6318
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+ select PINCTRL
config BCM63XX_CPU_6328
bool "support 6328 CPU"
@@ -32,6 +34,8 @@ config BCM63XX_CPU_6328
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+ select PINCTRL
bool "support 6338 CPU"
@@ -47,6 +51,8 @@ config BCM63XX_CPU_6348
select SYS_HAS_CPU_BMIPS32_3300
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
+ select PINCTRL
+ select PINCTRL_BCM6348
config BCM63XX_CPU_6358
bool "support 6358 CPU"
@@ -54,6 +60,8 @@ config BCM63XX_CPU_6358
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+ select PINCTRL
config BCM63XX_CPU_6362
bool "support 6362 CPU"
@@ -61,6 +69,8 @@ config BCM63XX_CPU_6362
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+ select PINCTRL
config BCM63XX_CPU_6368
bool "support 6368 CPU"
@@ -68,6 +78,8 @@ config BCM63XX_CPU_6368
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+ select PINCTRL
config BCM63XX_CPU_63268
bool "support 63268 CPU"
@@ -75,6 +87,8 @@ config BCM63XX_CPU_63268
- select HW_HAS_PCI
+ select HAVE_PCI
select BCM63XX_OHCI
select BCM63XX_EHCI
+ select PINCTRL
static struct physmap_flash_data flash_data = {
.width = 2,
---- a/drivers/mtd/redboot.c
-+++ b/drivers/mtd/redboot.c
-@@ -72,6 +72,7 @@ static int parse_redboot_partitions(stru
+--- a/drivers/mtd/parsers/redboot.c
++++ b/drivers/mtd/parsers/redboot.c
+@@ -79,6 +79,7 @@ static int parse_redboot_partitions(stru
int nulllen = 0;
int numslots;
unsigned long offset;
#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
static char nullstring[] = "unallocated";
#endif
-@@ -176,6 +177,16 @@ static int parse_redboot_partitions(stru
+@@ -185,6 +186,16 @@ static int parse_redboot_partitions(stru
goto out;
}
for (i = 0; i < numslots; i++) {
struct fis_list *new_fl, **prev;
-@@ -196,10 +207,10 @@ static int parse_redboot_partitions(stru
+@@ -205,10 +216,10 @@ static int parse_redboot_partitions(stru
goto out;
}
new_fl->img = &buf[i];
/* 240-255: Unused at present */
--- a/drivers/mtd/parsers/parser_imagetag.c
+++ b/drivers/mtd/parsers/parser_imagetag.c
-@@ -137,7 +137,8 @@ static int bcm963xx_parse_imagetag_parti
+@@ -132,7 +132,8 @@ static int bcm963xx_parse_imagetag_parti
} else {
/* OpenWrt layout */
rootfsaddr = kerneladdr + kernellen;
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1634,7 +1634,7 @@ static int bcm_enet_change_mtu(struct ne
+@@ -1612,7 +1612,7 @@ static int bcm_enet_change_mtu(struct ne
return -EBUSY;
/* add ethernet header + vlan tag size */
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -867,10 +867,8 @@ static int bcm_enet_open(struct net_devi
+@@ -854,10 +854,8 @@ static int bcm_enet_open(struct net_devi
struct bcm_enet_priv *priv;
struct sockaddr addr;
struct device *kdev;
void *p;
u32 val;
-@@ -878,40 +876,10 @@ static int bcm_enet_open(struct net_devi
+@@ -865,31 +863,10 @@ static int bcm_enet_open(struct net_devi
kdev = &priv->pdev->dev;
if (priv->has_phy) {
- }
-
- /* mask with MAC supported features */
-- phydev->supported &= (SUPPORTED_10baseT_Half |
-- SUPPORTED_10baseT_Full |
-- SUPPORTED_100baseT_Half |
-- SUPPORTED_100baseT_Full |
-- SUPPORTED_Autoneg |
-- SUPPORTED_Pause |
-- SUPPORTED_MII);
-- phydev->advertising = phydev->supported;
--
-- if (priv->pause_auto && priv->pause_rx && priv->pause_tx)
-- phydev->advertising |= SUPPORTED_Pause;
-- else
-- phydev->advertising &= ~SUPPORTED_Pause;
+- phy_support_sym_pause(phydev);
+- phy_set_max_speed(phydev, SPEED_100);
+- phy_set_sym_pause(phydev, priv->pause_rx, priv->pause_rx,
+- priv->pause_auto);
-
- phy_attached_info(phydev);
-
}
/* mask all interrupts and request them */
-@@ -921,7 +889,7 @@ static int bcm_enet_open(struct net_devi
+@@ -899,7 +876,7 @@ static int bcm_enet_open(struct net_devi
ret = request_irq(dev->irq, bcm_enet_isr_mac, 0, dev->name, dev);
if (ret)
ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, 0,
dev->name, dev);
-@@ -1083,8 +1051,8 @@ static int bcm_enet_open(struct net_devi
+@@ -1061,8 +1038,8 @@ static int bcm_enet_open(struct net_devi
enet_dmac_writel(priv, priv->dma_chan_int_mask,
ENETDMAC_IRMASK, priv->tx_chan);
else
bcm_enet_adjust_link(dev);
-@@ -1125,10 +1093,6 @@ out_freeirq_rx:
+@@ -1103,10 +1080,6 @@ out_freeirq_rx:
out_freeirq:
free_irq(dev->irq, dev);
return ret;
}
-@@ -1233,10 +1197,6 @@ static int bcm_enet_stop(struct net_devi
+@@ -1211,10 +1184,6 @@ static int bcm_enet_stop(struct net_devi
free_irq(priv->irq_rx, dev);
free_irq(dev->irq, dev);
return 0;
}
-@@ -1802,14 +1762,47 @@ static int bcm_enet_probe(struct platfor
+@@ -1779,14 +1748,47 @@ static int bcm_enet_probe(struct platfor
/* do minimal hardware init to be able to probe mii bus */
bcm_enet_hw_preinit(priv);
}
bus = priv->mii_bus;
-@@ -1833,6 +1826,35 @@ static int bcm_enet_probe(struct platfor
+@@ -1810,6 +1812,26 @@ static int bcm_enet_probe(struct platfor
dev_err(&pdev->dev, "unable to register mdio bus\n");
goto out_free_mdio;
}
+ }
+
+ /* mask with MAC supported features */
-+ phydev->supported &= (SUPPORTED_10baseT_Half |
-+ SUPPORTED_10baseT_Full |
-+ SUPPORTED_100baseT_Half |
-+ SUPPORTED_100baseT_Full |
-+ SUPPORTED_Autoneg |
-+ SUPPORTED_Pause |
-+ SUPPORTED_MII);
-+ phydev->advertising = phydev->supported;
-+
-+ if (priv->pause_auto && priv->pause_rx && priv->pause_tx)
-+ phydev->advertising |= SUPPORTED_Pause;
-+ else
-+ phydev->advertising &= ~SUPPORTED_Pause;
++ phy_support_sym_pause(phydev);
++ phy_set_max_speed(phydev, SPEED_100);
++ phy_set_sym_pause(phydev, priv->pause_rx, priv->pause_rx,
++ priv->pause_auto);
+
+ phy_attached_info(phydev);
} else {
/* run platform code to initialize PHY device */
-@@ -1840,45 +1862,16 @@ static int bcm_enet_probe(struct platfor
+@@ -1817,45 +1839,16 @@ static int bcm_enet_probe(struct platfor
pd->mii_config(dev, 1, bcm_enet_mdio_read_mii,
bcm_enet_mdio_write_mii)) {
dev_err(&pdev->dev, "unable to configure mdio bus\n");
if (priv->mii_bus)
mdiobus_unregister(priv->mii_bus);
-@@ -1886,6 +1879,9 @@ out_free_mdio:
+@@ -1863,6 +1856,9 @@ out_free_mdio:
if (priv->mii_bus)
mdiobus_free(priv->mii_bus);
out_uninit_hw:
/* turn off mdc clock */
enet_writel(priv, 0, ENET_MIISC_REG);
-@@ -1916,6 +1912,7 @@ static int bcm_enet_remove(struct platfo
+@@ -1893,6 +1889,7 @@ static int bcm_enet_remove(struct platfo
enet_writel(priv, 0, ENET_MIISC_REG);
if (priv->has_phy) {
#define ENETSW_MDIOC_EXT_MASK (1 << 16)
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -2185,6 +2185,18 @@ static int bcm_enetsw_open(struct net_de
+@@ -2162,6 +2162,18 @@ static int bcm_enetsw_open(struct net_de
priv->sw_port_link[i] = 0;
}
if (val & STRAPBUS_6328_BOOT_SEL_SERIAL)
return BCM63XX_FLASH_TYPE_SERIAL;
else
-@@ -94,12 +138,20 @@ static int __init bcm63xx_detect_flash_t
+@@ -94,18 +138,31 @@ static int __init bcm63xx_detect_flash_t
return BCM63XX_FLASH_TYPE_SERIAL;
case BCM6362_CPU_ID:
val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
return BCM63XX_FLASH_TYPE_SERIAL;
else
return BCM63XX_FLASH_TYPE_NAND;
- case BCM6368_CPU_ID:
- val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
-+ if (val & STRAPBUS_6368_SPI_CLK_FAST)
-+ bcm63xx_spi_flash_info[0].max_speed_hz = 20000000;
-+
- switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
- case STRAPBUS_6368_BOOT_SEL_NAND:
- return BCM63XX_FLASH_TYPE_NAND;
-@@ -110,6 +162,11 @@ static int __init bcm63xx_detect_flash_t
- }
case BCM63268_CPU_ID:
val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
+ if (val & STRAPBUS_63268_HSSPI_CLK_FAST)
if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
return BCM63XX_FLASH_TYPE_SERIAL;
else
-@@ -176,6 +233,7 @@ void __init bcm63xx_flash_detect(void)
+ return BCM63XX_FLASH_TYPE_NAND;
+ case BCM6368_CPU_ID:
+ val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
++ if (val & STRAPBUS_6368_SPI_CLK_FAST)
++ bcm63xx_spi_flash_info[0].max_speed_hz = 20000000;
++
+ switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
+ case STRAPBUS_6368_BOOT_SEL_NAND:
+ return BCM63XX_FLASH_TYPE_NAND;
+@@ -177,6 +234,7 @@ void __init bcm63xx_flash_detect(void)
int __init bcm63xx_flash_register(void)
{
u32 val;
switch (flash_type) {
-@@ -195,8 +253,14 @@ int __init bcm63xx_flash_register(void)
+@@ -196,8 +254,14 @@ int __init bcm63xx_flash_register(void)
return platform_device_register(&mtd_dev);
case BCM63XX_FLASH_TYPE_SERIAL:
--- a/arch/mips/bcm63xx/dev-flash.c
+++ b/arch/mips/bcm63xx/dev-flash.c
-@@ -270,3 +270,8 @@ int __init bcm63xx_flash_register(void)
+@@ -271,3 +271,8 @@ int __init bcm63xx_flash_register(void)
return -ENODEV;
}
}
spinlock_t enetsw_mdio_lock;
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -30,6 +30,7 @@
+@@ -17,6 +17,7 @@
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/if_vlan.h>
#include <bcm63xx_dev_enet.h>
#include "bcm63xx_enet.h"
-@@ -1932,7 +1933,8 @@ static int bcm_enet_remove(struct platfo
+@@ -1909,7 +1910,8 @@ static int bcm_enet_remove(struct platfo
return 0;
}
.probe = bcm_enet_probe,
.remove = bcm_enet_remove,
.driver = {
-@@ -1941,6 +1943,42 @@ struct platform_driver bcm63xx_enet_driv
+@@ -1918,6 +1920,42 @@ struct platform_driver bcm63xx_enet_driv
},
};
/*
* switch mii access callbacks
*/
-@@ -2197,29 +2235,6 @@ static int bcm_enetsw_open(struct net_de
+@@ -2174,29 +2212,6 @@ static int bcm_enetsw_open(struct net_de
enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i));
}
/* initialize flow control buffer allocation */
enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0,
ENETDMA_BUFALLOC_REG(priv->rx_chan));
-@@ -2675,6 +2690,9 @@ static int bcm_enetsw_probe(struct platf
+@@ -2652,6 +2667,9 @@ static int bcm_enetsw_probe(struct platf
struct bcm63xx_enetsw_platform_data *pd;
struct resource *res_mem;
int ret, irq_rx, irq_tx;
if (!bcm_enet_shared_base[0])
return -EPROBE_DEFER;
-@@ -2755,6 +2773,43 @@ static int bcm_enetsw_probe(struct platf
+@@ -2731,6 +2749,43 @@ static int bcm_enetsw_probe(struct platf
priv->pdev = pdev;
priv->net_dev = dev;
return 0;
out_disable_clk:
-@@ -2776,6 +2831,9 @@ static int bcm_enetsw_remove(struct plat
+@@ -2752,6 +2807,9 @@ static int bcm_enetsw_remove(struct plat
priv = netdev_priv(dev);
unregister_netdev(dev);
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -2734,9 +2734,9 @@ static int bcm_enetsw_probe(struct platf
+@@ -2710,9 +2710,9 @@ static int bcm_enetsw_probe(struct platf
if (ret)
goto out;
#include <bcm63xx_cpu.h>
#include <bcm63xx_dev_flash.h>
#include <bcm63xx_regs.h>
-@@ -247,6 +248,13 @@ int __init bcm63xx_flash_register(void)
+@@ -248,6 +249,13 @@ int __init bcm63xx_flash_register(void)
val = bcm_mpi_readl(MPI_CSBASE_REG(0));
val &= MPI_CSBASE_BASE_MASK;
endmenu
--- a/arch/mips/bcm63xx/boards/Makefile
+++ b/arch/mips/bcm63xx/boards/Makefile
-@@ -1,2 +1,3 @@
+@@ -1,3 +1,4 @@
+ # SPDX-License-Identifier: GPL-2.0-only
obj-y += board_common.o
obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
+obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o
u32 crc, expected_crc;
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
-@@ -64,6 +64,7 @@ void (*_dma_cache_wback)(unsigned long s
+@@ -62,6 +62,9 @@ void (*_dma_cache_wback_inv)(unsigned lo
+ void (*_dma_cache_wback)(unsigned long start, unsigned long size);
void (*_dma_cache_inv)(unsigned long start, unsigned long size);
- EXPORT_SYMBOL(_dma_cache_wback_inv);
++EXPORT_SYMBOL(_dma_cache_wback_inv);
+EXPORT_SYMBOL(_dma_cache_inv);
-
++
#endif /* CONFIG_DMA_NONCOHERENT */
+ /*
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -2232,6 +2232,10 @@ static int bcm_enetsw_open(struct net_de
+@@ -2209,6 +2209,10 @@ static int bcm_enetsw_open(struct net_de
rgmii_ctrl = enetsw_readb(priv, ENETSW_RGMII_CTRL_REG(i));
rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN;