1 \ *****************************************************************************
2 \ * Copyright (c) 2004, 2008 IBM Corporation
3 \ * All rights reserved.
4 \ * This program and the accompanying materials
5 \ * are made available under the terms of the BSD License
6 \ * which accompanies this distribution, and is available at
7 \ * http://www.opensource.org/licenses/bsd-license.php
10 \ * IBM Corporation - initial implementation
11 \ ****************************************************************************/
13 : vpd-read-bootlist ( -- )
14 837 4 vpd-bootlist rtas-read-vpd IF vpd-bootlist 4 erase THEN
17 : vpd-write-bootlist ( offset len data -- )
18 837 4 vpd-bootlist rtas-write-vpd
22 e 7 vpd-cb rtas-read-vpd drop
28 15 7 vpd-cb rtas-read-vpd drop
34 54 6 vpd-cb rtas-read-vpd drop
38 : .vpd-cardprefix-serial
39 5a 6 vpd-cb rtas-read-vpd drop
45 65 1 vpd-cb rtas-read-vpd drop
50 3c c vpd-cb rtas-read-vpd drop
55 48 c vpd-cb rtas-read-vpd drop
59 : .vpd-manufacturer-date
60 6b 4 vpd-cb rtas-read-vpd drop
66 9f 10 vpd-cb rtas-read-vpd drop
67 10 0 do i vpd-cb + c@ 2 0.r loop
70 : vpd-read-model ( -- addr len )
71 60 4 vpd-cb rtas-read-vpd drop vpd-cb 4 -leading s" ," $cat
72 e 7 vpd-cb rtas-read-vpd drop vpd-cb 4 $cat s" -" $cat vpd-cb 4 + 3 $cat
76 ." ===================== VPD ====================="
77 cr ." Machine Type : " .vpd-machine-type
78 cr ." Machine Serial No. : " .vpd-machine-serial
79 cr ." Hardware Revision : " .vpd-hw-revision
80 cr ." Manuf. Date : " .vpd-manufacturer-date
81 cr ." Part Number : " .vpd-part-number
82 cr ." FRU Number : " .vpd-fru-number
83 cr ." FRU Serial No. : " .vpd-cardprefix-serial .vpd-card-serial
84 cr ." UUID : " .vpd-uuid
87 : vpd-write-revision-and-build-id ( -- )
88 406 24 vpd-cb rtas-read-vpd drop 0
89 vpd-cb 1a + zcount bdate2human drop a string=ci 0=
90 IF bdate2human drop a vpd-cb 1a + zplace drop 1 THEN
91 vpd-cb zcount slof-revision string=ci 0=
92 IF slof-revision vpd-cb zplace drop 1 THEN
93 vpd-cb 4 + zcount slof-build-id string=ci 0=
94 IF slof-build-id vpd-cb 4 + rzplace drop 1 THEN
95 1 = IF 406 24 vpd-cb rtas-write-vpd drop THEN
98 vpd-write-revision-and-build-id