public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Question about MBX860  redboot Flash/Ethernet support.
@ 2001-05-18 23:02 Nohee Ko
  2001-05-19  7:06 ` Robin Farine
  0 siblings, 1 reply; 2+ messages in thread
From: Nohee Ko @ 2001-05-18 23:02 UTC (permalink / raw)
  To: ecos-discuss

 hi.
 I ported simple mbx redboot to my mpc860 platform.
my mpc860 platform is different from MBX board but very similiar to
that.

But unfortunately, Flash and Ethernet have not been  supported yet.
 

so I have a few questions about it.

1. MBX860 module uses Flash AM29F040B. But my mpc860 module uses Flash
AM29LV160.
   Because of the difference of used Flash, my mpc860 module is not
working properly when redboot starting.
   "FLASH : driver init failed !" message occurs on debug monitor.
   ( this case happens when RedBoot start with Flash and Ethernet
support . Without Flash support, RedBoot runs well on
    my board).
   So I'd like to know the reason why  "FLASH : driver init failed !"
message occurs on debug monitor.
   Moreover after printing this message, RedBoot stop! . So I can not
test my board using debug monitor any more.
  ( I can't key in any commands to debug monitor)

2. I know I can use ethernet using BOOTP without Flash support.
But I don't understand how it works.
So could you explain it in more detail?

thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Question about MBX860  redboot Flash/Ethernet support.
  2001-05-18 23:02 [ECOS] Question about MBX860 redboot Flash/Ethernet support Nohee Ko
@ 2001-05-19  7:06 ` Robin Farine
  0 siblings, 0 replies; 2+ messages in thread
From: Robin Farine @ 2001-05-19  7:06 UTC (permalink / raw)
  To: Nohee Ko; +Cc: ecos-discuss

"Nohee Ko" <nhko@gctsemi.com> writes:

>  hi.
>  I ported simple mbx redboot to my mpc860 platform.
> my mpc860 platform is different from MBX board but very similiar to
> that.
> 
> But unfortunately, Flash and Ethernet have not been  supported yet.
>  
> 
> so I have a few questions about it.
> 
> 1. MBX860 module uses Flash AM29F040B. But my mpc860 module uses Flash
> AM29LV160.
>    Because of the difference of used Flash, my mpc860 module is not
> working properly when redboot starting.
>    "FLASH : driver init failed !" message occurs on debug monitor.
>    ( this case happens when RedBoot start with Flash and Ethernet
> support . Without Flash support, RedBoot runs well on
>     my board).
>    So I'd like to know the reason why  "FLASH : driver init failed !"
> message occurs on debug monitor.
>    Moreover after printing this message, RedBoot stop! . So I can not
> test my board using debug monitor any more.
>   ( I can't key in any commands to debug monitor)
> 

You can disable flash support with a command like:

  ecosconfig remove CYGPKG_DEVS_FLASH_<platform>

look your ecos.ecc file for the value to substitute to <platform>.

> 
> 2. I know I can use ethernet using BOOTP without Flash support.  But I don't
> understand how it works.  So could you explain it in more detail?
> 

A possible solution uses a hook in "packages/redboot/<ver>/src/net/net_io.c"
(see below between <patch> and </patch>) that lets the application startup
code define its own routine to setup network parameters. Those parameters
consist of RedBoot global variables, such as: __local_ip_addr my_bootp_info
use_bootp and others.

My version of the bootloader (an additional object file added to the standard
RedBoot link objects) defines a RedBoot initializer that assigns the
above-mentioned hook with my own network setup routine.

static void
set_config_hook(void)
{
  net_init_config_hook = setup_net;
}
RedBoot_init(set_config_hook, RedBoot_INIT_FIRST);


HTH,

Robin

<patch>
Index: net_io.c
===================================================================
RCS file: /usr/cvs/eCos/base/packages/redboot/current/src/net/net_io.c,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -U4 -r1.1.1.2 -r1.3
--- net_io.c	2001/04/09 13:50:37	1.1.1.2
+++ net_io.c	2001/04/09 15:12:11	1.3
@@ -517,8 +517,26 @@
 CYG_HAL_TABLE_END( __NETDEVTAB_END__, netdev );
 
 RedBoot_init(net_init, RedBoot_INIT_LAST);
 
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+static void
+read_flash_config(void)
+{
+    // Fetch values from saved config data, if available
+    flash_get_config("net_debug", &net_debug, CONFIG_BOOL);
+    flash_get_config("gdb_port", &gdb_port, CONFIG_INT);
+    flash_get_config("bootp", &use_bootp, CONFIG_BOOL);
+    flash_get_config("bootp_my_ip", &__local_ip_addr, CONFIG_IP);
+    flash_get_config("bootp_server_ip", &my_bootp_info.bp_siaddr, CONFIG_IP);
+}
+
+void (*net_init_config_hook)(void) = read_flash_config;
+#else
+void (*net_init_config_hook)(void);
+#endif
+
+
 void
 net_init(void)
 {
     cyg_netdevtab_entry_t *t;
@@ -526,16 +544,10 @@
     // Set defaults as appropriate
     use_bootp = true;
     net_debug = false;
     gdb_port = CYGNUM_REDBOOT_NETWORKING_TCP_PORT;
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
-    // Fetch values from saved config data, if available
-    flash_get_config("net_debug", &net_debug, CONFIG_BOOL);
-    flash_get_config("gdb_port", &gdb_port, CONFIG_INT);
-    flash_get_config("bootp", &use_bootp, CONFIG_BOOL);
-    flash_get_config("bootp_my_ip", &__local_ip_addr, CONFIG_IP);
-    flash_get_config("bootp_server_ip", &my_bootp_info.bp_siaddr, CONFIG_IP);
-#endif
+    if (net_init_config_hook != (void (*)(void))0)
+      net_init_config_hook();
     have_net = false;
     // Make sure the recv buffers are set up
     eth_drv_buffers_init();
     __pktbuf_init();
</patch>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-19  7:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-18 23:02 [ECOS] Question about MBX860 redboot Flash/Ethernet support Nohee Ko
2001-05-19  7:06 ` Robin Farine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).