public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hebbar <gururajakr@sanyo.co.in>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users]  Few Patches for ARM Specific Codes
Date: Tue, 18 Dec 2007 03:40:12 -0800 (PST)	[thread overview]
Message-ID: <14395327.post@talk.nabble.com> (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
------------------------------------------------------------------------------

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

             reply	other threads:[~2007-12-18 11:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 11:40 Hebbar [this message]
2007-12-18 16:05 ` [U-Boot-Users] Few Patches for ARM Specific Codes Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14395327.post@talk.nabble.com \
    --to=gururajakr@sanyo.co.in \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox