mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
- Support ARMv8i / ARM32 (AArch32) baremetal target with arm-linux-gnueabihf toolchain - Implement ARMv8i boot entry point, banked exception mode stacks (IRQ, ABT, UND, SVC) - Implement 8 exception vectors, GICv2 distributor/CPU interface, CP15 Generic Timer (100 Hz), flat Section MMU - Support PL011 UART for early console & interactive LazyBox TTY input - Update Makefile with make armv8i_defconfig and automated cross-compilation - Update scripts/kconfig/menuconfig.py with dedicated armv8i options
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
#ifndef _ARCH_ARMV8I_GIC_H
|
|
#define _ARCH_ARMV8I_GIC_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#define GICD_BASE 0x08000000
|
|
#define GICC_BASE 0x08010000
|
|
|
|
// Distributor Registers
|
|
#define GICD_CTLR (GICD_BASE + 0x000)
|
|
#define GICD_TYPER (GICD_BASE + 0x004)
|
|
#define GICD_IIDR (GICD_BASE + 0x008)
|
|
#define GICD_ISENABLER(n) (GICD_BASE + 0x100 + ((n) * 4))
|
|
#define GICD_ICENABLER(n) (GICD_BASE + 0x180 + ((n) * 4))
|
|
#define GICD_ISPENDR(n) (GICD_BASE + 0x200 + ((n) * 4))
|
|
#define GICD_ICPENDR(n) (GICD_BASE + 0x280 + ((n) * 4))
|
|
#define GICD_IPRIORITYR(n) (GICD_BASE + 0x400 + ((n) * 4))
|
|
#define GICD_ITARGETSR(n) (GICD_BASE + 0x800 + ((n) * 4))
|
|
#define GICD_ICFGR(n) (GICD_BASE + 0xC00 + ((n) * 4))
|
|
|
|
// CPU Interface Registers
|
|
#define GICC_CTLR (GICC_BASE + 0x000)
|
|
#define GICC_PMR (GICC_BASE + 0x004)
|
|
#define GICC_BPR (GICC_BASE + 0x008)
|
|
#define GICC_IAR (GICC_BASE + 0x00C)
|
|
#define GICC_EOIR (GICC_BASE + 0x010)
|
|
|
|
typedef void (*gic_irq_handler_t)(uint32_t irq);
|
|
|
|
void gic_init(void);
|
|
void gic_enable_irq(uint32_t irq);
|
|
void gic_disable_irq(uint32_t irq);
|
|
void gic_set_priority(uint32_t irq, uint8_t prio);
|
|
void gic_register_handler(uint32_t irq, gic_irq_handler_t handler);
|
|
|
|
#endif // _ARCH_ARMV8I_GIC_H
|