MPC823 Serial ports
Hi all
I am trying to get the second serial port (SMC2) up and running. I have found that it was removed from arch/ppc/8xx_io/uart.c in the rs_table struct. I have added this again and now the kernel (2.2.5) seems to find it on bootup.
CPM UART driver version 0.02
ttyS00 at 0x0280 is a SMC
ttyS01 at 0x0380 is a SMC
What else do I need to do to get it working as when I echo something to it, I get nothing out of the port.
Thanks in advance
Grant
Signature · 6 lines
Grant Carter [email protected] Department of Electrical Engineering University of Cape Town Tel: +27 (0)21 650-3467 Fax: +27 (0)21 650-3465 "Coffee not found - operator halted!" ** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 7 lines · Grant Carter
Hi all
I am trying to get the second serial port (SMC2) up and running. I have found that it was removed from
arch/ppc/8xx_io/uart.cin thers_tablestruct. I have added this again and now the kernel (2.2.5) seems to find it on bootup.
Yes. I was using SMC2 on the TDM when I made the update. You can enable up to four (because of baud rate generators) serial ports for uarts. Pick any that you want. This will be more configurable in newer versions of the config scripts I am going to check into CVS one of these days.
Quoted 2 lines
What else do I need to do to get it working as when I echo something to it, I get nothing out of the port.
Make sure you have the device nodes in /dev properly defined. They should be:
ttyS0 4,64 ttyS1 4,65 ttyS2 4,66 ttyS3 4,67 -- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Console on SMC2 (was: Re: MPC823 Serial ports)
Quoted 6 lines · Dan Malek
Yes. I was using SMC2 on the TDM when I made the update. You can enable up to four (because of baud rate generators) serial ports for uarts. Pick any that you want. This will be more configurable in newer versions of the config scripts I am going to check into CVS one of these days.
Speaking of SMCs and CVS, attached is a diff adding support for having the boot console on SMC2. Currently I just set CONFIG_SERIAL_CONSOLE_PORT in asm/board.h, but maybe it should be a configuration option?
In uart.c I also fixed the major device of the console. TTYAUX_MAJOR corresponds to the /dev/cua* devices, which are obsolete.
//Marcus
Signature · 145 lines
-------------------------------+------------------------------------
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: [email protected]
===File ~/smc2-console.diff=================================
Index: uart.c
===================================================================
RCS file: /swb/cvs_repository/linux23/arch/ppc/8xx_io/uart.c,v
retrieving revision 1.1.1.4
retrieving revision 1.3
diff -u -r1.1.1.4 -r1.3
--- uart.c 1999/10/13 10:18:29 1.1.1.4
+++ uart.c 1999/10/21 12:44:44 1.3
@@ -2233,7 +2234,7 @@
static kdev_t serial_console_device(struct console *c)
{
- return MKDEV(TTYAUX_MAJOR, 64 + c->index);
+ return MKDEV(TTY_MAJOR, 64 + c->index);
}
@@ -2670,7 +2671,11 @@
* from dual port ram, and a character buffer area from host mem.
*/
up = (smc_uart_t *)&cp->cp_dparam[ser->port];
+#if CONFIG_SERIAL_CONSOLE_PORT == 1
+ cp->cp_pbpar = 0x0c00; /* Enable SMC2 instead of Port B I/O */
+#else
cp->cp_pbpar = 0x00c0; /* Enable SMC1 instead of Port B I/O */
+#endif
/* Allocate space for two buffer descriptors in the DP ram.
*/
@@ -2707,7 +2712,11 @@
/* Send the CPM an initialize command.
*/
+#if CONFIG_SERIAL_CONSOLE_PORT == 1
+ cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC2, CPM_CR_INIT_TRX) | CPM_CR_FLG;
+#else
cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC1, CPM_CR_INIT_TRX) | CPM_CR_FLG;
+#endif
/*
* delay for a bit - this is necessary on my board!
* -- Cort
Index: m8xx_tty.c
===================================================================
RCS file: /swb/cvs_repository/linux23/arch/ppc/mbxboot/m8xx_tty.c,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- m8xx_tty.c 1999/10/01 16:11:54 1.1.1.1
+++ m8xx_tty.c 1999/10/24 12:34:32 1.3
@@ -16,6 +16,18 @@
#include <asm/mpc8xx.h>
#include "../8xx_io/commproc.h"
+#ifndef CONFIG_SERIAL_CONSOLE_PORT
+#define CONFIG_SERIAL_CONSOLE_PORT 0
+#endif
+
+#if CONFIG_SERIAL_CONSOLE_PORT == 1
+# define PROFF_CONSMC PROFF_SMC2
+# define CPM_CR_CH_CON CPM_CR_CH_SMC2
+#else
+# define PROFF_CONSMC PROFF_SMC1
+# define CPM_CR_CH_CON CPM_CR_CH_SMC1
+#endif
+
#ifdef CONFIG_MBX
#define MBX_CSR1 ((volatile u_char *)0xfa100000)
#define CSR1_COMEN (u_char)0x02
@@ -33,8 +45,8 @@
uint dpaddr, memaddr;
cp = cpmp;
- sp = (smc_t*)&(cp->cp_smc[0]);
- up = (smc_uart_t *)&cp->cp_dparam[PROFF_SMC1];
+ sp = (smc_t*)&(cp->cp_smc[CONFIG_SERIAL_CONSOLE_PORT]);
+ up = (smc_uart_t *)&cp->cp_dparam[PROFF_CONSMC];
/* Disable transmitter/receiver.
*/
@@ -96,7 +108,11 @@
/* Set up the baud rate generator.
* See 8xx_io/commproc.c for details.
*/
+#if CONFIG_SERIAL_CONSOLE_PORT == 1
+ cp->cp_simode = 0x00001000;
+#else
cp->cp_simode = 0x10000000;
+#endif
cp->cp_brgc1 =
((((bd->bi_intfreq * 1000000)/16) / bd->bi_baudrate) << 1) | CPM_BRG_EN;
@@ -174,7 +190,7 @@
/* Issue a stop transmit, and wait for it.
*/
- cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC1,
+ cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CON,
CPM_CR_STOP_TX) | CPM_CR_FLG;
while (cp->cp_cpcr & CPM_CR_FLG);
}
@@ -191,7 +207,7 @@
/* Initialize Tx/Rx parameters.
*/
- cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_SMC1, CPM_CR_INIT_TRX) | CPM_CR_FLG;
+ cp->cp_cpcr = mk_cr_cmd(CPM_CR_CH_CON, CPM_CR_INIT_TRX) | CPM_CR_FLG;
while (cp->cp_cpcr & CPM_CR_FLG);
/* Enable transmitter/receiver.
@@ -206,7 +222,7 @@
volatile char *buf;
volatile smc_uart_t *up;
- up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC1];
+ up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONSMC];
tbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_tbase];
/* Wait for last character to go.
@@ -227,7 +243,7 @@
volatile smc_uart_t *up;
char c;
- up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC1];
+ up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONSMC];
rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];
/* Wait for character to show up.
@@ -246,7 +262,7 @@
volatile cbd_t *rbdf;
volatile smc_uart_t *up;
- up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC1];
+ up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_CONSMC];
rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];
return(!(rbdf->cbd_sc & BD_SC_EMPTY));
============================================================
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/Re: Console on SMC2 (was: Re: MPC823 Serial ports)
Quoted 4 lines · Marcus Sundberg
Speaking of SMCs and CVS, attached is a diff adding support for having the boot console on SMC2. Currently I just set
CONFIG_SERIAL_CONSOLE_PORTinasm/board.h, but maybe it should be a configuration option?
Yes, I am working on that. It will appear in my next CVS update. I have tried many different versions, and it appears the one that works the best is just a simple ask the questions version. I tried to make it smart about processor versions, what you are using for Ethernet, etc., and in the end the only one that seems to work is asking the individual questions about how you want ports configured.
I also have code for consoles on the SCC ports, and it needs a little more testing. I have a board showing up this week that should allow me to test that properly.
Quoted 1 line
In
uart.cI also fixed the major device of the console.
The console (as in /dev/console) is currently a symbolic link to the appropriate /dev/ttySx. Should we change that to be dynamically allocated?
Quoted 1 line
TTYAUX_MAJORcorresponds to the/dev/cua*devices, which are obsolete.
Yes, but be careful we need to change the device nodes in the file systems......
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Console on SMC2 (was: Re: MPC823 Serial ports)
In reply to Marcus SundbergHi Marcus,
Quoted 1 line · Marcus Sundberg
TTYAUX_MAJORcorresponds to the/dev/cua*devices, which are obsolete.
Could you please clarify what you mean here? Are you saying that the /dev/cua* devices are obsolete? If so, what's the replacement?
Thanks,
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Console on SMC2 (was: Re: MPC823 Serial ports)
They were replaced by /dev/ttyS*.
Quoted 10 lines
Hi Marcus,
Quoted 1 line · Marcus Sundberg
TTYAUX_MAJORcorresponds to the/dev/cua*devices, which are obsolete.Could you please clarify what you mean here? Are you saying that the
/dev/cua*devices are obsolete? If so, what's the replacement?Thanks,
Graham
Noah Misch
[email protected]
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Console on SMC2 (was: Re: MPC823 Serial ports)
Quoted 1 line · Noah Misch
They were replaced by
/dev/ttyS*.
On our Linux 2.2 Intel boxes, opening /dev/ttyS* blocks until the modem control lines become active if the port is in non-CLOCAL mode, whereas /dev/cua* doesn't. Since you can't change mode without opening the device, /dev/cua* is required to avoid the chicken-and-egg problem. Have the semantics of /dev/ttyS* changed to remove the need for /dev/cua*?
Thanks,
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Console on SMC2 (was: Re: MPC823 Serial ports)
In reply to a message not in the archiveQuoted 7 lines · [email protected] (Graham Stoney) writes:
Hi Marcus,
Quoted 1 line · Marcus Sundberg
TTYAUX_MAJORcorresponds to the/dev/cua*devices, which are obsolete.Could you please clarify what you mean here? Are you saying that the
/dev/cua*devices are obsolete?
Yes, has been so since before 2.2.0 IIRC.
Quoted 3 lines
If so, what's the replacement?
From linux/Documentation/Changes:
Also, please remember that cua* devices are now obsolete. Switch to
the corresponding ttyS* device instead (e.g., cua0 -> ttyS0, cua1 -> ttyS1, etc.).
//Marcus
Signature · 6 lines
-------------------------------+------------------------------------
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: [email protected]
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/Re: Console on SMC2 (was: Re: MPC823 Serial ports)
In reply to Dan MalekQuoted 7 lines · Dan Malek
Quoted 4 lines · Marcus Sundberg
Speaking of SMCs and CVS, attached is a diff adding support for having the boot console on SMC2. Currently I just set
CONFIG_SERIAL_CONSOLE_PORTinasm/board.h, but maybe it should be a configuration option?
Quoted 7 lines
Yes, I am working on that. It will appear in my next CVS update. I have tried many different versions, and it appears the one that works the best is just a simple ask the questions version. I tried to make it smart about processor versions, what you are using for Ethernet, etc., and in the end the only one that seems to work is asking the individual questions about how you want ports configured.
It would be nice if we had "Board default" as an option for the boot console (or as an alternative - make Config.in set the correct default device when you change boards).
Quoted 3 lines
I also have code for consoles on the SCC ports, and it needs a little more testing. I have a board showing up this week that should allow me to test that properly.
I hope you will include an option to completely disable serial ports on SCCs without changing uart.c too?
Quoted 4 lines
Quoted 1 line
In
uart.cI also fixed the major device of the console.The console (as in
/dev/console) is currently a symbolic link to the appropriate/dev/ttySx.
Well, not on any correct system running 2.1.71 or later. ;)
Quoted 1 line
Should we change that to be dynamically allocated?
I'm already running with /dev/console == char (5,1) as should be. It works fine with 8xx kernels regardless of whether TTYAUX_MAJOR or TTY_MAJOR is used for the console, except that I get the
"tty_io.c: process %d (%s) used obsolete /dev/%s - " "update software to use /dev/ttyS%d\n"
warning when my init script starts if it uses TTYAUX_MAJOR.
Quoted 4 lines
Quoted 1 line
TTYAUX_MAJORcorresponds to the/dev/cua*devices, which are obsolete.Yes, but be careful we need to change the device nodes in the file systems......
That should be done anyway, but is it really mandatory? Would anything break for people who have /dev/console as a symlink if the console used TTY_MAJOR instead?
//Marcus
Signature · 6 lines
-------------------------------+------------------------------------
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: [email protected]
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/Re: Console on SMC2 (was: Re: MPC823 Serial ports)
Quoted 3 lines · Marcus Sundberg
It would be nice if we had "Board default" as an option for the boot console (or as an alternative - make Config.in set the correct default device when you change boards).
Yeah, I know, but as I have said before, I have more than a dozen different boards in my office, all somewhat different. The configuration files get increasingly complex with all of these different possibilities. Having separate default configurations where the only difference is the console port is kind of overkill. Right now, you have to know where the console port is connected, and simply select it. I am trying to find a simple configuration that will work with all boards, rather than track lots of different ones.
Quoted 2 lines
I hope you will include an option to completely disable serial ports on SCCs without changing
uart.ctoo?
I can easily add that.
Quoted 1 line
Well, not on any correct system running 2.1.71 or later. ;)
If you say so. I didn't make any 8xx changes until later releases, and the standard distribution had a symbolic link, so I just kept that......
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Console on SMC2 (was: Re: MPC823 Serial ports)
Quoted 7 lines · Dan Malek
Quoted 3 lines · Marcus Sundberg
It would be nice if we had "Board default" as an option for the boot console (or as an alternative - make Config.in set the correct default device when you change boards).
Quoted 9 lines
Yeah, I know, but as I have said before, I have more than a dozen different boards in my office, all somewhat different. The configuration files get increasingly complex with all of these different possibilities. Having separate default configurations where the only difference is the console port is kind of overkill. Right now, you have to know where the console port is connected, and simply select it. I am trying to find a simple configuration that will work with all boards, rather than track lots of different ones.
Yes, that is the right way to go for the distribution kernel. Howver, we have several different boards here too, and personally I'd perfer if I could just select the CPU and board type at configuration time, and have the rest taken from my board specific file. This could be allowed even if the board files in the distribution doesn't use this feature.
//Marcus
Signature · 6 lines
-------------------------------+------------------------------------
Marcus Sundberg | http://www.stacken.kth.se/~mackan/
Royal Institute of Technology | Phone: +46 707 295404
Stockholm, Sweden | E-Mail: [email protected]
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/FEC ERROR 41200000 on CLLF-860T
Hi gang,
I'm using the linux-2.2.13 kernel from the linuxppc.cs.nmt.edu on a couple of Embedded Planet CLLF-860T boards, and I'm wondering if anyone can explain the following messages from the FEC for me please:
FEC ERROR 41200000
FEC ENET: rcv is not +last
Is this something I should be worried about?
Thanks!
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 4 lines · Graham Stoney
FEC ERROR 41200000
FEC ENET: rcv is not +lastIs this something I should be worried about?
Oh yes.....I don't have the FEC driver updated for that board yet. Although my instructions tell you how to download through that port and get the CLLF utility program to initialize it because I have been too lazy, something still isn't quite right.
If it appears to be working, then just keep smiling and go on about your business. Don't try any performance tests.......
That particular error looks legitimate. Probably some kind of a hard network error. Since the buffer wasn't marked as +last, it looks like someone is jumping on the bus with late collisions or something. How often does it occur?
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 5 lines · Dan Malek
Oh yes.....I don't have the FEC driver updated for that board yet. Although my instructions tell you how to download through that port and get the CLLF utility program to initialize it because I have been too lazy, something still isn't quite right.
I've got the kernel to boot thanks to your instructions, and it does keep running after the error appears. I notice that the fec driver in the 2.3.18 kernel is a little different, but I haven't managed to get that kernel to run at all yet, so I'm hanging with 2.2.13 at least for now.
Quoted 2 lines
If it appears to be working, then just keep smiling and go on about your business. Don't try any performance tests.......
Hmmm... performance tests are something I'm thinking about trying pretty soon!
Quoted 4 lines
That particular error looks legitimate. Probably some kind of a hard network error. Since the buffer wasn't marked as +last, it looks like someone is jumping on the bus with late collisions or something. How often does it occur?
Every couple of minutes or so; it seems to happen most during NFS traffic. I haven't really hunted it hard yet though.
Thanks,
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 3 lines · Graham Stoney
.... I notice that the fec driver in the 2.3.18
kernel is a little different, but I haven't managed to get that kernel to run at all yet, so I'm hanging with 2.2.13 at least for now.
Yes, I have learned the importance of being able to start and shutdown network drivers (the SCC doesn't do this). The FEC also has to be configured for half/full duplex, and this we must get the link change interrupts to detect this. If you never disconnect the Ethernet, this wouldn't be necessary, but that isn't real life. The drivers are changing to accomodate all of these things.
Quoted 1 line
Hmmm... performance tests are something I'm thinking about trying pretty soon!
Keep in mind that both the SCC and FEC Ethernet can send and receive back-to-back packets. They also have some tuning parameters for things like backoff timers to be more friendly on the network, and for SDMA system performance. The SCC Ethernet on a 50 MHz 860 can easily maintain the theoretical network limits between 8 and 9 Mbit/sec with the TCP/IP stack.
I could never understand why people use this as a "benchmark" as it is more important what you do with the data when you receive it or before you send it. This is a function of your task and the speed of the processor. There are no bounded latency guarantees or predictable behavior with Ethernet, so why try to use it like that?
The SCC and FEC will send packets as fast as you can create them, and will discard packets if you can't keep up. They provide efficient burst mode DMA and off load the PPC core. What more do you need to know?
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 1 line · Dan Malek
The drivers are changing to accomodate all of these things.
Sounds great; I'd be interested in testing an update whenever it's doable.
Quoted 2 lines
The SCC Ethernet on a 50 MHz 860 can easily maintain the theoretical network limits between 8 and 9 Mbit/sec with the TCP/IP stack.
We're using the FEC exclusively, and I'm hoping for a similar story at around 8 Mbytes/sec with the TCP/IP stack.
Quoted 6 lines
I could never understand why people use this as a "benchmark" as it is more important what you do with the data when you receive it or before you send it. This is a function of your task and the speed of the processor. There are no bounded latency guarantees or predictable behavior with Ethernet, so why try to use it like that?
You're absolutely right, of course: what matters here is system throughput in which the Ethernet is just one link. Our system is heavily pipelined all the way from the remote application down to the lowest hardware level. So long as none of the links in the pipeline stalls long enough to become the bottleneck, all the data should fly through nicely. Buffering in the various pipeline stages (including the TCP/IP buffers) affects how far a stall will propagate back up the pipeline. As you say, the important part here is what we do with the data when we receive it and before we send it; if we get that right, the ethernet link throughput will fall out in the wash.
Regards,
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
In reply to a message not in the archiveQuoted 10 lines · [email protected] (Graham Stoney) writes:
Quoted 1 line · Dan Malek
The drivers are changing to accomodate all of these things.
Sounds great; I'd be interested in testing an update whenever it's doable.
Quoted 2 lines
The SCC Ethernet on a 50 MHz 860 can easily maintain the theoretical network limits between 8 and 9 Mbit/sec with the TCP/IP stack.
We're using the FEC exclusively, and I'm hoping for a similar story at around 8 Mbytes/sec with the TCP/IP stack.
Well, that you can probably forget. :-(
Using a program that sends 1500 bytes udp packets as fast as it can we get 22-23 Mbit throughput (50MHz 860T).
On vxworks the same program gives about 27 Mbit throughput, and Windriver claims this is a limitation in the hardware...
(Our PII server connected to the same hub gives about 91 Mbit)
//Marcus
Signature · 3 lines
Signature under construction, please come back later. ** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 2 lines · Marcus Sundberg
On vxworks the same program gives about 27 Mbit throughput, and Windriver claims this is a limitation in the hardware...
Of course they would. There are lots of stories floating around about the 8xx hardware limitations. There are manual pages and application notes that describe how the 8xx hardware works (in particular the CPM), and how you compute the capabilities. In my experience, it has lived up to the publications. You can do things that are simply inefficient, or think about the system architecture or application and program it to do the things it can perform.
Even if it is "only" 20 something Mbits, how does that affect your application? That is more than double what Graham was expecting for his.
Remember Ethernet is a shared resource without any deterministic or bandwidth guarantees. If it doesn't meet your requirements, perhaps you should choose from the variety of other interfaces the 8xx provides.
It can run an infinite loop as fast as anything else........
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 3 lines · Dan Malek
Even if it is "only" 20 something Mbits, how does that affect your application? That is more than double what Graham was expecting for his.
No, Graham was expecting/hoping for 8 M _bytes_, not bits. So in fact it's actual performance is about 1/3 of that, which I pointed out to him.
//Marcus
Signature · 3 lines
Signature under construction, please come back later. ** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 3 lines · Marcus Sundberg
No, Graham was expecting/hoping for 8 M _bytes_, not bits. So in fact it's actual performance is about 1/3 of that, which I pointed out to him.
Marcus is right; we'd like to use all the bandwidth available on the FEC for optimal system performance. Can anyone elaborate or provide pointers to more information on the FEC throughput issue? Is there really a hardware problem in the CPU, or is it a board specific issue?
Thanks,
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
Quoted 1 line · Graham Stoney
Marcus is right;
My apologies.
Quoted 3 lines
....... Can anyone elaborate or provide pointers to more information on the FEC throughput issue? Is there really a hardware problem in the CPU, or is it a board specific issue?
The FEC must transfer data at the Ethernet rate because it doesn't have enough FIFO for an entire packet (it has some clever optimizations for collision and retrasmit). The SDMA is always to system memory, so if the buffers are there, the bits will fly.
It all comes down to what your application is doing, and if the PPC core has enough computes to provide buffers at the rate you require. I am sure I can write a demo application that will run at the maximum rate, and maybe it will represent what you are trying to accomplish......I am working on it.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: FEC ERROR 41200000 on CLLF-860T
In reply to a message not in the archiveQuoted 9 lines · [email protected] (Graham Stoney) writes:
Quoted 3 lines · Marcus Sundberg
No, Graham was expecting/hoping for 8 M _bytes_, not bits. So in fact it's actual performance is about 1/3 of that, which I pointed out to him.
Marcus is right; we'd like to use all the bandwidth available on the FEC for optimal system performance. Can anyone elaborate or provide pointers to more information on the FEC throughput issue? Is there really a hardware problem in the CPU, or is it a board specific issue?
I did some more quick testing.
The bottleneck seems to be the context-switching of Linux. When increasing the amount of data sent per sendto() call to 11k I got 41Mbit, and with 22k I got 46Mbit. If bandwidth is very important, maybe you should consider using an 80MHz 860P instead of the 860T.
//Marcus
Signature · 3 lines
Signature under construction, please come back later. ** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Linux ABI documents and powerpc supplements.
To linuxppc developers,
Kai Ruottu (who contributes a hell of a lot on the crossgcc mailing list and who cross-compiles for many targets including i586-cygwin, i586-mingw, powerpc-linux, powerpc-eabi, sparc-linux, arm-linux, etc) had some questions about Linux ABIs and powerpc supplements. I have forwarded the entire email. Hopefully someone can point him to any relevant docs and/or answer his questions. Most of his questions are towards the end of this email.
Thanks,
Brendan Simon.
Quoted 179 lines · Kai Ruottu
Quoted 11 lines · Brendan J Simon
Quoted 7 lines · Kai Ruottu
1. Using 'strings' to see the 'hard-wired' name of the dynamic linker in the executable:
E:\usr\local\samples>strings tst_ppc-linux.x | more /lib/ld.so.1 <------- !!! __gmon_start__ libc.so.6Quoted 5 lines
The output of "powerpc-linux-strings bjs1-shared" looks OK to me.
$ powerpc-linux-strings bjs1-shared _DYNAMIC _GLOBAL_OFFSET_TABLE_ __gmon_start__When your output from 'strings' didn't show the 'ld.so.1' (didn't it really?)
I tried removing the '--dynamic-linker xxxxx' from my specs, and got then :E:\usr\local\samples>strings tst_ppc-linux.x | more /usr/lib/ld.so.1 <------- !!!! __gmon_start__ libc.so.6This could be the right place for 'ld.so.1' in a Linux/PPC-system and my
powerpc-linux executables have been this far just insane... (I should never guess these things or trust my memory...)Quoted 16 lines
I'm not sure how to interpret the output of "powerpc-linux-objdump -p bjs1-shared". The output is :
$ powerpc-linux-objdump -p bjs1-shared <snip> Dynamic Section: NEEDED libc.so.6 INIT 0x610 <----- !!!! FINI 0x634 <----- !!!! HASH 0x94 STRTAB 0x310 SYMTAB 0x150 PLTGOT 0x40748 JMPREL 0x48c RELA 0x420 VERNEED 0x400 VERSYM 0x3c8The addresses look to be too small, those from my 'ppc-linux-gnu' are all over
'0x10000000' :Dynamic Section: NEEDED libc.so.6 NEEDED ld.so.1 INIT 0x100011f0 FINI 0x10001214 HASH 0x10000150 STRTAB 0x1000027c SYMTAB 0x1000019c PLTGOT 0x10011990 JMPREL 0x10000368 RELA 0x10000368 VERNEED 0x10000348 VERSYM 0x1000032awhich is the result of the default linker script (elf32ppclinux.x) :
SECTIONS { /* Read-only sections, merged into text segment: */ . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) }What should the base address be for a Linux/PPC executable?
Quoted 23 lines
I don't see anything strange here. I did the same for libc.so.6
$ powerpc-linux-objdump -p lib/libc.so.6 <snip> Version definitions: 1 0x01 0x0865f4e6 libc.so.6 2 0x00 0x0d696910 GLIBC_2.0 3 0x00 0x0d696911 GLIBC_2.1 GLIBC_2.0Version References:
required from ld.so.1:0x0d696911 0x00 05 GLIBC_2.1 0x0d696910 0x00 04 GLIBC_2.0And again for ld.so.1
$ powerpc-linux-objdump -p lib/ld.so.1 <snip> Version definitions: 1 0x01 0x0275a261 ld.so.1 2 0x00 0x0d696910 GLIBC_2.0 3 0x00 0x0d696911 GLIBC_2.1 GLIBC_2.0Quoted 2 lines
I don't see anything glaringly wrong but I don't exactly know what I would be looking for. Can you see any problems ?
Do you have just the same 'libc.so.6', 'ld.so.1' etc. in the cross-tools and in the
run-time environment? Your executable seems to be linked using some glibc-2.1.x libs, but do you have the same libs in the run-time target board? Or just some smaller and older ones ? (Recently someone somewhere wondered why the glibc-2.1.x libs are so big when the older 2.0.6 ones were much smaller...).Better to use the older ones at least when linking...
The generic rule is that one cannot run executables which were linked against newer
shared libs, using older shared libs at run-time. No forwards-compatibility expected. But all executables linked against older libs should run with newer shared libs. This kind of backwards-compatability is always expected... At least between two releases.Quoted 3 lines
Quoted 2 lines
Perhaps the new 'readelf' utility in binutils can be used for sanity checks
of the same kind...Never heard of it. Is it part of binutils-2.9.1 or newer cvs and snapshots ?
It is included with the new snapshots (perhaps almost a year now) :
E:\usr\local\ppc-linux-gnu\bin>readelf --version
GNU readelf 991116
Copyright 1997, 1998, 1999 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty.And the 'elf32ppclinux' support appeared to them some time ago :
E:\usr\local\ppc-linux-gnu\bin>ld -V
GNU ld version 2.9.5 (with BFD 991116)
Supported emulations:
elf32ppclinux
elf32ppcThe difference between 'elf32ppc' and 'elf32ppclinux' was discussed some time ago,
but the only difference seems to be the base address, here is a clip from the default linker script for elf32ppc :SECTIONS { /* Read-only sections, merged into text segment: */ . = 0x01800000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) }If the default linker script for 'elf32ppclinux' says in the same lines :
SECTIONS { /* Read-only sections, merged into text segment: */ . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) }So I'll repeat my question: "What should the base address to be for a Linux/PPC
executable?"Or doesn't it really matter if there is a '. = 0', '. =
0x01800000' or a '. =0x10000000'
in the line after the comment?For all ELF/x86-systems the base address seems to be the same, but for MIPS, SPARC
etc. it seems to vary between different ELF-systems... The SVR4/PowerPC ABI Supplement talks about '0x02000000' as the base address and the '/usr/lib/ld.so.1' is also the 'program interpreter' or the 'dynamic linker' there...BTW, is there something equivalent for Linux/PPC as there is for the never-seen
SVR4/PPC, the "System V Application Binary Interface, PowerPC Processor Supplement", by Steve Zucker and Kari Karhi? Sometimes it sounds very funny when there seems to be no free docs for the "Free Linux" (only those "For Dummies" things), but quite a lot for the commercial SVR4 (e.g. via 'www.sco.com/developer/devspecs').A document with the name "Linux Application Binary Interface, PowerPC Processor
Supplement" seems to be still missing... For Linux/ARM, Linux/Alpha, Linux/MIPS, Linux/M68K too... Isn't there any yet for Linux/x86? (Who said that MS tries to hide the Windows ABI...). Some day all the money went to RedHat & Co. should be converted into some docs... Meanwhile the SVR4-ABI docs, the ARM-ELF-ABI, DWARF etc. docs seem to be the only for Linux. And the GNU sources of course, but who really likes to read everything from the sources...
Quoted 3 lines
Ok, if there were some nice PDF etc. docs for Linux/* ABIs, there could be much less
misunderstandings and much less trouble to find these 'base' things... But surely more answers with the advice about 'RTFM'....
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: Linux ABI documents and powerpc supplements.
0x10000000 + SIZEOF_HEADERS is the current recommended base address for Linux/PPC. It was changed sometime ago from 0x1800000 to better support running the binaries on AIX. On Linux we use /lib/ld.so.1, Linux overrules the SYSV ABI here. The size of the libraries if you are talking about the standard Linux/PPC ones is due to a bug in 'strip' which tends to corrupt the libraries.
The most current documentation I know of is in <ftp://sourceware.cygnus.com/pub/binutils/ppc-docs/>
Franz.
Am Wed, 05 Jan 2000 schrieb Brendan J Simon:
Quoted 9 lines
To linuxppc developers,
Kai Ruottu (who contributes a hell of a lot on the crossgcc mailing list and who cross-compiles for many targets including i586-cygwin, i586-mingw, powerpc-linux, powerpc-eabi, sparc-linux, arm-linux, etc) had some questions about Linux ABIs and powerpc supplements. I have forwarded the entire email. Hopefully someone can point him to any relevant docs and/or answer his questions. Most of his questions are towards the end of this email.
Quoted 190 lines
Thanks,
Brendan Simon.Quoted 182 lines · Kai Ruottu
Quoted 11 lines · Brendan J Simon
Quoted 7 lines · Kai Ruottu
1. Using 'strings' to see the 'hard-wired' name of the dynamic linker in the executable:
E:\usr\local\samples>strings tst_ppc-linux.x | more /lib/ld.so.1 <------- !!! __gmon_start__ libc.so.6Quoted 5 lines
The output of "powerpc-linux-strings bjs1-shared" looks OK to me.
$ powerpc-linux-strings bjs1-shared _DYNAMIC _GLOBAL_OFFSET_TABLE_ __gmon_start__When your output from 'strings' didn't show the 'ld.so.1' (didn't it really?)
I tried removing the '--dynamic-linker xxxxx' from my specs, and got then :E:\usr\local\samples>strings tst_ppc-linux.x | more /usr/lib/ld.so.1 <------- !!!! __gmon_start__ libc.so.6This could be the right place for 'ld.so.1' in a Linux/PPC-system and my
powerpc-linux executables have been this far just insane... (I should never guess these things or trust my memory...)Quoted 16 lines
I'm not sure how to interpret the output of "powerpc-linux-objdump -p bjs1-shared". The output is :
$ powerpc-linux-objdump -p bjs1-shared <snip> Dynamic Section: NEEDED libc.so.6 INIT 0x610 <----- !!!! FINI 0x634 <----- !!!! HASH 0x94 STRTAB 0x310 SYMTAB 0x150 PLTGOT 0x40748 JMPREL 0x48c RELA 0x420 VERNEED 0x400 VERSYM 0x3c8The addresses look to be too small, those from my 'ppc-linux-gnu' are all over
'0x10000000' :Dynamic Section: NEEDED libc.so.6 NEEDED ld.so.1 INIT 0x100011f0 FINI 0x10001214 HASH 0x10000150 STRTAB 0x1000027c SYMTAB 0x1000019c PLTGOT 0x10011990 JMPREL 0x10000368 RELA 0x10000368 VERNEED 0x10000348 VERSYM 0x1000032awhich is the result of the default linker script (elf32ppclinux.x) :
SECTIONS { /* Read-only sections, merged into text segment: */ . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) }What should the base address be for a Linux/PPC executable?
Quoted 23 lines
I don't see anything strange here. I did the same for libc.so.6
$ powerpc-linux-objdump -p lib/libc.so.6 <snip> Version definitions: 1 0x01 0x0865f4e6 libc.so.6 2 0x00 0x0d696910 GLIBC_2.0 3 0x00 0x0d696911 GLIBC_2.1 GLIBC_2.0Version References:
required from ld.so.1:0x0d696911 0x00 05 GLIBC_2.1 0x0d696910 0x00 04 GLIBC_2.0And again for ld.so.1
$ powerpc-linux-objdump -p lib/ld.so.1 <snip> Version definitions: 1 0x01 0x0275a261 ld.so.1 2 0x00 0x0d696910 GLIBC_2.0 3 0x00 0x0d696911 GLIBC_2.1 GLIBC_2.0Quoted 2 lines
I don't see anything glaringly wrong but I don't exactly know what I would be looking for. Can you see any problems ?
Do you have just the same 'libc.so.6', 'ld.so.1' etc. in the cross-tools and in the
run-time environment? Your executable seems to be linked using some glibc-2.1.x libs, but do you have the same libs in the run-time target board? Or just some smaller and older ones ? (Recently someone somewhere wondered why the glibc-2.1.x libs are so big when the older 2.0.6 ones were much smaller...).Better to use the older ones at least when linking...
The generic rule is that one cannot run executables which were linked against newer
shared libs, using older shared libs at run-time. No forwards-compatibility expected. But all executables linked against older libs should run with newer shared libs. This kind of backwards-compatability is always expected... At least between two releases.Quoted 3 lines
Quoted 2 lines
Perhaps the new 'readelf' utility in binutils can be used for sanity checks
of the same kind...Never heard of it. Is it part of binutils-2.9.1 or newer cvs and snapshots ?
It is included with the new snapshots (perhaps almost a year now) :
E:\usr\local\ppc-linux-gnu\bin>readelf --version
GNU readelf 991116
Copyright 1997, 1998, 1999 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty.And the 'elf32ppclinux' support appeared to them some time ago :
E:\usr\local\ppc-linux-gnu\bin>ld -V
GNU ld version 2.9.5 (with BFD 991116)
Supported emulations:
elf32ppclinux
elf32ppcThe difference between 'elf32ppc' and 'elf32ppclinux' was discussed some time ago,
but the only difference seems to be the base address, here is a clip from the default linker script for elf32ppc :SECTIONS { /* Read-only sections, merged into text segment: */ . = 0x01800000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) }If the default linker script for 'elf32ppclinux' says in the same lines :
SECTIONS { /* Read-only sections, merged into text segment: */ . = 0x10000000 + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) }So I'll repeat my question: "What should the base address to be for a Linux/PPC
executable?"Or doesn't it really matter if there is a '. = 0', '. =
0x01800000' or a '. =0x10000000'
in the line after the comment?For all ELF/x86-systems the base address seems to be the same, but for MIPS, SPARC
etc. it seems to vary between different ELF-systems... The SVR4/PowerPC ABI Supplement talks about '0x02000000' as the base address and the '/usr/lib/ld.so.1' is also the 'program interpreter' or the 'dynamic linker' there...BTW, is there something equivalent for Linux/PPC as there is for the never-seen
SVR4/PPC, the "System V Application Binary Interface, PowerPC Processor Supplement", by Steve Zucker and Kari Karhi? Sometimes it sounds very funny when there seems to be no free docs for the "Free Linux" (only those "For Dummies" things), but quite a lot for the commercial SVR4 (e.g. via 'www.sco.com/developer/devspecs').A document with the name "Linux Application Binary Interface, PowerPC Processor
Supplement" seems to be still missing... For Linux/ARM, Linux/Alpha, Linux/MIPS, Linux/M68K too... Isn't there any yet for Linux/x86? (Who said that MS tries to hide the Windows ABI...). Some day all the money went to RedHat & Co. should be converted into some docs... Meanwhile the SVR4-ABI docs, the ARM-ELF-ABI, DWARF etc. docs seem to be the only for Linux. And the GNU sources of course, but who really likes to read everything from the sources...Ok, if there were some nice PDF etc. docs for Linux/* ABIs, there could be much less
misunderstandings and much less trouble to find these 'base' things... But surely more answers with the advice about 'RTFM'....
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: Linux ABI documents and powerpc supplements.
Quoted 8 lines · Franz Sirl
0x10000000+SIZEOF_HEADERSis the current recommended base address for Linux/PPC. It was changed sometime ago from0x1800000to better support running the binaries on AIX. On Linux we use/lib/ld.so.1, Linux overrules the SYSV ABI here. The size of the libraries if you are talking about the standard Linux/PPC ones is due to a bug in 'strip' which tends to corrupt the libraries.The most current documentation I know of is in <ftp://sourceware.cygnus.com/pub/binutils/ppc-docs/>
Thanks. I just downloaded the "System V Application Binary Interface PowerPC Processor Supplement". It is dated September 1995 and is authored by Steve Zucker (SunSoft) and Kari Karhi (IBM). Chapter 3 (page 3-24) says that "a program base of 0x02000000 (32 MB) is recommended for reasons given in chapter 5". I take it that the Linux/PPC supplement would state that a base of 0x10000000+SIZEOF_HEADERS is recommneded. Is there such a beast as a Linux/PPC supplement ?
I am having problems getting simple shared executalbes to work on my embedded powerpc system (MPC860). I am using an egcs-1.1.2 cross compiler and have cross-compiled linux-2.2.5 kernel, glibc-2.1 and some simple test applications. I have an app that outputs a string every second using puts(). If I compile with "powerpc-linux-gcc -m860 -static" it works, but if I compile with "powerpc-linux-gcc -m860 -shared" it doesn't work. I am mount root via nfs and the nfs daemon is in debug mode. I can see the libraries being accessed and read but the app just segfaults. Here is the "powerpc-linux-objdump -p" of the test apps and the libraries. Do they look OK ?
Would the segfault occur when loading the shared libraries into memory or when trying to execute code from memory ?
Do I need -fPIC or does -shared impy this ?
Thanks,
Brendan Simon.
bjs1-static: file format elf32-powerpc
Program Header:
LOAD off 0x00000000 vaddr 0x01800000 paddr 0x01800000 align 2**16
filesz 0x00038910 memsz 0x00038910 flags r-x
LOAD off 0x00038910 vaddr 0x01878910 paddr 0x01878910 align 2**16
filesz 0x000015ac memsz 0x00002034 flags rw-
NOTE off 0x000000a0 vaddr 0x018000a0 paddr 0x018000a0 align 2**4
filesz 0x00000020 memsz 0x00000020 flags r--bjs1-shared: file format elf32-powerpc
Program Header:
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**16
filesz 0x0000066c memsz 0x0000066c flags r-x
LOAD off 0x00000670 vaddr 0x00040670 paddr 0x00040670 align 2**16
filesz 0x000000d8 memsz 0x0000015c flags rwx
DYNAMIC off 0x00000678 vaddr 0x00040678 paddr 0x00040678 align 2**2
filesz 0x000000a0 memsz 0x000000a0 flags rw-Dynamic Section:
NEEDED libc.so.6 INIT 0x610 FINI 0x634 HASH 0x94 STRTAB 0x310 SYMTAB 0x150 STRSZ 0xad SYMENT 0x10 PLTGOT 0x40748 PLTRELSZ 0x3c PLTREL 0x7 JMPREL 0x48c RELA 0x420 RELASZ 0xa8 RELAENT 0xc TEXTREL 0x0 VERNEED 0x400 VERNEEDNUM 0x1 VERSYM 0x3c8
Version References:
required from libc.so.6:
0x0d696910 0x00 02 GLIBC_2.0
lib/libc.so.6: file format elf32-powerpc
Program Header:
PHDR off 0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2
filesz 0x000000c0 memsz 0x000000c0 flags r-x
INTERP off 0x000e8760 vaddr 0x00128760 paddr 0x00128760 align 2**2
filesz 0x00000010 memsz 0x00000010 flags rw-
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**16
filesz 0x000d9f1c memsz 0x000d9f1c flags r-x
LOAD off 0x000d9f20 vaddr 0x00119f20 paddr 0x00119f20 align 2**16
filesz 0x00012fa0 memsz 0x00016a48 flags rwx
DYNAMIC off 0x000e8a30 vaddr 0x00128a30 paddr 0x00128a30 align 2**2
filesz 0x000000b0 memsz 0x000000b0 flags rw-Dynamic Section:
NEEDED ld.so.1 SONAME libc.so.6 INIT 0x21738 FINI 0xd9eb0 HASH 0xf4 STRTAB 0x9728 SYMTAB 0x2be8 STRSZ 0x79ba SYMENT 0x10 PLTGOT 0x12cec0 PLTRELSZ 0x14d0 PLTREL 0x7 JMPREL 0x1ff50 RELA 0x11eec RELASZ 0xf714 RELAENT 0xc VERDEF 0x11e60 VERDEFNUM 0x3 VERNEED 0x11ebc VERNEEDNUM 0x1 VERSYM 0x110f6
Version definitions:
1 0x01 0x0865f4e6 libc.so.6
2 0x00 0x0d696910 GLIBC_2.0
3 0x00 0x0d696911 GLIBC_2.1
GLIBC_2.0
Version References:
required from ld.so.1:
0x0d696911 0x00 05 GLIBC_2.1
0x0d696910 0x00 04 GLIBC_2.0lib/ld.so.1: file format elf32-powerpc
Program Header:
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**16
filesz 0x00013fb8 memsz 0x00013fb8 flags r-x
LOAD off 0x00013fc0 vaddr 0x00053fc0 paddr 0x00053fc0 align 2**16
filesz 0x00002bc8 memsz 0x000032c0 flags rwx
DYNAMIC off 0x00016378 vaddr 0x00056378 paddr 0x00056378 align 2**2
filesz 0x00000088 memsz 0x00000088 flags rw-Dynamic Section:
SONAME ld.so.1 HASH 0x94 STRTAB 0xf28 SYMTAB 0x528 STRSZ 0xcc4 SYMENT 0x10 PLTGOT 0x56c2c PLTRELSZ 0x330 PLTREL 0x7 JMPREL 0x3170 RELA 0x1d9c RELASZ 0x1704 RELAENT 0xc VERDEF 0x1d40 VERDEFNUM 0x3 VERSYM 0x1c00
Version definitions:
1 0x01 0x0275a261 ld.so.1
2 0x00 0x0d696910 GLIBC_2.0
3 0x00 0x0d696911 GLIBC_2.1
GLIBC_2.0
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: Linux ABI documents and powerpc supplements.
In reply to Momchil 'Velco' VelikovQuoted 9 lines · Momchil 'Velco' Velikov
Quoted 5 lines · Brendan J Simon
I am having problems getting simple shared executalbes to work on my embedded powerpc system (MPC860). I am using an egcs-1.1.2 cross compiler and have cross-compiled linux-2.2.5 kernel, glibc-2.1 and some simple test applications. I have an app that outputs a string every second using
puts(). If I compile with "powerpc-linux-gcc -m860 -static" it works, but if I compile with "powerpc-linux-gcc -m860 -shared" it doesn't work. I am mount root via nfs and the nfs-shared is used to *create* a shared library. You need -Bdynamic in order to force the executable to be linked against shared libraries.
I think you are confusing the ld arguments and the gcc arguments. ld uses -Bdynamic and -Bstatic for force linking of dynamic or static executables. If -shared is specified on the gcc command line then, it is passed to ld as -Bdynamic. If -static is specified on the gcc command line, then it is passed to ld as -Bstatic. That's my understanding of it. I've just noticed that ld has a -shared argument also which is used for creating shared libraries as you have stated. If -shared on the gcc command line is passed unmodified to ld, then a shared library will be created instead of an execuable. I guess I can check using -v. I should probably just leave the -shared option out.
Thanks for your help,
Brendan Simon.
The gcc info pages say :
`-static'
On systems that support dynamic linking, this prevents linking with the shared libraries. On other systems, this option has no effect.
`-shared'
Produce a shared object which can then be linked with other objects to form an executable. Not all systems support this option. You must also specify -fpic' or -fPIC' on some systems when you specify this option.
`-BPREFIX'
This option specifies where to find the executables, libraries, include files, and data files of the compiler itself.
The compiler driver program runs one or more of the subprograms cpp', cc1', as' and ld'. It tries PREFIX as a prefix for each program it tries to run, both with and without `MACHINE/VERSION/' (*note Target Options::.).
For each subprogram to be run, the compiler driver first tries the -B' prefix, if any. If that name is not found, or if -B' was not specified, the driver tries two standard prefixes, which are /usr/lib/gcc/' and /usr/local/lib/gcc-lib/'. If neither of those results in a file name that is found, the unmodified program name is searched for using the directories specified in your `PATH' environment variable.
-B' prefixes that effectively specify directory names also apply to libraries in the linker, because the compiler translates these options into -L' options for the linker. They also apply to includes files in the preprocessor, because the compiler translates these options into -isystem' options for the preprocessor. In this case, the compiler appends include' to the prefix.
The run-time support file libgcc.a' can also be searched for using the -B' prefix, if needed. If it is not found there, the two standard prefixes above are tried, and that is all. The file is left out of the link if it is not found by those means.
Another way to specify a prefix much like the -B' prefix is to use the environment variable GCC_EXEC_PREFIX'. *Note Environment Variables::.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: Linux ABI documents and powerpc supplements.
In reply to Brendan J SimonQuoted 5 lines · Brendan J Simon
I am having problems getting simple shared executalbes to work on my embedded powerpc system (MPC860). I am using an egcs-1.1.2 cross compiler and have cross-compiled linux-2.2.5 kernel, glibc-2.1 and some simple test applications. I have an app that outputs a string every second using
puts(). If I compile with "powerpc-linux-gcc -m860 -static" it works, but if I compile with "powerpc-linux-gcc -m860 -shared" it doesn't work. I am mount root via nfs and the nfs
-shared is used to *create* a shared library. You need -Bdynamic in order to force the executable to be linked against shared libraries.
Regards,
-velco
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
dynamic binaries not working.
Quoted 9 lines · Momchil 'Velco' Velikov
Quoted 5 lines · Brendan J Simon
I am having problems getting simple shared executalbes to work on my embedded powerpc system (MPC860). I am using an egcs-1.1.2 cross compiler and have cross-compiled linux-2.2.5 kernel, glibc-2.1 and some simple test applications. I have an app that outputs a string every second using
puts(). If I compile with "powerpc-linux-gcc -m860 -static" it works, but if I compile with "powerpc-linux-gcc -m860 -shared" it doesn't work. I am mount root via nfs and the nfs-shared is used to *create* a shared library. You need -Bdynamic in order to force the executable to be linked against shared libraries.
I removed the -shared argument and the executable now looks a lot better interms of the vaddr and program headers etc. I used "powerpc-linux-gcc -Wall -mcpu=860 -fpic -o bjs1 bjs1.c". I tried with -fPIC, -fpic and without either. The program still does not run however. The output of objdump -p is below.
Does this look OK ?
Any suggestions for debugging the code or the shared libraries ?
Thanks,
Brendan Simon.
# powerpc-linux-objdump -p bjs1
bjs1: file format elf32-powerpc
Program Header:
PHDR off 0x00000034 vaddr 0x01800034 paddr 0x01800034 align 2**2
filesz 0x000000e0 memsz 0x000000e0 flags r-x
INTERP off 0x00000114 vaddr 0x01800114 paddr 0x01800114 align 2**0
filesz 0x0000000d memsz 0x0000000d flags r--
LOAD off 0x00000000 vaddr 0x01800000 paddr 0x01800000 align 2**16
filesz 0x000004e4 memsz 0x000004e4 flags r-x
LOAD off 0x000004e8 vaddr 0x018404e8 paddr 0x018404e8 align 2**16
filesz 0x000000e4 memsz 0x00000168 flags rwx
DYNAMIC off 0x00000508 vaddr 0x01840508 paddr 0x01840508 align 2**2
filesz 0x000000a0 memsz 0x000000a0 flags rw-
NOTE off 0x00000130 vaddr 0x01800130 paddr 0x01800130 align 2**4
filesz 0x00000020 memsz 0x00000020 flags r--Dynamic Section:
NEEDED libc.so.6 INIT 0x180048c FINI 0x18004b0 HASH 0x1800150 STRTAB 0x1800204 SYMTAB 0x1800184 STRSZ 0x74 SYMENT 0x10 DEBUG 0x0 PLTGOT 0x18405cc PLTRELSZ 0x3c PLTREL 0x7 JMPREL 0x18002b4 RELA 0x18002b4 RELASZ 0x3c RELAENT 0xc VERNEED 0x1800294 VERNEEDNUM 0x1 VERSYM 0x1800282
Version References:
required from libc.so.6:
0x0d696910 0x00 02 GLIBC_2.0
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: dynamic binaries not working.
Quoted 10 lines · Brendan J Simon
Quoted 7 lines · Momchil 'Velco' Velikov
Quoted 5 lines · Brendan J Simon
I am having problems getting simple shared executalbes to work on my embedded powerpc system (MPC860). I am using an egcs-1.1.2 cross compiler and have cross-compiled linux-2.2.5 kernel, glibc-2.1 and some simple test applications. I have an app that outputs a string every second using
puts(). If I compile with "powerpc-linux-gcc -m860 -static" it works, but if I compile with "powerpc-linux-gcc -m860 -shared" it doesn't work. I am mount root via nfs and the nfs
Quoted 7 lines
Quoted 2 lines
-shared is used to *create* a shared library. You need -Bdynamic in order to force the executable to be linked against shared libraries.
I removed the -shared argument and the executable now looks a lot better interms of the vaddr and program headers etc. I used "powerpc-linux-gcc -Wall -mcpu=860 -fpic -o bjs1
bjs1.c". I tried with -fPIC, -fpic and without either. The program still does not run however. The output of objdump -p is below.
You should not need -fpic in any form for the binary.
Also, you're using old versions of tools - I really strongly recommend upgrading. GCC 2.95.2 is worlds better than egcs 1.1.2 was, and the new binutils (2.9.5.0.x) fix many nasty little bugs.
Nothing below looked wrong to my inexperienced eye...
Dan
/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 | | Debian GNU/Linux Developer __ Carnegie Mellon University | | [email protected] | | [email protected] | \--------------------------------/ \--------------------------------/
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: Linux ABI documents and powerpc supplements.
In reply to Brendan J SimonQuoted 5 lines
Quoted 3 lines
-shared is used to *create* a shared library. You need -Bdynamic in order to force the executable to be linked against shared libraries.
I think you are confusing the ld arguments and the gcc arguments. ld uses -Bdynamic and -Bstatic
I think you misread the documentation. It has always been my understanding that -static explicitly prevents linking to shared libraries (which is otherwise the default), wheras -shared prepares an object to be used as part of a shared library later:
Quoted 5 lines
`-shared'
Produce a shared object which can then be linked with other objects to form an executable. Not all systems support this option. You must also specify-fpic' or-fPIC' on some systems when you specify this option.
That pretty much states it makes no sense using -shared in the final linkage step for a binary.
Michael
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: dynamic binaries not working.
In reply to Brendan J SimonQuoted 10 lines · Brendan J Simon
Momchil 'Velco' Velikov wrote:
I removed the -shared argument and the executable now looks a lot better interms of the vaddr and program headers etc. I used "powerpc-linux-gcc -Wall -mcpu=860 -fpic -o bjs1
bjs1.c". I tried with -fPIC, -fpic and without either. The program still does not run however. The output of objdump -p is below.
Does this look OK ?
Any suggestions for debugging the code or the shared libraries ?
Have you patched your glibc source so it can work on 860 ??
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
MPC860 patches for glibc
Quoted 13 lines · Kenneth Johansson
Quoted 10 lines · Brendan J Simon
Momchil 'Velco' Velikov wrote:
I removed the -shared argument and the executable now looks a lot better interms of the vaddr and program headers etc. I used "powerpc-linux-gcc -Wall -mcpu=860 -fpic -o bjs1
bjs1.c". I tried with -fPIC, -fpic and without either. The program still does not run however. The output of objdump -p is below.
Does this look OK ?
Any suggestions for debugging the code or the shared libraries ?
Quoted 1 line
Have you patched your glibc source so it can work on 860 ??
I didn't realise there were 860 patches for glibc. Where can I get these patches from ?
What do they do ?
I just ran configure and make with CC="powerpc-linux-gcc -mcpu=860" or CFLAGS=-mcpu=860. I can't remember which.
Thanks,
Brendan Simon.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: MPC860 patches for glibc
Quoted 2 lines · Brendan J Simon
I didn't realise there were 860 patches for glibc. Where can I get these patches from ?
The magic mailing list archive, of course (-:
http://lists.linuxppc.org/listarcs/linuxppc-embedded/199909/msg00000.html
Quoted 1 line
What do they do ?
Fix the cache line size for dynamic loading, and rearrange the FPU stuff so it doesn't get included when you build.
Regards,
Graham
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: MPC860 patches for glibc
In reply to a message not in the archiveQuoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Graham" == Graham Stoney <[email protected]> writes:
Quoted 2 lines · Graham> Brendan J Simon writes:
Quoted 2 lines
I didn't realise there were 860 patches for glibc. Where can I get these patches from ?
Graham> The magic mailing list archive, of course (-:
Graham> http://lists.linuxppc.org/listarcs/linuxppc-embedded/199909/msg00000.html
Quoted 1 line
Quoted 1 line
What do they do ?
Graham> Fix the cache line size for dynamic loading, and rearrange the Graham> FPU stuff so it doesn't get included when you build.
I think the below patch for dl-machine.c would be better. It incurs no loop overhead on the 32-byte cache line CPUs - and I think the double flush of the same line should be harmless (and cheaper than the loop overhead).
There is one small potential for error; if the macro is called with a (32-byte aligned pointer)+16/17/18...31 in which case the first 16 bytes (of the 32-byte aligned address) would not be flushed on a 8xx, while they would be on a bigger CPU. (did that make any sense at all ;)
Comments? Is it as safe/sensible as I think it is?
Thanks,
Jesper
dl-machine.c renamed from dl-machine.c~ +9 -2
@@ -63,10 +63,17 @@#define OPCODE_SLWI (ra,rs,sh) OPCODE_RLWINM(ra,rs,sh,0,31-sh) -#define PPC_DCBST (where) asm ("dcbst 0,%0" : : "r"(where) : "memory") +/* The macros dealing with cache lines affect both (where) and +(where+16). This is in order to support the 8xx CPUs which have +16-byte cache lines. On the CPUs with 32-byte cache lines this +should have no noticable effect as the first store instruction +would effectively make the second instruction a NOP (since the line +would no longer be dirty). */ +#define PPC_DCBST (where) asm ("dcbst 0,%0;dcbst 0,%1" : : "r"(where), "r"((unsigned long)(where)+16) : "memory") +#define PPC_ICBI (where) asm ("icbi 0,%0;icbi 0,%1" : : "r"(where), "r"((unsigned long)(where)+16) : "memory") +#define PPC_SYNC asm ("sync" : : : "memory")#define PPC_ISYNC asm volatile ("sync; isync" : : : "memory") -#define PPC_ICBI (where) asm ("icbi 0,%0" : : "r"(where) : "memory")#define PPC_DIE asm volatile ("tweq 0,0")/* Use this when you've modified some code, but it won't be in the
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: MPC860 patches for glibc
Would the changes suggested below, to the cache line size (mpc8xx = 16 bytes, others = 32 bytes) make any difference if my Instruction Cache and Data Cache was disabled. My current linux kernel has them all disabled for now.
Brendan Simon.
Quoted 42 lines · Jesper Skov
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Graham" == Graham Stoney <[email protected]> writes:
Quoted 2 lines · Graham> Brendan J Simon writes:
Quoted 2 lines
I didn't realise there were 860 patches for glibc. Where can I get these patches from ?
Graham> The magic mailing list archive, of course (-:
Graham> http://lists.linuxppc.org/listarcs/linuxppc-embedded/199909/msg00000.html
Quoted 1 line
Quoted 1 line
What do they do ?
Graham> Fix the cache line size for dynamic loading, and rearrange the Graham> FPU stuff so it doesn't get included when you build.
I think the below patch for
dl-machine.cwould be better. It incurs no loop overhead on the 32-byte cache line CPUs - and I think the double flush of the same line should be harmless (and cheaper than the loop overhead).There is one small potential for error; if the macro is called with a (32-byte aligned pointer)+16/17/18...31 in which case the first 16 bytes (of the 32-byte aligned address) would not be flushed on a 8xx, while they would be on a bigger CPU. (did that make any sense at all ;)
Comments? Is it as safe/sensible as I think it is?
Thanks,
Jesperdl-machine.c Thu Jan 6 14:09:34 2000 renamed from dl-machine.c~ Fri Mar 5 00:26:43 1999 +5
-1@@ -63,10 +63,17 @@ #define OPCODE_SLWI(ra,rs,sh) OPCODE_RLWINM(ra,rs,sh,0,31-sh) -#define PPC_DCBST(where) asm ("dcbst 0,%0" : : "r"(where) : "memory") +/* The macros dealing with cache lines affect both (where) and + (where+16). This is in order to support the 8xx CPUs which have + 16-byte cache lines. On the CPUs with 32-byte cache lines this + should have no noticable effect as the first store instruction + would effectively make the second instruction a NOP (since the line
dl-machine.c Thu Jan 6 14:09:34 2000 line 79
Quoted 10 lines
dl-machine.c Thu Jan 6 14:09:34 2000 renamed from dl-machine.c~ Fri Mar 5 00:26:43 1999 +4
-1+ would no longer be dirty). */ +#define PPC_DCBST(where) asm ("dcbst 0,%0;dcbst 0,%1" : : "r"(where), "r"((unsigned long)(where)+16) : "memory") +#define PPC_ICBI(where) asm ("icbi 0,%0;icbi 0,%1" : : "r"(where), "r"((unsigned long)(where)+16) : "memory") + #define PPC_SYNC asm ("sync" : : : "memory") #define PPC_ISYNC asm volatile ("sync; isync" : : : "memory") -#define PPC_ICBI(where) asm ("icbi 0,%0" : : "r"(where) : "memory") #define PPC_DIE asm volatile ("tweq 0,0") /* Use this when you've modified some code, but it won't be in the
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Re: MPC860 patches for glibc
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Brendan" == Brendan J Simon <[email protected]> writes:
Brendan> Would the changes suggested below, to the cache line size Brendan> (mpc8xx = 16 bytes, others = 32 bytes) make any difference if Brendan> my Instruction Cache and Data Cache was disabled. My current Brendan> linux kernel has them all disabled for now.
I can't imagine so. But you may want someone with more experience to answer your question :)
Jesper
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Bizarre initrd problem on CLLF860T
Hi there,
I'm wondering if anyone could please give me a pointer on the following problem I'm having: A couple of months ago when I last tried booting one of our CLLF860T boards with an initrd, it all worked fine -- no drama. Figuring that this hurdle was conquered, I haven't tried again until today, as we're happily NFS mounting the root filesystem for development.
Today though, I can't for the life of me work out why the initrd stuff isn't working. The log messages tell me that it's trying to mount the root filesystem *twice*, and the second attempt fails with a panic. I've been banging my head against this all afternoon to no avail; any suggestions?
I'm using Dan's 2.2.13-derived kernel; here are the boot messages:
loaded at: 00200000 0020C580 relocated to: 00100000 0010C580 board data at: 001001C4 001001E0 relocated to: 00200100 0020011C zimage at: 00207000 00266B05 initrd at: 00266B05 00332154 avail ram: 00333000 01000000
Linux/PPC load:
Uncompressing Linux...done.
Now booting the kernel
Linux version 2.2.13 (greyham@brixi) (gcc version 2.95.2 19991024 (release)) #55
Mon Apr 17 16:53:24T 2000
Boot arguments: root=/dev/ramtime_init: decrementer frequency = 180000000/60
Calibrating delay loop... 47.82 BogoMIPS
Memory: 14352k available (728k kernel code, 452k data, 32k init) [c0000000,c1000 000]
DENTRY hash tas: 262144 (order: 9, 2097152 bytes)
Buffer-cache hash table entries: 32768 (order: 5, 131072 bytes) Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.2
Based upon Swansea University Computer Society NET3.039
NET4: Unix domain sockets 1.0 for Linux NET4.0.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
TCP: Hash tables configured (ehash 16384 bhash 16384)
Starting kswapd v 1.1.1.1
CPM UART driver version 0.03
ttyS00 at 0x0280 is a SMC
ttyS01 at 0x0380 is a SMC
ttyS02 at 0x0100 is a SCC
ttyS03 at 0x0200 is a SCC
pty: 256 Unix98 ptys configured
RAM disk driver initialized: 16 RAM disks of 4096K size
loop: registered device at major 7
eth0: FEC ENET Version 0.1, 00:10:ec:00:0d:3b
PPP: version 2.3.7 (demand dialling)
TCP compression code copyright 1989 Regents of the University of California PPP line discipline regid.
fec: Phy @ 0x17, type 0x01814401
fec: link down
fec: 100 Mbps, Half-Duplex
Sending BOOTP requests..... OK
IP-Config: Got BOOTP answer from 10.2.2.90, my address is 10.2.0.21
IP-Config: Guessing netmask 255.0.0.0
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem)
VFS: Cannot open root device 00:00
Kernel panic: VFS: Unable to mount root fs on 00:00
Rebooting in 180 seconds..<0>Kernel panic: Kernel Mode Software FPU Emulation Rebooting in 180 seconds..
Any help greatly appreciated,
Graham
--
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909 Fax: +61 2 9805 2929
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
In reply to a message not in the archiveQuoted 14 lines · [email protected] (Graham Stoney) writes:
Hi there,
I'm wondering if anyone could please give me a pointer on the following problem I'm having: A couple of months ago when I last tried booting one of our CLLF860T boards with an initrd, it all worked fine -- no drama. Figuring that this hurdle was conquered, I haven't tried again until today, as we're happily NFS mounting the root filesystem for development.
Today though, I can't for the life of me work out why the initrd stuff isn't working. The log messages tell me that it's trying to mount the root filesystem *twice*, and the second attempt fails with a panic. I've been banging my head against this all afternoon to no avail; any suggestions?
I'm using Dan's 2.2.13-derived kernel; here are the boot messages:
[snip]
Quoted 4 lines
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem)
VFS: Cannot open root device 00:00Kernel panic: VFS: Unable to mount root fs on 00:00
Looks like the initrd is sucessfully mounted, then /linuxrc is either executed quietly or fails to be executed. In either case the bootup continues, and fails to mount the real root device because it is not set to anything useful.
How is your bootup supposed to work? If you want to use the initrd as the real root file system you should pass root=/dev/ram to the kernel.
//Marcus
--
Signature under construction, please come back later.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
Quoted 9 lines · Marcus Sundberg
Quoted 4 lines
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem)
VFS: Cannot open root device 00:00Kernel panic: VFS: Unable to mount root fs on 00:00Looks like the initrd is sucessfully mounted, then /linuxrc is either executed quietly or fails to be executed. In either case the bootup continues, and fails to mount the real root device because it is not set to anything useful.
Yes, but I'm confused as to why...
Quoted 3 lines
How is your bootup supposed to work? If you want to use the initrd as the real root file system you should pass root=/dev/ram to the kernel.
I'm just trying to boot to a standalone shell; I have no /linuxrc in my initrd, and I do want to use the initrd as the real root file system. Also, I have:
Boot arguments: root=/dev/ram
So it looks to me as though it _should_ work; but why is it trying to remount device 00:00? The ramdisk is supposed to be 01:00.
Mucho confusedo,
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
RE: Bizarre initrd problem on CLLF860T
Graham,
Hmmm... Here are some things I would try... it may be helpful to put a debug line in fs/namei.c, the open_namei call, and simply print the pathname, maybe this will show you the file which is causing the problem. When I get to work, I look at the the root device 00:00 and see what is different on my builds and get back to you with more information.
Jason
-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Graham Stoney
Sent: Monday, April 17, 2000 4:42 AM
To: Marcus Sundberg
Cc: Graham Stoney; LinuxPPC Embedded Mailing List
Subject: Re: Bizarre initrd problem on CLLF860T
Quoted 9 lines · Marcus Sundberg
Quoted 4 lines
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem)
VFS: Cannot open root device 00:00Kernel panic: VFS: Unable to mount root fs on 00:00Looks like the initrd is sucessfully mounted, then /linuxrc is either executed quietly or fails to be executed. In either case the bootup continues, and fails to mount the real root device because it is not set to anything useful.
Yes, but I'm confused as to why...
Quoted 3 lines
How is your bootup supposed to work? If you want to use the initrd as the real root file system you should pass root=/dev/ram to the kernel.
I'm just trying to boot to a standalone shell; I have no /linuxrc in my initrd,
and I do want to use the initrd as the real root file system. Also, I have:
Boot arguments: root=/dev/ram
So it looks to me as though it _should_ work; but why is it trying to remount
device 00:00? The ramdisk is supposed to be 01:00.
Mucho confusedo,
Graham
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
In reply to Graham StoneyQuoted 2 lines · Graham Stoney
Today though, I can't for the life of me work out why the initrd stuff isn't working.
So, what's different in your configuration? Is this the same kernel and ramdisk? Like I requested in a previous message, the the sources from MontaVista. They are the most recent.
Quoted 4 lines
Sending BOOTP requests..... OK
IP-Config: Got BOOTP answer from 10.2.2.90, my address is 10.2.0.21
IP-Config: Guessing netmask 255.0.0.0
RAMDISK: Compressed image found at block 0
IP-Config with Ramdisk is a pretty weird configuration. At the 'Linux/PPC Load:' enter 'root=/dev/ram ip=off'.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
Quoted 8 lines · In message <[email protected]> Dan Malek wrote:
Quoted 5 lines
Sending BOOTP requests..... OK
IP-Config: Got BOOTP answer from 10.2.2.90, my address is 10.2.0.21
IP-Config: Guessing netmask 255.0.0.0
RAMDISK: Compressed image found at block 0IP-Config with Ramdisk is a pretty weird configuration. At the 'Linux/PPC Load:' enter 'root=/dev/ram ip=off'.
Why do you call this weird? Is it not possible to use BOOTP to just get an IP address assigned?
What method for network configuration do you suggest for a minimized embedded system? Including tools like ifconfig and set-up scripts to call them?
I've been using similar combinations (RARP + initrd) for some time without problems; would this fail using BOOTP?
Ummm... let's see:
Using RARP:
...
ttyS00 at 0x0380 is a SMC
ttyS01 at 0x0280 is a SMC
pty: 256 Unix98 ptys configured
Found 2x16bit 4Mbyte CFI flash device of type AMD/Fujitsu standard at 40000000 registered flash device /dev/flash0
Found 2x16bit 4Mbyte CFI flash device of type AMD/Fujitsu standard at 40400000 registered flash device /dev/flash1
RAM disk driver initialized: 16 RAM disks of 4096K size
eth0: CPM ENET Version 0.2, 00:d0:93:00:02:6c
PPP: version 2.3.7 (demand dialling)
TCP compression code copyright 1989 Regents of the University of California PPP line discipline registered.
Sending RARP requests.... OK
IP-Config: Got RARP answer from 10.0.0.1, my address is 10.0.0.99
IP-Config: Guessing netmask 255.0.0.0
RAMDISK: Compressed image found at block 0
EXT2-fs warning: checktime reached, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 32k init
Stand-alone shell (version 2.1)
>
Using BOOTP:
...
ttyS00 at 0x0380 is a SMC
ttyS01 at 0x0280 is a SMC
pty: 256 Unix98 ptys configured
Found 2x16bit 4Mbyte CFI flash device of type AMD/Fujitsu standard at 40000000 registered flash device /dev/flash0
Found 2x16bit 4Mbyte CFI flash device of type AMD/Fujitsu standard at 40400000 registered flash device /dev/flash1
RAM disk driver initialized: 16 RAM disks of 4096K size
eth0: CPM ENET Version 0.2, 00:d0:93:00:02:6c
PPP: version 2.3.7 (demand dialling)
TCP compression code copyright 1989 Regents of the University of California PPP line discipline registered.
Sending BOOTP requests.... OK
IP-Config: Got BOOTP answer from 10.0.0.1, my address is 10.0.0.99
RAMDISK: Compressed image found at block 0
EXT2-fs warning: checktime reached, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 36k init
Stand-alone shell (version 2.1)
>
This works for me, too.
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] Man is the best computer we can put aboard a spacecraft ... and the only one that can be mass produced with unskilled labor.
- Wernher von Braun
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
In reply to Dan MalekHi everyone,
Thanks to all your suggestions, I have found the culprit...
Quoted 3 lines · Dan Malek
So, what's different in your configuration? Is this the same kernel and ramdisk? Like I requested in a previous message, the the sources from MontaVista. They are the most recent.
I am using the MontaVista kernel, with a few trivial local tweaks; namely the patches I've posted here over the last few weeks. My initrd problem lies in the CPU6 workaround in set_dec in arch/ppc/kernel/head.S, which does, err, interesting things to the command line!:
.globl set_decset_dec:
mfmsr r5 /* Disable interrupts */
li r4,0
ori r4,r4,MSR_EE
andc r6,r5,r4
SYNC /* Some chip revs need this... */
mtmsr r6
SYNC
lis r7, cmd_line@h ###
ori r7, r7, cmd_line@l ###
li r4, 0x2c00 ###
stw r4, 12(r7) ###
lwz r4, 12(r7) ###
mtspr 22, r3 /* Update Decrementer */
SYNC
mtmsr r5
SYNC
blrThe lines marked ### look like debug code that shouldn't have made it out to the world. It's causing my boot command line "root=/dev/ram" to turn into "root=/dev/ra", and triggering the initrd code that tries to remount the real root filesystem. If you're using the CPU6 workarounds, I suggest you nuke those lines.
Turns out I'm not going crazy after all.
Thanks again for all your suggestions,
Graham
--
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909 Fax: +61 2 9805 2929
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
In reply to a message not in the archiveQuoted 25 lines · [email protected] (Graham Stoney) writes:
I am using the MontaVista kernel, with a few trivial local tweaks; namely the patches I've posted here over the last few weeks. My initrd problem lies in the CPU6 workaround in
set_decinarch/ppc/kernel/head.S, which does, err, interesting things to the command line!:.globl
set_decset_dec:mfmsr r5 /* Disable interrupts */ li r4,0 ori r4,r4,MSR_EE andc r6,r5,r4 SYNC /* Some chip revs need this... */ mtmsr r6 SYNC lis r7, cmd_line@h ### ori r7, r7, cmd_line@l ### li r4, 0x2c00 ### stw r4, 12(r7) ### lwz r4, 12(r7) ### mtspr 22, r3 /* Update Decrementer */ SYNC mtmsr r5 SYNC blr
Quoted 5 lines
The lines marked ### look like debug code that shouldn't have made it out to the world. It's causing my boot command line "root=/dev/ram" to turn into "root=/dev/ra", and triggering the initrd code that tries to remount the real root filesystem. If you're using the CPU6 workarounds, I suggest you nuke those lines.
Actually they are part of the CPU6 workaround. set_dec() apparently was overlooked in our version of it, but MontaVista have that fixed. Unfortunately they fixed it wrong - set_dec() is called before the command line is processed, unlike _switch() which also use cmd_line to store the value.
I'd suggest keeping the C-version of set_dec() in ppc/kernel/time.h where it used to be and change it to the followingcode :
static __inline__ void set_dec(unsigned int val)
{
unsigned long flags;
unsigned long dummy_var;
register unsigned long reg5 __asm__ ("r5") = DEC_ADDR;
register unsigned long reg4 __asm__ ("r4") = (unsigned long) &dummy_var;
save_flags(flags);
cli();
asm volatile (
"stw %3,0(%2) \n\t"
"lwz %3,0(%2) \n\t"
"mtspr %0,%1 \n\t"
: : "i"(DEC), "r"((val)), "r"(reg4), "r"(reg5)
: "r4", "r5", "memory");
restore_flags(flags);
}//Marcus
--
Signature under construction, please come back later.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
Quoted 2 lines · Marcus Sundberg
I'd suggest keeping the C-version of
set_dec()inppc/kernel/time.hwhere it used to be and change it to the following code :
[snip]
Or not. ;-)
That didn't come out of the compiler as something useful, this version works though:
static __inline__ void set_dec(unsigned int val)
{
unsigned long dummy_var;
register unsigned long reg5 __asm__ ("r5");
register unsigned long reg4 __asm__ ("r4");
unsigned long flags;
save_flags(flags);
cli();
reg4 = (unsigned long) &dummy_var;
reg5 = DEC_ADDR;
asm volatile (
"stw %3,0(%2) \n\t"
"lwz %3,0(%2) \n\t"
"mtspr %0,%1 \n\t"
: : "i"(DEC), "r"((val)), "r"(reg4), "r"(reg5)
: "r4", "r5", "memory");
restore_flags(flags);
}//Marcus
--
Signature under construction, please come back later.
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
In reply to Graham StoneyQuoted 3 lines · Graham Stoney
..... My initrd problem lies in
the CPU6 workaround inset_decinarch/ppc/kernel/head.S, which does, err, interesting things to the command line!:
Sorry about that. It was a test hack I forgot about. I just needed something aligned and mapped to read/write that was _supposed_ to not affect anything. It popped to mind and I never went back to do something proper......I don't know why it ever worked for me.
Just create some 32-bit aligned variable and use that.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Re: Bizarre initrd problem on CLLF860T
In reply to Marcus SundbergQuoted 2 lines · Marcus Sundberg
I'd suggest keeping the C-version of
set_dec()inppc/kernel/time.hwhere it used to be and change it to the followingcode :
I just use whatever comes from the Linux/PPC development tree. It seems to move around depending upon what compiler bugs exist at the time. It may also be necessary to make this a real function for RT/Linux support.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/