Skip to contentSkip to conversation

fsi: aspeed: Enable 23-bit addressing

PATCH In review Eddie James 3 participants 3 messages Mar 11, 2020 – Apr 1, 2020

Subsystems (2)
lore
Share & tools
lore

Eddie James

author maintainer
#0 lore raw

PATCH 1/1 fsi: aspeed: Enable 23-bit addressing

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.

---
 drivers/fsi/fsi-master-aspeed.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/fsi/fsi-master-aspeed.c +4 -2
index 12e48f6..90c2e4e 100644
@@ -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) {
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw

Hi Eddie,

Quoted 3 lines

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.

Looks good, this is just the reverse of the encoding we set up in fsi_slave_calc_addr().

[I assume that the opb area is large enough for the 23-bit addressing...]

Cheers,

Jeremy

maintainer
#2 lore raw
Quoted 11 lines · Jeremy Kerr

Hi Eddie,

Quoted 3 lines

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.

Looks good, this is just the reverse of the encoding we set up in fsi_slave_calc_addr().

Thanks Jeremy.

Quoted 2 lines

[I assume that the opb area is large enough for the 23-bit addressing...]

On the AST2600 the AHB to OPB bridge sets the OBP base address to 0xa0000000, so we have plenty of address space to use. Is that what you're referring to, or have I misunderstood?

Cheers,

Joel