]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: beagle: beagleplay: Configure debounce registers
authorNishanth Menon <nm@ti.com>
Tue, 20 Feb 2024 18:39:51 +0000 (12:39 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 4 Mar 2024 16:49:24 +0000 (11:49 -0500)
Configure the debounce configuration that makes sense for BeaglePlay
usage model.

Signed-off-by: Nishanth Menon <nm@ti.com>
board/beagle/beagleplay/beagleplay.c

index 2adb2517ef009408628e216207e2fa4474f2a87b..fe1c4f9203293d22f10e2c3abab3a6b9cfefbfe2 100644 (file)
@@ -59,8 +59,32 @@ static void crystal_32k_enable(void)
        }
 }
 
+static void debounce_configure(void)
+{
+       /* Configure debounce one time from R5 */
+       if (IS_ENABLED(CONFIG_CPU_V7R)) {
+               /*
+                * Setup debounce time registers.
+                * arbitrary values. Times are approx
+                */
+               /* 1.9ms debounce @ 32k */
+               writel(0x1, CTRLMMR_DBOUNCE_CFG(1));
+               /* 5ms debounce @ 32k */
+               writel(0x5, CTRLMMR_DBOUNCE_CFG(2));
+               /* 20ms debounce @ 32k */
+               writel(0x14, CTRLMMR_DBOUNCE_CFG(3));
+               /* 46ms debounce @ 32k */
+               writel(0x18, CTRLMMR_DBOUNCE_CFG(4));
+               /* 100ms debounce @ 32k */
+               writel(0x1c, CTRLMMR_DBOUNCE_CFG(5));
+               /* 156ms debounce @ 32k */
+               writel(0x1f, CTRLMMR_DBOUNCE_CFG(6));
+       }
+}
+
 void spl_board_init(void)
 {
        crystal_32k_enable();
+       debounce_configure();
 }
 #endif