Skip to contentSkip to conversation

Few Patches for ARM Specific Codes

U-Boot-Users Hebbar 2 participants 2 messages Dec 18, 2007

lore
Share & tools
lore

Hebbar

author
#0 lore raw

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
------------------------------------------------------------------------------

lib_arm/board.c +18 -0
@@ -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
------------------------------------------------------------------------------

cpu/arm926ejs/start.S +4 -1
@@ -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
-------------------------------------------------------------------

cpu/arm926ejs/config.mk +1 -0
@@ -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
----------------------------------------------------------------------

common/cmd_bdinfo.c +2 -0
@@ -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

Signature · 2 lines
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.
#1 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

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.

Please submit these patches one by one, following the rulkes as outlined in http://www.denx.de/wiki/UBoot/Patches

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A complex system that works is invariably found to have evolved from
a simple system that worked."             - John Gall, _Systemantics_