summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2017-05-24 22:02:13 -0700
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-08-01 12:39:42 +1000
commitaac13141c95022126d089aa4177a1f8467cd105f (patch)
treed106c288440bc5966ef524964fb776f3c2031045 /core
parent4fb0e3f08ecd0b4e250c2cbc05b473cbb4b6850d (diff)
downloadblackbird-skiboot-aac13141c95022126d089aa4177a1f8467cd105f.tar.gz
blackbird-skiboot-aac13141c95022126d089aa4177a1f8467cd105f.zip
vas: Create MMIO device tree node
Create a device tree node for VAS and add properties that Linux will need to configure/use VAS. Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/vas.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/vas.c b/core/vas.c
index 24fe29e4..9fd7521b 100644
--- a/core/vas.c
+++ b/core/vas.c
@@ -321,6 +321,34 @@ static struct vas *alloc_vas(uint32_t chip_id, uint32_t vas_id, uint64_t base)
return vas;
}
+static void create_mm_dt_node(struct proc_chip *chip)
+{
+ struct dt_node *dn;
+ struct vas *vas;
+ uint64_t hvwc_start, hvwc_len;
+ uint64_t uwc_start, uwc_len;
+ uint64_t pbar_start, pbar_len;
+ uint64_t pbf_start, pbf_nbits;
+
+ vas = chip->vas;
+ get_hvwc_mmio_bar(chip->id, &hvwc_start, &hvwc_len);
+ get_uwc_mmio_bar(chip->id, &uwc_start, &uwc_len);
+ get_paste_bar(chip->id, &pbar_start, &pbar_len);
+ get_paste_bitfield(&pbf_start, &pbf_nbits);
+
+ dn = dt_new_addr(dt_root, "vas", hvwc_start);
+
+ dt_add_property_strings(dn, "compatible", "ibm,power9-vas",
+ "ibm,vas");
+
+ dt_add_property_u64s(dn, "reg", hvwc_start, hvwc_len,
+ uwc_start, uwc_len,
+ pbar_start, pbar_len,
+ pbf_start, pbf_nbits);
+
+ dt_add_property(dn, "ibm,vas-id", &vas->vas_id, sizeof(vas->vas_id));
+}
+
/*
* Disable one VAS instance.
*
@@ -364,6 +392,8 @@ static int init_vas_inst(struct dt_node *np)
init_rma(chip))
return -1;
+ create_mm_dt_node(chip);
+
prlog(PR_INFO, "VAS: Initialized chip %d\n", chip->id);
return 0;
OpenPOWER on IntegriCloud