[U-Boot-Users] Few Patches for ARM Specific Codes

Hebbar gururajakr at sanyo.co.in
Tue Dec 18 12:40:12 CET 2007


Hi,

we are working on a Customized ARM Board. I am trying to port Uboot for the
same board. I found that few patches were required for ARM Specidifc Modules
and below are the few patches that i found usefull.

1. I2C Init func in lib_arm/board.c --> found the same in ppc,blackfin
modules
------------------------------------------------------------------------------

--- u-boot-1.3.1/lib_arm/board.c	2007-12-06 01:21:19.000000000 -0800
+++ uboot/lib_arm/board.c	2007-12-12 19:57:51.296875000 -0800
@@ -84,6 +84,11 @@ extern void cs8900_get_enetaddr (uchar *
 extern void rtl8019_get_enetaddr (uchar * addr);
 #endif
 
+#if defined(CONFIG_HARD_I2C) || \
+    defined(CONFIG_SOFT_I2C)
+#include <i2c.h>
+#endif
+
 /*
  * Begin and End of memory area for malloc(), and current "brk"
  */
@@ -209,6 +214,16 @@ static void display_flash_config (ulong 
 }
 #endif /* CFG_NO_FLASH */
 
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+static int init_func_i2c (void)
+{
+	puts ("I2C:   ");
+	i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+	puts ("ready\n");
+	return (0);
+}
+#endif
+
 /*
  * Breathe some life into the board...
  *
@@ -251,6 +266,9 @@ init_fnc_t *init_sequence[] = {
 #if defined(CONFIG_DISPLAY_BOARDINFO)
 	checkboard,		/* display board info */
 #endif
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+	init_func_i2c,
+#endif
 	dram_init,		/* configure available RAM banks */
 	display_dram_config,
 	NULL,



2. Remove cpu_init_crit module if CONFIG_SKIP_LOWLEVEL_INIT not define. at
present even if CONFIG_SKIP_LOWLEVEL_INIT is not defined, cpu_init_crit  is
defined in uboot\cpu\arm926ejs\start.S
------------------------------------------------------------------------------

--- u-boot-1.3.1/cpu/arm926ejs/start.S	2007-12-06 01:21:19.000000000 -0800
+++ uboot/cpu/arm926ejs/start.S	2007-12-18 20:19:36.296875000 -0800
@@ -187,7 +187,7 @@ clbss_l:str	r2, [r0]		/* clear loop...  
 _start_armboot:
 	.word start_armboot
 
-
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*
  *************************************************************************
  *
@@ -225,6 +225,9 @@ cpu_init_crit:
 	bl	lowlevel_init	/* go setup pll,mux,memory */
 	mov	lr, ip		/* restore link */
 	mov	pc, lr		/* back to my caller */
+	
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
+	
 /*
  *************************************************************************
  *



3.Remove compiler warning: target CPU does not support interworking
-------------------------------------------------------------------
--- u-boot-1.3.1/cpu/arm926ejs/config.mk	2007-12-06 01:21:19.000000000 -0800
+++ uboot/cpu/arm926ejs/config.mk	2007-12-18 20:22:57.093750000 -0800
@@ -31,4 +31,5 @@ PLATFORM_CPPFLAGS += -march=armv4
 #
 # =========================================================================
 PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_CPPFLAGS +=$(call cc-option,-mno-thumb-interwork,)
 PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call
cc-option,-malignment-traps,))



4. Display Ethernet inf in do_bdinfo only if CONFIG_CMD_NET is defined
----------------------------------------------------------------------
--- u-boot-1.3.1/common/cmd_bdinfo.c	2007-12-06 01:21:19.000000000 -0800
+++ uboot/common/cmd_bdinfo.c	2007-12-18 19:46:41.625000000 -0800
@@ -314,6 +314,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int fl
 		print_num("-> size",	bd->bi_dram[i].size);
 	}
 
+#if defined(CONFIG_CMD_NET)
 	puts ("ethaddr     =");
 	for (i=0; i<6; ++i) {
 		printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
@@ -321,6 +322,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int fl
 	puts  ( "\n"
 		"ip_addr     = ");
 	print_IPaddr (bd->bi_ip_addr);
+#endif		
 	printf ("\n"
 		"baudrate    = %d bps\n", bd->bi_baudrate);
 



I welcome comments, complaints, suggestions and advices.

Regards
Gururaja
-- 
View this message in context: http://www.nabble.com/Few-Patches-for-ARM-Specific-Codes-tp14395327p14395327.html
Sent from the Uboot - Users mailing list archive at Nabble.com.





More information about the U-Boot mailing list