Re: amr64 acpipci(4)

2019-08-20 Thread Jonathan Gray
On Tue, Aug 20, 2019 at 08:49:19PM +0200, Mark Kettenis wrote:
> The Ampere/Lenvo HR330A firmware doesn't set the _TTP bit on the IO
> window of its host bridges.  It really should since these bridges
> translate memory transactions into io transactions.  But it isn't the
> only one that doesn't get this aspect right.  So it is probably best
> to ignore _TTP and just assume it converts memory transactions into io
> transactions.
> 
> ok?

ok jsg@

> 
> 
> Index: arch/arm64/dev/acpipci.c
> ===
> RCS file: /cvs/src/sys/arch/arm64/dev/acpipci.c,v
> retrieving revision 1.12
> diff -u -p -r1.12 acpipci.c
> --- arch/arm64/dev/acpipci.c  30 Jul 2019 21:44:15 -  1.12
> +++ arch/arm64/dev/acpipci.c  20 Aug 2019 18:43:15 -
> @@ -253,8 +253,10 @@ acpipci_parse_resources(int crsidx, unio
>   sc->sc_mem_trans = at;
>   break;
>   case LR_TYPE_IO:
> - if ((tflags & LR_IO_TTP) == 0)
> - return 0;
> + /*
> +  * Don't check _TTP as various firmwares don't set it,
> +  * even though they should!!
> +  */
>   extent_free(sc->sc_ioex, min, len, EX_WAITOK);
>   at = malloc(sizeof(struct acpipci_trans), M_DEVBUF, M_WAITOK);
>   at->at_iot = sc->sc_iot;
> 



amr64 acpipci(4)

2019-08-20 Thread Mark Kettenis
The Ampere/Lenvo HR330A firmware doesn't set the _TTP bit on the IO
window of its host bridges.  It really should since these bridges
translate memory transactions into io transactions.  But it isn't the
only one that doesn't get this aspect right.  So it is probably best
to ignore _TTP and just assume it converts memory transactions into io
transactions.

ok?


Index: arch/arm64/dev/acpipci.c
===
RCS file: /cvs/src/sys/arch/arm64/dev/acpipci.c,v
retrieving revision 1.12
diff -u -p -r1.12 acpipci.c
--- arch/arm64/dev/acpipci.c30 Jul 2019 21:44:15 -  1.12
+++ arch/arm64/dev/acpipci.c20 Aug 2019 18:43:15 -
@@ -253,8 +253,10 @@ acpipci_parse_resources(int crsidx, unio
sc->sc_mem_trans = at;
break;
case LR_TYPE_IO:
-   if ((tflags & LR_IO_TTP) == 0)
-   return 0;
+   /*
+* Don't check _TTP as various firmwares don't set it,
+* even though they should!!
+*/
extent_free(sc->sc_ioex, min, len, EX_WAITOK);
at = malloc(sizeof(struct acpipci_trans), M_DEVBUF, M_WAITOK);
at->at_iot = sc->sc_iot;