diff options
author | Eddie James <eajames@linux.ibm.com> | 2020-05-20 13:17:07 -0500 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2020-09-10 12:22:49 +0930 |
commit | 196964a31cf8c4175fab28942071215e34f0a684 (patch) | |
tree | 0a5be8dfeb0654995e3729e806f9aad778280f62 /drivers/fsi | |
parent | b36875a453ef8cb429f5e1064a7329b751fd0dda (diff) |
fsi: core: Set slave local bus ownership during init
The driver ought to claim local bus ownership of the slave it's
communicating with.
This is for multi-master setups. The slave (in theory) will deny access
to masters who try to access the CFAM address space but who don't "own"
the bus.
As driver doesn't seem to perform any other teardown there is no need to
"un-claim" ownership at teardown. Also I'm not aware of any multi-master
setup using this driver so it shouldn't actually matter. Also, the
hardware doesn't seem to enforce this despite being required in the
specification...
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/fsi')
-rw-r--r-- | drivers/fsi/fsi-core.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index c9c3842f6e62..4e60e84cd17a 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -50,6 +50,7 @@ static const int engine_page_size = 0x400; #define FSI_SMODE 0x0 /* R/W: Mode register */ #define FSI_SISC 0x8 /* R/W: Interrupt condition */ #define FSI_SSTAT 0x14 /* R : Slave status */ +#define FSI_SLBUS 0x30 /* W : LBUS Ownership */ #define FSI_LLMODE 0x100 /* R/W: Link layer mode register */ /* @@ -67,6 +68,11 @@ static const int engine_page_size = 0x400; #define FSI_SMODE_LBCRR_MASK 0xf /* Clk ratio mask */ /* + * SLBUS fields + */ +#define FSI_SLBUS_FORCE 0x80000000 /* Force LBUS ownership */ + +/* * LLMODE fields */ #define FSI_LLMODE_ASYNC 0x1 @@ -981,7 +987,7 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) uint32_t cfam_id; struct fsi_slave *slave; uint8_t crc; - __be32 data, llmode; + __be32 data, llmode, slbus; int rc; /* Currently, we only support single slaves on a link, and use the @@ -1052,6 +1058,14 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) } + slbus = cpu_to_be32(FSI_SLBUS_FORCE); + rc = fsi_master_write(master, link, id, FSI_SLAVE_BASE + FSI_SLBUS, + &slbus, sizeof(slbus)); + if (rc) + dev_warn(&master->dev, + "can't set slbus on slave:%02x:%02x %d\n", link, id, + rc); + rc = fsi_slave_set_smode(slave); if (rc) { dev_warn(&master->dev, |