aboutsummaryrefslogtreecommitdiffstats
path: root/src/pru/main.c
diff options
context:
space:
mode:
authorOleg Gavavka <work@datalink.net.ua>2024-04-27 18:01:57 +0300
committerGitHub <noreply@github.com>2024-04-27 11:01:57 -0400
commitb1eec53ff46d78fad6b41647708b452035b9fe81 (patch)
treeda3b012334bc7520eacc7c8db4a6aca2d5b43d5e /src/pru/main.c
parent0b329c5d28230e8ad19434840bde26f5fd332998 (diff)
downloadkutter-b1eec53ff46d78fad6b41647708b452035b9fe81.tar.gz
kutter-b1eec53ff46d78fad6b41647708b452035b9fe81.tar.xz
kutter-b1eec53ff46d78fad6b41647708b452035b9fe81.zip
pru: BeagleBone Firmware upgrade to Debian 11.7 Bullseye (#6577)
* Porting BeagleBone to Kernel 5.10 * Fixing issue with installation for BeagleBone. This fix resolve 2 issue: 1. Conflict with AVR packages. 2. "klipper_pru" script is executed before PRU cores are ready * Adding additional steps to BeagleBone install guide. * Updating BeagleBone documentation, adding different use cases, adding buses configurations SPI, I2C, CAN, UART Signed-off-by: Oleg Gavavka <work@datalink.net.ua>
Diffstat (limited to 'src/pru/main.c')
-rw-r--r--src/pru/main.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/pru/main.c b/src/pru/main.c
index 27634a12..2127479f 100644
--- a/src/pru/main.c
+++ b/src/pru/main.c
@@ -7,7 +7,7 @@
#include <stdint.h> // uint32_t
#include <pru/io.h> // read_r31
#include <pru_iep.h> // CT_IEP
-#include <pru_intc.h> // CT_INTC
+
#include <rsc_types.h> // resource_table
#include "board/misc.h" // dynmem_start
#include "board/io.h" // readl
@@ -75,7 +75,7 @@ timer_kick(void)
timer_set(timer_read_time() + 50);
CT_IEP.TMR_CMP_STS = 0xff;
__delay_cycles(4);
- CT_INTC.SECR0 = 1 << IEP_EVENT;
+ PRU_INTC.SECR0 = 1 << IEP_EVENT;
}
static uint32_t in_timer_dispatch;
@@ -83,9 +83,9 @@ static uint32_t in_timer_dispatch;
static void
_irq_poll(void)
{
- uint32_t secr0 = CT_INTC.SECR0;
+ uint32_t secr0 = PRU_INTC.SECR0;
if (secr0 & (1 << KICK_PRU1_EVENT)) {
- CT_INTC.SECR0 = 1 << KICK_PRU1_EVENT;
+ PRU_INTC.SECR0 = 1 << KICK_PRU1_EVENT;
sched_wake_tasks();
}
if (secr0 & (1 << IEP_EVENT)) {
@@ -93,7 +93,7 @@ _irq_poll(void)
in_timer_dispatch = 1;
uint32_t next = timer_dispatch_many();
timer_set(next);
- CT_INTC.SECR0 = 1 << IEP_EVENT;
+ PRU_INTC.SECR0 = 1 << IEP_EVENT;
in_timer_dispatch = 0;
}
}
@@ -148,7 +148,7 @@ console_sendf(const struct command_encoder *ce, va_list args)
SHARED_MEM->next_encoder_args = args;
writel(&SHARED_MEM->next_encoder, (uint32_t)ce);
- // Signal PRU0 to transmit message
+ // Signal PRU0 to transmit message - 20 | (18-16) = 22 = 0010 0010
write_r31(R31_WRITE_IRQ_SELECT | (KICK_PRU0_EVENT - R31_WRITE_IRQ_OFFSET));
uint32_t itd = in_timer_dispatch;
while (readl(&SHARED_MEM->next_encoder))
@@ -197,25 +197,6 @@ dynmem_end(void)
return (void*)(8*1024 - STACK_SIZE);
}
-
-/****************************************************************
- * Resource table
- ****************************************************************/
-
-struct my_resource_table {
- struct resource_table base;
-
- uint32_t offset[1]; /* Should match 'num' in actual definition */
-} resourceTable __visible __section(".resource_table") = {
- {
- 1, /* Resource table version: only version 1 is
- * supported by the current driver */
- 0, /* number of entries in the table */
- { 0, 0 }, /* reserved, must be zero */
- },
-};
-
-
/****************************************************************
* Startup
****************************************************************/