On Fri, Feb 24, 2017 at 1:11 PM, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote: > The ast driver configures a window to enable access into BMC > memory space in order to read some configuration registers. > > If this window is disabled, which it can be from the BMC side, > the ast driver can't function. > > Closing this window is a necessity for security if a machine's > host side and BMC side are controlled by different parties; > i.e. a cloud provider offering machines "bare metal". > > A recent patch went in to try to check if that window is open > but it does so by trying to access the registers in question > and testing if the result is 0xffffffff. > > This method will trigger a PCIe error when the window is closed > which on some systems will be fatal (it will trigger an EEH > for example on POWER which will take out the device). > > This patch improves this in two ways: > > - First, if the firmware has put properties in the device-tree > containing the relevant configuration information, we use these. > > - Otherwise, a bit in one of the SCU scratch registers (which > are readable via the VGA register space and writeable by the BMC) > will indicate if the BMC has closed the window. This bit has been > defined by Y.C Chen from Aspeed. > > If the window is closed and the configuration isn't available from > the device-tree, some sane defaults are used. Those defaults are > hopefully sufficient for standard video modes used on a server. > > Signed-off-by: Russell Currey <ruscur@xxxxxxxxxx> > Signed-off-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> > -- > > v2. [BenH] > - Reworked on top of Aspeed P2A patch > - Cleanup overall detection via a "config_mode" and log the > selected mode for diagnostics purposes > - Add a property for the SCU straps > > v3. [BenH] > - Moved the config mode detection to a separate functionn > - Add reading of SCU 0x40 D[12] to detect the window is > closed as to not trigger a bus error by just "trying". > (change provided by Y.C. Chen) > v4. [BenH] > - Only devices with the AST2000 PCI ID have a P2A bridge > - Update the P2A presence test to account for VGA only > mode as provided by Y.C. Chen. > v5. [BenH] > - Fixup prefix of OF properties based on Joel Stanley > review comments. LGTM. Thanks for the explaining the mcr regs, that stuff checks out now. Acked-by: Joel Stanley <joel@xxxxxxxxx> > --- > drivers/gpu/drm/ast/ast_drv.h | 6 +- > drivers/gpu/drm/ast/ast_main.c | 264 +++++++++++++++++++++++++---------------- > drivers/gpu/drm/ast/ast_post.c | 7 +- > 3 files changed, 168 insertions(+), 109 deletions(-) > _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel