Kernel/armv7 - Fixed incorrect addresses in Tegra2 options
authorJohn Hodge <[email protected]>
Sun, 22 Sep 2013 15:46:33 +0000 (23:46 +0800)
committerJohn Hodge <[email protected]>
Sun, 22 Sep 2013 15:46:33 +0000 (23:46 +0800)
KernelLand/Kernel/arch/armv7/include/options.h
KernelLand/Kernel/arch/armv7/platform_tegra2.c

index 9289891..973dabb 100644 (file)
@@ -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
 
index 21ff862..54f5c24 100644 (file)
@@ -6,7 +6,9 @@
  * - Tegra2 Core code
  */
 #include <acess.h>
+#include <timers.h>    // 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);

UCC git Repository :: git.ucc.asn.au