From c20e04432415cd064f65864c0fa496db58cdedd3 Mon Sep 17 00:00:00 2001 From: Mayuri Lokhande Date: Sun, 12 Feb 2023 16:09:54 +0530 Subject: [PATCH] Add CPU and platform initial support Issue: #87 #231 --- .../arm/32m/common_v6_v7/supervisor/arch.c | 146 ++++++++++++++++++ .../arm/32m/common_v6_v7/supervisor/asm.S | 81 ++++++++++ .../supervisor/exception_handler.c | 109 +++++++++++++ .../common_v6_v7/supervisor/include/arch.h | 139 +++++++++++++++++ .../32m/common_v6_v7/supervisor/include/arm.h | 67 ++++++++ src/platform/pico/common/arch/platform_mem.c | 29 ++++ src/platform/pico/common/platform.c | 112 ++++++++++++++ .../pico/common/platform/platform_resource.c | 37 +++++ src/platform/pico/common/platform_reset.c | 64 ++++++++ src/platform/pico/common/sections.ld.sx | 26 +++- src/platform/pico/r2040/include/plat_arch.h | 18 +++ 11 files changed, 823 insertions(+), 5 deletions(-) create mode 100644 src/arch/arm/32m/common_v6_v7/supervisor/arch.c create mode 100644 src/arch/arm/32m/common_v6_v7/supervisor/include/arch.h create mode 100644 src/arch/arm/32m/common_v6_v7/supervisor/include/arm.h create mode 100644 src/platform/pico/common/arch/platform_mem.c create mode 100644 src/platform/pico/common/platform.c create mode 100644 src/platform/pico/common/platform/platform_resource.c create mode 100644 src/platform/pico/common/platform_reset.c create mode 100644 src/platform/pico/r2040/include/plat_arch.h diff --git a/src/arch/arm/32m/common_v6_v7/supervisor/arch.c b/src/arch/arm/32m/common_v6_v7/supervisor/arch.c new file mode 100644 index 00000000..8be4539c --- /dev/null +++ b/src/arch/arm/32m/common_v6_v7/supervisor/arch.c @@ -0,0 +1,146 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : arch.c + * Description : This file consists of architecture specific function that + * cannot be inlined. Hence, present in c file. + * Primary Author : Mayuri Lokhande [mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void arch_mcall_handler() +{ + context_frame_t *frame = get_context_frame(); + mret_t mres; + machine_call(frame->r0, frame->r1, frame->r3, &mres); + frame->r0 = mres.p; + frame->r1 = mres.size; + frame->r2 = mres.status; + return; +} + +/** + *arch_early_setup - This function is called in the early stages of boot + * + * @brief This function is respinsible to clean reset cpu status/control registers. + * + */ +void arch_early_setup() +{ + arch_di(); + +} + +/** + * arch_setup - This function is called after initial setup is done + * + * @brief This function is called after initial setup is done. + */ +void arch_setup() +{ + return; +} + +void arch_di_save_state(istate_t *sreg_i_backup) +{ + * +} + +void arch_ei_restore_state(istate_t *sreg_i_backup) +{ + +} + +/** + * arch_core_index - Returns code index + */ + +_WEAK unsigned int arch_core_index() +{ + return 0; +} + +/** + * arch_wfi - wait for interrupt + * + * @brief This function should be called when the program needs to + * wait for interrupt. This also ensures low power consumption when compared to busy wait. + */ +void arch_wfi() +{ + asm volatile("wfi"); +} + +void _NORETURN arch_panic_handler_callback() +{ + context_frame_t *frame; + frame = get_context_frame(); + if(!frame) + goto panic; + syslog_stdout_enable(); + sysdbg("r0=%p\tr1=%p\tr2=%p\tr3=%p\tr4=%p\tr5=%p\n", + frame->r0, frame->r1, frame->r2, frame->r3, frame->r4, frame->r5); + sysdbg("r6=%p\tr7=%p\tr8=%p\tr9=%p\tr10=%p\tr11=%p\n", + frame->r6, frame->r7, frame->r8, frame->r9, frame->r10, frame->r11); + sysdbg("r12=%p\tr13=%p\tr14=%p\tr15=%p\tAPSR=%p\n", + frame->r12, frame->r13, frame->r14, frame->r15, frame->apsr); +#if DEBUG==0 + syslog(info, "APSR=%p\n", frame->apsr); +#endif +panic: + while(1) arch_wfi(); +} + +static cpu_sleep_t sleep_flag; + +/** + * arch_suspended_state_was + * + * @brief This function checks for the suspended state + * and returns true or flase based on arg. + * + * @param[in] state: suspended state + * @return bool: True/False + */ + +bool arch_suspended_state_was(cpu_sleep_t state) +{ + assert(state != resume); + if(!sleep_flag) + return false; + return (sleep_flag == state); +} + +/** + * arch_signal_suspend + * + * @brief This function is intended to be called before cpu enters + * suspend state. By passing the state, we store and use to check while + * exiting resume routine. + * + * @param[in] state: Suspend state of cpu + */ +void arch_signal_suspend(cpu_sleep_t state) +{ + sleep_flag = state; +} + +/** + * @brief This function signals resume of cpu. It is intended + * to be called after exiting resume routine. + */ +void arch_signal_resume(void) +{ + sleep_flag = resume; +} diff --git a/src/arch/arm/32m/common_v6_v7/supervisor/asm.S b/src/arch/arm/32m/common_v6_v7/supervisor/asm.S index e69de29b..b6ecf287 100644 --- a/src/arch/arm/32m/common_v6_v7/supervisor/asm.S +++ b/src/arch/arm/32m/common_v6_v7/supervisor/asm.S @@ -0,0 +1,81 @@ +* + * CYANCORE LICENSE + * Copyrights (C) 2022, Cyancore Team + * + * File Name : asm.S + * Description : This file consists of all the function written in asm + * like ISR, context management and panic handler + * Primary Author : Mayuri Lokhande [mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#include +#include + +/** + * PROLOGUE - A macro that defines context save operation. Saving only argument registers (r0 - r7) + **/ + +.macro PROLOGUE + push r0 + push r1 + MRS r1, APSR + push r1 + push r2 + push r3 + push r4 + push r5 + push r6 + push r7 +.endm + +/** + * EPILOGUE - A macro that defines context restore operation +**/ + +.macro EPILOGUE + pop r7 + pop r6 + pop r5 + pop r4 + pop r3 + pop r2 + pop r1 + MSR APSR, r1 + pop r1 + pop r0 +.endm + + +function int_ /id + push r0 + mov r0, #/id + b isr + +/** + * isr - interrupt service routine function + * @brief This function is called from interrupt router. + * It is responsible to do context management before and after + * calling the interrupt handler function. + */ + +function isr + PROLOGUE + MRS r1, MPS + add r1, #1 + bl exception_handler + EPILOGUE + pop r0 + +/** + * Interrupt Router Declaration Table + * 1-15 Interrupt routers are define as of now. If possible more can + * be added. But during compile time only necessary interrupt router + * functions will be retained and others are cleaned up. + */ +/*==========< Interrupt router functions >==========*/ +.set i, 1 +.rept 15 + INT %i +.set i, i+1 +.endr diff --git a/src/arch/arm/32m/common_v6_v7/supervisor/exception_handler.c b/src/arch/arm/32m/common_v6_v7/supervisor/exception_handler.c index e69de29b..92310a3f 100644 --- a/src/arch/arm/32m/common_v6_v7/supervisor/exception_handler.c +++ b/src/arch/arm/32m/common_v6_v7/supervisor/exception_handler.c @@ -0,0 +1,109 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : interrupt_handler.c + * Description : This file consists of arch interrupt handler sources. + * Primary Author : Mayuri Lokhande [mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static context_frame_t *local_frame; + +static void set_context_frame(*frame) +{ + local_frame = frame; +} + +bool in_isr(void) +{ + return (local_frame != NULL) ? true : false ; +} + +/** + * int_handler - Array of Interrupt handler pointers + * + * @brief This is a function pointer array which consists of addresses of corresponding + * interrupt handler functions. This is by default assigned as arch_panic_handler. + */ +static void (* exhandler[N_EXCEP])(void) = {{[0 ... N_EXCEP-1] = arch_panic_handler}}; + +/** + * arch_register_interrupt_handlers - Registers arch interrupt handlers + * @brief This function is responsible to registers all architectural level + * Interrupt handling functions. + * + * @param[in] id: Interrupt ID + * @param[in] *handler - function pointer of interrupt handling function. + */ + +void arch_register_interrupt_handler(unsigned int id, void(* handler)(void)) +{ + /*Check if Interrupt ID is valid*/ + assert((id > 0) && (id <= N_EXCEP)); + + /* + * Decrement ID as array indexing starts from 0. + * ID = 0 is CPU entry address. + */ + id --; + + /*Store interrupt handler*/ + exhandler[id] = handler; +} + +/** + * Exception handler - Executes Interrupt handler corresponding to int ID + * + * @brief This function is called by ISR. It executes function pointed by int_handler. + * It accepts int ID as argument, which indexes the interrupt handling function. + * + * @param[in] id: Interrupt ID + */ + +void exception_handler(unsigned int id, context_frame_t *frame) +{ + set_context_frame(frame); + + /*Check if Interrupt ID is valid*/ + if((id > 0) && (id <= N_EXCEP)) + { + /* + * Decrement ID as array indexing starts from 0. + * ID = 0 is CPU entry address. + */ + id --; + + /* Get corresponding interrupt handling function */ + void (*handler)(void) = exhandler[id] + + /* Check if the handler is valid*/ + assert(handler) + + /* Execute exception handler */ + handler(); + } + else if(id == 65535) + plat_panic_handler_callback(); + else if(id == 65536) + arch_panic_handler_callback(); + else{} + set_context_frame(NULL); + return; +} + +context_frame_t *get_context_frame() +{ + if(local_frame) + return local_frame; + return NULL; +} diff --git a/src/arch/arm/32m/common_v6_v7/supervisor/include/arch.h b/src/arch/arm/32m/common_v6_v7/supervisor/include/arch.h new file mode 100644 index 00000000..e3122399 --- /dev/null +++ b/src/arch/arm/32m/common_v6_v7/supervisor/include/arch.h @@ -0,0 +1,139 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : arch.h + * Description : This file prototypes arch related functions and + * defines inline-able arch functions. + * Primary Author : Mayuri Lokhande [mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#pragma once +#define _ARCH_H_ + +#include +#include +#include +#include +#include + +/** + * arch_early_setup - This needs to be called in early stages of boot + */ +void arch_early_setup(); + +/** + * arch_setup - This needs to be called after intial setup is completed. + */ +void arch_setup(); + +/** + * arch_wfi - Wait for interrupt, with sleep mode + */ +void arch_wfi(); +void arch_di_save_state(istate *); +void arch_ei_restore_state(istate *); + +/** + * arch_panic_handler - Executes when arch error occurs + */ +void arch_panic_handler(); + +/** + * arch_register_interrupt_handler - Registers interrupt handler for + * arch specific interrupt vectors + */ +void arch_register_interrupt_handler(unsigned int, void(*)(void)); + +/** + * arch_core_index - Returns code index + */ +static inline unsigned int arch_core_index() +{ + unsigned int id; + status_t status; + status = platform_sio_read(0x000 , &id); + if (status == success) + return id; + else + return 0; + +} + +unsigned int arch_core_index(); + +/** + * arch_machine_call - perform machine call + * @brief This function performs environment call + * + * @param[in] code: machine call code + * @param[in] r0: first argument + * @param[in] r1: second argument + * @param[in] r2: third argument + * @param[in] *ret: return struct + */ + +static inline void arch_machine_call(unsigned int code, unsigned int arg0, unsigned int arg1, unsigned int arg2, mret_t *ret) +{ + if(ret == NULL) + return; + register uint32_t r0 asm("r0") = code; + register uint32_t r1 asm("r1") = arg0; + register uint32_t r2 asm("r2") = arg1; + register uint32_t r3 asm("r3") = arg2; + asm volatile("svc" + :"+r" (r0), "+r" (r1), "+r"(r2) + :"r" (r0), "r" (r1), "r" (r2), "r" (r3) + :"memory"); + + ret->p = r0; + ret->size = r1; + ret->status = r2; + return; +} + + /** + * arch_ei - arch enable global interrupts + */ +static inline void arch_ei() +{ + asm volatile("cpsie iaf"); +} + +/** + * arch_ei - arch enable global interrupts + */ +static inline void arch_di() +{ + asm volatile("cpsid iaf"); +} + +static inline void arch_nop() +{ + asm volatile("nop"); +} + +static inline void arch_wfi() +{ + asm volatile("wfi"); +} + +static inline void arch_isb() +{ + asm volatile("isb"); +} + +static inline void arch_dsb() +{ + asm volatile("dsb"); +} + +static inline void arch_dmb() +{ + asm volatile("dmb"); +} + +bool arch_suspended_state_was(cpu_sleep_t); +void arch_signal_suspend(cpu_sleep_t); +void arch_signal_resume(void); diff --git a/src/arch/arm/32m/common_v6_v7/supervisor/include/arm.h b/src/arch/arm/32m/common_v6_v7/supervisor/include/arm.h new file mode 100644 index 00000000..832c0835 --- /dev/null +++ b/src/arch/arm/32m/common_v6_v7/supervisor/include/arm.h @@ -0,0 +1,67 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : arch.h + * Description : This file prototypes arch related functions and + * defines inline-able arch functions. + * Primary Author : Mayuri Lokhande [mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#pragma once +#define _ARM_H +#include +#include +#include + + +typedef struct context_frame +{ + uint8_t r15, r14, r13, r12, r11, r10, r9, r8, + r7, r6, r5, r4, r3, r2, r1, APSR, r0; +}context_frame_t; + +typedef uint32_t istate_t; + +static inline unsigned int arch_core_impid() +{ + unsigned int ret; + asm volatile("cpuid %0, implementer" : "=r"(ret)); + return ret; +} + +static inline unsigned int arch_core_varid() +{ + unsigned int ret; + asm volatile("cpuid %0, varid" : "=r"(ret)); + return ret; +} + +static inline unsigned int arch_core_archid() +{ + unsigned int ret; + asm volatile("cpuid %0, architecture" : "=r"(ret)); + return ret; +} + +static inline unsigned int arch_core_partno() +{ + unsigned int ret; + asm volatile("cpuid %0, partno" : "=r"(ret)); +} + +static inline unsigned int arch_core_revid() +{ + unsigned int ret; + asm volatile("cpuid %0, revision" : "=r"(ret)); +} + +static inline void arch_update_sp(uint32_t *p) +{ + asm volatile("mov sp, %0" : : "r"(p)); +} + +context_frame_t *get_context_frame(); +bool in_isr(void); +void arch_panic_handler_callback(); diff --git a/src/platform/pico/common/arch/platform_mem.c b/src/platform/pico/common/arch/platform_mem.c new file mode 100644 index 00000000..b16f947f --- /dev/null +++ b/src/platform/pico/common/arch/platform_mem.c @@ -0,0 +1,29 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : platform_mem.c + * Description : This file contains implementation of platform early setup APIs. + * Primary Author : Akash Kollipara [akashkollipara@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#include +#include +#include +#include + +extern uintptr_t _bss_start, _bss_size, _data_start, _data_size, + _data_vstart; + +status_t platform_bss_clear() +{ + memset(&_bss_start, 0, (size_t)&_bss_size); + return success; +} + +status_t platform_copy_data() +{ + memcpy(&_data_vstart, &_data_start, (size_t)&_data_size); + return success; +} diff --git a/src/platform/pico/common/platform.c b/src/platform/pico/common/platform.c new file mode 100644 index 00000000..7cc83467 --- /dev/null +++ b/src/platform/pico/common/platform.c @@ -0,0 +1,112 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : platform.c + * Description : This file contains sources for platform apis + * Primary Author : Akash Kollipara [akashkollipara@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +uint32_t reset_syndrome; + +void platform_early_setup() +{ + status_t ret = success; + + /* Setup platform memories*/ + ret |= platform_copy_data(); + ret |= platform_bss_clear(); + ret |= platform_init_heap(); + ret |= platform_resources_setup(); + + /* Setup memory syslogger*/ + driver_setup("mslog"); + + reset_syndrome = MMIO32(CHIP_RESET) & 0x01110100; + MMIO32(CHIP_RESET) = 0; + + ret |= platform_clk_reset(); + + if(ret != success) + exit(EXIT_FAILURE); + return; +} + +#if PRINT_MEMORY_LAYOUT +static void platform_memory_layout() +{ + extern uint32_t _text_start, _text_size, _text_end, + _data_vstart, _data_size, _data_end, + _stack_start, _stack_size, _stack_end, + _bss_start, _bss_size, _bss_end, + _heap_start, _heap_size, _heap_end, + _flash_size, _ram_size; + + syslog(info, "Memory Info >\n"); + syslog(info, "Flash Size : %u\n", &_flash_size); + syslog(info, "RAM Size : %u\n", &_ram_size); + syslog(info, "\n"); + syslog(info, "Program Memory Layout >\n"); + syslog(info, "text Region\t: %06p - %06p : Size: %u\n", + &_text_start, &_text_end, &_text_size); + syslog(info, "bss Region\t: %06p - %06p : Size: %u\n", + &_bss_start, &_bss_end, &_bss_size); + syslog(info, "data Region\t: %06p - %06p : Size: %u\n", + &_data_vstart, &_data_vend, &_data_size); + syslog(info, "stack Region\t: %06p - %06p : Size: %u\n", + &_stack_start, &_stack_end, &_stack_size); + syslog(info, "heap Region\t: %06p - %06p : Size: %u\n", + &_heap_start, &_heap_end, &_heap_size); + syslog(info, "\n"); +} +#endif + +/** + * platform_setup - Executes functions to make platform read to init + * + * @brief This function performs calls to function which make the + * framework ready to execute. This function should be made to run on boot core only. + */ +void platform_setup() +{ + sysdbg3("In %s\n", __func__); + driver_setup("earlycon"); + bootmsgs_enable(); + cyancore_insignia_lite(); +#if PRINT_MEMORY_LAYOUT + platform_memory_layout(); +#endif + return; +} + +/** + * platform_cpu_setup - Perform platform setup calls on all cpus + * + * @brief This function performs calls to functions that should be executed + * on all cores to make the cpu ready for the platform drivers. + */ +void platform_cpu_setup() +{ + sysdbg3("In %s\n", __func__); + arch_ei(); + return; +} + +void _NAKED plat_panic_handler_callback() +{ + context_frame_t *frame; + sysdbg3("In %s\n", __func__); + frame = get_context_frame(); + syslog(info, "SP=%p \tSREG = %P\n", frame, frame->sreg); + exit(EXIT_FAILURE); +} diff --git a/src/platform/pico/common/platform/platform_resource.c b/src/platform/pico/common/platform/platform_resource.c new file mode 100644 index 00000000..c725c3b2 --- /dev/null +++ b/src/platform/pico/common/platform/platform_resource.c @@ -0,0 +1,37 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019-2022, Cyancore Team + * + * File Name : platform_resource.c + * Description : This file contains sources for platform + * resource apis + * Primary Author : Mayuri Lokhande [mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#include +#include +#include +#include +#include +#include +#include + +/** + * platform_resources_setup - Updates platform DP and SP + * + * @brief This function is responsible to update platform DP + * and make it accessible to the system. This function needs to be called + * during platform setup. + * + * @return status: return the function execution status + */ +status_t platform_resources_setup() +{ + status_t ret = success; + extern dp_t device_prop; + extern sp_t software_prop; + ret = dp_init(&device_prop); + ret |= sp_init(&software_prop); + return ret; +} diff --git a/src/platform/pico/common/platform_reset.c b/src/platform/pico/common/platform_reset.c new file mode 100644 index 00000000..77980f1a --- /dev/null +++ b/src/platform/pico/common/platform_reset.c @@ -0,0 +1,64 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : platform_reset.c + * Description : This file contains sources for platform + * reset apis + * Primary Author : Mayuri Lokhande [mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern uint32_t reset_syndrome; +/** + * platform_get_reset_syndrome - returns the cause of reset + * + * @brief This function returns the infromation related to + * the reset sources. + * + * @return reset_cause : This function returns the reset cause + */ + +reset_t platform_get_reset_syndrome() +{ + sysdbg5("Reset Syndrome = %u\n", reset_syndrome); + if(reset_syndrome & (1 << 8)) + return power_on_reset; + + if(reset_syndrome & (1 << 16)) + return external_reset; + + else + return inval_reset; +} + +/** + * platform_reset_handler - handles the reset conditions + * + * @brief This function is responsible to handle the reset + * sources like watchdog , brownout, etxernal reset, etc. + * + * @param[in] rsyn: Reset syndrome + * + * @return void + */ +void platform_reset_handler(reset_t rsyn) +{ + if(rsyn == power_on_reset) + return; + if(rsyn == external_reset) + return; + else + plat_panic_handler(); +} diff --git a/src/platform/pico/common/sections.ld.sx b/src/platform/pico/common/sections.ld.sx index 7097b805..c7acb9a6 100644 --- a/src/platform/pico/common/sections.ld.sx +++ b/src/platform/pico/common/sections.ld.sx @@ -36,8 +36,6 @@ . = ALIGN(ALIGN_BOUND); *(.archvectors) KEEP(*(.archvectors)) - *(.platvectors) - KEEP(*(.platvectors)) . = ALIGN(ALIGN_BOUND); (*.text) (*.text.*) @@ -69,23 +67,41 @@ .driver_table : {} > vma_mem AT > lma_mem .mcall_table : {} > vma_mem AT > lma_mem + .heap : + { + . = ALIGN(ALIGN_BOUND); + *(.heap) + KEEP(*(.heap)) + . = . + HEAP_SIZE; + } > vma_mem + .stack : { . = ALIGN(ALIGN_BOUND); *(.stack) KEEP(*(.stack)) . = . + STACK_SIZE; - } > vma_mem + } > vma_smem + + PROVIDE(_text_start = ADDR(.text)); + PROVIDE(_text_size = SIZEOF(.text)); + PROVIDE(_text_end = _text_start + _text_size - 1); PROVIDE(_data_start = LOADADDR(.data)); PROVIDE(_data_size = SIZEOF(.data) + SIZEOF(.driver_table) + SIZEOF(.mcall_table)); PROVIDE(_data_vstart = ADDR(.data)); - PROVIDE(_data_vend = _data_vstart + _data_size); + PROVIDE(_data_vend = _data_vstart + _data_size - 1); PROVIDE(_bss_start = ADDR(.bss)); PROVIDE(_bss_size = SIZEOF(.bss)); + PROVIDE(_bss_end = _bss_start + _bss_size - 1); + + PROVIDE(_heap_start = ADDR(.heap)); + PROVIDE(_heap_size = SIZEOF(.heap)); + PROVIDE(_heap_end = _heap_start + _heap_size -1); + PROVIDE(_flash_size = _data_size + SIZEOF(.text)); - PROVIDE(_ram_size = _bss_size + _data_size + SIZEOF(.stack)); + PROVIDE(_ram_size = _bss_size + _data_size + SIZEOF(.stack) + SIZEOF(.heap)); ASSERT((_flash_size < FLASH_SIZE), "< x > Flash size exceeded ...") ASSERT((_ram_size < RAM_SIZE), "< x > RAM size exceeded ...") diff --git a/src/platform/pico/r2040/include/plat_arch.h b/src/platform/pico/r2040/include/plat_arch.h new file mode 100644 index 00000000..e402fb79 --- /dev/null +++ b/src/platform/pico/r2040/include/plat_arch.h @@ -0,0 +1,18 @@ +/* + * CYANCORE LICENSE + * Copyrights (C) 2019, Cyancore Team + * + * File Name : plat_arch.h + * Description : This file contains arch specific defines and + * prototypes + * Primary Author : Mayuri Lokhande[mayurilokhande01@gmail.com] + * Organisation : Cyancore Core-Team + */ + +#pragma once +#define _PLAT_ARCH_H_ + +#define _ARM_RP2040_ +#define ARCH_ARM + +#define CHIP_RESET 0x8