All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-5.4] fsi: aspeed: Enable 23-bit addressing
@ 2020-03-11 19:04 Eddie James
  2020-03-31  5:23 ` Jeremy Kerr
  0 siblings, 1 reply; 3+ messages in thread
From: Eddie James @ 2020-03-11 19:04 UTC (permalink / raw)
  To: openbmc; +Cc: joel, Eddie James

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>
---
 drivers/fsi/fsi-master-aspeed.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index 12e48f6..90c2e4e 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -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) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH linux dev-5.4] fsi: aspeed: Enable 23-bit addressing
  2020-03-11 19:04 [PATCH linux dev-5.4] fsi: aspeed: Enable 23-bit addressing Eddie James
@ 2020-03-31  5:23 ` Jeremy Kerr
  2020-04-01  6:27   ` Joel Stanley
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Kerr @ 2020-03-31  5:23 UTC (permalink / raw)
  To: Eddie James, openbmc

Hi Eddie,

> 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().

Acked-by: Jeremy Kerr <jk@ozlabs.org>

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

Cheers,


Jeremy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH linux dev-5.4] fsi: aspeed: Enable 23-bit addressing
  2020-03-31  5:23 ` Jeremy Kerr
@ 2020-04-01  6:27   ` Joel Stanley
  0 siblings, 0 replies; 3+ messages in thread
From: Joel Stanley @ 2020-04-01  6:27 UTC (permalink / raw)
  To: Jeremy Kerr; +Cc: Eddie James, OpenBMC Maillist

On Tue, 31 Mar 2020 at 05:23, Jeremy Kerr <jk@ozlabs.org> wrote:
>
> Hi Eddie,
>
> > 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().
>
> Acked-by: Jeremy Kerr <jk@ozlabs.org>

Thanks Jeremy.

> [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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-01  6:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-11 19:04 [PATCH linux dev-5.4] fsi: aspeed: Enable 23-bit addressing Eddie James
2020-03-31  5:23 ` Jeremy Kerr
2020-04-01  6:27   ` Joel Stanley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.