kernel: add pending bmips patches
Add patches sent upstream for bmips and b53 and remove downstream ones. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
|
||||
--- a/arch/mips/bmips/setup.c
|
||||
+++ b/arch/mips/bmips/setup.c
|
||||
@@ -31,11 +31,51 @@
|
||||
@@ -31,13 +31,52 @@
|
||||
|
||||
#define RELO_NORMAL_VEC BIT(18)
|
||||
|
||||
@@ -55,7 +55,8 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
+#define REG_BCM63268_MISC_SB ((void __iomem *)CKSEG1ADDR(0x10001814))
|
||||
+#define BCM63268_FCVO_SHIFT 21
|
||||
+#define BCM63268_FCVO_MASK (0xf << BCM63268_FCVO_SHIFT)
|
||||
+
|
||||
|
||||
extern bool bmips_rac_flush_disable;
|
||||
|
||||
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
|
||||
|
||||
@@ -67,7 +68,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
struct bmips_quirk {
|
||||
const char *compatible;
|
||||
void (*quirk_fn)(void);
|
||||
@@ -134,17 +174,161 @@ const char *get_system_type(void)
|
||||
@@ -142,17 +181,161 @@ const char *get_system_type(void)
|
||||
return "Generic BMIPS kernel";
|
||||
}
|
||||
|
||||
|
||||
@@ -50,12 +50,12 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
#define REG_BCM6368_DDR_PLLC ((void __iomem *)CKSEG1ADDR(0x100012a0))
|
||||
#define BCM6368_PLLC_P1_SHIFT 0
|
||||
#define BCM6368_PLLC_P1_MASK (0xf << BCM6368_PLLC_P1_SHIFT)
|
||||
@@ -67,7 +73,21 @@
|
||||
@@ -67,6 +73,21 @@
|
||||
#define REG_BCM63268_MISC_SB ((void __iomem *)CKSEG1ADDR(0x10001814))
|
||||
#define BCM63268_FCVO_SHIFT 21
|
||||
#define BCM63268_FCVO_MASK (0xf << BCM63268_FCVO_SHIFT)
|
||||
+#define BCM63268_MEMC_ADDR ((void __iomem *)CKSEG1ADDR(0x10003000))
|
||||
|
||||
+
|
||||
+#define SDRAM_CFG_REG 0x0
|
||||
+#define SDRAM_SPACE_SHIFT 4
|
||||
+#define SDRAM_SPACE_MASK (0xf << SDRAM_SPACE_SHIFT)
|
||||
@@ -70,9 +70,9 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
+
|
||||
+#define DDR_CSEND_REG 0x8
|
||||
|
||||
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
|
||||
extern bool bmips_rac_flush_disable;
|
||||
|
||||
@@ -76,6 +96,11 @@ struct bmips_cpufreq {
|
||||
@@ -77,6 +98,11 @@ struct bmips_cpufreq {
|
||||
u32 (*cpu_freq)(void);
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
struct bmips_quirk {
|
||||
const char *compatible;
|
||||
void (*quirk_fn)(void);
|
||||
@@ -333,9 +358,90 @@ void __init plat_time_init(void)
|
||||
@@ -340,9 +366,90 @@ void __init plat_time_init(void)
|
||||
mips_hpt_frequency = freq;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
const struct bmips_quirk *q;
|
||||
|
||||
set_io_port_base(0);
|
||||
@@ -353,6 +459,18 @@ void __init plat_mem_setup(void)
|
||||
@@ -360,6 +467,18 @@ void __init plat_mem_setup(void)
|
||||
|
||||
__dt_setup_arch(dtb);
|
||||
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
From f48c93e4c4b5dbad1c0fbd623fd68f55f1667527 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Fri, 10 Mar 2023 13:05:10 +0100
|
||||
Subject: [PATCH] mips: bmips: BCM6358: disable arch_sync_dma_for_cpu_all() for
|
||||
TP1
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
arch_sync_dma_for_cpu_all() causes kernel panics on BCM6358 with EHCI/OHCI:
|
||||
[ 3.881739] usb 1-1: new high-speed USB device number 2 using ehci-platform
|
||||
[ 3.895011] Reserved instruction in kernel code[#1]:
|
||||
[ 3.900113] CPU: 0 PID: 1 Comm: init Not tainted 5.10.16 #0
|
||||
[ 3.905829] $ 0 : 00000000 10008700 00000000 77d94060
|
||||
[ 3.911238] $ 4 : 7fd1f088 00000000 81431cac 81431ca0
|
||||
[ 3.916641] $ 8 : 00000000 ffffefff 8075cd34 00000000
|
||||
[ 3.922043] $12 : 806f8d40 f3e812b7 00000000 000d9aaa
|
||||
[ 3.927446] $16 : 7fd1f068 7fd1f080 7ff559b8 81428470
|
||||
[ 3.932848] $20 : 00000000 00000000 55590000 77d70000
|
||||
[ 3.938251] $24 : 00000018 00000010
|
||||
[ 3.943655] $28 : 81430000 81431e60 81431f28 800157fc
|
||||
[ 3.949058] Hi : 00000000
|
||||
[ 3.952013] Lo : 00000000
|
||||
[ 3.955019] epc : 80015808 setup_sigcontext+0x54/0x24c
|
||||
[ 3.960464] ra : 800157fc setup_sigcontext+0x48/0x24c
|
||||
[ 3.965913] Status: 10008703 KERNEL EXL IE
|
||||
[ 3.970216] Cause : 00800028 (ExcCode 0a)
|
||||
[ 3.974340] PrId : 0002a010 (Broadcom BMIPS4350)
|
||||
[ 3.979170] Modules linked in: ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl ehci_hcd gpio_button_hotplug usbcore nls_base usb_common
|
||||
[ 3.992907] Process init (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=77e22ec8)
|
||||
[ 4.000776] Stack : 81431ef4 7fd1f080 81431f28 81428470 7fd1f068 81431edc 7ff559b8 81428470
|
||||
[ 4.009467] 81431f28 7fd1f080 55590000 77d70000 77d5498c 80015c70 806f0000 8063ae74
|
||||
[ 4.018149] 08100002 81431f28 0000000a 08100002 81431f28 0000000a 77d6b418 00000003
|
||||
[ 4.026831] ffffffff 80016414 80080734 81431ecc 81431ecc 00000001 00000000 04000000
|
||||
[ 4.035512] 77d54874 00000000 00000000 00000000 00000000 00000012 00000002 00000000
|
||||
[ 4.044196] ...
|
||||
[ 4.046706] Call Trace:
|
||||
[ 4.049238] [<80015808>] setup_sigcontext+0x54/0x24c
|
||||
[ 4.054356] [<80015c70>] setup_frame+0xdc/0x124
|
||||
[ 4.059015] [<80016414>] do_notify_resume+0x1dc/0x288
|
||||
[ 4.064207] [<80011b50>] work_notifysig+0x10/0x18
|
||||
[ 4.069036]
|
||||
[ 4.070538] Code: 8fc300b4 00001025 26240008 <ac820000> ac830004 3c048063 0c0228aa 24846a00 26240010
|
||||
[ 4.080686]
|
||||
[ 4.082517] ---[ end trace 22a8edb41f5f983b ]---
|
||||
[ 4.087374] Kernel panic - not syncing: Fatal exception
|
||||
[ 4.092753] Rebooting in 1 seconds..
|
||||
|
||||
This only happens when booting from TP1 instead of TP0.
|
||||
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
arch/mips/bmips/dma.c | 5 +++++
|
||||
arch/mips/bmips/setup.c | 9 +++++++++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
--- a/arch/mips/bmips/dma.c
|
||||
+++ b/arch/mips/bmips/dma.c
|
||||
@@ -64,11 +64,16 @@ phys_addr_t dma_to_phys(struct device *d
|
||||
return dma_addr;
|
||||
}
|
||||
|
||||
+int bmips_dma_sync_disable = 0;
|
||||
+
|
||||
void arch_sync_dma_for_cpu_all(void)
|
||||
{
|
||||
void __iomem *cbr = BMIPS_GET_CBR();
|
||||
u32 cfg;
|
||||
|
||||
+ if (bmips_dma_sync_disable)
|
||||
+ return;
|
||||
+
|
||||
if (boot_cpu_type() != CPU_BMIPS3300 &&
|
||||
boot_cpu_type() != CPU_BMIPS4350 &&
|
||||
boot_cpu_type() != CPU_BMIPS4380)
|
||||
--- a/arch/mips/bmips/setup.c
|
||||
+++ b/arch/mips/bmips/setup.c
|
||||
@@ -89,6 +89,8 @@
|
||||
|
||||
#define DDR_CSEND_REG 0x8
|
||||
|
||||
+extern int bmips_dma_sync_disable;
|
||||
+
|
||||
static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
|
||||
|
||||
struct bmips_cpufreq {
|
||||
@@ -168,6 +170,13 @@ static void bcm6358_quirks(void)
|
||||
* disable SMP for now
|
||||
*/
|
||||
bmips_smp_enabled = 0;
|
||||
+
|
||||
+ /*
|
||||
+ * ARCH_HAS_SYNC_DMA_FOR_CPU_ALL causes kernel panics on BCM6358 when
|
||||
+ * booting from TP1
|
||||
+ */
|
||||
+ if (read_c0_brcm_cmt_local() & (1 << 31))
|
||||
+ bmips_dma_sync_disable = 1;
|
||||
}
|
||||
|
||||
static void bcm6368_quirks(void)
|
||||
@@ -1,38 +0,0 @@
|
||||
From b5c07b7bceed9287647697408423acd08f97db73 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Thu, 16 Mar 2023 18:42:41 +0100
|
||||
Subject: [PATCH] irqchip/bcm-6345-l1: request memory region
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Request memory region in order to display it in /proc/iomem.
|
||||
Also stop printing the MMIO address since it just displays (ptrval).
|
||||
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
drivers/irqchip/irq-bcm6345-l1.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/irqchip/irq-bcm6345-l1.c
|
||||
+++ b/drivers/irqchip/irq-bcm6345-l1.c
|
||||
@@ -261,6 +261,9 @@ static int __init bcm6345_l1_init_one(st
|
||||
if (!cpu->map_base)
|
||||
return -ENOMEM;
|
||||
|
||||
+ if (!request_mem_region(res.start, sz, res.name))
|
||||
+ pr_err("Failed to request intc memory");
|
||||
+
|
||||
for (i = 0; i < n_words; i++) {
|
||||
cpu->enable_cache[i] = 0;
|
||||
__raw_writel(0, cpu->map_base + reg_enable(intc, i));
|
||||
@@ -339,8 +342,7 @@ static int __init bcm6345_l1_of_init(str
|
||||
for_each_cpu(idx, &intc->cpumask) {
|
||||
struct bcm6345_l1_cpu *cpu = intc->cpus[idx];
|
||||
|
||||
- pr_info(" CPU%u at MMIO 0x%p (irq = %d)\n", idx,
|
||||
- cpu->map_base, cpu->parent_irq);
|
||||
+ pr_info(" CPU%u (irq = %d)\n", idx, cpu->parent_irq);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1,27 +0,0 @@
|
||||
From dadd7a1aa1eaebd5a03dee933c9051eae3724f00 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Thu, 9 Mar 2023 19:18:07 +0100
|
||||
Subject: [PATCH] net: dsa: b53: mmap: fix device tree support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
CPU port should also be enabled in order to get a working switch.
|
||||
|
||||
Fixes: a5538a777b73 ("net: dsa: b53: mmap: Add device tree support")
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/b53/b53_mmap.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/dsa/b53/b53_mmap.c
|
||||
+++ b/drivers/net/dsa/b53/b53_mmap.c
|
||||
@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct plat
|
||||
if (of_property_read_u32(of_port, "reg", ®))
|
||||
continue;
|
||||
|
||||
- if (reg < B53_CPU_PORT)
|
||||
+ if (reg < B53_N_PORTS)
|
||||
pdata->enabled_ports |= BIT(reg);
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
From 32cf73d8c6485b7b97aca7e377a68436d09b7022 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
|
||||
Date: Sun, 14 Mar 2021 20:03:44 +0100
|
||||
Subject: [PATCH] net: dsa: b53: add support for BCM63xx RGMIIs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/b53/b53_common.c | 37 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 37 insertions(+)
|
||||
|
||||
--- a/drivers/net/dsa/b53/b53_common.c
|
||||
+++ b/drivers/net/dsa/b53/b53_common.c
|
||||
@@ -1209,6 +1209,36 @@ static void b53_force_port_config(struct
|
||||
b53_write8(dev, B53_CTRL_PAGE, off, reg);
|
||||
}
|
||||
|
||||
+static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port,
|
||||
+ phy_interface_t interface)
|
||||
+{
|
||||
+ struct b53_device *dev = ds->priv;
|
||||
+ u8 rgmii_ctrl = 0, off;
|
||||
+
|
||||
+ if (port == 8)
|
||||
+ off = B53_RGMII_CTRL_IMP;
|
||||
+ else
|
||||
+ off = B53_RGMII_CTRL_P(port);
|
||||
+
|
||||
+ b53_read8(dev, B53_CTRL_PAGE, off, &rgmii_ctrl);
|
||||
+
|
||||
+ rgmii_ctrl &= ~(RGMII_CTRL_DLL_RXC | RGMII_CTRL_DLL_TXC);
|
||||
+ if (interface == PHY_INTERFACE_MODE_RGMII_ID)
|
||||
+ rgmii_ctrl |= (RGMII_CTRL_DLL_RXC | RGMII_CTRL_DLL_TXC);
|
||||
+ else if (interface == PHY_INTERFACE_MODE_RGMII_RXID)
|
||||
+ rgmii_ctrl |= RGMII_CTRL_DLL_RXC;
|
||||
+ else if (interface == PHY_INTERFACE_MODE_RGMII_TXID)
|
||||
+ rgmii_ctrl |= RGMII_CTRL_DLL_TXC;
|
||||
+
|
||||
+ if (port != B53_CPU_PORT)
|
||||
+ rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII;
|
||||
+
|
||||
+ b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl);
|
||||
+
|
||||
+ dev_info(ds->dev, "Configured port %d for %s\n", port,
|
||||
+ phy_modes(interface));
|
||||
+}
|
||||
+
|
||||
static void b53_adjust_link(struct dsa_switch *ds, int port,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
@@ -1235,6 +1265,9 @@ static void b53_adjust_link(struct dsa_s
|
||||
tx_pause, rx_pause);
|
||||
b53_force_link(dev, port, phydev->link);
|
||||
|
||||
+ if (is63xx(dev))
|
||||
+ b53_adjust_63xx_rgmii(ds, port, phydev->interface);
|
||||
+
|
||||
if (is531x5(dev) && phy_interface_is_rgmii(phydev)) {
|
||||
if (port == dev->imp_port)
|
||||
off = B53_RGMII_CTRL_IMP;
|
||||
@@ -1419,6 +1452,9 @@ void b53_phylink_mac_link_up(struct dsa_
|
||||
{
|
||||
struct b53_device *dev = ds->priv;
|
||||
|
||||
+ if (is63xx(dev) && port >= 4)
|
||||
+ b53_adjust_63xx_rgmii(ds, port, interface);
|
||||
+
|
||||
if (mode == MLO_AN_PHY)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user