From eadd32681787b1828ff92ef5046db6568d52ad55 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 29 May 2018 10:52:11 +0100
Subject: [PATCH 308/454] overlays: Add sdtweak features for network booting

It has been observed that a Pi with no SD card will poll the interface
continuously, using up to 10% CPU. Add some new parameters to the
sdtweak overlay to control this behaviour:

poll_once   Only look for a card once, at boot time. If none is found
            then the interface is effectively disabled.

enable      Set to "off" or "no" to completely disable the interface.

See: https://github.com/raspberrypi/linux/issues/2567

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
---
 arch/arm/boot/dts/overlays/README              | 10 ++++++++++
 arch/arm/boot/dts/overlays/sdtweak-overlay.dts |  2 ++
 2 files changed, 12 insertions(+)

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1618,6 +1618,16 @@ Params: overclock_50            Clock (i
 
         debug                   Enable debug output (default off)
 
+        poll_once               Looks for a card once after booting. Useful
+                                for network booting scenarios to avoid the
+                                overhead of continuous polling. N.B. Using
+                                this option restricts the system to using a
+                                single card per boot (or none at all).
+                                (default off)
+
+        enable                  Set to off to completely disable the interface
+                                (default on)
+
 
 Name:   smi
 Info:   Enables the Secondary Memory Interface peripheral. Uses GPIOs 2-25!
--- a/arch/arm/boot/dts/overlays/sdtweak-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sdtweak-overlay.dts
@@ -19,5 +19,7 @@
 		force_pio        = <&frag0>,"brcm,force-pio?";
 		pio_limit        = <&frag0>,"brcm,pio-limit:0";
 		debug            = <&frag0>,"brcm,debug?";
+		enable           = <&frag0>,"status";
+		poll_once        = <&frag0>,"non-removable?";
 	};
 };
