Skip to contentSkip to conversation

Add bootstrap command

PATCH New Dirk Eibach 8 participants 21 messages Jul 15, 2009 – Jul 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add bootstrap command

This adds a generic command for programming I2C bootstrap eeproms. Implementation for Canyonlands board is included.

---
 board/amcc/canyonlands/Makefile    |    5 +-
 board/amcc/canyonlands/bootstrap.c |  177 ++++++------------------------------
 common/Makefile                    |    1 +
 common/cmd_bootstrap.c             |   75 +++++++++++++++
 include/bootstrap.h                |   36 +++++++
 include/configs/canyonlands.h      |    6 +
 6 files changed, 148 insertions(+), 152 deletions(-)
 create mode 100644 common/cmd_bootstrap.c
 create mode 100644 include/bootstrap.h
board/amcc/canyonlands/Makefile +3 -2
index 2aeead6..be51cb9 100644
@@ -25,10 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= $(BOARD).o
-COBJS	+= bootstrap.o
+COBJS-y	:= $(BOARD).o
+COBJS-$(CONFIG_CMD_BOOTSTRAP) += bootstrap.o
 SOBJS	:= init.o
 
+COBJS   := $(COBJS-y)
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
board/amcc/canyonlands/bootstrap.c +27 -150

201 lines not on this page · raw message

common/Makefile +1 -0
index c8e5d26..0a9a17b 100644
@@ -71,6 +71,7 @@ COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
+COBJS-$(CONFIG_CMD_BOOTSTRAP) += cmd_bootstrap.o
 COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
 COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
 COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
common/cmd_bootstrap.c new file +75 -0

75 lines not on this page · raw message

include/bootstrap.h new file +36 -0
new file mode 100644
index 0000000..61919dc
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2009
+ * Dirk Eibach,  Guntermann & Drunck GmbH, eibach at gdsys.de
+ *
+ * based on code (C) Copyright 2008
+ * Stefan Roese, DENX Software Engineering, sr at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#ifndef __BOOTSTRAP_H
+#define __BOOTSTRAP_H
+
+#include <common.h>
+
+extern char *bootstrap_config_labels[];
+extern u8 bootstrap_configs[][CONFIG_BOOTSTRAP_BLOCKSIZE];
+
+#endif /* __BOOTSTRAP_H */
include/configs/canyonlands.h +6 -0
index 48c5198..ab0bd59 100644
@@ -330,6 +330,9 @@
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	10
 
+#define CONFIG_BOOTSTRAP_I2C_EEPROM_ADDR	0x54
+#define CONFIG_BOOTSTRAP_BLOCKSIZE		16
+
 /* I2C SYSMON (LM75, AD7414 is almost compatible)			*/
 #define CONFIG_DTT_LM75		1		/* ON Semi's LM75	*/
 #define CONFIG_DTT_AD7414	1		/* use AD7414		*/
@@ -443,10 +446,12 @@
  * Commands additional to the ones defined in amcc-common.h
  */
 #if defined(CONFIG_ARCHES)
+#define CONFIG_CMD_BOOTSTRAP
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_PCI
 #define CONFIG_CMD_SDRAM
 #elif defined(CONFIG_CANYONLANDS)
+#define CONFIG_CMD_BOOTSTRAP
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_EXT2
@@ -457,6 +462,7 @@
 #define CONFIG_CMD_SNTP
 #define CONFIG_CMD_USB
 #elif defined(CONFIG_GLACIER)
+#define CONFIG_CMD_BOOTSTRAP
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DTT
 #define CONFIG_CMD_NAND
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 Add bootstrap command

Quoted 2 lines · On Wednesday 15 July 2009 09:48:00 Dirk Eibach wrote:

This adds a generic command for programming I2C bootstrap eeproms. Implementation for Canyonlands board is included.

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090715/b1eaa3c5/attachment.pgp

#2 lore raw

PATCH 1/1 Add bootstrap command

Hi Dirk,

Quoted 6 lines · On Wednesday 15 July 2009 16:46:12 Mike Frysinger wrote:
Quoted 2 lines · On Wednesday 15 July 2009 09:48:00 Dirk Eibach wrote:

This adds a generic command for programming I2C bootstrap eeproms. Implementation for Canyonlands board is included.

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

I agree with Mike. Please change the command name and the files to something more specific. How about "4xxbootstrap"? Or "4xxstrap"? Any other good ideas about this naming welcome. :)

Other than this, patch looks good. Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#3 lore raw

PATCH 1/1 Add bootstrap command

Quoted 4 lines · Stefan Roese

Hi Dirk,

Quoted 1 line · On Wednesday 15 July 2009 16:46:12 Mike Frysinger wrote:

On Wednesday 15 July 2009 09:48:00 Dirk Eibach wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

This adds a generic command for programming I2C bootstrap eeproms. Implementation for Canyonlands board is included.

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

I agree with Mike. Please change the command name and the files to something more specific. How about "4xxbootstrap"? Or "4xxstrap"?

To long for my taste.

Quoted 2 lines

Any other good ideas
about this naming welcome. :)

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'. But it works a little mit different that the bootstrap command.

Quoted 3 lines

Other than this, patch looks good. Thanks.

Matthias

Quoted 2 lines

Best regards,
Stefan

#4 lore raw

PATCH 1/1 Add bootstrap command

Quoted 6 lines · On Thursday 16 July 2009 15:47:17 Matthias Fuchs wrote:
Quoted 5 lines
Quoted 2 lines

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

I agree with Mike. Please change the command name and the files to something more specific. How about "4xxbootstrap"? Or "4xxstrap"?

Quoted 8 lines

To long for my taste.

Quoted 2 lines

Any other good ideas
about this naming welcome. :)

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'.

If you already forgot what it's supposed to mean, then it definitely is not a good name. Better a bit longer and more descriptive.

Quoted 2 lines

But it works
a little mit different that the bootstrap command.

It would be great if you could merge/consolidate such 4xx custom commands into this common one. Does you command support more features? What's the main difference?

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#5 lore raw

PATCH 1/1 Add bootstrap command

Hi,

Quoted 16 lines · Stefan Roese
Quoted 11 lines · On Thursday 16 July 2009 15:47:17 Matthias Fuchs wrote:
Quoted 4 lines
Quoted 2 lines

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

I agree with Mike. Please change the command name and the files to something more specific. How about "4xxbootstrap"? Or "4xxstrap"?

To long for my taste.

Quoted 2 lines

Any other good ideas
about this naming welcome. :)

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'.

If you already forgot what it's supposed to mean, then it definitely is not a good name. Better a bit longer and more descriptive.

Quoted 6 lines
Quoted 2 lines

But it works
a little mit different that the bootstrap command.

It would be great if you could merge/consolidate such 4xx custom commands into this common one. Does you command support more features? What's the main difference?

BTW, there's also pllalter command for kilauea, that provides similar functionality.

Felix.

Quoted 15 lines

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#6 lore raw

PATCH 1/1 Add bootstrap command

Quoted 9 lines · On Thursday 16 July 2009 16:16:36 Felix Radensky wrote:
Quoted 6 lines
Quoted 2 lines

But it works
a little mit different that the bootstrap command.

It would be great if you could merge/consolidate such 4xx custom commands into this common one. Does you command support more features? What's the main difference?

BTW, there's also pllalter command for kilauea, that provides similar functionality.

Correct. Thanks for reminding me. I'll do some Kilauea work in the next days and so I'll probably change this command to the new 4xx-common bootstrap command (whatever this will be).

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#7 lore raw

PATCH 1/1 Add bootstrap command

In reply to Stefan Roese
Quoted 12 lines · Stefan Roese
Quoted 11 lines · On Thursday 16 July 2009 15:47:17 Matthias Fuchs wrote:
Quoted 5 lines
Quoted 2 lines

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

I agree with Mike. Please change the command name and the files to something more specific. How about "4xxbootstrap"? Or "4xxstrap"?

To long for my taste.

Quoted 2 lines

Any other good ideas
about this naming welcome. :)

Quoted 6 lines
Quoted 3 lines

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'.

If you already forgot what it's supposed to mean, then it definitely is not a good name. Better a bit longer and more descriptive.

I like 'sbe' - it short and I even gave it a meaning :-)

Quoted 6 lines
Quoted 3 lines

But it works
a little mit different that the bootstrap command.

It would be great if you could merge/consolidate such 4xx custom commands into this common one.

I was a little inspired by the sequoia code that also comes with a bootstrap command. So please don't ask me to merge it into common code. But your finger on your own nose.

Quoted 2 lines

Does you command support more features? What's the main difference?

Much simpler. Just call sbe with a descriptive argument like a CPU frequency or something like '667-66' on a 440EPx target with 66Mhz PCI clock or 'sr-test-only' for something you will remove later :-). This has two advantages over just using
numbers: You can remove configurations without making the following configs in the table moving to the front and its a little more secure meaning you have to type a couple of valid character to reconfigure the clocking. Just using "bootstrap 5" is error-prone.

Well, I like my syntax and behavior, but I do not want to totally dismiss Dirk's idea as long as I can keep my sbe command :-)

Quoted 17 lines

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#8 lore raw

PATCH 1/1 Add bootstrap command

Quoted 11 lines · On Thursday 16 July 2009 17:00:00 Matthias Fuchs wrote:
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Any other good ideas
about this naming welcome. :)

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'.

If you already forgot what it's supposed to mean, then it definitely is not a good name. Better a bit longer and more descriptive.

I like 'sbe' - it short and I even gave it a meaning :-)

But unfortunately not specific enough for a "common" command.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

But it works
a little mit different that the bootstrap command.

It would be great if you could merge/consolidate such 4xx custom commands into this common one.

I was a little inspired by the sequoia code that also comes with a bootstrap command. So please don't ask me to merge it into common code. But your finger on your own nose.

OK. But if your "sbe" command is "better" than the current bootstrap one, then let's see if it makes sense to use your command as the common one.

Quoted 11 lines
Quoted 2 lines

Does you command support more features? What's the main difference?

Much simpler. Just call sbe with a descriptive argument like a CPU frequency or something like '667-66' on a 440EPx target with 66Mhz PCI clock or 'sr-test-only' for something you will remove later :-). This has two advantages over just using
numbers: You can remove configurations without making the following configs in the table moving to the front and its a little more secure meaning you have to type a couple of valid character to reconfigure the clocking. Just using "bootstrap 5" is error-prone.

Ack.

Quoted 2 lines

Well, I like my syntax and behavior, but I do not want to totally dismiss Dirk's idea as long as I can keep my sbe command :-)

Seems that "your" command is not so bad. ;) I'll take a look at it tomorrow. Perhaps we can use some of your ideas in such a new common (PPC4xx) implementation. :)

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#9 lore raw

PATCH 1/1 Add bootstrap command

Quoted 8 lines · On Thursday 16 July 2009 17:00:00 Matthias Fuchs wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Any other good ideas
about this naming welcome. :)

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

If you already forgot what it's supposed to mean, then it definitely is not a good name. Better a bit longer and more descriptive.

I like 'sbe' - it short and I even gave it a meaning :-)

But unfortunately not specific enough for a "common" command.

I think we are talking about a generic 4xx command to write data into
the EEPROM that is read by the bootstrap controller. But I do not care about the name ;-)

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

But it works
a little mit different that the bootstrap command.

It would be great if you could merge/consolidate such 4xx custom commands into this common one.

Quoted 6 lines
Quoted 3 lines

I was a little inspired by the sequoia code that also comes with a bootstrap command. So please don't ask me to merge it into common code. But your finger on your own nose.

OK. But if your "sbe" command is "better" than the current bootstrap one, then let's see if it makes sense to use your command as the common one.

Dirk's approach is very generic. Putting nothing but the EEPROM data and a descriptive table into the board file is what we need. I only suggest to add an additional label to each entry that is used instead of using numbers and I'd to pass this label as argument instead of the a number. One could use the numbers as labels also :-)

When you do no pass the argument we could either print the descriptive texts as menu (as DIrk did so far) and wait for input or just print the texts as kind of help and the must supply an argument if he want to change something (I prefer the latter).

Quoted 13 lines
Quoted 4 lines
Quoted 3 lines

Does you command support more features? What's the main difference?

Quoted 8 lines

Much simpler. Just call sbe with a descriptive argument like a CPU frequency or something like '667-66' on a 440EPx target with 66Mhz PCI clock or 'sr-test-only' for something you will remove later :-). This has two advantages over just using
numbers: You can remove configurations without making the following configs in the table moving to the front and its a little more secure meaning you have to type a couple of valid character to reconfigure the clocking. Just using "bootstrap 5" is error-prone.

Quoted 8 lines

Ack.

Quoted 2 lines

Well, I like my syntax and behavior, but I do not want to totally dismiss Dirk's idea as long as I can keep my sbe command :-)

Seems that "your" command is not so bad. ;) I'll take a look at it tomorrow. Perhaps we can use some of your ideas in such a new common (PPC4xx) implementation. :)

My implementation is nothing but ar if-!strcmp-else-if-!strcmp implementation. But putting things together is a good idea.

Matthias

Quoted 5 lines

Thanks.

Best regards,
Stefan

#10 lore raw

PATCH 1/1 Add bootstrap command

Dear Matthias Fuchs,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 2 lines

But unfortunately not specific enough for a "common" command.

I think we are talking about a generic 4xx command to write data into
the EEPROM that is read by the bootstrap controller. But I do not care about the name ;-)

We're changing some board configuration data. Maybe the command name should start with "conf[ig]" then.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
All this doesn't alter anything, you know. The world is still full of
stupid people. They don't use their brains. They don't seem  to  want
to think straight.                    - Terry Pratchett, _Soul Music_
#11 lore raw

PATCH 1/1 Add bootstrap command

In reply to Matthias Fuchs
Quoted 5 lines · On Thursday 16 July 2009 22:08:27 Matthias Fuchs wrote:
Quoted 2 lines

OK. But if your "sbe" command is "better" than the current bootstrap one, then let's see if it makes sense to use your command as the common one.

Dirk's approach is very generic. Putting nothing but the EEPROM data and a descriptive table into the board file is what we need.

I'm aware of this, since I suggested to Dirk to implement it this way. ;)

Quoted 4 lines

I only suggest to
add an additional label to each entry that is used instead of using numbers and I'd to pass this label as argument instead of the a number. One could use the numbers as labels also :-)

Ack.

Quoted 4 lines

When you do no pass the argument we could either print the descriptive texts as menu (as DIrk did so far) and wait for input or just print the texts as kind of help and the must supply an argument if he want to change something (I prefer the latter).

Yes, just printing all available config options when called without parameter is what I prefer as well. Something like this:

=> 4xx_config (or 4xx_bootstrap)
Available configurations:

  Name                CPU  PLB  OPB  EBC  Boot-Location
  1                   333  133  66   66   NOR
  2                   333  133  66   66   NAND
  3                   333  133  66   66   PCI
  4                   400  133  66   66   NOR
  5                   400  133  66   66   NAND
  6                   400  160  80   53   NOR

...

The board maintainer could of course use real "names" instead of the numbers here.

Quoted 17 lines
Quoted 17 lines
Quoted 11 lines
Quoted 2 lines

Does you command support more features? What's the main difference?

Much simpler. Just call sbe with a descriptive argument like a CPU frequency or something like '667-66' on a 440EPx target with 66Mhz PCI clock or 'sr-test-only' for something you will remove later :-). This has two advantages over just using
numbers: You can remove configurations without making the following configs in the table moving to the front and its a little more secure meaning you have to type a couple of valid character to reconfigure the clocking. Just using "bootstrap 5" is error-prone.

Ack.

Quoted 2 lines

Well, I like my syntax and behavior, but I do not want to totally dismiss Dirk's idea as long as I can keep my sbe command :-)

Quoted 6 lines
Quoted 3 lines

Seems that "your" command is not so bad. ;) I'll take a look at it tomorrow. Perhaps we can use some of your ideas in such a new common (PPC4xx) implementation. :)

My implementation is nothing but ar if-!strcmp-else-if-!strcmp implementation. But putting things together is a good idea.

Yes, the implementation itself is non-optimal. I'll send an updated version of Dirk's patch with the "new" user interface and a new command-naming (hopefully) today.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#12 lore raw

PATCH 1/1 Add bootstrap command

In reply to Matthias Fuchs

Dear Matthias Fuchs,

Quoted 13 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Hi Dirk,

Quoted 1 line · On Wednesday 15 July 2009 16:46:12 Mike Frysinger wrote:

On Wednesday 15 July 2009 09:48:00 Dirk Eibach wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

This adds a generic command for programming I2C bootstrap eeproms. Implementation for Canyonlands board is included.

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

I agree with Mike. Please change the command name and the files to something more specific. How about "4xxbootstrap"? Or "4xxstrap"?

Quoted 7 lines

To long for my taste.

Quoted 2 lines

Any other good ideas
about this naming welcome. :)

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'. But it works

Indeed. "sbe" is not an acceptable name as nobody will know what it's suppost to mean.

Quoted 1 line

a little mit different that the bootstrap command.

Actually the name "bootstrap" command itself is something that I really dislike.

Please find a better description (avoiding "bootstrap"), and then chose a descriptive name.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A well-written program is its own heaven; a poorly-written program is
its own hell.             -- Geoffrey James, "The Tao of Programming"
#13 lore raw

PATCH 1/1 Add bootstrap command

Quoted 12 lines · Wolfgang Denk

Dear Matthias Fuchs,

Quoted 8 lines · In message<[email protected]> you wrote:
Quoted 8 lines

Hi Dirk,

Quoted 5 lines · On Wednesday 15 July 2009 16:46:12 Mike Frysinger wrote:
Quoted 2 lines · On Wednesday 15 July 2009 09:48:00 Dirk Eibach wrote:

This adds a generic command for programming I2C bootstrap eeproms. Implementation for Canyonlands board is included.

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

Quoted 7 lines
Quoted 1 line

a little mit different that the bootstrap command.

Actually the name "bootstrap" command itself is something that I really dislike.

Please find a better description (avoiding "bootstrap"), and then chose a descriptive name.

Keep in mind the processor UM documentation section that covers these boot methods is labeled "Bootstrap Operations". It refers the registers that the EEPROM values populate as "bootstrap registers", etc.

There is some logic in tying the section of the processor manual to the command. Whatever the command ends up being labeled, it would be nice if its purpose was clear to those who actually work in 4xx space.

Not to mention there is documentation referencing the current commands used by the evaluation platforms.

Regards,
-DM

#14 lore raw

PATCH 1/1 Add bootstrap command

Dear Dave Mitchell,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Please find a better description (avoiding "bootstrap"), and then chose a descriptive name.

Keep in mind the processor UM documentation section that covers these boot methods is labeled "Bootstrap Operations". It refers the registers that the EEPROM values populate as "bootstrap registers", etc.

Yes, I know. But then, bootstrapping [1] is really a name with a _very_ fuzzy meaning. It can be anything. The fact thay it was chosen in the UM documentation does't make it better - in U-Boot context I think about other activities, and in Linux context yet about other things.

Quoted 3 lines

There is some logic in tying the section of the processor manual to the command. Whatever the command ends up being labeled, it would be nice if its purpose was clear to those who actually work in 4xx space.

We are changing the CPU configuration, right? It has nothing to do with actually booting or bootstrapping? We are setting parameters that will be used by the CPU when it comes up out of reset, that's all.

So maybe we call this config_cpu ?

Quoted 2 lines

Not to mention there is documentation referencing the current commands used by the evaluation platforms.

Documentation should be updated when new software versions become available - that's a matter of fact.

[1] http://en.wikipedia.org/wiki/Bootstrap

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is impractical for  the  standard  to  attempt  to  constrain  the
behavior  of code that does not obey the constraints of the standard.
                                                          - Doug Gwyn
#15 lore raw

PATCH 1/1 Add bootstrap command

Quoted 9 lines · Wolfgang Denk

Dear Dave Mitchell,

Quoted 5 lines · In message<[email protected]> you wrote:
Quoted 2 lines

Please find a better description (avoiding "bootstrap"), and then chose a descriptive name.

Keep in mind the processor UM documentation section that covers these boot methods is labeled "Bootstrap Operations". It refers the registers that the EEPROM values populate as "bootstrap registers", etc.

Quoted 5 lines

Yes, I know. But then, bootstrapping [1] is really a name with a _very_ fuzzy meaning. It can be anything. The fact thay it was chosen in the UM documentation does't make it better - in U-Boot context I think about other activities, and in Linux context yet about other things.

In general, the term does have a "fuzzy" meaning. But within the AMCC 4xx processors, it does not. And we are talking about a command that would only be available to AMCC 4xx processors.

A command that's been in use on several U-Boot 4xx ports for some time.

Quoted 8 lines
Quoted 4 lines

There is some logic in tying the section of the processor manual to the command. Whatever the command ends up being labeled, it would be nice if its purpose was clear to those who actually work in 4xx space.

We are changing the CPU configuration, right? It has nothing to do with actually booting or bootstrapping? We are setting parameters that will be used by the CPU when it comes up out of reset, that's all.

It does actually allow you to set the boot ROM location, just FYI.

Quoted 8 lines

So maybe we call this config_cpu ?

Quoted 2 lines

Not to mention there is documentation referencing the current commands used by the evaluation platforms.

Documentation should be updated when new software versions become available - that's a matter of fact.

Of course. And I suppose I'm wasting energy typing since you have already made up your mind on the subject but no harm in trying.

Best regards,
-DM

#16 lore raw

PATCH 1/1 Add bootstrap command

Quoted 10 lines · On Friday 17 July 2009 02:12:45 Dave Mitchell wrote:
Quoted 9 lines
Quoted 3 lines

Keep in mind the processor UM documentation section that covers these boot methods is labeled "Bootstrap Operations". It refers the registers that the EEPROM values populate as "bootstrap registers", etc.

Yes, I know. But then, bootstrapping [1] is really a name with a _very_ fuzzy meaning. It can be anything. The fact thay it was chosen in the UM documentation does't make it better - in U-Boot context I think about other activities, and in Linux context yet about other things.

Quoted 5 lines

In general, the term does have a "fuzzy" meaning. But within the AMCC 4xx processors, it does not. And we are talking about a command that would only be available to AMCC 4xx processors.

A command that's been in use on several U-Boot 4xx ports for some time.

I'm aware of this fact. And changing this name is of course non-optimal. But from my point of view, the advantages of enhancing this command and making it easier usable/portable for all 4xx boards overweight this disadvantage.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#17 lore raw

PATCH 1/1 Add bootstrap command

In reply to Dave Mitchell

Dear Dave Mitchell,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 6 lines

Yes, I know. But then, bootstrapping [1] is really a name with a _very_ fuzzy meaning. It can be anything. The fact thay it was chosen in the UM documentation does't make it better - in U-Boot context I think about other activities, and in Linux context yet about other things.

Quoted 5 lines

In general, the term does have a "fuzzy" meaning. But within the AMCC 4xx processors, it does not. And we are talking about a command that would only be available to AMCC 4xx processors.

A command that's been in use on several U-Boot 4xx ports for some time.

Right. and now we are generalizing it to add a common command for all these boards - and actually for other architectures as well. We will have to suffer from a changed command name, but we win by better functionality, and less code duplication.

Quoted 2 lines

Of course. And I suppose I'm wasting energy typing since you have already made up your mind on the subject but no harm in trying.

I appreciate your comments, and you know that I rate your opinion highly; but in this case my more global perspective sets other priorities than your more 4xx-focussed POV. Sorry.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You see things; and you say ``Why?'' But I dream  things  that  never
were; and I say ``Why not?''
       - George Bernard Shaw _Back to Methuselah_ (1921) pt. 1, act 1
#18 lore raw

PATCH 1/1 Add bootstrap command

In reply to Wolfgang Denk
Quoted 27 lines

Dear Matthias Fuchs,

Quoted 13 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Hi Dirk,

Quoted 1 line · On Wednesday 15 July 2009 16:46:12 Mike Frysinger wrote:

On Wednesday 15 July 2009 09:48:00 Dirk Eibach wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

This adds a generic command for programming I2C bootstrap eeproms. Implementation for Canyonlands board is included.

"bootstrap" is pretty generic. can you pick something a little more descriptive/specific ?

I agree with Mike. Please change the command name and the files to something more specific. How about "4xxbootstrap"? Or "4xxstrap"?

Quoted 7 lines

To long for my taste.

Quoted 2 lines

Any other good ideas
about this naming welcome. :)

We called this command "sbe" on our PMC440 (440EPx) and upcoming PMC405DE (405EP) board. I must admit that I forget its meaning. Probably something like 'setup bootstrap eeprom'. But it works

Indeed. "sbe" is not an acceptable name as nobody will know what it's suppost to mean.

Quoted 7 lines
Quoted 1 line

a little mit different that the bootstrap command.

Actually the name "bootstrap" command itself is something that I really dislike.

Please find a better description (avoiding "bootstrap"), and then chose a descriptive name.

ccc - config chip|cpu configuration scc - setup chip|cpu configuration wcc - write chip|cpu configuration wcce - write chip|cpu configuration eeprom

I am not a friend of long names :-)

Matthias

#19 lore raw

PATCH 1/1 Add bootstrap command

Dear Matthias Fuchs,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Please find a better description (avoiding "bootstrap"), and then chose a descriptive name.

ccc - config chip|cpu configuration scc - setup chip|cpu configuration wcc - write chip|cpu configuration wcce - write chip|cpu configuration eeprom

Which of these will you still remember after the third glass of beer? ;-)

Quoted 1 line

I am not a friend of long names :-)

Neiter am I. But there are some basic rules for user interface design. Short commands should only be used for "harmless" operations. Long names are OK for critical actions where you better should have your brain online and not only your fingers continue to type

something  after  the  brain  detached. And short commands should bne
used  for  frequently  used  commands,  while  long,  self-explaining

commands are OK for more exotic operations.

This _is_ a thing that requires attention, and you do not need it frequently - I guess if you run statistics about command usage it will be in the bottom 5% - agreed?

So a long name is perfect.

Something like "config_cpu" or "set_cpu_config" etc. (and the
underscore is intentional to make you think twice what you are doing here).

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I'm what passes for a Unix guru in my office. This is  a  frightening
concept. - Lee Ann Goldstein, in <[email protected]>
#20 lore raw

PATCH 1/1 Add bootstrap command

In reply to Dirk Eibach

Please see my comments below.

On Wednesday 15 July 2009 15:48, Dirk Eibach wrote:

...

Quoted 50 lines
common/cmd_bootstrap.c new file +44 -0
new file mode 100644
index 0000000..6fceb23
@@ -0,0 +1,75 @@
+/*
+ * (C) Copyright 2009
+ * Dirk Eibach,  Guntermann & Drunck GmbH, eibach at gdsys.de
+ *
+ * based on code (C) Copyright 2008
+ * Stefan Roese, DENX Software Engineering, sr at denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include <bootstrap.h>
+#include <common.h>
+#include <command.h>
+#include <i2c.h>
+#include <asm/io.h>
+
+static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	int x, nbytes, selcfg;
+	extern char console_buffer[];
+
+	printf("Available configurations: \n\n");
+
+	for (x = 0; bootstrap_config_labels[x][0] != 0; x++)
+		printf(" %d - %s\n", (x+1), bootstrap_config_labels[x]);
+
+	do {

common/cmd_bootstrap.c line 54

Quoted 10 lines
common/cmd_bootstrap.c new file +10 -0
+		nbytes = readline(" Selection [1-x / quit]: ");
+
+		if (nbytes) {
+			if (strcmp(console_buffer, "quit") == 0)
+				return 0;
+			selcfg = simple_strtol(console_buffer, NULL, 10);
+			if ((selcfg < 1) || (selcfg > x))
+				nbytes = 0;
+		}
+	} while (nbytes == 0);

Do we really need to have this interactive? At least it would be fine to use "bootstrap 4" to get the fourth configuration.
So when an additional parameter ist passed to bootstrap you could bypass alle the printf stuff and directly update the EEPROM.

common/cmd_bootstrap.c line 65

Quoted 11 lines
common/cmd_bootstrap.c new file +11 -0
+
+
+	x = (selcfg - 1);
+
+	if (i2c_write(CONFIG_BOOTSTRAP_I2C_EEPROM_ADDR, 0, 1,
+		bootstrap_configs[x], CONFIG_BOOTSTRAP_BLOCKSIZE) != 0)
+		printf("Error writing to EEPROM at address 0x%x\n",
+			CONFIG_BOOTSTRAP_I2C_EEPROM_ADDR);
+	udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
+
+	printf("Done\n");

Can't we life without this 'Done' message?

common/cmd_bootstrap.c line 66

Quoted 1 line
common/cmd_bootstrap.c new file +1 -0
+	printf("Please power-cycle the board for the changes to take effect\n");

At least for 440EPx and 405EP calling 'reset' is enough and much easier for scripting :-)

Matthias