From f739d637291e79ffaacaf2f617642f244ed54a01 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Fri, 13 Dec 2024 11:52:15 -0500 Subject: [PATCH] Use full shared mem on PB2/BeaglePlay --- src/non-gpl/BBB48String/BBB48String.cpp | 4 ++-- src/non-gpl/BBB48String/FalconWS281x.asm | 2 +- src/pru/FalconPRUDefs.hp | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/non-gpl/BBB48String/BBB48String.cpp b/src/non-gpl/BBB48String/BBB48String.cpp index 1cf702424..59ddc72fd 100644 --- a/src/non-gpl/BBB48String/BBB48String.cpp +++ b/src/non-gpl/BBB48String/BBB48String.cpp @@ -667,8 +667,8 @@ void BBB48StringOutput::sendData(FrameData& d, uint32_t* dptr) { } if (fullsize > 0) { int outsize = fullsize; - if (outsize > (12 * 1024)) { - outsize = 12 * 1024; + if (outsize > m_pru->shared_ram_size) { + outsize = m_pru->shared_ram_size; } m_pru->memcpyToPRU(m_pru->shared_ram, d.curData + 7624 + 7624, outsize); } diff --git a/src/non-gpl/BBB48String/FalconWS281x.asm b/src/non-gpl/BBB48String/FalconWS281x.asm index a29ea815b..38cac92a4 100644 --- a/src/non-gpl/BBB48String/FalconWS281x.asm +++ b/src/non-gpl/BBB48String/FalconWS281x.asm @@ -369,7 +369,7 @@ USESHAREDRAM?: LDI32 r9, 0x00010000 LBBO &r10, r9, sram_offset, NUMOUTSTOREAD ADD sram_offset, sram_offset, OUTPUTS - LDI r8, 12188 + LDI r8, (SHM_SIZE-100) QBLT DATALOADED?, r8, sram_offset //reached the end of what we have in other sram, flip to DDR SET bit_flags, bit_flags, 3 diff --git a/src/pru/FalconPRUDefs.hp b/src/pru/FalconPRUDefs.hp index 84e9a1c3e..3df7a9166 100644 --- a/src/pru/FalconPRUDefs.hp +++ b/src/pru/FalconPRUDefs.hp @@ -58,6 +58,9 @@ #define NSPERCLK 5 #define NS2CLK(ns) ((ns) / 5) +#define SHM_SIZE (12 * 1024) + + #elif defined(AM62X) // Refer to this mapping in the file - \prussdrv\include\pruss_intc_mapping.h @@ -101,11 +104,10 @@ #define CTPPR_1 0x2202C -// There is currently a bug in the am62x device trees that are causing -// the PRU to run at 250Mhz instead of 333Mhz. When that is fixed, -// change this to 3 -#define NSPERCLK 4 -#define NS2CLK(ns) ((ns) / 4) +#define NSPERCLK 3 +#define NS2CLK(ns) ((ns) / 3) + +#define SHM_SIZE (32 * 1024) #else