GP10B uses the same 3D class as GP100.
Signed-off-by: Alexandre Courbot
---
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 3e4c4f44ba92
GP10B's secboot is largely similar to GM20B's. Only differences are MC
base address and the fact that GPCCS is also securely managed.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 1 +
drm/nouveau/nvkm/subdev/secboot/Kbuild| 1 +
drm/nouveau/n
ff-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/msgqueue.h| 4 +++-
drm/nouveau/nvkm/falcon/msgqueue.c | 7 ---
drm/nouveau/nvkm/falcon/msgqueue.h | 6 --
drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c | 3 ++-
drm/nouveau/nvkm/f
GP10B's FIFO is similar to GP100's, but only allows 512 channels.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/engine/fifo.h | 1 +
drm/nouveau/nvkm/engine/fifo/Kbuild| 1 +
drm/nouveau/nvkm/engine/fifo/gk104.h | 1 +
drm/nouveau/nvkm/engine/fifo/gp100.c |
GP10B requires a specific initialization sequence due to the absence of
devinit.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/ibus.h | 1 +
drm/nouveau/nvkm/subdev/ibus/Kbuild| 1 +
drm/nouveau/nvkm/subdev/ibus/gp10b.c | 59 ++
3
Allow the MC base address to be specified as an argument for the WPR
region reading function. GP10B uses a different address layout as GM20B,
so this is necessary. Also export the function to be used by GP10B.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.h | 3
The GP10B firmware is very close to GM20B's. The only difference is that
it supports booting multiple falcons. In order to avoid having too much
functions and structures shared, implement its support in the same
source file as GM20B firmware.
Signed-off-by: Alexandre Courbot
---
drm/no
The LS firmware post-run hook is the right place to start said LS
firmware. Moving it here also allows to remove special handling in the
ACR code.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 46
.../nvkm/subdev/secboot
A LS post-run hook can meet an error meaning the failure of secure boot.
Make sure this can be reported.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 6 --
drm/nouveau/nvkm/subdev/secboot/acr_r352.h | 2 +-
drm/nouveau/nvkm/subdev
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/engine/device/base.c | 24
1 file changed, 24 insertions(+)
diff --git a/drm/nouveau/nvkm/engine/device/base.c
b/drm/nouveau/nvkm/engine/device/base.c
index ffd7d09ed3ac..ad8f4092c5aa 100644
--- a/drm/nouveau/nvkm
GP10B's FB is largely compatible with the GP100 implementation, and only
requires a few additional register inits.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/fb.h | 1 +
drm/nouveau/nvkm/subdev/fb/Kbuild| 1 +
drm/nouveau/nvkm/subdev/fb/gp10b.c
GP10B is the chip used in Tegra X2 SoCs. This patchset adds support for
its base engines after reworking secboot a bit to accomodate its calling
convention better.
This patchset has been tested rendering simple off-screen buffers using Mesa
and yielded the expected result.
Alexandre Courbot (15
GP10B's power is managed by generic PM domains, so it does not require a
VDD regulator. Add this option into the chip function structure.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/tegra.h | 4
drm/nouveau/nouveau_platform.c | 2 ++
drm/nouveau
boot each falcons individually.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/msgqueue.h | 3 +--
drm/nouveau/include/nvkm/subdev/secboot.h | 2 +-
drm/nouveau/nvkm/engine/gr/gf100.c | 16 +---
drm/nouveau/nvkm/falcon/msgqueue.c | 25
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nouveau_platform.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/drm/nouveau/nouveau_platform.c b/drm/nouveau/nouveau_platform.c
index 49d9ba0e3c51..1ada186fab77 100644
--- a/drm/nouveau/nouveau_platform.c
+++ b/drm/nouveau
GR is similar to GP100, with a few unavailable registers.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/engine/gr.h | 1 +
drm/nouveau/nvkm/engine/gr/Kbuild| 1 +
drm/nouveau/nvkm/engine/gr/gf100.h | 4 +++
drm/nouveau/nvkm/engine/gr/gp100.c | 13 ++--
drm/nouveau
GP10B's MC is compatible with GP100's, but engines need to be explicitly
put out of ELPG during init.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/mc.h | 1 +
drm/nouveau/nvkm/subdev/mc/Kbuild| 1 +
drm/nouveau/nvkm/subdev/mc/gp100.c | 17 +++
We were returning PTR_ERR() on a NULL pointer, which obviously won't
work. nvkm_engine_ref() will return an error in case something went
wrong.
Signed-off-by: Alexandre Courbot
Reported-by: Dan Carpenter
---
drm/nouveau/nvkm/subdev/secboot/gp102.c | 3 ++-
1 file changed, 2 insertions(
On Sat, Mar 11, 2017 at 5:55 AM, Dan Carpenter wrote:
> Hello Alexandre Courbot,
>
> The patch 5429f82f3415: "drm/nouveau/secboot: add
> gp102/gp104/gp106/gp107 support" from Jan 26, 2017, leads to the
> following static checker warning:
>
> drivers/gpu/
The msgqueue pointer validity should be checked by its owner, not by the
msgqueue code itself to avoid this situation.
Signed-off-by: Alexandre Courbot
Reported-by: Julia Lawall
---
drm/nouveau/nvkm/engine/sec2/base.c | 7 +++
drm/nouveau/nvkm/falcon/msgqueue.c | 5 ++---
drm/nouveau/nvkm
it
seems to work like a charm.
Reviewed-by: Alexandre Courbot
Tested-by: Alexandre Courbot
Thanks,
Thierry
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
index a6a7fa0d7679..7f5244d57d2f 100644
--- a/drivers/gpu/d
Set a default error value in the mailbox 0 register so we can catch
cases where the secure boot binary fails early without being able to
report anything.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
diff
Allow users to clear interrupt flags.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/engine/falcon.h | 2 ++
drm/nouveau/nvkm/falcon/base.c | 6 ++
drm/nouveau/nvkm/falcon/v1.c | 17 +
3 files changed, 25 insertions(+), 0 deletions
Split the reset function into more meaningful and reusable ones.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 5 +-
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 78 +++
2 files changed, 58 insertions(+), 25 deletions(-)
diff --git a/drm
This hook can be removed if the function writing the HS
descriptor is aware of WPR settings. Let's do that as it allows us to
make the ACR descriptor structure private and save some code.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c
Generate the WPR descriptor closer to what RM does. In particular, set
the expected masks, and only set the ucode members on Tegra.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 21 -
1 file changed, 12 insertions(+), 9 deletions(-)
diff
needed.
The current hooks cover the external firmware loading as well as the
bootloader descriptor generation.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 239 -
drm/nouveau/nvkm/subdev/secboot/gm20b.c | 30 +++-
drm/nouveau/nvkm/subdev
The halt interrupt must be cleared after ACR is run, otherwise the LS
PMU firmware will not be able to run.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/secboot
consistent design.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 179 -
drm/nouveau/nvkm/subdev/secboot/gm20b.c | 43 ++
drm/nouveau/nvkm/subdev/secboot/priv.h | 71 --
3 files changed, 138 insertions(+), 155 deletions(-)
diff
Add a flag that can be set when declaring how a LS firmware should be
loaded. This allows us to remove falcon-specific code in the loader.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 10 --
drm/nouveau/nvkm/subdev/secboot/acr_r352.h | 2 ++
drm
The init() hook is called by the subdev's oneinit(). Rename it
accordingly to avoid confusion about the lifetime of objects allocated
in it.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/base.c | 4 ++--
drm/nouveau/nvkm/subdev/secboot/gm200.c | 4 ++--
drm/nouveau
Perform the zeroing of BL descriptors in the caller function instead of
trusting each generator will do it. This could avoid a few pulled hairs.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 4 ++--
drm/nouveau/nvkm/subdev/secboot/acr_r361.c | 2 --
2 files
ucode_header is not used anywhere, so just get rid of it.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c| 25 +---
drm/nouveau/nvkm/subdev/secboot/ls_ucode.h| 2 +--
drm/nouveau/nvkm/subdev/secboot/ls_ucode_gr.c | 2 +--
3 files changed
When the PMU firmware is present, the falcons it manages need to have
the lazy-bootstrap flag of their WPR header set so the ACR does not boot
them. Add support for this.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 4
drm/nouveau/nvkm/subdev/secboot
Since DMEM was initialized to zero, these fields went unnoticed. Add
them for safety.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 4
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
b/drm/nouveau
The WPR and LSB headers, used to generate the LS blob, may have a
different layout and sizes depending on the driver version they come
from. Abstract them and confine their use to driver-specific code.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c| 102
This was used only locally to one function and can be replaced by ad-hoc
variables.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 90 ---
1 file changed, 33 insertions(+), 57 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/secboot
Make sure we are not disturbed by spurious interrupts, as we poll the
halt bit anyway.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 7 +++
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/secboot/gm200.c
b/drm/nouveau
the PMU subdev. This will
make things more reusable and will allow us to close the loop with
the current falcon engine code - please just allow me a few more days
to finish this! :)
In the meantime, this code should be good to go and test.
Alexandre Courbot (18):
secboot: rename init() hook to
Recently trying to build nouveau.ko out of the kernel tree results in
the following error for me (in-kernel builds are fine):
uapi/drm/nouveau_drm.h:30:17: fatal error: drm.h: No such file or directory
This can be fixed by adding include/uapi/drm to the include path.
Signed-off-by: Alexandre
Add a fini() hook to the GR engine. This will be used by gf100+ to
properly release the FECS and GPCCS falcons.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/engine/gr/base.c | 10 ++
drm/nouveau/nvkm/engine/gr/priv.h | 1 +
2 files changed, 11 insertions(+), 0 deletions
gf100_gr_init_ctxctl() is basically two different functions (one for
use of internal firmware, the other for use of external firmware), but
its current layout makes it look more complex than it is. Split it to
better reflect that fact.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm
Since GR has moved to using the falcon library to start the falcons,
this function is not needed anymore.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 1 +-
drm/nouveau/nvkm/subdev/secboot/base.c| 15 +-
drm/nouveau/nvkm/subdev/secboot/gm200
Create instances for the FECS and GPCCS falcons and use the init() and
fini() hooks to reserve them for as long as GR controls them.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/engine/gr/gf100.c | 110 --
drm/nouveau/nvkm/engine/gr/gf100.h | 3 +-
2 files
Use the falcon library functions where relevant.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/pmu/gk20a.c | 33 +-
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/pmu/gk20a.c
b/drm/nouveau/nvkm/subdev/pmu
en secboot
and pmu is coming along with the actual gm20b PMU implementation, so
use this as a temporary solution.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/pmu.h | 1 +-
drm/nouveau/nvkm/engine/device/base.c | 1 +-
drm/nouveau/nvkm/subdev/pmu/Kbuild| 1 +-
drm/no
otherwise some FW will not work properly
* make IMEM/DMEM writing functions more robust
* move falcons instances into their owning subdev
* rework gk20a's PMU implementation and add dummy gm20b PMU driver
Alexandre Courbot (15):
core: constify nv*_printk macros
mc: add nvkm_mc_enabled()
Use the PMU constructor so that all base members (in particular the
falcon instance) are initialized properly.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/pmu/gk20a.c | 35 --
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/drm
Have an instance of nvkm_falcon in the PMU structure, ready to be used
by other subdevs (i.e. secboot).
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/pmu.h | 2 ++
drm/nouveau/nvkm/subdev/pmu/base.c| 4
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git
Some functions always succeed - change their return type to void and
remove the error-handling code in their caller.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/pmu/gk20a.c | 30 --
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/drm
Use the falcon library functions in secure boot. This removes a lot of
code and makes the secure boot flow easier to understand as no register
is directly accessed.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 4 +-
drm/nouveau/nvkm/subdev/secboot/base.c
Add a PMU constructor so implementations that extend the nvkm_pmu
structure can have all base members properly initialized.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/pmu/base.c | 21 +++--
drm/nouveau/nvkm/subdev/pmu/priv.h | 2 ++
2 files changed, 17
done by
engine/falcon.c need to be reimplemented. However this first step allows
to keep things simple and to discuss basic design.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/device.h | 1 +-
drm/nouveau/include/nvkm/engine/falcon.h | 65 +++-
drm/nouveau/nvkm
These functions should use the nvkm_secboot_falcon enum. Fix this.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 6 +++---
drm/nouveau/nvkm/subdev/secboot/base.c| 4 ++--
drm/nouveau/nvkm/subdev/secboot/priv.h| 4 ++--
3 files changed, 7 insertions
Constify the local variables declared in these macros so we can pass
const pointers to them.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/client.h | 4 ++--
drm/nouveau/include/nvkm/core/device.h | 2 +-
drm/nouveau/include/nvkm/core/subdev.h | 2 +-
3 files changed, 4
Add a function that allows us to query whether a given subdev is
currently enabled or not.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/mc.h | 1 +
drm/nouveau/nvkm/subdev/mc/base.c| 10 ++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drm
On Wed, Dec 7, 2016 at 6:53 PM, Michel Dänzer wrote:
> On 07/12/16 06:39 PM, Alexandre Courbot wrote:
>> On Fri, Dec 2, 2016 at 12:23 PM, Ilia Mirkin wrote:
>>> That's right -- nouveau currently requires 4k page sizes to work. This is a
>>> software limit
On Fri, Dec 2, 2016 at 12:23 PM, Ilia Mirkin wrote:
> That's right -- nouveau currently requires 4k page sizes to work. This is a
> software limitation, not a hardware one though.
Looking at the trace I wonder - is the limitation in Nouveau or in TTM?
>
>
> On Dec 1, 2016 5:13 PM, "Jeremy Linton
Oops, realized I made a last minute mistake - the following should be
squashed into this patch for proper behavior when secure boot is used.
Sorry for the inconvenience.
diff --git a/drm/nouveau/nvkm/falcon/base.c b/drm/nouveau/nvkm/falcon/base.c
index efef9fc63407..75663bd1f650 100644
--- a/drm/n
done by
engine/falcon.c need to be reimplemented. However this first step allows
to keep things simple and to discuss basic design.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/device.h | 3 +-
drm/nouveau/include/nvkm/engine/falcon.h | 77 +++-
drm/nouveau/nvkm
-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/engine/gr/gf100.c | 72 +--
drm/nouveau/nvkm/engine/gr/gf100.h | 2 +-
2 files changed, 25 insertions(+), 49 deletions(-)
diff --git a/drm/nouveau/nvkm/engine/gr/gf100.c
b/drm/nouveau/nvkm/engine/gr/gf100.c
index
Add a function that allows us to query whether a given subdev is
currently enabled or not.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/mc.h | 1 +
drm/nouveau/nvkm/subdev/mc/base.c| 10 ++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drm
gf100_gr_init_ctxctl() is basically two different functions (one for
use of internal firmware, the other for use of external firmware), but
its current layout makes it look more complex than it is. Split it to
better reflect that fact.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm
Use the definitions provided by the falcon library instead of
re-defining our own.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 12 +-
drm/nouveau/nvkm/engine/gr/gf100.c| 16
drm/nouveau/nvkm/engine/gr/gm200.c| 6 +--
drm/nouveau
Use the falcon library functions in secure boot. This removes a lot of
code and makes the secure boot flow easier to understand as no register
is directly accessed.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 3 +-
drm/nouveau/nvkm/subdev/secboot/base.c
Since GR has moved to using the falcon library to start the falcons,
this function is not needed anymore.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 1 +-
drm/nouveau/nvkm/subdev/secboot/base.c| 15 +--
drm/nouveau/nvkm/subdev/secboot/gm200
on library as an example.
Converting other engines is trivial and should make our use of falcons generally
safer.
Alexandre Courbot (8):
core: constify nv*_printk macros
mc: add nvkm_mc_enabled() function
core: add falcon library functions
secboot: use falcon library definitions
secboot:
Constify the local variables declared in these macros so we can pass
const pointers to them.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/client.h | 4 ++--
drm/nouveau/include/nvkm/core/device.h | 2 +-
drm/nouveau/include/nvkm/core/subdev.h | 2 +-
3 files changed, 4
Split the reset function into more meaningful and reusable ones.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/secboot.h | 3 +-
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 78 +++
2 files changed, 56 insertions(+), 25 deletions(-)
diff --git a/drm
new interface function to boot a given falcon using the PMU's ACR
unit.
Signed-off-by: Deepak Goyal
[acour...@nvidia.com: reorganize code]
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/pmu.h | 11 +-
drm/nouveau/nvkm/subdev/pmu/Kbuild| 1 +-
drm/nouveau/nvkm/s
Constify the local variables declared in these macros so we can pass
const pointers to them.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/client.h | 4 ++--
drm/nouveau/include/nvkm/core/device.h | 2 +-
drm/nouveau/include/nvkm/core/subdev.h | 2 +-
3 files changed, 4
The PMU firmware expects its version into this register.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/subdev/pmu.h | 1 +
drm/nouveau/nvkm/subdev/pmu/base.c | 1 +
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 3 +++
3 files changed, 5 insertions(+), 0 deletions
The halt interrupt must be cleared after ACR is run, otherwise the LS
PMU firmware will not be able to run.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 3 ++-
drm/nouveau/nvkm/subdev/secboot/base.c | 31 +++
drm/nouveau/nvkm/subdev
Add the ability for LS firmwares to declare a post-run hook that is
invoked right after the HS firmware is executed. This allows them to
e.g. write some initialization data into the falcon's DMEM.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c
MU message.
As we must preserve the old behavior to avoid breaking user-space, add a
few conditionals to the way falcons are reset.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 97 +++
1 file changed, 82 insertions(+), 15 deletions(-)
di
Make sure we are not disturbed by spurious interrupts, as we poll the
halt bit anyway.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 4
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/secboot/gm200.c
b/drm/nouveau/nvkm
Some PMU implementations (in particular the ones managed by secure
boot) may not have a reset() hook. Make sure we don't crash in that
case.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/pmu/base.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drm/no
boot bootstrap logic to be able to fall back to legacy behavior
if it turns out the boot falcon's LS firmware cannot be loaded.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr.h | 2 +-
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 61 +--
2
Add the PMU bootloader generator and PMU LS ops that will enable proper
PMU operation if the PMU falcon is designated as managed.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 80 +++-
1 file changed, 80 insertions(+), 0 deletions(-)
diff
Add nvkm_falcon_read_dmem() to read part of a falcon's DMEM into a
CPU-accessible buffer.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/falcon.h | 1 +
drm/nouveau/nvkm/core/falcon.c | 10 ++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --
Store the falcon's DMEM size in the secboot structure so it can be
retrieved later. This is needed to load the PMU LS firmware's argument
at the end of DMEM, where the LS firmware expects it to be.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr.h | 2 ++
d
When the PMU firmware is present, the falcons it manages need to have
the lazy-bootstrap flag of their WPR header set so the ACR does not boot
them. Add support for this.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 4
drm/nouveau/nvkm/subdev/secboot
Allow secboot to load a LS PMU firmware.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/Kbuild | 1 +-
drm/nouveau/nvkm/subdev/secboot/ls_ucode.h | 4 +-
drm/nouveau/nvkm/subdev/secboot/ls_ucode_pmu.c | 89 +++-
3 files changed, 93 insertions
Enable the PMU in GM20B, managed by secure boot.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/engine/device/base.c | 1 +
drm/nouveau/nvkm/subdev/secboot/gm20b.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/device/base.c
b/drm
Set a default error value in the mailbox 0 register so we can catch
cases where the secure boot binary fails early without being able to
report anything.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
diff
Add a constructor function that can be called by our gm200
implementation.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/pmu/base.c | 14 ++
drm/nouveau/nvkm/subdev/pmu/priv.h | 2 ++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drm/nouveau/nvkm
From: Deepak Goyal
Add support for the message format used by the GM20B signed PMU
firmware.
Signed-off-by: Deepak Goyal
[acour...@nvidia.com: reorganize code]
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/pmu/Kbuild| 2 +-
drm/nouveau/nvkm/subdev/pmu/base.c
Generate the WPR descriptor closer to what RM does. In particular, set
the expected masks, and only set the ucode members on Tegra.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 21 -
1 file changed, 12 insertions(+), 9 deletions(-)
diff
ucode_header is not used anywhere, so just get rid of it.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c| 25 +---
drm/nouveau/nvkm/subdev/secboot/ls_ucode.h| 2 +--
drm/nouveau/nvkm/subdev/secboot/ls_ucode_gr.c | 2 +--
3 files changed
Since DMEM was initialized to zero, these fields went unnoticed. Add
them for safety.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 4
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/secboot/acr_r352.c
b/drm/nouveau
Perform the zeroing of BL descriptors in the caller function instead of
trusting each generator will do it. This could avoid a few pulled hairs.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 4 ++--
drm/nouveau/nvkm/subdev/secboot/acr_r361.c | 2 --
2 files
The WPR and LSB headers, used to generate the LS blob, may have a
different layout and sizes depending on the driver version they come
from. Abstract them and confine their use to driver-specific code.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c| 102
This was used only locally to one function and can be replaced by ad-hoc
variables.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 90 ---
1 file changed, 33 insertions(+), 57 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev/secboot
Add a flag that can be set when declaring how a LS firmware should be
loaded. This allows us to remove falcon-specific code in the loader.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 10 --
drm/nouveau/nvkm/subdev/secboot/acr_r352.h | 2 ++
drm
The init() hook is called by the subdev's oneinit(). Rename it
accordingly to avoid confusion about the lifetime of objects allocated
in it.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/base.c | 4 ++--
drm/nouveau/nvkm/subdev/secboot/gm200.c | 4 ++--
drm/nouveau
needed.
The current hooks cover the external firmware loading as well as the
bootloader descriptor generation.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 239 -
drm/nouveau/nvkm/subdev/secboot/gm20b.c | 29 +++-
drm/nouveau/nvkm/subdev
consistent design.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 177 -
drm/nouveau/nvkm/subdev/secboot/gm20b.c | 43 ++
drm/nouveau/nvkm/subdev/secboot/priv.h | 71 --
3 files changed, 137 insertions(+), 154 deletions(-)
diff
This hook can be removed if the function writing the HS
descriptor is aware of WPR settings. Let's do that as it allows us to
make the ACR descriptor structure private and save some code.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c
Replace the falcon loading functions with calls to the equivalent
functions of the falcon library.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/nvkm/subdev/secboot/gm200.c | 31 +++---
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/drm/nouveau/nvkm/subdev
code, plus IMEM and DMEM loading functions.
In addition to the library itself, this patch updates users of the
previously secure-boot only definitions to use the new global ones.
Signed-off-by: Alexandre Courbot
---
drm/nouveau/include/nvkm/core/falcon.h| 50 +++-
drm/nouveau
1 - 100 of 722 matches
Mail list logo