[Skiboot] [PATCH v2 0/2] New vpd hierarchial structure in DT

Neelesh Gupta neelegup at linux.vnet.ibm.com
Tue Jan 13 16:45:36 AEDT 2015


The following series adds the support to populate VPD nodes in
hierarchial fashion in the device tree. It makes use of the
parent-child relationship of SLCA entries before adding the
individual vpd data to the corresponding nodes.

Completely removed the switch-case in valid_child_entry() function
as with the new logic, all the vpd nodes are created once during
the first pass from dt_add_vpd_node(). It has led to creation
of some new nodes which were not there in old DT, but think that
is not a problem.

Changes in v2:
==============
- Found few VPDs missing when compared to what we see in the ASMI
  page, they were also missing the older layout though. Included
  them by tweaking the logic of slca entries traversal. Now, start
  from the root entry (SLCA_ROOT_INDEX '0') and follow through its
  all the children.

Results:

1.
[root at tul169p1 device-tree]# tree -d /proc/device-tree/vpd/
/proc/device-tree/vpd/
`-- root-node-vpd at a000
    |-- enclosure at 1e00
    |   |-- air-mover at 3a00
    |   |-- air-mover at 3a01
    |   |-- backplane at 800
    |   |   |-- anchor-card at 500
    |   |   |-- backplane-extender at 900
    |   |   |   |-- serial-connector at 2a00
    |   |   |   |-- usb-connector at 2900
    |   |   |   `-- usb-connector at 2901
    |   |   |-- ethernet-connector at 2800
    |   |   |-- ethernet-connector at 2801
    |   |   |-- ms-dimm at d002
    |   |   |-- ms-dimm at d003
    |   |   |-- processor at 1000
    |   |   |-- processor at 1001
    |   |   |-- usb-connector at 2902
    |   |   |-- usb-connector at 2903
    |   |   |-- usb-connector at 2904
    |   |   `-- usb-connector at 2905
    |   |-- dasd-backplane at 2400
    |   |-- dasd-backplane at 2401
    |   |-- power-supply at 3103
    |   `-- service-processor at 200
    |-- enclosure-fault-led at a300
    |-- enclosure-led at a200
    |-- root-node-vpd at a001
    `-- system-vpd at 1c00

2. vpd { } snippet from the DT
	vpd {
		ibm,loc-code = "U8286.41A.TU00169";
		ibm,vpd = <0x84b00052 0x54045653 0x59534452 0x6535953 0x54454d42 0x52025330 0x53450754 0x55303031 0x36395347 0x7202020 0x20202020 0x544d0838 0x3238362d 0x34314154 0x4e082020 0x20202020 0x20204d4e 0x7202020 0x20202020 0x49440220 0x20535506 0x4ac19 0x77144e4e 0x10202020 0x20202020 0x20202020 0x20202020 0x20524704 0xf0c00000 0x52420433 0x31202057 0x4e0c4330 0x35303736 0x30364237 0x30414656 0x20202020 0x20202020 0x20202020 0x20202020 0x20202020 0x20202020 0x20202020 0x20202020 0x20504603 0x78 0x0>;
		phandle = <0x2>;
		linux,phandle = <0x2>;

		root-node-vpd at a000 {
			ibm,loc-code = "U8286.41A.TU00169";
			fru-type = [56 56];
			phandle = <0x1a>;
			linux,phandle = <0x1a>;

			system-vpd at 1c00 {
				ibm,loc-code = "U8286.41A.TU00169";
				fru-type = [53 56];
				phandle = <0x1c>;
				linux,phandle = <0x1c>;
			};

			root-node-vpd at a001 {
				ibm,loc-code = "U8286.41A.TU00169";
				fru-type = [56 56];
				phandle = <0x1b>;
				linux,phandle = <0x1b>;
			};

			enclosure-fault-led at a300 {
				ibm,loc-code = "U78C9.001.WZS0020";
				fru-type = [45 46];
				phandle = <0x35>;
				linux,phandle = <0x35>;
			};

			enclosure-led at a200 {
				ibm,loc-code = "U78C9.001.WZS0020";
				fru-type = [45 49];
				phandle = <0x34>;
				linux,phandle = <0x34>;
			};

			enclosure at 1e00 {
				ccin = "2B07";
				fru-number = "00E1964";
				description = "System planar 1S4U";
				ibm,loc-code = "U78C9.001.WZS0020";
				serial-number = "YL30UF34800E";
				ibm,vpd = <0x848c0052 0x54045649 0x4e494452 0x10492f4f 0x20424143 0x4b504c41 0x4e452020 0x20434501 0x31565a02 0x3031464e 0x7303045 0x31393634 0x504e0730 0x30453139 0x3432534e 0xc594c33 0x30554633 0x34383030 0x45434304 0x32423037 0x50520821 0x0 0x48 0x45043030 0x30314354 0x480f300 0x26485702 0x14233 0x6000000 0x142 0x34010042 0x370c0000 0x0 0x0 0x5046 0x2000078 0x841c0052 0x54044c58 0x5230565a 0x230314c 0x58083100 0x4010030 0x435046 0x2000078 0x84440052 0x54045643 0x454e4452 0x6434543 0x20202053 0x4507575a 0x53303032 0x30544d08 0x20202020 0x20202020 0x46430837 0x3843392d 0x30303152 0x470400b0 0x232c5242 0x4202020 0x20504603 0x78 0x0>;
				fru-type = [45 56];
				part-number = "00E1942";
				phandle = <0x1d>;
				linux,phandle = <0x1d>;

				service-processor at 200 {
					ccin = "2B07";
					fru-number = "00E1964";
					description = "System planar 1S4U";
					ibm,loc-code = "U78C9.001.WZS0020-P1";
					serial-number = "YL30UF34800E";
					ibm,vpd = <0x848c0052 0x54045649 0x4e494452 0x10492f4f 0x20424143 0x4b504c41 0x4e452020 0x20434501 0x31565a02 0x3031464e 0x7303045 0x31393634 0x504e0730 0x30453139 0x3432534e 0xc594c33 0x30554633 0x34383030 0x45434304 0x32423037 0x50520821 0x0 0x48 0x45043030 0x30314354 0x480f300 0x26485702 0x14233 0x6000000 0x142 0x34010042 0x370c0000 0x0 0x0 0x5046 0x2000078 0x841c0052 0x54044c58 0x5230565a 0x230314c 0x58083100 0x4010030 0x435046 0x2000078 0x84500052 0x54045652 0x31304452 0x10465350 0x20202020 0x20202020 0x20202020 0x20464704 0x564e5350 0x44430f42 0x44203230 0x31323032 0x32303038 0x3030464c 0x14503120 0x20202020 0x20202020 0x20202020 0x20202020 0x20504603 0x78 0x84400052 0x54045657 0x31304452 0x10465350 0x20565731 0x30202020 0x20202020 0x20474420 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x50460078 0x0>;
					fru-type = [53 50];
					part-number = "00E1942";
					phandle = <0x2e>;
					linux,phandle = <0x2e>;
				};

				backplane at 800 {
					ccin = "2B07";
					fru-number = "00E1964";
					description = "System planar 1S4U";
					ibm,loc-code = "U78C9.001.WZS0020-P1";
					serial-number = "YL30UF34800E";
					ibm,vpd = <0x848c0052 0x54045649 0x4e494452 0x10492f4f 0x20424143 0x4b504c41 0x4e452020 0x20434501 0x31565a02 0x3031464e 0x7303045 0x31393634 0x504e0730 0x30453139 0x3432534e 0xc594c33 0x30554633 0x34383030 0x45434304 0x32423037 0x50520821 0x0 0x48 0x45043030 0x30314354 0x480f300 0x26485702 0x14233 0x6000000 0x142 0x34010042 0x370c0000 0x0 0x0 0x5046 0x2000078 0x841c0052 0x54044c58 0x5230565a 0x230314c 0x58083100 0x4010030 0x435046 0x2000078 0x0>;
					fru-type = [42 50];
					part-number = "00E1942";
					phandle = <0x1e>;
					linux,phandle = <0x1e>;

					anchor-card at 500 {
						ccin = "52F2";
						fru-number = "00E2152";
						description = "System Anchor Card - IBM Power 814";
						ibm,loc-code = "U78C9.001.WZS0020-P1-C13";
						serial-number = "YL10BG34X1WK";
						ibm,vpd = <0x84cc0052 0x54045649 0x4e494452 0x10414e43 0x484f5220 0x20202020 0x20202020 0x20434501 0x31565a02 0x3031464e 0x7303045 0x32313532 0x504e0730 0x30453231 0x3438534e 0xc594c31 0x30424733 0x34583157 0x4b434304 0x35324632 0x50520881 0x300000 0x48 0x45043030 0x31304354 0x440b400 0x485702 0x14233 0x6000000 0x142 0x34010042 0x370c0000 0x0 0x0 0x4239 0x3c435332 0x110010 0xec7e9f53 0x50c14dfc 0xf0f4d227 0x2b4d31ad 0x7bcf7119 0x675f754d 0x320207c5 0xab4c6e28 0x754d33d4 0x24e46438 0x8ed14d4d 0x34b0e69e 0xb5fc4cd8 0xad504603 0x78 0x0>;
						fru-type = [41 56];
						part-number = "00E2148";
						phandle = <0x25>;
						linux,phandle = <0x25>;
					};

					usb-connector at 2902 {
						ibm,loc-code = "U78C9.001.WZS0020-P1-T2";
						fru-type = [43 55];
						phandle = <0x28>;
						linux,phandle = <0x28>;
					};

					usb-connector at 2903 {
						ibm,loc-code = "U78C9.001.WZS0020-P1-T5";
						fru-type = [43 55];
						phandle = <0x29>;
						linux,phandle = <0x29>;
					};

					usb-connector at 2904 {
						ibm,loc-code = "U78C9.001.WZS0020-P1-T1";
						fru-type = [43 55];
						phandle = <0x2a>;
						linux,phandle = <0x2a>;
					};

					usb-connector at 2905 {
						ibm,loc-code = "U78C9.001.WZS0020-P1-T6";
						fru-type = [43 55];
						phandle = <0x2b>;
						linux,phandle = <0x2b>;
					};

					ms-dimm at d002 {
						ccin = "31E0";
						size = "0016384";
						fru-number = "41T9614";
						ibm,chip-id = <0x0>;
						description = "16GB CDIMM";
						ibm,loc-code = "U78C9.001.WZS0020-P1-C18";
						serial-number = "YH31JH36C004";
						ibm,vpd = <0x84940052 0x54045649 0x4e494452 0x1049424d 0x20313647 0x42204d53 0x20202020 0x20434501 0x31565a02 0x3037464e 0x7343154 0x39363134 0x504e0734 0x31543936 0x3134534e 0xc594833 0x314a4833 0x36433030 0x34434304 0x33314530 0x50520849 0x0 0x1000053 0x5a073030 0x31363338 0x34484504 0x30303031 0x43540400 0x48 0x57020090 0x42330600 0x0 0x423401 0x42370c 0x0 0x0 0x0 0x50460078 0x0>;
						fru-type = [4d 53];
						part-number = "41T9614";
						phandle = <0x2c>;
						linux,phandle = <0x2c>;
					};

					ms-dimm at d003 {
						ccin = "31E0";
						size = "0016384";
						fru-number = "41T9614";
						ibm,chip-id = <0x0>;
						description = "16GB CDIMM";
						ibm,loc-code = "U78C9.001.WZS0020-P1-C19";
						serial-number = "YH31JH36L007";
						ibm,vpd = <0x84940052 0x54045649 0x4e494452 0x1049424d 0x20313647 0x42204d53 0x20202020 0x20434501 0x31565a02 0x3037464e 0x7343154 0x39363134 0x504e0734 0x31543936 0x3134534e 0xc594833 0x314a4833 0x364c3030 0x37434304 0x33314530 0x50520849 0x0 0x1000053 0x5a073030 0x31363338 0x34484504 0x30303031 0x43540400 0x48 0x57020090 0x42330600 0x0 0x423401 0x42370c 0x0 0x0 0x0 0x50460078 0x0>;
						fru-type = [4d 53];
						part-number = "41T9614";
						phandle = <0x2d>;
						linux,phandle = <0x2d>;
					};

					backplane-extender at 900 {
						ccin = "2B0B";
						fru-number = "00E1960";
						description = "Native I/O Card";
						ibm,loc-code = "U78C9.001.WZS0020-P1-C1";
						serial-number = "YL30UF32500M";
						ibm,vpd = <0x84800052 0x54045649 0x4e494452 0x104e4154 0x49564520 0x492f4f20 0x43415244 0x20434501 0x31565a02 0x3031464e 0x7303045 0x31393630 0x504e0730 0x30453138 0x3339534e 0xc594c33 0x30554633 0x32353030 0x4d434304 0x32423042 0x48450430 0x30303143 0x540440b5 0x4857 0x2000142 0x33060000 0x0 0x42340100 0x42370c00 0x0 0x0 0x50 0x46010078 0x0>;
						fru-type = [42 58];
						part-number = "00E1839";
						phandle = <0x1f>;
						linux,phandle = <0x1f>;

						usb-connector at 2900 {
							ibm,loc-code = "U78C9.001.WZS0020-P1-C1-T2";
							fru-type = [43 55];
							phandle = <0x20>;
							linux,phandle = <0x20>;
						};

						usb-connector at 2901 {
							ibm,loc-code = "U78C9.001.WZS0020-P1-C1-T3";
							fru-type = [43 55];
							phandle = <0x21>;
							linux,phandle = <0x21>;
						};

						serial-connector at 2a00 {
							ibm,loc-code = "U78C9.001.WZS0020-P1-C1-T1";
							fru-type = [43 53];
							phandle = <0x22>;
							linux,phandle = <0x22>;
						};
					};

					processor at 1000 {
						ccin = "AB12";
						fru-number = "0000000";
						ibm,loc-code = "U78C9.001.WZS0020-P1-C32";
						serial-number = "SYA393193545";
						ibm,vpd = [84 8c 00 52 54 04 56 49 4e 49 44 52 10 50 52 4f 43 45 53 53 4f 52 20 4d 4f 44 55 4c 45 46 4e 07 30 30 30 30 30 30 30 50 4e 07 30 30 46 59 31 35 30 53 4e 0c 53 59 41 33 39 33 31 39 33 35 34 35 43 43 04 41 42 31 32 48 45 04 30 30 30 31 43 54 04 00 00 00 00 48 57 02 00 01 42 33 06 00 00 00 00 00 00 42 34 01 00 42 37 0c 00 00 00 00 00 00 00 00 00 00 00 00 50 52 08 35 00 20 01 22 00 80 01 56 5a 02 20 20 43 45 01 31 50 46 02 00 00 78 00];
						fru-type = [50 46];
						part-number = "00FY150";
						phandle = <0x23>;
						linux,phandle = <0x23>;
					};

					processor at 1001 {
						ccin = "AB12";
						fru-number = "0000000";
						ibm,loc-code = "U78C9.001.WZS0020-P1-C32";
						serial-number = "SYA393193545";
						ibm,vpd = [84 8c 00 52 54 04 56 49 4e 49 44 52 10 50 52 4f 43 45 53 53 4f 52 20 4d 4f 44 55 4c 45 46 4e 07 30 30 30 30 30 30 30 50 4e 07 30 30 46 59 31 35 30 53 4e 0c 53 59 41 33 39 33 31 39 33 35 34 35 43 43 04 41 42 31 32 48 45 04 30 30 30 31 43 54 04 00 00 00 00 48 57 02 00 01 42 33 06 00 00 00 00 00 00 42 34 01 00 42 37 0c 00 00 00 00 00 00 00 00 00 00 00 00 50 52 08 35 00 20 01 22 00 80 01 56 5a 02 20 20 43 45 01 31 50 46 02 00 00 78 00];
						fru-type = [50 46];
						part-number = "00FY150";
						phandle = <0x24>;
						linux,phandle = <0x24>;
					};

					ethernet-connector at 2800 {
						ibm,loc-code = "U78C9.001.WZS0020-P1-T3 ";
						fru-type = [43 45];
						phandle = <0x26>;
						linux,phandle = <0x26>;
					};

					ethernet-connector at 2801 {
						ibm,loc-code = "U78C9.001.WZS0020-P1-T4 ";
						fru-type = [43 45];
						phandle = <0x27>;
						linux,phandle = <0x27>;
					};
				};

				power-supply at 3103 {
					ibm,loc-code = "U78C9.001.WZS0020-E4";
					fru-type = [50 53];
					phandle = <0x31>;
					linux,phandle = <0x31>;
				};

				dasd-backplane at 2400 {
					ibm,loc-code = "U78C9.001.WZS0020-P2";
					fru-type = [44 42];
					phandle = <0x2f>;
					linux,phandle = <0x2f>;
				};

				dasd-backplane at 2401 {
					ibm,loc-code = "U78C9.001.WZS0020-P2";
					fru-type = [44 42];
					phandle = <0x30>;
					linux,phandle = <0x30>;
				};

				air-mover at 3a00 {
					ibm,loc-code = "U78C9.001.WZS0020-A1";
					fru-type = [41 4d];
					phandle = <0x32>;
					linux,phandle = <0x32>;
				};

				air-mover at 3a01 {
					ibm,loc-code = "U78C9.001.WZS0020-A2";
					fru-type = [41 4d];
					phandle = <0x33>;
					linux,phandle = <0x33>;
				};
			};
		};
	};

---

Neelesh Gupta (2):
      core/device: Function to return child node using name
      vpd: Use slca parent-child relationship to create vpd tree


 core/device.c    |   16 ++++
 hdata/spira.h    |    2 
 hdata/vpd.c      |  217 +++++++++++++++++++-----------------------------------
 include/device.h |    3 +
 4 files changed, 96 insertions(+), 142 deletions(-)

-- 
Signature



More information about the Skiboot mailing list