From: John Hodge Date: Sun, 22 Sep 2013 15:46:33 +0000 (+0800) Subject: Kernel/armv7 - Fixed incorrect addresses in Tegra2 options X-Git-Tag: rel0.15~179 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=dec34c7d9b2713b08e9cfc853bb013a71f428b31;p=tpg%2Facess2.git Kernel/armv7 - Fixed incorrect addresses in Tegra2 options --- diff --git a/KernelLand/Kernel/arch/armv7/include/options.h b/KernelLand/Kernel/arch/armv7/include/options.h index 9289891a..973dabba 100644 --- a/KernelLand/Kernel/arch/armv7/include/options.h +++ b/KernelLand/Kernel/arch/armv7/include/options.h @@ -23,9 +23,9 @@ #if PLATFORM_is_tegra2 // Tegra2 # define UART0_PADDR 0x70006000 -# define UART0_IRQ 0 -# define GICD_PADDR 0x50041000 +# define UART0_IRQ 36 # define GICI_PADDR 0x50040100 +# define GICD_PADDR 0x50041000 //# define PL110_BASE 0x10020000 // Integrator #endif diff --git a/KernelLand/Kernel/arch/armv7/platform_tegra2.c b/KernelLand/Kernel/arch/armv7/platform_tegra2.c index 21ff862f..54f5c241 100644 --- a/KernelLand/Kernel/arch/armv7/platform_tegra2.c +++ b/KernelLand/Kernel/arch/armv7/platform_tegra2.c @@ -6,7 +6,9 @@ * - Tegra2 Core code */ #include +#include // MicroSleep #include "platform_tegra2.h" +#include "include/options.h" // === CONSTANTS === #define TIMER0_INT (0*32+0) // Pri #0 @@ -22,12 +24,16 @@ extern void Timer_CallTimers(void); // === PROTORTYPES === void Timer_IRQHandler_SysClock(int IRQ, void *_unused); +void Timer_IRQHandler_Timer2(int IRQ, void *_unused); +void Timer_IRQHandler_Timer3(int IRQ, void *_unused); +void Timer_IRQHandler_Timer4(int IRQ, void *_unused); void Time_Setup(void); +tTime Time_GetTickOffset(void); // TODO: move to header // === GLOBALS === // - Addresses for the GIC to use -tPAddr gGIC_InterfaceAddr = 0x50040000; -tPAddr gGIC_DistributorAddr = 0x50041000; +tPAddr gGIC_InterfaceAddr = GICI_PADDR; +tPAddr gGIC_DistributorAddr = GICD_PADDR; // - Map of timer registers volatile struct sTimersMap *gpTimersMap; volatile struct sClockResetMap *gpClockResetMap; @@ -69,6 +75,11 @@ void Time_MicroSleep(Uint16 Microsecs) ; } +tTime Time_GetTickOffset(void) +{ + return (gpTimersMap->TIMERUS.CNTR_1US/1000) % 100; +} + void Time_Setup(void) { gpTimersMap = (void*)MM_MapHWPages(0x60005000, 1);