[U-Boot] [PATCH] malta: enable RTC support

Paul Burton paul.burton at imgtec.com
Thu Oct 24 16:30:38 CEST 2013


This is actually required in order for a Linux kernel to boot
successfully on a physical Malta board. Without enabling the RTC, a
Malta Linux kernel will get stuck in its estimate_frequencies function
on boot.

Signed-off-by: Paul Burton <paul.burton at imgtec.com>
---
This is dependant upon my "MIPS Malta board support" series. The line
numbers in include/configs/malta.h will only match up exactly following
Gabor Juhos' "malta: define CONFIG_MEMSIZE_IN_BYTES" patch, but will
apply with or without it.

With this I have verified that Linux boots successfully on a physical
Malta with a coreFPGA6 core card & proAptiv bitstream.
---
 board/imgtec/malta/malta.c | 7 +++++++
 drivers/rtc/mc146818.c     | 2 +-
 include/configs/malta.h    | 5 +++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/board/imgtec/malta/malta.c b/board/imgtec/malta/malta.c
index d876507..a4ded67 100644
--- a/board/imgtec/malta/malta.c
+++ b/board/imgtec/malta/malta.c
@@ -147,6 +147,13 @@ int board_early_init_f(void)
 	return 0;
 }
 
+int misc_init_r(void)
+{
+	rtc_reset();
+
+	return 0;
+}
+
 struct serial_device *default_serial_console(void)
 {
 	switch (malta_sys_con()) {
diff --git a/drivers/rtc/mc146818.c b/drivers/rtc/mc146818.c
index 5f9d359..f7cf106 100644
--- a/drivers/rtc/mc146818.c
+++ b/drivers/rtc/mc146818.c
@@ -15,7 +15,7 @@
 #include <command.h>
 #include <rtc.h>
 
-#ifdef __I386__
+#if defined(__I386__) || defined(CONFIG_MALTA)
 #include <asm/io.h>
 #define in8(p) inb(p)
 #define out8(p, v) outb(v, p)
diff --git a/include/configs/malta.h b/include/configs/malta.h
index a4370ae..492b63a 100644
--- a/include/configs/malta.h
+++ b/include/configs/malta.h
@@ -25,6 +25,10 @@
 #define CONFIG_PCNET_79C973
 #define PCNET_HAS_PROM
 
+#define CONFIG_MISC_INIT_R
+#define CONFIG_RTC_MC146818
+#define CONFIG_SYS_ISA_IO_BASE_ADDRESS	0
+
 /*
  * CPU Configuration
  */
@@ -108,6 +112,7 @@
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_NFS
 
+#define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_PING
-- 
1.8.4




More information about the U-Boot mailing list