mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 15:32:33 +00:00
f5919b65d4
Patch generation process: - rebase rpi/rpi-4.14.y on v4.14.89 from linux-stable - git format-patch v4.14.89 Patches skipped during rebase: - lan78xx: Read MAC address from DT if present - lan78xx: Enable LEDs and auto-negotiation - Revert "softirq: Let ksoftirqd do its job" - sc16is7xx: Fix for multi-channel stall - lan78xx: Ignore DT MAC address if already valid - lan78xx: Simple patch to prevent some crashes - tcp_write_queue_purge clears all the SKBs in the write queue - Revert "lan78xx: Simple patch to prevent some crashes" - lan78xx: Connect phy early - Arm: mm: ftrace: Only set text back to ro after kernel has been marked ro - Revert "Revert "softirq: Let ksoftirqd do its job"" - ASoC: cs4265: SOC_SINGLE register value error fix - Revert "ASoC: cs4265: SOC_SINGLE register value error fix" - Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends" - Revert "Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"" Patches dropped after rebase: - net: Add non-mainline source for rtl8192cu wlan - net: Fix rtl8192cu build errors on other platforms - brcm: adds support for BCM43341 wifi - brcmfmac: Mute expected startup 'errors' - ARM64: Fix build break for RTL8187/RTL8192CU wifi - ARM64: Enable RTL8187/RTL8192CU wifi in build config - This is the driver for Sony CXD2880 DVB-T2/T tuner + demodulator - brcmfmac: add CLM download support - brcmfmac: request_firmware_direct is quieter - Sets the BCDC priority to constant 0 - brcmfmac: Disable ARP offloading when promiscuous - brcmfmac: Avoid possible out-of-bounds read - brcmfmac: Delete redundant length check - net: rtl8192cu: Normalize indentation - net: rtl8192cu: Fix implicit fallthrough warnings - Revert "Sets the BCDC priority to constant 0" - media: cxd2880: Bump to match 4.18.y version - media: cxd2880-spi: Bump to match 4.18.y version - Revert "mm: alloc_contig: re-allow CMA to compact FS pages" - Revert "Revert "mm: alloc_contig: re-allow CMA to compact FS pages"" - cxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 with MEDIA_SUBDRV_AUTOSELECT - 950-0421-HID-hid-bigbenff-driver-for-BigBen-Interactive-PS3OF.patch - 950-0453-Add-hid-bigbenff-to-list-of-have_special_driver-for-.patch Make I2C built-in instead of modular as in upstream defconfig; also the easiest way to get MFD_ARIZONA enabled, which is required by kmod-sound-soc-rpi-cirrus. Add missing compatible strings from 4.9/960-add-rasbperrypi-compatible.patch, using upstream names for compute modules. Add extra patch to enable the LEDs on lan78xx. Compile-tested: bcm2708, bcm2709, bcm2710 (with CONFIG_ALL_KMODS=y) Runtime-tested: bcm2708, bcm2710 Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
103 lines
3.5 KiB
Diff
103 lines
3.5 KiB
Diff
From e9ee8ed10620ed2e4474af53cb23058b034a6e56 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
|
|
Date: Fri, 7 Oct 2016 16:50:59 +0200
|
|
Subject: [PATCH 019/454] watchdog: bcm2835: Support setting reboot partition
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
The Raspberry Pi firmware looks at the RSTS register to know which
|
|
partition to boot from. The reboot syscall command
|
|
LINUX_REBOOT_CMD_RESTART2 supports passing in a string argument.
|
|
|
|
Add support for passing in a partition number 0..63 to boot from.
|
|
Partition 63 is a special partiton indicating halt.
|
|
If the partition doesn't exist, the firmware falls back to partition 0.
|
|
|
|
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
|
|
---
|
|
drivers/watchdog/bcm2835_wdt.c | 49 +++++++++++++++++++---------------
|
|
1 file changed, 27 insertions(+), 22 deletions(-)
|
|
|
|
--- a/drivers/watchdog/bcm2835_wdt.c
|
|
+++ b/drivers/watchdog/bcm2835_wdt.c
|
|
@@ -34,13 +34,7 @@
|
|
#define PM_RSTC_WRCFG_SET 0x00000030
|
|
#define PM_RSTC_WRCFG_FULL_RESET 0x00000020
|
|
#define PM_RSTC_RESET 0x00000102
|
|
-
|
|
-/*
|
|
- * The Raspberry Pi firmware uses the RSTS register to know which partition
|
|
- * to boot from. The partition value is spread into bits 0, 2, 4, 6, 8, 10.
|
|
- * Partition 63 is a special partition used by the firmware to indicate halt.
|
|
- */
|
|
-#define PM_RSTS_RASPBERRYPI_HALT 0x555
|
|
+#define PM_RSTS_PARTITION_CLR 0xfffffaaa
|
|
|
|
#define SECS_TO_WDOG_TICKS(x) ((x) << 16)
|
|
#define WDOG_TICKS_TO_SECS(x) ((x) >> 16)
|
|
@@ -97,9 +91,24 @@ static unsigned int bcm2835_wdt_get_time
|
|
return WDOG_TICKS_TO_SECS(ret & PM_WDOG_TIME_SET);
|
|
}
|
|
|
|
-static void __bcm2835_restart(struct bcm2835_wdt *wdt)
|
|
+/*
|
|
+ * The Raspberry Pi firmware uses the RSTS register to know which partiton
|
|
+ * to boot from. The partiton value is spread into bits 0, 2, 4, 6, 8, 10.
|
|
+ * Partiton 63 is a special partition used by the firmware to indicate halt.
|
|
+ */
|
|
+
|
|
+static void __bcm2835_restart(struct bcm2835_wdt *wdt, u8 partition)
|
|
{
|
|
- u32 val;
|
|
+ u32 val, rsts;
|
|
+
|
|
+ rsts = (partition & BIT(0)) | ((partition & BIT(1)) << 1) |
|
|
+ ((partition & BIT(2)) << 2) | ((partition & BIT(3)) << 3) |
|
|
+ ((partition & BIT(4)) << 4) | ((partition & BIT(5)) << 5);
|
|
+
|
|
+ val = readl_relaxed(wdt->base + PM_RSTS);
|
|
+ val &= PM_RSTS_PARTITION_CLR;
|
|
+ val |= PM_PASSWORD | rsts;
|
|
+ writel_relaxed(val, wdt->base + PM_RSTS);
|
|
|
|
/* use a timeout of 10 ticks (~150us) */
|
|
writel_relaxed(10 | PM_PASSWORD, wdt->base + PM_WDOG);
|
|
@@ -117,7 +126,13 @@ static int bcm2835_restart(struct watchd
|
|
{
|
|
struct bcm2835_wdt *wdt = watchdog_get_drvdata(wdog);
|
|
|
|
- __bcm2835_restart(wdt);
|
|
+ unsigned long long val;
|
|
+ u8 partition = 0;
|
|
+
|
|
+ if (data && !kstrtoull(data, 0, &val) && val <= 63)
|
|
+ partition = val;
|
|
+
|
|
+ __bcm2835_restart(wdt, partition);
|
|
|
|
return 0;
|
|
}
|
|
@@ -155,19 +170,9 @@ static void bcm2835_power_off(void)
|
|
of_find_compatible_node(NULL, NULL, "brcm,bcm2835-pm-wdt");
|
|
struct platform_device *pdev = of_find_device_by_node(np);
|
|
struct bcm2835_wdt *wdt = platform_get_drvdata(pdev);
|
|
- u32 val;
|
|
-
|
|
- /*
|
|
- * We set the watchdog hard reset bit here to distinguish this reset
|
|
- * from the normal (full) reset. bootcode.bin will not reboot after a
|
|
- * hard reset.
|
|
- */
|
|
- val = readl_relaxed(wdt->base + PM_RSTS);
|
|
- val |= PM_PASSWORD | PM_RSTS_RASPBERRYPI_HALT;
|
|
- writel_relaxed(val, wdt->base + PM_RSTS);
|
|
|
|
- /* Continue with normal reset mechanism */
|
|
- __bcm2835_restart(wdt);
|
|
+ /* Partition 63 tells the firmware that this is a halt */
|
|
+ __bcm2835_restart(wdt, 63);
|
|
}
|
|
|
|
static int bcm2835_wdt_probe(struct platform_device *pdev)
|