From 3f2546b2ef55b661fd8dd69682b38992225e86f6 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Mon, 29 Apr 2019 01:17:54 +0100 Subject: Initial import of qemu-2.4.1 --- roms/u-boot/tools/bddb/README | 116 +++++ roms/u-boot/tools/bddb/badsubmit.php | 23 + roms/u-boot/tools/bddb/bddb.css | 207 +++++++++ roms/u-boot/tools/bddb/brlog.php | 109 +++++ roms/u-boot/tools/bddb/browse.php | 147 +++++++ roms/u-boot/tools/bddb/config.php | 16 + roms/u-boot/tools/bddb/create_tables.sql | 90 ++++ roms/u-boot/tools/bddb/defs.php | 710 +++++++++++++++++++++++++++++++ roms/u-boot/tools/bddb/dodelete.php | 65 +++ roms/u-boot/tools/bddb/dodellog.php | 57 +++ roms/u-boot/tools/bddb/doedit.php | 186 ++++++++ roms/u-boot/tools/bddb/doedlog.php | 76 ++++ roms/u-boot/tools/bddb/donew.php | 230 ++++++++++ roms/u-boot/tools/bddb/donewlog.php | 86 ++++ roms/u-boot/tools/bddb/edit.php | 131 ++++++ roms/u-boot/tools/bddb/edlog.php | 86 ++++ roms/u-boot/tools/bddb/execute.php | 33 ++ roms/u-boot/tools/bddb/index.php | 38 ++ roms/u-boot/tools/bddb/new.php | 120 ++++++ roms/u-boot/tools/bddb/newlog.php | 54 +++ 20 files changed, 2580 insertions(+) create mode 100644 roms/u-boot/tools/bddb/README create mode 100644 roms/u-boot/tools/bddb/badsubmit.php create mode 100644 roms/u-boot/tools/bddb/bddb.css create mode 100644 roms/u-boot/tools/bddb/brlog.php create mode 100644 roms/u-boot/tools/bddb/browse.php create mode 100644 roms/u-boot/tools/bddb/config.php create mode 100644 roms/u-boot/tools/bddb/create_tables.sql create mode 100644 roms/u-boot/tools/bddb/defs.php create mode 100644 roms/u-boot/tools/bddb/dodelete.php create mode 100644 roms/u-boot/tools/bddb/dodellog.php create mode 100644 roms/u-boot/tools/bddb/doedit.php create mode 100644 roms/u-boot/tools/bddb/doedlog.php create mode 100644 roms/u-boot/tools/bddb/donew.php create mode 100644 roms/u-boot/tools/bddb/donewlog.php create mode 100644 roms/u-boot/tools/bddb/edit.php create mode 100644 roms/u-boot/tools/bddb/edlog.php create mode 100644 roms/u-boot/tools/bddb/execute.php create mode 100644 roms/u-boot/tools/bddb/index.php create mode 100644 roms/u-boot/tools/bddb/new.php create mode 100644 roms/u-boot/tools/bddb/newlog.php (limited to 'roms/u-boot/tools/bddb') diff --git a/roms/u-boot/tools/bddb/README b/roms/u-boot/tools/bddb/README new file mode 100644 index 00000000..9bee59a0 --- /dev/null +++ b/roms/u-boot/tools/bddb/README @@ -0,0 +1,116 @@ +Hymod Board Database + +(C) Copyright 2001 +Murray Jensen +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. diff --git a/roms/u-boot/tools/bddb/badsubmit.php b/roms/u-boot/tools/bddb/badsubmit.php new file mode 100644 index 00000000..5092a319 --- /dev/null +++ b/roms/u-boot/tools/bddb/badsubmit.php @@ -0,0 +1,23 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + require("defs.php"); + pg_head("$bddb_label - Unknown Submit Type"); +?> +
+ + + The form was submitted with an + unknown SUBMIT type . +

+ Perhaps you typed the URL in directly? Click here to go to the + home page of the . +
+
+
+ diff --git a/roms/u-boot/tools/bddb/bddb.css b/roms/u-boot/tools/bddb/bddb.css new file mode 100644 index 00000000..dee2b2ee --- /dev/null +++ b/roms/u-boot/tools/bddb/bddb.css @@ -0,0 +1,207 @@ +BODY { + background: #e0ffff; + color: #000000; + font-family: Arial, Verdana, Helvetica; +} +H1 { + font-family: "Copperplate Gothic Bold"; + background: transparent; + color: #993300; + text-align: center; +} +H2, H3, H4, H5 { + background: transparent; + color: #993300; + margin-top: 4%; + text-align: center; +} +Body.Plain Div.Abstract, Body.Plain P.Abstract { + background: #cccc99; + color: #333300; + border: white; + padding: 3%; + font-family: Times, Verdana; +} +TH.Nav { + background: #0000cc; + color: #ff9900; +} +TH.Menu { + background: #3366cc; + color: #ff9900; +} +A:hover { + color: #ff6600; +} +A.Menu:hover { + color: #ff6600; +} +A.HoMe:hover { + color: #ff6600; +} +A.Menu { + background: transparent; + color: #ffcc33; + font-family: Verdana, Helvetica, Arial; + font-size: smaller; + text-decoration: none; +} +A.Menu:visited { + background: transparent; + color: #ffcc99; +} +A.HoMe { + background: transparent; + color: #ffcc33; + font-family: Verdana, Helvetica, Arial; + text-decoration:none; +} +A.HoMe:visited { + background: transparent; + color: #ffcc99; +} +TH.Xmp { + background: #eeeeee; + color: #330066; + font-family: courier; + font-weight: normal; +} +TH.LuT { + background: #cccccc; + color: #000000; +} +TD.LuT { + background: #ffffcc; + color: #000000; + font-size: 85%; +} +TH.Info, TD.Info { + background: #ffffcc; + color: #660000; + font-family: "Comic Sans MS", Cursive, Verdana; + font-size: smaller; +} +Div.Info, P.Info { + background: #ffff99; + color: #990033; + text-align: left; + padding: 2%; + font-family: "Comic Sans MS", Cursive, Verdana; + font-size: 85%; + } +Div.Info A { + background: transparent; + color: #ff6600; +} +.HL { + background: #ffff99; + color: #000000; +} +TD.HL { + background: #ccffff; + color: #000000; +} +Div.Margins { + width: 512px; + text-align: center; +} +TD.Plain { + background: #ffffcc; + color: #000033; +} +.Type { + background: #cccccc; + color: #660000; +} +.Name { + background: #eeeeee; + color: #660000; + vertical-align: top; + text-align: right; +} +.Value { + background: #ffffee; + color: #000066; +} +.Drop { + background: #333366; + color: #ffcc33; + font-family: "Copperplate Gothic Light", Helvetica, Verdana, Arial; +} +A.Button:hover { + color: #ff6600; +} +A.Button { + text-decoration:none; + color: #003366; + background: #ffcc66; +} +.Button { + font-size: 9pt; + text-align: center; + text-decoration:none; + color: #003366; + background: #ffcc66; + margin-bottom: 2pt; + border-top: 2px solid #ffff99; + border-left: 2px solid #ffff99; + border-right: 2px solid #cc9933; + border-bottom: 2px solid #cc9933; + font-family: Verdana, Arial, "Comic Sans MS"; +} +.Banner { + width: 468; + font-size: 12pt; + text-align: center; + text-decoration:none; + color: #003366; + background: #ffcc66; + border-top: 4px solid #ffff99; + border-left: 4px solid #ffff99; + border-right: 4px solid #cc9933; + border-bottom: 4px solid #cc9933; + font-family: Verdana, Arial, "Comic Sans MS"; +} +TD.Nova, Body.Nova { + background: #000000; + font-family: "Times New Roman"; + font-weight: light; + color: #ffcc00; +} +Body.Nova A.Button { + background: gold; + color: #003366; +} +Body.Nova A.Banner { + background: transparent; + color: #003366; +} +Body.Nova A { + background: transparent; + text-decoration:none; + color: #ffd766; +} +Body.Nova H1, Body.Nova H2, Body.Nova H3, Body.Nova H4 { + background: transparent; + color: white; + margin-top: 4%; + text-align: center; + filter: Blur(Add=1, Direction=0, Strength=8); +} +Body.Nova Div.Abstract { + background: #000000; + color: #ffffff; + font-family: Times, Verdana; +} +Body.Nova A.Abstract { + background: transparent; + color: #ffeedd; +} +Body.Nova TH.LuT { + background: black; + color: #ffff99; +} +Body.Nova TD.LuT { + background: navy; + color: #ffff99; +} diff --git a/roms/u-boot/tools/bddb/brlog.php b/roms/u-boot/tools/bddb/brlog.php new file mode 100644 index 00000000..fccfbd01 --- /dev/null +++ b/roms/u-boot/tools/bddb/brlog.php @@ -0,0 +1,109 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // list page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Browse Board Log"); + + $serno=intval($serno); + if ($serno == 0) + die("serial number not specified or invalid!"); + + function print_cell($str) { + if ($str == '') + $str = ' '; + echo "\t$str\n"; + } +?> + + + + + + + + + + +\n"; + print_cell("$row[serno]"); + print_cell($row['ethaddr']); + print_cell($row['date']); + print_cell($row['batch']); + print_cell($row['type']); + print_cell($row['rev']); + print_cell($row['location']); + echo "\n"; + } + + mysql_free_result($r); +?> +
serno / editethaddrdatebatchtyperevlocation
+
+

+$limit){ + $preoffset=max(0,$offset-$limit); + $postoffset=$offset+$limit; + echo "\n\n"; + printf("\n", $offset>0?"":"no", $PHP_SELF, $preoffset); + printf("\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset); + echo "\n
<%sa href=\"%s?submit=Log&serno=$serno&offset=%d\">\"<\"<%sa href=\"%s?submit=Log&serno=$serno&offset=%d\">\">\"
\n"; + } + mysql_free_result($lr); +?> + + + + + + + +\n"; + print_cell("$row[logno]"); + print_cell($row['date']); + print_cell($row['who']); + print_cell("
" . urldecode($row['details']) . "
"); + echo "\n"; + } + + mysql_free_result($r); +?> +
logno / editdatewhodetails
+
+

+ + + + + +
+ ">Add to Log + + Back to Start +
+ diff --git a/roms/u-boot/tools/bddb/browse.php b/roms/u-boot/tools/bddb/browse.php new file mode 100644 index 00000000..675dfab7 --- /dev/null +++ b/roms/u-boot/tools/bddb/browse.php @@ -0,0 +1,147 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // list page (hymod_bddb / boards) + + require("defs.php"); + + $serno=isset($_REQUEST['serno'])?$_REQUEST['serno']:''; + + $verbose=isset($_REQUEST['verbose'])?intval($_REQUEST['verbose']):0; + + pg_head("$bddb_label - Browse database" . ($verbose?" (verbose)":"")); +?> +

+$limit){ + $preoffset=max(0,$offset-$limit); + $postoffset=$offset+$limit; + echo "\n\n"; + printf("\n", $offset>0?"":"no", $PHP_SELF, $preoffset, $verbose); + printf("\n", $postoffset<$lrow['n']?"":"no", $PHP_SELF, $postoffset, $offset); + echo "\n
<%sa href=\"%s?submit=Browse&offset=%d&verbose=%d\">\"<\"<%sa href=\"%s?submit=Browse&offset=%d&verbose=%d\">\">\"
\n"; + } + + mysql_free_result($lr); + } +?> + + + + + + + + + + +comments\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } +?> + +=$m[1] and serno<=$m[2])"; + } + else + die("illegal serial number ($s)"); + $pre = " or "; + } + } + $query .= " order by serno"; + if ($serno == '') + $query .= " limit $offset,$limit"; + + $r = mysql_query($query); + + function print_cell($str) { + if ($str == '') + $str = ' '; + echo "\t\n"; + } + + while($row=mysql_fetch_array($r)){ + foreach ($columns as $key) { + if (!key_in_array($key, $row)) + $row[$key] = ''; + } + + echo "\n"; + print_cell("Log"); + print_cell("$row[serno]"); + print_cell($row['ethaddr']); + print_cell($row['date']); + print_cell($row['batch']); + print_cell($row['type']); + print_cell($row['rev']); + print_cell($row['location']); + if ($verbose) { + print_cell("
\n" . urldecode($row['comments']) .
+				"\n\t
"); + print_cell(gather_enum_multi_print("sdram", 4, $row)); + print_cell(gather_enum_multi_print("flash", 4, $row)); + print_cell(gather_enum_multi_print("zbt", 16, $row)); + print_cell(gather_enum_multi_print("xlxtyp", 4, $row)); + print_cell(gather_enum_multi_print("xlxspd", 4, $row)); + print_cell(gather_enum_multi_print("xlxtmp", 4, $row)); + print_cell(gather_enum_multi_print("xlxgrd", 4, $row)); + print_cell($row['cputyp']); + print_cell($row['cpuspd']); + print_cell($row['cpmspd']); + print_cell($row['busspd']); + print_cell($row['hstype']); + print_cell($row['hschin']); + print_cell($row['hschout']); + } + echo "\n"; + } +?> +
serno / editethaddrdatebatchtyperevlocationsdramflashzbtxlxtypxlxspdxlxtmpxlxgrdcputypcpuspdcpmspdbusspdhstypehschinhschout
$str
+

+ + + + + +
%s Listing\n", $PHP_SELF, $offset, $verbose?0:1, $serno!=''?"&serno=$serno":'', $verbose?"Terse":"Verbose"); + ?>Back to Start
+ diff --git a/roms/u-boot/tools/bddb/config.php b/roms/u-boot/tools/bddb/config.php new file mode 100644 index 00000000..67257578 --- /dev/null +++ b/roms/u-boot/tools/bddb/config.php @@ -0,0 +1,16 @@ + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // mysql database access info + $mysql_user="fred"; + $mysql_pw="apassword"; + $mysql_db="mydbname"; + + // where to put the eeprom config files + $bddb_cfgdir = '/tftpboot/bddb'; + + // what this database is called + $bddb_label = 'Hymod Board Database'; +?> diff --git a/roms/u-boot/tools/bddb/create_tables.sql b/roms/u-boot/tools/bddb/create_tables.sql new file mode 100644 index 00000000..a2a57886 --- /dev/null +++ b/roms/u-boot/tools/bddb/create_tables.sql @@ -0,0 +1,90 @@ +# phpMyAdmin MySQL-Dump +# http://phpwizard.net/phpMyAdmin/ +# +# Host: localhost Database : hymod_bddb + +# (C) Copyright 2001 +# Murray Jensen +# CSIRO Manufacturing and Infrastructure Technology, Preston Lab + +# -------------------------------------------------------- +# +# Table structure for table 'boards' +# + +DROP TABLE IF EXISTS boards; +CREATE TABLE boards ( + serno int(10) unsigned zerofill NOT NULL auto_increment, + ethaddr char(17), + date date NOT NULL, + batch char(32), + type enum('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY') NOT NULL, + rev tinyint(3) unsigned zerofill NOT NULL, + location char(64), + comments text, + sdram0 enum('32M','64M','128M','256M','512M','1G','2G','4G'), + sdram1 enum('32M','64M','128M','256M','512M','1G','2G','4G'), + sdram2 enum('32M','64M','128M','256M','512M','1G','2G','4G'), + sdram3 enum('32M','64M','128M','256M','512M','1G','2G','4G'), + flash0 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'), + flash1 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'), + flash2 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'), + flash3 enum('4M','8M','16M','32M','64M','128M','256M','512M','1G'), + zbt0 enum('512K','1M','2M','4M','8M','16M'), + zbt1 enum('512K','1M','2M','4M','8M','16M'), + zbt2 enum('512K','1M','2M','4M','8M','16M'), + zbt3 enum('512K','1M','2M','4M','8M','16M'), + zbt4 enum('512K','1M','2M','4M','8M','16M'), + zbt5 enum('512K','1M','2M','4M','8M','16M'), + zbt6 enum('512K','1M','2M','4M','8M','16M'), + zbt7 enum('512K','1M','2M','4M','8M','16M'), + zbt8 enum('512K','1M','2M','4M','8M','16M'), + zbt9 enum('512K','1M','2M','4M','8M','16M'), + zbta enum('512K','1M','2M','4M','8M','16M'), + zbtb enum('512K','1M','2M','4M','8M','16M'), + zbtc enum('512K','1M','2M','4M','8M','16M'), + zbtd enum('512K','1M','2M','4M','8M','16M'), + zbte enum('512K','1M','2M','4M','8M','16M'), + zbtf enum('512K','1M','2M','4M','8M','16M'), + xlxtyp0 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'), + xlxtyp1 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'), + xlxtyp2 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'), + xlxtyp3 enum('XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'), + xlxspd0 enum('6','7','8','4','5','9','10','11','12'), + xlxspd1 enum('6','7','8','4','5','9','10','11','12'), + xlxspd2 enum('6','7','8','4','5','9','10','11','12'), + xlxspd3 enum('6','7','8','4','5','9','10','11','12'), + xlxtmp0 enum('COM','IND'), + xlxtmp1 enum('COM','IND'), + xlxtmp2 enum('COM','IND'), + xlxtmp3 enum('COM','IND'), + xlxgrd0 enum('NORMAL','ENGSAMP'), + xlxgrd1 enum('NORMAL','ENGSAMP'), + xlxgrd2 enum('NORMAL','ENGSAMP'), + xlxgrd3 enum('NORMAL','ENGSAMP'), + cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)','MPC8560'), + cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ'), + cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ'), + busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ'), + hstype enum('AMCC-S2064A','Xilinx-Rockets'), + hschin enum('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'), + hschout enum('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'), + PRIMARY KEY (serno), + KEY serno (serno), + UNIQUE serno_2 (serno) +); + +# +# Table structure for table 'log' +# + +DROP TABLE IF EXISTS log; +CREATE TABLE log ( + logno int(10) unsigned zerofill NOT NULL auto_increment, + serno int(10) unsigned zerofill NOT NULL, + date date NOT NULL, + details text NOT NULL, + PRIMARY KEY (logno), + KEY logno (logno, serno, date), + UNIQUE logno_2 (logno) +); diff --git a/roms/u-boot/tools/bddb/defs.php b/roms/u-boot/tools/bddb/defs.php new file mode 100644 index 00000000..0b506028 --- /dev/null +++ b/roms/u-boot/tools/bddb/defs.php @@ -0,0 +1,710 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // contains mysql user id and password - keep secret + require("config.php"); + + if (isset($_REQUEST['logout'])) { + Header("status: 401 Unauthorized"); + Header("HTTP/1.0 401 Unauthorized"); + Header("WWW-authenticate: basic realm=\"$bddb_label\""); + + echo "" . + "Access to '$bddb_label' Denied" . + "\n"; + echo "



" . + "You must be an Authorised User " . + "to access the '$bddb_label'" . + "

\n
\n"; + exit; + } + + // contents of the various enumerated types - if first item is + // empty ('') then the enum is allowed to be null (ie "not null" + // is not set on the column) + + // all column names in the database table + $columns = array( + 'serno','ethaddr','date','batch', + 'type','rev','location','comments', + 'sdram0','sdram1','sdram2','sdram3', + 'flash0','flash1','flash2','flash3', + 'zbt0','zbt1','zbt2','zbt3','zbt4','zbt5','zbt6','zbt7', + 'zbt8','zbt9','zbta','zbtb','zbtc','zbtd','zbte','zbtf', + 'xlxtyp0','xlxtyp1','xlxtyp2','xlxtyp3', + 'xlxspd0','xlxspd1','xlxspd2','xlxspd3', + 'xlxtmp0','xlxtmp1','xlxtmp2','xlxtmp3', + 'xlxgrd0','xlxgrd1','xlxgrd2','xlxgrd3', + 'cputyp','cpuspd','cpmspd','busspd', + 'hstype','hschin','hschout' + ); + + // board type + $type_vals = array('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY'); + + // Xilinx fpga types + $xlxtyp_vals = array('','XCV300E','XCV400E','XCV600E','XC2V2000','XC2V3000','XC2V4000','XC2V6000','XC2VP2','XC2VP4','XC2VP7','XC2VP20','XC2VP30','XC2VP50','XC4VFX20','XC4VFX40','XC4VFX60','XC4VFX100','XC4VFX140'); + + // Xilinx fpga speeds + $xlxspd_vals = array('','6','7','8','4','5','9','10','11','12'); + + // Xilinx fpga temperatures (commercial or industrial) + $xlxtmp_vals = array('','COM','IND'); + + // Xilinx fpga grades (normal or engineering sample) + $xlxgrd_vals = array('','NORMAL','ENGSAMP'); + + // CPU types + $cputyp_vals = array('','MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)','MPC8560'); + + // CPU/BUS/CPM clock speeds + $clk_vals = array('','33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ','300MHZ','333MHZ','366MHZ','400MHZ','433MHZ','466MHZ','500MHZ','533MHZ','566MHZ','600MHZ','633MHZ','666MHZ','700MHZ','733MHZ','766MHZ','800MHZ','833MHZ','866MHZ','900MHZ','933MHZ','966MHZ','1000MHZ','1033MHZ','1066MHZ','1100MHZ','1133MHZ','1166MHZ','1200MHZ','1233MHZ','1266MHZ','1300MHZ','1333MHZ'); + + // sdram sizes (nbits array is for eeprom config file) + $sdram_vals = array('','32M','64M','128M','256M','512M','1G','2G','4G'); + $sdram_nbits = array(0,25,26,27,28,29,30,31,32); + + // flash sizes (nbits array is for eeprom config file) + $flash_vals = array('','4M','8M','16M','32M','64M','128M','256M','512M','1G'); + $flash_nbits = array(0,22,23,24,25,26,27,28,29,30); + + // zbt ram sizes (nbits array is for write into eeprom config file) + $zbt_vals = array('','512K','1M','2M','4M','8M','16M'); + $zbt_nbits = array(0,19,20,21,22,23,24); + + // high-speed serial attributes + $hstype_vals = array('','AMCC-S2064A','Xilinx-Rockets'); + $hschin_vals = array('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'); + $hschout_vals = array('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'); + + // value filters - used when outputting html + function rev_filter($num) { + if ($num == 0) + return "001"; + else + return sprintf("%03d", $num); + } + + function text_filter($str) { + return urldecode($str); + } + + mt_srand(time() | getmypid()); + + // set up MySQL connection + mysql_connect("", $mysql_user, $mysql_pw) || die("cannot connect"); + mysql_select_db($mysql_db) || die("cannot select db"); + + // page header + function pg_head($title) + { + echo "\n\n"; + echo "\n"; + echo "$title\n"; + echo "\n"; + echo "\n"; + echo "

$title

\n"; + echo "
\n"; + } + + // page footer + function pg_foot() + { + echo "
\n"; + echo "
\n
" . + "If you have any problems, email " . + "" . + "Murray Jensen" . + "
\n" . + "
\n" . + "logout\n" . + "
\n"; + echo "

Made with " . + "" . + "Kyber phpMyBuilder

\n"; + echo "\n"; + echo "\n"; + } + + // some support functions + + if (!function_exists('array_search')) { + + function array_search($needle, $haystack, $strict = false) { + + if (is_array($haystack) && count($haystack)) { + + $ntype = gettype($needle); + + foreach ($haystack as $key => $value) { + + if ($value == $needle && (!$strict || + gettype($value) == $ntype)) + return $key; + } + } + + return false; + } + } + + if (!function_exists('in_array')) { + + function in_array($needle, $haystack, $strict = false) { + + if (is_array($haystack) && count($haystack)) { + + $ntype = gettype($needle); + + foreach ($haystack as $key => $value) { + + if ($value == $needle && (!$strict || + gettype($value) == $ntype)) + return true; + } + } + + return false; + } + } + + function key_in_array($key, $array) { + return in_array($key, array_keys($array), true); + } + + function enum_to_index($name, $vals) { + $index = array_search($GLOBALS[$name], $vals); + if ($vals[0] != '') + $index++; + return $index; + } + + // fetch a value from an array - return empty string is not present + function get_key_value($key, $array) { + if (key_in_array($key, $array)) + return $array[$key]; + else + return ''; + } + + function fprintf() { + $n = func_num_args(); + if ($n < 2) + return FALSE; + $a = func_get_args(); + $fp = array_shift($a); + $x = "\$s = sprintf"; + $sep = '('; + foreach ($a as $z) { + $x .= "$sep'$z'"; + $sep = ','; + } + $x .= ');'; + eval($x); + $l = strlen($s); + $r = fwrite($fp, $s, $l); + if ($r != $l) + return FALSE; + else + return TRUE; + } + + // functions to display (print) a database table and its columns + + function begin_table($ncols) { + global $table_ncols; + $table_ncols = $ncols; + echo "\n"; + } + + function begin_field($name, $span = 0) { + global $table_ncols; + echo "\n"; + echo "\t\n"; + if ($span <= 0) + $span = $table_ncols - 1; + if ($span > 1) + echo "\t\n"; + if ($span > 1) + echo "\t\n"; + echo "\n"; + } + + function end_table() { + echo "
$name\n"; + else + echo "\t\n"; + } + + function cont_field($span = 1) { + echo "\t\n"; + else + echo "\t\n"; + } + + function end_field() { + echo "\t
\n"; + } + + function print_field($name, $array, $size = 0, $filt='') { + + begin_field($name); + + if (key_in_array($name, $array)) + $value = $array[$name]; + else + $value = ''; + + if ($filt != '') + $value = $filt($value); + + echo "\t\t 0) + echo " size=$size maxlength=$size"; + echo ">\n"; + + end_field(); + } + + function print_field_multiline($name, $array, $cols, $rows, $filt='') { + + begin_field($name); + + if (key_in_array($name, $array)) + $value = $array[$name]; + else + $value = ''; + + if ($filt != '') + $value = $filt($value); + + echo "\t\t\n"; + + end_field(); + } + + // print a mysql ENUM as an html RADIO INPUT + function print_enum($name, $array, $vals, $def = -1) { + + begin_field($name); + + if (key_in_array($name, $array)) + $chk = array_search($array[$name], $vals, FALSE); + else + $chk = $def; + + $nval = count($vals); + + for ($i = 0; $i < $nval; $i++) { + + $val = $vals[$i]; + if ($val == '') + $pval = "none"; + else + $pval = "$val"; + + printf("\t\t$pval\n", + $i == $chk ? " checked" : ""); + } + + end_field(); + } + + // print a mysql ENUM as an html SELECT INPUT + function print_enum_select($name, $array, $vals, $def = -1) { + + begin_field($name); + + echo "\t\t\n"; + + end_field(); + } + + // print a group of mysql ENUMs (e.g. name0,name1,...) as an html SELECT + function print_enum_multi($base, $array, $vals, $cnt, $defs, $grp = 0) { + + global $table_ncols; + + if ($grp <= 0) + $grp = $cnt; + $ncell = $cnt / $grp; + $span = ($table_ncols - 1) / $ncell; + + begin_field($base, $span); + + $nval = count($vals); + + for ($i = 0; $i < $cnt; $i++) { + + if ($i > 0 && ($i % $grp) == 0) + cont_field($span); + + $name = sprintf("%s%x", $base, $i); + + echo "\t\t\n"; + } + + end_field(); + } + + // functions to handle the form input + + // fetch all the parts of an "enum_multi" into a string suitable + // for a MySQL query + function gather_enum_multi_query($base, $cnt) { + + $retval = ''; + + for ($i = 0; $i < $cnt; $i++) { + + $name = sprintf("%s%x", $base, $i); + + if (isset($_REQUEST[$name])) { + $retval .= sprintf(", %s='%s'", + $name, $_REQUEST[$name]); + } + } + + return $retval; + } + + // fetch all the parts of an "enum_multi" into a string suitable + // for a display e.g. in an html table cell + function gather_enum_multi_print($base, $cnt, $array) { + + $retval = ''; + + for ($i = 0; $i < $cnt; $i++) { + + $name = sprintf("%s%x", $base, $i); + + if ($array[$name] != '') { + if ($retval != '') + $retval .= ','; + $retval .= $array[$name]; + } + } + + return $retval; + } + + // fetch all the parts of an "enum_multi" into a string suitable + // for writing to the eeprom data file + function gather_enum_multi_write($base, $cnt, $vals, $xfrm = array()) { + + $retval = ''; + + for ($i = 0; $i < $cnt; $i++) { + + $name = sprintf("%s%x", $base, $i); + + if ($GLOBALS[$name] != '') { + if ($retval != '') + $retval .= ','; + $index = enum_to_index($name, $vals); + if ($xfrm != array()) + $retval .= $xfrm[$index]; + else + $retval .= $index; + } + } + + return $retval; + } + + // count how many parts of an "enum_multi" are actually set + function count_enum_multi($base, $cnt) { + + $retval = 0; + + for ($i = 0; $i < $cnt; $i++) { + + $name = sprintf("%s%x", $base, $i); + + if (isset($_REQUEST[$name])) + $retval++; + } + + return $retval; + } + + // ethernet address functions + + // generate a (possibly not unique) random vendor ethernet address + // (setting bit 6 in the ethernet address - motorola wise i.e. bit 0 + // is the most significant bit - means it is not an assigned ethernet + // address - it is a "locally administered" address). Also, make sure + // it is NOT a multicast ethernet address (by setting bit 7 to 0). + // e.g. the first byte of all ethernet addresses generated here will + // have 2 in the bottom two bits (incidentally, these are the first + // two bits transmitted on the wire, since the octets in ethernet + // addresses are transmitted LSB first). + + function gen_eth_addr($serno) { + + $ethaddr_hgh = (mt_rand(0, 65535) & 0xfeff) | 0x0200; + $ethaddr_mid = mt_rand(0, 65535); + $ethaddr_low = mt_rand(0, 65535); + + return sprintf("%02lx:%02lx:%02lx:%02lx:%02lx:%02lx", + $ethaddr_hgh >> 8, $ethaddr_hgh & 0xff, + $ethaddr_mid >> 8, $ethaddr_mid & 0xff, + $ethaddr_low >> 8, $ethaddr_low & 0xff); + } + + // check that an ethernet address is valid + function eth_addr_is_valid($ethaddr) { + + $ethbytes = split(':', $ethaddr); + + if (count($ethbytes) != 6) + return FALSE; + + for ($i = 0; $i < 6; $i++) { + $ethbyte = $ethbytes[$i]; + if (!ereg('^[0-9a-f][0-9a-f]$', $ethbyte)) + return FALSE; + } + + return TRUE; + } + + // write a simple eeprom configuration file + function write_eeprom_cfg_file() { + + global $sernos, $nsernos, $bddb_cfgdir, $numerrs, $cfgerrs; + global $date, $batch, $type_vals, $rev; + global $sdram_vals, $sdram_nbits; + global $flash_vals, $flash_nbits; + global $zbt_vals, $zbt_nbits; + global $xlxtyp_vals, $xlxspd_vals, $xlxtmp_vals, $xlxgrd_vals; + global $cputyp, $cputyp_vals, $clk_vals; + global $hstype, $hstype_vals, $hschin, $hschout; + + $numerrs = 0; + $cfgerrs = array(); + + for ($i = 0; $i < $nsernos; $i++) { + + $serno = sprintf("%010d", $sernos[$i]); + + $wfp = @fopen($bddb_cfgdir . "/$serno.cfg", "w"); + if (!$wfp) { + $cfgerrs[$i] = 'file create fail'; + $numerrs++; + continue; + } + set_file_buffer($wfp, 0); + + if (!fprintf($wfp, "serno=%d\n", $sernos[$i])) { + $cfgerrs[$i] = 'cfg wr fail (serno)'; + fclose($wfp); + $numerrs++; + continue; + } + + if (!fprintf($wfp, "date=%s\n", $date)) { + $cfgerrs[$i] = 'cfg wr fail (date)'; + fclose($wfp); + $numerrs++; + continue; + } + + if ($batch != '') { + if (!fprintf($wfp, "batch=%s\n", $batch)) { + $cfgerrs[$i] = 'cfg wr fail (batch)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + $typei = enum_to_index("type", $type_vals); + if (!fprintf($wfp, "type=%d\n", $typei)) { + $cfgerrs[$i] = 'cfg wr fail (type)'; + fclose($wfp); + $numerrs++; + continue; + } + + if (!fprintf($wfp, "rev=%d\n", $rev)) { + $cfgerrs[$i] = 'cfg wr fail (rev)'; + fclose($wfp); + $numerrs++; + continue; + } + + $s = gather_enum_multi_write("sdram", 4, + $sdram_vals, $sdram_nbits); + if ($s != '') { + $b = fprintf($wfp, "sdram=%s\n", $s); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (sdram)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + $s = gather_enum_multi_write("flash", 4, + $flash_vals, $flash_nbits); + if ($s != '') { + $b = fprintf($wfp, "flash=%s\n", $s); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (flash)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + $s = gather_enum_multi_write("zbt", 16, + $zbt_vals, $zbt_nbits); + if ($s != '') { + $b = fprintf($wfp, "zbt=%s\n", $s); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (zbt)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + $s = gather_enum_multi_write("xlxtyp", 4, $xlxtyp_vals); + if ($s != '') { + $b = fprintf($wfp, "xlxtyp=%s\n", $s); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (xlxtyp)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + $s = gather_enum_multi_write("xlxspd", 4, $xlxspd_vals); + if ($s != '') { + $b = fprintf($wfp, "xlxspd=%s\n", $s); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (xlxspd)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + $s = gather_enum_multi_write("xlxtmp", 4, $xlxtmp_vals); + if ($s != '') { + $b = fprintf($wfp, "xlxtmp=%s\n", $s); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (xlxtmp)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + $s = gather_enum_multi_write("xlxgrd", 4, $xlxgrd_vals); + if ($s != '') { + $b = fprintf($wfp, "xlxgrd=%s\n", $s); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (xlxgrd)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + if ($cputyp != '') { + $cputypi = enum_to_index("cputyp",$cputyp_vals); + $cpuspdi = enum_to_index("cpuspd", $clk_vals); + $busspdi = enum_to_index("busspd", $clk_vals); + $cpmspdi = enum_to_index("cpmspd", $clk_vals); + $b = fprintf($wfp, "cputyp=%d\ncpuspd=%d\n" . + "busspd=%d\ncpmspd=%d\n", + $cputypi, $cpuspdi, $busspdi, $cpmspdi); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (cputyp)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + if ($hstype != '') { + $hstypei = enum_to_index("hstype",$hstype_vals); + $b = fprintf($wfp, "hstype=%d\n" . + "hschin=%s\nhschout=%s\n", + $hstypei, $hschin, $hschout); + if (!$b) { + $cfgerrs[$i] = 'cfg wr fail (hstype)'; + fclose($wfp); + $numerrs++; + continue; + } + } + + if (!fclose($wfp)) { + $cfgerrs[$i] = 'file cls fail'; + $numerrs++; + } + } + + return $numerrs; + } +?> diff --git a/roms/u-boot/tools/bddb/dodelete.php b/roms/u-boot/tools/bddb/dodelete.php new file mode 100644 index 00000000..4839e36e --- /dev/null +++ b/roms/u-boot/tools/bddb/dodelete.php @@ -0,0 +1,65 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // dodelete page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Delete Board Results"); + + if (!isset($_REQUEST['serno'])) + die("the board serial number was not specified"); + $serno=intval($_REQUEST['serno']); + + mysql_query("delete from boards where serno=$serno"); + + if(mysql_errno()) { + $errstr = mysql_error(); + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe following error was encountered:\n"; + echo "\t\t

\n"; + echo "\t\t
\n"; + printf("\t\t\t%s\n", $errstr); + echo "\t\t
\n"; + echo "\t
\n"; + } + else { + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe board with serial number $serno was" + . " successfully deleted\n"; + mysql_query("delete from log where serno=$serno"); + if (mysql_errno()) { + $errstr = mysql_error(); + echo "\t\t\t\n"; + echo "\t\t\t\t

\n"; + echo "\t\t\t\t\tBut the following error occurred " . + "when deleting the log entries:\n"; + echo "\t\t\t\t

\n"; + echo "\t\t\t\t
\n"; + printf("\t\t\t\t\t%s\n", $errstr); + echo "\t\t\t\t
\n"; + echo "\t\t\t
\n"; + } + echo "\t\t

\n"; + echo "\t
\n"; + } +?> +

+ + + + + +
+ Back to Browse + + Back to Start +
+ diff --git a/roms/u-boot/tools/bddb/dodellog.php b/roms/u-boot/tools/bddb/dodellog.php new file mode 100644 index 00000000..9dd78c11 --- /dev/null +++ b/roms/u-boot/tools/bddb/dodellog.php @@ -0,0 +1,57 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // dodelete page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Delete Log Entry Results"); + + if (!isset($_REQUEST['serno'])) + die("the board serial number was not specified"); + $serno=intval($_REQUEST['serno']); + + if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == 0) + die("the log entry number not specified!"); + $logno=$_REQUEST['logno']; + + mysql_query("delete from log where serno=$serno and logno=$logno"); + + if(mysql_errno()) { + $errstr = mysql_error(); + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe following error was encountered:\n"; + echo "\t\t

\n"; + echo "\t\t
\n"; + printf("\t\t\t%s\n", $errstr); + echo "\t\t
\n"; + echo "\t
\n"; + } + else { + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe log entry with log number $logno\n"; + echo "\t\t\tand serial number $serno "; + echo "was successfully deleted\n"; + echo "\t\t

\n"; + echo "\t
\n"; + } +?> +

+ + + + + +
+ ">Back to Log + + Back to Start +
+ diff --git a/roms/u-boot/tools/bddb/doedit.php b/roms/u-boot/tools/bddb/doedit.php new file mode 100644 index 00000000..13fbb694 --- /dev/null +++ b/roms/u-boot/tools/bddb/doedit.php @@ -0,0 +1,186 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // doedit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Edit Board Results"); + + if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') + die("the board serial number was not specified"); + $serno=intval($_REQUEST['serno']); + + $query="update boards set"; + + if (isset($_REQUEST['ethaddr'])) { + $ethaddr=$_REQUEST['ethaddr']; + if (!eth_addr_is_valid($ethaddr)) + die("ethaddr is invalid ('$ethaddr')"); + $query.=" ethaddr='$ethaddr',"; + } + + if (isset($_REQUEST['date'])) { + $date=$_REQUEST['date']; + list($y, $m, $d) = split("-", $date); + if (!checkdate($m, $d, $y) || $y < 1999) + die("date is invalid (input '$date', " . + "yyyy-mm-dd '$y-$m-$d')"); + $query.=" date='$date'"; + } + + if (isset($_REQUEST['batch'])) { + $batch=$_REQUEST['batch']; + if (strlen($batch) > 32) + die("batch field too long (>32)"); + $query.=", batch='$batch'"; + } + + if (isset($_REQUEST['type'])) { + $type=$_REQUEST['type']; + if (!in_array($type, $type_vals)) + die("Invalid type ($type) specified"); + $query.=", type='$type'"; + } + + if (isset($_REQUEST['rev'])) { + $rev=$_REQUEST['rev']; + if (($rev = intval($rev)) <= 0 || $rev > 255) + die("Revision number is invalid ($rev)"); + $query.=sprintf(", rev=%d", $rev); + } + + if (isset($_REQUEST['location'])) { + $location=$_REQUEST['location']; + if (strlen($location) > 64) + die("location field too long (>64)"); + $query.=", location='$location'"; + } + + if (isset($_REQUEST['comments'])) + $comments=$_REQUEST['comments']; + $query.=", comments='" . rawurlencode($comments) . "'"; + + $query.=gather_enum_multi_query("sdram", 4); + + $query.=gather_enum_multi_query("flash", 4); + + $query.=gather_enum_multi_query("zbt", 16); + + $query.=gather_enum_multi_query("xlxtyp", 4); + $nxlx = count_enum_multi("xlxtyp", 4); + + $query.=gather_enum_multi_query("xlxspd", 4); + if (count_enum_multi("xlxspd", 4) != $nxlx) + die("number of xilinx speeds not same as number of types"); + + $query.=gather_enum_multi_query("xlxtmp", 4); + if (count_enum_multi("xlxtmp", 4) != $nxlx) + die("number of xilinx temps. not same as number of types"); + + $query.=gather_enum_multi_query("xlxgrd", 4); + if (count_enum_multi("xlxgrd", 4) != $nxlx) + die("number of xilinx grades not same as number of types"); + + if (isset($_REQUEST['cputyp'])) { + $cputyp=$_REQUEST['cputyp']; + $query.=", cputyp='$cputyp'"; + if (!isset($_REQUEST['cpuspd']) || $_REQUEST['cpuspd'] == '') + die("must specify cpu speed if cpu type is defined"); + $cpuspd=$_REQUEST['cpuspd']; + $query.=", cpuspd='$cpuspd'"; + if (!isset($_REQUEST['cpmspd']) || $_REQUEST['cpmspd'] == '') + die("must specify cpm speed if cpu type is defined"); + $cpmspd=$_REQUEST['cpmspd']; + $query.=", cpmspd='$cpmspd'"; + if (!isset($_REQUEST['busspd']) || $_REQUEST['busspd'] == '') + die("must specify bus speed if cpu type is defined"); + $busspd=$_REQUEST['busspd']; + $query.=", busspd='$busspd'"; + } + else { + if (isset($_REQUEST['cpuspd'])) + die("can't specify cpu speed if there is no cpu"); + if (isset($_REQUEST['cpmspd'])) + die("can't specify cpm speed if there is no cpu"); + if (isset($_REQUEST['busspd'])) + die("can't specify bus speed if there is no cpu"); + } + + if (isset($_REQUEST['hschin'])) { + $hschin=$_REQUEST['hschin']; + if (($hschin = intval($hschin)) < 0 || $hschin > 4) + die("Invalid number of hs input chans ($hschin)"); + } + else + $hschin = 0; + if (isset($_REQUEST['hschout'])) { + $hschout=$_REQUEST['hschout']; + if (($hschout = intval($hschout)) < 0 || $hschout > 4) + die("Invalid number of hs output chans ($hschout)"); + } + else + $hschout = 0; + if (isset($_REQUEST['hstype'])) { + $hstype=$_REQUEST['hstype']; + $query.=", hstype='$hstype'"; + } + else { + if ($_REQUEST['hschin'] != 0) + die("number of high-speed input channels must be zero" + . " if high-speed chip is not present"); + if ($_REQUEST['hschout'] != 0) + die("number of high-speed output channels must be zero" + . " if high-speed chip is not present"); + } + $query.=", hschin='$hschin'"; + $query.=", hschout='$hschout'"; + + $query.=" where serno=$serno"; + + mysql_query($query); + if(mysql_errno()) { + $errstr = mysql_error(); + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe following error was encountered:\n"; + echo "\t\t

\n"; + echo "\t\t
\n"; + printf("\t\t\t%s\n", $errstr); + echo "\t\t
\n"; + echo "\t
\n"; + } + else { + $sernos = array($serno); + $nsernos = 1; + + write_eeprom_cfg_file(); + + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe board with serial number $serno was" + . " successfully updated"; + if ($numerrs > 0) { + $errstr = $cfgerrs[0]; + echo "
\n\t\t\t"; + echo "(but the cfg file update failed: $errstr)"; + } + echo "\n"; + echo "\t\t

\n"; + echo "\t
\n"; + } + +?> +

+ + + + + +
Back to BrowseBack to Start
+ diff --git a/roms/u-boot/tools/bddb/doedlog.php b/roms/u-boot/tools/bddb/doedlog.php new file mode 100644 index 00000000..7009aa7d --- /dev/null +++ b/roms/u-boot/tools/bddb/doedlog.php @@ -0,0 +1,76 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // doedit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Edit Log Entry Results"); + + if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') + die("the board serial number was not specified"); + $serno=intval($_REQUEST['serno']); + + if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '') + die("log number not specified!"); + $logno=intval($_REQUEST['logno']); + + $query="update log set"; + + if (isset($_REQUEST['date'])) { + $date=$_REQUEST['date']; + list($y, $m, $d) = split("-", $date); + if (!checkdate($m, $d, $y) || $y < 1999) + die("date is invalid (input '$date', " . + "yyyy-mm-dd '$y-$m-$d')"); + $query.=" date='$date'"; + } + + if (isset($_REQUEST['who'])) { + $who=$_REQUEST['who']; + $query.=", who='" . $who . "'"; + } + + if (isset($_REQUEST['details'])) { + $details=$_REQUEST['details']; + $query.=", details='" . rawurlencode($details) . "'"; + } + + $query.=" where serno=$serno and logno=$logno"; + + mysql_query($query); + if(mysql_errno()) { + $errstr = mysql_error(); + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe following error was encountered:\n"; + echo "\t\t

\n"; + echo "\t\t
\n"; + printf("\t\t\t%s\n", $errstr); + echo "\t\t
\n"; + echo "\t
\n"; + } + else { + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe log entry with log number $logno and\n"; + echo "\t\t\tserial number $serno "; + echo "was successfully updated\n"; + echo "\t\t

\n"; + echo "\t
\n"; + } + +?> +

+ + + + + +
">Back to LogBack to Start
+ diff --git a/roms/u-boot/tools/bddb/donew.php b/roms/u-boot/tools/bddb/donew.php new file mode 100644 index 00000000..39b2c78f --- /dev/null +++ b/roms/u-boot/tools/bddb/donew.php @@ -0,0 +1,230 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // doedit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Board Registration Results"); + + if (isset($_REQUEST['serno'])) { + $serno=$_REQUEST['serno']; + die("serial number must not be set ($serno) when Creating!"); + } + + $query="update boards set"; + + list($y, $m, $d) = split("-", $date); + if (!checkdate($m, $d, $y) || $y < 1999) + die("date is invalid (input '$date', yyyy-mm-dd '$y-$m-$d')"); + $query.=" date='$date'"; + + if ($batch != '') { + if (strlen($batch) > 32) + die("batch field too long (>32)"); + $query.=", batch='$batch'"; + } + + if (!in_array($type, $type_vals)) + die("Invalid type ($type) specified"); + $query.=", type='$type'"; + + if (($rev = intval($rev)) <= 0 || $rev > 255) + die("Revision number is invalid ($rev)"); + $query.=sprintf(", rev=%d", $rev); + + $query.=gather_enum_multi_query("sdram", 4); + + $query.=gather_enum_multi_query("flash", 4); + + $query.=gather_enum_multi_query("zbt", 16); + + $query.=gather_enum_multi_query("xlxtyp", 4); + $nxlx = count_enum_multi("xlxtyp", 4); + + $query.=gather_enum_multi_query("xlxspd", 4); + if (count_enum_multi("xlxspd", 4) != $nxlx) + die("number of xilinx speeds not same as number of types"); + + $query.=gather_enum_multi_query("xlxtmp", 4); + if (count_enum_multi("xlxtmp", 4) != $nxlx) + die("number of xilinx temps. not same as number of types"); + + $query.=gather_enum_multi_query("xlxgrd", 4); + if (count_enum_multi("xlxgrd", 4) != $nxlx) + die("number of xilinx grades not same as number of types"); + + if ($cputyp == '') { + if ($cpuspd != '') + die("can't specify cpu speed if there is no cpu"); + if ($cpmspd != '') + die("can't specify cpm speed if there is no cpu"); + if ($busspd != '') + die("can't specify bus speed if there is no cpu"); + } + else { + $query.=", cputyp='$cputyp'"; + if ($cpuspd == '') + die("must specify cpu speed if cpu type is defined"); + $query.=", cpuspd='$cpuspd'"; + if ($cpmspd == '') + die("must specify cpm speed if cpu type is defined"); + $query.=", cpmspd='$cpmspd'"; + if ($busspd == '') + die("must specify bus speed if cpu type is defined"); + $query.=", busspd='$busspd'"; + } + + if (($hschin = intval($hschin)) < 0 || $hschin > 4) + die("Invalid number of hs input chans ($hschin)"); + if (($hschout = intval($hschout)) < 0 || $hschout > 4) + die("Invalid number of hs output chans ($hschout)"); + if ($hstype == '') { + if ($hschin != 0) + die("number of high-speed input channels must be zero" + . " if high-speed chip is not present"); + if ($hschout != 0) + die("number of high-speed output channels must be zero" + . " if high-speed chip is not present"); + } + else + $query.=", hstype='$hstype'"; + $query.=", hschin='$hschin'"; + $query.=", hschout='$hschout'"; + + // echo "final query = '$query'
\n"; + + $quant = intval($quant); + if ($quant <= 0) $quant = 1; + + $sernos = array(); + if ($geneths) + $ethaddrs = array(); + + $sqlerr = ''; + + while ($quant-- > 0) { + + mysql_query("insert into boards (serno) values (null)"); + if (mysql_errno()) { + $sqlerr = mysql_error(); + break; + } + + $serno = mysql_insert_id(); + if (!$serno) { + $sqlerr = "couldn't allocate new serial number"; + break; + } + + mysql_query($query . " where serno=$serno"); + if (mysql_errno()) { + $sqlerr = mysql_error(); + break; + } + + array_push($sernos, $serno); + + if ($geneths) { + + $ethaddr = gen_eth_addr($serno); + + mysql_query("update boards set ethaddr='$ethaddr'" . + " where serno=$serno"); + if (mysql_errno()) { + $sqlerr = mysql_error(); + + array_push($ethaddrs, + "" . + "db save fail" . + ""); + break; + } + + array_push($ethaddrs, $ethaddr); + } + } + + $nsernos = count($sernos); + + if ($nsernos > 0) { + + write_eeprom_cfg_file(); + + echo "\n"; + echo "\t

\n"; + echo "\t\tThe following board serial numbers were" + . " successfully allocated"; + if ($numerrs > 0) + echo " (but with $numerrs cfg file error" . + ($numerrs > 1 ? "s" : "") . ")"; + echo ":\n"; + echo "\t

\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\t\n"; + if ($numerrs > 0) + echo "\t\n"; + if ($geneths) + echo "\t\n"; + echo "\n"; + + for ($i = 0; $i < $nsernos; $i++) { + + $serno = sprintf("%010d", $sernos[$i]); + + echo "\n"; + + echo "\t\n"; + + if ($numerrs > 0) { + if (($errstr = $cfgerrs[$i]) == '') + $errstr = ' '; + echo "\t\n"; + } + + if ($geneths) { + echo "\t\n"; + } + + echo "\n"; + } + + echo "
Serial NumberCfg File ErrsEthernet Address
" . + "$serno" . + "" . + $errstr . + "" . + "" . + $ethaddrs[$i] . + "
\n"; + } + + if ($sqlerr != '') { + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe following SQL error was encountered:\n"; + echo "\t\t

\n"; + echo "\t\t
\n"; + printf("\t\t\t%s\n", $sqlerr); + echo "\t\t
\n"; + echo "\t
\n"; + } + +?> +

+ + + + + +
Go to BrowseBack to Start
+ diff --git a/roms/u-boot/tools/bddb/donewlog.php b/roms/u-boot/tools/bddb/donewlog.php new file mode 100644 index 00000000..7635d299 --- /dev/null +++ b/roms/u-boot/tools/bddb/donewlog.php @@ -0,0 +1,86 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // doedit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Add Log Entry Results"); + + if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') + die("serial number not specified!"); + $serno=intval($_REQUEST['serno']); + + if (isset($_REQUEST['logno'])) { + $logno=$_REQUEST['logno']; + die("log number must not be set ($logno) when Creating!"); + } + + $query="update log set serno=$serno"; + + list($y, $m, $d) = split("-", $date); + if (!checkdate($m, $d, $y) || $y < 1999) + die("date is invalid (input '$date', yyyy-mm-dd '$y-$m-$d')"); + $query.=", date='$date'"; + + if (isset($_REQUEST['who'])) { + $who=$_REQUEST['who']; + $query.=", who='" . $who . "'"; + } + + if (isset($_REQUEST['details'])) { + $details=$_REQUEST['details']; + $query.=", details='" . rawurlencode($details) . "'"; + } + + // echo "final query = '$query'
\n"; + + $sqlerr = ''; + + mysql_query("insert into log (logno) values (null)"); + if (mysql_errno()) + $sqlerr = mysql_error(); + else { + $logno = mysql_insert_id(); + if (!$logno) + $sqlerr = "couldn't allocate new serial number"; + else { + mysql_query($query . " where logno=$logno"); + if (mysql_errno()) + $sqlerr = mysql_error(); + } + } + + if ($sqlerr == '') { + echo "\n"; + echo "\t

\n"; + echo "\t\tA log entry with log number '$logno' was " . + "added to the board with serial number '$serno'\n"; + echo "\t

\n"; + echo "\n"; + } + else { + echo "\t\n"; + echo "\t\t

\n"; + echo "\t\t\tThe following SQL error was encountered:\n"; + echo "\t\t

\n"; + echo "\t\t
\n"; + printf("\t\t\t%s\n", $sqlerr); + echo "\t\t
\n"; + echo "\t
\n"; + } + +?> +

+ + + + + +
">Go to BrowseBack to Start
+ diff --git a/roms/u-boot/tools/bddb/edit.php b/roms/u-boot/tools/bddb/edit.php new file mode 100644 index 00000000..dd8c26c5 --- /dev/null +++ b/roms/u-boot/tools/bddb/edit.php @@ -0,0 +1,131 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // edit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Edit Board Registration"); + + if ($serno == 0) + die("serial number not specified or invalid!"); + + $pserno = sprintf("%010d", $serno); + + echo "
"; + echo "Board Serial Number: $pserno"; + echo "
\n"; + +?> +

+

+\n"; + + $r=mysql_query("select * from boards where serno=$serno"); + $row=mysql_fetch_array($r); + if(!$row) die("no record of serial number '$serno' in database"); + + begin_table(5); + + // ethaddr char(17) + print_field("ethaddr", $row, 17); + + // date date + print_field("date", $row); + + // batch char(32) + print_field("batch", $row, 32); + + // type enum('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY') + print_enum("type", $row, $type_vals); + + // rev tinyint(3) unsigned zerofill + print_field("rev", $row, 3, 'rev_filter'); + + // location char(64) + print_field("location", $row, 64); + + // comments text + print_field_multiline("comments", $row, 60, 10, 'text_filter'); + + // sdram[0-3] enum('32M','64M','128M','256M') + print_enum_multi("sdram", $row, $sdram_vals, 4, array()); + + // flash[0-3] enum('4M','8M','16M','32M','64M') + print_enum_multi("flash", $row, $flash_vals, 4, array()); + + // zbt[0-f] enum('512K','1M','2M','4M') + print_enum_multi("zbt", $row, $zbt_vals, 16, array()); + + // xlxtyp[0-3] enum('XCV300E','XCV400E','XCV600E') + print_enum_multi("xlxtyp", $row, $xlxtyp_vals, 4, array(), 1); + + // xlxspd[0-3] enum('6','7','8') + print_enum_multi("xlxspd", $row, $xlxspd_vals, 4, array(), 1); + + // xlxtmp[0-3] enum('COM','IND') + print_enum_multi("xlxtmp", $row, $xlxtmp_vals, 4, array(), 1); + + // xlxgrd[0-3] enum('NORMAL','ENGSAMP') + print_enum_multi("xlxgrd", $row, $xlxgrd_vals, 4, array(), 1); + + // cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)') + print_enum("cputyp", $row, $cputyp_vals); + + // cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ') + print_enum_select("cpuspd", $row, $clk_vals); + + // cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ') + print_enum_select("cpmspd", $row, $clk_vals); + + // busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ') + print_enum_select("busspd", $row, $clk_vals); + + // hstype enum('AMCC-S2064A') + print_enum("hstype", $row, $hstype_vals); + + // hschin enum('0','1','2','3','4') + print_enum("hschin", $row, $hschin_vals); + + // hschout enum('0','1','2','3','4') + print_enum("hschout", $row, $hschout_vals); + + end_table(); + + echo "

\n"; + echo "

"; + echo "WARNING: NO UNDO ON DELETE!"; + echo "

\n"; + echo "[ delete ]"; + echo "
\n"; + echo "

\n"; +?> +

+ + + + + + + + +
+ + +   + + + +   + + Back to Start +
+

+
+ diff --git a/roms/u-boot/tools/bddb/edlog.php b/roms/u-boot/tools/bddb/edlog.php new file mode 100644 index 00000000..8befd35b --- /dev/null +++ b/roms/u-boot/tools/bddb/edlog.php @@ -0,0 +1,86 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // edit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - Edit Board Log Entry"); + + if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') + die("serial number not specified!"); + $serno=intval($_REQUEST['serno']); + + if (!isset($_REQUEST['logno']) || $_REQUEST['logno'] == '') + die("log number not specified!"); + $logno=intval($_REQUEST['logno']); + + $pserno = sprintf("%010d", $serno); + $plogno = sprintf("%010d", $logno); + + echo "
"; + echo "Board Serial Number: $pserno, Log Number: $plogno"; + echo "
\n"; + +?> +

+

+\n"; + echo "\n"; + + $r=mysql_query("select * from log where serno=$serno and logno=$logno"); + $row=mysql_fetch_array($r); + if(!$row) + die("no record of log entry with serial number '$serno' " . + "and log number '$logno' in database"); + + begin_table(3); + + // date date + print_field("date", $row); + + // who char(20) + print_field("who", $row); + + // details text + print_field_multiline("details", $row, 60, 10, 'text_filter'); + + end_table(); + + echo "

\n"; + echo "

"; + echo "WARNING: NO UNDO ON DELETE!"; + echo "

\n"; + echo "[ delete ]"; + echo "
\n"; + echo "

\n"; +?> +

+ + + + + + + + +
+ + +   + + + +   + + Back to Start +
+

+
+ diff --git a/roms/u-boot/tools/bddb/execute.php b/roms/u-boot/tools/bddb/execute.php new file mode 100644 index 00000000..0b62882d --- /dev/null +++ b/roms/u-boot/tools/bddb/execute.php @@ -0,0 +1,33 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + $serno=isset($_REQUEST['serno'])?$_REQUEST['serno']:''; + + $submit=isset($_REQUEST['submit'])?$_REQUEST['submit']:"[NOT SET]"; + + switch ($submit) { + + case "New": + require("new.php"); + break; + + case "Edit": + require("edit.php"); + break; + + case "Browse": + require("browse.php"); + break; + + case "Log": + require("brlog.php"); + break; + + default: + require("badsubmit.php"); + break; + } +?> diff --git a/roms/u-boot/tools/bddb/index.php b/roms/u-boot/tools/bddb/index.php new file mode 100644 index 00000000..842aed55 --- /dev/null +++ b/roms/u-boot/tools/bddb/index.php @@ -0,0 +1,38 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + require("defs.php"); + pg_head("$bddb_label"); +?> + +
+ + + + + + + + + + +
+ + + + + + + +
+ Serial Number: + +
+
+
+ diff --git a/roms/u-boot/tools/bddb/new.php b/roms/u-boot/tools/bddb/new.php new file mode 100644 index 00000000..30323ff8 --- /dev/null +++ b/roms/u-boot/tools/bddb/new.php @@ -0,0 +1,120 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // edit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - New Board Registration"); +?> +
+

+ date("Y-m-d"))); + + // batch char(32) + print_field("batch", $row, 32); + + // type enum('IO','CLP','DSP','INPUT','ALT-INPUT','DISPLAY') + print_enum("type", $row, $type_vals, 0); + + // rev tinyint(3) unsigned zerofill + print_field("rev", $row, 3, 'rev_filter'); + + // sdram[0-3] enum('32M','64M','128M','256M') + print_enum_multi("sdram", $row, $sdram_vals, 4, array(2)); + + // flash[0-3] enum('4M','8M','16M','32M','64M') + print_enum_multi("flash", $row, $flash_vals, 4, array(2)); + + // zbt[0-f] enum('512K','1M','2M','4M') + print_enum_multi("zbt", $row, $zbt_vals, 16, array(2, 2)); + + // xlxtyp[0-3] enum('XCV300E','XCV400E','XCV600E') + print_enum_multi("xlxtyp", $row, $xlxtyp_vals, 4, array(1), 1); + + // xlxspd[0-3] enum('6','7','8') + print_enum_multi("xlxspd", $row, $xlxspd_vals, 4, array(1), 1); + + // xlxtmp[0-3] enum('COM','IND') + print_enum_multi("xlxtmp", $row, $xlxtmp_vals, 4, array(1), 1); + + // xlxgrd[0-3] enum('NORMAL','ENGSAMP') + print_enum_multi("xlxgrd", $row, $xlxgrd_vals, 4, array(1), 1); + + // cputyp enum('MPC8260(HIP3)','MPC8260A(HIP4)','MPC8280(HIP7)') + print_enum("cputyp", $row, $cputyp_vals, 1); + + // cpuspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ') + print_enum_select("cpuspd", $row, $clk_vals, 4); + + // cpmspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ') + print_enum_select("cpmspd", $row, $clk_vals, 4); + + // busspd enum('33MHZ','66MHZ','100MHZ','133MHZ','166MHZ','200MHZ','233MHZ','266MHZ') + print_enum_select("busspd", $row, $clk_vals, 2); + + // hstype enum('AMCC-S2064A') + print_enum("hstype", $row, $hstype_vals, 1); + + // hschin enum('0','1','2','3','4') + print_enum("hschin", $row, $hschin_vals, 4); + + // hschout enum('0','1','2','3','4') + print_enum("hschout", $row, $hschout_vals, 4); + + end_table(); +?> +

+ + + + + + + + + + + + + + + +
+ Allocate + + board serial number(s) +
+ + Generate Ethernet Address(es) +
+   +
+ + +   + + +
+
+ diff --git a/roms/u-boot/tools/bddb/newlog.php b/roms/u-boot/tools/bddb/newlog.php new file mode 100644 index 00000000..609bb855 --- /dev/null +++ b/roms/u-boot/tools/bddb/newlog.php @@ -0,0 +1,54 @@ + ?> + + // CSIRO Manufacturing Science and Technology, Preston Lab + + // edit page (hymod_bddb / boards) + + require("defs.php"); + + pg_head("$bddb_label - New Log Entry"); + + if (!isset($_REQUEST['serno']) || $_REQUEST['serno'] == '') + die("serial number not specified or invalid!"); + $serno=intval($_REQUEST['serno']); + + if (isset($_REQUEST['logno'])) { + $logno=$_REQUEST['logno']; + die("log number must not be specified when adding! ($logno)"); + } +?> +
+

+\n"; + + begin_table(3); + + // date date + print_field("date", array('date' => date("Y-m-d"))); + + // who char(20) + print_field("who", array()); + + // details text + print_field_multiline("details", array(), 60, 10, 'text_filter'); + + end_table(); +?> +

+ + + + + +
+ + + +
+
+ -- cgit v1.2.3