public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gthomas@redhat.com>
To: Anthony Massa <amassa@san.rr.com>
Cc: eCos <ecos-discuss@sourceware.cygnus.com>
Subject: RE: [ECOS] RedBoot
Date: Wed, 27 Dec 2000 15:32:00 -0000	[thread overview]
Message-ID: <XFMail.20001227163251.gthomas@redhat.com> (raw)
In-Reply-To: <00c701c0703e$778768a0$0200a8c0@cts.com>

[-- Attachment #1: Type: text/plain, Size: 6268 bytes --]

As I expected, the problem is that RedBoot/eCos can't get at the NVRAM
information.  This is because the NVRAM is connected via the I2C interface
and that is broken on the MBX!  I've not been able to figure out how to
make it work reliably.

However, the attached patch should let you get by.  It adds some additional 
information kept by RedBoot.  Basically, run 'fconfig' and enter the ESA 
(MAC) address manually.  Then RedBoot and eCos programs will be able to set 
up the interface properly.

Let me know if this works/helps/...  If so, I'll apply it permanently.

On 27-Dec-2000 Anthony Massa wrote:
> Here is the dump after applying the patch you sent.
> 
> RedBoot(tm) debug environment - built 11:31:22, Dec 27 2000
> Platform: Motorola MBX (PowerPC 860)
> Copyright (C) 2000, Red Hat, Inc.
> 
> RAM: 0x00000000-0x00400000
> FLASH: 0xfe000000 - 0xfe080000, 8 blocks of 0x00010000 bytes each.
> VP: 83A4, EP: 84A4, Code: 8
> 000083A4: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 000083B4: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 000083C4: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 000083D4: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 000083E4: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 000083F4: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008404: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008414: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008424: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008434: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008444: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008454: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008464: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008474: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008484: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> 00008494: FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF   |................|
> IP: 192.168.0.5, Default server: 192.168.0.3
> RedBoot> Ethernet recv:
> 0x0000AA2C: FFFF FFFF FFFF 0060  975B 43B8 0064        |.......`.[C..d  |
> 0x0000AA3A: E0E0 03FF FF00 6000  0400 0000 00FF FFFF   |......`.........|
> 0x0000AA4A: FFFF FF04 5200 0000  0000 6097 5B43 B804   |....R.....`.[C..|
> 0x0000AA5A: 5200 0206 404D 4143  4849 4E45 3254 4F57   |R...@MACHINE2TOW|
> 0x0000AA6A: 4552 0000 0000 0000  0000 0000 0000 0000   |ER..............|
> 0x0000AA7A: 0000 0000 0000 0000  0000 0000 0000 0000   |................|
> 0x0000AA8A: 0000 0000 0000 0000  0000 6097 5B43 B8E8   |..........`.[C..|
> 0x0000AA9A: 8500 0100 EDBD 813C
> 
> 
>>
>>
>> On 27-Dec-2000 Anthony Massa wrote:
>> > That's odd since I can see the correct MAC address from the
>> EPPCbug code.
>>                                                               ^^^^^^^^^^^^
>> But not from eCos/RedBoot, that's where the problem lies.
>>
>> >
>> > I did build this redboot image.  What do I need to do - any
>> help would be
>> > great...
>>
>> Try this patch and let me know what the output is.  This will print some
>> additional information at the point where the driver is trying to find the
>> address information.
>>
>> Index: hal/powerpc/mbx/current/src/hal_aux.c
>> ===================================================================
>> RCS file: /home/cvs/ecc/ecc/hal/powerpc/mbx/current/src/hal_aux.c,v
>> retrieving revision 1.11
>> diff -u -5 -p -r1.11 hal_aux.c
>> --- hal/powerpc/mbx/current/src/hal_aux.c       2000/06/15
>> 14:31:01     1.11
>> +++ hal/powerpc/mbx/current/src/hal_aux.c       2000/12/27 19:10:35
>> @@ -281,10 +281,12 @@ _mbx_fetch_VPD(int code, unsigned char *
>>      int i, len;
>>
>>      _mbx_init_i2c();  // Fetch the data if not already
>>      vp = &_MBX_eeprom_data[0];
>>      ep = &_MBX_eeprom_data[sizeof(_MBX_eeprom_data)];
>> +    diag_printf("VP: %x, EP: %x, Code: %x\n", vp, ep, code);
>> +    diag_dump_buf(vp, 256);
>>      while (vp < ep) {
>>          if (*vp == (unsigned char)code) {
>>              // Found the desired item
>>              len = (int)vp[1];
>>              if (len > size) len = size;
>>
>> >
>> >>
>> >> The problem seems to be that the driver in RedBoot (eCos)
>> can't get at the
>> >> ESA for your board.  It is supposed to do this by accessing
>> some NVRAM on
>> >> the board and then digging it out of a data structure kept by
>> EPPCbug.  If
>> >> eCos can't find the address, it falls back to a hard coded one which is
>> >>   0x08 0x00 0x3E 0x28 0x79 0xB8
>> >>
>> >> Did you build this RedBoot?  Can you?  If so, perhaps we can debug the
>> >> NVRAM code and figure out why it works for me but not for you.
>> >>
>> >> On 23-Dec-2000 Anthony Massa wrote:
>> >> > Gary - thanks for the offer, sorry I took this long to respond,
>> >> but this is
>> >> > the first chance at running something on my hardware
>> platform.  I have
>> >> > attached two different dumps.  The first one is with BOOTP
>> enabled.  The
>> >> > second is with a static IP address of 192.168.0.5.  I also did
>> >> a "ping" from
>> >> > my Windows NT workstation which received a reply from my MBX
>> >> board.  That is
>> >> > shown in the second dump as well.
>> >> >
>> >> > Any help you can give would be greatly appreciated.
>> >> >
>> >> > When I do a NIOT command under eppcbug I get the following
>> information
>> >> > Controller LUN: 20
>> >> > Device LUN: 00
>> >> > Address: FA200A00
>> >> > P-Address: 192.168.0.5
>> >> > H-Address: 08 00 3E 27 5A DC
>> >> >
>> >> > ============================
>> >> > START OF FIRST DUMP - WITH BOOTP ENABLED
>> >> >
>> >> > RedBoot(tm) debug environment - built 09:50:42, Dec 17 2000
>> >> > Platform: Motorola MBX (PowerPC 860)
>> >> > Copyright (C) 2000, Red Hat, Inc.
>> >> >
>> >> > RAM: 0x00000000-0x00400000
>> >> > FLASH: 0xfe000000 - 0xfe080000, 8 blocks of 0x00010000 bytes each.
>> >> > Ethernet send:
>> >> > 0x00004A44: FFFF FFFF FFFF 0800  3E28 79B8 0800
>> >> |........>(y...  |
>> >>                              ^^^^^^^^^^^^^^^
>> >> This is the ESA, but not the correct one for your board.  This
>> is why the
>> >> BOOTP setup does not work.
>> >>
>>

[-- Attachment #2: diffs --]
[-- Type: text/x-diff, Size: 2552 bytes --]

Index: devs/eth/powerpc/quicc/current/src/if_quicc.c
===================================================================
RCS file: /home/cvs/ecc/ecc/devs/eth/powerpc/quicc/current/src/if_quicc.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 if_quicc.c
--- devs/eth/powerpc/quicc/current/src/if_quicc.c	2000/10/24 10:28:33	1.5
+++ devs/eth/powerpc/quicc/current/src/if_quicc.c	2000/12/27 23:27:26
@@ -79,10 +79,22 @@ static unsigned char quicc_eth_rxbufs[CY
 static unsigned char quicc_eth_txbufs[CYGNUM_DEVS_ETH_POWERPC_QUICC_TxNUM]
                                      [CYGNUM_DEVS_ETH_POWERPC_QUICC_BUFSIZE];
 
 static struct quicc_eth_info quicc_eth0_info;
 static unsigned char enaddr[] = { 0x08, 0x00, 0x3E, 0x28, 0x79, 0xB8};
+#ifdef CYGPKG_REDBOOT
+#include <pkgconf/redboot.h>
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#include <redboot.h>
+#include <flash_config.h>
+RedBoot_config_option("Network hardware address [MAC]",
+                      quicc_esa,
+                      ALWAYS_ENABLED, true,
+                      CONFIG_ESA
+    );
+#endif
+#endif
 
 ETH_DRV_SC(quicc_eth0_sc,
            &quicc_eth0_info,   // Driver specific data
            "eth0",             // Name for this interface
            quicc_eth_start,
@@ -134,20 +146,32 @@ quicc_eth_init(struct cyg_netdevtab_entr
 {
     struct eth_drv_sc *sc = (struct eth_drv_sc *)tab->device_instance;
     struct quicc_eth_info *qi = (struct quicc_eth_info *)sc->driver_private;
     volatile EPPC *eppc = (volatile EPPC *)eppc_base();
     struct cp_bufdesc *rxbd, *txbd;
-    unsigned char *RxBUF, *TxBUF, *ep, *ap;
+    unsigned char *RxBUF, *TxBUF, *ep, *ap; 
     volatile struct ethernet_pram *enet_pram;
     volatile struct scc_regs *scc;
     int TxBD, RxBD;
     int cache_state;
     int i;
 
     // Fetch the board address from the VPD
 #define VPD_ETHERNET_ADDRESS 0x08
-    _mbx_fetch_VPD(VPD_ETHERNET_ADDRESS, enaddr, sizeof(enaddr));
+    if (_mbx_fetch_VPD(VPD_ETHERNET_ADDRESS, enaddr, sizeof(enaddr)) == 0) {
+#if defined(CYGPKG_REDBOOT) && \
+    defined(CYGSEM_REDBOOT_FLASH_CONFIG)
+        flash_get_config("quicc_esa", enaddr, CONFIG_ESA);
+#else
+        enet_pram = &eppc->pram[0].enet_scc;
+        ap = &enaddr[sizeof(enaddr)];
+        ep = (unsigned char *)&enet_pram->paddr_h;
+        for (i = 0;  i < sizeof(enaddr);  i++) {
+            *ap++ = *--ep;
+        }
+#endif
+    }
 
     // Ensure consistent state between cache and what the QUICC sees
     HAL_DCACHE_IS_ENABLED(cache_state);
     HAL_DCACHE_SYNC();
     HAL_DCACHE_DISABLE();

  reply	other threads:[~2000-12-27 15:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <00c601c07037$36ec1e50$0200a8c0@cts.com>
2000-12-27 11:12 ` Gary Thomas
2000-12-27 11:53   ` Anthony Massa
2000-12-27 15:32     ` Gary Thomas [this message]
2000-12-27 16:49       ` Anthony Massa
2007-11-19 14:33 Re: [ECOS] redboot Syed Ismail
2007-11-20 20:28 ` Gary Thomas
  -- strict thread matches above, loose matches on Subject: below --
2007-11-19 11:56 Syed Ismail
2007-11-19 13:00 ` Gary Thomas
2007-11-12 11:31 Re: [ECOS] Redboot Syed Ismail
2007-11-12 12:14 ` Gary Thomas
2007-11-12  8:40 Syed Ismail
2007-11-12  8:49 ` Andrew Lunn
2007-11-01 12:16 Syed Ismail
2005-05-20  9:11 [ECOS] RedBoot Yuriy V.
2003-04-18 16:59 [ECOS] redboot rameshs
2003-04-22 17:33 ` Jonathan Larmour
2001-12-26 23:11 [ECOS] RedBoot Gustav Kälvesten
2001-12-26 23:07 satish s mantri
2001-05-07 23:16 [ECOS] redboot mekala natarajan
2001-04-20 10:02 [ECOS] RedBoot Anthony Massa
2001-04-20 10:17 ` Jonathan Larmour
2001-04-19 17:24 Anthony Massa
2001-04-19 19:49 ` Jonathan Larmour
2001-04-20  7:22   ` Anthony Massa
2001-04-20  7:36     ` Jonathan Larmour
2001-04-20 17:24   ` Anthony Massa
2001-04-22 14:38   ` Anthony Massa
2001-04-23 12:09     ` Jonathan Larmour
2001-04-19 16:19 Anthony Massa
2001-04-19 16:31 ` Jonathan Larmour
2001-04-19 16:36   ` Anthony Massa
2001-04-19 19:49     ` Jonathan Larmour
     [not found] <XFMail.20001218160541.gthomas@redhat.com>
     [not found] ` <3A3F957D.4E7868F2@redhat.com>
     [not found]   ` <20001219112529.A26497@sr1.open-widgets.com>
     [not found]     ` <3A3FBAD2.8CD0F487@rhinosys.com>
2001-01-02  6:33       ` [ECOS] Redboot Jesper Skov
     [not found] <002001c0712a$89dad900$0200a8c0@cts.com>
2001-01-01  8:10 ` [ECOS] RedBoot Gary Thomas
2001-01-01 11:38   ` Anthony Massa
2001-01-01 16:16     ` Gary Thomas
2001-01-01 17:45       ` Anthony Massa
     [not found] <003f01c06d3b$50b4ad10$0200a8c0@cts.com>
2000-12-27 10:49 ` Gary Thomas
2000-12-15  5:54 [ECOS] Redboot Doug Fraser
2000-12-09 14:46 Anthony Massa
2000-11-07  7:06 [ECOS] redboot Jörg Rapka
2000-11-07  8:10 ` Gary Thomas

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=XFMail.20001227163251.gthomas@redhat.com \
    --to=gthomas@redhat.com \
    --cc=amassa@san.rr.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).