diff options
author | Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> | 2017-03-03 17:18:18 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-03-07 15:40:32 +1100 |
commit | 0f28e38bbeaa11bda20b81f2247c82682d93d787 (patch) | |
tree | 71f0f59d93d6c06de6d2c3252c291e50d71d0ec0 /hdata/fsp.c | |
parent | dd694b530c7b2c28efcae018bca8ad7910f845d8 (diff) | |
download | skiboot-0f28e38bbeaa11bda20b81f2247c82682d93d787.zip skiboot-0f28e38bbeaa11bda20b81f2247c82682d93d787.tar.gz skiboot-0f28e38bbeaa11bda20b81f2247c82682d93d787.tar.bz2 |
hdata: Add BMC device-tree node for P9 OpenPOWER systems
On P8 Hostboot creates the node. On P9, OPAL needs to create the node. BMC
information available in HDAT's SPINFO section.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Acked-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata/fsp.c')
-rw-r--r-- | hdata/fsp.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/hdata/fsp.c b/hdata/fsp.c index f44f6a9..3896dc4 100644 --- a/hdata/fsp.c +++ b/hdata/fsp.c @@ -279,11 +279,26 @@ static void add_uart(const struct spss_iopath *iopath, struct dt_node *lpc) static void bmc_create_node(const struct HDIF_common_hdr *sp) { + struct dt_node *bmc_node; u32 fw_bar, io_bar, mem_bar, internal_bar; const struct spss_iopath *iopath; + const struct spss_sp_impl *sp_impl; struct dt_node *lpcm, *lpc, *n; u64 lpcm_base, lpcm_end; - int chip_id; + int chip_id, size; + + bmc_node = dt_new(dt_root, "bmc"); + assert(bmc_node); + + dt_add_property_cells(bmc_node, "#address-cells", 1); + dt_add_property_cells(bmc_node, "#size-cells", 0); + + /* TODO: add sensor info under /bmc */ + sp_impl = HDIF_get_idata(sp, SPSS_IDATA_SP_IMPL, &size); + if (CHECK_SPPTR(sp_impl) && (size > 8)) { + dt_add_property_strings(bmc_node, "compatible", sp_impl->sp_family); + prlog(PR_INFO, "SP Family is %s\n", sp_impl->sp_family); + } iopath = HDIF_get_iarray_item(sp, SPSS_IDATA_SP_IOPATH, 0, NULL); |