ubee: 64 ticks/second and turn on the RTC
authorAlan Cox <alan@linux.intel.com>
Mon, 22 Dec 2014 12:42:14 +0000 (12:42 +0000)
committerAlan Cox <alan@linux.intel.com>
Mon, 22 Dec 2014 12:42:14 +0000 (12:42 +0000)
We'll need the RTC in fact as 64 doesn't divide by 10

Kernel/platform-ubee/config.h
Kernel/platform-ubee/devices.c
Kernel/platform-ubee/main.c

index 63d3962..8263e2e 100644 (file)
@@ -1,3 +1,5 @@
+/* We have an RTC */
+#define CONFIG_RTC
 /* Enable to make ^Z dump the inode table for debug */
 #undef CONFIG_IDUMP
 /* Enable to make ^A drop back into the monitor */
@@ -26,7 +28,7 @@
 #define VT_RIGHT       79
 #define VT_BOTTOM      23
 
-#define TICKSPERSEC 60   /* Ticks per second */
+#define TICKSPERSEC 64   /* Ticks per second */
 #define PROGBASE    0x0000  /* Base of user  */
 #define PROGLOAD    0x0100  /* Load and run here */
 #define PROGTOP     0x7D00  /* Top of program, base of U_DATA stash */
index fdb13ac..7d4f7ca 100644 (file)
@@ -36,6 +36,8 @@ bool validdev(uint16_t dev)
 void device_init(void)
 {
   int i;
+  /* Time of day clock */
+  inittod();
   /* Add 64 swaps (2MB) */
   for (i = MAX_SWAPS - 1 ; i >= 0; i--)
     swapmap_add(i);
index 08dae68..8248ba3 100644 (file)
@@ -57,3 +57,12 @@ void pagemap_init(void)
 #endif
 /* and if we ever poke at the 1024 stuff its bit 7-5/1-0 */
 }
+
+__sfr __at 0x04 rtc_c;
+__sfr __at 0x06 rtc_d;
+
+uint8_t rtc_secs(void)
+{
+       rtc_c = 0x00;
+       return rtc_d;
+}