fsi: aspeed: Enable 23-bit addressing
authorEddie James <eajames@linux.ibm.com>
Thu, 9 Jul 2020 19:17:43 +0000 (14:17 -0500)
committerJoel Stanley <joel@jms.id.au>
Thu, 10 Sep 2020 02:52:46 +0000 (12:22 +0930)
In order to access more than the second hub link, 23-bit addressing is
required. The core provides the highest two bits of address as the slave
ID to the master.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
drivers/fsi/fsi-master-aspeed.c

index f49742b..b49dccf 100644 (file)
@@ -241,9 +241,10 @@ static int aspeed_master_read(struct fsi_master *master, int link,
        struct fsi_master_aspeed *aspeed = to_fsi_master_aspeed(master);
        int ret;
 
-       if (id != 0)
+       if (id > 0x3)
                return -EINVAL;
 
+       addr |= id << 21;
        addr += link * FSI_HUB_LINK_SIZE;
 
        switch (size) {
@@ -273,9 +274,10 @@ static int aspeed_master_write(struct fsi_master *master, int link,
        struct fsi_master_aspeed *aspeed = to_fsi_master_aspeed(master);
        int ret;
 
-       if (id != 0)
+       if (id > 0x3)
                return -EINVAL;
 
+       addr |= id << 21;
        addr += link * FSI_HUB_LINK_SIZE;
 
        switch (size) {