mirror of https://github.com/hak5/openwrt.git
bcm63xx: refresh patches for kernel 5.4
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>master
parent
f8f1dc6eab
commit
04c07e05a1
|
@ -18,7 +18,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
|
||||||
+++ b/arch/mips/bcm63xx/Kconfig
|
+++ b/arch/mips/bcm63xx/Kconfig
|
||||||
@@ -7,10 +7,17 @@ config BCM63XX_CPU_3368
|
@@ -7,10 +7,17 @@ config BCM63XX_CPU_3368
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
|
|
||||||
+config BCM63XX_OHCI
|
+config BCM63XX_OHCI
|
||||||
+ bool
|
+ bool
|
||||||
|
@ -29,7 +29,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
|
||||||
config BCM63XX_CPU_6328
|
config BCM63XX_CPU_6328
|
||||||
bool "support 6328 CPU"
|
bool "support 6328 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
+ select BCM63XX_OHCI
|
+ select BCM63XX_OHCI
|
||||||
|
|
||||||
config BCM63XX_CPU_6338
|
config BCM63XX_CPU_6338
|
||||||
|
@ -37,25 +37,25 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
|
||||||
@@ -25,21 +32,25 @@ config BCM63XX_CPU_6348
|
@@ -25,21 +32,25 @@ config BCM63XX_CPU_6348
|
||||||
bool "support 6348 CPU"
|
bool "support 6348 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS32_3300
|
select SYS_HAS_CPU_BMIPS32_3300
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
+ select BCM63XX_OHCI
|
+ select BCM63XX_OHCI
|
||||||
|
|
||||||
config BCM63XX_CPU_6358
|
config BCM63XX_CPU_6358
|
||||||
bool "support 6358 CPU"
|
bool "support 6358 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
+ select BCM63XX_OHCI
|
+ select BCM63XX_OHCI
|
||||||
|
|
||||||
config BCM63XX_CPU_6362
|
config BCM63XX_CPU_6362
|
||||||
bool "support 6362 CPU"
|
bool "support 6362 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
+ select BCM63XX_OHCI
|
+ select BCM63XX_OHCI
|
||||||
|
|
||||||
config BCM63XX_CPU_6368
|
config BCM63XX_CPU_6368
|
||||||
bool "support 6368 CPU"
|
bool "support 6368 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
+ select BCM63XX_OHCI
|
+ select BCM63XX_OHCI
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
|
||||||
config BCM63XX_CPU_6328
|
config BCM63XX_CPU_6328
|
||||||
bool "support 6328 CPU"
|
bool "support 6328 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
+ select BCM63XX_EHCI
|
+ select BCM63XX_EHCI
|
||||||
|
|
||||||
|
@ -40,21 +40,21 @@ Signed-off-by: Florian Fainelli <florian@openwrt.org>
|
||||||
bool "support 6338 CPU"
|
bool "support 6338 CPU"
|
||||||
@@ -39,18 +46,21 @@ config BCM63XX_CPU_6358
|
@@ -39,18 +46,21 @@ config BCM63XX_CPU_6358
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
+ select BCM63XX_EHCI
|
+ select BCM63XX_EHCI
|
||||||
|
|
||||||
config BCM63XX_CPU_6362
|
config BCM63XX_CPU_6362
|
||||||
bool "support 6362 CPU"
|
bool "support 6362 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
+ select BCM63XX_EHCI
|
+ select BCM63XX_EHCI
|
||||||
|
|
||||||
config BCM63XX_CPU_6368
|
config BCM63XX_CPU_6368
|
||||||
bool "support 6368 CPU"
|
bool "support 6368 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
+ select BCM63XX_EHCI
|
+ select BCM63XX_EHCI
|
||||||
endmenu
|
endmenu
|
||||||
|
|
|
@ -1,482 +0,0 @@
|
||||||
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");
|
|
|
@ -1,37 +0,0 @@
|
||||||
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);
|
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
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);
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
|
|
||||||
--- a/drivers/pinctrl/Kconfig
|
--- a/drivers/pinctrl/Kconfig
|
||||||
+++ b/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/actions/Kconfig"
|
||||||
source "drivers/pinctrl/aspeed/Kconfig"
|
source "drivers/pinctrl/aspeed/Kconfig"
|
||||||
source "drivers/pinctrl/bcm/Kconfig"
|
source "drivers/pinctrl/bcm/Kconfig"
|
||||||
|
@ -31,7 +31,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
source "drivers/pinctrl/intel/Kconfig"
|
source "drivers/pinctrl/intel/Kconfig"
|
||||||
--- a/drivers/pinctrl/Makefile
|
--- a/drivers/pinctrl/Makefile
|
||||||
+++ b/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-y += actions/
|
||||||
obj-$(CONFIG_ARCH_ASPEED) += aspeed/
|
obj-$(CONFIG_ARCH_ASPEED) += aspeed/
|
||||||
obj-y += bcm/
|
obj-y += bcm/
|
||||||
|
|
|
@ -29,7 +29,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
|
|
||||||
--- a/drivers/gpio/gpiolib-of.c
|
--- a/drivers/gpio/gpiolib-of.c
|
||||||
+++ b/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
|
* of_gpiochip_scan_gpios - Scan gpio-controller for gpio definitions
|
||||||
* @chip: gpio chip to act on
|
* @chip: gpio chip to act on
|
||||||
|
@ -48,8 +48,8 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
{
|
{
|
||||||
struct gpio_desc *desc = NULL;
|
struct gpio_desc *desc = NULL;
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
@@ -376,7 +379,7 @@ static int of_gpiochip_scan_gpios(struct
|
@@ -634,7 +637,7 @@ static int of_gpiochip_scan_gpios(struct
|
||||||
enum gpio_lookup_flags lflags;
|
unsigned long lflags;
|
||||||
enum gpiod_flags dflags;
|
enum gpiod_flags dflags;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
- int ret;
|
- int ret;
|
||||||
|
@ -57,7 +57,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
|
|
||||||
for_each_available_child_of_node(chip->of_node, np) {
|
for_each_available_child_of_node(chip->of_node, np) {
|
||||||
if (!of_property_read_bool(np, "gpio-hog"))
|
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))
|
if (IS_ERR(desc))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -68,28 +68,24 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
ret = gpiod_hog(desc, name, lflags, dflags);
|
ret = gpiod_hog(desc, name, lflags, dflags);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
of_node_put(np);
|
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);
|
of_node_get(chip->of_node);
|
||||||
|
|
||||||
- status = of_gpiochip_scan_gpios(chip);
|
- ret = of_gpiochip_scan_gpios(chip);
|
||||||
- if (status) {
|
- if (ret)
|
||||||
- of_node_put(chip->of_node);
|
- of_node_put(chip->of_node);
|
||||||
- gpiochip_remove_pin_ranges(chip);
|
|
||||||
+ if (!chip->request) {
|
+ if (!chip->request) {
|
||||||
+ status = of_gpiochip_scan_gpios(chip, 0, chip->ngpio);
|
+ ret = of_gpiochip_scan_gpios(chip, 0, chip->ngpio);
|
||||||
+ if (status) {
|
+ if (ret)
|
||||||
+ of_node_put(chip->of_node);
|
+ of_node_put(chip->of_node);
|
||||||
+ gpiochip_remove_pin_ranges(chip);
|
|
||||||
+ }
|
+ }
|
||||||
}
|
|
||||||
-
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
--- a/drivers/gpio/gpiolib.c
|
--- a/drivers/gpio/gpiolib.c
|
||||||
+++ b/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);
|
list_add_tail(&pin_range->node, &gdev->pin_ranges);
|
||||||
|
|
||||||
|
@ -99,7 +95,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range);
|
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);
|
list_add_tail(&pin_range->node, &gdev->pin_ranges);
|
||||||
|
|
||||||
|
@ -108,18 +104,18 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(gpiochip_add_pin_range);
|
EXPORT_SYMBOL_GPL(gpiochip_add_pin_range);
|
||||||
|
|
||||||
--- a/drivers/gpio/gpiolib.h
|
--- a/drivers/gpio/gpiolib-of.h
|
||||||
+++ b/drivers/gpio/gpiolib.h
|
+++ b/drivers/gpio/gpiolib-of.h
|
||||||
@@ -103,6 +103,8 @@ struct gpio_desc *of_get_named_gpiod_fla
|
@@ -13,6 +13,8 @@ struct gpio_desc *of_find_gpio(struct de
|
||||||
const char *list_name, int index, enum of_gpio_flags *flags);
|
unsigned long *lookupflags);
|
||||||
int of_gpiochip_add(struct gpio_chip *gc);
|
int of_gpiochip_add(struct gpio_chip *gc);
|
||||||
void of_gpiochip_remove(struct gpio_chip *gc);
|
void of_gpiochip_remove(struct gpio_chip *gc);
|
||||||
+int of_gpiochip_scan_gpios(struct gpio_chip *chip, unsigned int start,
|
+int of_gpiochip_scan_gpios(struct gpio_chip *chip, unsigned int start,
|
||||||
+ unsigned int num);
|
+ 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
|
#else
|
||||||
static inline struct gpio_desc *of_find_gpio(struct device *dev,
|
@@ -25,6 +27,12 @@ static inline struct gpio_desc *of_find_
|
||||||
const char *con_id,
|
|
||||||
@@ -118,6 +120,12 @@ static inline struct gpio_desc *of_get_n
|
|
||||||
}
|
}
|
||||||
static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
|
static inline int of_gpiochip_add(struct gpio_chip *gc) { return 0; }
|
||||||
static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
|
static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
|
||||||
|
@ -129,6 +125,6 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
+{
|
+{
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+}
|
+}
|
||||||
#endif /* CONFIG_OF_GPIO */
|
static inline int of_gpio_get_count(struct device *dev, const char *con_id)
|
||||||
|
{
|
||||||
#ifdef CONFIG_ACPI
|
return 0;
|
||||||
|
|
|
@ -19,7 +19,8 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
--- a/arch/mips/bcm63xx/boards/Makefile
|
--- a/arch/mips/bcm63xx/boards/Makefile
|
||||||
+++ b/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-y += board_common.o
|
||||||
obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
|
obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
|
||||||
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
|
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/drivers/mtd/bcm63xxpart.c
|
--- a/drivers/mtd/parsers/bcm63xxpart.c
|
||||||
+++ b/drivers/mtd/bcm63xxpart.c
|
+++ b/drivers/mtd/parsers/bcm63xxpart.c
|
||||||
@@ -35,6 +35,8 @@
|
@@ -21,6 +21,8 @@
|
||||||
#include <linux/mtd/mtd.h>
|
#include <linux/mtd/mtd.h>
|
||||||
#include <linux/mtd/partitions.h>
|
#include <linux/mtd/partitions.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#define BCM963XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */
|
#define BCM963XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */
|
||||||
|
|
||||||
@@ -46,30 +48,6 @@
|
@@ -32,30 +34,6 @@
|
||||||
#define STR_NULL_TERMINATE(x) \
|
#define STR_NULL_TERMINATE(x) \
|
||||||
do { char *_str = (x); _str[sizeof(x) - 1] = 0; } while (0)
|
do { char *_str = (x); _str[sizeof(x) - 1] = 0; } while (0)
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
static int bcm63xx_read_nvram(struct mtd_info *master,
|
static int bcm63xx_read_nvram(struct mtd_info *master,
|
||||||
struct bcm963xx_nvram *nvram)
|
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;
|
struct bcm963xx_nvram *nvram = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
+};
|
+};
|
||||||
--- a/drivers/irqchip/Kconfig
|
--- a/drivers/irqchip/Kconfig
|
||||||
+++ b/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 GENERIC_IRQ_CHIP
|
||||||
select IRQ_DOMAIN
|
select IRQ_DOMAIN
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
select GENERIC_IRQ_CHIP
|
select GENERIC_IRQ_CHIP
|
||||||
--- a/drivers/irqchip/Makefile
|
--- a/drivers/irqchip/Makefile
|
||||||
+++ b/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_IRQ_MXS) += irq-mxs.o
|
||||||
obj-$(CONFIG_ARCH_TEGRA) += irq-tegra.o
|
obj-$(CONFIG_ARCH_TEGRA) += irq-tegra.o
|
||||||
obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
|
obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
|
||||||
|
|
|
@ -50,7 +50,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
+};
|
+};
|
||||||
--- a/drivers/irqchip/Kconfig
|
--- a/drivers/irqchip/Kconfig
|
||||||
+++ b/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 GENERIC_IRQ_CHIP
|
||||||
select IRQ_DOMAIN
|
select IRQ_DOMAIN
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
select IRQ_DOMAIN
|
select IRQ_DOMAIN
|
||||||
--- a/drivers/irqchip/Makefile
|
--- a/drivers/irqchip/Makefile
|
||||||
+++ b/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_IRQ_MXS) += irq-mxs.o
|
||||||
obj-$(CONFIG_ARCH_TEGRA) += irq-tegra.o
|
obj-$(CONFIG_ARCH_TEGRA) += irq-tegra.o
|
||||||
obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
|
obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
--- a/arch/mips/Kconfig
|
--- a/arch/mips/Kconfig
|
||||||
+++ b/arch/mips/Kconfig
|
+++ b/arch/mips/Kconfig
|
||||||
@@ -283,6 +283,9 @@ config BCM63XX
|
@@ -290,6 +290,9 @@ config BCM63XX
|
||||||
select SYNC_R4K
|
select SYNC_R4K
|
||||||
select DMA_NONCOHERENT
|
select DMA_NONCOHERENT
|
||||||
select IRQ_MIPS_CPU
|
select IRQ_MIPS_CPU
|
||||||
|
|
|
@ -22,14 +22,14 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
--- a/arch/mips/bcm63xx/Kconfig
|
--- a/arch/mips/bcm63xx/Kconfig
|
||||||
+++ b/arch/mips/bcm63xx/Kconfig
|
+++ b/arch/mips/bcm63xx/Kconfig
|
||||||
@@ -61,6 +61,11 @@ config BCM63XX_CPU_6368
|
@@ -61,6 +61,11 @@ config BCM63XX_CPU_6368
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
select BCM63XX_EHCI
|
select BCM63XX_EHCI
|
||||||
+
|
+
|
||||||
+config BCM63XX_CPU_63268
|
+config BCM63XX_CPU_63268
|
||||||
+ bool "support 63268 CPU"
|
+ bool "support 63268 CPU"
|
||||||
+ select SYS_HAS_CPU_BMIPS4350
|
+ select SYS_HAS_CPU_BMIPS4350
|
||||||
+ select HW_HAS_PCI
|
+ select HAVE_PCI
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
source "arch/mips/bcm63xx/boards/Kconfig"
|
source "arch/mips/bcm63xx/boards/Kconfig"
|
||||||
|
@ -260,19 +260,19 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
break;
|
break;
|
||||||
--- a/arch/mips/bcm63xx/dev-flash.c
|
--- a/arch/mips/bcm63xx/dev-flash.c
|
||||||
+++ b/arch/mips/bcm63xx/dev-flash.c
|
+++ b/arch/mips/bcm63xx/dev-flash.c
|
||||||
@@ -94,6 +94,12 @@ static int __init bcm63xx_detect_flash_t
|
@@ -84,6 +84,12 @@ static int __init bcm63xx_detect_flash_t
|
||||||
case STRAPBUS_6368_BOOT_SEL_PARALLEL:
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
return BCM63XX_FLASH_TYPE_PARALLEL;
|
else
|
||||||
}
|
return BCM63XX_FLASH_TYPE_NAND;
|
||||||
+ case BCM63268_CPU_ID:
|
+ case BCM63268_CPU_ID:
|
||||||
+ val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
|
+ val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
|
||||||
+ if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
|
+ if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
|
||||||
+ return BCM63XX_FLASH_TYPE_SERIAL;
|
+ return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
+ else
|
+ else
|
||||||
+ return BCM63XX_FLASH_TYPE_NAND;
|
+ return BCM63XX_FLASH_TYPE_NAND;
|
||||||
default:
|
case BCM6368_CPU_ID:
|
||||||
return -EINVAL;
|
val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
|
||||||
}
|
switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
|
||||||
--- a/arch/mips/bcm63xx/dev-spi.c
|
--- a/arch/mips/bcm63xx/dev-spi.c
|
||||||
+++ b/arch/mips/bcm63xx/dev-spi.c
|
+++ b/arch/mips/bcm63xx/dev-spi.c
|
||||||
@@ -51,7 +51,7 @@ int __init bcm63xx_spi_register(void)
|
@@ -51,7 +51,7 @@ int __init bcm63xx_spi_register(void)
|
||||||
|
|
|
@ -28,7 +28,7 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318
|
||||||
+config BCM63XX_CPU_6318
|
+config BCM63XX_CPU_6318
|
||||||
+ bool "support 6318 CPU"
|
+ bool "support 6318 CPU"
|
||||||
+ select SYS_HAS_CPU_BMIPS32_3300
|
+ select SYS_HAS_CPU_BMIPS32_3300
|
||||||
+ select HW_HAS_PCI
|
+ select HAVE_PCI
|
||||||
+
|
+
|
||||||
config BCM63XX_CPU_6328
|
config BCM63XX_CPU_6328
|
||||||
bool "support 6328 CPU"
|
bool "support 6328 CPU"
|
||||||
|
|
|
@ -146,7 +146,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318
|
||||||
* _REG relative to RSET_OTP
|
* _REG relative to RSET_OTP
|
||||||
--- a/arch/mips/pci/ops-bcm63xx.c
|
--- a/arch/mips/pci/ops-bcm63xx.c
|
||||||
+++ b/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))
|
if (!bcm63xx_pcie_can_access(bus, devfn))
|
||||||
return PCIBIOS_DEVICE_NOT_FOUND;
|
return PCIBIOS_DEVICE_NOT_FOUND;
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318
|
||||||
|
|
||||||
data = bcm_pcie_readl(reg);
|
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))
|
if (!bcm63xx_pcie_can_access(bus, devfn))
|
||||||
return PCIBIOS_DEVICE_NOT_FOUND;
|
return PCIBIOS_DEVICE_NOT_FOUND;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
static struct mtd_partition mtd_partitions[] = {
|
static struct mtd_partition mtd_partitions[] = {
|
||||||
{
|
{
|
||||||
.name = "cfe",
|
.name = "cfe",
|
||||||
@@ -108,13 +110,15 @@ static int __init bcm63xx_detect_flash_t
|
@@ -109,13 +111,15 @@ static int __init bcm63xx_detect_flash_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
#include <bcm63xx_cpu.h>
|
#include <bcm63xx_cpu.h>
|
||||||
#include <bcm63xx_dev_flash.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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
@@ -23,6 +23,8 @@ config BCM63XX_CPU_6318
|
@@ -23,6 +23,8 @@ config BCM63XX_CPU_6318
|
||||||
bool "support 6318 CPU"
|
bool "support 6318 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS32_3300
|
select SYS_HAS_CPU_BMIPS32_3300
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
+ select BCM63XX_OHCI
|
+ select BCM63XX_OHCI
|
||||||
+ select BCM63XX_EHCI
|
+ select BCM63XX_EHCI
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
@@ -73,6 +73,8 @@ config BCM63XX_CPU_63268
|
@@ -73,6 +73,8 @@ config BCM63XX_CPU_63268
|
||||||
bool "support 63268 CPU"
|
bool "support 63268 CPU"
|
||||||
select SYS_HAS_CPU_BMIPS4350
|
select SYS_HAS_CPU_BMIPS4350
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
+ select BCM63XX_OHCI
|
+ select BCM63XX_OHCI
|
||||||
+ select BCM63XX_EHCI
|
+ select BCM63XX_EHCI
|
||||||
endmenu
|
endmenu
|
||||||
|
|
|
@ -27,7 +27,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
static int __init bcm63xx_detect_flash_type(void)
|
static int __init bcm63xx_detect_flash_type(void)
|
||||||
{
|
{
|
||||||
u32 val;
|
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) {
|
switch (flash_type) {
|
||||||
case BCM63XX_FLASH_TYPE_PARALLEL:
|
case BCM63XX_FLASH_TYPE_PARALLEL:
|
||||||
|
|
|
@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
@@ -8,6 +8,7 @@
|
@@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/bootmem.h>
|
#include <linux/memblock.h>
|
||||||
+#include <linux/of_fdt.h>
|
+#include <linux/of_fdt.h>
|
||||||
#include <linux/smp.h>
|
#include <linux/smp.h>
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
static int flash_type;
|
static int flash_type;
|
||||||
|
|
||||||
static struct mtd_partition mtd_partitions[] = {
|
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) {
|
switch (flash_type) {
|
||||||
case BCM63XX_FLASH_TYPE_PARALLEL:
|
case BCM63XX_FLASH_TYPE_PARALLEL:
|
||||||
|
|
|
@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
--- a/drivers/gpio/Kconfig
|
--- a/drivers/gpio/Kconfig
|
||||||
+++ b/drivers/gpio/Kconfig
|
+++ b/drivers/gpio/Kconfig
|
||||||
@@ -151,6 +151,13 @@ config GPIO_BCM_KONA
|
@@ -147,6 +147,13 @@ config GPIO_BCM_KONA
|
||||||
help
|
help
|
||||||
Turn on GPIO support for Broadcom "Kona" chips.
|
Turn on GPIO support for Broadcom "Kona" chips.
|
||||||
|
|
||||||
|
@ -30,14 +30,14 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
default y if (ARCH_BRCMSTB || BMIPS_GENERIC)
|
default y if (ARCH_BRCMSTB || BMIPS_GENERIC)
|
||||||
--- a/drivers/gpio/Makefile
|
--- a/drivers/gpio/Makefile
|
||||||
+++ b/drivers/gpio/Makefile
|
+++ b/drivers/gpio/Makefile
|
||||||
@@ -34,6 +34,7 @@ obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o
|
@@ -34,6 +34,7 @@ obj-$(CONFIG_GPIO_ARIZONA) += gpio-ariz
|
||||||
obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o
|
obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o
|
||||||
obj-$(CONFIG_GPIO_RASPBERRYPI_EXP) += gpio-raspberrypi-exp.o
|
obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o
|
||||||
obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o
|
obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o
|
||||||
+obj-$(CONFIG_GPIO_BCM63XX) += gpio-bcm63xx.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_BD9571MWV) += gpio-bd9571mwv.o
|
||||||
obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o
|
obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o
|
||||||
obj-$(CONFIG_GPIO_BT8XX) += gpio-bt8xx.o
|
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/gpio/gpio-bcm63xx.c
|
+++ b/drivers/gpio/gpio-bcm63xx.c
|
||||||
@@ -0,0 +1,135 @@
|
@@ -0,0 +1,135 @@
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
--- a/arch/mips/bcm63xx/Kconfig
|
--- a/arch/mips/bcm63xx/Kconfig
|
||||||
+++ b/arch/mips/bcm63xx/Kconfig
|
+++ b/arch/mips/bcm63xx/Kconfig
|
||||||
@@ -25,6 +25,8 @@ config BCM63XX_CPU_6318
|
@@ -25,6 +25,8 @@ config BCM63XX_CPU_6318
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
select BCM63XX_EHCI
|
select BCM63XX_EHCI
|
||||||
+ select PINCTRL
|
+ select PINCTRL
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
config BCM63XX_CPU_6328
|
config BCM63XX_CPU_6328
|
||||||
bool "support 6328 CPU"
|
bool "support 6328 CPU"
|
||||||
@@ -32,6 +34,8 @@ config BCM63XX_CPU_6328
|
@@ -32,6 +34,8 @@ config BCM63XX_CPU_6328
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
select BCM63XX_EHCI
|
select BCM63XX_EHCI
|
||||||
+ select PINCTRL
|
+ select PINCTRL
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
bool "support 6338 CPU"
|
bool "support 6338 CPU"
|
||||||
@@ -47,6 +51,8 @@ config BCM63XX_CPU_6348
|
@@ -47,6 +51,8 @@ config BCM63XX_CPU_6348
|
||||||
select SYS_HAS_CPU_BMIPS32_3300
|
select SYS_HAS_CPU_BMIPS32_3300
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
+ select PINCTRL
|
+ select PINCTRL
|
||||||
+ select PINCTRL_BCM6348
|
+ select PINCTRL_BCM6348
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
config BCM63XX_CPU_6358
|
config BCM63XX_CPU_6358
|
||||||
bool "support 6358 CPU"
|
bool "support 6358 CPU"
|
||||||
@@ -54,6 +60,8 @@ config BCM63XX_CPU_6358
|
@@ -54,6 +60,8 @@ config BCM63XX_CPU_6358
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
select BCM63XX_EHCI
|
select BCM63XX_EHCI
|
||||||
+ select PINCTRL
|
+ select PINCTRL
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
config BCM63XX_CPU_6362
|
config BCM63XX_CPU_6362
|
||||||
bool "support 6362 CPU"
|
bool "support 6362 CPU"
|
||||||
@@ -61,6 +69,8 @@ config BCM63XX_CPU_6362
|
@@ -61,6 +69,8 @@ config BCM63XX_CPU_6362
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
select BCM63XX_EHCI
|
select BCM63XX_EHCI
|
||||||
+ select PINCTRL
|
+ select PINCTRL
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
config BCM63XX_CPU_6368
|
config BCM63XX_CPU_6368
|
||||||
bool "support 6368 CPU"
|
bool "support 6368 CPU"
|
||||||
@@ -68,6 +78,8 @@ config BCM63XX_CPU_6368
|
@@ -68,6 +78,8 @@ config BCM63XX_CPU_6368
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
select BCM63XX_EHCI
|
select BCM63XX_EHCI
|
||||||
+ select PINCTRL
|
+ select PINCTRL
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
config BCM63XX_CPU_63268
|
config BCM63XX_CPU_63268
|
||||||
bool "support 63268 CPU"
|
bool "support 63268 CPU"
|
||||||
@@ -75,6 +87,8 @@ config BCM63XX_CPU_63268
|
@@ -75,6 +87,8 @@ config BCM63XX_CPU_63268
|
||||||
select HW_HAS_PCI
|
select HAVE_PCI
|
||||||
select BCM63XX_OHCI
|
select BCM63XX_OHCI
|
||||||
select BCM63XX_EHCI
|
select BCM63XX_EHCI
|
||||||
+ select PINCTRL
|
+ select PINCTRL
|
||||||
|
|
|
@ -21,9 +21,9 @@ Signed-off-by: Axel Gembe <ago@bastart.eu.org>
|
||||||
|
|
||||||
static struct physmap_flash_data flash_data = {
|
static struct physmap_flash_data flash_data = {
|
||||||
.width = 2,
|
.width = 2,
|
||||||
--- a/drivers/mtd/redboot.c
|
--- a/drivers/mtd/parsers/redboot.c
|
||||||
+++ b/drivers/mtd/redboot.c
|
+++ b/drivers/mtd/parsers/redboot.c
|
||||||
@@ -72,6 +72,7 @@ static int parse_redboot_partitions(stru
|
@@ -79,6 +79,7 @@ static int parse_redboot_partitions(stru
|
||||||
int nulllen = 0;
|
int nulllen = 0;
|
||||||
int numslots;
|
int numslots;
|
||||||
unsigned long offset;
|
unsigned long offset;
|
||||||
|
@ -31,7 +31,7 @@ Signed-off-by: Axel Gembe <ago@bastart.eu.org>
|
||||||
#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
|
#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
|
||||||
static char nullstring[] = "unallocated";
|
static char nullstring[] = "unallocated";
|
||||||
#endif
|
#endif
|
||||||
@@ -176,6 +177,16 @@ static int parse_redboot_partitions(stru
|
@@ -185,6 +186,16 @@ static int parse_redboot_partitions(stru
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ Signed-off-by: Axel Gembe <ago@bastart.eu.org>
|
||||||
for (i = 0; i < numslots; i++) {
|
for (i = 0; i < numslots; i++) {
|
||||||
struct fis_list *new_fl, **prev;
|
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;
|
goto out;
|
||||||
}
|
}
|
||||||
new_fl->img = &buf[i];
|
new_fl->img = &buf[i];
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
/* 240-255: Unused at present */
|
/* 240-255: Unused at present */
|
||||||
--- a/drivers/mtd/parsers/parser_imagetag.c
|
--- a/drivers/mtd/parsers/parser_imagetag.c
|
||||||
+++ b/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 {
|
} else {
|
||||||
/* OpenWrt layout */
|
/* OpenWrt layout */
|
||||||
rootfsaddr = kerneladdr + kernellen;
|
rootfsaddr = kerneladdr + kernellen;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
||||||
+++ b/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;
|
return -EBUSY;
|
||||||
|
|
||||||
/* add ethernet header + vlan tag size */
|
/* add ethernet header + vlan tag size */
|
||||||
|
|
|
@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
|
|
||||||
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
||||||
+++ b/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 bcm_enet_priv *priv;
|
||||||
struct sockaddr addr;
|
struct sockaddr addr;
|
||||||
struct device *kdev;
|
struct device *kdev;
|
||||||
|
@ -26,7 +26,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
void *p;
|
void *p;
|
||||||
u32 val;
|
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;
|
kdev = &priv->pdev->dev;
|
||||||
|
|
||||||
if (priv->has_phy) {
|
if (priv->has_phy) {
|
||||||
|
@ -43,19 +43,10 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- /* mask with MAC supported features */
|
- /* mask with MAC supported features */
|
||||||
- phydev->supported &= (SUPPORTED_10baseT_Half |
|
- phy_support_sym_pause(phydev);
|
||||||
- SUPPORTED_10baseT_Full |
|
- phy_set_max_speed(phydev, SPEED_100);
|
||||||
- SUPPORTED_100baseT_Half |
|
- phy_set_sym_pause(phydev, priv->pause_rx, priv->pause_rx,
|
||||||
- SUPPORTED_100baseT_Full |
|
- priv->pause_auto);
|
||||||
- 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_attached_info(phydev);
|
- phy_attached_info(phydev);
|
||||||
-
|
-
|
||||||
|
@ -68,7 +59,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mask all interrupts and request them */
|
/* 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);
|
ret = request_irq(dev->irq, bcm_enet_isr_mac, 0, dev->name, dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -77,7 +68,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
|
|
||||||
ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, 0,
|
ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, 0,
|
||||||
dev->name, dev);
|
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,
|
enet_dmac_writel(priv, priv->dma_chan_int_mask,
|
||||||
ENETDMAC_IRMASK, priv->tx_chan);
|
ENETDMAC_IRMASK, priv->tx_chan);
|
||||||
|
|
||||||
|
@ -88,7 +79,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
else
|
else
|
||||||
bcm_enet_adjust_link(dev);
|
bcm_enet_adjust_link(dev);
|
||||||
|
|
||||||
@@ -1125,10 +1093,6 @@ out_freeirq_rx:
|
@@ -1103,10 +1080,6 @@ out_freeirq_rx:
|
||||||
out_freeirq:
|
out_freeirq:
|
||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
|
|
||||||
|
@ -99,7 +90,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
return ret;
|
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(priv->irq_rx, dev);
|
||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
|
|
||||||
|
@ -110,7 +101,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
return 0;
|
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 */
|
/* do minimal hardware init to be able to probe mii bus */
|
||||||
bcm_enet_hw_preinit(priv);
|
bcm_enet_hw_preinit(priv);
|
||||||
|
@ -159,7 +150,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
}
|
}
|
||||||
|
|
||||||
bus = priv->mii_bus;
|
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");
|
dev_err(&pdev->dev, "unable to register mdio bus\n");
|
||||||
goto out_free_mdio;
|
goto out_free_mdio;
|
||||||
}
|
}
|
||||||
|
@ -177,25 +168,16 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* mask with MAC supported features */
|
+ /* mask with MAC supported features */
|
||||||
+ phydev->supported &= (SUPPORTED_10baseT_Half |
|
+ phy_support_sym_pause(phydev);
|
||||||
+ SUPPORTED_10baseT_Full |
|
+ phy_set_max_speed(phydev, SPEED_100);
|
||||||
+ SUPPORTED_100baseT_Half |
|
+ phy_set_sym_pause(phydev, priv->pause_rx, priv->pause_rx,
|
||||||
+ SUPPORTED_100baseT_Full |
|
+ priv->pause_auto);
|
||||||
+ 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_attached_info(phydev);
|
+ phy_attached_info(phydev);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* run platform code to initialize PHY device */
|
/* 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,
|
pd->mii_config(dev, 1, bcm_enet_mdio_read_mii,
|
||||||
bcm_enet_mdio_write_mii)) {
|
bcm_enet_mdio_write_mii)) {
|
||||||
dev_err(&pdev->dev, "unable to configure mdio bus\n");
|
dev_err(&pdev->dev, "unable to configure mdio bus\n");
|
||||||
|
@ -245,7 +227,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
if (priv->mii_bus)
|
if (priv->mii_bus)
|
||||||
mdiobus_unregister(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)
|
if (priv->mii_bus)
|
||||||
mdiobus_free(priv->mii_bus);
|
mdiobus_free(priv->mii_bus);
|
||||||
|
|
||||||
|
@ -255,7 +237,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
out_uninit_hw:
|
out_uninit_hw:
|
||||||
/* turn off mdc clock */
|
/* turn off mdc clock */
|
||||||
enet_writel(priv, 0, ENET_MIISC_REG);
|
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);
|
enet_writel(priv, 0, ENET_MIISC_REG);
|
||||||
|
|
||||||
if (priv->has_phy) {
|
if (priv->has_phy) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ Subject: [PATCH 54/81] bcm63xx_enet: enable rgmii clock on external ports
|
||||||
#define ENETSW_MDIOC_EXT_MASK (1 << 16)
|
#define ENETSW_MDIOC_EXT_MASK (1 << 16)
|
||||||
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
||||||
+++ b/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;
|
priv->sw_port_link[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
if (val & STRAPBUS_6328_BOOT_SEL_SERIAL)
|
if (val & STRAPBUS_6328_BOOT_SEL_SERIAL)
|
||||||
return BCM63XX_FLASH_TYPE_SERIAL;
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
else
|
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;
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
case BCM6362_CPU_ID:
|
case BCM6362_CPU_ID:
|
||||||
val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
|
val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
|
||||||
|
@ -92,16 +92,6 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
return BCM63XX_FLASH_TYPE_SERIAL;
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
else
|
else
|
||||||
return BCM63XX_FLASH_TYPE_NAND;
|
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:
|
case BCM63268_CPU_ID:
|
||||||
val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
|
val = bcm_misc_readl(MISC_STRAPBUS_63268_REG);
|
||||||
+ if (val & STRAPBUS_63268_HSSPI_CLK_FAST)
|
+ if (val & STRAPBUS_63268_HSSPI_CLK_FAST)
|
||||||
|
@ -112,7 +102,16 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
|
if (val & STRAPBUS_63268_BOOT_SEL_SERIAL)
|
||||||
return BCM63XX_FLASH_TYPE_SERIAL;
|
return BCM63XX_FLASH_TYPE_SERIAL;
|
||||||
else
|
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)
|
int __init bcm63xx_flash_register(void)
|
||||||
{
|
{
|
||||||
|
@ -120,7 +119,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
switch (flash_type) {
|
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);
|
return platform_device_register(&mtd_dev);
|
||||||
case BCM63XX_FLASH_TYPE_SERIAL:
|
case BCM63XX_FLASH_TYPE_SERIAL:
|
||||||
|
|
|
@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
|
||||||
|
|
||||||
--- a/arch/mips/bcm63xx/dev-flash.c
|
--- a/arch/mips/bcm63xx/dev-flash.c
|
||||||
+++ b/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;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
spinlock_t enetsw_mdio_lock;
|
spinlock_t enetsw_mdio_lock;
|
||||||
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
||||||
+++ b/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/dma-mapping.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/if_vlan.h>
|
#include <linux/if_vlan.h>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include <bcm63xx_dev_enet.h>
|
#include <bcm63xx_dev_enet.h>
|
||||||
#include "bcm63xx_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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
.probe = bcm_enet_probe,
|
.probe = bcm_enet_probe,
|
||||||
.remove = bcm_enet_remove,
|
.remove = bcm_enet_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
@@ -1941,6 +1943,42 @@ struct platform_driver bcm63xx_enet_driv
|
@@ -1918,6 +1920,42 @@ struct platform_driver bcm63xx_enet_driv
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
/*
|
/*
|
||||||
* switch mii access callbacks
|
* 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));
|
enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@
|
||||||
/* initialize flow control buffer allocation */
|
/* initialize flow control buffer allocation */
|
||||||
enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0,
|
enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0,
|
||||||
ENETDMA_BUFALLOC_REG(priv->rx_chan));
|
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 bcm63xx_enetsw_platform_data *pd;
|
||||||
struct resource *res_mem;
|
struct resource *res_mem;
|
||||||
int ret, irq_rx, irq_tx;
|
int ret, irq_rx, irq_tx;
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
|
|
||||||
if (!bcm_enet_shared_base[0])
|
if (!bcm_enet_shared_base[0])
|
||||||
return -EPROBE_DEFER;
|
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->pdev = pdev;
|
||||||
priv->net_dev = dev;
|
priv->net_dev = dev;
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_disable_clk:
|
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);
|
priv = netdev_priv(dev);
|
||||||
unregister_netdev(dev);
|
unregister_netdev(dev);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
||||||
+++ b/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)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
#include <bcm63xx_cpu.h>
|
#include <bcm63xx_cpu.h>
|
||||||
#include <bcm63xx_dev_flash.h>
|
#include <bcm63xx_dev_flash.h>
|
||||||
#include <bcm63xx_regs.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 = bcm_mpi_readl(MPI_CSBASE_REG(0));
|
||||||
val &= MPI_CSBASE_BASE_MASK;
|
val &= MPI_CSBASE_BASE_MASK;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,8 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
|
||||||
endmenu
|
endmenu
|
||||||
--- a/arch/mips/bcm63xx/boards/Makefile
|
--- a/arch/mips/bcm63xx/boards/Makefile
|
||||||
+++ b/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-y += board_common.o
|
||||||
obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
|
obj-$(CONFIG_BOARD_BCM963XX) += board_bcm963xx.o
|
||||||
+obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o
|
+obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o
|
||||||
|
|
|
@ -15,11 +15,13 @@
|
||||||
u32 crc, expected_crc;
|
u32 crc, expected_crc;
|
||||||
--- a/arch/mips/mm/cache.c
|
--- a/arch/mips/mm/cache.c
|
||||||
+++ b/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);
|
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);
|
+EXPORT_SYMBOL(_dma_cache_inv);
|
||||||
|
+
|
||||||
#endif /* CONFIG_DMA_NONCOHERENT */
|
#endif /* CONFIG_DMA_NONCOHERENT */
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
|
||||||
+++ b/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_readb(priv, ENETSW_RGMII_CTRL_REG(i));
|
||||||
rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN;
|
rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN;
|
||||||
|
|
Loading…
Reference in New Issue