Skip to content

Commit

Permalink
phb3/phb4/p7ioc: Document supported TCE sizes in DT
Browse files Browse the repository at this point in the history
Add a new property, "ibm,supported-tce-sizes", to advertise to Linux how
big the available TCE sizes are.  Each value is a bit shift, from
smallest to largest.

Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
ruscur authored and stewartsmith committed Feb 20, 2018
1 parent ac8a62b commit 08b1929
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hw/p7ioc-phb.c
Expand Up @@ -2596,6 +2596,11 @@ static void p7ioc_pcie_add_node(struct p7ioc_phb *p)
tkill = reg[0] + PHB_TCE_KILL;
dt_add_property_cells(np, "ibm,opal-tce-kill",
hi32(tkill), lo32(tkill));
dt_add_property_cells(np, "ibm,supported-tce-sizes",
12, // 4K
16, // 64K
24, // 16M
34); // 16G

/*
* Linux may use this property to allocate the diag data buffer, which
Expand Down
5 changes: 5 additions & 0 deletions hw/phb3.c
Expand Up @@ -4469,6 +4469,11 @@ static void phb3_add_properties(struct phb3 *p)
tkill = reg + PHB_TCE_KILL;
dt_add_property_cells(np, "ibm,opal-tce-kill",
hi32(tkill), lo32(tkill));
dt_add_property_cells(np, "ibm,supported-tce-sizes",
12, // 4K
16, // 64K
24, // 16M
28); // 256M

/*
* Indicate to Linux that the architected IODA2 MSI EOI method
Expand Down
5 changes: 5 additions & 0 deletions hw/phb4.c
Expand Up @@ -4708,6 +4708,11 @@ static void phb4_add_properties(struct phb4 *p)
/* M64 ranges start at 1 as MBT0 is used for M32 */
dt_add_property_cells(np, "ibm,opal-available-m64-ranges",
1, p->mbt_size - 1);
dt_add_property_cells(np, "ibm,supported-tce-sizes",
12, // 4K
16, // 64K
21, // 2M
30); // 1G

/* Tell Linux about alignment limits for segment splits.
*
Expand Down

0 comments on commit 08b1929

Please sign in to comment.