fsi: Fix one and two byte bus reads/writes

Address checker fixed to allow one and two byte reads/writes.
Address alignments for each size verified.

Signed-off-by: Edward James <[email protected]>
Signed-off-by: Christopher Bostic <[email protected]>
Acked-by: Jeremy Kerr <[email protected]>
Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Eddie James 2018-02-12 15:45:43 +10:30 • committed by Greg Kroah-Hartman
commit 99f039e97b

View file

@ -656,10 +656,13 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id)
/* FSI master support */
static int fsi_check_access(uint32_t addr, size_t size)
{
if (size != 1 && size != 2 && size != 4)
return -EINVAL;
if ((addr & 0x3) != (size & 0x3))
if (size == 4) {
if (addr & 0x3)
return -EINVAL;
} else if (size == 2) {
if (addr & 0x1)
return -EINVAL;
} else if (size != 1)
return -EINVAL;
return 0;