mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 09:32:34 +00:00
ramips: fix actiontec web7200 dual boot
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
From 2858efa76a021729e068e45675c86f670674aa16 Mon Sep 17 00:00:00 2001
|
||||
From a42b4b5273ed91281c046939492d5bb02b0ca3fa Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Fri, 7 Jan 2022 10:58:08 +0100
|
||||
Subject: [PATCH] ramips: add support for actiontec web7200
|
||||
Subject: [PATCH 06/14] ramips: add support for actiontec web7200
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
@@ -34,7 +34,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
create mode 100644 target/linux/ramips/patches-5.4/499-mtd-add-nmbm-support.patch
|
||||
|
||||
diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
|
||||
index 33af86c846..ce389d6ef8 100644
|
||||
index 33af86c846..c13ee08103 100644
|
||||
--- a/package/boot/uboot-envtools/files/ramips
|
||||
+++ b/package/boot/uboot-envtools/files/ramips
|
||||
@@ -13,6 +13,9 @@ touch /etc/config/ubootenv
|
||||
@@ -3196,7 +3196,7 @@ index 0000000000..18dfb6adda
|
||||
+#include "nmbm-debug.inl"
|
||||
diff --git a/target/linux/ramips/files/drivers/mtd/nmbm/nmbm-debug.h b/target/linux/ramips/files/drivers/mtd/nmbm/nmbm-debug.h
|
||||
new file mode 100644
|
||||
index 0000000000..582118333e
|
||||
index 0000000000..7f9dfed9e1
|
||||
--- /dev/null
|
||||
+++ b/target/linux/ramips/files/drivers/mtd/nmbm/nmbm-debug.h
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2740
patches/ramips/0008-ramips-move-mt7621_nand-driver-to-files.patch
Normal file
2740
patches/ramips/0008-ramips-move-mt7621_nand-driver-to-files.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
From 8ff3f57a88d867d48c2a38876baf9b389d7441df Mon Sep 17 00:00:00 2001
|
||||
From: Stijn Tintel <stijn@linux-ipv6.be>
|
||||
Date: Wed, 19 Jan 2022 17:59:51 +0200
|
||||
Subject: [PATCH 09/14] ramips: mt7621_nand: reduce log verbosity
|
||||
|
||||
Avoid flooding the log with the message below by increasing the log
|
||||
level to debug:
|
||||
|
||||
mt7621-nand 1e003000.nand: Using programmed access timing: 31c07388
|
||||
|
||||
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
|
||||
---
|
||||
target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
index 678295a68d..16493a2e97 100644
|
||||
--- a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
+++ b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
@@ -759,7 +759,7 @@ static int mt7621_nfc_setup_data_interface(struct nand_chip *nand, int csline,
|
||||
|
||||
acccon = ACCTIMING(tpoecs, tprecs, tc2r, tw2r, twh, twst, trlt);
|
||||
|
||||
- dev_info(nfc->dev, "Using programmed access timing: %08x\n", acccon);
|
||||
+ dev_dbg(nfc->dev, "Using programmed access timing: %08x\n", acccon);
|
||||
|
||||
nfi_write32(nfc, NFI_ACCCON, acccon);
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 10d63c9973b9598a065244e9752db7aa3d78a93f Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 9 Mar 2022 20:46:21 +0100
|
||||
Subject: [PATCH 10/14] ramips: mt7621_nand: initialize ECC_FDMADDR
|
||||
|
||||
This is needed for the ECC controller to access FDM data
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
index 16493a2e97..0751e59c37 100644
|
||||
--- a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
+++ b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
@@ -214,6 +214,7 @@ struct mt7621_nfc {
|
||||
struct clk *nfi_clk;
|
||||
struct device *dev;
|
||||
|
||||
+ u32 nfi_base;
|
||||
void __iomem *nfi_regs;
|
||||
void __iomem *ecc_regs;
|
||||
|
||||
@@ -860,6 +861,8 @@ static int mt7621_nfc_ecc_init(struct mt7621_nfc *nfc)
|
||||
(decode_block_size << DEC_CS_S) |
|
||||
(DEC_CON_EL << DEC_CON_S) | DEC_EMPTY_EN;
|
||||
|
||||
+ ecc_write32(nfc, ECC_FDMADDR, nfc->nfi_base + NFI_FDML(0));
|
||||
+
|
||||
mt7621_ecc_encoder_op(nfc, false);
|
||||
ecc_write32(nfc, ECC_ENCCNFG, ecc_enccfg);
|
||||
|
||||
@@ -1277,6 +1280,7 @@ static int mt7621_nfc_probe(struct platform_device *pdev)
|
||||
nfc->dev = dev;
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nfi");
|
||||
+ nfc->nfi_base = res->start;
|
||||
nfc->nfi_regs = devm_ioremap_resource(dev, res);
|
||||
if (IS_ERR(nfc->nfi_regs)) {
|
||||
ret = PTR_ERR(nfc->nfi_regs);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From bee84b6606374bb887e70e263419b19e112f1b5c Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 10 Mar 2022 11:45:00 +0100
|
||||
Subject: [PATCH 11/14] ramips: enable support for mtk_bmt in the nand flash
|
||||
driver
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
.../linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
index 0751e59c37..1072450898 100644
|
||||
--- a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
+++ b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/rawnand.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
+#include <linux/mtd/mtk_bmt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <asm/addrspace.h>
|
||||
|
||||
@@ -1254,9 +1255,12 @@ static int mt7621_nfc_init_chip(struct mt7621_nfc *nfc)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
+ mtk_bmt_attach(mtd);
|
||||
+
|
||||
ret = mtd_device_register(mtd, NULL, 0);
|
||||
if (ret) {
|
||||
dev_err(nfc->dev, "Failed to register MTD: %d\n", ret);
|
||||
+ mtk_bmt_detach(mtd);
|
||||
nand_release(nand);
|
||||
return ret;
|
||||
}
|
||||
@@ -1325,7 +1329,11 @@ clk_disable:
|
||||
static int mt7621_nfc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mt7621_nfc *nfc = platform_get_drvdata(pdev);
|
||||
+ struct nand_chip *nand = &nfc->nand;
|
||||
+ struct mtd_info *mtd = nand_to_mtd(nand);
|
||||
|
||||
+ mtk_bmt_detach(mtd);
|
||||
+ mtd_device_unregister(mtd);
|
||||
nand_release(&nfc->nand);
|
||||
clk_disable_unprepare(nfc->nfi_clk);
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
29
patches/ramips/0012-ramips-skip-bbt-scan-on-mt7621.patch
Normal file
29
patches/ramips/0012-ramips-skip-bbt-scan-on-mt7621.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
From 806708eed0809c9ee07cbcff1285a64c9767242f Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 10 Mar 2022 15:20:29 +0100
|
||||
Subject: [PATCH 12/14] ramips: skip bbt scan on mt7621
|
||||
|
||||
reduces unnecessary flash reads and speeds up boot time
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
index 1072450898..f01e1e8a8e 100644
|
||||
--- a/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
+++ b/target/linux/ramips/files/drivers/mtd/nand/raw/mt7621_nand.c
|
||||
@@ -1229,7 +1229,8 @@ static int mt7621_nfc_init_chip(struct mt7621_nfc *nfc)
|
||||
nand_set_controller_data(nand, (void *)nfc);
|
||||
nand_set_flash_node(nand, nfc->dev->of_node);
|
||||
|
||||
- nand->options |= NAND_USE_BOUNCE_BUFFER | NAND_NO_SUBPAGE_WRITE;
|
||||
+ nand->options |= NAND_USE_BOUNCE_BUFFER | NAND_NO_SUBPAGE_WRITE |
|
||||
+ NAND_SKIP_BBTSCAN;
|
||||
if (!nfc->nfi_clk)
|
||||
nand->options |= NAND_KEEP_TIMINGS;
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 9f51c3956a80205006dc6a686d80969bd3b42ecb Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 10 Mar 2022 17:32:20 +0100
|
||||
Subject: [PATCH 13/14] kernel: mtdsplit: support UBI after FIT images
|
||||
|
||||
Change the partition name accordingly. Same behavior as mtdsplit_uimage
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
.../generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
|
||||
index 5cc1658dbd..f043428949 100644
|
||||
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
|
||||
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_fit.c
|
||||
@@ -57,6 +57,7 @@ mtdsplit_fit_parse(struct mtd_info *mtd,
|
||||
size_t fit_offset, fit_size;
|
||||
size_t rootfs_offset, rootfs_size;
|
||||
struct mtd_partition *parts;
|
||||
+ enum mtdsplit_part_type type;
|
||||
int ret;
|
||||
|
||||
of_property_read_string(np, "openwrt,cmdline-match", &cmdline_match);
|
||||
@@ -101,7 +102,7 @@ mtdsplit_fit_parse(struct mtd_info *mtd,
|
||||
|
||||
/* Search for the rootfs partition after the FIT image */
|
||||
ret = mtd_find_rootfs_from(mtd, fit_offset + fit_size, mtd->size,
|
||||
- &rootfs_offset, NULL);
|
||||
+ &rootfs_offset, &type);
|
||||
if (ret) {
|
||||
pr_info("no rootfs found after FIT image in \"%s\"\n",
|
||||
mtd->name);
|
||||
@@ -118,7 +119,10 @@ mtdsplit_fit_parse(struct mtd_info *mtd,
|
||||
parts[0].offset = fit_offset;
|
||||
parts[0].size = mtd_rounddown_to_eb(fit_size, mtd) + mtd->erasesize;
|
||||
|
||||
- parts[1].name = ROOTFS_PART_NAME;
|
||||
+ if (type == MTDSPLIT_PART_TYPE_UBI)
|
||||
+ parts[1].name = UBI_PART_NAME;
|
||||
+ else
|
||||
+ parts[1].name = ROOTFS_PART_NAME;
|
||||
parts[1].offset = rootfs_offset;
|
||||
parts[1].size = rootfs_size;
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
4429
patches/ramips/0014-update-actiontec-web7200-support.patch
Normal file
4429
patches/ramips/0014-update-actiontec-web7200-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user