u-boot/tools/bddb
wdenk 6dd652fa4d Patches by Murray Jensen, 17 Jun 2003:
- Hymod board database mods: add "who" field and new xilinx chip types
- provide new "init_cmd_timeout()" function so code external to
  "common/main.c" can use the "reset_cmd_timeout()" function before
  entering the main loop
- add DTT support for adm1021 (new file dtt/adm1021.c; config
  slightly different. see include/configs/hymod.h for an example
  (requires CONFIG_DTT_ADM1021, CONFIG_DTT_SENSORS, and
  CFG_DTT_ADM1021 defined)
- add new "eeprom_probe()" function which has similar args and
  behaves in a similar way to "eeprom_read()" etc.
- add 8260 FCC ethernet loopback code (new "eth_loopback_test()"
  function which is enabled by defining CONFIG_ETHER_LOOPBACK_TEST)
- gdbtools copyright update
- ensure that set_msr() executes the "sync" and "isync" instructions
  after the "mtmsr" instruction in cpu/mpc8260/interrupts.c
- 8260 I/O ports fix: Open Drain should be set last when configuring
- add SIU IRQ defines for 8260
- allow LDSCRIPT override and OBJCFLAGS initialization: change to
  config.mk to allow board configurations to override the GNU
  linker script, selected via the LDSCRIPT, make variable, and to
  give an initial value to the OBJCFLAGS make variable
- 8260 i2c enhancement:
  o correctly extends the timeout depending on the size of all
    queued messages for both transmit and receive
  o will not continue with receive if transmit times out
  o ensures that the error callback is done for all queued tx
    and rx messages
  o correctly detects both tx and rx timeouts, only delivers one to
    the callback, and does not overwrite an earlier error
  o logic in i2c_probe now correct
- add "vprintf()" function so that "panic()" function can be
  technically correct
- many Hymod board changes
2003-06-19 23:40:20 +00:00
..
badsubmit.php Initial revision 2001-08-05 15:35:05 +00:00
bddb.css Initial revision 2002-03-08 21:31:05 +00:00
brlog.php Patches by Murray Jensen, 17 Jun 2003: 2003-06-19 23:40:20 +00:00
browse.php Initial revision 2002-11-03 00:38:21 +00:00
config.php Initial revision 2002-11-03 00:38:21 +00:00
create_tables.sql Initial revision 2002-11-03 00:38:21 +00:00
defs.php Patches by Murray Jensen, 17 Jun 2003: 2003-06-19 23:40:20 +00:00
dodelete.php Initial revision 2002-11-03 00:38:21 +00:00
dodellog.php Initial revision 2002-11-03 00:38:21 +00:00
doedit.php Initial revision 2002-11-03 00:38:21 +00:00
doedlog.php Patches by Murray Jensen, 17 Jun 2003: 2003-06-19 23:40:20 +00:00
donew.php Initial revision 2002-11-03 00:38:21 +00:00
donewlog.php Patches by Murray Jensen, 17 Jun 2003: 2003-06-19 23:40:20 +00:00
edit.php Initial revision 2002-11-03 00:38:21 +00:00
edlog.php Patches by Murray Jensen, 17 Jun 2003: 2003-06-19 23:40:20 +00:00
execute.php Initial revision 2002-11-03 00:38:21 +00:00
index.php Initial revision 2002-11-03 00:38:21 +00:00
new.php Initial revision 2002-11-03 00:38:21 +00:00
newlog.php Patches by Murray Jensen, 17 Jun 2003: 2003-06-19 23:40:20 +00:00
README Initial revision 2002-11-03 00:38:21 +00:00

Hymod Board Database

(C) Copyright 2001
Murray Jensen <Murray.Jensen@cmst.csiro.au>
CSIRO Manufacturing Science and Technology, Preston Lab

25-Jun-01

This stuff is a set of PHP/MySQL scripts to implement a custom board
database. It will need *extensive* hacking to modify it to keep the
information about your custom boards that you want, however it is a good
starting point.

How it is used:

	1. a board has gone through all the hardware testing etc and is
	   ready to have the flash programmed for the first time - first you
	   go to a web page and fill in information about the board in a form
	   to register it in a database

	2. the web stuff allocates a (unique) serial number and (optionally)
	   a (locally administered) ethernet address and stores the information
	   in a database using the serial number as the key (can do whole
	   batches of boards in one go and/or use a previously registered board
	   as defaults for the new board(s))

	3. it then creates a file in the tftp area of a server somewhere
	   containing the board information in a simple text format (one
	   per serial number)

	4. all hymod boards have an i2c eeprom, and when U-Boot sees that
	   the eeprom is unitialised, it prompts for a serial number and
	   ethernet address (if not set), then transfers the file created
	   in step 3 from the server and initialises the eeprom from its
	   contents

What this means is you can't boot the board until you have allocated a serial
number, but you don't have to type it all twice - you do it once on the web
and the board then finds the info it needs to initialise its eeprom. The
other side of the coin is the reading of the eeprom and how it gets passed
to Linux (or another O/S).

To see how this is all done for the hymod boards look at the code in the
"board/hymod" directory and in the file "include/asm/hymod.h". Hymod boards
can have a mezzanine card which also have an eeprom that needs allocating,
the same process is used for these as well - just a different i2c address.

Other forms provide the following functions:

	- browsing the board database
	- editing board information (one at a time)
	- maintaining/browsing a (simple) per board event log

You will need: MySQL (I use version 3.23.7-alpha), PHP4 (with MySQL
support enabled) and a web server (I use Apache 1.3.x).

I originally started by using phpMyBuilder (http://kyber.dk/phpMyBuilder)
but it soon got far more complicated than that could handle (but I left
the copyright messages in there anyway). Most of the code resides in the
common defs.php file, which shouldn't need much alteration - all the work
will be in shaping the front-end php files to your liking.

Here's a quick summary of what needs doing to use it for your boards:

1. get phpMyAdmin (http://phpwizard.net/projects/phpMyAdmin/) - it's an
   invaluable tool for this sort of stuff (this step is optional of course)

2. edit "bddb.css" to your taste, if you could be bothered - I have no
   idea what is in there or what it does - I copied it from somewhere else
   ("user.css" from the phpMyEdit (http://phpmyedit.sourcerforge.net) package,
   I think) - I figure one day I'll see what sort of things I can change
   in there.

3. create a mysql database - call it whatever you like

4. edit "create_tables.sql" and modify the "boards" table schema to
   reflect the information you want to keep about your boards. It may or
   may not be easier to do this and the next step in phpMyAdmin. Check out
   the MySQL documentation at http://www.mysql.com/doc/ in particular the
   column types at http://www.mysql.com/doc/C/o/Column_types.html - Note
   there is only support for a few data types:

	int		- presented as an html text input
	char/text	- presented as an html text input
	date		- presented as an html text input
	enum		- presented as an html radio input

   I also have what I call "enum_multi" which is a set of enums with the
   same name, but suffixed with a number e.g. fred0, fred1, fred2. These
   are presented as a number of html select's with a single label "fred"
   this is useful for board characteristics that have multiple items of
   the same type e.g. multiple banks of sdram.

5. use the "create_tables.sql" file to create the "boards" table in the
   database e.g. mysql dbname < create_tables.sql

6. create a user and password for the web server to log into the MySQL
   database with; give this user select, insert and update privileges
   to the database created in 3 (and delete, if you want the "delete"
   functions in the edit forms to work- I have this turned off). phpMyAdmin
   helps in this step.

7. edit "config.php" and set the variables: $mysql_user, $mysql_pw, $mysql_db,
   $bddb_cfgdir and $bddb_label - keep the contents of this file secret - it
   contains the web servers username and password (the three $mysql_* vars
   are set from the previous step)

8. edit "defs.php" and a. adjust the various enum value arrays and b. edit
   the function "pg_foot()" to remove my email address :-)

9. do major hacking on the following files: browse.php, doedit.php, donew.php,
   edit.php and new.php to reflect your database schema - fortunately the
   hacking is fairly straight-forward, but it is boring and time-consuming.

These notes were written rather hastily - if you find any obvious problems
please let me know.